Skip to content

Commit

Permalink
Merge pull request #13 from axone-protocol/fix-lexer-comment-close
Browse files Browse the repository at this point in the history
πŸ› Fix mishandling of **/ at the end of bracketed comment.
  • Loading branch information
ccamel authored Oct 7, 2024
2 parents be8584f + 608acbe commit c4c18d4
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 c4c18d4

Please sign in to comment.