aboutsummaryrefslogtreecommitdiff
path: root/driver/parser/parser.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2022-11-13 14:03:19 +0900
committerRyo Nihei <nihei.dev@gmail.com>2022-11-13 14:23:10 +0900
commit16a433b0681a19985c0134d5f9719f0fcdfe634a (patch)
tree67ccababc0e79106a9c55bf529ae7ecee78a9f80 /driver/parser/parser.go
parentFix typo (diff)
downloadurubu-16a433b0681a19985c0134d5f9719f0fcdfe634a.tar.gz
urubu-16a433b0681a19985c0134d5f9719f0fcdfe634a.tar.xz
Add byte position to nodes of a syntax tree
Diffstat (limited to 'driver/parser/parser.go')
-rw-r--r--driver/parser/parser.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/driver/parser/parser.go b/driver/parser/parser.go
index 05f7d38..2eaa678 100644
--- a/driver/parser/parser.go
+++ b/driver/parser/parser.go
@@ -64,6 +64,10 @@ type VToken interface {
// Invalid returns true when a token is invalid.
Invalid() bool
+ // BytePosition returns (position, length) pair.
+ // `position` is a byte position where a token appears and `length` is a length in bytes.
+ BytePosition() (int, int)
+
// Position returns (row, column) pair.
Position() (int, int)
}