diff --git a/crosstl/src/backend/DirectX/DirectxAst.py b/crosstl/src/backend/DirectX/DirectxAst.py index f0900f1..ac88d52 100644 --- a/crosstl/src/backend/DirectX/DirectxAst.py +++ b/crosstl/src/backend/DirectX/DirectxAst.py @@ -94,6 +94,7 @@ def __init__(self, condition, body): def __repr__(self): return f"WhileNode(condition={self.condition}, body={self.body})" + class DoWhileNode(ASTNode): def __init__(self, condition, body): self.condition = condition @@ -102,6 +103,7 @@ def __init__(self, condition, body): def __repr__(self): return f"DoWhileNode(condition={self.condition}, body={self.body})" + class ReturnNode(ASTNode): def __init__(self, value): self.value = value diff --git a/tests/test_backend/test_directx/test_codegen.py b/tests/test_backend/test_directx/test_codegen.py index 8f66ecc..29eddfe 100644 --- a/tests/test_backend/test_directx/test_codegen.py +++ b/tests/test_backend/test_directx/test_codegen.py @@ -209,6 +209,7 @@ def test_while_codegen(): except SyntaxError: pytest.fail("While loop parsing or code generation not implemented.") + def test_do_while_codegen(): code = """ struct VSInput { diff --git a/tests/test_backend/test_directx/test_parser.py b/tests/test_backend/test_directx/test_parser.py index 6ab507f..d36590a 100644 --- a/tests/test_backend/test_directx/test_parser.py +++ b/tests/test_backend/test_directx/test_parser.py @@ -93,6 +93,7 @@ def test_while_parsing(): except SyntaxError: pytest.fail("while parsing not implemented") + def test_do_while_parsing(): code = """ VSOutput VSMain(VSInput input) {