diff --git a/mode/go/go.js b/mode/go/go.js index 8dbdc65d1c..bd54f1ab03 100644 --- a/mode/go/go.js +++ b/mode/go/go.js @@ -46,11 +46,11 @@ CodeMirror.defineMode("go", function(config) { } if (/[\d\.]/.test(ch)) { if (ch == ".") { - stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); + stream.match(/^[0-9_]+([eE][\-+]?[0-9_]+)?/); } else if (ch == "0") { - stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); + stream.match(/^[xX][0-9a-fA-F_]+/) || stream.match(/^[0-7_]+/); } else { - stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); + stream.match(/^[0-9_]*\.?[0-9_]*([eE][\-+]?[0-9_]+)?/); } return "number"; }