Add '#' comment syntax that works like Python comments. Comments can take up a whole line or appear at the end of a line. All characters after '#' until the next newline or EOF are ignored. Closes #24
16 lines
452 B
Plaintext
16 lines
452 B
Plaintext
# This is a full-line comment at the start
|
|
# The following defines the identity function
|
|
identity := \x.x # This is an end-of-line comment
|
|
|
|
# Define a simple function that applies a function twice
|
|
twice := \f.\x.(f (f x))
|
|
|
|
# Test that comments don't interfere with expressions
|
|
result := (twice identity VALUE) # Should just return VALUE
|
|
|
|
# Multiple comments in a row
|
|
# can appear anywhere
|
|
# without breaking the code
|
|
|
|
result # Final comment at the end
|