diff options
| author | Mel <einebeere@gmail.com> | 2022-05-09 00:01:02 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-05-09 00:01:02 +0200 |
| commit | b09a14147d397904722ee7c25e4defc56135b96f (patch) | |
| tree | 694dc725528310f3a65d04785b8eea33908ce69f /pkg/lang/scanner/token | |
| parent | b5a9660b6ac42bce27c746e76013c3ce5992743a (diff) | |
| download | jinx-b09a14147d397904722ee7c25e4defc56135b96f.tar.zst jinx-b09a14147d397904722ee7c25e4defc56135b96f.zip | |
Extract source walk part of scanner
Diffstat (limited to 'pkg/lang/scanner/token')
| -rw-r--r-- | pkg/lang/scanner/token/loc.go | 10 | ||||
| -rw-r--r-- | pkg/lang/scanner/token/token.go | 8 |
2 files changed, 5 insertions, 13 deletions
diff --git a/pkg/lang/scanner/token/loc.go b/pkg/lang/scanner/token/loc.go deleted file mode 100644 index 7936cba..0000000 --- a/pkg/lang/scanner/token/loc.go +++ /dev/null @@ -1,10 +0,0 @@ -package token - -type Loc struct { - Row int - Col int -} - -func NewLoc(row, col int) Loc { - return Loc{row, col} -} diff --git a/pkg/lang/scanner/token/token.go b/pkg/lang/scanner/token/token.go index 1ccd864..a39df8a 100644 --- a/pkg/lang/scanner/token/token.go +++ b/pkg/lang/scanner/token/token.go @@ -1,19 +1,21 @@ package token +import "jinx/pkg/libs/source" + type Token struct { Kind TokenKind - At Loc + At source.Loc Data any } -func Simple(kind TokenKind, at Loc) Token { +func Simple(kind TokenKind, at source.Loc) Token { return Token{ Kind: kind, At: at, } } -func New(kind TokenKind, at Loc, data any) Token { +func New(kind TokenKind, at source.Loc, data any) Token { return Token{ Kind: kind, At: at, |
