Skip to content

Commit

Permalink
predeclared identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
nathany committed Jun 23, 2013
1 parent cad9a00 commit 4c877bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/coderay/scanners/go.rb
Expand Up @@ -31,6 +31,11 @@ class Go < Scanner
'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?
Expand All @@ -40,7 +45,8 @@ class Go < Scanner
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:
Expand Down

0 comments on commit 4c877bf

Please sign in to comment.