HCoop
/
jackhill
/
mal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c780f81
)
factor: detect unclosed strings.
author
Joel Martin
<github@martintribe.org>
Wed, 31 Jul 2019 04:58:48 +0000
(23:58 -0500)
committer
Joel Martin
<github@martintribe.org>
Wed, 31 Jul 2019 04:59:26 +0000
(23:59 -0500)
Detect strings that are not properly terminated.
factor/lib/reader/reader.factor
patch
|
blob
|
blame
|
history
diff --git
a/factor/lib/reader/reader.factor
b/factor/lib/reader/reader.factor
index
568eae0
..
ae228bd
100644
(file)
--- a/
factor/lib/reader/reader.factor
+++ b/
factor/lib/reader/reader.factor
@@
-9,7
+9,8
@@
CONSTANT: token-regex R/ (~@|[\[\]{}()'`~^@]|"(?:\\.|[^\\"])*"?|;.*|[^\s\[\]{}('
DEFER: read-form
: (read-string) ( str -- maltype )
- dup last CHAR: " = [
+! dup last CHAR: " = [
+ dup R/ ^"(?:\\.|[^\\"])*"$/ matches? [
rest but-last R/ \\./ [
{
{ [ dup >string "\\\\" = ] [ drop "\\" ] }