Files
code_tool_fly/VSCode-win32-x64-1.74.0/resources/app/extensions/ruby/syntaxes/ruby.tmLanguage.json
T

1 line
40 KiB
JSON
Raw Normal View History

2025-05-09 16:55:09 +08:00
{"information_for_contributors":["This file has been converted from https://github.com/textmate/ruby.tmbundle/blob/master/Syntaxes/Ruby.plist","If you want to provide a fix or improvement, please create a pull request against the original repository.","Once accepted there, we are happy to receive an update request."],"version":"https://github.com/textmate/ruby.tmbundle/commit/efcb8941c701343f1b2e9fb105c678152fea6892","name":"Ruby","scopeName":"source.ruby","comment":"\n\tTODO: unresolved issues\n\n\ttext:\n\t\"p <<end\n\tprint me!\n\tend\"\n\tsymptoms:\n\tnot recognized as a heredoc\n\tsolution:\n\tthere is no way to distinguish perfectly between the << operator and the start\n\tof a heredoc. Currently, we require assignment to recognize a heredoc. More\n\trefinement is possible.\n\t• Heredocs with indented terminators (<<-) are always distinguishable, however.\n\t• Nested heredocs are not really supportable at present\n\n\ttext:\n\tprint <<-'THERE' \n\tThis is single quoted. \n\tThe above used #{Time.now} \n\tTHERE \n\tsymtoms:\n\tFrom Programming Ruby p306; should be a non-interpolated heredoc.\n\t\n text:\n val?(a):p(b)\n val?'a':'b'\n symptoms:\n ':p' is recognized as a symbol.. its 2 things ':' and 'p'.\n :'b' has same problem.\n solution:\n ternary operator rule, precedence stuff, symbol rule.\n but also consider 'a.b?(:c)' ??\n","patterns":[{"captures":{"1":{"name":"keyword.control.class.ruby"},"2":{"name":"entity.name.type.class.ruby"},"3":{"name":"keyword.operator.other.ruby"},"4":{"name":"entity.other.inherited-class.ruby"},"5":{"name":"keyword.operator.other.ruby"},"6":{"name":"variable.other.object.ruby"}},"match":"^\\s*(class)\\s+(?:([.a-zA-Z0-9_:]+)(?:\\s*(<)\\s*([.a-zA-Z0-9_:]+))?|(<<)\\s*([.a-zA-Z0-9_:]+))","name":"meta.class.ruby"},{"captures":{"1":{"name":"keyword.control.module.ruby"},"2":{"name":"entity.name.type.module.ruby"},"3":{"name":"entity.other.inherited-class.module.first.ruby"},"4":{"name":"punctuation.separator.inheritance.ruby"},"5":{"name":"entity.other.inherited-class.module.second.ruby"},"6":{"name":"punctuation.separator.inheritance.ruby"},"7":{"name":"entity.other.inherited-class.module.third.ruby"},"8":{"name":"punctuation.separator.inheritance.ruby"}},"match":"^\\s*(module)\\s+(([A-Z]\\w*(::))?([A-Z]\\w*(::))?([A-Z]\\w*(::))*[A-Z]\\w*)","name":"meta.module.ruby"},{"comment":"else if is a common mistake carried over from other languages. it works if you put in a second end, but its never what you want.","match":"(?<!\\.)\\belse(\\s)+if\\b","name":"invalid.deprecated.ruby"},{"captures":{"1":{"name":"punctuation.definition.constant.ruby"}},"comment":"symbols as hash key (1.9 syntax)","match":"(?>[a-zA-Z_]\\w*(?>[?!])?)(:)(?!:)","name":"constant.other.symbol.hashkey.ruby"},{"captures":{"1":{"name":"punctuation.definition.constant.ruby"}},"comment":"symbols as hash key (1.8 syntax)","match":"(?<!:)(:)(?>[a-zA-Z_]\\w*(?>[?!])?)(?=\\s*=>)","name":"constant.other.symbol.hashkey.ruby"},{"comment":"everything being a reserved word, not a value and needing a 'end' is a..","match":"(?<!\\.)\\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\\b(?![?!])","name":"keyword.control.ruby"},{"comment":"contextual smart pair support for block parameters","match":"(?<!\\.)\\bdo\\b","name":"keyword.control.start-block.ruby"},{"comment":"contextual smart pair support","match":"(?<=\\{)(\\s+)","name":"meta.syntax.ruby.start-block"},{"match":"(?<!\\.)\\b(alias|alias_method|block_given[?]|break|defined[?]|iterator[?]|next|redo|retry|return|super|undef|yield)(\\b|(?<=[?]))(?![?!])","name":"keyword.control.pseudo-method.ruby"},{"match":"\\b(nil|true|false)\\b(?![?!])","name":"constant.language.ruby"},{"match":"\\b(__(dir|FILE|LINE)__)\\b(?![?!])","name":"variable.language.ruby"},{"begin":"^__END__\\n","captures":{"0":{"name":"string.unquoted.program-block.ruby"}},"comment":"__END__ marker","contentName":"text.plain","end":"(?=not)impossible","patterns":[{"begin":"(?=<?xml|<(?i:html\\b)|!DOCTYPE (?i:html\\b))","end":"(?=not