Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full support for comments in MOROS Lisp #489

Merged
merged 3 commits into from
May 24, 2023
Merged

Conversation

vinc
Copy link
Owner

@vinc vinc commented May 24, 2023

This PR add full support for comments in MOROS Lisp. Previously comments where striped in the main code source but not in other files loaded with the load function, and the naive comment stripping had known bugs. Comments will now be parsed directly during the parsing step.

The error output will be a little worse for the main code source but it will be consistent with the load function. Better context will be added later.

In MOROS Lisp comments start with the char # like in Perl, Ruby, and Python instead of the traditional ; to be consistent with the shell and the shebang character sequence at the beginning of scripts: #!/bin/shell or #!/bin/lisp.

# Line comment
(def (fibonacci n) # Inline comment
  (if (< n 2) n
    (+ (fibonacci (- n 1)) (fibonacci (- n 2)))))

@vinc vinc marked this pull request as ready for review May 24, 2023 21:11
@vinc vinc merged commit 9c850e1 into trunk May 24, 2023
@vinc vinc deleted the feature/parse-lisp-comments branch May 24, 2023 21:20
@vinc vinc mentioned this pull request Jun 4, 2023
3 tasks
@vinc vinc mentioned this pull request Jun 20, 2023
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.

1 participant