feat: comments for saccharine #24

Closed
opened 2026-01-13 01:50:19 +00:00 by mvhutz · 0 comments
Owner

Context

Currently, the saccharine language does not support comments of any type. This prevents proper documentation of code, among other things.

Proposed Solution

Add '#' comment syntax. This should operate just like in Python, or any other language that supports it.

# A comment can take up a whole line. This code '(\x.x y)' is not processed.
fn x := x # Everything after that '#' is not processed either.

Acceptance Criteria

  • Update the Tokenizer to identify a '#'.
    • On seeing a '#', ignore all characters until the next newline, or until EOF.
  • Add a new test to tests/ that incorporates comments in various ways. Make sure this new test passes.
## Context Currently, the `saccharine` language does not support comments of any type. This prevents proper documentation of code, among other things. ## Proposed Solution Add '#' comment syntax. This should operate just like in Python, or any other language that supports it. ```txt # A comment can take up a whole line. This code '(\x.x y)' is not processed. fn x := x # Everything after that '#' is not processed either. ``` ## Acceptance Criteria - Update the Tokenizer to identify a '#'. - On seeing a '#', ignore all characters until the next newline, or until EOF. - Add a new test to `tests/` that incorporates comments in various ways. Make sure this new test passes.
Sign in to join this conversation.