Skip to content

Commit

Permalink
Fix syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghislain Fourny committed Jul 31, 2024
1 parent ff247cf commit 4b51c0d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(:JIQS: ShouldRun; Output="{ "b" : 2, "c" : 3, "d" : 4 }" :)
copy $je := {"a": 1, "b": 2, "c": 3, "d": 4}
modify (delete $je.a, replace value of $je.a with 5)
modify (delete json $je.a, replace value of json $je.a with 5)
return $je
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(:JIQS: ShouldCrash; ErrorCode="JNUP0016"; ErrorMetadata="LINE:3:COLUMN:7:" :)
copy $je := [1 to 4]
modify insert 5 into $je at position 6
modify insert json 5 into $je at position 6
return $je

(: selector expr does not evaluate to int within range of the target array :)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(:JIQS: ShouldCrash; ErrorCode="RBDY0007"; ErrorMetadata="LINE:3:COLUMN:7:" :)
let $data := {"bool" : true, "int": 10}
return delete $data.bool
return delete json $data.bool

(: attempt to modify immutable variable :)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(:JIQS: ShouldCrash; ErrorCode="XUST0001"; ErrorMetadata="LINE:4:COLUMN:8:" :)
copy $je := { "a" : {"foo" : 1}}
modify
let $l := rename $je.a.foo as "b"
let $l := rename json $je.a.foo as "b"
return
rename $l.foo as "b"
rename json $l.foo as "b"
return $je

(: expr in let clause is not simple :)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ declare updating function local:upsert($o as object, $key as string, $val as ite
()
};
copy $je := {"a" : 1, "b" : 2}
modify local:upsert(insert "c" : 3 into $je, "c", 3)
modify local:upsert(insert json "c" : 3 into $je, "c", 3)
return $je
(: argument of function call is not simple :)

0 comments on commit 4b51c0d

Please sign in to comment.