summaryrefslogtreecommitdiff
path: root/nodes.go
diff options
context:
space:
mode:
authorAdam Scarr <adam@vektah.net>2017-08-06 17:02:39 +1000
committerAdam Scarr <adam@vektah.net>2017-08-06 17:02:39 +1000
commita65a9325aaebd1499a8e523463cc023124f8536a (patch)
tree2fb31800b67a3914a7204a28319a7aeb0ac649c7 /nodes.go
parent8b343d6360d0edc065b9b62ab5e708e907b45a92 (diff)
Get the HTML parser working
Diffstat (limited to 'nodes.go')
-rw-r--r--nodes.go25
1 files changed, 1 insertions, 24 deletions
diff --git a/nodes.go b/nodes.go
index 410fa7e..29dd58f 100644
--- a/nodes.go
+++ b/nodes.go
@@ -3,18 +3,6 @@ package parsec
import "fmt"
type Node interface {
- Pos() int
-}
-
-type Token struct {
- pos int
- Value string
-}
-
-func (e Token) Pos() int { return e.pos }
-
-func NewToken(pos int, value string) Token {
- return Token{pos, value}
}
type Error struct {
@@ -29,18 +17,7 @@ func NewError(pos int, message string) Error {
return Error{pos, message}
}
-func IsError(n Node) bool {
+func IsError(n interface{}) bool {
_, isErr := n.(Error)
return isErr
}
-
-type Sequence struct {
- pos int
- Nodes []Node
-}
-
-func (e Sequence) Pos() int { return e.pos }
-
-func NewSequence(pos int, n ...Node) Sequence {
- return Sequence{pos, n}
-}