aboutsummaryrefslogtreecommitdiff
path: root/tools/cmake2meson.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cmake2meson.py')
-rwxr-xr-xtools/cmake2meson.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/cmake2meson.py b/tools/cmake2meson.py
index 960cad9..24d8e4a 100755
--- a/tools/cmake2meson.py
+++ b/tools/cmake2meson.py
@@ -22,12 +22,13 @@ class Lexer:
self.token_specification = [
# Need to be sorted longest to shortest.
('ignore', re.compile(r'[ \t]')),
- ('id', re.compile('[_0-9a-z/A-Z.]+')),
+ ('id', re.compile('[-+_0-9a-z/A-Z.]+')),
('eol', re.compile(r'\n')),
('comment', re.compile(r'\#.*')),
('lparen', re.compile(r'\(')),
('rparen', re.compile(r'\)')),
('string', re.compile('"[^"]*?"')),
+ ('varexp', re.compile(r'\${[-_0-9a-z/A-Z.]+}')),
]
def lex(self, code):
@@ -58,6 +59,8 @@ class Lexer:
yield('Id: ' + match_text)
elif tid == 'eol':
yield('eol')
+ elif tid == 'varexp':
+ yield('Variable:' + match_text[2:-1])
else:
raise RuntimeError('Wharrgarbl')
break