Daniel Däschle
3881e97a40
vlib: remove ustring usage ( #10618 )
2021-06-30 22:30:28 +03:00
Uwe Krüger
60c880a0cc
vlib: use `malloc_noscan()` where possible ( #10465 )
2021-06-15 14:47:11 +03:00
crthpl
4273a9697e
parser: add support for flags in asm output constraints ( #10103 )
2021-05-14 12:01:15 +03:00
Delyan Angelov
84f9789e72
v: tag more low level functions with `[direct_array_access]`
2021-05-06 00:35:16 +03:00
Delyan Angelov
3405f517a4
v.scanner: apply `[direct_array_access]` for key frequently called low level functions
2021-05-05 23:45:23 +03:00
Delyan Angelov
597a774d36
scanner: speed up Scanner.skip_whitespace (~2-3% speed up of `-o x.c cmd/v`)
2021-05-03 14:14:32 +03:00
Lukas Neubert
b2c16ced57
parser: filter out vet space indent errors inside StringInterLiterals ( #9695 )
2021-04-12 16:03:22 +03:00
Lukas Neubert
46e7e27ba3
v vet: give an error for trailing whitespace ( #9574 )
2021-04-09 13:22:14 +03:00
Lukas Neubert
a0648a3ec2
all: fixes related to Node.pos ( #9613 )
2021-04-06 15:16:19 +02:00
Ned Palacios
b9cbb4f177
scanner: fix eof token position ( #9432 )
2021-03-23 08:51:09 +01:00
Ned Palacios
aa4e22c287
scanner, token: add column information to tokens ( #9407 )
2021-03-23 06:23:46 +01:00
Delyan Angelov
a00c80b98f
v: support compiler notices. Use them for `[deprecated_after: '2021-05-01']` tags
...
Compiler notices are like warnings, with these differences:
a) notices use a different color.
b) notices use a different label.
c) notices do not prevent compilation with -prod.
(warnings are converted to errors with -prod)
2021-03-22 19:59:00 +02:00
Delyan Angelov
c76c69ec35
all: simplify `return if ...` constructs to make more code compatible with -autofree
2021-03-22 16:45:29 +02:00
zakuro
8dc0e4d150
v.scanner: decode \uXXXX in scanner ( #9298 )
2021-03-14 12:09:17 +02:00
zakuro
00dedaf6c1
scanner: replace ascii unicode(\u0020) with hex(\x20) ( #9259 )
2021-03-13 08:02:42 +02:00
Lukas Neubert
a67d49050c
math: add a pure V `math.mathutil`, with generic `min`, `max` and `abs` functions ( #9176 ), and use it consistently
2021-03-12 11:28:04 +02:00
StunxFS
6a7ef4f5b2
v.scanner: fix position of hash statements ( #9222 )
2021-03-10 20:23:17 +02:00
zakuro
db9b523cc9
utf8: deprecate utf8.char_len ( #9008 )
2021-03-01 15:35:57 +02:00
Delyan Angelov
1c0eefae38
parser/scanner: replace p.peek_tok2/3 with p.peek_token(2/3) ( #8946 )
2021-02-24 21:03:53 +03:00
Lukas Neubert
18aecde9e5
fmt: cleanup comments code ( #8901 )
2021-02-22 18:43:54 +02:00
zakuro
1891ebf22d
scanner: print multibyte char for invalid char error ( #8804 )
2021-02-18 15:43:39 +02:00
Lukas Neubert
848295cdea
scanner: do not warn on \' after string interpolation ( #8729 )
2021-02-15 17:54:30 +02:00
Lukas Neubert
473cd1d416
fmt: single line ternary return ( #8605 )
2021-02-08 00:28:46 +01:00
Lukas Neubert
7f4c582f1a
fmt: unwrap long infix exprs inside parenthesis if necessary ( #8609 )
2021-02-07 23:10:39 +01:00
Lukas Neubert
58b37519e0
scanner: fix warning for \" after string interpolation ( #8510 )
2021-02-02 14:14:06 +02:00
Lukas Neubert
e47c13903b
fmt: keep newlines between toplevel stmts ( #8383 )
2021-01-29 12:17:59 +02:00
Delyan Angelov
4fcd8d8a98
scanner: fix `' "$var", "$another"'` where `r"`, was treated as start of a raw string
2021-01-28 15:38:42 +02:00
Delyan Angelov
079fbffaf5
scanner: implement s.trace/2
2021-01-28 15:21:19 +02:00
StunxFS
cb885d30b4
scanner: fix typo ( #8345 )
2021-01-27 13:53:41 +01:00
Delyan Angelov
728344ff65
ci: fix `v test-cleancode`
2021-01-25 12:55:01 +02:00
Lukas Neubert
8b61891348
fmt: smarter if condition wrapping ( #8201 )
2021-01-23 10:33:22 +02:00
Daniel Däschle
dbf84520f1
all: update assoc syntax ( #8274 )
2021-01-22 23:24:48 +01:00
Tim Basel
129eee346b
fmt: keep single empty lines ( #8189 )
2021-01-19 14:49:40 +01:00
Lukas Neubert
ac2c3847af
all: update copyright to 2019-2021 ( #8029 )
2021-01-18 13:20:06 +01:00
Lukas Neubert
16c9cbce7c
fmt: correctly increase f.line_len for write_indent ( #8174 )
2021-01-18 06:02:29 +01:00
Daniel Däschle
53941c4a0a
fmt: fix if cond break readability ( #8132 )
2021-01-16 02:12:17 +01:00
zakuro
4cd50ed566
scanner: remove debug_tokens ( #8078 )
2021-01-13 08:33:37 +01:00
zakuro
254df0ca62
fmt: improve string quotes ( #8075 )
2021-01-13 06:05:27 +01:00
Lukas Neubert
0e490766df
fmt: do not move single line block comments to previous line ( #8046 )
2021-01-13 03:30:24 +01:00
zakuro
33694665f0
fmt: align each contiguous field of struct. not the whole. ( #7981 )
2021-01-12 04:38:43 +01:00
zakuro
2103d9a6c4
fmt: keep new line at both ends of block comment ( #8003 )
2021-01-10 21:06:29 +01:00
Larpon
8f315d226b
vvet: move to own subdir, prepare richer suggestions ( #7989 )
2021-01-09 16:11:49 +02:00
Alexander Medvednikov
3e04dfc79f
builtin: fix byte.str() (part 1)
2021-01-05 18:59:51 +01:00
Lukas Neubert
eaba21d81a
fmt: keep the shebang header in vsh files ( #7893 )
2021-01-05 16:14:16 +02:00
zakuro
dd516858d4
fmt: align struct field comments ( #7632 )
2021-01-03 21:10:25 +01:00
zakuro
73f41f9a2a
scanner: remove unicode operator ( #7766 )
2021-01-01 13:05:28 +02:00
zakuro
a6e6c48c36
fmt: keep _ separator in number literals ( #7495 )
2020-12-23 14:48:43 +02:00
yuyi
c11928260d
scanner: minor cleanup of scanner.v ( #7467 )
2020-12-22 10:56:29 +01:00
Lukas Neubert
c922565525
fmt: only insert a space after // if the 3rd char is alphanumeric ( #7330 )
2020-12-15 04:26:28 +01:00
Daniel Däschle
7e3e30aa9c
ci: add a parser fuzzer step too ( #7288 )
2020-12-12 15:20:38 +02:00
Daniel Däschle
11808f9fa3
parser: fix silent errors ( #7271 )
2020-12-12 04:06:09 +01:00
yuyi
2a731e1c8e
scanner: fix interpolation with more embedded string args ( #7258 )
2020-12-11 19:15:59 +02:00
Daniel Däschle
9c1a5c5117
parser: fix silent parsing examples/vmod.v ( #7264 )
2020-12-11 19:14:07 +02:00
Daniel Däschle
1c56ff7faf
parser: fix fibonacci in silent mode ( #7240 )
2020-12-10 18:17:25 +02:00
Daniel Däschle
8b3ffb9be2
scanner: fix when string literal ends after } ( #7237 )
2020-12-10 17:04:12 +02:00
Daniel Däschle
032ea0f4f8
scanner: fix silent mode string parsing ( #7220 )
2020-12-09 20:09:07 +01:00
yuyi
5fa1e403ec
scanner: fix interpolation with string args ( #7214 )
2020-12-09 19:58:27 +01:00
yuyi
05a217aaf0
scanner: minor cleanup and optimization in scanner.v ( #7204 )
2020-12-09 02:09:46 +01:00
Lukas Neubert
f30faf2627
scanner: allow \e escape used for ANSI colors ( #7177 )
2020-12-07 17:21:34 +01:00
yuyi
f377710c0b
scanner: minor optimization in `text_scan()` ( #7172 )
2020-12-07 06:33:41 +01:00
Daniel Däschle
47d0ed308d
parser: prepare for better VLS integration, more accurate parser errors ( #7119 )
2020-12-04 20:34:05 +02:00
Delyan Angelov
7a8d6a7c7b
scanner: treat warnings as errors on -W too, simillar to the parser
2020-12-04 15:11:35 +02:00
Delyan Angelov
eefdf4baa6
scanner: do not warn for \x07 in strings
2020-12-03 14:11:32 +02:00
yuyi
0b96cd50e1
scanner: fix escape `\u` ( fix #6849 ) ( #7012 )
2020-11-29 17:01:40 +02:00
yuyi
f336c2c5cc
scanner: fix error of backslash escaping x in ident_string( fix #6850 ) ( #6994 )
2020-11-29 00:39:45 +02:00
Delyan Angelov
e6116c47be
scanner: guarantee an early exit when the parser/scanner is stuck
2020-11-27 12:44:39 +02:00
yuyi
636efb3c20
cgen: fix windows escape errors for comptime @ pseudo vars ( #6977 )
2020-11-27 11:16:57 +02:00
Alexander Medvednikov
9b0c96d792
scanner: allow \r after $
2020-11-27 03:27:34 +01:00
Alexander Medvednikov
c27818e247
all: remove remaining broken escape sequences
2020-11-27 03:17:19 +01:00
Alexander Medvednikov
62ee436944
all: remove broken escape sequences after $ in strings
2020-11-27 03:07:37 +01:00
Ned Palacios
b957c64905
scanner: store errors and warnings on silent mode ( #6883 )
2020-11-20 11:44:19 +02:00
Delyan Angelov
7d472d887e
scanner: vfmt scanner.v
2020-11-11 17:25:58 +02:00
Delyan Angelov
8c241cb745
checker: check that fns with return values, and matches, do return
2020-11-11 17:23:57 +02:00
Larpon
4051ce869c
all: remove unused enum value and improve error message for `@` tokens in scanner ( #6751 )
2020-11-05 12:59:49 +02:00
Larpon
785bf40f67
all: remove comp time '@' expansion from scanner ( #6746 )
2020-11-05 10:12:32 +02:00
Enzo
b083f4014b
fmt: fix multiple things and format most of the compiler ( #6631 )
...
Format expressions inside string interpolation like the rest (it used to be a+b instead of a + b, not too sure why)
Fix formatting some match branches when there were only one statement inside (it was inlined)
Fix parsing and formatting some comments edge case on struct field init. You should check out this test because the result is a bit different from before. I personally find it more logical but I would understand if the former format was to stay
Fix formatting of void-returning function signature
2020-10-15 22:12:59 +02:00
Alexander Medvednikov
982056894e
fmt: use `f(x int, y int)` instead of `f(x, y int)`
2020-10-15 12:00:46 +02:00
Delyan Angelov
8e5067421f
vet: accumulate the collected errors manually (fixes CI)
2020-10-06 10:02:35 +03:00
Alexander Medvednikov
256a572cbe
vet: fix vet_errors
2020-10-06 07:07:50 +02:00
Alexander Medvednikov
63c9b88e7f
vet: remove unnecessary &[]string
2020-10-06 06:43:28 +02:00
Henrixounez
0f1ed1ca09
scanner: add an error for unfinished string literals ( #6519 )
2020-10-01 16:40:59 +03:00
Alexander Medvednikov
624f22e27e
all: mutability check (part 1); enable mutable sumtype args
2020-09-22 05:28:29 +02:00
Swastik Baranwal
077b597bd8
scanner/parser: change error msgs for `\0` and `\x00` and add error for r`byte` and c`byte` ( #6436 )
2020-09-21 17:34:24 +03:00
Swastik Baranwal
1c886ad067
scanner: add check for `!is_raw` for null `\0` ( #6427 )
2020-09-19 19:09:18 +03:00
Henrixounez
99574e465d
scanner: allow escape on null character ( #6404 )
2020-09-18 01:02:06 +02:00
Daniel Däschle
3a146a6dbe
checker: fix error pos on default value ( #6338 )
2020-09-09 15:34:41 +02:00
Delyan Angelov
47f59d3fb6
v.scanner: fix error line numbers when comments end with CRLF
2020-08-26 11:39:32 +03:00
Nick Treleaven
98c39a37c0
scanner: warn about interpolation for `$f(expr)` ( #6179 )
2020-08-22 05:48:06 +02:00
Uwe Krüger
9a5f040f72
all: handle `<-` arrow token for channel operations ( #6152 )
2020-08-17 20:12:00 +02:00
Delyan Angelov
36eae1c175
builtin: x.vstring() instead of string(x) ( #6102 )
2020-08-10 18:05:26 +02:00
Maciej Michalec
449c98e861
scanner: floats without fraction ( fix #5262 ) ( #6064 )
2020-08-05 05:11:29 +02:00
Swastik Baranwal
8b66816bdc
scanner: more checks for `_` as num_sep ( #5992 )
2020-07-28 16:09:19 +10:00
Delyan Angelov
a552674254
vvet: fix segfault on `v vet .`
2020-07-25 15:57:57 +03:00
Alexander Medvednikov
632e27a4a9
all: fix a big mutability bug and update all mutable vars
2020-07-23 23:16:36 +02:00
Enzo
8a855ccae1
fmt,vet: handle `var in [single_value]` ( #5882 )
2020-07-19 19:58:34 +02:00
Swastik Baranwal
f3a505b558
scanner: add check for `_` in num literals ( #5849 )
2020-07-16 17:29:07 +03:00
Delyan Angelov
c891014c77
scanner: reduce memory, increase speed for long commented sections
2020-07-11 21:27:39 +03:00
Delyan Angelov
022cc72740
scanner: parse multiple comments and long strings without a stackoverflow
2020-07-11 20:52:08 +03:00
Alexander Medvednikov
2a696cb837
vet: prohibit spaces before `)`
2020-07-11 12:14:19 +02:00
Alexander Medvednikov
549d7a487d
tests: fix scanner_test.v
2020-07-11 11:51:58 +02:00