Created stub high-level module compilation function
This commit is contained in:
parent
93f0ac945f
commit
e8f6165f38
@ -1,8 +1,6 @@
|
||||
package lexer
|
||||
|
||||
import (
|
||||
"github.com/sashakoshka/arf/file"
|
||||
)
|
||||
import "github.com/sashakoshka/arf/file"
|
||||
|
||||
// LexingOperation holds information about an ongoing lexing operataion.
|
||||
type LexingOperation struct {
|
||||
|
@ -1,8 +1,6 @@
|
||||
package lexer
|
||||
|
||||
import (
|
||||
"github.com/sashakoshka/arf/file"
|
||||
)
|
||||
import "github.com/sashakoshka/arf/file"
|
||||
|
||||
// TokenKind is an enum represzenting what role a token has.
|
||||
type TokenKind int
|
||||
|
23
main.go
Normal file
23
main.go
Normal file
@ -0,0 +1,23 @@
|
||||
package arf
|
||||
|
||||
import "os"
|
||||
import "io"
|
||||
import "path/filepath"
|
||||
import "github.com/sashakoshka/arf/lexer"
|
||||
|
||||
func CompileModule (modulePath string, output io.Writer) (err error) {
|
||||
moduleFiles, err := os.ReadDir(modulePath)
|
||||
if err != nil { return err }
|
||||
|
||||
var moduleTokens []lexer.Token
|
||||
for _, entry := range moduleFiles {
|
||||
if filepath.Ext(entry.Name()) != ".arf" || entry.IsDir() {
|
||||
continue
|
||||
}
|
||||
|
||||
tokens, err := lexer.Tokenize()
|
||||
if err != nil { return err }
|
||||
}
|
||||
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user