Skip to content

Commit

Permalink
Maybe working string literal
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-y committed Sep 24, 2024
1 parent 4d04025 commit 03d6d86
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/parser/reader-macros/string.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Identifier, StringLiteral } from "../../syntax-objects/index.js";
import { Identifier, List } from "../../syntax-objects/index.js";
import { ReaderMacro } from "./types.js";

export const stringMacro: ReaderMacro = {
Expand Down Expand Up @@ -31,9 +31,19 @@ export const stringMacro: ReaderMacro = {
});
}

return new StringLiteral({
value: token.value,
location: token.location,
});
return new List([
"String",
[
"object",
[
":",
"chars",
[
"FixedArray",
...token.value.split("").map((char) => char.charCodeAt(0)),
],
],
],
]);
},
};

0 comments on commit 03d6d86

Please sign in to comment.