Skip to content

Commit

Permalink
fix syntax inside dict
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Metelkin committed Nov 26, 2023
1 parent 8409523 commit adf0df5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 32 deletions.
63 changes: 32 additions & 31 deletions src/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/pegjs/heta.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Note "Note" = "'''" s:(!"!(''')" s:("\\'"/[^']))+ "'''" (Break/Space)*
return { notes };
}

Dict "Dict" = "{" (Break/Space)* Comment* item: DictPair* (Break/Space)* "}"
Dict "Dict" = "{" (Break/Space/Comment)* item: DictPair* (Break/Space/Comment)* "}"
{
return _.fromPairs(item);
}
Expand Down
6 changes: 6 additions & 0 deletions test/parse/input/comments.heta
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ scn4 {
type: kinetic,
method: {timeRange: [0,120], timeStep: 2, solver: lsoda}
};

scn5 {
class: Model,
//scope: one,
//type: kinetic
};
5 changes: 5 additions & 0 deletions test/parse/output/comments.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,10 @@
"timeStep": 2,
"solver": "lsoda"
}
},
{
"action": "upsert",
"id": "scn5",
"class": "Model"
}
]

0 comments on commit adf0df5

Please sign in to comment.