Skip to content

Commit

Permalink
Merge pull request #2098 from xushiwei/q
Browse files Browse the repository at this point in the history
change: for line <- lines(file) => for line <- file
  • Loading branch information
xushiwei authored Feb 11, 2025
2 parents 622d8b1 + b617361 commit 73e0d75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion demo/gop-parser/gopcalc/calc.gop
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func calc(e ast.Expr) float64 {
}

print "> "
for line <- lines(os.Stdin) {
for line <- os.Stdin {
e, err := parser.parseExpr(line)
if err != nil {
print "error: ${err}\n> "
Expand Down
2 changes: 1 addition & 1 deletion demo/gop-scanner/rpncalc/rpncalc.gop
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ func calc(expr string) string {
}

print "> "
for line <- lines(os.Stdin) {
for line <- os.Stdin {
print "${calc(line)}\n> "
}
6 changes: 3 additions & 3 deletions demo/gop-scanner/simplecalc/calc.gop
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ func calc(expr string) string {
token.QUO: 2,
}
s := scanner.new(expr, nil, 0)
n := 0 // op count
rv := true // require value
n := 0 // op count
rv := true // require value
neg := false // negative number
for {
pos, tok, lit := s.scan()
Expand Down Expand Up @@ -69,6 +69,6 @@ func calc(expr string) string {
}

print "> "
for line <- lines(os.Stdin) {
for line <- os.Stdin {
print "${calc(line)}\n> "
}

0 comments on commit 73e0d75

Please sign in to comment.