« Previous | Next » 

Revision bd3924a3

IDbd3924a33a66c40065a8fa73b4d7a27aca3b0e04

Added by Michael Roth almost 13 years ago

json-lexer: fix flushing logic to not always go to error state

Currently we flush the lexer by passing in a NULL character. This
generally forces the lexer to go to the corresponding TERMINAL state
for whatever token type it is currently parsing, emits the token to the
parser, then puts the lexer back into IN_START state. However, since a
NULL character causes char_consumed to be 0, we always do a second pass
after this, which puts us in the IN_ERROR state. Fix this behavior by
adding a "flush" flag that tells the lexer not to do a more than 1
iteration.

Signed-off-by: Michael Roth <>
Signed-off-by: Anthony Liguori <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences