Skip to content

Commit

Permalink
🪲 Allow list access to appear on lhs of and/or conditions (#5410)
Browse files Browse the repository at this point in the history
Fixes #5398 
In level 17, the OR and AND conditions could not have a list access on the left hand side. The problem occurs because the `]` has optional space after it while the `and/or` operator has mandatory space before it. When parsing `if 'red' == colors[1] and ...`, the parser matches the space between `]` and `and` as the optional space after `]` and not as the mandatory space before `and`.

The solution in this PR relaxes the constraint in the `and` and `or` operators by making the space before them optional.

**How to test**
- Confirm that the following program works correctly in level 17:
```
f = ['.', '.', '.']
if f[1] == f[2] and f[2] == f[3]
    print 'test'
```
  • Loading branch information
boryanagoncharenko committed Apr 16, 2024
1 parent 48947af commit d05a9f1
Show file tree
Hide file tree
Showing 56 changed files with 168 additions and 106 deletions.
4 changes: 2 additions & 2 deletions grammars/keywords-ar.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-bg.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-bn.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-ca.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-cs.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-cy.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-da.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-de.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-el.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-en.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-eo.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ("" | "au" | "aux" | "or") _SPACE
_OR: _SPACE? ("" | "au" | "aux" | "or") _SPACE
_WHILE: ("dum" | "while") _SPACE
_LENGTH: "longo" | "length"
_COLOR : ("koloro" | "color") _SPACE?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-es.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-et.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-fa.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-fi.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-fr.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-fy.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-he.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-hi.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-hu.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-ia.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions grammars/keywords-id.lark
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
Loading

0 comments on commit d05a9f1

Please sign in to comment.