summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-23 18:15:22 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-23 18:15:22 +0200
commit7ef6f7783d788bf656a3c59600cd45cd5b694376 (patch)
treec48e20b4831df00a1b0391e3ab8a761b44ef9c4b /lib/coderay
parentafa2be73c03d033056024354787abd66f2ff7fa0 (diff)
downloadcoderay-7ef6f7783d788bf656a3c59600cd45cd5b694376.tar.gz
add support for raw strings in Go
Diffstat (limited to 'lib/coderay')
-rw-r--r--lib/coderay/scanners/go.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/coderay/scanners/go.rb b/lib/coderay/scanners/go.rb
index dbf9595..c0c602d 100644
--- a/lib/coderay/scanners/go.rb
+++ b/lib/coderay/scanners/go.rb
@@ -103,7 +103,14 @@ module Scanners
end
encoder.text_token match, :delimiter
state = :string
-
+
+ elsif match = scan(/ ` ([^`]+)? (`)? /x)
+ encoder.begin_group :shell
+ encoder.text_token '`', :delimiter
+ encoder.text_token self[1], :content if self[1]
+ encoder.text_token self[2], :delimiter if self[2]
+ encoder.end_group :shell
+
elsif match = scan(/ \# \s* if \s* 0 /x)
match << scan_until(/ ^\# (?:elif|else|endif) .*? $ | \z /xm) unless eos?
encoder.text_token match, :comment