Skip to content

Commit

Permalink
Remember last result as _
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Lindig <lindig@gmail.com>
  • Loading branch information
lindig committed Jun 11, 2024
1 parent 544d9e4 commit cdb946e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

let digit = ['0'-'9']
let digits = digit digit*
let alpha = ['a'-'z']
let alpha = ['a'-'z' '_']
let id = alpha (digit|alpha)*

let seconds = digits ('.' digits)?
Expand Down
2 changes: 1 addition & 1 deletion lib/parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let lookup id = Hashtbl.find_opt t id |> function
%%

main:
expr EOL { Some $1 }
expr EOL { add "_" $1; Some $1 }
| stmt EOL { None }
;

Expand Down

0 comments on commit cdb946e

Please sign in to comment.