summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/forth/forth.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/go/forth/forth.go b/go/forth/forth.go
index 389036e..5ae7805 100644
--- a/go/forth/forth.go
+++ b/go/forth/forth.go
@@ -130,7 +130,7 @@ func literal(n int) word {
}
}
-func number(s string) (int, bool) {
+func atoi(s string) (int, bool) {
n, err := strconv.Atoi(s)
return n, err == nil
}
@@ -140,7 +140,7 @@ func colon(dict dictionary, l *lexer) error {
return ErrEOL
}
name := l.next()
- if _, ok := number(name); ok {
+ if _, ok := atoi(name); ok {
return ErrWord
}
w, err := compile(dict, l)
@@ -171,7 +171,7 @@ func compile(dict dictionary, l *lexer) ([]word, error) {
continue
}
// try to parse literal
- if n, ok := number(v); ok {
+ if n, ok := atoi(v); ok {
words = append(words, literal(n))
continue
}