diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-06 17:02:39 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-06 17:02:39 +1000 |
commit | a65a9325aaebd1499a8e523463cc023124f8536a (patch) | |
tree | 2fb31800b67a3914a7204a28319a7aeb0ac649c7 /nodes.go | |
parent | 8b343d6360d0edc065b9b62ab5e708e907b45a92 (diff) |
Get the HTML parser working
Diffstat (limited to 'nodes.go')
-rw-r--r-- | nodes.go | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -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} -} |