about summary refs log tree commit diff
path: root/pkg/lang/scanner
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-04-21 03:19:06 +0200
committerMel <einebeere@gmail.com>2022-04-21 03:19:06 +0200
commitb5a9660b6ac42bce27c746e76013c3ce5992743a (patch)
tree0e9bd21a30aae25fe21a7a3994a48ac2cea8c955 /pkg/lang/scanner
parent5267c0e8653b431cfd2c06212cdba4f22225bd02 (diff)
downloadjinx-b5a9660b6ac42bce27c746e76013c3ce5992743a.tar.zst
jinx-b5a9660b6ac42bce27c746e76013c3ce5992743a.zip
Lang parser prototype
Diffstat (limited to 'pkg/lang/scanner')
-rw-r--r--pkg/lang/scanner/token/token.go9
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
+	}
+}