From e94ddb0e0b2fc3a67a10c2f248a9ecfdffbe7b93 Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Mon, 17 May 2021 13:29:50 -0500 Subject: [PATCH] Need an absolute path for the pre-processor --- c2logic/instruction_definition.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c2logic/instruction_definition.py b/c2logic/instruction_definition.py index aa5989c..14d9771 100644 --- a/c2logic/instruction_definition.py +++ b/c2logic/instruction_definition.py @@ -1,3 +1,4 @@ +from pathlib import Path from pycparser import parse_file, c_ast def extract_asm(body: c_ast.Compound): @@ -45,7 +46,7 @@ class InstructionReader(c_ast.NodeVisitor): except AttributeError: record['args'] = tuple() -instructions = parse_file('instruction_definition.c', use_cpp=True) +instructions = parse_file(str(Path(__file__).parent / 'instruction_definition.c'), use_cpp=True) reader = InstructionReader() reader.visit(instructions) FUNCS = reader.funcs