diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-01 18:33:26 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-01 18:33:26 +0200 |
commit | 12ccc075d724f9985be488b162b243f46dff871a (patch) | |
tree | ae788a28754397db7ad009c011b9c02818cc555d /src/lib/prononciation.mly | |
parent | 843230359b2157212c4e93b51994f0fde90d808b (diff) |
Made all tests pass
Diffstat (limited to 'src/lib/prononciation.mly')
-rw-r--r-- | src/lib/prononciation.mly | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/lib/prononciation.mly b/src/lib/prononciation.mly index bd97632..63bf2a1 100644 --- a/src/lib/prononciation.mly +++ b/src/lib/prononciation.mly @@ -8,10 +8,17 @@ *) open Tokens + + let letter_e = function + | Accent.NONE -> Tokens.E + | Accent.AGRAVE -> Tokens.E_AGRAVE + | Accent.ACUTE -> Tokens.E_ACUTE + %} -%token AUX_ +%token X_ %token ENT_ +%token EL_ %token IENT_ %token Sep @@ -19,7 +26,7 @@ %token B %token C %token D -%token E +%token<Accent.t> E %token E_ACUTE %token E_AGRAVE %token F @@ -32,12 +39,10 @@ %token M %token N %token O -%token OU %token Q %token P %token R %token S -%token SZ %token T %token U %token V @@ -58,15 +63,13 @@ voyel: | A { A } - | E { E } + | E { letter_e $1 } | I { I } | O { O } | A U { O } | E A U { O } | O U { OU } | U { U } - | E_ACUTE { E_ACUTE } - | E_AGRAVE { E_AGRAVE } letters: @@ -78,7 +81,7 @@ letters: | C { K :: [] } | C H { X :: [] } | C I { S :: I :: [] } - | C E { S :: E :: [] } + | C E { S :: letter_e $2 :: [] } | C U { K :: U :: [] } | C U I { K :: I :: [] } | C U E { K :: E :: [] } @@ -87,15 +90,15 @@ letters: | F { F :: [] } | G { G :: [] } | G I { J :: I :: [] } - | G E { J :: E :: [] } + | G E { J :: letter_e $2 :: [] } | G U { G :: U :: [] } | G U I { G :: I :: [] } - | G U E { G :: E :: [] } + | G U E { G :: letter_e $3 :: [] } | H { Sep :: [] } | J { J :: [] } | K { K :: [] } - | E L { E :: L :: [] } + | E L { letter_e $1 :: L :: [] } | E L L { E_AGRAVE :: L :: [] } | I L { I :: L :: [] } | I L L { I :: Y :: [] } @@ -128,9 +131,10 @@ letters: | Z { Z :: [] } ending: - | AUX_ { O::S::EOL::[]} + | X_ { S::EOL::[]} | IENT_ { I::T::EOL::[]} | ENT_ { E::T::EOL::[]} + | EL_ { E_AGRAVE::L::EOL::[]} | EOL { EOL::[] } main: |