Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case xval:
- v:
- (char == '{')
- ? (o := Map(), (path[path.Length] is Array)
- ? path[path.Length].Push(o)
- : path[path.Length][key] := o, path.Push(o), expect := xobj, ji++)
- : (char == '[')
- ? (a := [], (path[path.Length] is Array)
- ? path[path.Length].Push(a)
- : path[path.Length][key] := a, path.Push(a)
- , expect := xarr
- , ji++)
- : (char == str_flag)
- ? (end := InStr(jtxt, str_flag, 1, ji+1))
- is_key
- ? (is_key := 0, key := SubStr(jtxt, ji+1, end-ji-1), expect := xcln, ji := end+1)
- : (rev(SubStr(jtxt, ji+1, end-ji-1)), expect := xend, ji := end+1)
- : err(24, ji, '"', SubStr(jtxt, ji))
- : InStr('-0123456789', char, 1)
- ? RegExMatch(jtxt, '(-?(?:0|[123456789]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?)', &match, ji)
- ? (rev(Number(match[])), expect := xend, ji := match.Pos + match.Len )
- : err(25, ji, , SubStr(jtxt, ji))
- : (char == 't')
- ? (SubStr(jtxt, ji, 4) == 'true')
- ? (rev(true) , ji+=4, expect := xend)
- : err(26, ji + tfn_idx('true', SubStr(jtxt, ji, 4)), 'true' , SubStr(jtxt, ji, 4))
- : (char == 'f')
- ? (SubStr(jtxt, ji, 5) == 'false')
- ? (rev(false), ji+=5, expect := xend)
- : err(27, ji + tfn_idx('false', SubStr(jtxt, ji, 5)), 'false', SubStr(jtxt, ji, 5))
- : (char == 'n')
- ? (SubStr(jtxt, ji, 4) == 'null')
- ? (rev(null) , ji+=4, expect := xend)
- : err(28, ji + tfn_idx('null', SubStr(jtxt, ji, 4)), 'null' , SubStr(jtxt, ji, 4))
- : err(29, ji, '`n`tArray: [ `n`tObject: { `n`tString: " `n`tNumber: -0123456789 `n`ttrue/false/null: tfn ', char)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement