ThinkOpenly / sail

Sail architecture definition language
Other
11 stars 12 forks source link

JSON is malformed #28

Closed ThinkOpenly closed 5 months ago

ThinkOpenly commented 5 months ago

Trying to load JSON currently emitted with make json fails:

$ python3 -c "import json; f=open('make-json.out'); j=json.load(f)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 15446 column 3 (char 3071881)
ThinkOpenly commented 5 months ago

The tail end of the new "functions" content from commit 4aa402457cc55b1e3b6fac20f18091aff0f5b1fc has a lingering comma after the last element:

  {
    "name": "riscv_f32Div",
    "source": "{\n  extern_f32Div(rm, v1, v2);\n  (float_fflags[4 .. 0], float_result[31 .. 0])\n}"
  },
  ]
}
ThinkOpenly commented 5 months ago

Fixed via 7ad136c5b2ba1e9c1cf9fef911a20173b7394042