diff --git a/grammars/keywords-ar.lark b/grammars/keywords-ar.lark index 4151d704a90..6bbfaf09e54 100644 --- a/grammars/keywords-ar.lark +++ b/grammars/keywords-ar.lark @@ -35,7 +35,7 @@ _IN: _SPACE ( "ـ"* "ف" "ـ"* "ي" "ـ"* | "in") _SPACE _NOT_IN: _SPACE ( "ـ"* "n" "ـ"* "o" "ـ"* "t" "ـ"* " " "ـ"* "i" "ـ"* "n" "ـ"* | "not in") _SPACE _IF: ( "ـ"* "ا" "ـ"* "ذ" "ـ"* "ا" "ـ"* | "if") _SPACE _ELSE: "ـ"* "و" "ـ"* "إ" "ـ"* "ل" "ـ"* "ا" "ـ"* | "else" -_AND: _SPACE ( "ـ"* "و" "ـ"* | "and") _SPACE +_AND: _SPACE? ( "ـ"* "و" "ـ"* | "and") _SPACE _REPEAT: ( "ـ"* "ك" "ـ"* "ر" "ـ"* "ر" "ـ"* | "repeat") _SPACE _TIMES: _SPACE ( "ـ"* "م" "ـ"* "ر" "ـ"* "ة" "ـ"* | "times") _FOR: ( "ـ"* "ل" "ـ"* "ك" "ـ"* "ل" "ـ"* | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ( "ـ"* "ا" "ـ"* "ل" "ـ"* "ى" "ـ"* | "to") _SPACE _STEP: "ـ"* "خ" "ـ"* "ط" "ـ"* "و" "ـ"* "ة" "ـ"* | "step" _ELIF: _SPACE? ( "ـ"* "و" "ـ"* "إ" "ـ"* "ل" "ـ"* "ا" "ـ"* " " "ـ"* "ا" "ـ"* "ذ" "ـ"* "ا" "ـ"* | "elif") _SPACE _INPUT: ( "ـ"* "ا" "ـ"* "د" "ـ"* "خ" "ـ"* "ل" "ـ"* | "input") -_OR: _SPACE ( "ـ"* "أ" "ـ"* "و" "ـ"* | "or") _SPACE +_OR: _SPACE? ( "ـ"* "أ" "ـ"* "و" "ـ"* | "or") _SPACE _WHILE: ( "ـ"* "ب" "ـ"* "ي" "ـ"* "ن" "ـ"* "م" "ـ"* "ا" "ـ"* | "while") _SPACE _LENGTH: "ـ"* "ط" "ـ"* "و" "ـ"* "ل" "ـ"* | "length" _COLOR : ( "ـ"* "ل" "ـ"* "و" "ـ"* "ن" "ـ"* | "color") _SPACE? diff --git a/grammars/keywords-bg.lark b/grammars/keywords-bg.lark index ea8f2e10fb5..10d7a13921a 100644 --- a/grammars/keywords-bg.lark +++ b/grammars/keywords-bg.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("в" | "in") _SPACE _NOT_IN: _SPACE ("не в/във" | "not in") _SPACE _IF: ("ако" | "if") _SPACE _ELSE: "иначе" | "else" -_AND: _SPACE ("и" | "and") _SPACE +_AND: _SPACE? ("и" | "and") _SPACE _REPEAT: ("повтори" | "repeat") _SPACE _TIMES: _SPACE ("пъти" | "times") _FOR: ("за" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("до" | "to") _SPACE _STEP: "стъпка" | "step" _ELIF: _SPACE? ("иначе ако" | "elif") _SPACE _INPUT: ("въвеждане" | "input") -_OR: _SPACE ("или" | "or") _SPACE +_OR: _SPACE? ("или" | "or") _SPACE _WHILE: ("докато" | "while") _SPACE _LENGTH: "дължина" | "length" _COLOR : ("цвят" | "color") _SPACE? diff --git a/grammars/keywords-bn.lark b/grammars/keywords-bn.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-bn.lark +++ b/grammars/keywords-bn.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-ca.lark b/grammars/keywords-ca.lark index 41de620a499..d12ff0e6f87 100644 --- a/grammars/keywords-ca.lark +++ b/grammars/keywords-ca.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("dins" | "in") _SPACE _NOT_IN: _SPACE ("no dins" | "not in") _SPACE _IF: ("si" | "if") _SPACE _ELSE: "sino" | "else" -_AND: _SPACE ("i" | "and") _SPACE +_AND: _SPACE? ("i" | "and") _SPACE _REPEAT: ("repeteix" | "repeat") _SPACE _TIMES: _SPACE ("vegades" | "times") _FOR: ("per" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("fins" | "to") _SPACE _STEP: "pas" | "step" _ELIF: _SPACE? ("sinosi" | "elif") _SPACE _INPUT: ("entra" | "input") -_OR: _SPACE ("o" | "or") _SPACE +_OR: _SPACE? ("o" | "or") _SPACE _WHILE: ("mentre" | "while") _SPACE _LENGTH: "mida" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-cs.lark b/grammars/keywords-cs.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-cs.lark +++ b/grammars/keywords-cs.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-cy.lark b/grammars/keywords-cy.lark index 731d45a0f4e..a87f0e133fd 100644 --- a/grammars/keywords-cy.lark +++ b/grammars/keywords-cy.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("mewn" | "in") _SPACE _NOT_IN: _SPACE ("dim mewn" | "not in") _SPACE _IF: ("os" | "if") _SPACE _ELSE: "arall" | "else" -_AND: _SPACE ("a" | "and") _SPACE +_AND: _SPACE? ("a" | "and") _SPACE _REPEAT: ("ailadrodd" | "repeat") _SPACE _TIMES: _SPACE ("gwaith" | "times") _FOR: ("ar gyfer" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("i" | "to") _SPACE _STEP: "cam" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("mewnbwn" | "input") -_OR: _SPACE ("neu" | "or") _SPACE +_OR: _SPACE? ("neu" | "or") _SPACE _WHILE: ("tra" | "while") _SPACE _LENGTH: "hyd" | "length" _COLOR : ("lliw" | "color") _SPACE? diff --git a/grammars/keywords-da.lark b/grammars/keywords-da.lark index 77a8cfb5352..b67f5c16e65 100644 --- a/grammars/keywords-da.lark +++ b/grammars/keywords-da.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("farve" | "color") _SPACE? diff --git a/grammars/keywords-de.lark b/grammars/keywords-de.lark index d4d631f0359..b741e3b0d71 100644 --- a/grammars/keywords-de.lark +++ b/grammars/keywords-de.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("nicht in" | "not in") _SPACE _IF: ("falls" | "if") _SPACE _ELSE: "sonst" | "else" -_AND: _SPACE ("und" | "and") _SPACE +_AND: _SPACE? ("und" | "and") _SPACE _REPEAT: ("wiederhole" | "repeat") _SPACE _TIMES: _SPACE ("mal" | "times") _FOR: ("für" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("bis" | "to") _SPACE _STEP: "schritt" | "step" _ELIF: _SPACE? ("sofalls" | "elif") _SPACE _INPUT: ("eingabe" | "input") -_OR: _SPACE ("oder" | "or") _SPACE +_OR: _SPACE? ("oder" | "or") _SPACE _WHILE: ("solange" | "while") _SPACE _LENGTH: "länge" | "length" _COLOR : ("farbe" | "color") _SPACE? diff --git a/grammars/keywords-el.lark b/grammars/keywords-el.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-el.lark +++ b/grammars/keywords-el.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-en.lark b/grammars/keywords-en.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-en.lark +++ b/grammars/keywords-en.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-eo.lark b/grammars/keywords-eo.lark index 25b79be7964..7ac967d52d5 100644 --- a/grammars/keywords-eo.lark +++ b/grammars/keywords-eo.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("en" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("se" | "if") _SPACE _ELSE: "alie" | "else" -_AND: _SPACE ("kaj" | "and") _SPACE +_AND: _SPACE? ("kaj" | "and") _SPACE _REPEAT: ("ripetu" | "repeat") _SPACE _TIMES: _SPACE ("fojojn" | "times") _FOR: ("por" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("ĝis" | "ghis" | "gxis" | "^gis" | "g^is" | "to") _SPACE _STEP: "paŝo" | "pasho" | "pasxo" | "pa^so" | "pas^o" | "step" _ELIF: _SPACE? ("alie se" | "elif") _SPACE _INPUT: ("enigu" | "input") -_OR: _SPACE ("aŭ" | "au" | "aux" | "or") _SPACE +_OR: _SPACE? ("aŭ" | "au" | "aux" | "or") _SPACE _WHILE: ("dum" | "while") _SPACE _LENGTH: "longo" | "length" _COLOR : ("koloro" | "color") _SPACE? diff --git a/grammars/keywords-es.lark b/grammars/keywords-es.lark index 8f86afed3f8..8cbba86648e 100644 --- a/grammars/keywords-es.lark +++ b/grammars/keywords-es.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("en" | "in") _SPACE _NOT_IN: _SPACE ("no en" | "not in") _SPACE _IF: ("si" | "if") _SPACE _ELSE: "sino" | "else" -_AND: _SPACE ("y" | "and") _SPACE +_AND: _SPACE? ("y" | "and") _SPACE _REPEAT: ("repetir" | "repeat") _SPACE _TIMES: _SPACE ("veces" | "times") _FOR: ("para" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("a" | "to") _SPACE _STEP: "paso" | "step" _ELIF: _SPACE? ("sinosi" | "elif") _SPACE _INPUT: ("entrada" | "input") -_OR: _SPACE ("o" | "or") _SPACE +_OR: _SPACE? ("o" | "or") _SPACE _WHILE: ("mientras" | "while") _SPACE _LENGTH: "longitud" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-et.lark b/grammars/keywords-et.lark index eb25ff33a33..250251f3939 100644 --- a/grammars/keywords-et.lark +++ b/grammars/keywords-et.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("nimistus" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("kui" | "if") _SPACE _ELSE: "muidu" | "else" -_AND: _SPACE ("ja" | "and") _SPACE +_AND: _SPACE? ("ja" | "and") _SPACE _REPEAT: ("korda" | "repeat") _SPACE _TIMES: _SPACE ("korda" | "times") _FOR: ("jaoks" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("kuni" | "to") _SPACE _STEP: "sammuga" | "step" _ELIF: _SPACE? ("muidukui" | "elif") _SPACE _INPUT: ("sisesta" | "input") -_OR: _SPACE ("või" | "or") _SPACE +_OR: _SPACE? ("või" | "or") _SPACE _WHILE: ("senikui" | "while") _SPACE _LENGTH: "pikkus" | "length" _COLOR : ("värv" | "color") _SPACE? diff --git a/grammars/keywords-fa.lark b/grammars/keywords-fa.lark index e4b0c448b3f..887835e8c48 100644 --- a/grammars/keywords-fa.lark +++ b/grammars/keywords-fa.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("رنگ" | "color") _SPACE? diff --git a/grammars/keywords-fi.lark b/grammars/keywords-fi.lark index f92782ae2a1..8ba8b2acb18 100644 --- a/grammars/keywords-fi.lark +++ b/grammars/keywords-fi.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("listassa" | "in") _SPACE _NOT_IN: _SPACE ("ei kohteessa" | "not in") _SPACE _IF: ("jos" | "if") _SPACE _ELSE: "muuten" | "else" -_AND: _SPACE ("ja" | "and") _SPACE +_AND: _SPACE? ("ja" | "and") _SPACE _REPEAT: ("toista" | "repeat") _SPACE _TIMES: _SPACE ("kertaa" | "times") _FOR: ("jokaiselle" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("asti" | "to") _SPACE _STEP: "askel" | "step" _ELIF: _SPACE? ("muutenjos" | "elif") _SPACE _INPUT: ("syöte" | "input") -_OR: _SPACE ("tai" | "or") _SPACE +_OR: _SPACE? ("tai" | "or") _SPACE _WHILE: ("kun" | "while") _SPACE _LENGTH: "pituus" | "length" _COLOR : ("väri" | "color") _SPACE? diff --git a/grammars/keywords-fr.lark b/grammars/keywords-fr.lark index b360496b839..509711a7ff3 100644 --- a/grammars/keywords-fr.lark +++ b/grammars/keywords-fr.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("dans" | "in") _SPACE _NOT_IN: _SPACE ("pas dans" | "not in") _SPACE _IF: ("si" | "if") _SPACE _ELSE: "sinon" | "else" -_AND: _SPACE ("et" | "and") _SPACE +_AND: _SPACE? ("et" | "and") _SPACE _REPEAT: ("répète" | "repete" | "repeat") _SPACE _TIMES: _SPACE ("fois" | "times") _FOR: ("pour" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("à" | "to") _SPACE _STEP: "pas" | "step" _ELIF: _SPACE? ("sinon si" | "elif") _SPACE _INPUT: ("demande" | "input") -_OR: _SPACE ("ou" | "or") _SPACE +_OR: _SPACE? ("ou" | "or") _SPACE _WHILE: ("tant que" | "while") _SPACE _LENGTH: "longueur" | "length" _COLOR : ("couleur" | "color") _SPACE? diff --git a/grammars/keywords-fy.lark b/grammars/keywords-fy.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-fy.lark +++ b/grammars/keywords-fy.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-he.lark b/grammars/keywords-he.lark index 34c63e70920..16a6c01a988 100644 --- a/grammars/keywords-he.lark +++ b/grammars/keywords-he.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("בתוך" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("אם" | "if") _SPACE _ELSE: "אחרת" | "else" -_AND: _SPACE ("וגם" | "and") _SPACE +_AND: _SPACE? ("וגם" | "and") _SPACE _REPEAT: ("חזור" | "repeat") _SPACE _TIMES: _SPACE ("פעמים" | "times") _FOR: ("לכל" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("עד" | "to") _SPACE _STEP: "צעד" | "step" _ELIF: _SPACE? ("אחרתאם" | "elif") _SPACE _INPUT: ("קלט" | "input") -_OR: _SPACE ("או" | "or") _SPACE +_OR: _SPACE? ("או" | "or") _SPACE _WHILE: ("כלעוד" | "while") _SPACE _LENGTH: "אורך" | "length" _COLOR : ("צבע" | "color") _SPACE? diff --git a/grammars/keywords-hi.lark b/grammars/keywords-hi.lark index 3ac0f61919c..f760f9e34c1 100644 --- a/grammars/keywords-hi.lark +++ b/grammars/keywords-hi.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("में" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("अगर" | "if") _SPACE _ELSE: "अन्यथा" | "else" -_AND: _SPACE ("और" | "and") _SPACE +_AND: _SPACE? ("और" | "and") _SPACE _REPEAT: ("दोहराना" | "repeat") _SPACE _TIMES: _SPACE ("बार" | "times") _FOR: ("के लिये" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("से" | "to") _SPACE _STEP: "क़दम" | "step" _ELIF: _SPACE? ("एलिफ" | "elif") _SPACE _INPUT: ("इनपुट" | "input") -_OR: _SPACE ("या" | "or") _SPACE +_OR: _SPACE? ("या" | "or") _SPACE _WHILE: ("व्हाइल" | "while") _SPACE _LENGTH: "लंबाई" | "length" _COLOR : ("रंग" | "color") _SPACE? diff --git a/grammars/keywords-hu.lark b/grammars/keywords-hu.lark index 23bd0d2ffeb..3382543e850 100644 --- a/grammars/keywords-hu.lark +++ b/grammars/keywords-hu.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("eleme" | "in") _SPACE _NOT_IN: _SPACE ("nem eleme" | "not in") _SPACE _IF: ("ha" | "if") _SPACE _ELSE: "egyébként" | "else" -_AND: _SPACE ("és" | "and") _SPACE +_AND: _SPACE? ("és" | "and") _SPACE _REPEAT: ("ismételd" | "repeat") _SPACE _TIMES: _SPACE ("alkalommal" | "times") _FOR: ("minden" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("től" | "to") _SPACE _STEP: "lépésenként" | "step" _ELIF: _SPACE? ("egybk-ha" | "elif") _SPACE _INPUT: ("bekér" | "input") -_OR: _SPACE ("vagy" | "or") _SPACE +_OR: _SPACE? ("vagy" | "or") _SPACE _WHILE: ("amíg" | "while") _SPACE _LENGTH: "hossz" | "length" _COLOR : ("szín" | "color") _SPACE? diff --git a/grammars/keywords-ia.lark b/grammars/keywords-ia.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-ia.lark +++ b/grammars/keywords-ia.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-id.lark b/grammars/keywords-id.lark index e6f39e185db..fa916a881da 100644 --- a/grammars/keywords-id.lark +++ b/grammars/keywords-id.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("dalam" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("jika" | "if") _SPACE _ELSE: "lainnya" | "else" -_AND: _SPACE ("dan" | "and") _SPACE +_AND: _SPACE? ("dan" | "and") _SPACE _REPEAT: ("ulangi" | "repeat") _SPACE _TIMES: _SPACE ("kali" | "times") _FOR: ("untuk" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("ke" | "to") _SPACE _STEP: "langkah" | "step" _ELIF: _SPACE? ("lain_jika" | "elif") _SPACE _INPUT: ("masukan" | "input") -_OR: _SPACE ("atau" | "or") _SPACE +_OR: _SPACE? ("atau" | "or") _SPACE _WHILE: ("selama" | "while") _SPACE _LENGTH: "panjang" | "length" _COLOR : ("warna" | "color") _SPACE? diff --git a/grammars/keywords-it.lark b/grammars/keywords-it.lark index 91c1331a0f6..13bfd12cc36 100644 --- a/grammars/keywords-it.lark +++ b/grammars/keywords-it.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("non quello" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "altrimenti" | "else" -_AND: _SPACE ("e" | "and") _SPACE +_AND: _SPACE? ("e" | "and") _SPACE _REPEAT: ("ripeti" | "repeat") _SPACE _TIMES: _SPACE ("volte" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "passo" | "step" _ELIF: _SPACE? ("altrimenti se" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("mentre" | "while") _SPACE _LENGTH: "lunghezza" | "length" _COLOR : ("colore" | "color") _SPACE? diff --git a/grammars/keywords-ja.lark b/grammars/keywords-ja.lark index 6a683f12c05..be3d6fe0f5e 100644 --- a/grammars/keywords-ja.lark +++ b/grammars/keywords-ja.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("かい" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("いろ" | "color") _SPACE? diff --git a/grammars/keywords-kmr.lark b/grammars/keywords-kmr.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-kmr.lark +++ b/grammars/keywords-kmr.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-ko.lark b/grammars/keywords-ko.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-ko.lark +++ b/grammars/keywords-ko.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-mi.lark b/grammars/keywords-mi.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-mi.lark +++ b/grammars/keywords-mi.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-nb_NO.lark b/grammars/keywords-nb_NO.lark index e2b7f394a5c..70ecf337e6a 100644 --- a/grammars/keywords-nb_NO.lark +++ b/grammars/keywords-nb_NO.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("i" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("hvis" | "if") _SPACE _ELSE: "ellers" | "else" -_AND: _SPACE ("og" | "and") _SPACE +_AND: _SPACE? ("og" | "and") _SPACE _REPEAT: ("gjenta" | "repeat") _SPACE _TIMES: _SPACE ("ganger" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("til" | "to") _SPACE _STEP: "steg" | "step" _ELIF: _SPACE? ("elhvis" | "elif") _SPACE _INPUT: ("inndata" | "input") -_OR: _SPACE ("eller" | "or") _SPACE +_OR: _SPACE? ("eller" | "or") _SPACE _WHILE: ("mens" | "while") _SPACE _LENGTH: "lengde" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-nl.lark b/grammars/keywords-nl.lark index 2a76586243e..29461835475 100644 --- a/grammars/keywords-nl.lark +++ b/grammars/keywords-nl.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("niet in" | "not in") _SPACE _IF: ("als" | "if") _SPACE _ELSE: "anders" | "else" -_AND: _SPACE ("en" | "and") _SPACE +_AND: _SPACE? ("en" | "and") _SPACE _REPEAT: ("herhaal" | "repeat") _SPACE _TIMES: _SPACE ("keer" | "times") _FOR: ("voor" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("tot" | "to") _SPACE _STEP: "stap" | "step" _ELIF: _SPACE? ("alsanders" | "elif") _SPACE _INPUT: ("invoer" | "input") -_OR: _SPACE ("of" | "or") _SPACE +_OR: _SPACE? ("of" | "or") _SPACE _WHILE: ("zolang" | "while") _SPACE _LENGTH: "lengte" | "length" _COLOR : ("kleur" | "color") _SPACE? diff --git a/grammars/keywords-pa_PK.lark b/grammars/keywords-pa_PK.lark index 1467eae43ef..3d95448369f 100644 --- a/grammars/keywords-pa_PK.lark +++ b/grammars/keywords-pa_PK.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("اندر" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("جے" | "if") _SPACE _ELSE: "وکھرا" | "else" -_AND: _SPACE ("تے" | "and") _SPACE +_AND: _SPACE? ("تے" | "and") _SPACE _REPEAT: ("دہرا" | "repeat") _SPACE _TIMES: _SPACE ("ضرب" | "times") _FOR: ("جدوں" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("منزل" | "to") _SPACE _STEP: "سطر" | "step" _ELIF: _SPACE? ("ہور" | "elif") _SPACE _INPUT: ("اینپٹ" | "input") -_OR: _SPACE ("یا" | "or") _SPACE +_OR: _SPACE? ("یا" | "or") _SPACE _WHILE: ("جدکہ" | "while") _SPACE _LENGTH: "لمبائی" | "length" _COLOR : ("رنگ" | "color") _SPACE? diff --git a/grammars/keywords-pap.lark b/grammars/keywords-pap.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-pap.lark +++ b/grammars/keywords-pap.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-pl.lark b/grammars/keywords-pl.lark index a27cb24ecf0..40ec702414e 100644 --- a/grammars/keywords-pl.lark +++ b/grammars/keywords-pl.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("w" | "in") _SPACE _NOT_IN: _SPACE ("nie w" | "not in") _SPACE _IF: ("jeżeli" | "if") _SPACE _ELSE: "inaczej" | "else" -_AND: _SPACE ("i" | "and") _SPACE +_AND: _SPACE? ("i" | "and") _SPACE _REPEAT: ("powtórz" | "repeat") _SPACE _TIMES: _SPACE ("razy" | "times") _FOR: ("dla" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("do" | "to") _SPACE _STEP: "krok" | "step" _ELIF: _SPACE? ("albo" | "elif") _SPACE _INPUT: ("wprowadź" | "input") -_OR: _SPACE ("lub" | "or") _SPACE +_OR: _SPACE? ("lub" | "or") _SPACE _WHILE: ("dopóki" | "while") _SPACE _LENGTH: "długość" | "length" _COLOR : ("kolor" | "color") _SPACE? diff --git a/grammars/keywords-pt_BR.lark b/grammars/keywords-pt_BR.lark index c04f55daca8..76e8c7eb685 100644 --- a/grammars/keywords-pt_BR.lark +++ b/grammars/keywords-pt_BR.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("em" | "in") _SPACE _NOT_IN: _SPACE ("não em" | "not in") _SPACE _IF: ("se" | "if") _SPACE _ELSE: "senão" | "else" -_AND: _SPACE ("e" | "and") _SPACE +_AND: _SPACE? ("e" | "and") _SPACE _REPEAT: ("repita" | "repeat") _SPACE _TIMES: _SPACE ("vezes" | "times") _FOR: ("para" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("para" | "to") _SPACE _STEP: "passo" | "step" _ELIF: _SPACE? ("senão se" | "elif") _SPACE _INPUT: ("entrada" | "input") -_OR: _SPACE ("ou" | "or") _SPACE +_OR: _SPACE? ("ou" | "or") _SPACE _WHILE: ("enquanto" | "while") _SPACE _LENGTH: "comprimento" | "length" _COLOR : ("cor" | "color") _SPACE? diff --git a/grammars/keywords-pt_PT.lark b/grammars/keywords-pt_PT.lark index dbc38940b62..97382490152 100644 --- a/grammars/keywords-pt_PT.lark +++ b/grammars/keywords-pt_PT.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "senão" | "else" -_AND: _SPACE ("e" | "and") _SPACE +_AND: _SPACE? ("e" | "and") _SPACE _REPEAT: ("repetir" | "repeat") _SPACE _TIMES: _SPACE ("vezes" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "passo" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("enquanto" | "while") _SPACE _LENGTH: "comprimento" | "length" _COLOR : ("cor" | "color") _SPACE? diff --git a/grammars/keywords-ro.lark b/grammars/keywords-ro.lark index 399e84ad249..689047ad523 100644 --- a/grammars/keywords-ro.lark +++ b/grammars/keywords-ro.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("nu în" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("si" | "and") _SPACE +_AND: _SPACE? ("si" | "and") _SPACE _REPEAT: ("repetă" | "repeat") _SPACE _TIMES: _SPACE ("inmulțit" | "times") _FOR: ("pentru" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("către" | "to") _SPACE _STEP: "pas" | "step" _ELIF: _SPACE? ("altfel dacă" | "elif") _SPACE _INPUT: ("intrare" | "input") -_OR: _SPACE ("sau" | "or") _SPACE +_OR: _SPACE? ("sau" | "or") _SPACE _WHILE: ("în timp ce" | "while") _SPACE _LENGTH: "lungime" | "length" _COLOR : ("culoare" | "color") _SPACE? diff --git a/grammars/keywords-ru.lark b/grammars/keywords-ru.lark index e0fd2fe07b8..94c988f5986 100644 --- a/grammars/keywords-ru.lark +++ b/grammars/keywords-ru.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("в" | "in") _SPACE _NOT_IN: _SPACE ("не в" | "not in") _SPACE _IF: ("если" | "if") _SPACE _ELSE: "иначе" | "else" -_AND: _SPACE ("и" | "and") _SPACE +_AND: _SPACE? ("и" | "and") _SPACE _REPEAT: ("повторить" | "repeat") _SPACE _TIMES: _SPACE ("раз" | "times") _FOR: ("для" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("до" | "to") _SPACE _STEP: "шаг" | "step" _ELIF: _SPACE? ("иначе, если" | "elif") _SPACE _INPUT: ("ввод" | "input") -_OR: _SPACE ("или" | "or") _SPACE +_OR: _SPACE? ("или" | "or") _SPACE _WHILE: ("пока" | "while") _SPACE _LENGTH: "длина" | "length" _COLOR : ("цвет" | "color") _SPACE? diff --git a/grammars/keywords-sl.lark b/grammars/keywords-sl.lark index ee4533ba89b..406866037a5 100644 --- a/grammars/keywords-sl.lark +++ b/grammars/keywords-sl.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("v" | "in") _SPACE _NOT_IN: _SPACE ("ni v" | "not in") _SPACE _IF: ("če" | "if") _SPACE _ELSE: "drugače" | "else" -_AND: _SPACE ("in" | "and") _SPACE +_AND: _SPACE? ("in" | "and") _SPACE _REPEAT: ("ponovi" | "repeat") _SPACE _TIMES: _SPACE ("krat" | "times") _FOR: ("za" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("do" | "to") _SPACE _STEP: "korak" | "step" _ELIF: _SPACE? ("aliče" | "elif") _SPACE _INPUT: ("vnos" | "input") -_OR: _SPACE ("ali" | "or") _SPACE +_OR: _SPACE? ("ali" | "or") _SPACE _WHILE: ("medtem ko" | "while") _SPACE _LENGTH: "dolžina" | "length" _COLOR : ("barva" | "color") _SPACE? diff --git a/grammars/keywords-sq.lark b/grammars/keywords-sq.lark index a4c90cc3171..46457b89f6c 100644 --- a/grammars/keywords-sq.lark +++ b/grammars/keywords-sq.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("në" | "in") _SPACE _NOT_IN: _SPACE ("jo në" | "not in") _SPACE _IF: ("nëse" | "if") _SPACE _ELSE: "ndryshe" | "else" -_AND: _SPACE ("dhe" | "and") _SPACE +_AND: _SPACE? ("dhe" | "and") _SPACE _REPEAT: ("përsërit" | "repeat") _SPACE _TIMES: _SPACE ("her" | "times") _FOR: ("për" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("deri" | "to") _SPACE _STEP: "hap" | "step" _ELIF: _SPACE? ("nendryshe" | "elif") _SPACE _INPUT: ("hyrje" | "input") -_OR: _SPACE ("ose" | "or") _SPACE +_OR: _SPACE? ("ose" | "or") _SPACE _WHILE: ("derisa" | "while") _SPACE _LENGTH: "gjatësia" | "length" _COLOR : ("ngjyrë" | "color") _SPACE? diff --git a/grammars/keywords-sr.lark b/grammars/keywords-sr.lark index fa0ceb93421..44cb136f3c4 100644 --- a/grammars/keywords-sr.lark +++ b/grammars/keywords-sr.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("u" | "in") _SPACE _NOT_IN: _SPACE ("ne/nije u" | "not in") _SPACE _IF: ("ako" | "if") _SPACE _ELSE: "inače" | "else" -_AND: _SPACE ("i" | "and") _SPACE +_AND: _SPACE? ("i" | "and") _SPACE _REPEAT: ("ponovi" | "repeat") _SPACE _TIMES: _SPACE ("vremena" | "times") _FOR: ("za" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("u" | "to") _SPACE _STEP: "korak" | "step" _ELIF: _SPACE? ("inače ako" | "elif") _SPACE _INPUT: ("ulaz" | "input") -_OR: _SPACE ("ili" | "or") _SPACE +_OR: _SPACE? ("ili" | "or") _SPACE _WHILE: ("dok" | "while") _SPACE _LENGTH: "dužina" | "length" _COLOR : ("boja" | "color") _SPACE? diff --git a/grammars/keywords-sv.lark b/grammars/keywords-sv.lark index f8ba1bccafb..fedb08a96b4 100644 --- a/grammars/keywords-sv.lark +++ b/grammars/keywords-sv.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("i" | "in") _SPACE _NOT_IN: _SPACE ("inte i" | "not in") _SPACE _IF: ("om" | "if") _SPACE _ELSE: "annars" | "else" -_AND: _SPACE ("och" | "and") _SPACE +_AND: _SPACE? ("och" | "and") _SPACE _REPEAT: ("upprepa" | "repeat") _SPACE _TIMES: _SPACE ("gånger" | "times") _FOR: ("för" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("till" | "to") _SPACE _STEP: "steg" | "step" _ELIF: _SPACE? ("anom" | "elif") _SPACE _INPUT: ("inmatning" | "input") -_OR: _SPACE ("eller" | "or") _SPACE +_OR: _SPACE? ("eller" | "or") _SPACE _WHILE: ("medan" | "while") _SPACE _LENGTH: "längd" | "length" _COLOR : ("färg" | "color") _SPACE? diff --git a/grammars/keywords-sw.lark b/grammars/keywords-sw.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-sw.lark +++ b/grammars/keywords-sw.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-te.lark b/grammars/keywords-te.lark index 7ddecb875c9..ab0f2c73c25 100644 --- a/grammars/keywords-te.lark +++ b/grammars/keywords-te.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("मेలో" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("ఉంటే" | "if") _SPACE _ELSE: "లేకపోతే" | "else" -_AND: _SPACE ("మరియు" | "and") _SPACE +_AND: _SPACE? ("మరియు" | "and") _SPACE _REPEAT: ("పునరావృతం" | "repeat") _SPACE _TIMES: _SPACE ("సార్లు" | "times") _FOR: ("కోసం" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("కు" | "to") _SPACE _STEP: "అడుగు" | "step" _ELIF: _SPACE? ("మరొకటి ఉంటే" | "elif") _SPACE _INPUT: ("ఇన్పుట్" | "input") -_OR: _SPACE ("లేదా" | "or") _SPACE +_OR: _SPACE? ("లేదా" | "or") _SPACE _WHILE: ("అయితే" | "while") _SPACE _LENGTH: "పొడవు" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-template.lark b/grammars/keywords-template.lark index 772075521e4..6cc7c680388 100644 --- a/grammars/keywords-template.lark +++ b/grammars/keywords-template.lark @@ -35,7 +35,7 @@ _IN: _SPACE ({in} | "in") _SPACE _NOT_IN: _SPACE ({not_in} | "not in") _SPACE _IF: ({if} | "if") _SPACE _ELSE: {else} | "else" -_AND: _SPACE ({and} | "and") _SPACE +_AND: _SPACE? ({and} | "and") _SPACE _REPEAT: ({repeat} | "repeat") _SPACE _TIMES: _SPACE ({times} | "times") _FOR: ({for} | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ({to} | "to") _SPACE _STEP: {step} | "step" _ELIF: _SPACE? ({elif} | "elif") _SPACE _INPUT: ({input} | "input") -_OR: _SPACE ({or} | "or") _SPACE +_OR: _SPACE? ({or} | "or") _SPACE _WHILE: ({while} | "while") _SPACE _LENGTH: {length} | "length" _COLOR : ({color} | "color") _SPACE? diff --git a/grammars/keywords-th.lark b/grammars/keywords-th.lark index ef92ce831b0..f3e2c708063 100644 --- a/grammars/keywords-th.lark +++ b/grammars/keywords-th.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("อยู่ใน" | "in") _SPACE _NOT_IN: _SPACE ("ไม่อยู่ใน" | "not in") _SPACE _IF: ("ถ้า" | "if") _SPACE _ELSE: "ไม่อย่างนั้น" | "else" -_AND: _SPACE ("และ" | "and") _SPACE +_AND: _SPACE? ("และ" | "and") _SPACE _REPEAT: ("ทำซ้ำ" | "repeat") _SPACE _TIMES: _SPACE ("ครั้ง" | "times") _FOR: ("ให้" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("จนถึง" | "to") _SPACE _STEP: "เดิน" | "step" _ELIF: _SPACE? ("หรือถ้า" | "elif") _SPACE _INPUT: ("รับข้อมูล" | "input") -_OR: _SPACE ("หรือ" | "or") _SPACE +_OR: _SPACE? ("หรือ" | "or") _SPACE _WHILE: ("เมื่อไหร่ก็ตามที่" | "while") _SPACE _LENGTH: "ความยาว" | "length" _COLOR : ("สี" | "color") _SPACE? diff --git a/grammars/keywords-tl.lark b/grammars/keywords-tl.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-tl.lark +++ b/grammars/keywords-tl.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-tn.lark b/grammars/keywords-tn.lark index c43a9b849cf..ee132056bbf 100644 --- a/grammars/keywords-tn.lark +++ b/grammars/keywords-tn.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/keywords-tr.lark b/grammars/keywords-tr.lark index a2fe49f5d0e..8f127fa6fd2 100644 --- a/grammars/keywords-tr.lark +++ b/grammars/keywords-tr.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("şunda" | "in") _SPACE _NOT_IN: _SPACE ("şunda değil" | "not in") _SPACE _IF: ("eğer" | "if") _SPACE _ELSE: "değilse" | "else" -_AND: _SPACE ("ve" | "and") _SPACE +_AND: _SPACE? ("ve" | "and") _SPACE _REPEAT: ("tekrarla" | "repeat") _SPACE _TIMES: _SPACE ("kere" | "times") _FOR: ("şunun için" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("şuraya" | "to") _SPACE _STEP: "adım" | "step" _ELIF: _SPACE? ("değileğer" | "elif") _SPACE _INPUT: ("girdi" | "input") -_OR: _SPACE ("veya" | "or") _SPACE +_OR: _SPACE? ("veya" | "or") _SPACE _WHILE: ("şu iken" | "while") _SPACE _LENGTH: "uzunluk" | "length" _COLOR : ("renk" | "color") _SPACE? diff --git a/grammars/keywords-uk.lark b/grammars/keywords-uk.lark index 2ac239c7464..00be226932e 100644 --- a/grammars/keywords-uk.lark +++ b/grammars/keywords-uk.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("в" | "in") _SPACE _NOT_IN: _SPACE ("не в" | "not in") _SPACE _IF: ("якщо" | "if") _SPACE _ELSE: "інакше" | "else" -_AND: _SPACE ("і" | "and") _SPACE +_AND: _SPACE? ("і" | "and") _SPACE _REPEAT: ("повтори" | "repeat") _SPACE _TIMES: _SPACE ("разів" | "рази" | "раз" | "times") _FOR: ("для" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("до" | "to") _SPACE _STEP: "крок" | "step" _ELIF: _SPACE? ("інакше якщо" | "elif") _SPACE _INPUT: ("введи" | "input") -_OR: _SPACE ("або" | "or") _SPACE +_OR: _SPACE? ("або" | "or") _SPACE _WHILE: ("тоді як" | "while") _SPACE _LENGTH: "довжина" | "length" _COLOR : ("колір" | "color") _SPACE? diff --git a/grammars/keywords-ur.lark b/grammars/keywords-ur.lark index 38b1e72585a..5da6bc02e3c 100644 --- a/grammars/keywords-ur.lark +++ b/grammars/keywords-ur.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("میں" | "in") _SPACE _NOT_IN: _SPACE ("نہیں ہے" | "not in") _SPACE _IF: ("اگر" | "if") _SPACE _ELSE: "ورنہ" | "else" -_AND: _SPACE ("اور" | "and") _SPACE +_AND: _SPACE? ("اور" | "and") _SPACE _REPEAT: ("مکرر" | "repeat") _SPACE _TIMES: _SPACE ("دفعہ" | "times") _FOR: ("فی" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("سے" | "to") _SPACE _STEP: "قدم" | "step" _ELIF: _SPACE? ("یااگر" | "elif") _SPACE _INPUT: ("بتاؤ" | "input") -_OR: _SPACE ("یا" | "or") _SPACE +_OR: _SPACE? ("یا" | "or") _SPACE _WHILE: ("جبتک" | "while") _SPACE _LENGTH: "لمبائی" | "length" _COLOR : ("رنگ" | "color") _SPACE? diff --git a/grammars/keywords-vi.lark b/grammars/keywords-vi.lark index 6bafc9308e7..397fe08c37b 100644 --- a/grammars/keywords-vi.lark +++ b/grammars/keywords-vi.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("nếu" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("và" | "and") _SPACE +_AND: _SPACE? ("và" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("hoặc" | "or") _SPACE +_OR: _SPACE? ("hoặc" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("màu" | "color") _SPACE? diff --git a/grammars/keywords-zh_Hans.lark b/grammars/keywords-zh_Hans.lark index b7c2a5d6a25..46c72e6da66 100644 --- a/grammars/keywords-zh_Hans.lark +++ b/grammars/keywords-zh_Hans.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("在里面" | "in") _SPACE _NOT_IN: _SPACE ("不在" | "not in") _SPACE _IF: ("如果" | "if") _SPACE _ELSE: "否则" | "else" -_AND: _SPACE ("并且" | "and") _SPACE +_AND: _SPACE? ("并且" | "and") _SPACE _REPEAT: ("重复" | "repeat") _SPACE _TIMES: _SPACE ("次" | "times") _FOR: ("取" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("到" | "to") _SPACE _STEP: "步" | "step" _ELIF: _SPACE? ("否则如果" | "elif") _SPACE _INPUT: ("输入" | "input") -_OR: _SPACE ("或" | "or") _SPACE +_OR: _SPACE? ("或" | "or") _SPACE _WHILE: ("当" | "while") _SPACE _LENGTH: "长度" | "length" _COLOR : ("颜色" | "color") _SPACE? diff --git a/grammars/keywords-zh_Hant.lark b/grammars/keywords-zh_Hant.lark index d7fefcae39b..c461b233dd9 100644 --- a/grammars/keywords-zh_Hant.lark +++ b/grammars/keywords-zh_Hant.lark @@ -35,7 +35,7 @@ _IN: _SPACE ("in" | "in") _SPACE _NOT_IN: _SPACE ("not in" | "not in") _SPACE _IF: ("if" | "if") _SPACE _ELSE: "else" | "else" -_AND: _SPACE ("and" | "and") _SPACE +_AND: _SPACE? ("and" | "and") _SPACE _REPEAT: ("repeat" | "repeat") _SPACE _TIMES: _SPACE ("times" | "times") _FOR: ("for" | "for") _SPACE @@ -44,7 +44,7 @@ _TO: _SPACE ("to" | "to") _SPACE _STEP: "step" | "step" _ELIF: _SPACE? ("elif" | "elif") _SPACE _INPUT: ("input" | "input") -_OR: _SPACE ("or" | "or") _SPACE +_OR: _SPACE? ("or" | "or") _SPACE _WHILE: ("while" | "while") _SPACE _LENGTH: "length" | "length" _COLOR : ("color" | "color") _SPACE? diff --git a/grammars/level6-Additions.lark b/grammars/level6-Additions.lark index 99e10ece493..c6138fb477b 100644 --- a/grammars/level6-Additions.lark +++ b/grammars/level6-Additions.lark @@ -11,8 +11,7 @@ ask: var (_IS | _EQUALS) _ASK (_print_argument)? play: _PLAY (list_access | expression | textwithoutspaces) equality_check: (textwithoutspaces | INT) (_IS | _EQUALS) (quoted_text| textwithoutspaces | INT) - -condition:+= in_list_check | not_in_list_check | equality_check +condition: >> equality_check list_access_var: var (_IS | _EQUALS) var _AT (INT | random) assign_button: NAME (_IS | _EQUALS) _BUTTON diff --git a/tests/test_level/test_level_16.py b/tests/test_level/test_level_16.py index 919f8a5cdda..c3e10714563 100644 --- a/tests/test_level/test_level_16.py +++ b/tests/test_level/test_level_16.py @@ -593,6 +593,29 @@ def test_color_with_list_access_random(self): extra_check_function=self.is_turtle(), ) + # + # and/or commands + # + @parameterized.expand(['and', 'or']) + def test_if_list_access_lhs_and_or(self, op): + code = textwrap.dedent(f"""\ + colors = ['red', 'green', 'blue'] + if colors[1] == colors[2] {op} 1 == 1 + print 'red'""") + + expected = HedyTester.dedent( + "colors = ['red', 'green', 'blue']", + self.list_access_transpiled('colors[int(1)-1]'), + self.list_access_transpiled('colors[int(2)-1]'), + f"""\ + if convert_numerals('Latin', colors[int(1)-1]) == convert_numerals('Latin', colors[int(2)-1]) {op} convert_numerals('Latin', '1') == convert_numerals('Latin', '1'): + print(f'''red''')""") + + self.single_level_tester( + code=code, + expected=expected, + ) + # # in/not-in list commands # diff --git a/tests/test_level/test_level_17.py b/tests/test_level/test_level_17.py index 8330f51b924..e4e225c0ee4 100644 --- a/tests/test_level/test_level_17.py +++ b/tests/test_level/test_level_17.py @@ -127,6 +127,26 @@ def test_if_elif_boolean(self): self.single_level_tester(code=code, expected=expected) + @parameterized.expand(['and', 'or']) + def test_if_list_access_lhs_and_or(self, op): + code = textwrap.dedent(f"""\ + colors = ['red', 'green', 'blue'] + if colors[1] == colors[2] {op} 1 == 1: + print 'red'""") + + expected = HedyTester.dedent( + "colors = ['red', 'green', 'blue']", + self.list_access_transpiled('colors[int(1)-1]'), + self.list_access_transpiled('colors[int(2)-1]'), + f"""\ + if convert_numerals('Latin', colors[int(1)-1]) == convert_numerals('Latin', colors[int(2)-1]) {op} convert_numerals('Latin', '1') == convert_numerals('Latin', '1'): + print(f'''red''')""") + + self.single_level_tester( + code=code, + expected=expected, + ) + def test_for_loop(self): code = textwrap.dedent("""\ a is 2 diff --git a/tests/test_level/test_level_18.py b/tests/test_level/test_level_18.py index a48527d8b20..82431bf40c9 100644 --- a/tests/test_level/test_level_18.py +++ b/tests/test_level/test_level_18.py @@ -353,3 +353,23 @@ def nested_function(): expected=expected, skipped_mappings=skipped_mappings, ) + + @parameterized.expand(['and', 'or']) + def test_if_list_access_lhs_and_or(self, op): + code = textwrap.dedent(f"""\ + colors = ['red', 'green', 'blue'] + if colors[1] == colors[2] {op} 1 == 1: + print('red')""") + + expected = HedyTester.dedent( + "colors = ['red', 'green', 'blue']", + self.list_access_transpiled('colors[int(1)-1]'), + self.list_access_transpiled('colors[int(2)-1]'), + f"""\ + if convert_numerals('Latin', colors[int(1)-1]) == convert_numerals('Latin', colors[int(2)-1]) {op} convert_numerals('Latin', '1') == convert_numerals('Latin', '1'): + print(f'''red''')""") + + self.single_level_tester( + code=code, + expected=expected, + )