all: unify const names to snake_case

This commit is contained in:
yuyi 2020-05-22 23:36:09 +08:00 committed by GitHub
parent aef751861d
commit dda875a9c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 543 additions and 540 deletions

View file

@ -4,7 +4,7 @@
import os
const (
NUMERIC_CHAR = [`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`.`,`e`,`E`]
numeric_char = [`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`.`,`e`,`E`]
)
// Convert expression to Reverse Polish Notation.
@ -17,7 +17,7 @@ fn expr_to_rev_pol(expr string) ?[]string {
mut pos := 0
for pos<expr.len {
mut end_pos := pos
for end_pos<expr.len && expr[end_pos] in NUMERIC_CHAR {
for end_pos<expr.len && expr[end_pos] in numeric_char {
end_pos++
}
if end_pos>pos {
@ -102,7 +102,7 @@ fn eval_rev_pol(rev_pol []string) ?f64 {
fn is_num_string(str string) bool {
for c in str {
if c !in NUMERIC_CHAR {
if c !in numeric_char {
return false
}
}