diff options
author | Özgür Kesim <oec@codeblau.de> | 2019-11-28 15:43:52 +0100 |
---|---|---|
committer | Özgür Kesim <oec@codeblau.de> | 2019-11-28 15:43:52 +0100 |
commit | 5173c86ded407b4990903e275be1f286345006ec (patch) | |
tree | 334a37efdec34392bc170669762e330a580dbf19 | |
parent | 29336c8a7a98087bc83ef39d352282bc92b1b3c5 (diff) |
remember input string in result
-rw-r--r-- | parser.go | 2 | ||||
-rw-r--r-- | result.go | 1 |
2 files changed, 2 insertions, 1 deletions
@@ -80,7 +80,7 @@ func Run(parser Parserish, input string, ws ...VoidParser) (result interface{}, ps.WS = ws[0] } - ret := Result{} + ret := Result{Input: input} p(ps, &ret) ps.WS(ps) @@ -15,6 +15,7 @@ type Result struct { Token string Child []Result Result interface{} + Input string Start int End int } |