Skip to content

Commit 4c877bf

Browse files
committed
1 parent cad9a00 commit 4c877bf

File tree

1 file changed

+7
-1
lines changed
  • lib/coderay/scanners

1 file changed

+7
-1
lines changed

lib/coderay/scanners/go.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class Go < Scanner
3131
'nil', 'iota',
3232
'true', 'false',
3333
] # :nodoc:
34+
35+
PREDEFINED_FUNCTIONS = %w[
36+
append cap close complex copy delete imag len
37+
make new panic print println real recover
38+
] # :nodoc:
3439

3540
DIRECTIVES = [
3641
'go_no_directive', # Seems no directive concept in Go?
@@ -40,7 +45,8 @@ class Go < Scanner
4045
add(KEYWORDS, :keyword).
4146
add(PREDEFINED_TYPES, :predefined_type).
4247
add(DIRECTIVES, :directive).
43-
add(PREDEFINED_CONSTANTS, :predefined_constant) # :nodoc:
48+
add(PREDEFINED_CONSTANTS, :predefined_constant).
49+
add(PREDEFINED_FUNCTIONS, :predefined) # :nodoc:
4450

4551
ESCAPE = / [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
4652
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:

0 commit comments

Comments
 (0)