diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2022-11-13 14:03:19 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2022-11-13 14:23:10 +0900 |
commit | 16a433b0681a19985c0134d5f9719f0fcdfe634a (patch) | |
tree | 67ccababc0e79106a9c55bf529ae7ecee78a9f80 /driver/parser/template.go | |
parent | Fix typo (diff) | |
download | cotia-16a433b0681a19985c0134d5f9719f0fcdfe634a.tar.gz cotia-16a433b0681a19985c0134d5f9719f0fcdfe634a.tar.xz |
Add byte position to nodes of a syntax tree
Diffstat (limited to 'driver/parser/template.go')
-rw-r--r-- | driver/parser/template.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/driver/parser/template.go b/driver/parser/template.go index 96eb71f..e9620dc 100644 --- a/driver/parser/template.go +++ b/driver/parser/template.go @@ -433,6 +433,10 @@ func (t *vToken) Invalid() bool { return t.tok.Invalid } +func (t *vToken) BytePosition() (int, int) { + return t.tok.BytePos, t.tok.ByteLen +} + func (t *vToken) Position() (int, int) { return t.tok.Row, t.tok.Col } |