Cheating in the same way, strings!

This commit is contained in:
Nathan Braswell
2020-10-11 20:01:18 -04:00
parent 0820113c67
commit 42c2fcfb66
2 changed files with 3 additions and 2 deletions

View File

@@ -702,7 +702,7 @@ fun main(argc: int, argv: **char): int {
} else if input[i+1] == '\\' || input[i+1] == '"' {
to_ret += input[i+1]
} else {
return KPResult::Err(kpString(str("bad string escape")))
return KPResult::Err(kpString(str("bad string escape: ") + input[i+1]))
}
// skip
i++

View File

@@ -73,7 +73,8 @@
|(;[ -~]*
))+") (lambda (x) nil))
(array (quote atom) (array "-?[0-9]+") (lambda (x) (read-string x)))
; String here
(array (quote atom) (array "\"([#-[]| |[]-~]|(\\\\)|(\\n)|(\\t)|(\\\\*)|(\\0)|
|[ -!]|(\\\\\"))*\"") (lambda (x) (read-string x)))
(array (quote atom) (array "-|(([a-z]|[A-Z]|_|\\*|/|\\?|\\+|!|=|&|<|>|%)([a-z]|[A-Z]|_|[0-9]|\\*|\\?|\\+|-|!|=|&|<|>|%)*)") (lambda (x) (cond (= "true" x) true
(= "false" x) false
(= "nil" x) nil