diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2013-07-13 20:34:10 +0200 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2013-07-13 20:34:10 +0200 |
commit | 6dd14ef018ee4417771504117819121bd4b8520d (patch) | |
tree | ec543688aa3a3394e2ec8ec4cf6999f07c70af61 /lib/coderay | |
parent | bbe4d72ba785f1bd6fd703d63b096a907da1b09f (diff) | |
download | coderay-6dd14ef018ee4417771504117819121bd4b8520d.tar.gz |
be a bit more graceful with buggy Go strings
Diffstat (limited to 'lib/coderay')
-rw-r--r-- | lib/coderay/scanners/go.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/coderay/scanners/go.rb b/lib/coderay/scanners/go.rb index 938da9d..5034adc 100644 --- a/lib/coderay/scanners/go.rb +++ b/lib/coderay/scanners/go.rb @@ -165,9 +165,10 @@ module Scanners label_expected = false elsif match = scan(/ \\ (?: #{ESCAPE} | #{UNICODE_ESCAPE} ) /mox) encoder.text_token match, :char - elsif match = scan(/ \\ | $ /x) + elsif match = scan(/ \\ /x) + encoder.text_token match, :error + elsif match = scan(/$/) encoder.end_group :string - encoder.text_token match, :error unless match.empty? state = :initial label_expected = false else |