File tree Expand file tree Collapse file tree 5 files changed +9
-0
lines changed Expand file tree Collapse file tree 5 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ tokens:-
115115<state_dclabel> "#root-integrity" { mkL TokenDCRootInteg }
116116<state_dclabel> "#null-confidentiality" { mkL TokenDCNullConf }
117117<state_dclabel> "#null-integrity" { mkL TokenDCNullInteg }
118+ -- Integer literal parsing inspired by https:// github.com/ocaml/ocaml/blob/trunk/parsing/lexer.mll
118119<0> @declit { mkLs (\s -> TokenNum ( read ( filter (/ ='_') s))) }
119120<0> @binlit { mkLs (\s -> TokenNum ( fst ( head ( readBin ( filter (/ ='_') ( drop 2 s)))))) }
120121<0> @octlit { mkLs (\s -> TokenNum ( fst ( head ( readOct ( filter (/ ='_') ( drop 2 s)))))) }
Original file line number Diff line number Diff line change 1+ Parse Error:
2+ Invalid literal 0b12
3+ at 1:5 before end of line
Original file line number Diff line number Diff line change 1+ 0b12
Original file line number Diff line number Diff line change 1+ Parse Error:
2+ Invalid literal 0o8
3+ at 1:4 before end of line
Original file line number Diff line number Diff line change 1+ 0o8
You can’t perform that action at this time.
0 commit comments