Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Summpot committed Oct 28, 2023
1 parent 2a58079 commit 65c2c5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/TreeSitterSharp/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,8 @@ public readonly TsNode ToUnmanaged()
return _internalNode;
}

public override readonly string ToString() => Ts.node_string(_internalNode);
public readonly string GetSExpression()
{
return Ts.node_string(_internalNode);
}
}
2 changes: 1 addition & 1 deletion tests/TreeSitterSharp.C.Tests/CParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ int fibonacci(int n) {
var tree = parser.Parse(code);
Node rootNode = tree.Root;

Assert.Equal(expected,rootNode.ToString());
Assert.Equal(expected, rootNode.GetSExpression());
}
}
2 changes: 1 addition & 1 deletion tests/TreeSitterSharp.Json.Tests/JsonParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void PrintTree()
(document (array (number) (null)))
""";

Assert.Equal(expected, rootNode.ToString());
Assert.Equal(expected, rootNode.GetSExpression());
}

}

0 comments on commit 65c2c5a

Please sign in to comment.