fix more bugs
This commit is contained in:
@@ -212,7 +212,7 @@ static enum fh_error w_c_fetch(struct fh_thread_s *fh, const struct fh_word_s *w
|
||||
char value = 0;
|
||||
TRY(fh_fetch_char(fh, addr, &value));
|
||||
|
||||
TRY(ds_push(fh, (uint32_t) value));
|
||||
TRY(ds_push(fh, (uint32_t) (value&0xFF)));
|
||||
return FH_OK;
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -156,9 +156,9 @@ enum fh_error fh_input_read_quotedstring(struct fh_thread_s *fh, bool escaped, c
|
||||
if (isdigit(c)) {
|
||||
hex |= c - '0';
|
||||
} else if (c >= 'a' && c <= 'f') {
|
||||
hex |= c - 'a';
|
||||
hex |= 10 + (c - 'a');
|
||||
} else if (c >= 'A' && c <= 'F') {
|
||||
hex |= c - 'A';
|
||||
hex |= 10 + (c - 'A');
|
||||
} else {
|
||||
LOGE("Bad hex escape");
|
||||
return FH_ERR_SYNTAX;
|
||||
@@ -167,6 +167,8 @@ enum fh_error fh_input_read_quotedstring(struct fh_thread_s *fh, bool escaped, c
|
||||
if (hexdigits == 0) {
|
||||
c = (char) hex;
|
||||
goto append;
|
||||
} else {
|
||||
goto skip;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1802,7 +1802,6 @@ TESTING S\" (Forth 2012 compilation mode)
|
||||
\ interpretation semantics. S\" in interpretation mode is tested in the tests on
|
||||
\ the File-Access word set
|
||||
|
||||
1 debug
|
||||
T{ : SSQ1 S\" abc" S" abc" S= ; -> }T \ No escapes
|
||||
T{ SSQ1 -> TRUE }T
|
||||
T{ : SSQ2 S\" " ; SSQ2 SWAP DROP -> 0 }T \ Empty string
|
||||
@@ -1835,7 +1834,7 @@ T{ SSQ3 DROP 19 CHARS + C@ -> 92 }T \ \\ \ Back Slash
|
||||
CR .( The next test should display:)
|
||||
CR .( One line...)
|
||||
CR .( another line)
|
||||
T{ : SSQ4 S\" \nOne line...\nanotherLine\n" TYPE ; SSQ4 -> }T
|
||||
T{ : SSQ4 S\" \nOne line...\nanother line\n" TYPE ; SSQ4 -> }T
|
||||
|
||||
\ Test bare escapable characters appear as themselves
|
||||
T{ : SSQ5 S\" abeflmnqrtvxz" S" abeflmnqrtvxz" S= ; SSQ5 -> TRUE }T
|
||||
|
||||
Reference in New Issue
Block a user