Some more work on string expansion.

This commit is contained in:
Daniel Jones 2013-02-28 22:49:34 -08:00
parent 084a45fc74
commit f812efe3ad
4 changed files with 90 additions and 35 deletions

16
mk.go
View file

@ -1,13 +1,13 @@
package main
import (
//"fmt"
//"io/ioutil"
//"os"
"fmt"
"io/ioutil"
"os"
)
func main() {
//input, _ := ioutil.ReadAll(os.Stdin)
input, _ := ioutil.ReadAll(os.Stdin)
// TEST LEXING
//_, tokens := lex(string(input))
@ -16,10 +16,10 @@ func main() {
//}
// TEST PARSING
//rs := parse(string(input), "<stdin>")
//fmt.Println(rs)
rs := parse(string(input), "<stdin>")
fmt.Println(rs)
// TEST STRING EXPANSION
rules := &ruleSet{make(map[string][]string), make([]rule, 0)}
println(rules.expand("\"This is a quote: \\\"\""))
//rules := &ruleSet{make(map[string][]string), make([]rule, 0)}
//println(rules.expand("\"This is a quote: \\\"\""))
}