diff --git a/autotests/folding/highlight.rb.fold b/autotests/folding/highlight.rb.fold --- a/autotests/folding/highlight.rb.fold +++ b/autotests/folding/highlight.rb.fold @@ -549,3 +549,25 @@ :@abc :@@abc :$abc + +# squiggly HEREDOC + <<~HEREDOC + Hello!! + HEREDOC + +# HEREDOC with backticks +<<`HEREDOC` + echo "hello" +HEREDOC + +# do not highlight HEREDOC markers after the "class" keyword +# (singleton class definition) (bug: #358273) +class <end +singleton_class = ( class <end ) + +# highlight regular expressions after ": " (bug: #361875) +get 'files/:slug/:filename', to: 'files#download', slug: /^[a-z]+$/, filename: %r|^[/\s]+$| +@@hello!: /regexp/ +[]=: %r!regexp! diff --git a/autotests/html/highlight.rb.html b/autotests/html/highlight.rb.html --- a/autotests/html/highlight.rb.html +++ b/autotests/html/highlight.rb.html @@ -555,4 +555,26 @@ :@abc :@@abc :$abc + +# squiggly HEREDOC + <<~HEREDOC + Hello!! + HEREDOC + +# HEREDOC with backticks +<<`HEREDOC` + echo "hello" +HEREDOC + +# do not highlight HEREDOC markers after the "class" keyword +# (singleton class definition) (bug: #358273) +class <<Foo = Object.new + attr_accessor :foo +end +singleton_class = ( class <<foo; self; end ) + +# highlight regular expressions after ": " (bug: #361875) +get 'files/:slug/:filename', to: 'files#download', slug: /^[a-z]+$/, filename: %r|^[/\s]+$| +@@hello!: /regexp/ +[]=: %r!regexp! diff --git a/autotests/input/highlight.rb b/autotests/input/highlight.rb --- a/autotests/input/highlight.rb +++ b/autotests/input/highlight.rb @@ -549,3 +549,25 @@ :@abc :@@abc :$abc + +# squiggly HEREDOC + <<~HEREDOC + Hello!! + HEREDOC + +# HEREDOC with backticks +<<`HEREDOC` + echo "hello" +HEREDOC + +# do not highlight HEREDOC markers after the "class" keyword +# (singleton class definition) (bug: #358273) +class <:@abc
:@@abc
:$abc
+
+# squiggly HEREDOC
+ <<~HEREDOC
+ Hello!!
+ HEREDOC
+
+# HEREDOC with backticks
+<<`HEREDOC`
+ echo "hello"
+HEREDOC
+
+# do not highlight HEREDOC markers after the "class" keyword
+# (singleton class definition) (bug: #358273)
+class <<Foo = Object.new
+ attr_accessor :foo
+end
+singleton_class = ( class <<foo; self; end )
+
+# highlight regular expressions after ": " (bug: #361875)
+get 'files/:slug/:filename', to: 'files#download', slug: /^[a-z]+$/, filename: %r|^[/\s]+$|
+@@hello!: /regexp/
+[]=: %r!regexp!
diff --git a/data/syntax/ruby.xml b/data/syntax/ruby.xml --- a/data/syntax/ruby.xml +++ b/data/syntax/ruby.xml @@ -31,7 +31,7 @@ warn - - extend - include - prepend - + + extend + include + prepend + @@ -204,7 +204,7 @@ - + @@ -231,7 +231,7 @@ - + - - + + @@ -280,8 +280,10 @@ - - + + + @@ -436,13 +438,17 @@ The contexts below support both normal and indented heredocs --> - + - + + + - + - + + + @@ -467,6 +473,16 @@ + + + + + + + + + + @@ -892,7 +908,7 @@ - + @@ -913,3 +929,5 @@ + +