aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-05-25 08:01:40 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-05-25 08:01:40 +0300
commit3a4cdb843bb4f866137b1113ab9af9bc1e7d5a76 (patch)
tree8f2384e31b08f27dd96eadc4e7bb1db177f88fac /tools
parent7d25129c03905868423381e4df714a88b34e304a (diff)
downloadmeson-3a4cdb843bb4f866137b1113ab9af9bc1e7d5a76.zip
meson-3a4cdb843bb4f866137b1113ab9af9bc1e7d5a76.tar.gz
meson-3a4cdb843bb4f866137b1113ab9af9bc1e7d5a76.tar.bz2
Can now lex all of libcolumbus.
Diffstat (limited to 'tools')
-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