Skip to content

Commit

Permalink
Namebind can return void
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanBrouwer committed Aug 17, 2024
1 parent 9ee6ce0 commit 91b37fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 10 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,13 @@ THE BIG TODO LIST:
- Use a smarter data structure than a HashMap for caching
- Multi-file support
- Grammars can be stored in `let` statement and returned from programs
- How do manage this arena-wise?
- How do manage this arena-wise?


"I found a FnConstruct with two more argument a, b"
Events are the current entries of ActionResult

"Ok, call this function on a, and this function on b please"
"When a or b is done, notify me"

Vars no longer needs to be in PR then
10 changes: 6 additions & 4 deletions prism-parser/src/parser/parser_rule_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,12 @@ pub fn parser_expr<'a, 'arn: 'a, 'grm: 'arn, E: ParseError<L = ErrorLabel<'grm>>
RuleExpr::NameBind(name, sub) => {
let res = parser_expr(rules, block_ctx, sub, vars).parse(pos, state, context);
res.map(|mut res| {
res.free = res
.free
.insert(name, VarMapValue::Value(res.rtrn), state.alloc);
res
PR {
free: res
.free
.insert(name, VarMapValue::Value(res.rtrn), state.alloc),
rtrn: ActionResult::VOID,
}
})
}
RuleExpr::Action(sub, action) => {
Expand Down

0 comments on commit 91b37fa

Please sign in to comment.