summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorp4bl0 <r _at_ uzy .dot. me>2018-06-18 18:44:29 (CEST)
committerp4bl0 <r _at_ uzy .dot. me>2018-06-18 18:44:29 (CEST)
commit06777ed756119ab6d4d2c8f00010b5415d6697ef (patch)
treec0d80b0fa8df8adf53b458aeb398ea184e2871c6
parentbae593053c9804d87568909fdc6e5d31bbf47bf4 (diff)
downloadseselab-06777ed756119ab6d4d2c8f00010b5415d6697ef.zip
seselab-06777ed756119ab6d4d2c8f00010b5415d6697ef.tar.gz
fix include path bug
-rw-r--r--compiler.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler.py b/compiler.py
index 4c8843a..4f41295 100644
--- a/compiler.py
+++ b/compiler.py
@@ -187,7 +187,8 @@ class Compiler:
self._ln.append(1)
for l in inp:
if '.include' in l:
- self.compile_file(l.split('.include', 1)[1].strip())
+ self.compile_file(os.path.dirname(path) + '/' +
+ l.split('.include', 1)[1].strip())
else:
a = self.instr(l)
if a is not None:
@@ -202,7 +203,7 @@ class Compiler:
try:
self._code.append([['jmp', ('lbl', 'main')], ('_', -1)])
self._count += 1
- self.compile_file(path)
+ self.compile_file(os.path.abspath(path))
for instr in self._code:
if instr[0][0] in ('cal', 'jmp', 'beq', 'bne'):
if instr[0][1][0] == 'lbl':
Pablo Rauzy — generated by cgit