Commit Graph

113 Commits (e512caf8f57f947113e603310077c00da2faaae2)

Author SHA1 Message Date
Louis Schmieder 23513ae35c
v.parser: fix vfmt eating the file name in `$tmpl('non_existant_file')` (#10056) 2021-05-08 21:11:13 +03:00
Louis Schmieder fc3b628440
v: support `$for attr in Test.attributes` (#9836) 2021-04-25 18:29:26 +03:00
Delyan Angelov d4f31412b7
v: deprecate `@VROOT` in favour of `@VMODROOT` (#9795) 2021-04-19 19:01:47 +03:00
Lukas Neubert a0648a3ec2
all: fixes related to Node.pos (#9613) 2021-04-06 15:16:19 +02:00
Alexander Medvednikov 7385f8e56b all: a massive merge of ast and table modules 2021-04-02 01:57:09 +03: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
Anton Zavodchikov 1ad4623fb8
tmpl: move to v/parser (#9052) 2021-03-15 13:35:55 +02:00
Miccah f26d2f02b7
ast, cgen, checker, parser: support method arguments in comptime $for (#9208) 2021-03-11 15:04:34 +02:00
Lukas Neubert 460e06b9ff
fmt: do not insert a newline before returned $vweb.html() (#9063) 2021-03-03 10:14:05 +02:00
Anton Zavodchikov 506041a15b
tmpl: fix doubling templates folder path and enhancements (#9029) 2021-03-01 11:15:59 +02:00
Nick Treleaven 4ad95cfeaf
checker: check types with $for/$if introspection (#8984) 2021-02-26 15:26:50 +01:00
Nick Treleaven 59d4d0ef1d
checker: detect unknown type to iterate with $for (#8971) 2021-02-26 08:28:19 +02:00
kristof de spiegeleer 3f3bec45fa
examples: add a template example, update the regex examples (#8829) 2021-02-19 12:39:15 +02:00
Delyan Angelov 25a3873019
parser,checker: support @METHOD, replaced by 'ReceiverType.MethodName' 2021-02-05 16:32:43 +02:00
Larpon d25825df57
all: support compile time `$env('ENV_VAR')` (#8456) 2021-01-31 19:22:42 +02:00
Nick Treleaven f992099726
checker: check s.$method(arg) argument is []string (#8455) 2021-01-31 15:28:23 +01:00
Nick Treleaven 43c3a3b080
checker: fix compile-time call with string identifier expression (#8415) 2021-01-30 15:24:16 +01:00
Nick Treleaven c0685eeefc
parser: add warning for s.$field.name without brackets (#8411) 2021-01-30 12:56:10 +01:00
Lukas Neubert e47c13903b
fmt: keep newlines between toplevel stmts (#8383) 2021-01-29 12:17:59 +02:00
Delyan Angelov 728344ff65
ci: fix `v test-cleancode` 2021-01-25 12:55:01 +02:00
Delyan Angelov d4f6f5eec4
sokol,fontstash: move f_d_use_freetype.v to vlib/fontstash/a_d_use_freetype.v 2021-01-23 11:39:17 +02:00
Louis Schmieder 4045ec1ca8
checker: remove vweb unused vars (#8180) 2021-01-21 11:09:19 +01:00
Delyan Angelov 7037965973
parser: cleanup unused `p.os_from_string` 2021-01-19 08:33:03 +02:00
Delyan Angelov f375418847
parser: remove forgotten eprintln statement 2021-01-18 14:57:10 +02:00
Lukas Neubert ac2c3847af
all: update copyright to 2019-2021 (#8029) 2021-01-18 13:20:06 +01:00
Alexander Medvednikov a008c8254c parser: comptime: update tmpl_path 2021-01-17 06:42:21 +01:00
Alexander Medvednikov ac8a7ac901 parser: bootstrap the new struct init check 2021-01-17 06:30:30 +01:00
Alexander Medvednikov 2b058edc98 checker: do not require ref field init with update expr 2021-01-17 06:24:03 +01:00
Delyan Angelov 5ae55731b9
embed: move to `v.embed_file`, fix CI failing test 2021-01-16 20:03:07 +02:00
Larpon f73500f2fe
all: add support for the `x := $embed_file('v.png')` compile time call (#8048) 2021-01-14 16:20:11 +02:00
Daniel Däschle 5841d5d8e1
all: implement basic comptime field selector (#7888) 2021-01-05 16:11:43 +02:00
spaceface c544cc508b
pref: fix cross-compiling graphical apps to Windows (#7449) 2020-12-21 19:45:12 +02:00
joe-conigliaro 0aa9f5a007
all: optimize scope usage in checker & parser. store scope in ast nodes (#7281) 2020-12-12 19:01:12 +11:00
Daniel Däschle 47d0ed308d
parser: prepare for better VLS integration, more accurate parser errors (#7119) 2020-12-04 20:34:05 +02:00
Lukas Neubert 2691163a7e
scope: remove redundant name arg from register() (#7077) 2020-12-02 14:40:25 +01:00
Daniel Däschle 6af082e70e
doc: detailed documentation of the compiler pipeline (#7043) 2020-12-01 03:58:39 +01:00
ka-weihe 9367dcda10
all: fix remaining c warnings and add -Werror to CI (#7021) 2020-11-29 21:23:37 +02:00
Alexander Medvednikov 5e59718970 fmt: handle $tmpl 2020-11-26 18:53:38 +01:00
Alexander Medvednikov 5efd393af2 all: make comptime templates usable outside of vweb via $tmpl 2020-11-26 18:40:35 +01:00
Daniel Däschle aa6303f0b2
all: use the new types with old syntax (#6922) 2020-11-24 13:58:29 +01:00
Delyan Angelov 2228d75657 ci: fix formatting of comptime.v 2020-11-21 19:04:31 +02:00
Delyan Angelov fa55c247a2 parser: add `-d print_vweb_template_expansions` to ease vweb template debugging 2020-11-21 17:59:02 +02:00
Larpon 785bf40f67
all: remove comp time '@' expansion from scanner (#6746) 2020-11-05 10:12:32 +02:00
Delyan Angelov 9eb655e65c all: add .pos fields to all AST nodes, to avoid wrong positions in error messages 2020-11-04 13:34:12 +02:00
Delyan Angelov 3c2202572b
cgen: produce cleaner error on missing C headers (with optional explanation) (#6637)
Implements support for `#include <openssl/rand.h> # Please install OpenSSL`.
2020-10-17 18:27:06 +03: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
Swastik Baranwal 314fae7446
checker: add more checks for hash_stmt (#6615) 2020-10-15 11:58:01 +03:00
Delyan Angelov dc954bbb03 all: use `macos` consistently in os.user_os and the compiler 2020-09-29 22:32:20 +03:00
spaceface777 ff92c3409d
ast: merge `IfExpr` and `CompIf` (#6011) 2020-09-18 00:58:54 +02:00
spaceface777 d663f57d43
parser: move flag logic to checker (#6239) 2020-08-28 09:24:04 +03:00