Skip to content

Commit

Permalink
🖊️ Add support for boolean values (#5524)
Browse files Browse the repository at this point in the history
Fixes #5370
Adds support for boolean values with the following caveats:
- we support both `true` and `True` as correct boolean values. Since hedy is currently case sensitive, this PR uses a workaround to support both values and does not attempt to solve the case sensitivity issue.
- when printed, the boolean value will appear as a correct python value, e.g. `True`, regardless in which language it was originally written. In other words, the Bulgarian program `{print} {true}` will yield literally `True`. The problem cannot be solved with the existing mechanisms in Hedy, so a separate issue will be created to address the matter.
- highlighting is still work in progress

**How to test**
In levels 15-18, try the following programs:
```
a is true
print a
```
```
a is true

while a = True
    print 1
    a = false

print 2
```
  • Loading branch information
boryanagoncharenko authored May 25, 2024
1 parent 7edbd2f commit 25d3d4f
Show file tree
Hide file tree
Showing 142 changed files with 1,653 additions and 445 deletions.
4 changes: 4 additions & 0 deletions content/keywords/ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: ردد
elif: وإلا اذا
else: وإلا
'false': 'false'
'False': 'False'
for: لكل
forward: تقدم
from: من
Expand Down Expand Up @@ -57,6 +59,8 @@ step: خطوة
times: مرة
to: الى
to_list: الى
'true': 'true'
'True': 'True'
turn: استدر
while: بينما
white: ابيض
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/bg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: дефинирай
echo: покажи
elif: иначе ако
else: иначе
'false': невярно
'False': Невярно
for: за
forward: напред
from: от
Expand Down Expand Up @@ -57,6 +59,8 @@ step: стъпка
times: пъти
to: до
to_list: до
'true': вярно
'True': Вярно
turn: завий
while: докато
white: бяло
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/bn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: echo
elif: elif
else: else
'false': 'false'
'False': 'False'
for: for
forward: forward
from: from
Expand Down Expand Up @@ -57,6 +59,8 @@ step: step
times: times
to: to
to_list: to
'true': 'true'
'True': 'True'
turn: turn
while: while
white: white
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/ca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: defineix
echo: eco
elif: sinosi
else: sino
'false': 'false'
'False': 'False'
for: per
forward: avança
from: de
Expand Down Expand Up @@ -57,6 +59,8 @@ step: pas
times: vegades
to: fins
to_list: a
'true': 'true'
'True': 'True'
turn: gira
while: mentre
white: blanc
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: echo
elif: elif
else: else
'false': 'false'
'False': 'False'
for: for
forward: forward
from: from
Expand Down Expand Up @@ -57,6 +59,8 @@ step: step
times: times
to: to
to_list: to
'true': 'true'
'True': 'True'
turn: turn
while: while
white: white
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/cy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: adleisio
elif: elif
else: arall
'false': 'false'
'False': 'False'
for: ar gyfer
forward: ymlaen
from: o
Expand Down Expand Up @@ -57,6 +59,8 @@ step: cam
times: gwaith
to: i
to_list: i
'true': 'true'
'True': 'True'
turn: troi
while: tra
white: gwyn
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/da.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: ekko
elif: elif
else: else
'false': 'false'
'False': 'False'
for: for
forward: fremad
from: from
Expand Down Expand Up @@ -57,6 +59,8 @@ step: step
times: times
to: to
to_list: to
'true': 'true'
'True': 'True'
turn: drej
while: while
white: white
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: echo
elif: sofalls
else: sonst
'false': 'false'
'False': 'False'
for: für
forward: vorwärts
from: aus
Expand Down Expand Up @@ -57,6 +59,8 @@ step: schritt
times: mal
to: bis
to_list: zu
'true': 'true'
'True': 'True'
turn: drehe
while: solange
white: Weiß
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/el.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: echo
elif: elif
else: else
'false': 'false'
'False': 'False'
for: for
forward: forward
from: from
Expand Down Expand Up @@ -57,6 +59,8 @@ step: step
times: times
to: to
to_list: to
'true': 'true'
'True': 'True'
turn: turn
while: while
white: white
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: echo
elif: elif
else: else
'false': 'false'
'False': 'False'
for: for
forward: forward
from: from
Expand Down Expand Up @@ -57,6 +59,8 @@ step: step
times: times
to: to
to_list: to
'true': 'true'
'True': 'True'
turn: turn
while: while
white: white
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/eo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: eĥu|ehhu|ehxu|e^hu|eh^u
elif: alie se
else: alie
'false': 'false'
'False': 'False'
for: por
forward: antaŭen|antauen|antauxen
from: el
Expand Down Expand Up @@ -57,6 +59,8 @@ step: paŝo|pasho|pasxo|pa^so|pas^o
times: fojojn
to: ĝis|ghis|gxis|^gis|g^is
to_list: al
'true': 'true'
'True': 'True'
turn: turnu
while: dum
white: blanka
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: definir
echo: eco
elif: sinosi
else: sino
'false': 'false'
'False': 'False'
for: para
forward: adelante
from: de
Expand Down Expand Up @@ -57,6 +59,8 @@ step: paso
times: veces
to: a
to_list: a
'true': 'true'
'True': 'True'
turn: girar
while: mientras
white: blanco
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/et.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: peegelda
elif: muidukui
else: muidu
'false': 'false'
'False': 'False'
for: jaoks
forward: edasi
from: nimistust
Expand Down Expand Up @@ -57,6 +59,8 @@ step: sammuga
times: korda
to: kuni
to_list: nimistusse
'true': 'true'
'True': 'True'
turn: pööra
while: senikui
white: valge
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/fa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: echo
elif: elif
else: else
'false': 'false'
'False': 'False'
for: for
forward: به جلو
from: from
Expand Down Expand Up @@ -57,6 +59,8 @@ step: step
times: times
to: to
to_list: to
'true': 'true'
'True': 'True'
turn: دور بزن
while: while
white: سفید
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/fi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: kaiku
elif: muutenjos
else: muuten
'false': 'false'
'False': 'False'
for: jokaiselle
forward: eteenpäin
from: listasta
Expand Down Expand Up @@ -57,6 +59,8 @@ step: askel
times: kertaa
to: asti
to_list: listaksi
'true': 'true'
'True': 'True'
turn: käänny
while: kun
white: valkoinen
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: définis
echo: réponds
elif: sinon si
else: sinon
'false': 'false'
'False': 'False'
for: pour
forward: avance
from: de
Expand Down Expand Up @@ -57,6 +59,8 @@ step: pas
times: fois
to: à
to_list: à
'true': 'true'
'True': 'True'
turn: tourne
while: tant que
white: blanc
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/fr_CA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: définis
echo: réponds
elif: sinon si
else: sinon
'false': 'false'
'False': 'False'
for: pour
forward: avance
from: de
Expand Down Expand Up @@ -57,6 +59,8 @@ step: pas
times: fois
to: à
to_list: à
'true': 'true'
'True': 'True'
turn: tourne
while: tant que
white: blanc
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/fy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: echo
elif: elif
else: else
'false': 'false'
'False': 'False'
for: for
forward: forward
from: from
Expand Down Expand Up @@ -57,6 +59,8 @@ step: step
times: times
to: to
to_list: to
'true': 'true'
'True': 'True'
turn: turn
while: while
white: white
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/he.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: הדהד
elif: אחרתאם
else: אחרת
'false': 'false'
'False': 'False'
for: לכל
forward: קדימה
from: מ
Expand Down Expand Up @@ -57,6 +59,8 @@ step: צעד
times: פעמים
to: עד
to_list: אל
'true': 'true'
'True': 'True'
turn: פנה
while: כלעוד
white: לבן
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/hi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: गूंज
elif: एलिफ
else: अन्यथा
'false': 'false'
'False': 'False'
for: के लिये
forward: आगे
from: से
Expand Down Expand Up @@ -57,6 +59,8 @@ step: क़दम
times: बार
to: से
to_list: से
'true': 'true'
'True': 'True'
turn: मोड़
while: व्हाइल
white: सफ़ेद
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/hu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: utánoz
elif: egybk-ha
else: egyébként
'false': 'false'
'False': 'False'
for: minden
forward: előre
from: ebből
Expand Down Expand Up @@ -57,6 +59,8 @@ step: lépésenként
times: alkalommal
to: től
to_list: ebbe
'true': 'true'
'True': 'True'
turn: fordul
while: amíg
white: fehér
Expand Down
4 changes: 4 additions & 0 deletions content/keywords/ia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ define: define
echo: echo
elif: elif
else: else
'false': 'false'
'False': 'False'
for: for
forward: forward
from: from
Expand Down Expand Up @@ -57,6 +59,8 @@ step: step
times: times
to: to
to_list: to
'true': 'true'
'True': 'True'
turn: turn
while: while
white: white
Expand Down
Loading

0 comments on commit 25d3d4f

Please sign in to comment.