Skip to content

Commit

Permalink
Normalize -0
Browse files Browse the repository at this point in the history
  • Loading branch information
thaliaarchi committed Mar 5, 2023
1 parent c6b2df6 commit 2394d5f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ws.jq
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def parse_inst:
def inst($typ): .prog += [{typ:$typ, pos, pc:.prog|length}];
def inst_num($typ):
.n = 0 | match_char(parse_num; parse_num | .n*=-1; .) |
if .n == 0 then .n = 0 else . end | # Normalize -0
.prog += [{typ:$typ, arg:.n, pos, pc:.prog|length}] |
del(.n);
def inst_lbl($typ):
Expand Down

0 comments on commit 2394d5f

Please sign in to comment.