From 03d6d86b6d5486661bbce69f3e06397eeea01194 Mon Sep 17 00:00:00 2001 From: Drew Youngwerth Date: Mon, 23 Sep 2024 22:07:37 -0700 Subject: [PATCH] Maybe working string literal --- src/parser/reader-macros/string.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/parser/reader-macros/string.ts b/src/parser/reader-macros/string.ts index 77e394f8..56300c99 100644 --- a/src/parser/reader-macros/string.ts +++ b/src/parser/reader-macros/string.ts @@ -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 = { @@ -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)), + ], + ], + ], + ]); }, };