Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions uast/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ var casesToNode = []struct {
KeyEnd: expPos(4, 2, 2),
},
},
{
name: "Bool",
obj: Bool{
GenNode: GenNode{
Positions: Positions{
KeyStart: {Offset: 3, Line: 2, Col: 1},
KeyEnd: {Offset: 8, Line: 2, Col: 6},
},
},
Value: true,
},
exp: nodes.Object{
KeyType: nodes.String("uast:Bool"),
KeyPos: nodes.Object{
KeyType: nodes.String(TypePositions),
KeyStart: expPos(3, 2, 1),
KeyEnd: expPos(8, 2, 6),
},
"Value": nodes.Bool(true),
},
},
{
name: "Alias",
obj: Alias{
Expand Down
7 changes: 7 additions & 0 deletions uast/uast.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func init() {
GenNode{},
Identifier{},
String{},
Bool{},
QualifiedIdentifier{},
Comment{},
Group{},
Expand Down Expand Up @@ -346,3 +347,9 @@ type Function struct {
Type FunctionType `json:"Type"`
Body *Block `json:"Body"`
}

// Bool is a boolean literal.
type Bool struct {
GenNode
Value bool `json:"Value"`
}