mirror of
https://github.com/hazemKrimi/jack-compiler.git
synced 2026-05-01 17:48:57 +00:00
chore: rename parser back to compilation engine
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package parser
|
||||
package engine
|
||||
|
||||
import (
|
||||
"errors"
|
||||
@@ -637,7 +637,7 @@ func compileClass(output *strings.Builder, tokens []tokenizer.Token) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func ParseTokens(tokens []tokenizer.Token) (string, error) {
|
||||
func Compile(tokens []tokenizer.Token) (string, error) {
|
||||
var output strings.Builder
|
||||
|
||||
if err := compileClass(&output, tokens); err != nil {
|
||||
|
||||
@@ -26,7 +26,7 @@ func process(inputPath string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
parsed, err := parser.ParseTokens(tokens)
|
||||
compiled, err := engine.Compile(tokens)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -34,7 +34,7 @@ func process(inputPath string) error {
|
||||
|
||||
outputPath := strings.Replace(inputPath, ".jack", ".xml", 1)
|
||||
|
||||
if err := os.WriteFile(outputPath, []byte(parsed), 0644); err != nil {
|
||||
if err := os.WriteFile(outputPath, []byte(compiled), 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user