Skip to content

Commit

Permalink
Merge pull request #680 from DanielXMoore/655
Browse files Browse the repository at this point in the history
fix #655
  • Loading branch information
STRd6 authored Sep 2, 2023
2 parents f0d89bf + bfcbd49 commit abff838
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions build/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -euo pipefail

c8 mocha "$@"
tsc
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"docs:build": "yarn build && vitepress build civet.dev",
"docs:preview": "yarn build && vitepress preview civet.dev",
"prepublishOnly": "yarn build && yarn test",
"test": "c8 mocha && tsc"
"test": "bash ./build/test.sh"
},
"author": "Daniel X. Moore",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions source/parser.hera
Original file line number Diff line number Diff line change
Expand Up @@ -2240,6 +2240,7 @@ BracedObjectLiteralContent
// Allow each prop to be a single Property object or an array of such
prop = Array.isArray(prop) ? prop : [prop]
let last = prop[prop.length-1]
if (!last) return []
last = {
...last,
delim,
Expand Down
16 changes: 16 additions & 0 deletions test/object.civet
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,22 @@ describe "object", ->
({z: x.y.z})
"""

testCase """
empty
---
{{}}
---
({})
"""

testCase """
empty
---
{{}, {}}
---
({})
"""

testCase """
call
---
Expand Down

0 comments on commit abff838

Please sign in to comment.