Turn a potential assertion failure into a syntax error

This commit is contained in:
Zahary Karadjov 2020-08-01 19:28:36 +03:00
parent d5eb9427b8
commit 9ca88fdcd4
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,7 @@ type
etNumber = "number" etNumber = "number"
etString = "string" etString = "string"
etComma = "comma" etComma = "comma"
etColon = "colon"
etBracketLe = "array start bracket" etBracketLe = "array start bracket"
etBracketRi = "array end bracker" etBracketRi = "array end bracker"
etCurrlyLe = "object start bracket" etCurrlyLe = "object start bracket"
@ -140,6 +141,7 @@ proc requireToken*(r: JsonReader, tk: TokKind) =
of tkBracketLe: etBracketLe of tkBracketLe: etBracketLe
of tkCurlyRi: etCurrlyRi of tkCurlyRi: etCurrlyRi
of tkCurlyLe: etCurrlyLe of tkCurlyLe: etCurrlyLe
of tkColon: etColon
else: (doAssert false; etBool) else: (doAssert false; etBool)
proc skipToken*(r: var JsonReader, tk: TokKind) = proc skipToken*(r: var JsonReader, tk: TokKind) =