Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Aug 17, 2024
1 parent 472bfc1 commit 64f306a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

.idea/vcs.xml
.idea/modules.xml
.idea/Davi.iml
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions davi.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
package main

import (
"encoding/json"
"fmt"
. "github.com/DavinciScript/Davi/lexer"
)

func main() {

fmt.Println("Running davi.go")

// Run the lexer
lexer := NewLexer([]byte(`print(1234, "foo") @`))
lexer := NewLexer([]byte(`print(1234, "foo")`))
for {
pos, tok, val := lexer.Next()
if tok == EOF {
break
}
fmt.Printf("%d:%d %s %q\n", pos.Line, pos.Column, tok, val)
data := map[string]interface{}{
"posLine": pos.Line,
"posColumn": pos.Column,
"token": tok,
"value": val,
}
out, _ := json.MarshalIndent(data, "", " ")
fmt.Println(string(out))
if tok == ILLEGAL {
break
}
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module github.com/DavinciScript/Davi

go 1.21.5

require github.com/lmittmann/tint v1.0.5 // indirect
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/lmittmann/tint v1.0.5 h1:NQclAutOfYsqs2F1Lenue6OoWCajs5wJcP3DfWVpePw=
github.com/lmittmann/tint v1.0.5/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=

0 comments on commit 64f306a

Please sign in to comment.