We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proc initFromJson*[T](dst: var Matrix[T]; p: var JsonParser) = eat(p, tkCurlyLe) var count = 0 while p.tok != tkCurlyRi: if p.tok != tkString: raiseParseErr(p, "string literal as key") case p.a of "m": discard getTok(p) eat(p, tkColon) if count > 1: raiseParseErr(p, "JSON keys in order") count = 1 initFromJson(dst.m, p) of "n": discard getTok(p) eat(p, tkColon) if count > 2: raiseParseErr(p, "JSON keys in order") count = 2 initFromJson(dst.n, p) of "data": discard getTok(p) eat(p, tkColon) if count > 3: raiseParseErr(p, "JSON keys in order") count = 3 eat(p, tkBracketLe) assert dst.m != 0 and dst.n == 0 dst.data = createData[T](dst.m * dst.n) var i = 0 while p.tok != tkBracketRi: initFromJson(dst.data[i], p) inc(i) if p.tok != tkComma: break discard getTok(p) eat(p, tkBracketRi) else: raiseParseErr(p, "valid object field") if p.tok != tkComma: break discard getTok(p) eat(p, tkCurlyRi)
doesn't even seem enough...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
doesn't even seem enough...
The text was updated successfully, but these errors were encountered: