diff --git a/engine/lexer.go b/engine/lexer.go index 4d9b887..637a878 100644 --- a/engine/lexer.go +++ b/engine/lexer.go @@ -296,6 +296,8 @@ func (l *Lexer) commentClose() (Token, error) { return Token{}, err case r == '/': return l.layoutTextSequence(true) + case r == '*': + return l.commentClose() default: return l.commentText(true) } diff --git a/engine/lexer_test.go b/engine/lexer_test.go index 814f06b..2be6d98 100644 --- a/engine/lexer_test.go +++ b/engine/lexer_test.go @@ -40,6 +40,7 @@ func TestLexer_Token(t *testing.T) { {input: `/ *`, token: Token{kind: tokenGraphic, val: `/`}}, {input: "/* comment *", err: io.EOF}, {input: `/🙈`, err: errMonkey}, + {input: `/* **/foo`, token: Token{kind: tokenLetterDigit, val: "foo"}}, // https://github.com/ichiban/prolog/issues/326 {input: `改善`, token: Token{kind: tokenLetterDigit, val: `改善`}}, {input: `プロログ`, token: Token{kind: tokenLetterDigit, val: `プロログ`}},