commit 39496029260d59ed03912ed197b94f2b6ac671ee
parent 55722405149dec484c746cef4b1d064bca148fea
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Sun, 2 Apr 2023 08:54:53 -0400
halcc: fix broken pspush/pspop
Diffstat:
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/comp/c/egen.fs b/fs/comp/c/egen.fs
@@ -203,8 +203,8 @@ MAXLITSZ Stack :new structbind Stack _list
_litarena :] drop ( "a ) Result :const endof
'{' of isChar?^ parseList endof
S" pspop" of s=
- read( read) Result :?freeCurrentW 0 PSP+) @, PS-
- Result :W parsePostfixOp endof
+ read( read) Result :?freeCurrentW
+ 0 PSP+) @, PS+ Result :W parsePostfixOp endof
S" NULL" of s= 0 Result :const endof
S" sizeof" of s=
read( nextt parseType _assert typesize Result :const read) endof
diff --git a/fs/comp/c/fgen.fs b/fs/comp/c/fgen.fs
@@ -53,7 +53,7 @@ alias noop parseStatement ( tok -- ) \ forward declaration
[compile] again [compile] then r> resolvebreaks ;
: _pspush
- read( nextt parseExpression Result :>W$ 0 PSP+) !, PS+ read) read; ;
+ read( nextt parseExpression Result :>W$ psneutral dup, read) read; ;
: _break [compile] ahead _breaks :push read; ;
diff --git a/fs/tests/comp/c/lib.fs b/fs/tests/comp/c/lib.fs
@@ -43,9 +43,9 @@ memfile MemFile :buf( s c@+ []= #
}
}
-\ S" foo 42 bar" foo 42 #eq
-\ S" foo baz bar" foo -1 #eq
-\ S" ( ----- %d )" S" ( ----- 000 )" sscanf # 0 #eq
+S" foo 42 bar" foo 42 #eq
+S" foo baz bar" foo -1 #eq
+S" ( ----- %d )" S" ( ----- 000 )" sscanf # 0 #eq
:c int foo() {
int hdl = fopen("/tests/reffile");