Created
January 24, 2009 00:24
-
-
Save subtleGradient/51281 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { scopeName = 'source.ruby.experimental'; | |
| foldingStartMarker = '(?x)^ | |
| (\s*+ | |
| (module|class|def | |
| |unless|if | |
| |case | |
| |begin | |
| |for|while|until | |
| |^=begin | |
| |( "(\\.|[^"])*+" # eat a double quoted string | |
| | ''(\\.|[^''])*+'' # eat a single quoted string | |
| | [^#"''] # eat all but comments and strings | |
| )* | |
| ( \s (do|begin|case) | |
| | (?<!\$)[-+=&|*/~%^<>~] \s*+ (if|unless) | |
| ) | |
| )\b | |
| (?! [^;]*+ ; .*? \bend\b ) | |
| |( "(\\.|[^"])*+" # eat a double quoted string | |
| | ''(\\.|[^''])*+'' # eat a single quoted string | |
| | [^#"''] # eat all but comments and strings | |
| )* | |
| ( \{ (?! [^}]*+ \} ) | |
| | \[ (?! [^\]]*+ \] ) | |
| ) | |
| ).*$ | |
| | [#] .*? \(fold\) \s*+ $ # Sune’s special marker | |
| '; | |
| foldingStopMarker = '(?x) | |
| ( (^|;) \s*+ end \s*+ ([#].*)? $ | |
| | (^|;) \s*+ end \. .* $ | |
| | ^ \s*+ [}\]] \s*+ ([#;,].*)? $ | |
| | [#] .*? \(end\) \s*+ $ # Sune’s special marker | |
| | ^=end | |
| )'; | |
| patterns = ( | |
| { name = 'meta.function-call.method.without-arguments.ruby'; | |
| begin = '(?<=[^\.]\.|::)(?=[a-zA-Z][a-zA-Z0-9_!?]*[^a-zA-Z0-9_!?])'; | |
| end = '(?<=[a-zA-Z0-9_!?])(?=[^a-zA-Z0-9_!?])'; | |
| patterns = ( | |
| { include = '#known_function_names'; }, | |
| { name = 'variable.other.constant.ruby'; | |
| match = '\b[A-Z]\w*\b'; | |
| }, | |
| { name = 'entity.name.function.ruby'; | |
| match = '([a-zA-Z][a-zA-Z0-9_!?]*)(?=[^a-zA-Z0-9_!?])'; | |
| }, | |
| ); | |
| }, | |
| { name = 'meta.function-call.method.with-arguments.ruby'; | |
| begin = '(?<=[^\.])(?=(\.|::)[a-zA-Z][a-zA-Z0-9_!?]*\()(\.|::)'; | |
| end = '(?<=[a-zA-Z0-9_!?])(?=\()'; | |
| beginCaptures = { 1 = { name = 'punctuation.separator.method.ruby'; }; }; | |
| patterns = ( | |
| { include = '#nest_function_parens'; }, | |
| { include = '#known_function_names'; }, | |
| { name = 'entity.name.function.ruby'; | |
| match = '([a-zA-Z][a-zA-Z0-9_!?]*)(?=\()'; | |
| }, | |
| ); | |
| }, | |
| { name = 'meta.function-call.ruby'; | |
| begin = '(?=[a-zA-Z][a-zA-Z0-9_!?]*\()'; | |
| end = '(?<=[a-zA-Z0-9_!?])(?=\()'; | |
| patterns = ( | |
| { include = '#nest_function_parens'; }, | |
| { include = '#known_function_names'; }, | |
| { name = 'entity.name.function.ruby'; | |
| match = '([a-zA-Z0-9_!?]+)(?=\()'; | |
| }, | |
| ); | |
| }, | |
| { comment = 'methods that are alone on a line without parens. EG: print "something"'; | |
| begin = '(^|(?<=[\{\(]))(?=\s*[a-zA-Z][a-zA-Z0-9_!?]+(?=\s+(?!\s*([\]\)\}\=\+\-\*\/\^\,\|]|<\s|<<\s))))'; | |
| end = '\s+|(?={)'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( | |
| { include = 'source.ruby'; }, | |
| { include = '#known_function_names'; }, | |
| { name = 'meta.function-call.ruby'; | |
| match = '[a-zA-Z][a-zA-Z0-9_!?]+(?=\{|\s+(?!\s*([\]\)\}\=\+\-\*\/\^\,\|]|<\s|<<\s)))'; | |
| captures = { 0 = { name = 'entity.name.function.ruby'; }; }; | |
| }, | |
| { include = '#leading-space'; }, | |
| ); | |
| applyEndPatternLast = 1; | |
| }, | |
| { name = 'string.unquoted.embedded.sql.ruby'; | |
| comment = 'SQL code in heredoc'; | |
| begin = '(?><<-SQL\b)'; | |
| end = '\s*SQL$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = 'source.sql'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { include = '#leading-space'; }, | |
| { include = '#source_ruby'; }, | |
| { name = 'variable.other.ruby'; | |
| comment = 'This is kindof experimental. There really is no way to perfectly match all regular variables, but you can pretty well assume that any normal word in certain curcumstances that havnt already been scoped as something else are probably variables, and the advantages beat the potential errors'; | |
| match = '((?<=\W)\b|^)\w+\b(?=\s*([\]\)\}\=\+\-\*\/\^\$\,\|]|<\s|<<\s|#|if|unless))'; | |
| }, | |
| { name = 'variable.other.ruby'; | |
| match = '(?<=^|[\s\{\(])[a-z][a-zA-Z0-9_]*(?=\.|\[)'; | |
| }, | |
| { name = 'variable.other.ruby'; | |
| match = '(?<=,|\s)[a-z][a-zA-Z0-9_]*\s*$'; | |
| }, | |
| ); | |
| repository = { | |
| escaped_char = { | |
| name = 'constant.character.escape.ruby'; | |
| match = '\\(?:0\d{1,2}|x[\da-fA-F]{1,2}|.)'; | |
| }; | |
| heredoc = { | |
| contentName = 'source.trailing-space.ruby'; | |
| begin = '<<-?(?:\w+|([''"]?).*?\1)'; | |
| end = '$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| patterns = ( | |
| { name = 'punctuation.definition.string.begin.ruby'; | |
| match = '<<-?(?:\w+|([''"]?).*?\1)'; | |
| }, | |
| { include = '$self'; }, | |
| ); | |
| }; | |
| interpolated_ruby = { | |
| patterns = ( | |
| { name = 'source.ruby.embedded.source'; | |
| match = '#\{(\})'; | |
| captures = { | |
| 0 = { name = 'punctuation.section.embedded.ruby'; }; | |
| 1 = { name = 'source.ruby.embedded.source.empty'; }; | |
| }; | |
| }, | |
| { name = 'source.ruby.embedded.source'; | |
| begin = '#\{'; | |
| end = '\}'; | |
| captures = { 0 = { name = 'punctuation.section.embedded.ruby'; }; }; | |
| patterns = ( | |
| { include = '#nest_curly_and_self'; }, | |
| { include = '$self'; }, | |
| ); | |
| }, | |
| { name = 'variable.other.readwrite.instance.ruby'; | |
| match = '(#@)[a-zA-Z_]\w*'; | |
| captures = { 1 = { name = 'punctuation.definition.variable.ruby'; }; }; | |
| }, | |
| { name = 'variable.other.readwrite.class.ruby'; | |
| match = '(#@@)[a-zA-Z_]\w*'; | |
| captures = { 1 = { name = 'punctuation.definition.variable.ruby'; }; }; | |
| }, | |
| { name = 'variable.other.readwrite.global.ruby'; | |
| match = '(#\$)[a-zA-Z_]\w*'; | |
| captures = { 1 = { name = 'punctuation.definition.variable.ruby'; }; }; | |
| }, | |
| ); | |
| }; | |
| known_function_names = { | |
| name = 'support.function.core.ruby'; | |
| comment = ' | |
| adding all the core methods here to provide a visual aid for spelling errors, | |
| as long as the current theme highlights [support.function] scopes. | |
| ie: if you miss type first as fisrt, then the word will not highlight.'; | |
| match = '\b(abort_on_exception=|absolute\?|acos!|acosh!|add!|add\?|alive\?|all\?|any\?|asin!|asinh!|async=|atan!|atan2!|atanh!|attributes=|autoload\?|avail_out=|beginning_of_line\?|between\?|block_given\?|blockdev\?|bol\?|capitalize!|casefold\?|changed\?|chardev\?|charset=|chomp!|chop!|close!|closed\?|closed_read\?|closed_write\?|codepage=|collect!|comment=|compact!|const_defined\?|coredump\?|cos!|cosh!|critical=|data=|dataType=|datetime_format=|debug\?|default=|delete!|delete\?|directory\?|dn=|downcase!|dst\?|egid=|eid=|empty\?|enclosed\?|end\?|ended\?|eof\?|eos\?|eql\?|eqn\?|equal\?|error\?|event\?|exclude_end\?|executable\?|executable_real\?|exist\?|exists\?|exit!|exited\?|euid=|exp!|extensions=|fatal\?|file\?|filter=|finished\?|finite\?|flatten!|fnmatch\?|fragment=|frozen\?|fu_have_symlink\?|fu_world_writable\?|gid=|gmt\?|gregorian_leap\?|groups=|grpowned\?|gsub!|has_key\?|has_value\?|headers=|hierarchical\?|host=|identical\?|include\?|infinite\?|info\?|input\?|instance_of\?|integer\?|is_a\?|iterator\?|julian_leap\?|key\?|kind_of\?|leap\?|level=|lineno=|locked\?|log!|log10!|log=|lstrip!|map!|match\?|matched\?|max=|maxgroups=|member\?|merge!|method_defined\?|mountpoint\?|multipart\?|mtime=|multipart\?|nan\?|new!|next!|next\?|nil\?|nodeTypedValue=|nodeValue=|nonzero\?|normalize!|ns\?|ondataavailable=|onreadystatechange=|ontransformnode=|opaque=|optional\?|orig_name=|os\?|output\?|owned\?|params=|password=|path=|pipe\?|pointer=|port=|pos=|power!|preserveWhiteSpace=|priority=|private_method_defined\?|proper_subset\?|proper_superset\?|protected_method_defined\?|public_method_defined\?|query=|re_exchangeable\?|readable\?|readable_real\?|registry=|regular\?|reject!|relative\?|resolveExternals=|respond_to\?|rest\?|retval\?|reverse!|root\?|rstrip!|run\?|run=|scheme=|scope=|secure=|setgid\?|setuid\?|sid_available\?|signaled\?|sin!|singular\?|sinh!|size\?|slice!|socket\?|sort!|sqrt!|square\?|squeeze!|sticky\?|stop\?|stopped\?|stream_end\?|string=|strip!|sub!|subset\?|succ!|success\?|superset\?|swapcase!|symlink\?|sync=|sync_point\?|tainted\?|tan!|tanh!|text=|to=|tr!|tr_s!|tty\?|typecode=|uid=|uniq!|upcase!|uptodate\?|url=|user=|userinfo=|utc\?|valid_civil\?|valid_commercial\?|valid_jd\?|valid_ordinal\?|valid_time\?|validateOnParse=|value=|value\?|visible\?|warn\?|writable\?|writable_real\?|zero\?)|\b(__getobj__|__id__|__init__|__send__|__setobj__|_dump|_getproperty|_id2ref|_invoke|_load|_setproperty|abbrev|abort_on_exception|abort|abs2|absoluteChildNumber|absolute|abs|acosh|acos|add_builtin_type|add_domain_type|add_finalizer|add_observer|add_private_type|add_ruby_type|add|adler32|adler|ajd_to_amjd|ajd_to_jd|ajd|a|all_symbols|all_waits|allocate|amjd_to_ajd|amjd|ancestorChildNumber|ancestors|angle|appendChild|appendData|append_features|args|arg|arity|asctime|asinh|asin|assoc|async|at_exit|atan2|atanh|atan|atime|attributes|at|autoload|avail_in|avail_out|b64encode|backtrace|baseName|basename|base|benchmark|binding|bind|binmode|blksize|blockquote|blocks|bmbm|bm|broadcast|build2|build|call_finalizer|callcc|caller|call|capitalize|caption|captures|casecmp|cd|ceil|center|change_privilege|changed|charset_map|charset|chdir|check_until|checkbox_group|checkbox|check|childNodes|childNumber|children|chmod_R|chmod|chomp|chop|chown_R|chown|chroot|chr|civil_to_jd|civil|class_eval|class_name|class_variable_get|class_variable_set|class_variables|classify|class|cleanpath|clear|cloneNode|clone|close_read|close_write|close|cmp|codepage|coerce|collect2|collect|column_size|column_vector|column_vectors|columns|column|comment|commercial_to_jd|commercial|commit|compact|compare_by_row_vectors|compare_by|compare_file|compare_stream|compile|component_ary|component|concat|conj|conjugate|connect|const_get|const_load|const_missing|const_set|constants|conv|copy_entry|copy_file|copy_stream|copy|cosh|cos|count_observers|count|covector|cp_r|cp|crc32|crc_table|crc|createAttribute|createCDATASection|createComment|createDocumentFragment|createElement|createEntityReference|createNode|createProcessingInstruction|createTextNode|create_docfile|create_win32ole_makefile|critical|crypt|ctime|current|cwday|cweek|cwyear|dataType|data_type|data|datetime_format|day_fraction|day_fraction_to_time|day|debug|decode64|decode_b|decode|def_delegator|def_delegators|def_instance_delegator|def_instance_delegators|def_singleton_delegator|def_singleton_delegators|default_handler|default_port|default_proc|default|define_class|define_finalizer|define_define_define_instance_variables|define_method|define_method_missing|define_module|definition|deflate|deleteData|delete_at|delete_if|delete_observer|delete_observers|delete|denominator|depth|deq|detach|detect|detect_implicit|determinant|det|dev_major|dev_minor|dev|diagonal|difference|dir_foreach|dirname|disable|dispid|display|divide|divmod|div|dn|doctype|documentElement|downcase|downto|dump_stream|dump|dup|each2|each_byte|each_cons|each_document|each_entry|each_filename|each_index|each_key|each_line|each_node|each_object|each_pair|each_slice|each_value|each_with_index|each|eid|elements|emitter|enable|enclose|encode64|encode|end|england|enq|entities|entries|enum_cons|enum_for|enum_slice|enum_with_index|eof|erfc|erf|errno|errorCode|error|escapeElement|escapeHTML|escape|euid|eval|event_interface|exception|exclusive|exclusive_unlock|exec|exit_value|exitstatus|exit|expand_path|exp|extend_object|extended|extensions|extname|extract|failed|fail|fatal|fcntl|fetch|file_field|fileno|filepos|fill|filter|finalizers|find_all|find|finish|first|firstChild|flatten_merge|flatten|flock|floor|flush_next_in|flush_next_out|flush|fnmatch|for_fd|foreachline|foreach|fork|format|formatDate|formatIndex|formatNumber|formatTime|form|freeze|frexp|fsync|ftype|garbage_collect|gcdlcm|gcd|generate_args|generate_argtype|generate_argtypes|generate_class|generate_constants|generate_func_methods|generate_method_args_help|generate_method_body|generate_method_help|generate_methods|generate_method|generate_properties_with_args|generate_propget_methods|generate_propput_methods|generate_propputref_methods|generate|generic_parser|getAllResponseHeaders|getAttribute|getAttributeNode|getElementsByTagName|getNamedItem|getQualifiedItem|getResponseHeader|get_byte|getbyte|getch|getc|getegid|geteuid|getgid|getgm|getlocal|getpgid|getpgrp|getpriority|gets|getuid|getutc|getwd|gid|global_variables|glob|gmt_offset|gmtime|gmtoff|gm|grant_privilege|gregorian|grep|groups|group|gsub|guess1|guess2|guess_old|guess|guid|handler1|handler2|handler3|hasChildNodes|hasFeature|hash|header|helpcontext|helpfile|helpstring|hex|hidden|hour|html_escape|html|httpdate|hypot|h|iconv|id2name|identity|id|imag|image_button|image|img|implementation|im|included_modules|included|indexes|index|indices|induced_from|inflate|info|inherited|init_elements|initgroups|initialize_copy|inject|inner_product|ino|insertBefore|insertData|insert|inspect|install|instance_eval|instance_method|instance_methods|instance_variable_get|instance_variable_set|instance_variables|intern|intersection|inverse|inverse_from|invert|invkind|invoke|invoke_kind|inv|ioctl|isatty|isdst|iseuc|iso8601|issetugid|issjis|isutf8|italy|item|jd_to_ajd|jd_to_civil|jd_to_commercial|jd_to_ld|jd_to_mjd|jd_to_ordinal|jd_to_wday|jd|join_nowait|join|julian|kcode|kconv|keys|kill|lambda|lastChild|last_match|last|lchmod|lchown|lcm|ld_to_jd|ldexp|ld|length|level|lineno|linepos|(?<=\.)line|link|listup|list|ljust|ln_s|ln_sf|ln|loadXML|load_documents|load_file|load_stream|load|local_variables|localtime|local|lock|log10|log|lstat|lstrip|main|major_version|make_link|make_symlink|makedirs|map2|map|marshal_dump|marshal_load|matched|matched_size|matchedsize|match|maxgroups|max|mday|measure|members|memberwise|merge|message_message|method_added|method_missing|method_removed|method_undefined|methods|method|minor|minor_version|min|mjd_to_jd|mjd|mkdir_p|mkdir|mkpath|mktime|mode|module_eval|modulo|month|mon|move|mtime|multipart_form|must_C_version|mv|namespaceURI|name|navigate|nesting|new2|new_start|nextNode|nextSibling|next_wait|next|nitems|nkf|nlink|nodeFromID|nodeName|nodeType|nodeTypeString|nodeTypedValue|nodeValue|normalize|notationName|notations|notify_observers|now|num_waiting|numerator|object_id|object_maker|oct|offset_vtbl|offset|ole_classes|ole_free|ole_func_methods|ole_get_methods|ole_method|ole_method_help|ole_methods|ole_obj_help|ole_put_methods|ole_reference_count|ole_show_help|ole_type_detail|ole_type|oletypelib_name|on_event_with_outargs|on_event|ondataavailable|onreadystatechange|opendir|open|options|ordinal_to_jd|ordinal|orig_name|os_code|out|ownerDocument|pack|params|parentNode|parent|parseError|parse_documents|parse_file|parsed|parser|parse|partition|password|password_field|pass|path|peek|peep|pid|pipe|pointer|polar|popen|popup_menu|pop|post_match|pos|ppid|pre_match|prec_f|prec_i|prec|prefix|preserveWhiteSpace|pretty|previousSibling|printf|print|priority|private_class_method|private_instance_methods|private_methods|proc|progids|progid|protected_instance_methods|protected_methods|prune|publicId|public_class_method|public_instance_methods|public_methods|push|putc|puts|pwd|p|quick_emit|quote|quo|radio_button|radio_group|rand|rank|rassoc|raw_cookie|raw_cookie2|rdev_major|rdev_minor|rdev|rdiv|re_exchange|read_type_class|readchar|readlines|readline|readlink|readpartial|readyState|read|realpath|realtime|real|reason|reduce|regexp|rehash|reject|relative_path_from|remainder|removeAttribute|removeAttributeNode|removeChild|removeNamedItem|removeQualifiedItem|remove_class_variable|remove_const|remove_dir|remove_entry_secure|remove_entry|remove_file|remove_finalizer|remove_instance_variable|remove_method|remove|rename|reopen|replaceChild|replaceData|replace|request_uri|require|reset|resolveExternals|resolver|responseBody|responseStream|responseText|responseXML|rest_size|restore|restsize|rest|result|return_type_detail|return_type|return_vtype|reverse_each|reverse|rewind|rfc1123_date|rfc2822|rfc822|rid|rindex|rjust|rm_f|rm_rf|rm_r|rmdir|rmtree|rm|roots|root|round|route_from|route_to|row_size|row_vector|row_vectors|rows|row|rpower|rstrip|run|r|safe_level|safe_unlink|save(?!!)|scalar|scan_full|scan_until|scan|scope|scrolling_list|search_full|sec|seek|selectNodes|selectSingleNode|select|send|setAttribute|setAttributeNode|setNamedItem|setRequestHeader|set_attributes|set_backtrace|set_dictionary|set_dn|set_eoutvar|set_extensions|set_filter|set_fragment|set_headers|set_host|set_log|set_opaque|set_password|set_path|set_port|set_query|set_registry|set_scheme|set_scope|set_to|set_trace_func|set_typecode|set_user|set_userinfo|setegid|seteuid|setgid|setpgid|setpgrp|setpriority|setproperty|setregid|setresgid|setresuid|setreuid|setrgid|setruid|setsid|setuid|setup|shellwords|shift|signal|sin|singleton_method_added|singleton_method_removed|singleton_method_undefined|singleton_methods|sinh|size_opt_params|size_params|size|skip_until|skip|sleep|slice|sort_by|sort|source|specified|split|splitText|sprintf|sqrt|squeeze|srand|srcText|src_type|start|status|statusText|stat|step|stop_msg_stopsig|stop|store|strftime|string|strip|strptime|sub|submit|substringData|subtract|succ|success|sum|superclass|swapcase|switch|symlink|synchronize|sync|syscall|sysopen|sysread|sysseek|systemId|system|syswrite|tagName|tagurize|taint|tanh|tan|target|teardown|tell|terminate|termsig|test__invoke|test_bracket_equal_with_arg|test_class_to_s|test_const_CP_ACP|test_const_CP_MACCP|test_const_CP_OEMCP|test_const_CP_SYMBOL|test_const_CP_THREAD_ACP|test_const_CP_UTF7|test_const_CP_UTF8|test_convert_bignum|test_dispid|test_each|test_event|test_event_interface|test_get_win32ole_object|test_helpcontext|test_helpfile|test_helpstring|test_input|test_invoke_kind|test_invoke|test_name|test_no_exist_property|test_offset_vtbl|test_ole_func_methods|test_ole_get_methods|test_ole_invoke_with_named_arg|test_ole_invoke_with_named_arg_last|test_ole_method_help|test_ole_methods|test_ole_put_methods|test_ole_type|test_ole_type_detail|test_on_event|test_on_event2|test_on_event3|test_on_event4|test_openSchema|test_optional|test_output|test_return_type|test_return_type_detail|test_return_vtype|test_s_codepage|test_s_codepage_changed|test_s_codepage_set|test_s_connect|test_s_const_load|test_s_test_s_new_DCOM|test_s_new_from_clsid|test_s_ole_classes|test_s_progids|test_s_typelibs|test_setproperty|test_setproperty_bracket|test_setproperty_with_equal|test_src_type|test_to_s|test_typekind|test_value|test_variables|test_variant|test_visible|test|text_field|textarea|text|time_to_day_fraction|timeout|times|tmpdir|to_ary|to_a|to_enum|to_f|to_hash|to_int|to_io|to_i|to_mailtext|to_proc|to_rfc822text|to_r|to_set|to_str|to_sym|to_s|today|toeuc|tojis|tosjis|total_in|total_out|touch|toutf16|toutf8|tr_s|trace_var|trace|transaction|transfer|transformNode|transformNodeToObject|transpose|trap|truncate|try_implicit|try_lock|tr|tv_sec|tv_usec|typekind|typelibs|type|t|uid|umask|unbind|undef_method|undefine_finalizer|unescapeElement|unescapeHTML|unescape|ungetc|union|uniqueID|uniq|unknown|unlink|unlock|unpack|unscan|unshift|untaint|untrace_var|unused|upcase|update|upto|url_encode|url|use_registry|usec|userinfo|user|utc_offset|utc|utime|u|validateOnParse|values_at|values|value|variable_kind|variables|varkind|version|wait2|waitall|waitpid|waitpid2|wait|wakeup|warn|wday|wrap|write|xmlschema|xml|yday|year|yield|zero|zip|zlib_version|zone_offset|zone)\b'; | |
| }; | |
| leading-space = { | |
| patterns = ( | |
| { name = 'meta.leading-tabs'; | |
| begin = '^(?=(\t| ))'; | |
| end = '(?=[^\t\s]|\n)'; | |
| patterns = ( | |
| { match = '( )( )?( )?( )?( )?( )?( )?( )?( )?( )?( )?'; | |
| captures = { | |
| 1 = { name = 'meta.odd-tab.group1.spaces'; }; | |
| 2 = { name = 'meta.even-tab.group2.spaces'; }; | |
| 3 = { name = 'meta.odd-tab.group3.spaces'; }; | |
| 4 = { name = 'meta.even-tab.group4.spaces'; }; | |
| 5 = { name = 'meta.odd-tab.group5.spaces'; }; | |
| 6 = { name = 'meta.even-tab.group6.spaces'; }; | |
| 7 = { name = 'meta.odd-tab.group7.spaces'; }; | |
| 8 = { name = 'meta.even-tab.group8.spaces'; }; | |
| 9 = { name = 'meta.odd-tab.group9.spaces'; }; | |
| 10 = { name = 'meta.even-tab.group10.spaces'; }; | |
| 11 = { name = 'meta.odd-tab.group11.spaces'; }; | |
| }; | |
| }, | |
| { match = '(\t)(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?'; | |
| captures = { | |
| 1 = { name = 'meta.odd-tab.group1.tab'; }; | |
| 2 = { name = 'meta.even-tab.group2.tab'; }; | |
| 3 = { name = 'meta.odd-tab.group3.tab'; }; | |
| 4 = { name = 'meta.even-tab.group4.tab'; }; | |
| 5 = { name = 'meta.odd-tab.group5.tab'; }; | |
| 6 = { name = 'meta.even-tab.group6.tab'; }; | |
| 7 = { name = 'meta.odd-tab.group7.tab'; }; | |
| 8 = { name = 'meta.even-tab.group8.tab'; }; | |
| 9 = { name = 'meta.odd-tab.group9.tab'; }; | |
| 10 = { name = 'meta.even-tab.group10.tab'; }; | |
| 11 = { name = 'meta.odd-tab.group11.tab'; }; | |
| }; | |
| }, | |
| ); | |
| }, | |
| ); | |
| }; | |
| nest_brackets = { | |
| begin = '\['; | |
| end = '\]'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( { include = '#nest_brackets'; } ); | |
| }; | |
| nest_brackets_i = { | |
| begin = '\['; | |
| end = '\]'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_brackets_i'; }, | |
| ); | |
| }; | |
| nest_brackets_r = { | |
| begin = '\['; | |
| end = '\]'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( | |
| { include = '#regex_sub'; }, | |
| { include = '#nest_brackets_r'; }, | |
| ); | |
| }; | |
| nest_curly = { | |
| begin = '\{'; | |
| end = '\}'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( { include = '#nest_curly'; } ); | |
| }; | |
| nest_curly_and_self = { | |
| patterns = ( | |
| { begin = '\{'; | |
| end = '\}'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( { include = '#nest_curly_and_self'; } ); | |
| }, | |
| { include = '$self'; }, | |
| ); | |
| }; | |
| nest_curly_i = { | |
| begin = '\{'; | |
| end = '\}'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_curly_i'; }, | |
| ); | |
| }; | |
| nest_curly_r = { | |
| begin = '\{'; | |
| end = '\}'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( | |
| { include = '#regex_sub'; }, | |
| { include = '#nest_curly_r'; }, | |
| ); | |
| }; | |
| nest_function_parens = { | |
| contentName = 'meta.section.scope.ruby.experimental'; | |
| begin = '\('; | |
| end = '\)'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby.experimental'; }; }; | |
| patterns = ( | |
| { include = '#nest_function_parens'; }, | |
| { include = '$self'; }, | |
| ); | |
| }; | |
| nest_ltgt = { | |
| begin = '\<'; | |
| end = '\>'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( { include = '#nest_ltgt'; } ); | |
| }; | |
| nest_ltgt_i = { | |
| begin = '\<'; | |
| end = '\>'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_ltgt_i'; }, | |
| ); | |
| }; | |
| nest_ltgt_r = { | |
| begin = '\<'; | |
| end = '\>'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( | |
| { include = '#regex_sub'; }, | |
| { include = '#nest_ltgt_r'; }, | |
| ); | |
| }; | |
| nest_parens = { | |
| begin = '\('; | |
| end = '\)'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( { include = '#nest_parens'; } ); | |
| }; | |
| nest_parens_i = { | |
| begin = '\('; | |
| end = '\)'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_parens_i'; }, | |
| ); | |
| }; | |
| nest_parens_r = { | |
| begin = '\('; | |
| end = '\)'; | |
| captures = { 0 = { name = 'punctuation.section.scope.ruby'; }; }; | |
| patterns = ( | |
| { include = '#regex_sub'; }, | |
| { include = '#nest_parens_r'; }, | |
| ); | |
| }; | |
| regex_sub = { | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { name = 'string.regexp.arbitrary-repitition.ruby'; | |
| match = '(\{)\d+(,\d+)?(\})'; | |
| captures = { | |
| 1 = { name = 'punctuation.definition.arbitrary-repitition.ruby'; }; | |
| 3 = { name = 'punctuation.definition.arbitrary-repitition.ruby'; }; | |
| }; | |
| }, | |
| { name = 'string.regexp.character-class.ruby'; | |
| begin = '\[(?:\^?\])?'; | |
| end = '\]'; | |
| captures = { 0 = { name = 'punctuation.definition.character-class.ruby'; }; }; | |
| patterns = ( { include = '#escaped_char'; } ); | |
| }, | |
| { name = 'string.regexp.group.ruby'; | |
| begin = '\('; | |
| end = '\)'; | |
| captures = { 0 = { name = 'punctuation.definition.group.ruby'; }; }; | |
| patterns = ( { include = '#regex_sub'; } ); | |
| }, | |
| { name = 'comment.line.number-sign.ruby'; | |
| comment = 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.'; | |
| match = '(?<=^|\s)(#)\s[[a-zA-Z0-9,. \t?!-][^\x{00}-\x{7F}]]*$'; | |
| captures = { 1 = { name = 'punctuation.definition.comment.ruby'; }; }; | |
| }, | |
| ); | |
| }; | |
| source_ruby = { | |
| patterns = ( | |
| { name = 'meta.class.ruby'; | |
| match = '^\s*(class)\s+(([.a-zA-Z0-9_:]+(\s*(<)\s*[.a-zA-Z0-9_:]+)?)|((<<)\s*[.a-zA-Z0-9_:]+))'; | |
| captures = { | |
| 1 = { name = 'keyword.control.class.ruby'; }; | |
| 2 = { name = 'entity.name.type.class.ruby'; }; | |
| 4 = { name = 'entity.other.inherited-class.ruby'; }; | |
| 5 = { name = 'punctuation.separator.inheritance.ruby'; }; | |
| 6 = { name = 'variable.other.object.ruby'; }; | |
| 7 = { name = 'punctuation.definition.variable.ruby'; }; | |
| }; | |
| }, | |
| { name = 'meta.module.ruby'; | |
| match = '^\s*(module)\s+(([A-Z]\w*(::))?([A-Z]\w*(::))?([A-Z]\w*(::))*[A-Z]\w*)'; | |
| 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'; }; | |
| }; | |
| }, | |
| { name = 'invalid.deprecated.ruby'; | |
| comment = 'else if is a common mistake carried over from other languages. it works if you put in a second end, but it’s never what you want.'; | |
| match = '(?<!\.)\belse(\s)+if\b'; | |
| }, | |
| { name = 'keyword.control.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.start-block.ruby'; | |
| comment = 'contextual smart pair support for block parameters'; | |
| match = '(?<!\.)\bdo\b\s*'; | |
| }, | |
| { name = 'meta.syntax.ruby.start-block'; | |
| comment = 'contextual smart pair support'; | |
| match = '(?<=\{)(\s+)'; | |
| }, | |
| { name = 'keyword.operator.logical.ruby'; | |
| comment = " as above, just doesn't need a 'end' and does a logic operation"; | |
| match = '(?<!\.)\b(and|not|or)\b'; | |
| }, | |
| { name = 'keyword.control.pseudo-method.ruby'; | |
| comment = ' just as above but being not a logical operation'; | |
| match = '(?<!\.)\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\b(?![?!])|\bdefined\?|\bblock_given\?'; | |
| }, | |
| { name = 'constant.language.ruby'; | |
| match = '\b(nil|true|false)\b(?![?!])'; | |
| }, | |
| { name = 'variable.language.ruby'; | |
| match = '\b(__(FILE|LINE)__|self)\b(?![?!])'; | |
| }, | |
| { name = 'keyword.other.special-method.ruby'; | |
| comment = ' everything being a method but having a special function is a..'; | |
| match = '\b(initialize|new|loop|include|extend|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|module_function|public|protected)\b(?![?!])'; | |
| }, | |
| { name = 'meta.require.ruby'; | |
| begin = '\b(require)\b'; | |
| end = '$|(?=#)'; | |
| captures = { 1 = { name = 'keyword.other.special-method.ruby'; }; }; | |
| patterns = ( { include = '$self'; } ); | |
| }, | |
| { name = 'variable.other.readwrite.instance.ruby'; | |
| match = '(@)[a-zA-Z_]\w*'; | |
| captures = { 1 = { name = 'punctuation.definition.variable.ruby'; }; }; | |
| }, | |
| { name = 'variable.other.readwrite.class.ruby'; | |
| match = '(@@)[a-zA-Z_]\w*'; | |
| captures = { 1 = { name = 'punctuation.definition.variable.ruby'; }; }; | |
| }, | |
| { name = 'variable.other.readwrite.global.ruby'; | |
| match = '(\$)[a-zA-Z_]\w*'; | |
| captures = { 1 = { name = 'punctuation.definition.variable.ruby'; }; }; | |
| }, | |
| { name = 'variable.other.readwrite.global.pre-defined.ruby'; | |
| match = '(\$)(!|@|&|`|''|\+|\d+|~|=|/|\\|,|;|\.|<|>|_|\*|\$|\?|:|"|-[0adFiIlpv])'; | |
| captures = { 1 = { name = 'punctuation.definition.variable.ruby'; }; }; | |
| }, | |
| { name = 'meta.environment-variable.ruby'; | |
| begin = '\b(ENV)\['; | |
| end = '\]'; | |
| beginCaptures = { 1 = { name = 'variable.other.constant.ruby'; }; }; | |
| patterns = ( { include = '$self'; } ); | |
| }, | |
| { name = 'support.class.ruby'; | |
| match = '\b[A-Z]\w*(?=((\.|::)[A-Za-z]|\[))'; | |
| }, | |
| { name = 'variable.other.constant.ruby'; | |
| match = '\b[A-Z]\w*\b'; | |
| }, | |
| { name = 'meta.function.method.with-arguments.ruby'; | |
| contentName = 'variable.parameter.function.ruby'; | |
| comment = 'the method pattern comes from the symbol pattern, see there for a explaination'; | |
| begin = '(?x) | |
| (?=def\b) # an optimization to help Oniguruma fail fast | |
| (?<=^|\s)(def)\s+ # the def keyword | |
| ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix | |
| (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name | |
| |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method | |
| \s*(\() # the openning parenthesis for arguments | |
| '; | |
| end = '\)'; | |
| beginCaptures = { | |
| 1 = { name = 'keyword.control.def.ruby'; }; | |
| 2 = { name = 'entity.name.function.ruby'; }; | |
| 3 = { name = 'punctuation.definition.parameters.ruby'; }; | |
| }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.parameters.ruby'; }; }; | |
| patterns = ( { include = '$self'; } ); | |
| }, | |
| { name = 'meta.function.method.with-arguments.ruby'; | |
| contentName = 'variable.parameter.function.ruby'; | |
| comment = 'same as the previous rule, but without parentheses around the arguments'; | |
| begin = '(?x) | |
| (?=def\b) # an optimization to help Oniguruma fail fast | |
| (?<=^|\s)(def)\s+ # the def keyword | |
| ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix | |
| (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name | |
| |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method | |
| [ \t] # the space separating the arguments | |
| (?=[ \t]*[^\s#]) # make sure arguments and not a comment follow | |
| '; | |
| end = '$'; | |
| beginCaptures = { | |
| 1 = { name = 'keyword.control.def.ruby'; }; | |
| 2 = { name = 'entity.name.function.ruby'; }; | |
| }; | |
| patterns = ( { include = '$self'; } ); | |
| }, | |
| { name = 'meta.function.method.without-arguments.ruby'; | |
| comment = ' the optional name is just to catch the def also without a method-name'; | |
| match = '(?x) | |
| (?=def\b) # an optimization to help Oniguruma fail fast | |
| (?<=^|\s)(def)\b # the def keyword | |
| ( \s+ # an optional group of whitespace followed by… | |
| ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix | |
| (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name | |
| |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) )? # …or an operator method | |
| '; | |
| captures = { | |
| 1 = { name = 'keyword.control.def.ruby'; }; | |
| 3 = { name = 'entity.name.function.ruby'; }; | |
| }; | |
| }, | |
| { name = 'constant.numeric.ruby'; | |
| match = '\b(0[xX]\h(?>_?\h)*|\d(?>_?\d)*(\.(?![^[:space:][:digit:]])(?>_?\d)*)?([eE][-+]?\d(?>_?\d)*)?|0[bB][01]+)\b'; | |
| }, | |
| { name = 'constant.other.symbol.single-quoted.ruby'; | |
| begin = ":'"; | |
| end = "'"; | |
| captures = { 0 = { name = 'punctuation.definition.constant.ruby'; }; }; | |
| patterns = ( | |
| { name = 'constant.character.escape.ruby'; | |
| match = '\\[''\\]'; | |
| }, | |
| ); | |
| }, | |
| { name = 'constant.other.symbol.double-quoted.ruby'; | |
| begin = ':"'; | |
| end = '"'; | |
| captures = { 0 = { name = 'punctuation.definition.constant.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.single.ruby'; | |
| comment = 'single quoted string (does not allow interpolation)'; | |
| begin = "'"; | |
| end = "'"; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { name = 'constant.character.escape.ruby'; | |
| match = '\\''|\\\\'; | |
| }, | |
| ); | |
| }, | |
| { name = 'string.quoted.double.ruby'; | |
| comment = 'double quoted string (allows for interpolation)'; | |
| begin = '"'; | |
| end = '"'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.interpolated.ruby'; | |
| comment = 'execute string (allows for interpolation)'; | |
| begin = '`'; | |
| end = '`'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.interpolated.ruby'; | |
| comment = 'execute string (allow for interpolation)'; | |
| begin = '%x\{'; | |
| end = '\}'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_curly_i'; }, | |
| ); | |
| }, | |
| { name = 'string.interpolated.ruby'; | |
| comment = 'execute string (allow for interpolation)'; | |
| begin = '%x\['; | |
| end = '\]'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_brackets_i'; }, | |
| ); | |
| }, | |
| { name = 'string.interpolated.ruby'; | |
| comment = 'execute string (allow for interpolation)'; | |
| begin = '%x\<'; | |
| end = '\>'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_ltgt_i'; }, | |
| ); | |
| }, | |
| { name = 'string.interpolated.ruby'; | |
| comment = 'execute string (allow for interpolation)'; | |
| begin = '%x\('; | |
| end = '\)'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_parens_i'; }, | |
| ); | |
| }, | |
| { name = 'string.interpolated.ruby'; | |
| comment = 'execute string (allow for interpolation)'; | |
| begin = '%x([^\w])'; | |
| end = '\1'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { contentName = 'string.regexp.classic.ruby'; | |
| comment = 'regular expressions (normal) | |
| we only start a regexp if the character before it (excluding whitespace) | |
| is what we think is before a regexp | |
| '; | |
| begin = '(?x) | |
| (?: | |
| ^ # beginning of line | |
| | (?<= # or look-behind on: | |
| [=>~(?:\[,|&;] | |
| | [\s;]if\s # keywords | |
| | [\s;]elsif\s | |
| | [\s;]while\s | |
| | [\s;]unless\s | |
| | [\s;]when\s | |
| | [\s;]assert_match\s | |
| | [\s;]or\s # boolean opperators | |
| | [\s;]and\s | |
| | [\s;]not\s | |
| | [\s.]index\s # methods | |
| | [\s.]scan\s | |
| | [\s.]sub\s | |
| | [\s.]sub!\s | |
| | [\s.]gsub\s | |
| | [\s.]gsub!\s | |
| | [\s.]match\s | |
| ) | |
| | (?<= # or a look-behind with line anchor: | |
| ^when\s # duplication necessary due to limits of regex | |
| | ^if\s | |
| | ^elsif\s | |
| | ^while\s | |
| | ^unless\s | |
| ) | |
| ) | |
| \s*((/))(?![*+{}?]) | |
| '; | |
| end = '((/[eimnosux]*))'; | |
| captures = { | |
| 1 = { name = 'string.regexp.classic.ruby'; }; | |
| 2 = { name = 'punctuation.definition.string.ruby'; }; | |
| }; | |
| patterns = ( { include = '#regex_sub'; } ); | |
| }, | |
| { name = 'string.regexp.mod-r.ruby'; | |
| comment = 'regular expressions (literal)'; | |
| begin = '%r\{'; | |
| end = '\}[eimnosux]*'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#regex_sub'; }, | |
| { include = '#nest_curly_r'; }, | |
| ); | |
| }, | |
| { name = 'string.regexp.mod-r.ruby'; | |
| comment = 'regular expressions (literal)'; | |
| begin = '%r\['; | |
| end = '\][eimnosux]*'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#regex_sub'; }, | |
| { include = '#nest_brackets_r'; }, | |
| ); | |
| }, | |
| { name = 'string.regexp.mod-r.ruby'; | |
| comment = 'regular expressions (literal)'; | |
| begin = '%r\('; | |
| end = '\)[eimnosux]*'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#regex_sub'; }, | |
| { include = '#nest_parens_r'; }, | |
| ); | |
| }, | |
| { name = 'string.regexp.mod-r.ruby'; | |
| comment = 'regular expressions (literal)'; | |
| begin = '%r\<'; | |
| end = '\>[eimnosux]*'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#regex_sub'; }, | |
| { include = '#nest_ltgt_r'; }, | |
| ); | |
| }, | |
| { name = 'string.regexp.mod-r.ruby'; | |
| comment = 'regular expressions (literal)'; | |
| begin = '%r([^\w])'; | |
| end = '\1[eimnosux]*'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( { include = '#regex_sub'; } ); | |
| }, | |
| { name = 'string.quoted.other.literal.upper.ruby'; | |
| comment = 'literal capable of interpolation ()'; | |
| begin = '%[QWSR]?\('; | |
| end = '\)'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_parens_i'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.other.literal.upper.ruby'; | |
| comment = 'literal capable of interpolation []'; | |
| begin = '%[QWSR]?\['; | |
| end = '\]'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_brackets_i'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.other.literal.upper.ruby'; | |
| comment = 'literal capable of interpolation <>'; | |
| begin = '%[QWSR]?\<'; | |
| end = '\>'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_ltgt_i'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.double.ruby.mod'; | |
| comment = 'literal capable of interpolation -- {}'; | |
| begin = '%[QWSR]?\{'; | |
| end = '\}'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| { include = '#nest_curly_i'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.other.literal.upper.ruby'; | |
| comment = 'literal capable of interpolation -- wildcard'; | |
| begin = '%[QWSR]([^\w])'; | |
| end = '\1'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.other.literal.other.ruby'; | |
| comment = 'literal capable of interpolation -- wildcard'; | |
| begin = '%([^\w\s=])'; | |
| end = '\1'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.other.literal.lower.ruby'; | |
| comment = 'literal incapable of interpolation -- ()'; | |
| begin = '%[qws]\('; | |
| end = '\)'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { name = 'constant.character.escape.ruby'; | |
| match = '\\\)|\\\\'; | |
| }, | |
| { include = '#nest_parens'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.other.literal.lower.ruby'; | |
| comment = 'literal incapable of interpolation -- <>'; | |
| begin = '%[qws]\<'; | |
| end = '\>'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { name = 'constant.character.escape.ruby'; | |
| match = '\\\>|\\\\'; | |
| }, | |
| { include = '#nest_ltgt'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.other.literal.lower.ruby'; | |
| comment = 'literal incapable of interpolation -- []'; | |
| begin = '%[qws]\['; | |
| end = '\]'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { name = 'constant.character.escape.ruby'; | |
| match = '\\\]|\\\\'; | |
| }, | |
| { include = '#nest_brackets'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.other.literal.lower.ruby'; | |
| comment = 'literal incapable of interpolation -- {}'; | |
| begin = '%[qws]\{'; | |
| end = '\}'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { name = 'constant.character.escape.ruby'; | |
| match = '\\\}|\\\\'; | |
| }, | |
| { include = '#nest_curly'; }, | |
| ); | |
| }, | |
| { name = 'string.quoted.other.literal.lower.ruby'; | |
| comment = 'literal incapable of interpolation -- wildcard'; | |
| begin = '%[qws]([^\w])'; | |
| end = '\1'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { comment = 'Cant be named because its not neccesarily an escape.'; | |
| match = '\\.'; | |
| }, | |
| ); | |
| }, | |
| { name = 'constant.other.symbol.ruby'; | |
| comment = 'symbols'; | |
| match = '(?<!:)(:)(?>[a-zA-Z_]\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?|@@?[a-zA-Z_]\w*)'; | |
| captures = { 1 = { name = 'punctuation.definition.constant.ruby'; }; }; | |
| }, | |
| { name = 'comment.block.documentation.ruby'; | |
| comment = 'multiline comments'; | |
| begin = '^=begin'; | |
| end = '^=end'; | |
| captures = { 0 = { name = 'punctuation.definition.comment.ruby'; }; }; | |
| }, | |
| { name = 'comment.line.number-sign.ruby'; | |
| match = '(?:^[ \t]+)?(#).*$\n?'; | |
| captures = { 1 = { name = 'punctuation.definition.comment.ruby'; }; }; | |
| }, | |
| { name = 'constant.numeric.ruby'; | |
| comment = ' | |
| matches questionmark-letters. | |
| examples (1st alternation = hex): | |
| ?\x1 ?\x61 | |
| examples (2nd alternation = octal): | |
| ?\0 ?\07 ?\017 | |
| examples (3rd alternation = escaped): | |
| ?\n ?\b | |
| examples (4th alternation = meta-ctrl): | |
| ?\C-a ?\M-a ?\C-\M-\C-\M-a | |
| examples (4th alternation = normal): | |
| ?a ?A ?0 | |
| ?* ?" ?( | |
| ?. ?# | |
| the negative lookbehind prevents against matching | |
| p(42.tainted?) | |
| '; | |
| match = '(?<!\w)\?(\\(x\h{1,2}(?!\h)\b|0[0-7]{0,2}(?![0-7])\b|[^x0MC])|(\\[MC]-)+\w|[^\s\\])'; | |
| }, | |
| { contentName = 'text.plain'; | |
| comment = '__END__ marker'; | |
| begin = '^__END__\n'; | |
| end = '(?=not)impossible'; | |
| captures = { 0 = { name = 'string.unquoted.program-block.ruby'; }; }; | |
| patterns = ( | |
| { name = 'text.html.embedded.ruby'; | |
| begin = '(?=<?xml|<(?i:html\b)|!DOCTYPE (?i:html\b))'; | |
| end = '(?=not)impossible'; | |
| patterns = ( { include = 'text.html.basic'; } ); | |
| }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.heredoc.ruby'; | |
| begin = '(?=(?>\=\s*<<(\w+))(?!\s+#\s*([Cc]|sh|[Jj]ava)))'; | |
| end = '^\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.heredoc.ruby'; | |
| begin = '(?=(?>\=\s*<<"([^"]*)")(?!\s+#\s*([Cc]|sh|[Jj]ava)))'; | |
| end = '^\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.embedded.html.ruby'; | |
| contentName = 'text.html.embedded.ruby'; | |
| comment = 'heredoc with embedded HTML and indented terminator'; | |
| begin = '(?><<-HTML\b)'; | |
| end = '\s*HTML$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = 'text.html.basic'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.embedded.sql.ruby'; | |
| contentName = 'text.sql.embedded.ruby'; | |
| comment = 'heredoc with embedded SQL and indented terminator'; | |
| begin = '(?><<-SQL\b)'; | |
| end = '\s*SQL$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = 'source.sql'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.embedded.ruby.ruby'; | |
| comment = 'ruby code in heredoc, interpolated'; | |
| begin = '(?><<-(["\\'']?)(\w+_(?i:eval))\1)'; | |
| end = '\s*\2$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = 'source.ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.heredoc.ruby'; | |
| comment = 'nested heredoc with indented terminator'; | |
| begin = '(?=(?><<-(\w+)).*(?><<-(\w+))+)'; | |
| end = '^\s*\2$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.heredoc.ruby'; | |
| comment = 'heredoc with indented terminator'; | |
| begin = '(?=(?><<-(\w+)))'; | |
| end = '^\s*\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.heredoc.ruby'; | |
| comment = 'heredoc with indented terminator'; | |
| begin = '(?=(?><<-"([^"]*)"))'; | |
| end = '^\s*\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.heredoc.ruby'; | |
| comment = 'heredoc, single quoted'; | |
| begin = "(?=(?>\=\s*<<'([^']*)')(?!\s+#\s*([Cc]|sh|[Jj]ava)))"; | |
| end = '^\s*\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { name = 'constant.character.escape.ruby'; | |
| match = '\\''|\\\\'; | |
| }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.heredoc.ruby'; | |
| comment = 'heredoc with indented terminator, single quoted'; | |
| begin = "(?=(?><<-'([^']*)'))"; | |
| end = '^\s*\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { name = 'constant.character.escape.ruby'; | |
| match = '\\''|\\\\'; | |
| }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.embedded.c.ruby'; | |
| begin = '(?>\=\s*<<(\w+))(?=\s+#\s*[Cc](?!(\+\+|[Ss][Ss])))'; | |
| end = '^\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = 'source.c'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.embedded.cplusplus.ruby'; | |
| begin = '(?>\=\s*<<(\w+))(?=\s+#\s*[Cc]\+\+)'; | |
| end = '^\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = 'source.c++'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.embedded.css.ruby'; | |
| begin = '(?>\=\s*<<(\w+))(?=\s+#\s*[Cc][Ss][Ss])'; | |
| end = '^\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = 'source.css'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.embedded.js.ruby'; | |
| begin = '(?>\=\s*<<(\w+))(?=\s+#\s*[Jj]ava[Ss]cript)'; | |
| end = '^\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = 'source.js'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { name = 'string.unquoted.embedded.shell.ruby'; | |
| begin = '(?>\=\s*<<(\w+))(?=\s+#\s*sh)'; | |
| end = '^\1$'; | |
| beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.ruby'; }; }; | |
| endCaptures = { 0 = { name = 'punctuation.definition.string.end.ruby'; }; }; | |
| patterns = ( | |
| { include = '#heredoc'; }, | |
| { include = 'source.shell'; }, | |
| { include = '#interpolated_ruby'; }, | |
| { include = '#escaped_char'; }, | |
| ); | |
| }, | |
| { begin = '(?<=\{|do|\{\s|do\s)(\|)'; | |
| end = '(\|)'; | |
| captures = { 1 = { name = 'punctuation.separator.variable.ruby'; }; }; | |
| patterns = ( | |
| { name = 'variable.other.block.ruby'; | |
| match = '[_a-zA-Z][_a-zA-Z0-9]*'; | |
| }, | |
| { name = 'punctuation.separator.variable.ruby'; | |
| match = ','; | |
| }, | |
| ); | |
| }, | |
| { name = 'punctuation.separator.key-value'; | |
| match = '=>'; | |
| }, | |
| { name = 'keyword.operator.assignment.augmented.ruby'; | |
| match = '<<=|%=|&=|\*=|\*\*=|\+=|\-=|\^=|\|{1,2}=|/=|<<'; | |
| }, | |
| { name = 'keyword.operator.comparison.ruby'; | |
| match = '<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \t])\?'; | |
| }, | |
| { name = 'keyword.operator.logical.ruby'; | |
| match = '(?<=[ \t])!+|\bnot\b|&&|\band\b|\|\||\bor\b|\^'; | |
| }, | |
| { name = 'keyword.operator.arithmetic.ruby'; | |
| match = '(%|&|\*\*|\*|\+|\-|/)'; | |
| }, | |
| { name = 'keyword.operator.assignment.ruby'; | |
| match = '='; | |
| }, | |
| { name = 'keyword.operator.other.ruby'; | |
| match = '\||~|>>'; | |
| }, | |
| { name = 'punctuation.separator.other.ruby'; | |
| match = ':'; | |
| }, | |
| { name = 'punctuation.separator.statement.ruby'; | |
| match = '\;'; | |
| }, | |
| { name = 'punctuation.separator.object.ruby'; | |
| match = ','; | |
| }, | |
| { name = 'punctuation.separator.method.ruby'; | |
| match = '\.|::'; | |
| }, | |
| { name = 'punctuation.section.scope.ruby'; | |
| match = '\{|\}'; | |
| }, | |
| { name = 'punctuation.section.array.ruby'; | |
| match = '\[|\]'; | |
| }, | |
| { name = 'punctuation.section.function.ruby'; | |
| match = '\(|\)'; | |
| }, | |
| ); | |
| }; | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <syntax name="source.ruby.experimental"> | |
| <zones> | |
| <zone name="meta.function-call.method.without-arguments.ruby"> | |
| <starts-with> | |
| <expression>(?<=[^\.]\.|::)(?=[a-zA-Z][a-zA-Z0-9_!?]*[^a-zA-Z0-9_!?])</expression> | |
| </starts-with> | |
| <ends-with> | |
| <expression>(?<=[a-zA-Z0-9_!?])(?=[^a-zA-Z0-9_!?])</expression> | |
| </ends-with> | |
| <subzones> | |
| <include collection="known_function_names"/> | |
| <zone name="variable.other.constant.ruby"> | |
| <expression>\b[A-Z]\w*\b</expression> | |
| </zone> | |
| <zone name="entity.name.function.ruby"> | |
| <expression>([a-zA-Z][a-zA-Z0-9_!?]*)(?=[^a-zA-Z0-9_!?])</expression> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone name="meta.function-call.method.with-arguments.ruby"> | |
| <starts-with> | |
| <expression>(?<=[^\.])(?=(\.|::)[a-zA-Z][a-zA-Z0-9_!?]*\()(\.|::)</expression> | |
| <capture number="1" name="punctuation.separator.method.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>(?<=[a-zA-Z0-9_!?])(?=\()</expression> | |
| </ends-with> | |
| <subzones> | |
| <include collection="nest_function_parens"/> | |
| <include collection="known_function_names"/> | |
| <zone name="entity.name.function.ruby"> | |
| <expression>([a-zA-Z][a-zA-Z0-9_!?]*)(?=\()</expression> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone name="meta.function-call.ruby"> | |
| <starts-with> | |
| <expression>(?=[a-zA-Z][a-zA-Z0-9_!?]*\()</expression> | |
| </starts-with> | |
| <ends-with> | |
| <expression>(?<=[a-zA-Z0-9_!?])(?=\()</expression> | |
| </ends-with> | |
| <subzones> | |
| <include collection="nest_function_parens"/> | |
| <include collection="known_function_names"/> | |
| <zone name="entity.name.function.ruby"> | |
| <expression>([a-zA-Z0-9_!?]+)(?=\()</expression> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone> | |
| <starts-with> | |
| <expression>(^|(?<=[\{\(]))(?=\s*[a-zA-Z][a-zA-Z0-9_!?]+(?=\s+(?!\s*([\]\)\}\=\+\-\*\/\^\,\|]|<\s|<<\s))))</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\s+|(?={)</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include syntax="source.ruby"/> | |
| <include collection="known_function_names"/> | |
| <zone name="meta.function-call.ruby"> | |
| <expression>[a-zA-Z][a-zA-Z0-9_!?]+(?=\{|\s+(?!\s*([\]\)\}\=\+\-\*\/\^\,\|]|<\s|<<\s)))</expression> | |
| <capture number="0" name="entity.name.function.ruby"/> | |
| </zone> | |
| <include collection="leading-space"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.embedded.sql.ruby"> | |
| <starts-with> | |
| <expression>(?><<-SQL\b)</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\s*SQL$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include collection="interpolated_ruby"/> | |
| <include syntax="source.sql"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <include collection="leading-space"/> | |
| <include collection="source_ruby"/> | |
| <zone name="variable.other.ruby"> | |
| <expression>((?<=\W)\b|^)\w+\b(?=\s*([\]\)\}\=\+\-\*\/\^\$\,\|]|<\s|<<\s|#|if|unless))</expression> | |
| </zone> | |
| <zone name="variable.other.ruby"> | |
| <expression>(?<=^|[\s\{\(])[a-z][a-zA-Z0-9_]*(?=\.|\[)</expression> | |
| </zone> | |
| <zone name="variable.other.ruby"> | |
| <expression>(?<=,|\s)[a-z][a-zA-Z0-9_]*\s*$</expression> | |
| </zone> | |
| </zones> | |
| <library> | |
| <collection name="escaped_char"> | |
| <zone name="constant.character.escape.ruby"> | |
| <expression>\\(?:0\d{1,2}|x[\da-fA-F]{1,2}|.)</expression> | |
| </zone> | |
| </collection> | |
| <collection name="heredoc"> | |
| <zone> | |
| <starts-with> | |
| <expression><<-?(?:\w+|(['"]?).*?\1)</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>$</expression> | |
| </ends-with> | |
| <subzones name="source.trailing-space.ruby"> | |
| <zone name="punctuation.definition.string.begin.ruby"> | |
| <expression><<-?(?:\w+|(['"]?).*?\1)</expression> | |
| </zone> | |
| <include syntax="$self"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="interpolated_ruby"> | |
| <zone name="source.ruby.embedded.source"> | |
| <expression>#\{(\})</expression> | |
| <capture number="0" name="punctuation.section.embedded.ruby"/> | |
| <capture number="1" name="source.ruby.embedded.source.empty"/> | |
| </zone> | |
| <zone name="source.ruby.embedded.source"> | |
| <starts-with> | |
| <expression>#\{</expression> | |
| <capture number="0" name="punctuation.section.embedded.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\}</expression> | |
| <capture number="0" name="punctuation.section.embedded.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="nest_curly_and_self"/> | |
| <include syntax="$self"/> | |
| </subzones> | |
| </zone> | |
| <zone name="variable.other.readwrite.instance.ruby"> | |
| <expression>(#@)[a-zA-Z_]\w*</expression> | |
| <capture number="1" name="punctuation.definition.variable.ruby"/> | |
| </zone> | |
| <zone name="variable.other.readwrite.class.ruby"> | |
| <expression>(#@@)[a-zA-Z_]\w*</expression> | |
| <capture number="1" name="punctuation.definition.variable.ruby"/> | |
| </zone> | |
| <zone name="variable.other.readwrite.global.ruby"> | |
| <expression>(#\$)[a-zA-Z_]\w*</expression> | |
| <capture number="1" name="punctuation.definition.variable.ruby"/> | |
| </zone> | |
| </collection> | |
| <collection name="known_function_names"> | |
| <zone name="support.function.core.ruby"> | |
| <expression>\b(abort_on_exception=|absolute\?|acos!|acosh!|add!|add\?|alive\?|all\?|any\?|asin!|asinh!|async=|atan!|atan2!|atanh!|attributes=|autoload\?|avail_out=|beginning_of_line\?|between\?|block_given\?|blockdev\?|bol\?|capitalize!|casefold\?|changed\?|chardev\?|charset=|chomp!|chop!|close!|closed\?|closed_read\?|closed_write\?|codepage=|collect!|comment=|compact!|const_defined\?|coredump\?|cos!|cosh!|critical=|data=|dataType=|datetime_format=|debug\?|default=|delete!|delete\?|directory\?|dn=|downcase!|dst\?|egid=|eid=|empty\?|enclosed\?|end\?|ended\?|eof\?|eos\?|eql\?|eqn\?|equal\?|error\?|event\?|exclude_end\?|executable\?|executable_real\?|exist\?|exists\?|exit!|exited\?|euid=|exp!|extensions=|fatal\?|file\?|filter=|finished\?|finite\?|flatten!|fnmatch\?|fragment=|frozen\?|fu_have_symlink\?|fu_world_writable\?|gid=|gmt\?|gregorian_leap\?|groups=|grpowned\?|gsub!|has_key\?|has_value\?|headers=|hierarchical\?|host=|identical\?|include\?|infinite\?|info\?|input\?|instance_of\?|integer\?|is_a\?|iterator\?|julian_leap\?|key\?|kind_of\?|leap\?|level=|lineno=|locked\?|log!|log10!|log=|lstrip!|map!|match\?|matched\?|max=|maxgroups=|member\?|merge!|method_defined\?|mountpoint\?|multipart\?|mtime=|multipart\?|nan\?|new!|next!|next\?|nil\?|nodeTypedValue=|nodeValue=|nonzero\?|normalize!|ns\?|ondataavailable=|onreadystatechange=|ontransformnode=|opaque=|optional\?|orig_name=|os\?|output\?|owned\?|params=|password=|path=|pipe\?|pointer=|port=|pos=|power!|preserveWhiteSpace=|priority=|private_method_defined\?|proper_subset\?|proper_superset\?|protected_method_defined\?|public_method_defined\?|query=|re_exchangeable\?|readable\?|readable_real\?|registry=|regular\?|reject!|relative\?|resolveExternals=|respond_to\?|rest\?|retval\?|reverse!|root\?|rstrip!|run\?|run=|scheme=|scope=|secure=|setgid\?|setuid\?|sid_available\?|signaled\?|sin!|singular\?|sinh!|size\?|slice!|socket\?|sort!|sqrt!|square\?|squeeze!|sticky\?|stop\?|stopped\?|stream_end\?|string=|strip!|sub!|subset\?|succ!|success\?|superset\?|swapcase!|symlink\?|sync=|sync_point\?|tainted\?|tan!|tanh!|text=|to=|tr!|tr_s!|tty\?|typecode=|uid=|uniq!|upcase!|uptodate\?|url=|user=|userinfo=|utc\?|valid_civil\?|valid_commercial\?|valid_jd\?|valid_ordinal\?|valid_time\?|validateOnParse=|value=|value\?|visible\?|warn\?|writable\?|writable_real\?|zero\?)|\b(__getobj__|__id__|__init__|__send__|__setobj__|_dump|_getproperty|_id2ref|_invoke|_load|_setproperty|abbrev|abort_on_exception|abort|abs2|absoluteChildNumber|absolute|abs|acosh|acos|add_builtin_type|add_domain_type|add_finalizer|add_observer|add_private_type|add_ruby_type|add|adler32|adler|ajd_to_amjd|ajd_to_jd|ajd|a|all_symbols|all_waits|allocate|amjd_to_ajd|amjd|ancestorChildNumber|ancestors|angle|appendChild|appendData|append_features|args|arg|arity|asctime|asinh|asin|assoc|async|at_exit|atan2|atanh|atan|atime|attributes|at|autoload|avail_in|avail_out|b64encode|backtrace|baseName|basename|base|benchmark|binding|bind|binmode|blksize|blockquote|blocks|bmbm|bm|broadcast|build2|build|call_finalizer|callcc|caller|call|capitalize|caption|captures|casecmp|cd|ceil|center|change_privilege|changed|charset_map|charset|chdir|check_until|checkbox_group|checkbox|check|childNodes|childNumber|children|chmod_R|chmod|chomp|chop|chown_R|chown|chroot|chr|civil_to_jd|civil|class_eval|class_name|class_variable_get|class_variable_set|class_variables|classify|class|cleanpath|clear|cloneNode|clone|close_read|close_write|close|cmp|codepage|coerce|collect2|collect|column_size|column_vector|column_vectors|columns|column|comment|commercial_to_jd|commercial|commit|compact|compare_by_row_vectors|compare_by|compare_file|compare_stream|compile|component_ary|component|concat|conj|conjugate|connect|const_get|const_load|const_missing|const_set|constants|conv|copy_entry|copy_file|copy_stream|copy|cosh|cos|count_observers|count|covector|cp_r|cp|crc32|crc_table|crc|createAttribute|createCDATASection|createComment|createDocumentFragment|createElement|createEntityReference|createNode|createProcessingInstruction|createTextNode|create_docfile|create_win32ole_makefile|critical|crypt|ctime|current|cwday|cweek|cwyear|dataType|data_type|data|datetime_format|day_fraction|day_fraction_to_time|day|debug|decode64|decode_b|decode|def_delegator|def_delegators|def_instance_delegator|def_instance_delegators|def_singleton_delegator|def_singleton_delegators|default_handler|default_port|default_proc|default|define_class|define_finalizer|define_define_define_instance_variables|define_method|define_method_missing|define_module|definition|deflate|deleteData|delete_at|delete_if|delete_observer|delete_observers|delete|denominator|depth|deq|detach|detect|detect_implicit|determinant|det|dev_major|dev_minor|dev|diagonal|difference|dir_foreach|dirname|disable|dispid|display|divide|divmod|div|dn|doctype|documentElement|downcase|downto|dump_stream|dump|dup|each2|each_byte|each_cons|each_document|each_entry|each_filename|each_index|each_key|each_line|each_node|each_object|each_pair|each_slice|each_value|each_with_index|each|eid|elements|emitter|enable|enclose|encode64|encode|end|england|enq|entities|entries|enum_cons|enum_for|enum_slice|enum_with_index|eof|erfc|erf|errno|errorCode|error|escapeElement|escapeHTML|escape|euid|eval|event_interface|exception|exclusive|exclusive_unlock|exec|exit_value|exitstatus|exit|expand_path|exp|extend_object|extended|extensions|extname|extract|failed|fail|fatal|fcntl|fetch|file_field|fileno|filepos|fill|filter|finalizers|find_all|find|finish|first|firstChild|flatten_merge|flatten|flock|floor|flush_next_in|flush_next_out|flush|fnmatch|for_fd|foreachline|foreach|fork|format|formatDate|formatIndex|formatNumber|formatTime|form|freeze|frexp|fsync|ftype|garbage_collect|gcdlcm|gcd|generate_args|generate_argtype|generate_argtypes|generate_class|generate_constants|generate_func_methods|generate_method_args_help|generate_method_body|generate_method_help|generate_methods|generate_method|generate_properties_with_args|generate_propget_methods|generate_propput_methods|generate_propputref_methods|generate|generic_parser|getAllResponseHeaders|getAttribute|getAttributeNode|getElementsByTagName|getNamedItem|getQualifiedItem|getResponseHeader|get_byte|getbyte|getch|getc|getegid|geteuid|getgid|getgm|getlocal|getpgid|getpgrp|getpriority|gets|getuid|getutc|getwd|gid|global_variables|glob|gmt_offset|gmtime|gmtoff|gm|grant_privilege|gregorian|grep|groups|group|gsub|guess1|guess2|guess_old|guess|guid|handler1|handler2|handler3|hasChildNodes|hasFeature|hash|header|helpcontext|helpfile|helpstring|hex|hidden|hour|html_escape|html|httpdate|hypot|h|iconv|id2name|identity|id|imag|image_button|image|img|implementation|im|included_modules|included|indexes|index|indices|induced_from|inflate|info|inherited|init_elements|initgroups|initialize_copy|inject|inner_product|ino|insertBefore|insertData|insert|inspect|install|instance_eval|instance_method|instance_methods|instance_variable_get|instance_variable_set|instance_variables|intern|intersection|inverse|inverse_from|invert|invkind|invoke|invoke_kind|inv|ioctl|isatty|isdst|iseuc|iso8601|issetugid|issjis|isutf8|italy|item|jd_to_ajd|jd_to_civil|jd_to_commercial|jd_to_ld|jd_to_mjd|jd_to_ordinal|jd_to_wday|jd|join_nowait|join|julian|kcode|kconv|keys|kill|lambda|lastChild|last_match|last|lchmod|lchown|lcm|ld_to_jd|ldexp|ld|length|level|lineno|linepos|(?<=\.)line|link|listup|list|ljust|ln_s|ln_sf|ln|loadXML|load_documents|load_file|load_stream|load|local_variables|localtime|local|lock|log10|log|lstat|lstrip|main|major_version|make_link|make_symlink|makedirs|map2|map|marshal_dump|marshal_load|matched|matched_size|matchedsize|match|maxgroups|max|mday|measure|members|memberwise|merge|message_message|method_added|method_missing|method_removed|method_undefined|methods|method|minor|minor_version|min|mjd_to_jd|mjd|mkdir_p|mkdir|mkpath|mktime|mode|module_eval|modulo|month|mon|move|mtime|multipart_form|must_C_version|mv|namespaceURI|name|navigate|nesting|new2|new_start|nextNode|nextSibling|next_wait|next|nitems|nkf|nlink|nodeFromID|nodeName|nodeType|nodeTypeString|nodeTypedValue|nodeValue|normalize|notationName|notations|notify_observers|now|num_waiting|numerator|object_id|object_maker|oct|offset_vtbl|offset|ole_classes|ole_free|ole_func_methods|ole_get_methods|ole_method|ole_method_help|ole_methods|ole_obj_help|ole_put_methods|ole_reference_count|ole_show_help|ole_type_detail|ole_type|oletypelib_name|on_event_with_outargs|on_event|ondataavailable|onreadystatechange|opendir|open|options|ordinal_to_jd|ordinal|orig_name|os_code|out|ownerDocument|pack|params|parentNode|parent|parseError|parse_documents|parse_file|parsed|parser|parse|partition|password|password_field|pass|path|peek|peep|pid|pipe|pointer|polar|popen|popup_menu|pop|post_match|pos|ppid|pre_match|prec_f|prec_i|prec|prefix|preserveWhiteSpace|pretty|previousSibling|printf|print|priority|private_class_method|private_instance_methods|private_methods|proc|progids|progid|protected_instance_methods|protected_methods|prune|publicId|public_class_method|public_instance_methods|public_methods|push|putc|puts|pwd|p|quick_emit|quote|quo|radio_button|radio_group|rand|rank|rassoc|raw_cookie|raw_cookie2|rdev_major|rdev_minor|rdev|rdiv|re_exchange|read_type_class|readchar|readlines|readline|readlink|readpartial|readyState|read|realpath|realtime|real|reason|reduce|regexp|rehash|reject|relative_path_from|remainder|removeAttribute|removeAttributeNode|removeChild|removeNamedItem|removeQualifiedItem|remove_class_variable|remove_const|remove_dir|remove_entry_secure|remove_entry|remove_file|remove_finalizer|remove_instance_variable|remove_method|remove|rename|reopen|replaceChild|replaceData|replace|request_uri|require|reset|resolveExternals|resolver|responseBody|responseStream|responseText|responseXML|rest_size|restore|restsize|rest|result|return_type_detail|return_type|return_vtype|reverse_each|reverse|rewind|rfc1123_date|rfc2822|rfc822|rid|rindex|rjust|rm_f|rm_rf|rm_r|rmdir|rmtree|rm|roots|root|round|route_from|route_to|row_size|row_vector|row_vectors|rows|row|rpower|rstrip|run|r|safe_level|safe_unlink|save(?!!)|scalar|scan_full|scan_until|scan|scope|scrolling_list|search_full|sec|seek|selectNodes|selectSingleNode|select|send|setAttribute|setAttributeNode|setNamedItem|setRequestHeader|set_attributes|set_backtrace|set_dictionary|set_dn|set_eoutvar|set_extensions|set_filter|set_fragment|set_headers|set_host|set_log|set_opaque|set_password|set_path|set_port|set_query|set_registry|set_scheme|set_scope|set_to|set_trace_func|set_typecode|set_user|set_userinfo|setegid|seteuid|setgid|setpgid|setpgrp|setpriority|setproperty|setregid|setresgid|setresuid|setreuid|setrgid|setruid|setsid|setuid|setup|shellwords|shift|signal|sin|singleton_method_added|singleton_method_removed|singleton_method_undefined|singleton_methods|sinh|size_opt_params|size_params|size|skip_until|skip|sleep|slice|sort_by|sort|source|specified|split|splitText|sprintf|sqrt|squeeze|srand|srcText|src_type|start|status|statusText|stat|step|stop_msg_stopsig|stop|store|strftime|string|strip|strptime|sub|submit|substringData|subtract|succ|success|sum|superclass|swapcase|switch|symlink|synchronize|sync|syscall|sysopen|sysread|sysseek|systemId|system|syswrite|tagName|tagurize|taint|tanh|tan|target|teardown|tell|terminate|termsig|test__invoke|test_bracket_equal_with_arg|test_class_to_s|test_const_CP_ACP|test_const_CP_MACCP|test_const_CP_OEMCP|test_const_CP_SYMBOL|test_const_CP_THREAD_ACP|test_const_CP_UTF7|test_const_CP_UTF8|test_convert_bignum|test_dispid|test_each|test_event|test_event_interface|test_get_win32ole_object|test_helpcontext|test_helpfile|test_helpstring|test_input|test_invoke_kind|test_invoke|test_name|test_no_exist_property|test_offset_vtbl|test_ole_func_methods|test_ole_get_methods|test_ole_invoke_with_named_arg|test_ole_invoke_with_named_arg_last|test_ole_method_help|test_ole_methods|test_ole_put_methods|test_ole_type|test_ole_type_detail|test_on_event|test_on_event2|test_on_event3|test_on_event4|test_openSchema|test_optional|test_output|test_return_type|test_return_type_detail|test_return_vtype|test_s_codepage|test_s_codepage_changed|test_s_codepage_set|test_s_connect|test_s_const_load|test_s_test_s_new_DCOM|test_s_new_from_clsid|test_s_ole_classes|test_s_progids|test_s_typelibs|test_setproperty|test_setproperty_bracket|test_setproperty_with_equal|test_src_type|test_to_s|test_typekind|test_value|test_variables|test_variant|test_visible|test|text_field|textarea|text|time_to_day_fraction|timeout|times|tmpdir|to_ary|to_a|to_enum|to_f|to_hash|to_int|to_io|to_i|to_mailtext|to_proc|to_rfc822text|to_r|to_set|to_str|to_sym|to_s|today|toeuc|tojis|tosjis|total_in|total_out|touch|toutf16|toutf8|tr_s|trace_var|trace|transaction|transfer|transformNode|transformNodeToObject|transpose|trap|truncate|try_implicit|try_lock|tr|tv_sec|tv_usec|typekind|typelibs|type|t|uid|umask|unbind|undef_method|undefine_finalizer|unescapeElement|unescapeHTML|unescape|ungetc|union|uniqueID|uniq|unknown|unlink|unlock|unpack|unscan|unshift|untaint|untrace_var|unused|upcase|update|upto|url_encode|url|use_registry|usec|userinfo|user|utc_offset|utc|utime|u|validateOnParse|values_at|values|value|variable_kind|variables|varkind|version|wait2|waitall|waitpid|waitpid2|wait|wakeup|warn|wday|wrap|write|xmlschema|xml|yday|year|yield|zero|zip|zlib_version|zone_offset|zone)\b</expression> | |
| </zone> | |
| </collection> | |
| <collection name="leading-space"> | |
| <zone name="meta.leading-tabs"> | |
| <starts-with> | |
| <expression>^(?=(\t| ))</expression> | |
| </starts-with> | |
| <ends-with> | |
| <expression>(?=[^\t\s]|\n)</expression> | |
| </ends-with> | |
| <subzones> | |
| <zone> | |
| <expression>( )( )?( )?( )?( )?( )?( )?( )?( )?( )?( )?</expression> | |
| <capture number="1" name="meta.odd-tab.group1.spaces"/> | |
| <capture number="10" name="meta.even-tab.group10.spaces"/> | |
| <capture number="11" name="meta.odd-tab.group11.spaces"/> | |
| <capture number="2" name="meta.even-tab.group2.spaces"/> | |
| <capture number="3" name="meta.odd-tab.group3.spaces"/> | |
| <capture number="4" name="meta.even-tab.group4.spaces"/> | |
| <capture number="5" name="meta.odd-tab.group5.spaces"/> | |
| <capture number="6" name="meta.even-tab.group6.spaces"/> | |
| <capture number="7" name="meta.odd-tab.group7.spaces"/> | |
| <capture number="8" name="meta.even-tab.group8.spaces"/> | |
| <capture number="9" name="meta.odd-tab.group9.spaces"/> | |
| </zone> | |
| <zone> | |
| <expression>(\t)(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?</expression> | |
| <capture number="1" name="meta.odd-tab.group1.tab"/> | |
| <capture number="10" name="meta.even-tab.group10.tab"/> | |
| <capture number="11" name="meta.odd-tab.group11.tab"/> | |
| <capture number="2" name="meta.even-tab.group2.tab"/> | |
| <capture number="3" name="meta.odd-tab.group3.tab"/> | |
| <capture number="4" name="meta.even-tab.group4.tab"/> | |
| <capture number="5" name="meta.odd-tab.group5.tab"/> | |
| <capture number="6" name="meta.even-tab.group6.tab"/> | |
| <capture number="7" name="meta.odd-tab.group7.tab"/> | |
| <capture number="8" name="meta.even-tab.group8.tab"/> | |
| <capture number="9" name="meta.odd-tab.group9.tab"/> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_brackets"> | |
| <zone> | |
| <starts-with> | |
| <expression>\[</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\]</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="nest_brackets"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_brackets_i"> | |
| <zone> | |
| <starts-with> | |
| <expression>\[</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\]</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_brackets_i"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_brackets_r"> | |
| <zone> | |
| <starts-with> | |
| <expression>\[</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\]</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| <include collection="nest_brackets_r"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_curly"> | |
| <zone> | |
| <starts-with> | |
| <expression>\{</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\}</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="nest_curly"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_curly_and_self"> | |
| <zone> | |
| <starts-with> | |
| <expression>\{</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\}</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="nest_curly_and_self"/> | |
| </subzones> | |
| </zone> | |
| <include syntax="$self"/> | |
| </collection> | |
| <collection name="nest_curly_i"> | |
| <zone> | |
| <starts-with> | |
| <expression>\{</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\}</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_curly_i"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_curly_r"> | |
| <zone> | |
| <starts-with> | |
| <expression>\{</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\}</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| <include collection="nest_curly_r"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_function_parens"> | |
| <zone> | |
| <starts-with> | |
| <expression>\(</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby.experimental"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby.experimental"/> | |
| </ends-with> | |
| <subzones name="meta.section.scope.ruby.experimental"> | |
| <include collection="nest_function_parens"/> | |
| <include syntax="$self"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_ltgt"> | |
| <zone> | |
| <starts-with> | |
| <expression>\<</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\></expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="nest_ltgt"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_ltgt_i"> | |
| <zone> | |
| <starts-with> | |
| <expression>\<</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\></expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_ltgt_i"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_ltgt_r"> | |
| <zone> | |
| <starts-with> | |
| <expression>\<</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\></expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| <include collection="nest_ltgt_r"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_parens"> | |
| <zone> | |
| <starts-with> | |
| <expression>\(</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="nest_parens"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_parens_i"> | |
| <zone> | |
| <starts-with> | |
| <expression>\(</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_parens_i"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="nest_parens_r"> | |
| <zone> | |
| <starts-with> | |
| <expression>\(</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)</expression> | |
| <capture number="0" name="punctuation.section.scope.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| <include collection="nest_parens_r"/> | |
| </subzones> | |
| </zone> | |
| </collection> | |
| <collection name="regex_sub"> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <zone name="string.regexp.arbitrary-repitition.ruby"> | |
| <expression>(\{)\d+(,\d+)?(\})</expression> | |
| <capture number="1" name="punctuation.definition.arbitrary-repitition.ruby"/> | |
| <capture number="3" name="punctuation.definition.arbitrary-repitition.ruby"/> | |
| </zone> | |
| <zone name="string.regexp.character-class.ruby"> | |
| <starts-with> | |
| <expression>\[(?:\^?\])?</expression> | |
| <capture number="0" name="punctuation.definition.character-class.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\]</expression> | |
| <capture number="0" name="punctuation.definition.character-class.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.regexp.group.ruby"> | |
| <starts-with> | |
| <expression>\(</expression> | |
| <capture number="0" name="punctuation.definition.group.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)</expression> | |
| <capture number="0" name="punctuation.definition.group.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| </subzones> | |
| </zone> | |
| <zone name="comment.line.number-sign.ruby"> | |
| <expression>(?<=^|\s)(#)\s[[a-zA-Z0-9,. \t?!-][^\x{00}-\x{7F}]]*$</expression> | |
| <capture number="1" name="punctuation.definition.comment.ruby"/> | |
| </zone> | |
| </collection> | |
| <collection name="source_ruby"> | |
| <zone name="meta.class.ruby"> | |
| <expression>^\s*(class)\s+(([.a-zA-Z0-9_:]+(\s*(<)\s*[.a-zA-Z0-9_:]+)?)|((<<)\s*[.a-zA-Z0-9_:]+))</expression> | |
| <capture number="1" name="keyword.control.class.ruby"/> | |
| <capture number="2" name="entity.name.type.class.ruby"/> | |
| <capture number="4" name="entity.other.inherited-class.ruby"/> | |
| <capture number="5" name="punctuation.separator.inheritance.ruby"/> | |
| <capture number="6" name="variable.other.object.ruby"/> | |
| <capture number="7" name="punctuation.definition.variable.ruby"/> | |
| </zone> | |
| <zone name="meta.module.ruby"> | |
| <expression>^\s*(module)\s+(([A-Z]\w*(::))?([A-Z]\w*(::))?([A-Z]\w*(::))*[A-Z]\w*)</expression> | |
| <capture number="1" name="keyword.control.module.ruby"/> | |
| <capture number="2" name="entity.name.type.module.ruby"/> | |
| <capture number="3" name="entity.other.inherited-class.module.first.ruby"/> | |
| <capture number="4" name="punctuation.separator.inheritance.ruby"/> | |
| <capture number="5" name="entity.other.inherited-class.module.second.ruby"/> | |
| <capture number="6" name="punctuation.separator.inheritance.ruby"/> | |
| <capture number="7" name="entity.other.inherited-class.module.third.ruby"/> | |
| <capture number="8" name="punctuation.separator.inheritance.ruby"/> | |
| </zone> | |
| <zone name="invalid.deprecated.ruby"> | |
| <expression>(?<!\.)\belse(\s)+if\b</expression> | |
| </zone> | |
| <zone name="keyword.control.ruby"> | |
| <expression>(?<!\.)\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\b(?![?!])</expression> | |
| </zone> | |
| <zone name="keyword.control.start-block.ruby"> | |
| <expression>(?<!\.)\bdo\b\s*</expression> | |
| </zone> | |
| <zone name="meta.syntax.ruby.start-block"> | |
| <expression>(?<=\{)(\s+)</expression> | |
| </zone> | |
| <zone name="keyword.operator.logical.ruby"> | |
| <expression>(?<!\.)\b(and|not|or)\b</expression> | |
| </zone> | |
| <zone name="keyword.control.pseudo-method.ruby"> | |
| <expression>(?<!\.)\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\b(?![?!])|\bdefined\?|\bblock_given\?</expression> | |
| </zone> | |
| <zone name="constant.language.ruby"> | |
| <expression>\b(nil|true|false)\b(?![?!])</expression> | |
| </zone> | |
| <zone name="variable.language.ruby"> | |
| <expression>\b(__(FILE|LINE)__|self)\b(?![?!])</expression> | |
| </zone> | |
| <zone name="keyword.other.special-method.ruby"> | |
| <expression>\b(initialize|new|loop|include|extend|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|module_function|public|protected)\b(?![?!])</expression> | |
| </zone> | |
| <zone name="meta.require.ruby"> | |
| <starts-with> | |
| <expression>\b(require)\b</expression> | |
| <capture number="1" name="keyword.other.special-method.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>$|(?=#)</expression> | |
| <capture number="1" name="keyword.other.special-method.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include syntax="$self"/> | |
| </subzones> | |
| </zone> | |
| <zone name="variable.other.readwrite.instance.ruby"> | |
| <expression>(@)[a-zA-Z_]\w*</expression> | |
| <capture number="1" name="punctuation.definition.variable.ruby"/> | |
| </zone> | |
| <zone name="variable.other.readwrite.class.ruby"> | |
| <expression>(@@)[a-zA-Z_]\w*</expression> | |
| <capture number="1" name="punctuation.definition.variable.ruby"/> | |
| </zone> | |
| <zone name="variable.other.readwrite.global.ruby"> | |
| <expression>(\$)[a-zA-Z_]\w*</expression> | |
| <capture number="1" name="punctuation.definition.variable.ruby"/> | |
| </zone> | |
| <zone name="variable.other.readwrite.global.pre-defined.ruby"> | |
| <expression>(\$)(!|@|&|`|'|\+|\d+|~|=|/|\\|,|;|\.|<|>|_|\*|\$|\?|:|"|-[0adFiIlpv])</expression> | |
| <capture number="1" name="punctuation.definition.variable.ruby"/> | |
| </zone> | |
| <zone name="meta.environment-variable.ruby"> | |
| <starts-with> | |
| <expression>\b(ENV)\[</expression> | |
| <capture number="1" name="variable.other.constant.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\]</expression> | |
| </ends-with> | |
| <subzones> | |
| <include syntax="$self"/> | |
| </subzones> | |
| </zone> | |
| <zone name="support.class.ruby"> | |
| <expression>\b[A-Z]\w*(?=((\.|::)[A-Za-z]|\[))</expression> | |
| </zone> | |
| <zone name="variable.other.constant.ruby"> | |
| <expression>\b[A-Z]\w*\b</expression> | |
| </zone> | |
| <zone name="meta.function.method.with-arguments.ruby"> | |
| <starts-with> | |
| <expression>(?x) | |
| (?=def\b) # an optimization to help Oniguruma fail fast | |
| (?<=^|\s)(def)\s+ # the def keyword | |
| ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix | |
| (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name | |
| |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method | |
| \s*(\() # the openning parenthesis for arguments | |
| </expression> | |
| <capture number="1" name="keyword.control.def.ruby"/> | |
| <capture number="2" name="entity.name.function.ruby"/> | |
| <capture number="3" name="punctuation.definition.parameters.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)</expression> | |
| <capture number="0" name="punctuation.definition.parameters.ruby"/> | |
| </ends-with> | |
| <subzones name="variable.parameter.function.ruby"> | |
| <include syntax="$self"/> | |
| </subzones> | |
| </zone> | |
| <zone name="meta.function.method.with-arguments.ruby"> | |
| <starts-with> | |
| <expression>(?x) | |
| (?=def\b) # an optimization to help Oniguruma fail fast | |
| (?<=^|\s)(def)\s+ # the def keyword | |
| ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix | |
| (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name | |
| |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method | |
| [ \t] # the space separating the arguments | |
| (?=[ \t]*[^\s#]) # make sure arguments and not a comment follow | |
| </expression> | |
| <capture number="1" name="keyword.control.def.ruby"/> | |
| <capture number="2" name="entity.name.function.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>$</expression> | |
| </ends-with> | |
| <subzones name="variable.parameter.function.ruby"> | |
| <include syntax="$self"/> | |
| </subzones> | |
| </zone> | |
| <zone name="meta.function.method.without-arguments.ruby"> | |
| <expression>(?x) | |
| (?=def\b) # an optimization to help Oniguruma fail fast | |
| (?<=^|\s)(def)\b # the def keyword | |
| ( \s+ # an optional group of whitespace followed by… | |
| ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix | |
| (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name | |
| |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) )? # …or an operator method | |
| </expression> | |
| <capture number="1" name="keyword.control.def.ruby"/> | |
| <capture number="3" name="entity.name.function.ruby"/> | |
| </zone> | |
| <zone name="constant.numeric.ruby"> | |
| <expression>\b(0[xX]\h(?>_?\h)*|\d(?>_?\d)*(\.(?![^[:space:][:digit:]])(?>_?\d)*)?([eE][-+]?\d(?>_?\d)*)?|0[bB][01]+)\b</expression> | |
| </zone> | |
| <zone name="constant.other.symbol.single-quoted.ruby"> | |
| <starts-with> | |
| <expression>:'</expression> | |
| <capture number="0" name="punctuation.definition.constant.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>'</expression> | |
| <capture number="0" name="punctuation.definition.constant.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <zone name="constant.character.escape.ruby"> | |
| <expression>\\['\\]</expression> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone name="constant.other.symbol.double-quoted.ruby"> | |
| <starts-with> | |
| <expression>:"</expression> | |
| <capture number="0" name="punctuation.definition.constant.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>"</expression> | |
| <capture number="0" name="punctuation.definition.constant.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.single.ruby"> | |
| <starts-with> | |
| <expression>'</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>'</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <zone name="constant.character.escape.ruby"> | |
| <expression>\\'|\\\\</expression> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.double.ruby"> | |
| <starts-with> | |
| <expression>"</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>"</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.interpolated.ruby"> | |
| <starts-with> | |
| <expression>`</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>`</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.interpolated.ruby"> | |
| <starts-with> | |
| <expression>%x\{</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\}</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_curly_i"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.interpolated.ruby"> | |
| <starts-with> | |
| <expression>%x\[</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\]</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_brackets_i"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.interpolated.ruby"> | |
| <starts-with> | |
| <expression>%x\<</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\></expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_ltgt_i"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.interpolated.ruby"> | |
| <starts-with> | |
| <expression>%x\(</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_parens_i"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.interpolated.ruby"> | |
| <starts-with> | |
| <expression>%x([^\w])</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\1</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone> | |
| <starts-with> | |
| <expression>(?x) | |
| (?: | |
| ^ # beginning of line | |
| | (?<= # or look-behind on: | |
| [=>~(?:\[,|&;] | |
| | [\s;]if\s # keywords | |
| | [\s;]elsif\s | |
| | [\s;]while\s | |
| | [\s;]unless\s | |
| | [\s;]when\s | |
| | [\s;]assert_match\s | |
| | [\s;]or\s # boolean opperators | |
| | [\s;]and\s | |
| | [\s;]not\s | |
| | [\s.]index\s # methods | |
| | [\s.]scan\s | |
| | [\s.]sub\s | |
| | [\s.]sub!\s | |
| | [\s.]gsub\s | |
| | [\s.]gsub!\s | |
| | [\s.]match\s | |
| ) | |
| | (?<= # or a look-behind with line anchor: | |
| ^when\s # duplication necessary due to limits of regex | |
| | ^if\s | |
| | ^elsif\s | |
| | ^while\s | |
| | ^unless\s | |
| ) | |
| ) | |
| \s*((/))(?![*+{}?]) | |
| </expression> | |
| <capture number="1" name="string.regexp.classic.ruby"/> | |
| <capture number="2" name="punctuation.definition.string.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>((/[eimnosux]*))</expression> | |
| <capture number="1" name="string.regexp.classic.ruby"/> | |
| <capture number="2" name="punctuation.definition.string.ruby"/> | |
| </ends-with> | |
| <subzones name="string.regexp.classic.ruby"> | |
| <include collection="regex_sub"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.regexp.mod-r.ruby"> | |
| <starts-with> | |
| <expression>%r\{</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\}[eimnosux]*</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| <include collection="nest_curly_r"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.regexp.mod-r.ruby"> | |
| <starts-with> | |
| <expression>%r\[</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\][eimnosux]*</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| <include collection="nest_brackets_r"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.regexp.mod-r.ruby"> | |
| <starts-with> | |
| <expression>%r\(</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)[eimnosux]*</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| <include collection="nest_parens_r"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.regexp.mod-r.ruby"> | |
| <starts-with> | |
| <expression>%r\<</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\>[eimnosux]*</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| <include collection="nest_ltgt_r"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.regexp.mod-r.ruby"> | |
| <starts-with> | |
| <expression>%r([^\w])</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\1[eimnosux]*</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="regex_sub"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.upper.ruby"> | |
| <starts-with> | |
| <expression>%[QWSR]?\(</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_parens_i"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.upper.ruby"> | |
| <starts-with> | |
| <expression>%[QWSR]?\[</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\]</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_brackets_i"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.upper.ruby"> | |
| <starts-with> | |
| <expression>%[QWSR]?\<</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\></expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_ltgt_i"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.double.ruby.mod"> | |
| <starts-with> | |
| <expression>%[QWSR]?\{</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\}</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| <include collection="nest_curly_i"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.upper.ruby"> | |
| <starts-with> | |
| <expression>%[QWSR]([^\w])</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\1</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.other.ruby"> | |
| <starts-with> | |
| <expression>%([^\w\s=])</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\1</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.lower.ruby"> | |
| <starts-with> | |
| <expression>%[qws]\(</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\)</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <zone name="constant.character.escape.ruby"> | |
| <expression>\\\)|\\\\</expression> | |
| </zone> | |
| <include collection="nest_parens"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.lower.ruby"> | |
| <starts-with> | |
| <expression>%[qws]\<</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\></expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <zone name="constant.character.escape.ruby"> | |
| <expression>\\\>|\\\\</expression> | |
| </zone> | |
| <include collection="nest_ltgt"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.lower.ruby"> | |
| <starts-with> | |
| <expression>%[qws]\[</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\]</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <zone name="constant.character.escape.ruby"> | |
| <expression>\\\]|\\\\</expression> | |
| </zone> | |
| <include collection="nest_brackets"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.lower.ruby"> | |
| <starts-with> | |
| <expression>%[qws]\{</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\}</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <zone name="constant.character.escape.ruby"> | |
| <expression>\\\}|\\\\</expression> | |
| </zone> | |
| <include collection="nest_curly"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.quoted.other.literal.lower.ruby"> | |
| <starts-with> | |
| <expression>%[qws]([^\w])</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\1</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <zone> | |
| <expression>\\.</expression> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone name="constant.other.symbol.ruby"> | |
| <expression>(?<!:)(:)(?>[a-zA-Z_]\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?|@@?[a-zA-Z_]\w*)</expression> | |
| <capture number="1" name="punctuation.definition.constant.ruby"/> | |
| </zone> | |
| <zone name="comment.block.documentation.ruby"> | |
| <starts-with> | |
| <expression>^=begin</expression> | |
| <capture number="0" name="punctuation.definition.comment.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^=end</expression> | |
| <capture number="0" name="punctuation.definition.comment.ruby"/> | |
| </ends-with> | |
| </zone> | |
| <zone name="comment.line.number-sign.ruby"> | |
| <expression>(?:^[ \t]+)?(#).*$\n?</expression> | |
| <capture number="1" name="punctuation.definition.comment.ruby"/> | |
| </zone> | |
| <zone name="constant.numeric.ruby"> | |
| <expression>(?<!\w)\?(\\(x\h{1,2}(?!\h)\b|0[0-7]{0,2}(?![0-7])\b|[^x0MC])|(\\[MC]-)+\w|[^\s\\])</expression> | |
| </zone> | |
| <zone> | |
| <starts-with> | |
| <expression>^__END__\n</expression> | |
| <capture number="0" name="string.unquoted.program-block.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>(?=not)impossible</expression> | |
| <capture number="0" name="string.unquoted.program-block.ruby"/> | |
| </ends-with> | |
| <subzones name="text.plain"> | |
| <zone name="text.html.embedded.ruby"> | |
| <starts-with> | |
| <expression>(?=<?xml|<(?i:html\b)|!DOCTYPE (?i:html\b))</expression> | |
| </starts-with> | |
| <ends-with> | |
| <expression>(?=not)impossible</expression> | |
| </ends-with> | |
| <subzones> | |
| <include syntax="text.html.basic"/> | |
| </subzones> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.heredoc.ruby"> | |
| <starts-with> | |
| <expression>(?=(?>\=\s*<<(\w+))(?!\s+#\s*([Cc]|sh|[Jj]ava)))</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.heredoc.ruby"> | |
| <starts-with> | |
| <expression>(?=(?>\=\s*<<"([^"]*)")(?!\s+#\s*([Cc]|sh|[Jj]ava)))</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.embedded.html.ruby"> | |
| <starts-with> | |
| <expression>(?><<-HTML\b)</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\s*HTML$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones name="text.html.embedded.ruby"> | |
| <include collection="heredoc"/> | |
| <include syntax="text.html.basic"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.embedded.sql.ruby"> | |
| <starts-with> | |
| <expression>(?><<-SQL\b)</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\s*SQL$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones name="text.sql.embedded.ruby"> | |
| <include collection="heredoc"/> | |
| <include syntax="source.sql"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.embedded.ruby.ruby"> | |
| <starts-with> | |
| <expression>(?><<-(["\\']?)(\w+_(?i:eval))\1)</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>\s*\2$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include collection="interpolated_ruby"/> | |
| <include syntax="source.ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.heredoc.ruby"> | |
| <starts-with> | |
| <expression>(?=(?><<-(\w+)).*(?><<-(\w+))+)</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\s*\2$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.heredoc.ruby"> | |
| <starts-with> | |
| <expression>(?=(?><<-(\w+)))</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\s*\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.heredoc.ruby"> | |
| <starts-with> | |
| <expression>(?=(?><<-"([^"]*)"))</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\s*\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.heredoc.ruby"> | |
| <starts-with> | |
| <expression>(?=(?>\=\s*<<'([^']*)')(?!\s+#\s*([Cc]|sh|[Jj]ava)))</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\s*\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <zone name="constant.character.escape.ruby"> | |
| <expression>\\'|\\\\</expression> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.heredoc.ruby"> | |
| <starts-with> | |
| <expression>(?=(?><<-'([^']*)'))</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\s*\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <zone name="constant.character.escape.ruby"> | |
| <expression>\\'|\\\\</expression> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.embedded.c.ruby"> | |
| <starts-with> | |
| <expression>(?>\=\s*<<(\w+))(?=\s+#\s*[Cc](?!(\+\+|[Ss][Ss])))</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include syntax="source.c"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.embedded.cplusplus.ruby"> | |
| <starts-with> | |
| <expression>(?>\=\s*<<(\w+))(?=\s+#\s*[Cc]\+\+)</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include syntax="source.c++"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.embedded.css.ruby"> | |
| <starts-with> | |
| <expression>(?>\=\s*<<(\w+))(?=\s+#\s*[Cc][Ss][Ss])</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include syntax="source.css"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.embedded.js.ruby"> | |
| <starts-with> | |
| <expression>(?>\=\s*<<(\w+))(?=\s+#\s*[Jj]ava[Ss]cript)</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include syntax="source.js"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone name="string.unquoted.embedded.shell.ruby"> | |
| <starts-with> | |
| <expression>(?>\=\s*<<(\w+))(?=\s+#\s*sh)</expression> | |
| <capture number="0" name="punctuation.definition.string.begin.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>^\1$</expression> | |
| <capture number="0" name="punctuation.definition.string.end.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <include collection="heredoc"/> | |
| <include syntax="source.shell"/> | |
| <include collection="interpolated_ruby"/> | |
| <include collection="escaped_char"/> | |
| </subzones> | |
| </zone> | |
| <zone> | |
| <starts-with> | |
| <expression>(?<=\{|do|\{\s|do\s)(\|)</expression> | |
| <capture number="1" name="punctuation.separator.variable.ruby"/> | |
| </starts-with> | |
| <ends-with> | |
| <expression>(\|)</expression> | |
| <capture number="1" name="punctuation.separator.variable.ruby"/> | |
| </ends-with> | |
| <subzones> | |
| <zone name="variable.other.block.ruby"> | |
| <expression>[_a-zA-Z][_a-zA-Z0-9]*</expression> | |
| </zone> | |
| <zone name="punctuation.separator.variable.ruby"> | |
| <expression>,</expression> | |
| </zone> | |
| </subzones> | |
| </zone> | |
| <zone name="punctuation.separator.key-value"> | |
| <expression>=></expression> | |
| </zone> | |
| <zone name="keyword.operator.assignment.augmented.ruby"> | |
| <expression><<=|%=|&=|\*=|\*\*=|\+=|\-=|\^=|\|{1,2}=|/=|<<</expression> | |
| </zone> | |
| <zone name="keyword.operator.comparison.ruby"> | |
| <expression><=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \t])\?</expression> | |
| </zone> | |
| <zone name="keyword.operator.logical.ruby"> | |
| <expression>(?<=[ \t])!+|\bnot\b|&&|\band\b|\|\||\bor\b|\^</expression> | |
| </zone> | |
| <zone name="keyword.operator.arithmetic.ruby"> | |
| <expression>(%|&|\*\*|\*|\+|\-|/)</expression> | |
| </zone> | |
| <zone name="keyword.operator.assignment.ruby"> | |
| <expression>=</expression> | |
| </zone> | |
| <zone name="keyword.operator.other.ruby"> | |
| <expression>\||~|>></expression> | |
| </zone> | |
| <zone name="punctuation.separator.other.ruby"> | |
| <expression>:</expression> | |
| </zone> | |
| <zone name="punctuation.separator.statement.ruby"> | |
| <expression>\;</expression> | |
| </zone> | |
| <zone name="punctuation.separator.object.ruby"> | |
| <expression>,</expression> | |
| </zone> | |
| <zone name="punctuation.separator.method.ruby"> | |
| <expression>\.|::</expression> | |
| </zone> | |
| <zone name="punctuation.section.scope.ruby"> | |
| <expression>\{|\}</expression> | |
| </zone> | |
| <zone name="punctuation.section.array.ruby"> | |
| <expression>\[|\]</expression> | |
| </zone> | |
| <zone name="punctuation.section.function.ruby"> | |
| <expression>\(|\)</expression> | |
| </zone> | |
| </collection> | |
| </library> | |
| </syntax> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment