Skip to content

Commit

Permalink
fix mishandling of **/ at the end of bracketed comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
ichiban committed Oct 3, 2024
1 parent 03d3d3d commit 0ec73e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions engine/lexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: `プロログ`}},
Expand Down

0 comments on commit 0ec73e2

Please sign in to comment.