Skip to content

Commit d4dd564

Browse files
committed
parser: remove strconv import
1 parent 498c8cf commit d4dd564

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

vlib/v/parser/parser.v

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import v.errors
1313
import os
1414
import runtime
1515
import time
16-
import strconv
1716

1817
pub struct Parser {
1918
file_name string // "/home/user/hello.v"
@@ -60,7 +59,7 @@ mut:
6059

6160
// for tests
6261
pub fn parse_stmt(text string, table &table.Table, scope &ast.Scope) ast.Stmt {
63-
pref:= &pref.Preferences{}
62+
pref := &pref.Preferences{}
6463
s := scanner.new_scanner(text, .skip_comments, pref)
6564
mut p := Parser{
6665
scanner: s
@@ -127,8 +126,8 @@ pub fn parse_file(path string, b_table &table.Table, comments_mode scanner.Comme
127126
eprintln('NB: You can run `v fmt -w file.v` to fix these automatically')
128127
exit(1)
129128
}
130-
//if pref.is_vet && p.scanner.text.contains('( '\n ') {
131-
//}
129+
// if pref.is_vet && p.scanner.text.contains('( '\n ') {
130+
// }
132131
return p.parse()
133132
}
134133

@@ -1203,12 +1202,12 @@ fn (mut p Parser) string_expr() ast.Expr {
12031202
if fields[0].len > 0 && fields[0][0] == `0` {
12041203
fill = true
12051204
}
1206-
fwidth = strconv.atoi(fields[0])
1205+
fwidth = fields[0].int()
12071206
if fwidthneg {
12081207
fwidth = -fwidth
12091208
}
12101209
if fields.len > 1 {
1211-
precision = strconv.atoi(fields[1])
1210+
precision = fields[1].int()
12121211
}
12131212
p.next()
12141213
}

0 commit comments

Comments
 (0)