Files
lambda/tests/comments.test
M.V. Hutz 6418e05255 feat: add comment support to saccharine language
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
2026-01-12 20:53:38 -05:00

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