projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/scheme: Accept more escaped character constants
[fw/altos]
/
src
/
scheme
/
ao_scheme_read.c
diff --git
a/src/scheme/ao_scheme_read.c
b/src/scheme/ao_scheme_read.c
index 7d540aa5af22f26991dacd194371bbc9673215a6..f7e95a6358c75f6d68948931fed60b7d8aeb9f1c 100644
(file)
--- a/
src/scheme/ao_scheme_read.c
+++ b/
src/scheme/ao_scheme_read.c
@@
-110,7
+110,7
@@
static const uint16_t lex_classes[128] = {
PRINTABLE, /* Y */
PRINTABLE, /* Z */
PRINTABLE, /* [ */
PRINTABLE, /* Y */
PRINTABLE, /* Z */
PRINTABLE, /* [ */
- PRINTABLE
|BACKSLASH,
/* \ */
+ PRINTABLE
,
/* \ */
PRINTABLE, /* ] */
PRINTABLE, /* ^ */
PRINTABLE, /* _ */
PRINTABLE, /* ] */
PRINTABLE, /* ^ */
PRINTABLE, /* _ */
@@
-204,18
+204,20
@@
lex_quoted(void)
lex_class = 0;
c &= 0x7f;
switch (c) {
lex_class = 0;
c &= 0x7f;
switch (c) {
- case 'n':
- return '\n';
- case 'f':
- return '\f';
+ case 'a':
+ return '\a';
case 'b':
return '\b';
case 'b':
return '\b';
+ case 't':
+ return '\t';
+ case 'n':
+ return '\n';
case 'r':
return '\r';
case 'r':
return '\r';
+ case 'f':
+ return '\f';
case 'v':
return '\v';
case 'v':
return '\v';
- case 't':
- return '\t';
case '0':
case '1':
case '2':
case '0':
case '1':
case '2':
@@
-422,7
+424,7
@@
_lex(void)
if (lex_class & STRINGC) {
for (;;) {
c = lexc();
if (lex_class & STRINGC) {
for (;;) {
c = lexc();
- if (
lex_class & BACKSLASH
)
+ if (
c == '\\'
)
c = lex_quoted();
if (lex_class & (STRINGC|ENDOFFILE)) {
end_token();
c = lex_quoted();
if (lex_class & (STRINGC|ENDOFFILE)) {
end_token();
@@
-636,7
+638,7
@@
ao_scheme_read(void)
v = _ao_scheme_bool_false;
break;
case STRING:
v = _ao_scheme_bool_false;
break;
case STRING:
- string = ao_scheme_string_
make
(token_string);
+ string = ao_scheme_string_
new
(token_string);
if (string)
v = ao_scheme_string_poly(string);
else
if (string)
v = ao_scheme_string_poly(string);
else