diff --git a/pythonbpf/codegen.py b/pythonbpf/codegen.py index de3d5a8..5b34836 100644 --- a/pythonbpf/codegen.py +++ b/pythonbpf/codegen.py @@ -9,10 +9,15 @@ from .globals_pass import globals_processing def processor(source_code, filename, module): tree = ast.parse(source_code, filename) print(ast.dump(tree, indent=4)) - constants_processing(tree, module) - license_processing(tree, module) - globals_processing(tree, module) - functions_processing(tree, module) + + # For now, we will parse the BPF specific parts of AST + # Big rewrite + + # will worry later + # constants_processing(tree, module) + # license_processing(tree, module) + # globals_processing(tree, module) + # functions_processing(tree, module) def compile_to_ir(filename: str, output: str): diff --git a/pythonbpf/decorators.py b/pythonbpf/decorators.py index 6e7a618..115d34f 100644 --- a/pythonbpf/decorators.py +++ b/pythonbpf/decorators.py @@ -1,3 +1,9 @@ +def bpf(func): + """Decorator to mark a function for BPF compilation.""" + func._is_bpf = True + return func + + def section(name: str): def wrapper(fn): fn._section = name