Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { scopeName = 'source.ruby.experimental';
- comment = '
- TODO: unresolved issues
- text:
- "p << end
- print me!
- end"
- symptoms:
- not recognized as a heredoc
- solution:
- there is no way to distinguish perfectly between the << operator and the start
- of a heredoc. Currently, we require assignment to recognize a heredoc. More
- refinement is possible.
- • Heredocs with indented terminators (<<-) are always distinguishable, however.
- • Nested heredocs are not really supportable at present
- text:
- "a\332a"
- symptoms:
- ''\332'' is not recognized as slash3.. which should be octal 332.
- solution:
- plain regexp.. should be easy.
- text:
- val?(a):p(b)
- val?''a'':''b''
- symptoms:
- '':p'' is recognized as a symbol.. its 2 things '':'' and ''p''.
- :''b'' has same problem.
- solution:
- ternary operator rule, precedence stuff, symbol rule.
- but also consider ''a.b?(:c)'' ??
- ';
- firstLineMatch = '^#!/.*\bruby\b';
- fileTypes = ( 'rb', 'rbx', 'Rakefile', 'rake', 'cgi', 'fcgi' );
- foldingStartMarker = '(?x)^
- (\s*
- (module|class|def
- |unless|if
- |case
- |begin
- |for|while|until
- |( "(\\.|[^"])* " # 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* [}\]] \s* ([#].*)? $
- | [#] .*? \(end\) \s* $ # Sune’s special marker
- )';
- patterns = (
- { name = 'declaration.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.class.ruby'; };
- 4 = { name = 'entity.other.inherited-class.ruby'; };
- 5 = { name = 'variable.other.object.ruby'; };
- };
- },
- { name = 'declaration.module.ruby';
- match = '^\s*(module)\s ((([A-Z]\w*::)*)[A-Z]\w*)';
- captures =
- { 1 = { name = 'keyword.control.module.ruby'; };
- 2 = { name = 'entity.name.module.ruby'; };
- 3 = { name = 'entity.other.parent-module.ruby'; };
- };
- },
- { 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.ruby.start-block';
- 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\?';
- },
- { name = 'constant.language.pseudo-variable.ruby';
- comment = ' every reserved word, being a value is a..';
- match = '\b(nil|true|false|__(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|require|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|public|protected)\b(?![?!])';
- },
- { name = 'variable.other.readwrite.instance.ruby';
- match = '@[a-zA-Z_]\w*';
- },
- { name = 'variable.other.readwrite.class.ruby';
- match = '@@[a-zA-Z_]\w*';
- },
- { name = 'variable.other.readwrite.global.ruby';
- match = '\$[a-zA-Z_]\w*';
- },
- { name = 'variable.other.readwrite.global.pre-defined.ruby';
- match = '\$(!|@|&|`|''|\ |\d|~|=|/|\\|,|;|\.|<|>|_|\*|\$|\?|:|"|-[0adFiIlpv])';
- },
- { name = 'variable.other.constant.ruby';
- match = '\b[A-Z]\w*\b';
- },
- { name = 'declaration.function.method.with-arguments.ruby';
- comment = ' the method pattern comes from the symbol pattern, see there for a explaination';
- begin = '(?:^|\s )(def)\b\s ((?>[a-zA-Z_]\w*(?>\.|::))?(?>[a-zA-Z_]\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[- ]@?|\[\]=?))\s*\(';
- end = '\)';
- captures =
- { 1 = { name = 'keyword.control.def.ruby'; };
- 2 = { name = 'entity.name.function.ruby'; };
- };
- patterns = ( { include = '$base'; } );
- contentName = 'variable.parameter';
- },
- { name = 'declaration.function.method.without-arguments.ruby';
- comment = ' the optional name is just to catch the def also without a method-name';
- match = '(?:^|\s )(def)\b(\s ((?>[a-zA-Z_]\w*(?>\.|::))?(?>[a-zA-Z_]\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[- ]@?|\[\]=?)))?';
- 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)*(\.(?>_?\d)*)?([eE][- ]?(?>_?\d)*)?|0[bB][01] )\b';
- },
- { name = 'constant.other.symbol.single-quoted.ruby';
- begin = ":'";
- end = "'";
- swallow = '\\[''\\]';
- },
- { name = 'constant.other.symbol.double-quoted.ruby';
- begin = ':"';
- end = '"';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { name = 'string.quoted.single.ruby';
- comment = 'single quoted string (does not allow interpolation)';
- begin = "'";
- end = "'";
- swallow = '\\.';
- patterns = (
- { name = 'constant.character.escaped.ruby';
- match = '\\''|\\\\';
- }
- );
- },
- { name = 'string.quoted.double.ruby';
- comment = 'double quoted string (allows for interpolation)';
- begin = '"';
- end = '"';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { name = 'string.interpolated.ruby';
- comment = 'execute string (allows for interpolation)';
- begin = '`';
- end = '`';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { name = 'string.interpolated.ruby';
- comment = 'execute string (allow for interpolation)';
- begin = '%x\{';
- end = '\}';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_curly_i'; },
- );
- },
- { name = 'string.interpolated.ruby';
- comment = 'execute string (allow for interpolation)';
- begin = '%x\[';
- end = '\]';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_brackets_i'; },
- );
- },
- { name = 'string.interpolated.ruby';
- comment = 'execute string (allow for interpolation)';
- begin = '%x\<';
- end = '\>';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_ltgt_i'; },
- );
- },
- { name = 'string.interpolated.ruby';
- comment = 'execute string (allow for interpolation)';
- begin = '%x\(';
- end = '\)';
- swallow = '\\.';
- 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';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { name = '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|;)when\s
- | (\s|;)or\s
- | (\s|;)and\s
- | (\s|;|\.)scan\s
- | (\s|;|\.)sub\s
- | (\s|l|\.)sub!\s
- | (\s|;|\.)gsub\s
- | (\s|;|\.)gsub!\s
- | (\s|;)if\s
- | (\s|;)elsif\s
- )
- | (?<= # or a look-behind with line anchor:
- ^when\s # duplication necessary due to limits of regex
- | ^scan\s
- | ^sub\s
- | ^gsub\s
- | ^gsub\s
- | ^gsub!\s
- | ^if\s
- | ^elsif\s
- )
- )
- \s*/(?![* {}?])
- ';
- end = '/[eimnosux]*';
- patterns = ( { include = '#regex_sub'; } );
- },
- { name = 'string.regexp.mod-r.ruby';
- comment = 'regular expressions (literal)';
- begin = '%r\{';
- end = '\}[eimnosux]*';
- patterns = (
- { include = '#regex_sub'; },
- { include = '#nest_curly_r'; },
- );
- },
- { name = 'string.regexp.mod-r.ruby';
- comment = 'regular expressions (literal)';
- begin = '%r\[';
- end = '\][eimnosux]*';
- patterns = (
- { include = '#regex_sub'; },
- { include = '#nest_brackets_r'; },
- );
- },
- { name = 'string.regexp.mod-r.ruby';
- comment = 'regular expressions (literal)';
- begin = '%r\(';
- end = '\)[eimnosux]*';
- patterns = (
- { include = '#regex_sub'; },
- { include = '#nest_parens_r'; },
- );
- },
- { name = 'string.regexp.mod-r.ruby';
- comment = 'regular expressions (literal)';
- begin = '%r\<';
- end = '\>[eimnosux]*';
- patterns = (
- { include = '#regex_sub'; },
- { include = '#nest_ltgt_r'; },
- );
- },
- { name = 'string.regexp.mod-r.ruby';
- comment = 'regular expressions (literal)';
- begin = '%r([^\w])';
- end = '\1[eimnosux]*';
- patterns = ( { include = '#regex_sub'; } );
- },
- { name = 'string.quoted.literal.upper.ruby';
- comment = 'literal capable of interpolation ()';
- begin = '%[QWSR]?\(';
- end = '\)';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_parens_i'; },
- );
- },
- { name = 'string.quoted.literal.upper.ruby';
- comment = 'literal capable of interpolation []';
- begin = '%[QWSR]?\[';
- end = '\]';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_brackets_i'; },
- );
- },
- { name = 'string.quoted.literal.upper.ruby';
- comment = 'literal capable of interpolation <>';
- begin = '%[QWSR]?\<';
- end = '\>';
- swallow = '\\.';
- 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 = '\}';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_curly_i'; },
- );
- },
- { name = 'string.quoted.literal.upper.ruby';
- comment = 'literal capable of interpolation -- wildcard';
- begin = '%[QWSR]([^\w])';
- end = '\1';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { name = 'string.quoted.literal.upper.ruby';
- comment = 'literal capable of interpolation -- wildcard';
- begin = '%([^\w\s])';
- end = '\1';
- swallow = '\\.';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { name = 'string.quoted.literal.lower.ruby';
- comment = 'literal incapable of interpolation -- ()';
- begin = '%[qws]\(';
- end = '\)';
- swallow = '\\.';
- patterns = (
- { name = 'constant.character.escaped.ruby';
- match = '\\\)|\\\\';
- },
- { include = '#nest_parens'; },
- );
- },
- { name = 'string.quoted.literal.lower.ruby';
- comment = 'literal incapable of interpolation -- <>';
- begin = '%[qws]\<';
- end = '\>';
- swallow = '\\.';
- patterns = (
- { name = 'constant.character.escaped.ruby';
- match = '\\\>|\\\\';
- },
- { include = '#nest_ltgt'; },
- );
- },
- { name = 'string.quoted.literal.lower.ruby';
- comment = 'literal incapable of interpolation -- []';
- begin = '%[qws]\[';
- end = '\]';
- swallow = '\\.';
- patterns = (
- { name = 'constant.character.escaped.ruby';
- match = '\\\]|\\\\';
- },
- { include = '#nest_brackets'; },
- );
- },
- { name = 'string.quoted.single.ruby.mod';
- comment = 'literal incapable of interpolation -- {}';
- begin = '%[qws]\{';
- end = '\}';
- swallow = '\\.';
- patterns = (
- { name = 'constant.character.escaped.ruby';
- match = '\\\}|\\\\';
- },
- { include = '#nest_curly'; },
- );
- },
- { name = 'string.quoted.literal.lower.ruby';
- comment = 'literal incapable of interpolation -- wildcard';
- begin = '%[qws]([^\w])';
- end = '\1';
- swallow = '\\.';
- },
- { name = 'constant.other.symbol.ruby';
- comment = 'symbols';
- match = '(?<!:):(?>[a-zA-Z_]\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\|]|\*\*?|=?~|[- ]@?|\[\]=?|@@?[a-zA-Z_]\w*)';
- },
- { name = 'comment.documentation.ruby';
- comment = 'multiline comments';
- begin = '^=begin';
- end = '^=end';
- swallow = '\\.';
- },
- { name = 'comment.line.number-sign.ruby';
- match = '#.*$\n?';
- },
- { 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\\])';
- },
- { comment = '__END__ marker';
- begin = '^__END__\n';
- end = '(?!impossible)impossible';
- captures = { 0 = { name = 'string.unquoted.program-block.ruby'; }; };
- contentName = 'text.plain';
- },
- { name = 'string.unquoted.heredoc.ruby';
- begin = '(?>\=\s*<<(\w ))(?!\s #\s*([Cc]|sh|[Jj]ava))';
- end = '^\1$';
- patterns = (
- { include = '#heredoc'; },
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { name = 'string.unquoted.embedded.html.ruby';
- comment = 'heredoc with embedded HTML and indented terminator';
- begin = '(?><<-HTML\b)';
- end = '\s*HTML$';
- patterns = (
- { include = '#heredoc'; },
- { include = 'text.html.basic'; },
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- contentName = 'text.html.embedded.ruby';
- },
- { name = 'string.unquoted.heredoc.ruby';
- comment = 'heredoc with indented terminator';
- begin = '(?><<-(\w ))';
- end = '\s*\1$';
- patterns = (
- { include = '#heredoc'; },
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { name = 'string.unquoted.embedded.c.ruby';
- begin = '(?>\=\s*<<(\w ))(?=\s #\s*[Cc](?!(\ \ |[Ss][Ss])))';
- end = '^\1$';
- 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$';
- 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$';
- 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$';
- patterns = (
- { include = '#heredoc'; },
- { include = 'source.js.prototype'; },
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { name = 'string.unquoted.embedded.shell.ruby';
- begin = '(?>\s*<<(\w ))(?=\s #\s*sh)';
- end = '^\1$';
- patterns = (
- { include = '#heredoc'; },
- { include = 'source.shell'; },
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- );
- },
- { 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|attr|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|catch|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_include|define_initialize|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|extend|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|include|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|loop|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_loop|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|module_function|modulo|month|mon|move|mtime|multipart_form|must_C_version|mv|namespaceURI|name|navigate|nesting|new2|new_start|new|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|private|proc|progids|progid|protected_instance_methods|protected_methods|protected|prune|publicId|public_class_method|public_instance_methods|public_methods|public|push|putc|puts|pwd|p|quick_emit|quote|quo|radio_button|radio_group|raise|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_loop|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_new|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|throw|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';
- },
- { match = '(?<=\{\t|do\t|\{ |do |\{|do)(\|)([a-zA-Z0-9_\s,] )(\|)';
- captures =
- { 1 = { name = 'meta.brace.pipe.ruby'; };
- 2 = { name = 'variable.other.block.ruby'; };
- 3 = { name = 'meta.brace.pipe.ruby'; };
- };
- },
- { name = 'keyword.operator.setter.arrow';
- match = '=>';
- },
- { name = 'keyword.operator.getter';
- match = '===|==|=~|!~|!=|>(?!>)|<(?!<)|>=|~|\|\|(?!=)|\|(?![=|\|])|<=>|<=|>=';
- },
- { name = 'keyword.operator.setter';
- match = '%|&|\*\*|\*|\ |-|/|<<|=|>>|>|\^|\|\|=';
- },
- { include = '#round-brackets'; },
- { name = 'meta.delimiter.statement.ruby';
- match = '\;';
- },
- { name = 'meta.delimiter.object.ruby';
- match = ',';
- },
- { name = 'meta.delimiter.method.ruby';
- match = '\.';
- },
- { name = 'meta.brace.curly.ruby';
- match = '\{|\}';
- },
- { name = 'meta.brace.square.ruby';
- match = '\[|\]';
- },
- { name = 'meta.brace.round.ruby';
- match = '\(|\)';
- },
- );
- repository =
- { escaped_char =
- { name = 'constant.character.escaped.ruby';
- match = '\\(?:0\d{1,2}|x[\da-fA-F]{1,2}|.)';
- };
- heredoc =
- { begin = '^<<-?\w ';
- end = '$';
- patterns = ( { include = '$base'; } );
- };
- interpolated_ruby = { patterns = (
- { name = 'source.ruby.embedded.source.brace';
- begin = '#\{';
- end = '\}';
- patterns = ( { include = '#nest_curly_and_self'; } );
- contentName = 'source.ruby.embedded.source';
- },
- { name = 'variable.other.readwrite.instance.ruby';
- match = '#@[a-zA-Z_]\w*';
- },
- { name = 'variable.other.readwrite.class.ruby';
- match = '#@@[a-zA-Z_]\w*';
- },
- { name = 'variable.other.readwrite.global.ruby';
- match = '#\$[a-zA-Z_]\w*';
- },
- );
- };
- nest_brackets =
- { begin = '\[';
- end = '\]';
- patterns = ( { include = '#nest_brackets'; } );
- };
- nest_brackets_i =
- { begin = '\[';
- end = '\]';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_brackets_i'; },
- );
- };
- nest_brackets_r =
- { begin = '\[';
- end = '\]';
- patterns = (
- { include = '#regex_sub'; },
- { include = '#nest_brackets_r'; },
- );
- };
- nest_curly =
- { begin = '\{';
- end = '\}';
- patterns = ( { include = '#nest_curly'; } );
- };
- nest_curly_and_self = { patterns = (
- { begin = '\{';
- end = '\}';
- patterns = ( { include = '#nest_curly_and_self'; } );
- },
- { include = '$self'; },
- );
- };
- nest_curly_i =
- { begin = '\{';
- end = '\}';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_curly_i'; },
- );
- };
- nest_curly_r =
- { begin = '\{';
- end = '\}';
- patterns = (
- { include = '#regex_sub'; },
- { include = '#nest_curly_r'; },
- );
- };
- nest_ltgt =
- { begin = '\<';
- end = '\>';
- patterns = ( { include = '#nest_ltgt'; } );
- };
- nest_ltgt_i =
- { begin = '\<';
- end = '\>';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_ltgt_i'; },
- );
- };
- nest_ltgt_r =
- { begin = '\<';
- end = '\>';
- patterns = (
- { include = '#regex_sub'; },
- { include = '#nest_ltgt_r'; },
- );
- };
- nest_parens =
- { begin = '\(';
- end = '\)';
- patterns = ( { include = '#nest_parens'; } );
- };
- nest_parens_i =
- { begin = '\(';
- end = '\)';
- patterns = (
- { include = '#interpolated_ruby'; },
- { include = '#escaped_char'; },
- { include = '#nest_parens_i'; },
- );
- };
- nest_parens_r =
- { begin = '\(';
- end = '\)';
- 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 )?\}';
- },
- { name = 'string.regexp.character-class.ruby';
- begin = '\[(?:\^?\])?';
- end = '\]';
- patterns = ( { include = '#escaped_char'; } );
- },
- { name = 'string.regexp.group.ruby';
- begin = '\(';
- end = '\)';
- patterns = ( { include = '#regex_sub'; } );
- },
- { name = 'comment.line.number-sign.ruby';
- comment = 'Only allow word characters and punctuation to avoid false positives, since the availability of comments depend on regexp flags.';
- match = '(?<=^|\s)#\s[a-zA-Z0-9,. ]*$';
- },
- );
- };
- round-brackets = { patterns = (
- { begin = '\{';
- end = '\}|(?=%>)';
- captures = { 0 = { name = 'meta.brace.curly.ruby.experimental'; }; };
- patterns = ( { include = 'source.ruby.experimental'; } );
- contentName = 'meta.group.braces.curly.ruby.experimental';
- }
- );
- };
- };
- }
Add Comment
Please, Sign In to add comment