Skip to content

Commit 055842a

Browse files
committed
♻️ priting AST node tree as default
1 parent 49e5195 commit 055842a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

PascalInterpreter.playground/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ let interpeter = Interpreter("7 + 3 * (10 / (12 / (3 + 1) - 1)) / (2 + 3) - 5 -
1717
interpeter.eval()
1818

1919
let parser = Parser("2 * (7 + 3) ")
20-
print(parser.expr().asString)
20+
print(parser.expr())

SwiftPascalInterpreter/SwiftPascalInterpreter/Extensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ extension Interpreter: CustomStringConvertible {
9797
}
9898
}
9999

100-
extension AST {
101-
public var asString: String {
100+
extension AST: CustomStringConvertible {
101+
public var description: String {
102102
return treeString(self, using: { node in
103103
switch node {
104104
case let .number(value):

0 commit comments

Comments
 (0)