Skip to content

Commit

Permalink
Add changes from today
Browse files Browse the repository at this point in the history
Signed-off-by: Itay Dafna <i.b.dafna@gmail.com>
  • Loading branch information
ibdafna committed Jul 8, 2022
1 parent 63e06bb commit 095b604
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 417 deletions.
2 changes: 2 additions & 0 deletions compiler/src/parsing/ast_helper.re
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ module Exp = {
mk(~loc?, ~attributes?, PExpLambda(a, b));
let apply = (~loc=?, ~attributes=?, a, b) =>
mk(~loc?, ~attributes?, PExpApp(a, b));
let construct = (~loc=?, ~attributes=?, a, b) =>
mk(~loc?, ~attributes?, PExpConstruct(a, b));
// It's difficult to parse rational numbers while division exists (in the
// parser state where you've read NUMBER_INT and you're looking ahead at /,
// you've got a shift/reduce conflict between reducing const -> NUMBER_INT
Expand Down
3 changes: 3 additions & 0 deletions compiler/src/parsing/ast_helper.rei
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ module Exp: {
let apply:
(~loc: loc=?, ~attributes: attributes=?, expression, list(expression)) =>
expression;
let construct:
(~loc: loc=?, ~attributes: attributes=?, id, list(expression)) =>
expression;
let binop:
(~loc: loc=?, ~attributes: attributes=?, expression, list(expression)) =>
expression;
Expand Down
7 changes: 7 additions & 0 deletions compiler/src/parsing/ast_mapper.re
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ module E = {
sub.expr(sub, e),
List.map(sub.expr(sub), el),
)
| PExpConstruct(id, el) =>
construct(
~loc,
~attributes,
map_identifier(sub, id),
List.map(sub.expr(sub), el),
)
| PExpBlock(el) => block(~loc, ~attributes, List.map(sub.expr(sub), el))
| PExpNull => null(~loc, ~attributes, ())
| PExpConstraint(e, t) =>
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/parsing/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(menhir
(modules parser)
(flags --explain --unused-tokens --strict))
(flags --explain --unused-tokens))

;; The following two rules create a copy of the file parser.mly named
;; unitActionsParser.mly. This is a copy of the grammar where the semantic
Expand Down
Loading

0 comments on commit 095b604

Please sign in to comment.