We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://docs.ruby-lang.org/en/master/syntax/control_expressions_rdoc.html#label-Modifier+if+and+unless https://docs.ruby-lang.org/en/master/syntax/control_expressions_rdoc.html#label-Modifier+while+and+until
Patch ruby-heredoc-0409.patch
diff --git a/lexers/LexRuby.cxx b/lexers/LexRuby.cxx index f5e1aec3..fda7450e 100644 --- a/lexers/LexRuby.cxx +++ b/lexers/LexRuby.cxx @@ -645,7 +645,7 @@ bool sureThisIsNotHeredoc(Sci_Position lt2StartPos, Accessor &styler) { return definitely_not_a_here_doc; } else { const char ch = styler[j]; - if (ch == '#' || isEOLChar(ch) || ch == '.' || ch == ',') { + if (ch == '#' || isEOLChar(ch) || ch == '.' || ch == ',' || IsLowerCase(ch)) { // This is OK, so break and continue; break; } else { diff --git a/test/examples/ruby/Issue67.rb b/test/examples/ruby/Issue67.rb index dcdb8c06..406ae308 100644 --- a/test/examples/ruby/Issue67.rb +++ b/test/examples/ruby/Issue67.rb @@ -11,3 +11,22 @@ ONE $stdout.puts <<~EOT.chomp squiggly heredoc EOT + +# modifier if, unless, while and until +alias error puts + +error <<EOF if true +heredoc if true +EOF + +error <<EOF unless false +heredoc unless false +EOF + +error <<EOF while false +heredoc while false +EOF + +error <<EOF until true +heredoc until true +EOF
IsLowerCase(ch) is simple fix to check these keywords as <<indentifier1 indentifier2 is invalid when << is an operator (shift or append).
IsLowerCase(ch)
<<indentifier1 indentifier2
<<
The text was updated successfully, but these errors were encountered:
[Ruby] Allow modifier if, unless, while and until after heredoc delim…
d1a0f69
…iter. See ScintillaOrg/lexilla#236
#236 Allow modifier if, unless, while and until after heredoc delimiter.
b45f40c
No branches or pull requests
https://docs.ruby-lang.org/en/master/syntax/control_expressions_rdoc.html#label-Modifier+if+and+unless
https://docs.ruby-lang.org/en/master/syntax/control_expressions_rdoc.html#label-Modifier+while+and+until
Patch ruby-heredoc-0409.patch
IsLowerCase(ch)
is simple fix to check these keywords as<<indentifier1 indentifier2
is invalid when<<
is an operator (shift or append).The text was updated successfully, but these errors were encountered: