lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jan 7, 2016 at 8:13 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> OK, fair enough. I may look into tweaking the parser to accept != as
>> well as ~= for my own use, though that depends on whether I can wrap
>> my brain around the parser.
>
> It's the lexer that needs to be hacked and it's pretty easy;
> just add this in function llex near to "case '~'":
>
>       case '!': {
>         next(ls);
>         if (check_next1(ls, '=')) return TK_NE;
>         else return '!';
>       }

Thanks. :-)

I figured out that it was the lexer after examining some of the power
patches on the wiki, specifically one for Lua 5.1 that added this
along with bitwise operators. Looks like it will be easier than I
expected.

Now that I have the ability to compile on Windows, I'm going to
experiment a bit with tweaking Lua to fit my tastes. Eventually I want
to create my own programming language from scratch for fun, probably
implemented in Lua or Python (given my limited C experience), and
gaining a greater understanding of the Lua internals through tweaking
and reading code will aid me in that goal.