Turn a potential assertion failure into a syntax error
This commit is contained in:
parent
d5eb9427b8
commit
9ca88fdcd4
|
@ -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) =
|
||||||
|
|
Loading…
Reference in New Issue