DeanLight / graph_rewrite

Graph rewriting project
Apache License 2.0
1 stars 0 forks source link

allowing constant constrained syntactic sugar #5

Open DeanLight opened 2 years ago

DeanLight commented 2 years ago
""" a[x:int = ] """

""" a[x:str = "hello world" ] """

""" b[x:ExpNode = 5 ] """

type="ExpNode" 
val = "a~1"

constructor = getName("ExpNode")

try:
    instance = constructor(val)
Except:
    print("Error")

if getattr(instance, __eq__) == None:
    raise ("equality not found for type {type}")
instance == match['b']['x']

__eq__

int("5")

int("fsd")
DeanLight commented 2 years ago
class Result:

    nx_pointer
    mapper

    __getitem__(self, key):
        nx_pointer.get_node_attributes(self.nx_pointer, mapper[key])