diff --git a/src/cmd/compile/internal/syntax/scanner.go b/src/cmd/compile/internal/syntax/scanner.go index 807d8383866..24ca4f50eab 100644 --- a/src/cmd/compile/internal/syntax/scanner.go +++ b/src/cmd/compile/internal/syntax/scanner.go @@ -101,6 +101,29 @@ redo: s.line, s.col = s.pos() s.blank = s.line > startLine || startCol == colbase s.start() + + if isLetter(s.ch) { + s.nextch() + // accelerate common case (7bit ASCII) + for isLetter(s.ch) || isDecimal(s.ch) { + s.nextch() + } + + // protocol case (ex. http:// or https://) + if s.ch == ':' { + s.nextch() + if s.ch == '/' { + s.nextch() + if s.ch == '/' { + s.nextch() + s.lineComment() + goto redo + } + } + } + s.rewind() + } + if isLetter(s.ch) || s.ch >= utf8.RuneSelf && s.atIdentChar(true) { s.nextch() s.ident()