Skip to content

Commit

Permalink
[go mode] Don't treat identifiers followed by a dot as builtins
Browse files Browse the repository at this point in the history
Issue #319
  • Loading branch information
marijnh committed Oct 6, 2020
1 parent 3d585fa commit 7b573f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/go.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(factory(global.CodeMirror));
}(this, (function (CodeMirror) { 'use strict';

var e = [/^const(?![a-zA-Z¡-￿_0-9_])/, /^var(?![a-zA-Z¡-￿_0-9_])/, /^type(?![a-zA-Z¡-￿_0-9_])/, /^import(?![a-zA-Z¡-￿_0-9_])/, /^package(?![a-zA-Z¡-￿_0-9_])/, /^func(?![a-zA-Z¡-￿_0-9_])/, /^go(?![a-zA-Z¡-￿_0-9_])/, /^defer(?![a-zA-Z¡-￿_0-9_])/, /^return(?![a-zA-Z¡-￿_0-9_])/, /^break(?![a-zA-Z¡-￿_0-9_])/, /^continue(?![a-zA-Z¡-￿_0-9_])/, /^default(?![a-zA-Z¡-￿_0-9_])/, /^case(?![a-zA-Z¡-￿_0-9_])/, /^select(?![a-zA-Z¡-￿_0-9_])/, /^goto(?![a-zA-Z¡-￿_0-9_])/, /^fallthrough(?![a-zA-Z¡-￿_0-9_])/, /^[a-zA-Z¡-￿__][a-zA-Z¡-￿_0-9_]*/, [1, "\n", "\t", " "], /^[a-zA-Z0-9¡-￿_\.]+/, /^\@[a-zA-Z0-9¡-￿_]+/, [0, /^(?!\*\/|\{?\@[a-zA-Z0-9¡-￿_])/, /^[^]/], /^if(?![a-zA-Z¡-￿_0-9_])/, /^else(?![a-zA-Z¡-￿_0-9_])/, /^switch(?![a-zA-Z¡-￿_0-9_])/, /^for(?![a-zA-Z¡-￿_0-9_])/, /^(?:\!|\+|\-|\*|\^|\&|\<\-)/, /^range(?![a-zA-Z¡-￿_0-9_])/, /^struct(?![a-zA-Z¡-￿_0-9_])/, /^interface(?![a-zA-Z¡-￿_0-9_])/, /^map(?![a-zA-Z¡-￿_0-9_])/, /^chan(?![a-zA-Z¡-￿_0-9_])/, /^(?:(?:0o|0O)[0-7]+|(?:0x|OX)[0-9a-fA-F]+|(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+)(?:[eE][\+\-]?[0-9]+)?i?)/, /^(?:true|false|nil|iota)(?![a-zA-Z¡-￿_0-9_])/, /^make(?![a-zA-Z¡-￿_0-9_])/, /^(?:append|cap|close|complex|copy|delete|imag|len|new|panic|print|println|real|recover)(?![a-zA-Z¡-￿_0-9_])/, /^(?:\+\+|\-\-)/, /^(?:(?:\+|\&\^?|\-|\||\*|\^|\/|\<\<?|\>\>?|\%|\=)\=?|\<\-|\=|\:\=|\!\=)/, /^[a-zA-Z¡-￿__][a-zA-Z¡-￿_0-9_]*(?=\()/, [1, ";", "\n"], /^[a-zA-Z¡-￿__][a-zA-Z¡-￿_0-9_]*(?= *\:)/, /^(?:\.\.\.)?/, /^(?:\.\.\.|(?![\)\,]))/];
var e = [/^const(?![a-zA-Z¡-￿_0-9_])/, /^var(?![a-zA-Z¡-￿_0-9_])/, /^type(?![a-zA-Z¡-￿_0-9_])/, /^import(?![a-zA-Z¡-￿_0-9_])/, /^package(?![a-zA-Z¡-￿_0-9_])/, /^func(?![a-zA-Z¡-￿_0-9_])/, /^go(?![a-zA-Z¡-￿_0-9_])/, /^defer(?![a-zA-Z¡-￿_0-9_])/, /^return(?![a-zA-Z¡-￿_0-9_])/, /^break(?![a-zA-Z¡-￿_0-9_])/, /^continue(?![a-zA-Z¡-￿_0-9_])/, /^default(?![a-zA-Z¡-￿_0-9_])/, /^case(?![a-zA-Z¡-￿_0-9_])/, /^select(?![a-zA-Z¡-￿_0-9_])/, /^goto(?![a-zA-Z¡-￿_0-9_])/, /^fallthrough(?![a-zA-Z¡-￿_0-9_])/, /^[a-zA-Z¡-￿__][a-zA-Z¡-￿_0-9_]*/, [1, "\n", "\t", " "], /^[a-zA-Z0-9¡-￿_\.]+/, /^\@[a-zA-Z0-9¡-￿_]+/, [0, /^(?!\*\/|\{?\@[a-zA-Z0-9¡-￿_])/, /^[^]/], /^if(?![a-zA-Z¡-￿_0-9_])/, /^else(?![a-zA-Z¡-￿_0-9_])/, /^switch(?![a-zA-Z¡-￿_0-9_])/, /^for(?![a-zA-Z¡-￿_0-9_])/, /^(?:\!|\+|\-|\*|\^|\&|\<\-)/, /^range(?![a-zA-Z¡-￿_0-9_])/, /^struct(?![a-zA-Z¡-￿_0-9_])/, /^interface(?![a-zA-Z¡-￿_0-9_])/, /^map(?![a-zA-Z¡-￿_0-9_])/, /^chan(?![a-zA-Z¡-￿_0-9_])/, /^(?:(?:0o|0O)[0-7]+|(?:0x|OX)[0-9a-fA-F]+|(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+)(?:[eE][\+\-]?[0-9]+)?i?)/, /^(?:true|false|nil|iota)(?![a-zA-Z¡-￿_0-9_])/, /^make(?![a-zA-Z¡-￿_0-9_])/, /^(?:append|cap|close|complex|copy|delete|imag|len|new|panic|print|println|real|recover)(?![a-zA-Z¡-￿_0-9_\.])/, /^(?:\+\+|\-\-)/, /^(?:(?:\+|\&\^?|\-|\||\*|\^|\/|\<\<?|\>\>?|\%|\=)\=?|\<\-|\=|\:\=|\!\=)/, /^[a-zA-Z¡-￿__][a-zA-Z¡-￿_0-9_]*(?=\()/, [1, ";", "\n"], /^[a-zA-Z¡-￿__][a-zA-Z¡-￿_0-9_]*(?= *\:)/, /^(?:\.\.\.)?/, /^(?:\.\.\.|(?![\)\,]))/];
var nodes = [
[1, 4, 2],
[/^[^]/, 0],
Expand Down
2 changes: 1 addition & 1 deletion src/go.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ tokens {
builtin="builtin" {
("append" | "cap" | "close" | "complex" | "copy" | "delete" | "imag" |
"len" | "new" | "panic" | "print" | "println" | "real" |
"recover") !identifierChar
"recover") !(identifierChar | ".")
}

binOp="operator" {
Expand Down

0 comments on commit 7b573f3

Please sign in to comment.