summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/go.rb
diff options
context:
space:
mode:
authorNathan Youngman <git@nathany.com>2013-06-23 12:43:50 -0600
committerNathan Youngman <git@nathany.com>2013-06-23 12:43:50 -0600
commit4c877bf0eb655cf2c04a0efb24b4e5f83b97e160 (patch)
tree4dbf8843b92bc0a149d1a606905c6d1a725c0db5 /lib/coderay/scanners/go.rb
parentcad9a00e28d61781d5a12a0556be7126eb790725 (diff)
downloadcoderay-4c877bf0eb655cf2c04a0efb24b4e5f83b97e160.tar.gz
predeclared identifiers
http://golang.org/ref/spec#Predeclared_identifiers
Diffstat (limited to 'lib/coderay/scanners/go.rb')
-rw-r--r--lib/coderay/scanners/go.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/coderay/scanners/go.rb b/lib/coderay/scanners/go.rb
index 04504ab..ae50aa4 100644
--- a/lib/coderay/scanners/go.rb
+++ b/lib/coderay/scanners/go.rb
@@ -31,6 +31,11 @@ module Scanners
'nil', 'iota',
'true', 'false',
] # :nodoc:
+
+ PREDEFINED_FUNCTIONS = %w[
+ append cap close complex copy delete imag len
+ make new panic print println real recover
+ ] # :nodoc:
DIRECTIVES = [
'go_no_directive', # Seems no directive concept in Go?
@@ -40,7 +45,8 @@ module Scanners
add(KEYWORDS, :keyword).
add(PREDEFINED_TYPES, :predefined_type).
add(DIRECTIVES, :directive).
- add(PREDEFINED_CONSTANTS, :predefined_constant) # :nodoc:
+ add(PREDEFINED_CONSTANTS, :predefined_constant).
+ add(PREDEFINED_FUNCTIONS, :predefined) # :nodoc:
ESCAPE = / [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc: