scanner: make the 1. float error a warning for now

pull/11312/head
Alexander Medvednikov 2021-08-25 16:58:54 +03:00
parent 109d5d5847
commit 714fa3215c
4 changed files with 4 additions and 3 deletions

View File

@ -8,6 +8,8 @@ fn C.darwin_draw_string(x int, y int, s string, cfg voidptr)
fn C.darwin_text_width(s string) int fn C.darwin_text_width(s string) int
fn C.darwin_text_width_runes(r []rune) int
fn C.darwin_window_refresh() fn C.darwin_window_refresh()
fn C.darwin_draw_rect(f32, f32, f32, f32, voidptr) fn C.darwin_draw_rect(f32, f32, f32, f32, voidptr)

View File

@ -68,7 +68,6 @@ int darwin_text_width(string s) {
return (int)(ceil(size.width)); return (int)(ceil(size.width));
} }
void darwin_draw_rect(float x, float y, float width, float height, gx__Color c) { void darwin_draw_rect(float x, float y, float width, float height, gx__Color c) {
NSColor* color = nscolor(c); NSColor* color = nscolor(c);
NSRect rect = NSMakeRect(x, y, width, height); NSRect rect = NSMakeRect(x, y, width, height);

View File

@ -438,7 +438,7 @@ fn (mut s Scanner) ident_dec_number() string {
s.pos-- s.pos--
} else { } else {
// 5. // 5.
s.error('float literals should have a digit after the decimal point, e.g. `5.0`') s.warn('float literals should have a digit after the decimal point, e.g. `5.0`')
} }
} }
} }

View File

@ -1,4 +1,4 @@
vlib/v/scanner/tests/float_literals_dot_err.vv:2:9: error: float literals should have a digit after the decimal point, e.g. `5.0` vlib/v/scanner/tests/float_literals_dot_err.vv:2:9: warning: float literals should have a digit after the decimal point, e.g. `5.0`
1 | fn main() { 1 | fn main() {
2 | a := 1. 2 | a := 1.
| ^ | ^