~rabbits/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH uxn] (uxnasm) only ignore [ or ] if it is a whole token

Details
Message ID
<20220605213357.xhsgnxiuwf4f4ie3@t480>
DKIM signature
pass
Download raw message
Patch: +2 -2
Currently, tokens beginning with a [ or ] character are completely
ignored, which forbids a macro from beginning with these characters.
Specifically, a macro can be declared eg. as `%[x { ... }` but cannot be
dereferenced as `[x`.
This patch only ignores these tokens if they have a length of 1;
otherwise the switch falls through to the default case.
---

I noticed this bug from a note in this post: https://cybre.space/@wim_v12e/108425428588139783

 src/uxnasm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/uxnasm.c b/src/uxnasm.c
index b4243d6..e5e6a35 100644
--- a/src/uxnasm.c
+++ b/src/uxnasm.c
@@ -343,8 +343,8 @@ parse(char *w, FILE *f)
		while((c = w[++i]))
			if(!writebyte(c)) return 0;
		break;
	case '[': break; /* ignored */
	case ']': break; /* ignored */
	case '[': if (slen(w) == 1) break; /* else FALLTHROUGH */
	case ']': if (slen(w) == 1) break; /* else FALLTHROUGH */
	default:
		/* opcode */
		if(findopcode(w) || scmp(w, "BRK", 4)) {
-- 
2.36.1

[uxn/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CKIIV514IW3W.1R7TBJ2NGLEPJ@cirno>
In-Reply-To
<20220605213357.xhsgnxiuwf4f4ie3@t480> (view parent)
DKIM signature
missing
Download raw message
uxn/patches/.build.yml: SUCCESS in 1m0s

[(uxnasm) only ignore [ or ] if it is a whole token][0] from [phoebos][1]

[0]: https://lists.sr.ht/~rabbits/public-inbox/patches/32778
[1]: ben@bvnf.space

✓ #774797 SUCCESS uxn/patches/.build.yml https://builds.sr.ht/~rabbits/job/774797
Reply to thread Export thread (mbox)