From ce31bc25727cfc340c2a4e1c4c87de433a9602a1 Mon Sep 17 00:00:00 2001 From: Christian Rinderknecht Date: Sun, 4 Aug 2019 18:02:56 +0200 Subject: [PATCH] Fixes. --- src/parser/pascaligo/Doc/pascaligo_02.bnf | 4 ++-- src/parser/pascaligo/Doc/pascaligo_03.bnf | 4 ++-- src/parser/pascaligo/Doc/pascaligo_04.bnf | 4 ++-- src/parser/pascaligo/Doc/pascaligo_05.bnf | 4 ++-- src/parser/pascaligo/Doc/pascaligo_06.bnf | 8 +++---- src/parser/pascaligo/Doc/pascaligo_07.bnf | 28 +++++++++++------------ src/parser/pascaligo/Doc/pascaligo_08.bnf | 8 +++---- src/parser/pascaligo/Doc/pascaligo_09.bnf | 8 +++---- src/parser/pascaligo/Doc/pascaligo_10.bnf | 8 +++---- src/parser/pascaligo/Doc/pascaligo_11.bnf | 8 +++---- src/parser/pascaligo/Doc/pascaligo_12.bnf | 8 +++---- src/parser/pascaligo/Doc/pascaligo_13.bnf | 11 +++++---- src/parser/pascaligo/Doc/pascaligo_14.bnf | 11 +++++---- src/parser/pascaligo/Doc/pascaligo_15.bnf | 11 +++++---- src/parser/pascaligo/Doc/pascaligo_16.bnf | 11 +++++---- src/parser/pascaligo/Doc/pascaligo_17.bnf | 11 +++++---- src/parser/pascaligo/Doc/pascaligo_18.bnf | 11 +++++---- src/parser/pascaligo/Doc/pascaligo_19.bnf | 11 +++++---- src/parser/pascaligo/Doc/pascaligo_20.bnf | 15 +++++++----- 19 files changed, 104 insertions(+), 80 deletions(-) diff --git a/src/parser/pascaligo/Doc/pascaligo_02.bnf b/src/parser/pascaligo/Doc/pascaligo_02.bnf index aa116d906..a8fd7f688 100644 --- a/src/parser/pascaligo/Doc/pascaligo_02.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_02.bnf @@ -1,6 +1,6 @@ -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) diff --git a/src/parser/pascaligo/Doc/pascaligo_03.bnf b/src/parser/pascaligo/Doc/pascaligo_03.bnf index dedd68a84..f7893cf6d 100644 --- a/src/parser/pascaligo/Doc/pascaligo_03.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_03.bnf @@ -1,6 +1,6 @@ -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) diff --git a/src/parser/pascaligo/Doc/pascaligo_04.bnf b/src/parser/pascaligo/Doc/pascaligo_04.bnf index c223129f7..5f344787a 100644 --- a/src/parser/pascaligo/Doc/pascaligo_04.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_04.bnf @@ -1,6 +1,6 @@ -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) diff --git a/src/parser/pascaligo/Doc/pascaligo_05.bnf b/src/parser/pascaligo/Doc/pascaligo_05.bnf index 926e1244d..d88b74f78 100644 --- a/src/parser/pascaligo/Doc/pascaligo_05.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_05.bnf @@ -1,6 +1,6 @@ -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) diff --git a/src/parser/pascaligo/Doc/pascaligo_06.bnf b/src/parser/pascaligo/Doc/pascaligo_06.bnf index e62db26aa..f16a91dba 100644 --- a/src/parser/pascaligo/Doc/pascaligo_06.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_06.bnf @@ -1,6 +1,6 @@ -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -195,9 +195,9 @@ single_instr ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET diff --git a/src/parser/pascaligo/Doc/pascaligo_07.bnf b/src/parser/pascaligo/Doc/pascaligo_07.bnf index f9ad66fb4..a6d801368 100644 --- a/src/parser/pascaligo/Doc/pascaligo_07.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_07.bnf @@ -1,6 +1,6 @@ -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -15,31 +15,31 @@ item_or_closing(item,sep,term) ::= (* Compound constructs *) -par(X) ::= LPAR X RPAR +par(item) ::= LPAR item RPAR -brackets(X) ::= LBRACKET X RBRACKET +brackets(item) ::= LBRACKET item RBRACKET (* Sequences *) (* Possibly empty sequence of items *) -seq(X) ::= - option(nseq(X)) +seq(item) ::= + option(nseq(item)) (* Non-empty sequence of items *) -nseq(X) ::= X seq(X) +nseq(item) ::= item seq(item) (* Non-empty separated sequence of items *) -nsepseq(X,Sep) ::= - X -| X Sep nsepseq(X,Sep) +nsepseq(item,Sep) ::= + item +| item Sep nsepseq(item,Sep) (* Possibly empty separated sequence of items *) -sepseq(X,Sep) ::= - option(nsepseq(X,Sep)) +sepseq(item,Sep) ::= + option(nsepseq(item,Sep)) (* Main *) @@ -182,9 +182,9 @@ single_instr ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET diff --git a/src/parser/pascaligo/Doc/pascaligo_08.bnf b/src/parser/pascaligo/Doc/pascaligo_08.bnf index 4944ba91b..f459f2193 100644 --- a/src/parser/pascaligo/Doc/pascaligo_08.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_08.bnf @@ -1,6 +1,6 @@ -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -187,9 +187,9 @@ single_instr ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET diff --git a/src/parser/pascaligo/Doc/pascaligo_09.bnf b/src/parser/pascaligo/Doc/pascaligo_09.bnf index acd43171a..0b15db3ac 100644 --- a/src/parser/pascaligo/Doc/pascaligo_09.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_09.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -193,9 +193,9 @@ single_instr ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET diff --git a/src/parser/pascaligo/Doc/pascaligo_10.bnf b/src/parser/pascaligo/Doc/pascaligo_10.bnf index d0e2f14b9..ae956b3c7 100644 --- a/src/parser/pascaligo/Doc/pascaligo_10.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_10.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -193,9 +193,9 @@ single_instr ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET diff --git a/src/parser/pascaligo/Doc/pascaligo_11.bnf b/src/parser/pascaligo/Doc/pascaligo_11.bnf index 6c9cbf461..569b16392 100644 --- a/src/parser/pascaligo/Doc/pascaligo_11.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_11.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -191,9 +191,9 @@ single_instr ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET diff --git a/src/parser/pascaligo/Doc/pascaligo_12.bnf b/src/parser/pascaligo/Doc/pascaligo_12.bnf index b213b230a..47c399337 100644 --- a/src/parser/pascaligo/Doc/pascaligo_12.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_12.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -195,9 +195,9 @@ path ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET diff --git a/src/parser/pascaligo/Doc/pascaligo_13.bnf b/src/parser/pascaligo/Doc/pascaligo_13.bnf index 135e0052b..7b8146e1c 100644 --- a/src/parser/pascaligo/Doc/pascaligo_13.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_13.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -195,9 +195,9 @@ path ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET @@ -344,5 +344,8 @@ core_pattern ::= | par(cons_pattern) | par(nsepseq(core_pattern,COMMA)) +tuple_pattern ::= + par(nsepseq(core_pattern,COMMA)) + cons_pattern ::= core_pattern CONS pattern diff --git a/src/parser/pascaligo/Doc/pascaligo_14.bnf b/src/parser/pascaligo/Doc/pascaligo_14.bnf index 23718d06b..4973e59b6 100644 --- a/src/parser/pascaligo/Doc/pascaligo_14.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_14.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -195,9 +195,9 @@ path ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET @@ -345,5 +345,8 @@ core_pattern ::= | par(cons_pattern) | par(nsepseq(core_pattern,COMMA)) +tuple_pattern ::= + par(nsepseq(core_pattern,COMMA)) + cons_pattern ::= core_pattern CONS pattern diff --git a/src/parser/pascaligo/Doc/pascaligo_15.bnf b/src/parser/pascaligo/Doc/pascaligo_15.bnf index 0cc9c2070..3f26f6494 100644 --- a/src/parser/pascaligo/Doc/pascaligo_15.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_15.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -195,9 +195,9 @@ path ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET @@ -347,5 +347,8 @@ core_pattern ::= | par(cons_pattern) | par(nsepseq(core_pattern,COMMA)) +tuple_pattern ::= + par(nsepseq(core_pattern,COMMA)) + cons_pattern ::= core_pattern CONS pattern diff --git a/src/parser/pascaligo/Doc/pascaligo_16.bnf b/src/parser/pascaligo/Doc/pascaligo_16.bnf index fcf25c03c..ab6844335 100644 --- a/src/parser/pascaligo/Doc/pascaligo_16.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_16.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -195,9 +195,9 @@ path ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET @@ -350,5 +350,8 @@ core_pattern ::= | par(cons_pattern) | par(nsepseq(core_pattern,COMMA)) +tuple_pattern ::= + par(nsepseq(core_pattern,COMMA)) + cons_pattern ::= core_pattern CONS pattern diff --git a/src/parser/pascaligo/Doc/pascaligo_17.bnf b/src/parser/pascaligo/Doc/pascaligo_17.bnf index 245c2988c..7a1f4c926 100644 --- a/src/parser/pascaligo/Doc/pascaligo_17.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_17.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -195,9 +195,9 @@ path ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET @@ -350,5 +350,8 @@ core_pattern ::= | LPAR cons_pattern RPAR | LPAR nsepseq(core_pattern,COMMA) RPAR +tuple_pattern ::= + par(nsepseq(core_pattern,COMMA)) + cons_pattern ::= core_pattern CONS pattern diff --git a/src/parser/pascaligo/Doc/pascaligo_18.bnf b/src/parser/pascaligo/Doc/pascaligo_18.bnf index d8b378645..6d7911a23 100644 --- a/src/parser/pascaligo/Doc/pascaligo_18.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_18.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -195,9 +195,9 @@ path ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET @@ -353,5 +353,8 @@ paren_pattern ::= cons_pattern | nsepseq(core_pattern,COMMA) +tuple_pattern ::= + par(nsepseq(core_pattern,COMMA)) + cons_pattern ::= core_pattern CONS pattern diff --git a/src/parser/pascaligo/Doc/pascaligo_19.bnf b/src/parser/pascaligo/Doc/pascaligo_19.bnf index a3e90d99e..937290d18 100644 --- a/src/parser/pascaligo/Doc/pascaligo_19.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_19.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -195,9 +195,9 @@ path ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET @@ -353,3 +353,6 @@ paren_pattern ::= core_pattern CONS pattern | core_pattern | core_pattern COMMA nsepseq(core_pattern,COMMA) + +tuple_pattern ::= + par(nsepseq(core_pattern,COMMA)) diff --git a/src/parser/pascaligo/Doc/pascaligo_20.bnf b/src/parser/pascaligo/Doc/pascaligo_20.bnf index 1d2f84afb..3afe57b98 100644 --- a/src/parser/pascaligo/Doc/pascaligo_20.bnf +++ b/src/parser/pascaligo/Doc/pascaligo_20.bnf @@ -5,9 +5,9 @@ right_assoc(item,op) ::= left_assoc(item,op) ::= right_assoc(item,op) -option(X) := +option(item) := (**) -| X +| item series(item,sep,term) ::= item after_item(item,sep,term) @@ -186,9 +186,9 @@ path ::= injection(Kind,element) ::= Kind series(element,SEMI,End) | Kind End -| Kind LBRACKET bracketed +| Kind LBRACKET bracketed(element) -bracketed ::= +bracketed(element) ::= series(element,SEMI,RBRACKET) | RBRACKET @@ -283,7 +283,7 @@ core_expr ::= | C_None | C_Some arguments | Constr option(arguments) -| LPAR paren_expr RPAR +| par(paren_expr) | injection(List,expr) | Nil | structure @@ -332,9 +332,12 @@ core_pattern ::= | Constr option(tuple_pattern) | injection(List,core_pattern) | Nil -| LPAR paren_pattern RPAR +| par(paren_pattern) paren_pattern ::= core_pattern CONS pattern | core_pattern | core_pattern COMMA nsepseq(core_pattern,COMMA) + +tuple_pattern ::= + par(nsepseq(core_pattern,COMMA))