Skip to content

Commit

Permalink
fix duplicated location in recursive syntax-rules macro error #429
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Jan 19, 2025
1 parent 96dd540 commit e47199f
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* fix `expt` [#426](https://github.com/jcubic/lips/issues/426), [#424](https://github.com/jcubic/lips/issues/424)
* remove stripping `\r` characters from Lexer (that is used by ports)
* unpack `values` only in REPL
* fix duplicated location in recursive syntax-rules macro error [#429](https://github.com/jcubic/lips/issues/429)

## 1.0.0-beta.20
### Feature
Expand Down
13 changes: 8 additions & 5 deletions dist/lips.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions dist/lips.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lips.esm.min.js

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions dist/lips.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lips.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -9248,7 +9248,10 @@ var global_env = new Environment({
rules = rules.cdr;
}
} catch (e) {
e.message += `\nin macro:\n ${macro.toString(true)}`;
const location = `\nin macro:\n ${macro.toString(true)}`;
if (!e.message.includes(location)) {
e.message += location;
}
throw e;
}
throw new Error(`syntax-rules: no matching syntax in macro ${code.toString(true)}`);
Expand Down

0 comments on commit e47199f

Please sign in to comment.