nbell12 / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

support for lua keywords #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

I need to create a patch with test cases.  The only keyword additions
really needed for this would be:

var LUA_KEYWORDS = "elseif local nil repeat";

You can grab a quick lua example from http://lua-users.org/wiki if you're
interested in poking around with me.

Cheers!
Joseph Armbruster

Original issue reported on code.google.com by josepharmbruster@gmail.com on 30 Nov 2007 at 8:50

GoogleCodeExporter commented 8 years ago
Note: This will break the tests for bash due to new "local" keywords

Original comment by josepharmbruster@gmail.com on 30 Nov 2007 at 9:02

GoogleCodeExporter commented 8 years ago
Here's the starter patch to support Lua.  I patched the bash block to handle 
the new
local keyword.  Only thing left to do is add test case.  HTML contains some 
test code
I snatched from http://lua-users.org/wiki for giggles.

Enjoy!

Original comment by josepharmbruster@gmail.com on 30 Nov 2007 at 9:29

Attachments:

GoogleCodeExporter commented 8 years ago
Note: I felt as if I needed to hack at the 'END'PLN blah tokens to make the 
test case
work, please let me know if it was all done correctly.

Original comment by josepharmbruster@gmail.com on 30 Nov 2007 at 9:30

GoogleCodeExporter commented 8 years ago
Since LUA has a very different lexical grammar than most of the other 
languages, I
did it as a language extension.  See the usage comment in
http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-lua.j
s

Please also see the testcase at
http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html#is
sue24

I've never written a line of LUA, so that's based on my quick reading of 
chapter 2 of
the language reference.  Please let me know if it's all mucked up.

Original comment by mikesamuel@gmail.com on 5 Jul 2008 at 11:53