Skip to content

Commit

Permalink
Fix function call lexer skipping one trailing character
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgio committed Jun 22, 2024
1 parent 66f882f commit 7ea5305
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class FunctionCallArgumentsWalkerLexer(
} else {
// The text outside the delimiters does not represent a named argument:
// end of the function call.
reader.index = startIndex // Rollback
reader.index = startIndex - 1 // Rollback
break
}
}
Expand All @@ -199,6 +199,8 @@ class FunctionCallArgumentsWalkerLexer(
// and the lexing operation is not affected by this walking.
if (it.isEmpty()) {
reader.index = 0
}
} /*else {
reader.index--
}*/
}
}
1 change: 1 addition & 0 deletions core/src/test/kotlin/eu/iamgio/quarkdown/LexerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ class LexerTest {
assertIs<StrongToken>(tokens.next())
assertIs<PlainTextToken>(tokens.next())
assertIs<FunctionCallToken>(tokens.next())
assertIs<PlainTextToken>(tokens.next())
assertIs<FunctionCallToken>(tokens.next())
assertIs<PlainTextToken>(tokens.next())

Expand Down

0 comments on commit 7ea5305

Please sign in to comment.