Skip to content

Commit cf17db3

Browse files
committed
unscape control characters
1 parent 2fe5c94 commit cf17db3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: 5_main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package main
1919
import (
2020
"log"
2121
"os"
22+
"strings"
23+
"time"
2224
)
2325

2426
/*
@@ -40,8 +42,11 @@ func main() {
4042
if err != nil {
4143
log.Fatal(err)
4244
}
43-
l := NewLexer(string(input))
45+
str := string(input)
46+
str = strings.NewReplacer(`\n`, "\n", `\t`, "\t", `\r`, "\r").Replace(str)
47+
l := NewLexer(str)
4448
p := NewParser(l.tokens)
4549
scope := NewScope(nil)
4650
Eval(p.nodes, scope)
51+
time.Sleep(time.Second * 30)
4752
}

0 commit comments

Comments
 (0)