Skip to content

Commit

Permalink
Fix indents of a tree
Browse files Browse the repository at this point in the history
  • Loading branch information
nihei9 committed Aug 19, 2021
1 parent 4248528 commit 6c2036e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@ $ echo -n 'foo + bar * baz * 100' | vartan parse expr.json
expr
├─ expr
│ └─ term
└─ factor
└─ id "foo"
│ └─ factor
│ └─ id "foo"
├─ add_op "+"
└─ term
├─ term
│ ├─ term
│ │ └─ factor
│ │ └─ id "bar"
│ ├─ mul_op "*"
│ └─ factor
└─ id "baz"
├─ mul_op "*"
└─ factor
└─ number "100"
├─ term
│ ├─ term
│ │ └─ factor
│ │ └─ id "bar"
│ ├─ mul_op "*"
│ └─ factor
└─ id "baz"
├─ mul_op "*"
└─ factor
└─ number "100"
```

When `vartan parse` command successfully parses the input data, it prints a CST or an AST (if any).
Expand Down
2 changes: 1 addition & 1 deletion driver/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func printTree(w io.Writer, node *Node, ruledLine string, childRuledLinePrefix s

var prefix string
if i >= num-1 {
prefix = " "
prefix = " "
} else {
prefix = "│ "
}
Expand Down

0 comments on commit 6c2036e

Please sign in to comment.