diff options
Diffstat (limited to 'src/LispAst.kt')
-rw-r--r-- | src/LispAst.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/LispAst.kt b/src/LispAst.kt index 79fee8a..6ac7032 100644 --- a/src/LispAst.kt +++ b/src/LispAst.kt @@ -33,6 +33,12 @@ sealed class LispAst : HasLispPosition { } } + data class NumberLiteral(override val position: LispPosition, val numberValue: Double) : LispNode() { + override fun toSource(): String { + return numberValue.toString() + } + } + data class StringLiteral(override val position: LispPosition, val parsedString: String) : LispNode() { override fun toSource(): String { return "\"${parsedString.replace("\\", "\\\\").replace("\"", "\\\"")}\"" // TODO: better escaping |