From 5173c86ded407b4990903e275be1f286345006ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Thu, 28 Nov 2019 15:43:52 +0100 Subject: [PATCH] remember input string in result --- parser.go | 2 +- result.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/parser.go b/parser.go index c2fbb3e..1b196b6 100644 --- a/parser.go +++ b/parser.go @@ -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) diff --git a/result.go b/result.go index 6f0f819..13e2cd5 100644 --- a/result.go +++ b/result.go @@ -15,6 +15,7 @@ type Result struct { Token string Child []Result Result interface{} + Input string Start int End int }