summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2017-01-30 07:42:59 +0100
committerGeorg Brandl <georg@python.org>2017-01-30 07:42:59 +0100
commit1aec641cfd9cb1a15a504d3d4b0a5f4092a593c3 (patch)
tree4b2c42660078e44f930b37c42c11ce064c1e4e76
parent68cfbd6fb823f77b741be33109deab4936ac9fe5 (diff)
downloadpygments-1aec641cfd9cb1a15a504d3d4b0a5f4092a593c3.tar.gz
Xorg: add whitespace rule
-rw-r--r--pygments/lexers/xorg.py6
-rw-r--r--tests/examplefiles/xorg.conf2
2 files changed, 5 insertions, 3 deletions
diff --git a/pygments/lexers/xorg.py b/pygments/lexers/xorg.py
index 1344f6e5..89475a80 100644
--- a/pygments/lexers/xorg.py
+++ b/pygments/lexers/xorg.py
@@ -23,12 +23,14 @@ class XorgLexer(RegexLexer):
tokens = {
'root': [
+ (r'\s+', Text),
(r'#.*$', Comment),
+
(r'((|Sub)Section)(\s+)("\w+")',
bygroups(String.Escape, String.Escape, Text, String.Escape)),
(r'(End(|Sub)Section)', String.Escape),
- (r'(^(?!S|E|#)(|\s+)(?!Sec|End|Sub)\w+)(\s+)([^\n#]+)',
- bygroups(Name.Builtin, Text, Text, Name.Constant)),
+ (r'(\w+)(\s+)([^\n#]+)',
+ bygroups(Name.Builtin, Text, Name.Constant)),
],
}
diff --git a/tests/examplefiles/xorg.conf b/tests/examplefiles/xorg.conf
index a189be9f..e1f7164b 100644
--- a/tests/examplefiles/xorg.conf
+++ b/tests/examplefiles/xorg.conf
@@ -26,7 +26,7 @@ EndSection
Section "Device"
Identifier "Card0"
Driver "nvidia"
- VendorName "NVIDIA Corporation"
+ VendorName "NVIDIA Corporation" # inline comment
#Option "RenderAccel" "true"
#Option "NvAgp" "3"