Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use regex to filter labels from a.out files of vasm

  • Loading branch information...
commit f0d643daf0f56fcfdf31a1d77358d6cb1f14eafe 1 parent 57d766d
Krusty/Benediction authored
View
1  README.rst
@@ -8,6 +8,7 @@ do cross-dev computing for the Amstrad CPC.
Current functionalities are:
* syntactic error detection in z80 source files
+ * extraction of symbols value in vasm a.out files
Other functionalities will be added depending on my needs in my current CPC projects.
View
19 cpcdemotools/source_checker/vasm_symbols.py
@@ -15,6 +15,7 @@
# imports
import sys
+import re
# code
if __name__ == '__main__':
@@ -47,16 +48,18 @@
symbols[label] = value
- # TODO filter with regex (no need to type the whole label)
- if len(sys.argv) == 3:
- label = sys.argv[2]
- if label in symbols:
- print "%s\tequ %s" % (label, symbols[label][1:-1])
- else:
- sys.stderr.write('Label "%s" not present\n' % label)
- else:
+ if len(sys.argv) == 3: # Search according to a REGEX
+ search = re.compile(sys.argv[2])
+
+ # Filter labels
+ for label in sorted(symbols.keys()):
+ if re.search(search, label):
+ print "%s\tequ %s" % (label, symbols[label][1:-1])
+ else: # Display all
for label in sorted(symbols.keys()):
print "%s\tequ %s" % (label, symbols[label][1:-1])
+
+
# metadata
__author__ = 'Krusty/Benediction'
__copyright__ = 'Copyright 2013, Benediction'
View
1  cpcdemotools/source_checker/z80_syntax_checker.py
@@ -16,6 +16,7 @@
But it can quickly detect some errors.
"""
# TODO add: ex de, hl ; push sp ; add a
+# TODO remove duplciate alert when set is used
# imports
import sys, os
View
14 setup.py
@@ -9,11 +9,19 @@
author='Romain Giot',
author_email='giot.romain@gmail.com',
url='http://www.python.org/sigs/distutils-sig/',
- packages=['cpcdemotools', 'cpcdemotools.source_checker'],
- scripts=['cpcdemotools/source_checker/z80_syntax_checker.py']
+ packages=[
+ 'cpcdemotools',
+ 'cpcdemotools.source_checker',
+ 'cpcdemotools.sound'
+ ],
+ scripts=[
+ 'cpcdemotools/source_checker/z80_syntax_checker.py',
+ 'cpcdemotools/source_checker/vasm_symbols.py',
+ 'cpcdemotools/sound/ymreader.py'
+
+ ]
)
-#!/usr/bin/env python
# metadata
Please sign in to comment.
Something went wrong with that request. Please try again.