Skip to content

Commit

Permalink
loosen parser furthre
Browse files Browse the repository at this point in the history
  • Loading branch information
s-kybound committed Nov 3, 2024
1 parent 3e7580a commit a7b436f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/transpiler/parser/scheme-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,9 @@ export class SchemeParser implements Parser {
token.literal as string
);
default:
// if in a quoting context, any keyword is instead treated as a symbol
if (this.quoteMode !== QuoteMode.NONE) {
// if in a quoting context, or when dealing with the macro chapter,
// any keyword is instead treated as a symbol
if (this.quoteMode !== QuoteMode.NONE || this.chapter >= MACRO_CHAPTER) {
return new Atomic.Symbol(this.toLocation(token), token.lexeme);
}
throw new ParserError.UnexpectedFormError(
Expand Down

0 comments on commit a7b436f

Please sign in to comment.