<div><div dir="auto">I don’t find the variable names to particularly confusing - we usually have a function</div><div dir="auto"><br></div><div dir="auto">int something_parse(struct something_parser_s * parser, char * buf, int buf_len) {</div></div><div dir="auto"> char * p = buf;</div><div dir="auto"> char * pe = buf + buf_len;</div><div dir="auto"> %%write exec;</div><div dir="auto">}</div><div dir="auto"><br></div><div dir="auto">Which is pretty easy to read. The cs variable is stored in the structure, which gives us partial reads for free; so a rg_ prefix isn’t very necessary there either. (parser->cs reads like “parsers current state”, which is good enough I think).</div><div dir="auto"><br></div><div dir="auto">If you feel strongly about it, variable can solve your readability problems.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">lör 23 feb. 2019 kl. 13:12 skrev Peng Yu <<a href="mailto:pengyu.ut@gmail.com">pengyu.ut@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="auto">This can be easily solved but adding a command line option to enable such prefixes and the date the prefixes will be enforced (say in 3 years). So people can have time to migrate their ragel code. This kind of things has been done all the time. I don’t think it should be an excuse not make the variable name more readable. “access” can solve the readability problem, but it also uses an extra structure which changes the meaning of the code. I will check “variable” later.</div><div dir="auto"><br></div><div dir="auto">BTW, how many uses of ragel anyway? It seems to have a far less user base than flex. My impression is that people uses it because it can offer something flex does not offer. However, flex can already solve a lot of lexing problems. So there will be much less users use ragel than flex. This can be shown by the numbers of questions on stack overflow and the numbers of projects on github.</div></div><div><br><div class="gmail_quote"><div>On Sat, Feb 23, 2019 at 3:52 AM Adrian Thurston <<a href="mailto:thurston@colm.net" target="_blank">thurston@colm.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can use the variable and access statements (section 5 of the <br>
manual).<br>
<br>
Changing the default behaviour at this point would break every ragel <br>
program out there and that's not something I'm interested in doing.<br>
<br>
On 2019-02-22 21:23, Peng Yu wrote:<br>
> The variables mentioned in section 5.1 "Variables Used by Ragel"<br>
> manual are very much like common names. It will be confusing to look<br>
> at ragel code written in this way. Why not consider adding a prefix,<br>
> e.g., rg_, to them to make it less confusing? Thanks.<br>
> <br>
> - cs<br>
> - p<br>
> - ...<br>
<br>
_______________________________________________<br>
ragel-users mailing list<br>
<a href="mailto:ragel-users@colm.net" target="_blank">ragel-users@colm.net</a><br>
<a href="http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users" rel="noreferrer" target="_blank">http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users</a></blockquote></div></div>-- <br><div dir="ltr" class="m_1914343646743897933gmail_signature" data-smartmail="gmail_signature">Regards,<br>Peng</div>
_______________________________________________<br>
ragel-users mailing list<br>
<a href="mailto:ragel-users@colm.net" target="_blank">ragel-users@colm.net</a><br>
<a href="http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users" rel="noreferrer" target="_blank">http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users</a></blockquote></div></div>