mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-26 15:14:12 +00:00
improve error from unterminated string
This commit is contained in:
parent
6d6754a09d
commit
33f4cecbbf
@ -84,14 +84,14 @@ class Tokenizer
|
|||||||
$addCurrent();
|
$addCurrent();
|
||||||
|
|
||||||
// Check for errors
|
// Check for errors
|
||||||
if ($parens[0] != 0) {
|
if ($isString) {
|
||||||
|
throw new MadLispException("unterminated string");
|
||||||
|
} elseif ($parens[0] != 0) {
|
||||||
throw new MadLispException("missing closing )");
|
throw new MadLispException("missing closing )");
|
||||||
} elseif ($parens[1] != 0) {
|
} elseif ($parens[1] != 0) {
|
||||||
throw new MadLispException("missing closing ]");
|
throw new MadLispException("missing closing ]");
|
||||||
} elseif ($parens[2] != 0) {
|
} elseif ($parens[2] != 0) {
|
||||||
throw new MadLispException("missing closing }");
|
throw new MadLispException("missing closing }");
|
||||||
} elseif ($isString) {
|
|
||||||
throw new MadLispException("unterminated string");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tokens;
|
return $tokens;
|
||||||
|
Loading…
Reference in New Issue
Block a user