lua-users home
lua-l archive

Re: GNU Source-highlight -> Lua Highlighter for enscript

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


On 2004年4月26日, Luiz Henrique de Figueiredo wrote:
> GNU Source-highlight 1.9 now includes support for Lua.
> http://www.gnu.org/software/src-highlite/
I have modified enscript.st file in my computer in order to include
support for Lua code in enscript, other gnu source-highlight formatter
(http://people.ssh.fi/mtr/genscript/). I did not know about src-highlite,
but I will try it and maybe it replaces enscript :). Anyway, I sent you
the configuration file needed to give support to Lua.
Best regards,
Salvador E.
Post.data: I sent you only diff output with respect to the original
configuration file enscript.st, I can send you the entire file If you
want. It seems to work well, but I have coded it with no knowledge of
"awk-like" enscript language, only by analogy to other source.
1290d1289
< /\.lua$/				lua;
4534,4656d4532
< /**
< * Name: lua
< * Description: Lua programming language.
< */
< 
< state lua_string
< {
< /(\]\])/ {
< language_print (0ドル);
< return;
< }
< lua_string_end {
< language_print (0ドル);
< return;
< }
< LANGUAGE_SPECIALS {
< language_print (0ドル);
< }
< }
< 
< state lua_long_comment
< {
< /(\]\])/ {
< language_print (0ドル);
< return;
< }
< LANGUAGE_SPECIALS {
< language_print (0ドル);
< }
< }
< 
< state lua
< {
< /* Comments. */
< /^#|--/ {
< comment_face (true);
< language_print (0ドル);
< call (eat_one_line);
< comment_face (false);
< }
< 
< /* Lua long comment */
< /(--\[\[)/ {
< comment_face (true);
< language_print (0ドル);
< call (lua_long_comment);
< comment_face (false);
< }
< 
< /* Lua strings */
< /(\[\[)/ {
< string_face (true);
< language_print (0ドル);
< call (lua_string);
< string_face (false);
< }
< 
< /(\"|[\'])/ {
< lua_string_end = regexp( 0ドル );
< string_face (true);
< language_print (0ドル);
< call (lua_string);
< string_face (false);
< }
< 
< /* Function */
< /([ \t]*)(function)([ \t]+)([^(]*)/ {
< /* indentation */
< language_print (1ドル);
< 
< /* def */
< keyword_face (true);
< language_print (2ドル);
< keyword_face (false);
< 
< /* middle */
< language_print (3ドル);
< 
< /* Function name. */
< function_name_face (true);
< language_print (4ドル);
< function_name_face (false);
< }
< 
< /* local variable */
< /([ \t]*)(local)([ \t,]+)([^=]*)/ {
< /* indentation */
< language_print (1ドル);
< 
< keyword_face (true);
< language_print (2ドル);
< keyword_face (false);
< 
< /* middle */
< language_print (3ドル);
< 
< /* Function name. */
< variable_name_face (true);
< language_print (4ドル);
< variable_name_face (false);
< }
< 
< /* Keywords
< (build-re '(and assert break class continue def del elif else
< else: except except: exec finally for from global if import in
< is lambda not or pass print raise return try try: while
< yield)) */
< /\b(and|break|do|e(lse(|if)|nd)|f(alse|or|unction)|i(f|n)|local|n(il|ot)|\
< or|re(peat|turn)|t(hen|rue)|until|while)\b/ {
< keyword_face (true);
< language_print (0ドル);
< keyword_face (false);
< }
< }
< 
< 
< /*
< Local variables:
< mode: c
< End:
< */
< 

AltStyle によって変換されたページ (->オリジナル) /