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/parser.go | |
parent | Fix typo (diff) | |
download | urubu-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.go | 4 |
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) } |