wip: new folder structure, overhaul language

This commit is contained in:
2025-12-26 02:39:15 -05:00
parent 11e7f70625
commit d427703afe
10 changed files with 132 additions and 111 deletions

27
pkg/saccharine/token.go Normal file
View File

@@ -0,0 +1,27 @@
package saccharine
// All tokens in the pseudo-lambda language.
type TokenType int
const (
// Denotes the '(' token.
TokenOpenParen TokenType = iota
// Denotes the ')' token.
TokenCloseParen
// Denotes an alpha-numeric variable.
TokenVariable
// Denotes the '/' token.
TokenSlash
// Denotes the '.' token.
TokenDot
)
// A representation of a token in source code.
type Token struct {
// Where the token begins in the source text.
Index int
// What type the token is.
Type TokenType
// The value of the token.
Value string
}