summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-08-31 13:37:19 +0200
committerSébastien Dailly <sebastien@chimrod.com>2021-08-31 13:37:19 +0200
commit843230359b2157212c4e93b51994f0fde90d808b (patch)
tree1d22d4efb54f0e4c94564b8e8e1960a0a9fda8ef /src/test
parent6ccbcc2cadae41574e33226b9072a08354880d28 (diff)
Added endign work in lexer
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bw.conflicts25
-rw-r--r--src/test/bw.mly18
-rw-r--r--src/test/test.ml2
3 files changed, 45 insertions, 0 deletions
diff --git a/src/test/bw.conflicts b/src/test/bw.conflicts
new file mode 100644
index 0000000..58385d2
--- /dev/null
+++ b/src/test/bw.conflicts
@@ -0,0 +1,25 @@
+
+** Conflict (shift/reduce) in state 2.
+** Token involved: W
+** This state is reached from main after reading:
+
+seq W
+
+** The derivations that appear below have the following common factor:
+** (The question mark symbol (?) represents the spot where the derivations begin to differ.)
+
+main
+(?)
+
+** In state 2, looking ahead at W, shifting is permitted
+** because of the following sub-derivation:
+
+seq ending EOL
+ W . W W
+
+** In state 2, looking ahead at W, reducing production
+** seq -> seq W
+** is permitted because of the following sub-derivation:
+
+seq ending EOL // lookahead token appears because ending can begin with W
+seq W .
diff --git a/src/test/bw.mly b/src/test/bw.mly
new file mode 100644
index 0000000..8b022bd
--- /dev/null
+++ b/src/test/bw.mly
@@ -0,0 +1,18 @@
+%token B
+%token W
+%token EOL
+
+%start<unit> main
+
+%%
+
+seq : {}
+ | seq B {}
+ | seq W {}
+ ;
+
+ending : {}
+ | W W W {}
+ ;
+
+main : seq ending EOL {}
diff --git a/src/test/test.ml b/src/test/test.ml
index a9980e4..a3f4598 100644
--- a/src/test/test.ml
+++ b/src/test/test.ml
@@ -48,6 +48,7 @@ let tests =
; "achat", "aSa(t)"
; "ani", "ani"
; "anta", "@ta"
+ ; "anneaux", "ano(s)"
; "arachide", "aRaSid°"
; "as", "a(s)"
; "asia", "azia"
@@ -65,6 +66,7 @@ let tests =
; "loin", "Lw5"
; "groin", "gR[w5]"
; "hirondelle", "iR§dEL°"
+ ; "joues", "ju°(s)"
; "pacha", "paSa"
; "péché", "peSe"
; "persai", "pERsE"