please help

This commit is contained in:
2024-08-10 16:49:47 +02:00
parent fec3c39de2
commit 459c7f47cd
6 changed files with 118 additions and 42 deletions
+6 -5
View File
@@ -3,16 +3,17 @@ package main
import (
"fmt"
"github.com/wyst-lang/wyst/token"
"github.com/wyst-lang/wyst/parser"
)
func main() {
tokens, err := Tokenize("test 123", token.RULES_TOP)
code := "hello"
ast, state, err := parser.Parse(code, parser.TOP)
if err != nil {
fmt.Printf("Syntax error at %s \n", err)
fmt.Printf("SyntaxErr at %d:%d: %s\n", state.Line, state.Column, err)
return
}
for i := 0; i < len(tokens); i++ {
fmt.Printf("%s\n", tokens[i])
for i := 0; i < len(ast); i++ {
fmt.Printf("%s\n", ast[i])
}
}