summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-03-01 18:47:03 +0100
committerGeorg Brandl <georg@python.org>2010-03-01 18:47:03 +0100
commitf411adb77e3eab8d26978134ca1e69de2584f21e (patch)
treea47477ca6592970848ef234a552dab86ec30fee9
parentce802b6aea5f21efa06c61dacb54be7a6d79e966 (diff)
downloadpygments-f411adb77e3eab8d26978134ca1e69de2584f21e.tar.gz
Allow shebang line in Lua lexer.
-rw-r--r--CHANGES2
-rw-r--r--pygments/lexers/agile.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 14a62a66..1d034fc6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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),