nac3standalone/demo: handle imports consistently
This commit is contained in:
parent
234823c51a
commit
3f890f183c
@ -6,6 +6,7 @@ import importlib.machinery
|
||||
import pathlib
|
||||
|
||||
from numpy import int32, int64, uint32, uint64
|
||||
from typing import TypeVar, Generic
|
||||
|
||||
|
||||
def patch(module):
|
||||
@ -35,6 +36,8 @@ def patch(module):
|
||||
module.int64 = int64
|
||||
module.uint32 = uint32
|
||||
module.uint64 = uint64
|
||||
module.TypeVar = TypeVar
|
||||
module.Generic = Generic
|
||||
module.extern = extern
|
||||
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
from typing import TypeVar, Generic
|
||||
|
||||
@extern
|
||||
def output_int32(x: int32):
|
||||
...
|
||||
|
@ -62,9 +62,6 @@ fn main() {
|
||||
let parser_result = parser::parse_program(&program, file_name.into()).unwrap();
|
||||
|
||||
for stmt in parser_result.into_iter() {
|
||||
if matches!(stmt.node, StmtKind::Import { .. } | StmtKind::ImportFrom { .. }) {
|
||||
continue;
|
||||
}
|
||||
if let StmtKind::Assign { targets, value, .. } = &stmt.node {
|
||||
fn handle_typevar_definition(
|
||||
var: &Expr,
|
||||
|
Loading…
Reference in New Issue
Block a user