diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-08-31 13:37:19 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-08-31 13:37:19 +0200 |
commit | 843230359b2157212c4e93b51994f0fde90d808b (patch) | |
tree | 1d22d4efb54f0e4c94564b8e8e1960a0a9fda8ef /src/lib/lexer.mll | |
parent | 6ccbcc2cadae41574e33226b9072a08354880d28 (diff) |
Added endign work in lexer
Diffstat (limited to 'src/lib/lexer.mll')
-rw-r--r-- | src/lib/lexer.mll | 81 |
1 files changed, 43 insertions, 38 deletions
diff --git a/src/lib/lexer.mll b/src/lib/lexer.mll index 07305d8..27a7a8f 100644 --- a/src/lib/lexer.mll +++ b/src/lib/lexer.mll @@ -1,49 +1,54 @@ { - open Tokens + open Prononciation exception Error of string } +let ending = eof | '\n' + rule letter = parse -| '|' { Sep } -| 'a' { A } -| 'b' { B } -| 'c' { C } -| 'd' { D } -| 'e' { E } -| '\232' { E_ACUTE } -| '\xC3' '\xA8' { E_AGRAVE } -| '\233' { E_ACUTE } -| '\xC3' '\xA9' { E_ACUTE } -| 'f' { F } -| 'g' { G } -| 'h' { H } -| 'i' { I } -| 'j' { J } -| 'k' { K } -| 'l' { L } -| 'm' { M } -| "mm" { M } -| 'n' { N } -| "nn" { N } -| 'o' { O } -| 'p' { P } -| 'q' { Q } -| 'r' { R } -| 'u' { U } -| 's' { S } -| 't' { T } -| 'u' { U } -| 'v' { V } -| 'w' { W } -| 'x' { X } -| 'y' { Y } -| 'z' { Z } -| ' ' { Space } -| '\n' { EOL } -| eof { EOL } +| '|' { Sep } +| 'a' { A } +| 'b' { B } +| 'c' { C } +| 'd' { D } +| 'e' { E } +| '\232' { E_ACUTE } +| "è" { E_AGRAVE } +| '\233' { E_ACUTE } +| "é" { E_ACUTE } +| 'f' { F } +| 'g' { G } +| 'h' { H } +| 'i' { I } +| 'j' { J } +| 'k' { K } +| 'l' { L } +| 'm' { M } +| "mm" { M } +| 'n' { N } +| "nn" { N } +| 'o' { O } +| 'p' { P } +| 'q' { Q } +| 'r' { R } +| 'u' { U } +| 's' { S } +| 't' { T } +| 'u' { U } +| 'v' { V } +| 'w' { W } +| 'x' { X } +| 'y' { Y } +| 'z' { Z } +| ' ' { Space } +| ending { EOL } +| "eaux" ending { AUX_ } +| "aux" ending { AUX_ } +| "ient" ending { IENT_ } +| "ent" ending { ENT_ } (* This rule looks for a single line, terminated with '\n' or eof. It returns a pair of an optional string (the line that was found) |