~sircmpwn/rc-devel

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] lex: allow dots in function names

Details
Message ID
<20231022194343.18970-2-max@mxsr.de>
DKIM signature
missing
Download raw message
Patch: +2 -2
Example usage:
fn ... cd ../..
---
See also https://lists.sr.ht/~sircmpwn/rc-users/%3CCWEVA3HZND0V.29Y3XIS88YJT9%40mxsr.de%3E
 lex/lex.ha | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lex/lex.ha b/lex/lex.ha
index fea55d6..2e58493 100644
--- a/lex/lex.ha
+++ b/lex/lex.ha
@@ -98,7 +98,7 @@ export fn next(lex: *lexer, word: bool) (token | error) = {
	};

	if (word) {
		if (ascii::isalnum(rn) || rn == '_' || rn == '*') {
		if (ascii::isalnum(rn) || rn == '_' || rn == '*' || rn == '.') {
			unread(lex, rn);
			return lexword(lex);
		};
@@ -226,7 +226,7 @@ fn lexword(lex: *lexer) (token | error) = {
			break;
		};

		if (!ascii::isalnum(rn) && rn != '_' && rn != '*') {
		if (!ascii::isalnum(rn) && rn != '_' && rn != '*' && rn != '.') {
			unread(lex, rn);
			break;
		};
-- 
2.42.0
Details
Message ID
<CWFLO9Z0QN1H.3DVKE1LN828GM@taiga>
In-Reply-To
<20231022194343.18970-2-max@mxsr.de> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/rc
   a5426c6..f34f923  master -> master

A more general solution might be to use params in the function
definition grammar, rather than words. But this is fine for now.
Reply to thread Export thread (mbox)