Add working tview, add working load ond Tables, remove giu

This commit is contained in:
Pablu
2025-12-01 15:00:58 +01:00
parent 027aad1374
commit 6182129022
11 changed files with 383 additions and 172 deletions

View File

@@ -19,11 +19,21 @@ const (
LPAREN
RPAREN
COMMA
ASTERIKS
ASSIGN
// Keywords
CREATE
TABLE
SELECT
FROM
WHERE
AND
OR
ORDER
TOP
PRIMARY
FOREIGN
REFERENCES
@@ -35,6 +45,8 @@ const (
TEXT
INTEGER
NULL
REAL
BLOB
)
var keywords map[string]Token = map[string]Token{
@@ -50,6 +62,15 @@ var keywords map[string]Token = map[string]Token{
"NULL": NULL,
"IF": IF,
"EXISTS": EXISTS,
"SELECT": SELECT,
"FROM": FROM,
"WHERE": WHERE,
"AND": AND,
"OR": OR,
"ORDER": ORDER,
"TOP": TOP,
"REAL": REAL,
"BLOB": BLOB,
}
type Position struct {
@@ -91,6 +112,10 @@ func (l *Lexer) Lex() (Position, Token, string) {
return l.pos, LPAREN, "("
case ')':
return l.pos, RPAREN, ")"
case '*':
return l.pos, ASTERIKS, "*"
case '=':
return l.pos, ASSIGN, "="
default:
if unicode.IsSpace(r) {
continue