Delyan Angelov
8be10ffbd6
vfmt: always walk over all comptime branches
2020-04-24 19:05:55 +03:00
Delyan Angelov
863fab0268
comptime: enable again skipping parsing of other platform branches
2020-04-24 08:51:48 +03:00
Delyan Angelov
6b31ebe456
Revert "comptime: enable again skipping parsing of other platform branches"
...
This reverts commit 0f4c5fb1c9
.
2020-04-23 22:47:16 +03:00
Delyan Angelov
0f4c5fb1c9
comptime: enable again skipping parsing of other platform branches
2020-04-23 20:45:16 +03:00
Delyan Angelov
adb8fb1dc6
comptime: fix custom -d flags and `$if x? {}`. Fixes ftp_test.v .
2020-04-23 17:52:44 +03:00
yuyi
2b4f72ef64
parser: fix empty import error
2020-04-23 14:48:05 +02:00
Delyan Angelov
8b5573a6f3
errors: use more distinct and detailed name redefinition messages
2020-04-23 13:15:01 +03:00
yuyi
5664cbd3d0
enum: check enum name and modify related files
2020-04-23 05:16:10 +02:00
Kris Cherven
d871595437
all: replace `var` with `mut`
2020-04-23 01:16:58 +02:00
Alexander Medvednikov
d7ee4755c2
parser/cgen: interfaces (part 1)
2020-04-22 20:23:53 +02:00
joe-conigliaro
de182d5809
parser: use single scope for fn args/body
2020-04-22 21:15:38 +10:00
joe-conigliaro
80a4fbf0be
parser: anon fn arg scope fix
2020-04-22 21:11:58 +10:00
joe-conigliaro
3ca4f5fada
checker/parser: anon fn call & return type fix
2020-04-22 18:41:57 +10:00
Kris Cherven
5c3742fbd2
parser: check var names in for loops
2020-04-22 03:48:51 +02:00
Kris Cherven
155891a4e0
parser: add unused variable warning
2020-04-22 01:52:56 +02:00
joe-conigliaro
abf5942433
parser/cgen: anon fn var & calling ( #4534 )
2020-04-21 13:23:36 +10:00
Alexander Medvednikov
ee2e83fef0
go back to `mut`. decisions, decisions...
2020-04-21 05:11:50 +02:00
Alexander Medvednikov
1bf094fbca
parser: mut in receivers
2020-04-21 05:07:49 +02:00
Ruofan XU
cdb1b0344c
checker: improve type check for arithmetic assignment op and fix error pos
2020-04-20 20:56:05 +02:00
yuyi
717e26b45e
checker: more infix checks
2020-04-20 14:49:26 +02:00
Alexander Medvednikov
e006da7259
parser: fix a bad comment
2020-04-20 08:44:14 +02:00
Alexander Medvednikov
ee2f1652b5
fmt: add EOL
2020-04-20 08:30:42 +02:00
Alexander Medvednikov
c1fc768c1b
fmt: run on cmd/v; cgen: fix anonymous functions
2020-04-20 07:04:31 +02:00
Kris Cherven
95ae915c0c
checker/parser: fix outdated error messages
2020-04-19 20:46:48 +02:00
Enzo Baldisserri
57c142b993
checker: disallow pub in main
2020-04-19 00:07:57 +02:00
yuyi
5374899f29
parser: fix interpolation error
2020-04-18 00:22:03 +02:00
Enzo Baldisserri
f2be3d7ffb
checker: check that right `is` type exists
2020-04-18 00:19:33 +02:00
Tim Basel
73073cd954
parser: anonymous functions (part 1)
2020-04-17 21:59:19 +02:00
yuyi
67cd90de6e
parser: fix number parse error
2020-04-17 20:31:32 +02:00
Alexander Medvednikov
c4b7d7cab3
match: shadow variable instead of `it`
2020-04-17 19:24:10 +02:00
Alexander Medvednikov
59baef89a0
parser: assign.v, containers.v, for.v, if.v
2020-04-17 18:16:55 +02:00
Alexander Medvednikov
b53fb365a6
parser: move pratt logic to pratt.v
2020-04-17 18:11:04 +02:00
Alexander Medvednikov
16931fd23f
parser: move all struct logic to struct.v
2020-04-17 18:01:02 +02:00
Alexander Medvednikov
06c1b9e95e
table/checker: verify private functions/methods
2020-04-17 17:16:14 +02:00
Daniel Däschle
af30bf939e
checker: fix return underlining
2020-04-17 16:16:56 +02:00
Daniel Däschle
402e55d115
ast: expr.Position; struct field refactoring
2020-04-17 02:38:39 +02:00
Alexander Medvednikov
714ff50322
fmt: use the new receiver syntax
2020-04-16 15:42:40 +02:00
Alexander Medvednikov
4b5acfd960
parser: (var x X) receiver syntax
2020-04-16 15:40:21 +02:00
Alexander Medvednikov
8760313ce5
fmt builder.v
2020-04-16 15:35:19 +02:00
Alexander Medvednikov
af224b4933
parser/cgen: is keyword
2020-04-16 15:32:14 +02:00
Daniel Däschle
19723c927b
checker: move more checks from parser
2020-04-16 12:17:15 +02:00
Delyan Angelov
8a1248b2e7
builder: restore module import cycle detection/topological reorder
2020-04-16 12:29:36 +03:00
Daniel Däschle
04db2d02b8
checker: move struct name check from parser to checker
2020-04-16 11:01:18 +02:00
Daniel Däschle
a680db44ed
parser: change `for` error message
2020-04-16 06:01:14 +02:00
yuyi
b15780ae51
parser: better const error
2020-04-16 06:00:05 +02:00
Abdullah Atta
6a186e8f11
jsgen: implement js backend
2020-04-15 23:16:49 +02:00
Daniel Däschle
27b6f30305
checker: move capital var check from parser to checker
2020-04-15 19:09:51 +02:00
Daniel Däschle
93b942de46
parser: fix a match error
2020-04-15 16:23:03 +02:00
Alexander Medvednikov
da28bc7026
Revert "fmt: `(var f Foo)`"
...
This reverts commit 4b110756e0
.
2020-04-15 04:15:42 +02:00
Alexander Medvednikov
4b110756e0
fmt: `(var f Foo)`
2020-04-15 03:56:16 +02:00
Alexander Medvednikov
f34352faf9
fmt: use var instead of mut
2020-04-15 01:55:51 +02:00
Alexander Medvednikov
efaec8be8e
token/parser: var keyword
2020-04-15 01:45:27 +02:00
Daniel Däschle
4068cbc6eb
parser: fix var name check pos
2020-04-14 21:27:17 +02:00
Alexander Medvednikov
14e1b963f2
parser: do not allow variable names with capital letters
2020-04-14 20:40:00 +02:00
Enzo Baldisserri
86402204a7
checker: fail if else isn't the last branch of match
2020-04-14 20:31:51 +02:00
Alexander Medvednikov
233ae3f772
fmt: use `import module` syntax
2020-04-14 19:32:23 +02:00
Alexander Medvednikov
2251634743
parser: hide import deprecation warning for now
2020-04-14 18:36:29 +02:00
Alexander Medvednikov
f91d527154
deprecate `import module`
2020-04-14 18:27:30 +02:00
Alexander Medvednikov
ec10831318
parser: `[]int{cap:cap, len:len}` syntax; minor fixes
2020-04-14 18:10:16 +02:00
joe-conigliaro
b33a9fc9e7
parser: fix left shift precedence
2020-04-15 01:41:14 +10:00
Delyan Angelov
2b3204603a
parser: add an $if tinyc{} wrapper for the tcc_stack_bug variable
2020-04-14 18:02:55 +03:00
Delyan Angelov
2df4998acc
parser: fix v selfcompilation with tcc (tcc bug workaround)
2020-04-14 11:06:19 +03:00
Daniel Däschle
12e48c6fe2
checker: check match for exhaustion
2020-04-14 01:03:31 +02:00
Alexander Medvednikov
24958df565
parser: do not allow duplicate fns; cgen: move fn code to fn.v
2020-04-13 19:59:57 +02:00
Daniel Däschle
a6100be8df
parser: fix position of array init
...
* parser: fix position of array init
* fix checker_error_test.v tests
2020-04-13 19:08:02 +03:00
Alexander Medvednikov
2bd22aa4a4
parser: type Foo = Bar
2020-04-13 15:06:02 +02:00
Alexander Medvednikov
0db0c642c3
vfmt: add missing imports automatically
2020-04-12 17:45:04 +02:00
Daniel Däschle
4449468ca4
parser: correct error position on field and method errors
2020-04-12 15:19:07 +03:00
Daniel Däschle
79dad0bca9
parser: fix enum default value in struct
...
* parser: fix enum default value in struct
* Add a test for the enum default values in structs.
* Fix compilation of vfmt.
* Run vfmt over enum_default_value_in_struct_test.v
* Cleanup spurious , in vfmt output for enum declarations
Co-authored-by: Delyan Angelov <delian66@gmail.com>
2020-04-12 13:35:54 +03:00
yuyi
0ced7116b6
string: add is_upper/is_lower and fix parser.match_expr error
...
* string: add is_upper/is_lower and fix parser.match_expr error
* to_capital => capitalize, to_title => title
* is_titled => is_title, is_capitalized => is_capital
2020-04-12 13:09:05 +03:00
Alexander Medvednikov
449d839684
checker: make sure functions return
2020-04-11 21:50:14 +02:00
Alexander Medvednikov
d0ac69d12e
parser: fix sizeof(&Foo)
2020-04-11 18:38:25 +02:00
yuyi
ea960b2ce2
parser: fix inter literal format error
2020-04-11 17:25:39 +02:00
yuyi
c1aba95d7d
parser: refactor script & repl handling
2020-04-11 15:06:26 +03:00
Daniel Däschle
be16c5b21d
parser: better error on short init struct
2020-04-11 14:56:55 +03:00
Alexander Medvednikov
053de0b8e3
checker: check variable mutability
2020-04-11 04:09:41 +02:00
Alexander Medvednikov
9422cd1009
parser: handle mut & receivers; fix checker_error_test
2020-04-11 02:24:00 +02:00
Alexander Medvednikov
8fbae86bb3
vfmt: skip skipped modules; add module test
2020-04-10 22:32:52 +02:00
Alexander Medvednikov
b95a47b5a7
checker: check fn main(); vfmt: fix for{}, module and module comments
2020-04-10 22:27:54 +02:00
Delyan Angelov
217e6f3b8e
checker/parser: allow for fixed array with sizes defined with a const
2020-04-10 22:01:22 +03:00
Alexander Medvednikov
f76931c01e
cache builtin modules
2020-04-10 18:11:43 +02:00
Daniel Däschle
c815f84722
parser: fix void assign check
2020-04-10 15:53:06 +03:00
Daniel Däschle
42b3b19af4
checker: fix checker enum infix error
2020-04-10 15:44:01 +03:00
Daniel Däschle
adb379dd63
parser: fix string position
2020-04-10 15:40:52 +03:00
Delyan Angelov
83dfc6b9b9
checker: add more checks for multivar assignments
2020-04-10 15:38:43 +03:00
Delyan Angelov
3573030b9b
checker: fix error position for assignment expression
2020-04-10 15:14:05 +03:00
Delyan Angelov
60d6543733
comptime: support @VROOT again
2020-04-10 13:02:00 +03:00
Daniel Däschle
0f11d883fa
checker: fix error messages and add checker tests
...
* checker: fix error messages
* tests: fix command and ignore defect output
2020-04-10 11:59:07 +03:00
Delyan Angelov
7d564e9791
cgen: skip inc generation for ForCStmt, when empty in the v source
2020-04-10 10:00:14 +03:00
Alexander Medvednikov
d5fb68e3d6
vfmt: fix struct init; run on struct_test.v
2020-04-10 00:36:50 +02:00
Alexander Medvednikov
9b2511133d
vfmt: lots of fixes; cmd/v: -keepc;
2020-04-10 00:30:43 +02:00
Daniel Däschle
32550c6d69
scanner: even better error messages
2020-04-10 00:09:34 +02:00
Daniel Däschle
320fad49c5
checker: check enum
2020-04-09 19:23:49 +02:00
Alexander Medvednikov
6ac64c8586
parser: register #flags
2020-04-09 16:39:53 +02:00
Alexander Medvednikov
f508955b64
vfmt: fix mod.Type; run vfmt on ast.v
2020-04-09 15:33:46 +02:00
Alexander Medvednikov
f3c917e0aa
fmt: fix array receivers; cmd/v: -showcc
2020-04-09 15:05:06 +02:00
yuyi
87df587f5a
parser: fix script and repl error
2020-04-09 12:46:16 +02:00
Alexander Medvednikov
b40fdd9089
scope: find_const
2020-04-08 19:47:20 +02:00
Daniel Däschle
03c307a8c0
parser: fix struct name error
2020-04-08 19:08:54 +02:00
Daniel Däschle
d38acb5487
cgen: fix enum print case
2020-04-08 18:55:10 +02:00