mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 09:47:17 +00:00
Update for issue #62
This commit is contained in:
parent
4a2d4f52b5
commit
dc9dc98e80
@ -48,5 +48,7 @@ int system_test() {
|
|||||||
assert(janet_equals(janet_cstringv("a string."), janet_cstringv("a string.")));
|
assert(janet_equals(janet_cstringv("a string."), janet_cstringv("a string.")));
|
||||||
assert(janet_equals(janet_csymbolv("sym"), janet_csymbolv("sym")));
|
assert(janet_equals(janet_csymbolv("sym"), janet_csymbolv("sym")));
|
||||||
|
|
||||||
|
assert(JANET_NUMBER == janet_type(janet_wrap_number(0.0 / 0.0)));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -552,6 +552,9 @@ void janet_parser_consume(JanetParser *parser, uint8_t c) {
|
|||||||
void janet_parser_eof(JanetParser *parser) {
|
void janet_parser_eof(JanetParser *parser) {
|
||||||
janet_parser_checkdead(parser);
|
janet_parser_checkdead(parser);
|
||||||
janet_parser_consume(parser, '\n');
|
janet_parser_consume(parser, '\n');
|
||||||
|
if (parser->statecount > 1) {
|
||||||
|
parser->error = "unexpected end of source";
|
||||||
|
}
|
||||||
parser->offset--;
|
parser->offset--;
|
||||||
parser->flag = 1;
|
parser->flag = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user