summaryrefslogtreecommitdiff
path: root/pygments/lexers/installers.py
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2021-11-13 19:53:40 +0100
committerMatthäus G. Chajdas <dev@anteru.net>2021-11-13 19:55:07 +0100
commiteddc11e7e867fe5d80dcffce309c0e96f0da75ac (patch)
tree3881cfd8ef5d08d3cdf3c02fc71e4f2032735d1e /pygments/lexers/installers.py
parent55daae8f28661f05c04fa38d48434df722f7dd85 (diff)
downloadpygments-git-eddc11e7e867fe5d80dcffce309c0e96f0da75ac.tar.gz
Improve NSIS lexer.
* Correctly identify whitespace. * Merge consecutive tokens where possible. * Consistently use String.Double for the opening and closing quotation marks
Diffstat (limited to 'pygments/lexers/installers.py')
-rw-r--r--pygments/lexers/installers.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/pygments/lexers/installers.py b/pygments/lexers/installers.py
index 804f5973..1f7b2831 100644
--- a/pygments/lexers/installers.py
+++ b/pygments/lexers/installers.py
@@ -42,7 +42,8 @@ class NSISLexer(RegexLexer):
include('basic'),
(r'\$\{[a-z_|][\w|]*\}', Keyword.Pseudo),
(r'/[a-z_]\w*', Name.Attribute),
- ('.', Text),
+ (r'\s+', Whitespace),
+ (r'[\w.]+', Text),
],
'basic': [
(r'(\n)(Function)(\s+)([._a-z][.\w]*)\b',
@@ -128,16 +129,16 @@ class NSISLexer(RegexLexer):
(r'\$[a-z_]\w*', Name.Variable),
],
'str_double': [
- (r'"', String, '#pop'),
+ (r'"', String.Double, '#pop'),
(r'\$(\\[nrt"]|\$)', String.Escape),
include('interpol'),
- (r'.', String.Double),
+ (r'[^"]+', String.Double),
],
'str_backtick': [
- (r'`', String, '#pop'),
+ (r'`', String.Double, '#pop'),
(r'\$(\\[nrt"]|\$)', String.Escape),
include('interpol'),
- (r'.', String.Double),
+ (r'[^`]+', String.Double),
],
}