diff --git a/Syntaxes/Ruby.plist b/Syntaxes/Ruby.plist index 9484cce..1ba8cb8 100644 --- a/Syntaxes/Ruby.plist +++ b/Syntaxes/Ruby.plist @@ -19,14 +19,7 @@ • Heredocs with indented terminators (<<-) are always distinguishable, however. • Nested heredocs are not really supportable at present - text: - print <<-'THERE' - This is single quoted. - The above used #{Time.now} - THERE - symtoms: - From Programming Ruby p306; should be a non-interpolated heredoc. - + text: val?(a):p(b) val?'a':'b' @@ -1745,607 +1738,2626 @@ begin - (?=(?><<-("?)((?:[_\w]+_|)HTML)\b\1)) - comment - Heredoc with embedded html - end - (?!\G) - name - meta.embedded.block.html - patterns - + (?>((<<-'((?:\w*_)?RUBY)\b'))([^\n]*$)) + beginCaptures + + 1 - begin - (?><<-("?)((?:[_\w]+_|)HTML)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - text.html - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - name string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + patterns include - #heredoc - - - include - #interpolated_ruby - - - include - text.html.basic - - - include - #escaped_char + source.ruby - - - - begin - (?=(?><<-("?)((?:[_\w]+_|)SQL)\b\1)) + comment - Heredoc with embedded sql + Uninterpolated Indented Ruby Heredoc + contentName + string.unquoted.heredoc.ruby end - (?!\G) - name - meta.embedded.block.sql - patterns - + ^(\s*(\3))\s*\n + endCaptures + + 1 - begin - (?><<-("?)((?:[_\w]+_|)SQL)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.sql - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - name string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.sql - - - include - #escaped_char - - + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.ruby + + + include + #escaped_char begin - (?=(?><<-("?)((?:[_\w]+_|)CSS)\b\1)) - comment - Heredoc with embedded css - end - (?!\G) - name - meta.embedded.block.css - patterns - + (?>((<<-(["`]?)((?:\w*_)?RUBY)\b\3))([^\n]*$)) + beginCaptures + + 1 - begin - (?><<-("?)((?:[_\w]+_|)CSS)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.css - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - name string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + patterns include - #heredoc - - - include - #interpolated_ruby - - - include - source.css - - - include - #escaped_char + source.ruby - - - - begin - (?=(?><<-("?)((?:[_\w]+_|)CPP)\b\1)) + comment - Heredoc with embedded c++ + Interpolated Indented Ruby Heredoc + contentName + string.unquoted.heredoc.ruby end - (?!\G) - name - meta.embedded.block.c++ + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + patterns - begin - (?><<-("?)((?:[_\w]+_|)CPP)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.c++ - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - + include + #heredoc + + + include + #interpolated_ruby + + + include + source.ruby + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?RUBY)\b'))([^\n]*$)) + beginCaptures + + 1 + name string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + patterns include - #heredoc - - - include - #interpolated_ruby - - - include - source.c++ - - - include - #escaped_char + source.ruby - - - - begin - (?=(?><<-("?)((?:[_\w]+_|)C)\b\1)) + comment - Heredoc with embedded c + Uninterpolated Unindented Ruby Heredoc + contentName + string.unquoted.heredoc.ruby end - (?!\G) - name - meta.embedded.block.c - patterns - - - begin - (?><<-("?)((?:[_\w]+_|)C)\b\1) - beginCaptures - - 0 + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.ruby + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?RUBY)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Unindented Ruby Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.ruby + + + include + #escaped_char + + + + + begin + (?>((<<-'((?:\w*_)?LUA)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Indented Lua Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.lua + + + include + #escaped_char + + + + + begin + (?>((<<-(["`]?)((?:\w*_)?LUA)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Indented Lua Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.lua + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?LUA)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Unindented Lua Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.lua + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?LUA)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Unindented Lua Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.lua + + + include + #escaped_char + + + + + begin + (?>((<<-'((?:\w*_)?(?:SH|SHELL))\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Indented Shell Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.shell + + + include + #escaped_char + + + + + begin + (?>((<<-(["`]?)((?:\w*_)?(?:SH|SHELL))\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Indented Shell Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.shell + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?(?:SH|SHELL))\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Unindented Shell Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.shell + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?(?:SH|SHELL))\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Unindented Shell Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.shell + + + include + #escaped_char + + + + + begin + (?>((<<-'((?:\w*_)?JQUERY)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Indented jQuery Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.js.jquery + + + include + #escaped_char + + + + + begin + (?>((<<-(["`]?)((?:\w*_)?JQUERY)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Indented jQuery Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.js.jquery + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?JQUERY)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Unindented jQuery Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.js.jquery + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?JQUERY)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Unindented jQuery Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.js.jquery + + + include + #escaped_char + + + + + begin + (?>((<<-'((?:\w*_)?(?:JS|JAVASCRIPT))\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Indented JavaScript Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.js + + + include + #escaped_char + + + + + begin + (?>((<<-(["`]?)((?:\w*_)?(?:JS|JAVASCRIPT))\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Indented JavaScript Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.js + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?(?:JS|JAVASCRIPT))\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Unindented JavaScript Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.js + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?(?:JS|JAVASCRIPT))\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Unindented JavaScript Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.js + + + include + #escaped_char + + + + + begin + (?>((<<-'((?:\w*_)?C)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Indented C Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.c + + + include + #escaped_char + + + + + begin + (?>((<<-(["`]?)((?:\w*_)?C)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Indented C Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.c + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?C)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Unindented C Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.c + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?C)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Unindented C Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.c + + + include + #escaped_char + + + + + begin + (?>((<<-'((?:\w*_)?CPP)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Indented C++ Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.c++ + + + include + #escaped_char + + + + + begin + (?>((<<-(["`]?)((?:\w*_)?CPP)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Indented C++ Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.c++ + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?CPP)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Unindented C++ Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.c++ + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?C)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Unindented C++ Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.c++ + + + include + #escaped_char + + + + + begin + (?>((<<-'((?:\w*_)?CSS)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Indented CSS Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.css + + + include + #escaped_char + + + + + begin + (?>((<<-(["`]?)((?:\w*_)?CSS)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Indented CSS Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.css + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?CSS)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Unindented CSS Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + source.css + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?CSS)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Unindented CSS Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.css + + + include + #escaped_char + + + + + begin + (?>((<<-'((?:\w*_)?HTML)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + - name - punctuation.definition.string.begin.ruby + include + source.ruby - - contentName - source.c - end - \s*\2$\n? - endCaptures - - 0 + + + + comment + Uninterpolated Indented HTML Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + text.html.basic + + + include + #escaped_char + + + + + begin + (?>((<<-(["`]?)((?:\w*_)?HTML)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + - name - punctuation.definition.string.end.ruby + include + source.ruby - + + + + comment + Interpolated Indented HTML Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + text.html.basic + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?HTML)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + + patterns + + + include + source.ruby + + + + + comment + Uninterpolated Unindented HTML Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + text.basic.html + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?HTML)\b\3))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + + + comment + Interpolated Unindented HTML Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^((\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + text.basic.html + + + include + #escaped_char + + + + + begin + (?>((<<-'((?:\w*_)?SQL)\b'))([^\n]*$)) + beginCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + name - string.unquoted.heredoc.ruby + punctuation.definition.string.begin.ruby + + 4 + patterns include - #heredoc - - - include - #interpolated_ruby - - - include - source.c - - - include - #escaped_char + source.ruby - - - - begin - (?=(?><<-("?)((?:[_\w]+_|)(?:JS|JAVASCRIPT))\b\1)) + comment - Heredoc with embedded javascript + Uninterpolated Indented SQL Heredoc + contentName + string.unquoted.heredoc.ruby end - (?!\G) - name - meta.embedded.block.js + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + patterns - begin - (?><<-("?)((?:[_\w]+_|)(?:JS|JAVASCRIPT))\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.js - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - + include + #heredoc + + + include + source.sql + + + include + #escaped_char + + + + + begin + (?>((<<-(["`]?)((?:\w*_)?SQL)\b\3))([^\n]*$)) + beginCaptures + + 1 + name string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + patterns include - #heredoc - - - include - #interpolated_ruby - - - include - source.js - - - include - #escaped_char + source.ruby - - - - begin - (?=(?><<-("?)((?:[_\w]+_|)JQUERY)\b\1)) + comment - Heredoc with embedded jQuery javascript + Interpolated Indented SQL Heredoc + contentName + string.unquoted.heredoc.ruby end - (?!\G) - name - meta.embedded.block.js.jquery + ^(\s*(\4))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + patterns - begin - (?><<-("?)((?:[_\w]+_|)JQUERY)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.js.jquery - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - + include + #heredoc + + + include + #interpolated_ruby + + + include + source.sql + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<'((?:\w*_)?SQL)\b'))([^\n]*$)) + beginCaptures + + 1 + name string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + patterns include - #heredoc - - - include - #interpolated_ruby - - - include - source.js.jquery - - - include - #escaped_char + source.ruby - - - - begin - (?=(?><<-("?)((?:[_\w]+_|)(?:SH|SHELL))\b\1)) + comment - Heredoc with embedded shell + Uninterpolated Unindented SQL Heredoc + contentName + string.unquoted.heredoc.ruby end - (?!\G) - name - meta.embedded.block.shell + ^((\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + patterns - begin - (?><<-("?)((?:[_\w]+_|)(?:SH|SHELL))\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.shell - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - + include + #heredoc + + + include + source.sql + + + include + #escaped_char + + + + + begin + (?>(?:^|[=,]\s*)((<<(["`]?)((?:\w*_)?SQL)\b\3))([^\n]*$)) + beginCaptures + + 1 + name string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.shell - + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + include - #escaped_char + source.ruby - - - - begin - (?=(?><<-("?)((?:[_\w]+_|)LUA)\b\1)) + comment - Heredoc with embedded lua + Interpolated Unindented SQL Heredoc + contentName + string.unquoted.heredoc.ruby end - (?!\G) - name - meta.embedded.block.lua - patterns - + ^((\4))\s*\n + endCaptures + + 1 - begin - (?><<-("?)((?:[_\w]+_|)LUA)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.lua - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - name string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.lua - - - include - #escaped_char - - + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + source.sql + + + include + #escaped_char begin - (?=(?><<-("?)((?:[_\w]+_|)RUBY)\b\1)) - comment - Heredoc with embedded ruby - end - (?!\G) - name - meta.embedded.block.ruby - patterns - + (?>((<<-'(\w+)\b'))([^\n]*$)) + beginCaptures + + 1 - begin - (?><<-("?)((?:[_\w]+_|)RUBY)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.ruby - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - name string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 4 + patterns - - include - #heredoc - - - include - #interpolated_ruby - include source.ruby - - include - #escaped_char - + + comment + Uninterpolated Indented Heredoc + contentName + string.unquoted.heredoc.ruby + end + ^(\s*(\3))\s*\n + endCaptures + + 1 + + name + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #escaped_char + begin - (?>\=\s*<<(\w+)) + (?>((<<-(["`]?)(\w+)\b\3))([^\n]*$)) beginCaptures - 0 + 1 + + name + string.unquoted.heredoc.ruby + + 2 name punctuation.definition.string.begin.ruby + 5 + + patterns + + + include + source.ruby + + + + comment + Interpolated Indented Heredoc + contentName + string.unquoted.heredoc.ruby end - ^\1$ + ^(\s*(\4))\s*\n endCaptures - 0 + 1 + + name + string.unquoted.heredoc.ruby + + 2 name punctuation.definition.string.end.ruby - name - string.unquoted.heredoc.ruby patterns @@ -2364,39 +4376,55 @@ begin - (?><<-(\w+)) + (?>(?:^|[=,]\s*)((<<'(\w+)\b'))([^\n]*$)) beginCaptures - 0 + 1 + + name + string.unquoted.heredoc.ruby + + 2 name punctuation.definition.string.begin.ruby + 4 + + patterns + + + include + source.ruby + + + comment - heredoc with indented terminator + Uninterpolated Unindented Heredoc + contentName + string.unquoted.heredoc.ruby end - \s*\1$ + ^((\3))\s*\n endCaptures - 0 + 1 + + name + string.unquoted.heredoc.ruby + + 2 name punctuation.definition.string.end.ruby - name - string.unquoted.heredoc.ruby patterns include #heredoc - - include - #interpolated_ruby - include #escaped_char @@ -2405,30 +4433,62 @@ begin - (?<=\{|do|\{\s|do\s)(\|) - captures + (?>(?:^|[=,]\s*)((<<(["`]?)(\w+)\b\3))([^\n]*$)) + beginCaptures 1 name - punctuation.separator.variable.ruby + string.unquoted.heredoc.ruby + + 2 + + name + punctuation.definition.string.begin.ruby + + 5 + + patterns + + + include + source.ruby + + + comment + Interpolated Unindented Heredoc + contentName + string.unquoted.heredoc.ruby end - (\|) - patterns - + ^((\4))\s*\n + endCaptures + + 1 - match - [_a-zA-Z][_a-zA-Z0-9]* name - variable.other.block.ruby + string.unquoted.heredoc.ruby + 2 - match - , name - punctuation.separator.variable.ruby + punctuation.definition.string.end.ruby + + + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + #escaped_char diff --git a/Tests/heredoc.rb b/Tests/heredoc.rb new file mode 100644 index 0000000..f3722f2 --- /dev/null +++ b/Tests/heredoc.rb @@ -0,0 +1,260 @@ +# = Standard Heredocs ========================================================== + +<