Skip to content

Add block-comments /* ... */ to prog syntax#3

Open
lou1306 wants to merge 3 commits intomainfrom
block-comments
Open

Add block-comments /* ... */ to prog syntax#3
lou1306 wants to merge 3 commits intomainfrom
block-comments

Conversation

@lou1306
Copy link
Collaborator

@lou1306 lou1306 commented Feb 27, 2025

To add comments, we simply override parsec's whitespace parser. We allow the possibility of a /* followed by any sequence of characters ended by */. Thus, these block comments may now appear whenever the original syntax allowed for whitespace.

We also add a spaces() parser at the head of the main parser, to allow comments (or mere whitespace) at the top of a .prog file.

To add comments, we simply override parsec's whitespace parser. We
allow the possibility of a /* followed by any sequence of characters
ended by */. Thus, these block comments may now appear whenever the
original syntax allowed for whitespace.

We also add a spaces() parser at the head of the main parser, to allow
comments (or mere whitespace) at the top of a .prog file.
@lou1306
Copy link
Collaborator Author

lou1306 commented Feb 27, 2025

Comments are still not allowed in the SPECIFICATION section. That uses a different parser (TatSu) and it seems that our version has a bug with the directive for block comments. We should try and investigate if we can bump up the version of TatSu that we use without breaking stuff.

@shaunazzopardi shaunazzopardi self-assigned this Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants