diff options
Diffstat (limited to 'pkg/lang/scanner/token/token.go')
| -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 + } +} |
