Merge remote-tracking branch 'origin/master'

This commit is contained in:
Justin Ethier 2018-04-30 14:00:45 -04:00
commit 6be7a259ff
2 changed files with 14 additions and 0 deletions

View file

@ -2,6 +2,10 @@
## 0.7.3 - TBD ## 0.7.3 - TBD
Features
- Added basic support for square and curly brackets in place of parentheses.
Bug Fixes Bug Fixes
- Fixed an off-by-one error in `read-line` where the function erroneously reported an extra character was read from `stdin`. Thanks to wasamasa for the bug report. - Fixed an off-by-one error in `read-line` where the function erroneously reported an extra character was read from `stdin`. Thanks to wasamasa for the bug report.

View file

@ -6851,6 +6851,16 @@ void Cyc_io_read_token(void *data, object cont, object port)
} }
} else if (c == '|' && !p->tok_end) { } else if (c == '|' && !p->tok_end) {
_read_literal_identifier(data, p); _read_literal_identifier(data, p);
} else if (c == '[' || c == '{') {
if (p->tok_end) _read_return_atom(data, cont, p);
// Special encoding so we can distinguish from chars such as #\(
make_c_opaque(opq, obj_char2obj('(')); // Cheap support for brackets
return_thread_runnable(data, &opq);
} else if (c == ']' || c == '}') {
if (p->tok_end) _read_return_atom(data, cont, p);
// Special encoding so we can distinguish from chars such as #\(
make_c_opaque(opq, obj_char2obj(')')); // Cheap support for brackets
return_thread_runnable(data, &opq);
} else { } else {
// No special meaning, add char to current token (an atom) // No special meaning, add char to current token (an atom)
_read_add_to_tok_buf(p, c); _read_add_to_tok_buf(p, c);