add symbol syntax

This commit is contained in:
Quentin Leonetti
2019-07-20 20:16:36 +02:00
parent 2574ad297b
commit 371615a899
2 changed files with 10 additions and 4 deletions

View File

@@ -115,6 +115,8 @@ function Lisp (input, lib) {
return { type: TYPES.number, value: parseFloat(input) }
} else if (input[0] === '"' && input.slice(-1) === '"') {
return { type: TYPES.string, value: input.slice(1, -1) }
} else if (input[0] === ':') {
return { type: TYPES.string, value: input.slice(1) }
} else if (input === 'true' || input === 'false') {
return { type: TYPES.bool, value: input === 'true' }
} else {