Skip to content

Soumalya1857/Zarkan

Repository files navigation

Language.py

a language you won't understand

  • traceback support given
  • variables can be declared with var keyword
  • comparisons work fine
  • if else is working fine
  • support for strings given(addition and multiplications)
  • support for loops(for and while) given
  • file support to be given soon
  • various functions to be added
  • will add a proper documentation for this language
  • support for built in functions are given
  • multi line functionality added
  • documentation is on its way

run shell.py to enter the language shell

python3 shell.py

sample code

>>>> 23 > 5
1
>>>> var a = 5
5
>>>> 34 + a
39
>>>> 6 == 5
0
>>>> 7 == 7
1 
>>>> if 10 > 5 then 5 else 23
5
>>>> var p = 10 if 10 < 5 else 30 * 5
10
>>>> for i = 0 to 10 step 2 then p = p+1
>>>> p
26
#(10 + 0 + 2 + 4 + 8)
>>>> func greet(name, number) -> "Hello" * 3 + name
<function greet>
>>>> greet(Ninja,3)
Hello Hello Hello Ninja

adding this for initial commit in feature1

About

Aysehi baytha tha, Ek language bana diya

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages