fix(tests): serialize alias statements
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
from typing import Optional, Sequence
|
from typing import Optional, Sequence
|
||||||
|
|
||||||
from midas.ast.midas import (
|
from midas.ast.midas import (
|
||||||
|
AliasStmt,
|
||||||
BinaryExpr,
|
BinaryExpr,
|
||||||
CallExpr,
|
CallExpr,
|
||||||
ComplexType,
|
ComplexType,
|
||||||
@@ -61,6 +62,13 @@ class MidasAstJsonSerializer(
|
|||||||
"bound": self._serialize_optional(param.bound),
|
"bound": self._serialize_optional(param.bound),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def visit_alias_stmt(self, stmt: AliasStmt) -> dict:
|
||||||
|
return {
|
||||||
|
"_type": "AliasStmt",
|
||||||
|
"name": stmt.name.lexeme,
|
||||||
|
"type": stmt.type.accept(self),
|
||||||
|
}
|
||||||
|
|
||||||
def visit_member_stmt(self, stmt: MemberStmt) -> dict:
|
def visit_member_stmt(self, stmt: MemberStmt) -> dict:
|
||||||
return {
|
return {
|
||||||
"_type": "MemberStmt",
|
"_type": "MemberStmt",
|
||||||
|
|||||||
Reference in New Issue
Block a user