diff options
| author | Mel <einebeere@gmail.com> | 2022-04-21 03:19:06 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-04-21 03:19:06 +0200 |
| commit | b5a9660b6ac42bce27c746e76013c3ce5992743a (patch) | |
| tree | 0e9bd21a30aae25fe21a7a3994a48ac2cea8c955 /pkg/lang/scanner/token | |
| parent | 5267c0e8653b431cfd2c06212cdba4f22225bd02 (diff) | |
| download | jinx-b5a9660b6ac42bce27c746e76013c3ce5992743a.tar.zst jinx-b5a9660b6ac42bce27c746e76013c3ce5992743a.zip | |
Lang parser prototype
Diffstat (limited to 'pkg/lang/scanner/token')
| -rw-r--r-- | pkg/lang/scanner/token/token.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/lang/scanner/token/token.go b/pkg/lang/scanner/token/token.go index 840a420..1ccd864 100644 --- a/pkg/lang/scanner/token/token.go +++ b/pkg/lang/scanner/token/token.go @@ -20,3 +20,12 @@ func New(kind TokenKind, at Loc, data any) Token { Data: data, } } + +func (t Token) CanEndStmt() bool { + switch t.Kind { + case EOF, EOL, SemiColon: + return true + default: + return false + } +} |
