Commit Graph

1576 Commits (d24dce8eb33d60395e8dd8326bbfd0e81a0bcf7b)

Author SHA1 Message Date
yuyi c1c3ae2a18
parser: minor cleanup in fn_args() (#13711) 2022-03-11 10:42:03 +02:00
yuyi 3f351036a2
parser: fix error for fn with type only argument (fix #13704) (#13709) 2022-03-10 22:52:06 +02:00
yuyi dd06698ee3
ast: rename TypeSymbol.is_public to TypeSymbol.is_pub (#13710) 2022-03-10 22:18:57 +02:00
Delyan Angelov beb1b8ce1b
tools: add `v scan file.v` 2022-03-07 18:25:38 +02:00
Alexander Medvednikov 36ec47cd20 all: replace "NB:" with "Note:" (docs/comments) 2022-03-06 20:01:22 +03:00
yuyi 8136157f87
checker: fix error for 'or expr with nested match expr' (#13658) 2022-03-05 13:06:08 +02:00
yuyi f70e5bd69b
parser: check assign expr with undefined variable (#13653) 2022-03-04 10:33:14 +02:00
ChAoS_UnItY 63b41e67fa
v.parser: change body_start_pos to function declaration's lcbr, resolve #13642 (#13646) 2022-03-03 19:51:27 +02:00
yuyi 288b13b51d
all: cleanup smartcasts in the compiler (#13639) 2022-03-03 10:48:31 +02:00
yuyi 22017ff8f4
parser: fix error for 'for smartcast' - part 1 (#13629) 2022-03-02 12:18:03 +02:00
Joe Conigliaro 3b6e122d9d
all: comptime_call - update tmpl scope vars with caller scope vars after their properties got updated in checker 2022-03-01 02:13:29 +11:00
yuyi 013589e9fe
parser: minor cleanup in global_decl() (#13617) 2022-02-28 13:30:17 +02:00
yuyi bc16c61f6f
parser: check using 'mut' on fn_decl return type (#13610) 2022-02-27 14:23:43 +02:00
yuyi 0fb1eaef04
parser: check the redefinition of built-in IError (#13606) 2022-02-26 09:52:40 +02:00
Larpon d80f5165dd
fmt: keep trailing comments after fn header decl (#13596) 2022-02-25 16:36:48 +03:00
yuyi 83ea97b1a3
parser: fix optional expr with array value (#13599) 2022-02-25 15:54:12 +03:00
Larpon 73f931b52e
fmt: improve single line const comment placement (#13595) 2022-02-25 14:46:12 +02:00
yuyi b5e7cef1b1
ast: define 'const invalid_type_idx = -1' (#13573) 2022-02-23 11:54:43 +03:00
playX b842e89acc
all: initial implementation of compile-time types (#13549) 2022-02-21 17:42:54 +02:00
yuyi 04654ed518
parser: check error for defer propagate (fix #13534) (#13536) 2022-02-20 12:29:08 +02:00
yuyi 4f9039991f
parser: cleanup in check_undefined_variables() (#13496) 2022-02-17 10:16:52 +02:00
yuyi 842fd7a27e
parser: check assign expr with undefined variables of struct_init (#13495) 2022-02-17 10:21:03 +03:00
Alexander Medvednikov 5a14748e7c cgen: c2v enum fix 2022-02-16 12:05:32 +03:00
Delyan Angelov d25652fbcf
parser, ast: support -d for trace_rewrite_already_registered_symbol, trace_register_sym, trace_parse_stmt, trace_parse_comptime, trace_parse_text, trace_parse_file, trace_parse_vet_file 2022-02-15 13:20:40 +02:00
yuyi f9fc136c24
all: rename InterfaceDecl.ifaces to InterfaceDecl.embeds (#13475) 2022-02-15 11:17:39 +02:00
Delyan Angelov 799c95dc4e
tests: filter test_ fns with params from the list of automatically run test functions (fix #13443) 2022-02-12 17:30:20 +02:00
yuyi 7178367de0
all: fix error for comptime for in field with generic fn (fix #13409) (#13439) 2022-02-11 22:00:13 +02:00
Tim Basel 9d0a5942ac
builtin: change IError `msg` and `code` to methods + fix vlib, add a deprecation notice for the old usages (#13041) 2022-02-11 15:52:33 +02:00
Delyan Angelov 9ed18efa53
checker: error on redefining any of the public builtin functions, not just ['print', 'println', 'eprint', 'eprintln', 'isnil', 'panic', 'exit'] (#13419) 2022-02-10 12:26:30 +02:00
yuyi f2eb50008d
parser, checker: cleanup struct short syntax processing (#13416) 2022-02-09 18:31:16 +02:00
yuyi 4be3c92640
checker: check generic struct init without type parameter (#13404) 2022-02-09 14:06:45 +02:00
Vincenzo Palazzo 10dcb2e0d9
parser: allow embedding interfaces from other modules (#13385) 2022-02-07 00:20:34 +02:00
div72 939bc9f26f
v.parser: fix compilation of normal .v files with -translated (#13363) 2022-02-06 12:53:20 +02:00
div72 cec7e91714
v.parser, v.checker, v.gen: add support for [translated] tag (#13373) 2022-02-06 00:16:02 +02:00
yuyi 173b4652fb
parser: check orm sql statements, using undefined variables in where expr (fix #13367) (#13368) 2022-02-05 11:32:41 +02:00
yuyi a61b4809dc
ast, parser, checker: fix generic struct init with inconsistent generic types (#13359) 2022-02-04 14:24:38 +02:00
Benjamin Stigsen ceb05b163a
strings: rename Builder.write_b() to Builder.write_byte(), add deprecation (#13313) 2022-01-28 20:34:44 +02:00
Delyan Angelov e1a2ab345d
parser,ast,checker: add support for `[deprecated: "use another module"] module obsolete` 2022-01-27 12:34:14 +02:00
yuyi 291a1ffd8d
token: rename Position to Pos, rename position() to pos() (#13279) 2022-01-26 12:36:28 +02:00
yuyi ca1f675dba
ast, checker, cgen: implement if guard with multi return optional (#13273) 2022-01-25 14:36:33 +02:00
Delyan Angelov 5f38ba896e
parser,cgen: handle `const x = $embed_file("file.txt").to_string()` 2022-01-25 11:40:07 +02:00
yuyi d553071e65
parser, checker: correct error message for a fixed array size using a non constant (fix #13219) (#13228) 2022-01-20 13:03:19 +02:00
Tim Basel 14b33baa3b
transformer: refactor + apply transform to (hopefully) all nodes (#13216) 2022-01-20 08:40:16 +02:00
yuyi ba3308296b
ast: rename register_type_symbol to register_sym (#13217) 2022-01-19 20:16:23 +02:00
jeffmikels 7a2705d8ce
scanner: multibyte rune literals now support unicode, hex, and octal escape codes (#13140) 2022-01-19 03:23:25 +03:00
Delyan Angelov 40a5c5c1a0
parser: make the $tmpl subparser more robust. The legacy .html mode, is now ON, only for .html template files.
Implement a .simple default mode, with *minimum* heuristcs, and only
supporting expansion of @expressions, @include, @if, @else, @for, @end.

The existing .html mode, with its complex state transitions for html/js/css
and heuristics, is now used *only* for template files, that have the `.html`
extension.
2022-01-18 14:57:45 +02:00
yuyi f0b7e5049b
parser: check the receiver error of method call (#13203) 2022-01-18 12:47:06 +02:00
trueFireblade 727c9fb4a1
all: add string range OrExpr (#13189) 2022-01-17 13:03:10 +03:00
jeffmikels 4189b7e280
builtin: add a `byterune` method on `[]byte` (#13145) 2022-01-13 22:26:17 +02:00
yuyi 155f897270
ast, parser, checker: fix generic struct field with default struct value (#13158) 2022-01-13 22:25:25 +02:00
Tim Basel 10efe47f03
parser: add support for mutable if guards (#13132) 2022-01-11 15:32:58 +02:00
yuyi 86ba4517b1
parser: check error of anon fn argument type (#13103) 2022-01-09 16:15:34 +02:00
Ken 9cbfa882e6
ast: support attributes for `ast.SumType` (#13010) 2022-01-08 17:35:10 +03:00
Delyan Angelov 5717066147
ci: fix `$tmpl` regression detected by gitly tests (after a73e146) 2022-01-07 19:19:31 +02:00
Artem a73e1462f0
tmpl.v: fix of is_html_open_tag function and allow usage of V template sign '@' in JS code (#13067) 2022-01-07 14:31:32 +02:00
Delyan Angelov 8088f462c9
parser: fix parsers producing codegen statements (for `[flag] enum MyEnum{}`) with mixed scope 2022-01-06 18:02:52 +02:00
Alexander Medvednikov 59ed4be49a all: update copyright year 2022-01-04 12:21:12 +03:00
pancake 4b55800ffd
v.eval: add tests and fix runtime cast crash (#13019) 2022-01-03 18:30:42 +02:00
Delyan Angelov 9278d4ec19
docs: fix a typo 2022-01-02 09:18:24 +02:00
Alexander Medvednikov 0e1cfd4a28 checker: simplify type sizeof check and fix c2v globals 2022-01-01 19:56:13 +03:00
yuyi cc577e1bfb
parser: check variable redefinition error (#12992) 2021-12-29 13:44:08 +02:00
Delyan Angelov 43fee6b3d5
all: fix registration of methods with the same name on different generic structs 2021-12-28 21:42:48 +02:00
Alexander Medvednikov 6176ce9f03 all: c2v fixes 2021-12-28 08:00:56 +03:00
Delyan Angelov 14648fa41e
parser: reduce max_expr_level to 310 (due to more limited stack size on windows) 2021-12-27 20:21:58 +02:00
Delyan Angelov a2eb90ee4e
parser: prevent too deep recursions in p.check_undefined_variables 2021-12-27 12:30:17 +02:00
Daniel Däschle 35282396ec
all: inline sum types (#12912) 2021-12-25 18:26:40 +03:00
Delyan Angelov db1175e455
parser: handle `[noreturn]` on methods too 2021-12-22 19:58:37 +02:00
penguindark 278c08704c
all: support slices with negative indexes `#[start..end]` (gated arrays) (#12914) 2021-12-22 16:34:02 +03:00
zakuro 2693631643
parser: make codegen generate correct module name (#12929) 2021-12-22 10:55:57 +11:00
joe-conigliaro 07cf6d9f96
parser/scanner: make codegen impl use own parser. closes #12857 (#12925) 2021-12-21 19:48:06 +02:00
yuyi cd0b581445
ast: rename 'table.get_type_symbol()' to 'table.sym()' and more related calls (#12898) 2021-12-19 18:25:18 +02:00
ChAoS_UnItY 50d988ebc7
v.parser: forbid unsupported language functions/types in specific backends (#12655) 2021-12-18 10:00:31 +02:00
Delyan Angelov 6ff953d936
preludes,builder,cgen: add support for VTEST_RUNNER=tap and -test-runner tap (#12523) 2021-12-16 15:59:46 +02:00
Delyan Angelov df7f2aa8a3
all: support `[markused]` tags for fns/consts/globals 2021-12-15 14:34:49 +02:00
zakuro eed882950c
fmt: remove extra comma of branch instead of parse error (#12814) 2021-12-14 08:14:43 +02:00
Delyan Angelov 79de408ef0
parser,checker: support `[generated] module xyz` (turns off notices). Use it for `infix.v`. 2021-12-12 00:58:38 +02:00
Thomas Mangin 0d0d7323bb
transformer: provide direct_memory_access to arrays when safe (#12724) 2021-12-11 21:55:46 +02:00
yuyi 7fc9e614a3
ast, parser, checker: fix generic fn in builtin module (#12769) 2021-12-09 21:37:43 +02:00
yuyi e433badcb8
parser, cgen: fix multiple comptime tmpl in one function (#12757) 2021-12-08 11:12:02 +03:00
yuyi c29a3cf6e8
parser: fix (absolute path) error (#12747) 2021-12-07 11:33:53 +02:00
Tim Basel c23ebec944
parser: support bool values in attributes (#12750) 2021-12-07 12:11:29 +03:00
Tim Basel 6d14275106
parser: support dot prefix for attributes (#12744) 2021-12-07 01:32:29 +03:00
Delyan Angelov 3ab82a23c5
tools: cleanup the output of V, compiled with `-d trace_parser` and `-d trace_checker` 2021-12-06 09:54:53 +02:00
Delyan Angelov 229d2fb667
v.util.timers: improve tracing by supporting `-d trace_timers_creation` 2021-12-05 11:55:41 +02:00
Leo Developer ace63594bf
all: support `$embed_file('embed.vv', .zlib)` (#12654) 2021-12-04 19:43:19 +02:00
pancake 8ac7739db8
parser: forbid empty match statements 'match cond.op {else {}}' (#12618) 2021-11-30 09:32:48 +02:00
Leo Developer 0f59d88ba6
v.embedfile: make path public (#12614) 2021-11-29 16:32:42 +02:00
Delyan Angelov 6d97b0a407
checker: improve checking of a << b, when a and b are numbers (#12589) 2021-11-29 03:48:49 +03:00
Delyan Angelov d431145a39
v.util,tools: use os.join_path_single 2021-11-22 21:42:55 +02:00
Delyan Angelov 3caeadfa0d
cgen,vfmt: support `[weak]` tags for functions and globals 2021-11-18 18:32:39 +02:00
zakuro b5e410e408
fmt: format explicit map init with parameter (#12499) 2021-11-18 08:34:30 +03:00
playX 2eb02ff5a7
jsdom, js: start refactoring jsdom; improve JS interfaces; add two attributes for them (#12488) 2021-11-17 11:41:33 +02:00
yuyi 5a89c0a480
ast: change CompFor to ComptimeFor (#12482) 2021-11-17 08:29:43 +02:00
Delyan Angelov 045579fd8a
parser: use the `[has_globals]` module attribute, remove the parser `global_enabled_mods whitelist` (part 2) 2021-11-16 11:44:36 +02:00
Delyan Angelov f0f5f97e9f
parser: support a `[has_globals]` module attribute, to eliminate a parser whitelist (part 1) 2021-11-16 11:34:26 +02:00
yuyi c28041cecc
all: cleanup/rename all `comp_` names to be `comptime_` (#12467) 2021-11-15 15:47:29 +02:00
playX 6c32c544e1
js,parser: allow declaring methods on JS interfaces for easier FFI (#12447) 2021-11-13 11:08:17 +02:00
playX a4c57ba56e
js: support JS interfaces (#12426) 2021-11-11 14:36:32 +02:00
yuyi 8f4180ea09
parser: check generic parameters error of generic struct declaration (#12418) 2021-11-09 09:25:57 +02:00
Delyan Angelov 1c12186701
v.token,ast,scanner,parser: use a KeywordsMatcher lookup for builtin_type_names searches too 2021-11-07 16:39:40 +02:00