diff options
author | Özgür Kesim <oec@codeblau.de> | 2019-11-29 07:50:44 +0100 |
---|---|---|
committer | Özgür Kesim <oec@codeblau.de> | 2019-11-29 07:50:44 +0100 |
commit | cf289e64743647b158ebcc85b4c7aade0d345067 (patch) | |
tree | 21aa4878662b9c573eb7c4c472378ffacf0d5efa /combinator.go | |
parent | a7c195f79968b20cc7cf7b3a9f9fbb22459cb348 (diff) |
added .Input to newly created Results
Diffstat (limited to 'combinator.go')
-rw-r--r-- | combinator.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/combinator.go b/combinator.go index f5c06e3..b6b888b 100644 --- a/combinator.go +++ b/combinator.go @@ -12,6 +12,7 @@ func Seq(parsers ...Parserish) Parser { node.Child = make([]Result, len(parserfied)) startpos := ps.Pos for i, parser := range parserfied { + node.Child[i].Input = node.Input parser(ps, &node.Child[i]) if ps.Errored() { ps.Pos = startpos @@ -97,7 +98,7 @@ func manyImpl(min int, op Parserish, sep ...Parserish) Parser { node.Child = make([]Result, 0, 5) startpos := ps.Pos for { - node.Child = append(node.Child, Result{}) + node.Child = append(node.Child, Result{Input: node.Input}) opParser(ps, &node.Child[len(node.Child)-1]) if ps.Errored() { if len(node.Child)-1 < min || ps.Cut > ps.Pos { |