From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] regexp doubt
Date: Tue, 13 Jul 2010 14:57:40 -0400 [thread overview]
Message-ID: <b546afe5c6506091e0329de81bcde1b7@brasstown.quanstro.net> (raw)
In-Reply-To: <AANLkTinMrkIBafWVXrlLQmo5lPPRmq-IEqNoyNX-5MIo@mail.gmail.com>
patch:
/n/dump/2010/0713/sys/src/cmd/acme/regx.c:20,26 - regx.c:20,26
typedef struct Inst Inst;
struct Inst
{
- uint type; /* < 0x10000 ==> literal, otherwise action */
+ uint type; /* < 0x1000000 ==> literal, otherwise action */
union {
int sid;
int subid;
/n/dump/2010/0713/sys/src/cmd/acme/regx.c:61,85 - regx.c:61,85
* 0x100xx are operators, value == precedence
* 0x200xx are tokens, i.e. operands for operators
*/
- #define OPERATOR 0x10000 /* Bitmask of all operators */
- #define START 0x10000 /* Start, used for marker on stack */
- #define RBRA 0x10001 /* Right bracket, ) */
- #define LBRA 0x10002 /* Left bracket, ( */
- #define OR 0x10003 /* Alternation, | */
- #define CAT 0x10004 /* Concatentation, implicit operator */
- #define STAR 0x10005 /* Closure, * */
- #define PLUS 0x10006 /* a+ == aa* */
- #define QUEST 0x10007 /* a? == a|nothing, i.e. 0 or 1 a's */
- #define ANY 0x20000 /* Any character but newline, . */
- #define NOP 0x20001 /* No operation, internal use only */
- #define BOL 0x20002 /* Beginning of line, ^ */
- #define EOL 0x20003 /* End of line, $ */
- #define CCLASS 0x20004 /* Character class, [] */
- #define NCCLASS 0x20005 /* Negated character class, [^] */
- #define END 0x20077 /* Terminate: match found */
+ #define OPERATOR 0x1000000 /* Bitmask of all operators */
+ #define START 0x1000000 /* Start, used for marker on stack */
+ #define RBRA 0x1000001 /* Right bracket, ) */
+ #define LBRA 0x1000002 /* Left bracket, ( */
+ #define OR 0x1000003 /* Alternation, | */
+ #define CAT 0x1000004 /* Concatentation, implicit operator */
+ #define STAR 0x1000005 /* Closure, * */
+ #define PLUS 0x1000006 /* a+ == aa* */
+ #define QUEST 0x1000007 /* a? == a|nothing, i.e. 0 or 1 a's */
+ #define ANY 0x2000000 /* Any character but newline, . */
+ #define NOP 0x2000001 /* No operation, internal use only */
+ #define BOL 0x2000002 /* Beginning of line, ^ */
+ #define EOL 0x2000003 /* End of line, $ */
+ #define CCLASS 0x2000004 /* Character class, [] */
+ #define NCCLASS 0x2000005 /* Negated character class, [^] */
+ #define END 0x2000077 /* Terminate: match found */
- #define ISATOR 0x10000
- #define ISAND 0x20000
+ #define ISATOR 0x1000000
+ #define ISAND 0x2000000
/*
* Parser Information
/n/dump/2010/0713/sys/src/cmd/acme/regx.c:452,458 - regx.c:452,458
exprp++;
return '\n';
}
- return *exprp++|0x10000;
+ return *exprp++|0x1000000;
}
return *exprp++;
}
/n/dump/2010/0713/sys/src/cmd/acme/regx.c:492,498 - regx.c:492,498
classp[n+2] = c2;
n += 3;
}else
- classp[n++] = c1;
+ classp[n++] = c1 & ~0x1000000;
}
classp[n] = 0;
if(nclass == Nclass){
next prev parent reply other threads:[~2010-07-13 18:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 14:56 hugo rivera
2010-07-13 15:01 ` Vinu Rajashekhar
2010-07-13 15:11 ` hugo rivera
2010-07-13 15:15 ` Rodolfo (kix)
2010-07-13 15:31 ` hugo rivera
2010-07-13 15:37 ` blstuart
2010-07-13 15:46 ` hugo rivera
2010-07-13 15:50 ` Ethan Grammatikidis
2010-07-13 15:18 ` erik quanstrom
2010-07-13 15:31 ` hugo rivera
2010-07-13 16:00 ` erik quanstrom
2010-07-13 18:38 ` Russ Cox
2010-07-13 18:46 ` blstuart
2010-07-14 7:47 ` hugo rivera
2010-07-13 18:47 ` erik quanstrom
2010-07-13 18:49 ` erik quanstrom
2010-07-13 18:57 ` erik quanstrom [this message]
2010-07-14 18:11 ` Russ Cox
2010-07-15 8:15 ` hugo rivera
2010-07-13 15:48 ` yy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b546afe5c6506091e0329de81bcde1b7@brasstown.quanstro.net \
--to=quanstro@quanstro.net \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).