diff options
author | Georg Brandl <georg@python.org> | 2010-03-01 18:47:03 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-03-01 18:47:03 +0100 |
commit | f411adb77e3eab8d26978134ca1e69de2584f21e (patch) | |
tree | a47477ca6592970848ef234a552dab86ec30fee9 | |
parent | ce802b6aea5f21efa06c61dacb54be7a6d79e966 (diff) | |
download | pygments-f411adb77e3eab8d26978134ca1e69de2584f21e.tar.gz |
Allow shebang line in Lua lexer.
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | pygments/lexers/agile.py | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -36,7 +36,7 @@ Version 1.3 - Add small enhancements to the C lexer (#467) and Bash lexer (#469). - Small fixes for the Tcl, Debian control file, Nginx config, - Smalltalk, Objective-C, Clojure lexers. + Smalltalk, Objective-C, Clojure, Lua lexers. - Gherkin lexer: Fixed single apostrophe bug and added new i18n keywords. diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py index ea605404..bfaf0a68 100644 --- a/pygments/lexers/agile.py +++ b/pygments/lexers/agile.py @@ -1011,6 +1011,11 @@ class LuaLexer(RegexLexer): tokens = { 'root': [ + # lua allows a file to start with a shebang + (r'#!(.*?)$', Comment.Preproc), + (r'', Text, 'base'), + ], + 'base': [ (r'(?s)--\[(=*)\[.*?\]\1\]', Comment.Multiline), ('--.*$', Comment.Single), |