From 44aee69f064ec54afa9fdc6c79db19369b42a66d Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Fri, 24 Jan 2025 13:18:31 -0800 Subject: [PATCH] fix: test_ast --- .../test_ast/test_ast_nested/ast-nested.json | 838 +++++++++--------- 1 file changed, 419 insertions(+), 419 deletions(-) diff --git a/tests/unit/codegen/sdk/output/snapshots/test_ast/test_ast_nested/ast-nested.json b/tests/unit/codegen/sdk/output/snapshots/test_ast/test_ast_nested/ast-nested.json index 276f5605f..3079c70e1 100644 --- a/tests/unit/codegen/sdk/output/snapshots/test_ast/test_ast_nested/ast-nested.json +++ b/tests/unit/codegen/sdk/output/snapshots/test_ast/test_ast_nested/ast-nested.json @@ -1,421 +1,421 @@ { - "codegen_sdk_type": "PyClass", - "span": { - "range": { - "start_byte": 1, - "end_byte": 66, - "start_point": { - "row": 1, - "column": 0 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "class_definition", - "children": [ - [ - "get_name()", - { - "codegen_sdk_type": "Name", - "span": { - "range": { - "start_byte": 7, - "end_byte": 10, - "start_point": { - "row": 1, - "column": 6 - }, - "end_point": { - "row": 1, - "column": 9 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "identifier", - "children": [] - } - ], - [ - "methods", - { - "codegen_sdk_type": "PyCodeBlock", - "span": { - "range": { - "start_byte": 16, - "end_byte": 66, - "start_point": { - "row": 2, - "column": 4 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "block", - "children": [ - [ - "statements", - { - "codegen_sdk_type": "MultiLineCollection", - "span": { - "range": { - "start_byte": 16, - "end_byte": 66, - "start_point": { - "row": 2, - "column": 4 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "block", - "children": [ - [ - null, - { - "codegen_sdk_type": "SymbolStatement", - "span": { - "range": { - "start_byte": 16, - "end_byte": 66, - "start_point": { - "row": 2, - "column": 4 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "class_definition", - "children": [ - [ - null, - { - "codegen_sdk_type": "Name", - "span": { - "range": { - "start_byte": 22, - "end_byte": 25, - "start_point": { - "row": 2, - "column": 10 - }, - "end_point": { - "row": 2, - "column": 13 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "identifier", - "children": [] - } - ], - [ - null, - { - "codegen_sdk_type": "PyCodeBlock", - "span": { - "range": { - "start_byte": 35, - "end_byte": 66, - "start_point": { - "row": 3, - "column": 8 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "block", - "children": [ - [ - "statements", - { - "codegen_sdk_type": "MultiLineCollection", - "span": { - "range": { - "start_byte": 35, - "end_byte": 66, - "start_point": { - "row": 3, - "column": 8 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "block", - "children": [ - [ - null, - { - "codegen_sdk_type": "SymbolStatement", - "span": { - "range": { - "start_byte": 35, - "end_byte": 66, - "start_point": { - "row": 3, - "column": 8 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "function_definition", - "children": [ - [ - null, - { - "codegen_sdk_type": "Name", - "span": { - "range": { - "start_byte": 39, - "end_byte": 42, - "start_point": { - "row": 3, - "column": 12 - }, - "end_point": { - "row": 3, - "column": 15 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "identifier", - "children": [] - } - ], - [ - null, - { - "codegen_sdk_type": "Collection", - "span": { - "range": { - "start_byte": 42, - "end_byte": 48, - "start_point": { - "row": 3, - "column": 15 - }, - "end_point": { - "row": 3, - "column": 21 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "parameters", - "children": [ - [ - null, - { - "codegen_sdk_type": "PyParameter", - "span": { - "range": { - "start_byte": 43, - "end_byte": 47, - "start_point": { - "row": 3, - "column": 16 - }, - "end_point": { - "row": 3, - "column": 20 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "identifier", - "children": [] - } - ] - ] - } - ], - [ - null, - { - "codegen_sdk_type": "PyCodeBlock", - "span": { - "range": { - "start_byte": 62, - "end_byte": 66, - "start_point": { - "row": 4, - "column": 12 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "block", - "children": [ - [ - "statements", - { - "codegen_sdk_type": "MultiLineCollection", - "span": { - "range": { - "start_byte": 62, - "end_byte": 66, - "start_point": { - "row": 4, - "column": 12 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "block", - "children": [ - [ - null, - { - "codegen_sdk_type": "PyPassStatement", - "span": { - "range": { - "start_byte": 62, - "end_byte": 66, - "start_point": { - "row": 4, - "column": 12 - }, - "end_point": { - "row": 4, - "column": 16 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "pass_statement", - "children": [] - } - ] - ] - } - ] - ] - } - ] - ] - } - ] - ] - } - ] - ] - } - ] - ] - } - ] - ] - } - ] - ] - } - ], - [ - null, - { - "codegen_sdk_type": "Name", - "span": { - "range": { - "start_byte": 22, - "end_byte": 25, - "start_point": { - "row": 2, - "column": 10 - }, - "end_point": { - "row": 2, - "column": 13 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "identifier", - "children": [] - } - ], - [ - null, - { - "codegen_sdk_type": "Name", - "span": { - "range": { - "start_byte": 39, - "end_byte": 42, - "start_point": { - "row": 3, - "column": 12 - }, - "end_point": { - "row": 3, - "column": 15 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "identifier", - "children": [] - } - ], - [ - null, - { - "codegen_sdk_type": "Name", - "span": { - "range": { - "start_byte": 43, - "end_byte": 47, - "start_point": { - "row": 3, - "column": 16 - }, - "end_point": { - "row": 3, - "column": 20 - } - }, - "filepath": "test.py" - }, - "tree_sitter_type": "identifier", - "children": [] - } - ] - ] + "codegen_sdk_type": "PyClass", + "span": { + "range": { + "start_byte": 1, + "end_byte": 66, + "start_point": { + "row": 1, + "column": 0 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "class_definition", + "children": [ + [ + "get_name()", + { + "codegen_sdk_type": "Name", + "span": { + "range": { + "start_byte": 7, + "end_byte": 10, + "start_point": { + "row": 1, + "column": 6 + }, + "end_point": { + "row": 1, + "column": 9 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "identifier", + "children": [] + } + ], + [ + "methods", + { + "codegen_sdk_type": "PyCodeBlock", + "span": { + "range": { + "start_byte": 16, + "end_byte": 66, + "start_point": { + "row": 2, + "column": 4 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "block", + "children": [ + [ + "statements", + { + "codegen_sdk_type": "MultiLineCollection", + "span": { + "range": { + "start_byte": 16, + "end_byte": 66, + "start_point": { + "row": 2, + "column": 4 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "block", + "children": [ + [ + null, + { + "codegen_sdk_type": "SymbolStatement", + "span": { + "range": { + "start_byte": 16, + "end_byte": 66, + "start_point": { + "row": 2, + "column": 4 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "class_definition", + "children": [ + [ + null, + { + "codegen_sdk_type": "Name", + "span": { + "range": { + "start_byte": 22, + "end_byte": 25, + "start_point": { + "row": 2, + "column": 10 + }, + "end_point": { + "row": 2, + "column": 13 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "identifier", + "children": [] + } + ], + [ + null, + { + "codegen_sdk_type": "PyCodeBlock", + "span": { + "range": { + "start_byte": 35, + "end_byte": 66, + "start_point": { + "row": 3, + "column": 8 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "block", + "children": [ + [ + "statements", + { + "codegen_sdk_type": "MultiLineCollection", + "span": { + "range": { + "start_byte": 35, + "end_byte": 66, + "start_point": { + "row": 3, + "column": 8 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "block", + "children": [ + [ + null, + { + "codegen_sdk_type": "SymbolStatement", + "span": { + "range": { + "start_byte": 35, + "end_byte": 66, + "start_point": { + "row": 3, + "column": 8 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "function_definition", + "children": [ + [ + null, + { + "codegen_sdk_type": "Name", + "span": { + "range": { + "start_byte": 39, + "end_byte": 42, + "start_point": { + "row": 3, + "column": 12 + }, + "end_point": { + "row": 3, + "column": 15 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "identifier", + "children": [] + } + ], + [ + null, + { + "codegen_sdk_type": "Collection", + "span": { + "range": { + "start_byte": 42, + "end_byte": 48, + "start_point": { + "row": 3, + "column": 15 + }, + "end_point": { + "row": 3, + "column": 21 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "parameters", + "children": [ + [ + null, + { + "codegen_sdk_type": "PyParameter", + "span": { + "range": { + "start_byte": 43, + "end_byte": 47, + "start_point": { + "row": 3, + "column": 16 + }, + "end_point": { + "row": 3, + "column": 20 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "identifier", + "children": [] + } + ] + ] + } + ], + [ + null, + { + "codegen_sdk_type": "PyCodeBlock", + "span": { + "range": { + "start_byte": 62, + "end_byte": 66, + "start_point": { + "row": 4, + "column": 12 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "block", + "children": [ + [ + "statements", + { + "codegen_sdk_type": "MultiLineCollection", + "span": { + "range": { + "start_byte": 62, + "end_byte": 66, + "start_point": { + "row": 4, + "column": 12 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "block", + "children": [ + [ + null, + { + "codegen_sdk_type": "PyPassStatement", + "span": { + "range": { + "start_byte": 62, + "end_byte": 66, + "start_point": { + "row": 4, + "column": 12 + }, + "end_point": { + "row": 4, + "column": 16 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "pass_statement", + "children": [] + } + ] + ] + } + ] + ] + } + ] + ] + } + ] + ] + } + ] + ] + } + ] + ] + } + ] + ] + } + ] + ] + } + ], + [ + null, + { + "codegen_sdk_type": "Name", + "span": { + "range": { + "start_byte": 22, + "end_byte": 25, + "start_point": { + "row": 2, + "column": 10 + }, + "end_point": { + "row": 2, + "column": 13 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "identifier", + "children": [] + } + ], + [ + null, + { + "codegen_sdk_type": "Name", + "span": { + "range": { + "start_byte": 39, + "end_byte": 42, + "start_point": { + "row": 3, + "column": 12 + }, + "end_point": { + "row": 3, + "column": 15 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "identifier", + "children": [] + } + ], + [ + null, + { + "codegen_sdk_type": "Name", + "span": { + "range": { + "start_byte": 43, + "end_byte": 47, + "start_point": { + "row": 3, + "column": 16 + }, + "end_point": { + "row": 3, + "column": 20 + } + }, + "filepath": "test.py" + }, + "tree_sitter_type": "identifier", + "children": [] + } + ] + ] }