refactored print loop, project structure

This commit is contained in:
Aidan Hahn 2019-11-29 00:02:00 -08:00
parent aaa0a8a507
commit b0d9bb4643
No known key found for this signature in database
GPG key ID: 327711E983899316
9 changed files with 14 additions and 25 deletions

11
cmd/print_ast.go Normal file
View file

@ -0,0 +1,11 @@
package main
import (
"strings"
"os"
"git.callpipe.com/aidan/shsh"
)
func main() {
shsh.PrintSExpression(shsh.Lex(strings.Join(os.Args[1:], " ")))
}

View file

@ -1,14 +0,0 @@
package main
import (
"bufio"
"os"
"git.callpipe.com/aidan/shsh"
)
func main() {
scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() {
shsh.PrintSExpression(shsh.Lex(scanner.Text()))
}
}