Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
glyh committed Sep 16, 2024
1 parent de5342b commit 486fb2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/parser/parser.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fn parser() -> PS {
let expr_ref : Ref[PS] = { val: empty() }
let stmt_ref : Ref[PS] = { val: empty() }
let block_expr = tok(@lex.LBRACE) >>
// HACK: there's test case that uses `{}`
(ref(stmt_ref) + epsilon().replace(S::Unit)) <<
tok(@lex.RBRACE)

Expand Down Expand Up @@ -211,7 +212,6 @@ fn parser() -> PS {
let_tup_head(false) +
lift2_maybe(
fn(get_expr, rhs) {
// HACK: comment below to relax enforcement
match get_expr {
S::Get(_, _) => ()
_ => return None
Expand All @@ -221,11 +221,6 @@ fn parser() -> PS {
get_or_apply,
tok(@lex.ASSIGN) >> ref(expr_ref),
)
// HACK: To support sequencing exps:
//+
//ref(expr_ref).map(
// fn { exp => fn(rest) { S::Let(("_", fix_type(None)), exp, rest) } },
//)
stmt_ref.val = fold_right(
ref(expr_ref),
stmt_head,
Expand All @@ -245,9 +240,7 @@ fn parser() -> PS {
_ => true
},
) +
let_head(true) +
// HACK: relax to accept tuple let at top level
let_tup_head(true)
let_head(true)
fold_right(
tok(@lex.EOF).replace(S::Unit),
// NOTE: top level definitions must start at the beginning of line
Expand Down
3 changes: 3 additions & 0 deletions test/test_src/bad.mbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main {

};

0 comments on commit 486fb2a

Please sign in to comment.