diff --git a/lib/rouge/lexers/q.rb b/lib/rouge/lexers/q.rb index 196cac4b2f..4326d9a1f6 100644 --- a/lib/rouge/lexers/q.rb +++ b/lib/rouge/lexers/q.rb @@ -65,7 +65,7 @@ def self.builtins end # White space and comments - rule(%r{[ \t\r]\/.*$}, Comment::Single) + rule(%r{[ \t\r]+\/.*$}, Comment::Single) rule(/[ \t\r]+/, Text::Whitespace) rule(%r{^/$.*?^\\$}m, Comment::Multiline) rule(%r{^\/[^\n]*$(\n[^\S\n]+.*$)*}, Comment::Multiline) diff --git a/spec/visual/samples/q b/spec/visual/samples/q index b1b79b679e..c43df289d5 100644 --- a/spec/visual/samples/q +++ b/spec/visual/samples/q @@ -40,6 +40,8 @@ iasc|idesc|inv|keys|load|log|lsq|ltime|ltrim|maxs|md5|meta|mins|next|parse|plist / Strings ("";"x\n";"\007") +a:1 2 3 / comment with leading whitespaces +b:3 4 5 5 / to bring in line with this comment 10D 10D10 10D10:10 10D10:10:10 10D10:10:10.11 10Dz 10D10p 10D10:10n 10D10:10:10z 10D10:10:10.11p @@ -74,4 +76,4 @@ til eof comment / no effect \ -no effect \ No newline at end of file +no effect