1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

toml: remove math import (used only for math.max and math.max_u32)

This commit is contained in:
Delyan Angelov 2022-04-11 10:21:14 +03:00
parent 1938bc48e7
commit e4dfffd70b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -3,14 +3,13 @@
// that can be found in the LICENSE file. // that can be found in the LICENSE file.
module scanner module scanner
import math
import toml.input import toml.input
import toml.token import toml.token
import toml.util import toml.util
pub const ( pub const (
digit_extras = [`_`, `.`, `x`, `o`, `b`, `e`, `E`] digit_extras = [`_`, `.`, `x`, `o`, `b`, `e`, `E`]
end_of_text = math.max_u32 end_of_text = 4294967295
) )
// Scanner contains the necessary fields for the state of the scan process. // Scanner contains the necessary fields for the state of the scan process.
@ -346,7 +345,7 @@ fn (mut s Scanner) new_token(kind token.Kind, lit string, len int) token.Token {
return token.Token{ return token.Token{
kind: kind kind: kind
lit: lit lit: lit
col: math.max(1, col) col: if col < 1 { 1 } else { col }
line_nr: s.line_nr + 1 line_nr: s.line_nr + 1
pos: s.pos - s.header_len - len + 1 pos: s.pos - s.header_len - len + 1
len: len len: len