strath/sm-test-files/hello.sm
Gabriel 0eed22213f updated regexp
now supports ; comments
2021-12-16 21:12:44 +01:00

55 lines
965 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

&& ¡! around code means its a statement
&& ¿? around code means its an expression
#mult /}}string{{str\ /{float}num\ | (
¿string * float?
)
&& rest line comment
]]Inline comment[[
``
multiline comment
indention is 3 spaces
main function has to be a thing
´´
¡}}string{{ variable!
&& take input into variable
¡=>/variable\!
&& output variable
¡<=/variable\!
&& $ means true
&& € means false
&& == is implied in if conditions
; test comment
&& = is equal to ===
&& if condition is true log the text
¿??$/condition\ | (
¡<=/"condition was true"!; hello test
)?
&& if condition is false log the text
¿??€/condition\ | (
¡<=/"condition was false"!
)?
#sub /\ | (
&& This code prints hello world
¿??$? | (
!<= "Hello World"!;
)
)
#sub /\ | (
&& This code checks if input is equal to another string
¿??$ /=> "hello"\? | ( && Takes input and compares to string
!<= "World!"!; Prints World!
)?
)