Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case xval:
- v:
- if (char == '{') {
- o := Map()
- if (path[path.Length] is Array)
- path[path.Length].Push(o)
- else
- path[path.Length][key] := o
- path.Push(o), expect := xobj, ji++
- } else if (char == '[') {
- a := []
- if (path[path.Length] is Array)
- path[path.Length].Push(a)
- else path[path.Length][key] := a, path.Push(a)
- expect := xarr
- ji++
- } else if (char == str_flag) {
- if (end := InStr(jtxt, str_flag, 1, ji+1))
- if is_key
- is_key := 0
- , key := SubStr(jtxt, ji+1, end-ji-1)
- , expect := xcln, ji := end+1
- else
- rev(SubStr(jtxt, ji+1, end-ji-1))
- , expect := xend, ji := end+1
- else err(24, ji, '"', SubStr(jtxt, ji))
- } else if InStr('-0123456789', char, 1)
- if RegExMatch(jtxt, '(-?(?:0|[123456789]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?)', &match, ji)
- rev(Number(match[]))
- , expect := xend
- , ji := match.Pos + match.Len
- else err(25, ji, , SubStr(jtxt, ji))
- else if (char == 't')
- if (SubStr(jtxt, ji, 4) == 'true')
- rev(true)
- , ji+=4
- , expect := xend
- else err(26, ji + tfn_idx('true', SubStr(jtxt, ji, 4)), 'true' , SubStr(jtxt, ji, 4))
- else if (char == 'f')
- if (SubStr(jtxt, ji, 5) == 'false')
- rev(false)
- , ji+=5
- , expect := xend
- else err(27, ji + tfn_idx('false', SubStr(jtxt, ji, 5)), 'false', SubStr(jtxt, ji, 5))
- else if (char == 'n')
- if (SubStr(jtxt, ji, 4) == 'null')
- rev(null)
- , ji+=4
- , expect := xend
- else err(28, ji + tfn_idx('null', SubStr(jtxt, ji, 4)), 'null' , SubStr(jtxt, ji, 4))
- else 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