From a4e561ff1579f42e9191bfb8b0f9555db2817180 Mon Sep 17 00:00:00 2001 From: yuyi Date: Sun, 11 Aug 2024 10:24:08 +0800 Subject: [PATCH 1/2] fmt: fix alignment of struct init fields --- cmd/tools/gen_vc.v | 14 +- cmd/tools/measure/fmt_speed.v | 10 +- cmd/tools/measure/parser_speed.v | 10 +- cmd/tools/modules/testing/common.v | 36 +- cmd/tools/oldv.v | 16 +- cmd/tools/performance_compare.v | 16 +- cmd/tools/vast/vast.v | 4 +- cmd/tools/vbump.v | 8 +- cmd/tools/vbump_test.v | 18 +- cmd/tools/vcheck-md.v | 18 +- cmd/tools/vcover/main.v | 4 +- cmd/tools/vcreate/project_model_bin.v | 2 +- cmd/tools/vcreate/project_model_lib.v | 4 +- cmd/tools/vcreate/project_model_web.v | 36 +- cmd/tools/vcreate/vcreate.v | 40 +- cmd/tools/vdoc/html.v | 12 +- cmd/tools/vdoc/main.v | 2 +- cmd/tools/vdoc/vdoc.v | 4 +- cmd/tools/vdoctor.v | 4 +- cmd/tools/vfmt.v | 16 +- cmd/tools/vgret.v | 30 +- cmd/tools/vls.v | 4 +- cmd/tools/vmissdoc.v | 24 +- cmd/tools/vpm/parse.v | 24 +- cmd/tools/vpm/settings.v | 20 +- cmd/tools/vpm/vcs.v | 20 +- cmd/tools/vrepeat.v | 4 +- cmd/tools/vrepl.v | 4 +- cmd/tools/vshader.v | 10 +- cmd/tools/vtest-all.v | 212 +- cmd/tools/vup.v | 10 +- cmd/tools/vvet/errors.v | 30 +- cmd/tools/vvet/vvet.v | 9 +- doc/docs.md | 34 +- examples/2048/2048.v | 84 +- examples/cli.v | 34 +- examples/clock/clock.v | 16 +- examples/database/mysql.v | 6 +- examples/database/orm.v | 42 +- .../use_shared_library.v | 2 +- examples/fetch_ip.v | 2 +- examples/fireworks/fireworks.v | 14 +- examples/fireworks/modules/objects/rocket.v | 4 +- examples/flag/animated_help_text.v | 10 +- examples/flag/flag_layout_editor.v | 12 +- examples/flappylearning/game.v | 28 +- .../modules/neuroevolution/neuronevolution.v | 2 +- examples/game_of_life/life_gg.v | 14 +- .../modules/automaton/automaton.v | 2 +- examples/gg/additive.v | 32 +- examples/gg/arcs_and_slices.v | 14 +- examples/gg/bezier.v | 10 +- examples/gg/bezier_anim.v | 10 +- examples/gg/cursor.v | 6 +- examples/gg/digital_rain.v | 20 +- examples/gg/drag_n_drop.v | 20 +- examples/gg/draw_pixels.v | 10 +- examples/gg/fire.v | 14 +- examples/gg/mandelbrot.v | 24 +- examples/gg/many_thousands_of_circles.v | 8 +- examples/gg/minimal.v | 10 +- .../path_finding_algorithm_visualizer/aStar.v | 30 +- examples/gg/polygons.v | 8 +- examples/gg/random.v | 12 +- examples/gg/raven_text_rendering.v | 14 +- examples/gg/raycaster.v | 14 +- examples/gg/rectangles.v | 14 +- examples/gg/rotating_textured_quad.v | 12 +- examples/gg/sample_count.v | 8 +- examples/gg/spirograph.v | 8 +- examples/gg/stars.v | 16 +- examples/gg/worker_thread.v | 14 +- examples/hot_reload/bounce.v | 22 +- examples/hot_reload/graph.v | 16 +- .../js_dom_draw_benchmark_chart/chart/main.v | 4 +- .../v_vweb_orm/src/main.v | 18 +- .../simple_linear_regression.v | 8 +- examples/macos_tray/tray.v | 4 +- examples/path_tracing.v | 172 +- examples/pendulum-simulation/full.v | 2 +- .../modules/sim/anim/app.v | 18 +- .../modules/sim/args/parser.v | 34 +- .../pendulum-simulation/modules/sim/img/ppm.v | 6 +- .../modules/sim/img/writer.v | 4 +- .../modules/sim/params_test.v | 10 +- .../pendulum-simulation/modules/sim/runner.v | 4 +- .../modules/sim/sim_test.v | 10 +- .../pendulum-simulation/modules/sim/worker.v | 4 +- .../modules/sim/worker_test.v | 18 +- examples/pendulum-simulation/parallel.v | 4 +- .../pendulum-simulation/parallel_with_iw.v | 2 +- examples/pico/raw_callback.v | 6 +- examples/quadtree_demo/quadtree_demo.v | 26 +- examples/smtp/mail.v | 12 +- examples/snek/snek.js.v | 24 +- examples/snek/snek.v | 30 +- examples/sokol/01_cubes/cube.v | 34 +- examples/sokol/02_cubes_glsl/cube_glsl.v | 44 +- .../sokol/03_march_tracing_glsl/rt_glsl.v | 40 +- examples/sokol/04_multi_shader_glsl/rt_glsl.v | 20 +- examples/sokol/05_instancing_glsl/rt_glsl.v | 18 +- .../sokol/06_obj_viewer/modules/obj/rend.v | 24 +- examples/sokol/06_obj_viewer/show_obj.v | 30 +- .../07_simple_shader_glsl/simple_shader.v | 22 +- examples/sokol/08_sdf/sdf.v | 14 +- examples/sokol/clear.v | 12 +- examples/sokol/drawing.v | 10 +- examples/sokol/fonts.v | 8 +- examples/sokol/freetype_raven.v | 14 +- .../particles/modules/particle/particle.v | 10 +- examples/sokol/particles/particles.v | 24 +- examples/sokol/sounds/melody.v | 10 +- examples/sokol/sounds/wav_player.v | 4 +- examples/ssl_server/client.v | 4 +- examples/ssl_server/server.v | 4 +- examples/templates/templates.v | 220 +- examples/term.ui/cursor_chaser.v | 6 +- examples/term.ui/event_viewer.v | 12 +- examples/term.ui/pong.v | 16 +- examples/term.ui/rectangles.v | 14 +- examples/term.ui/term_drawing.v | 26 +- examples/term.ui/text_editor.v | 10 +- examples/term.ui/vyper.v | 14 +- examples/tetris/tetris.js.v | 20 +- examples/tetris/tetris.v | 20 +- examples/ttf_font/example_ttf.v | 22 +- examples/viewer/file_scan.v | 20 +- examples/viewer/view.v | 50 +- examples/viewer/zip_container.v | 16 +- examples/vweb_fullstack/src/auth_services.v | 4 +- examples/vweb_fullstack/src/product_service.v | 2 +- examples/vweb_fullstack/src/user_services.v | 2 +- examples/vweb_orm_jwt/src/auth_services.v | 4 +- examples/vweb_orm_jwt/src/user_services.v | 2 +- examples/web_crawler/web_crawler.v | 2 +- examples/xvweb/todo/main.v | 2 +- .../README.md | 6 +- .../code/blog/blog.v | 2 +- vlib/benchmark/benchmark.v | 8 +- vlib/builtin/array.v | 86 +- vlib/builtin/array_d_gcboehm_opt.v | 48 +- vlib/builtin/array_flags_test.v | 8 +- vlib/builtin/array_test.v | 20 +- vlib/builtin/builtin.c.v | 4 +- vlib/builtin/js/array_test.js.v | 20 +- vlib/builtin/js/builtin.v | 2 +- vlib/builtin/js/map_test.js.v | 2 +- vlib/builtin/js/string.js.v | 2 +- vlib/builtin/linux_bare/memory_managment.v | 14 +- vlib/builtin/linux_bare/old/array_bare.v | 12 +- vlib/builtin/map.v | 72 +- vlib/builtin/map_d_gcboehm_opt.v | 84 +- vlib/builtin/map_test.v | 2 +- vlib/builtin/result.v | 2 +- vlib/builtin/sorted_map.v | 6 +- vlib/builtin/string.v | 30 +- vlib/builtin/string_charptr_byteptr_helpers.v | 28 +- vlib/builtin/string_interpolation.v | 12 +- vlib/cli/README.md | 8 +- vlib/cli/command_test.v | 48 +- vlib/cli/flag_test.v | 16 +- vlib/cli/help.v | 12 +- vlib/cli/help_test.v | 24 +- vlib/cli/man.v | 10 +- vlib/cli/man_test.v | 24 +- vlib/cli/version.v | 10 +- vlib/clipboard/clipboard_windows.c.v | 8 +- vlib/clipboard/x11/clipboard.c.v | 16 +- vlib/compress/zstd/zstd_test.v | 24 +- vlib/context/cancel.v | 8 +- vlib/context/deadline.v | 4 +- vlib/context/onecontext/onecontext.v | 8 +- vlib/context/value.v | 4 +- vlib/crypto/bcrypt/bcrypt.v | 6 +- vlib/crypto/blake2b/blake2b.v | 4 +- vlib/crypto/blake2b/blake2b_test.v | 2048 +-- vlib/crypto/blake2b/testdata/test_vectors.v | 2048 +-- vlib/crypto/blake2s/blake2s.v | 4 +- vlib/crypto/blake2s/blake2s_test.v | 2048 +-- vlib/crypto/blake2s/testdata/test_vectors.v | 2048 +-- vlib/crypto/blake3/blake3.v | 16 +- vlib/crypto/blake3/blake3_chunk_test.v | 104 +- vlib/crypto/blowfish/blowfish_test.v | 136 +- vlib/crypto/cipher/cbc.v | 6 +- vlib/crypto/cipher/cfb.v | 8 +- vlib/crypto/cipher/ctr.v | 6 +- vlib/crypto/cipher/ofb.v | 6 +- vlib/crypto/ed25519/internal/ed25519_test.v | 4 +- .../internal/edwards25519/element_test.v | 4 +- .../internal/edwards25519/scalarmult.v | 2 +- vlib/crypto/pem/pem_test.v | 6 +- vlib/crypto/sha3/sha3.v | 12 +- vlib/datatypes/bloom_filter.v | 24 +- vlib/datatypes/bstree.v | 12 +- vlib/datatypes/fsm/fsm.v | 6 +- vlib/datatypes/quadtree.v | 70 +- vlib/datatypes/quadtree_test.v | 24 +- vlib/db/mssql/mssql.c.v | 2 +- vlib/db/mssql/stmt_handle.c.v | 2 +- vlib/db/mysql/README.md | 4 +- vlib/db/mysql/mysql.c.v | 14 +- vlib/db/mysql/mysql_orm_test.v | 38 +- vlib/db/mysql/mysql_test.v | 6 +- vlib/db/mysql/orm.c.v | 6 +- vlib/db/mysql/prepared_stmt_test.v | 6 +- vlib/db/mysql/result.c.v | 38 +- vlib/db/mysql/stmt.c.v | 16 +- vlib/db/pg/pg_orm_test.v | 64 +- vlib/db/sqlite/parent_child_test.v | 12 +- vlib/db/sqlite/sqlite.c.v | 10 +- vlib/db/sqlite/sqlite_orm_test.v | 34 +- vlib/db/sqlite/sqlite_vfs_lowlevel_test.v | 60 +- vlib/db/sqlite/vfs_lowlevel.c.v | 4 +- vlib/dl/loader/README.md | 6 +- vlib/dl/loader/loader.v | 2 +- vlib/dl/loader/loader_test.v | 2 +- vlib/dlmalloc/dlmalloc.v | 30 +- vlib/dlmalloc/dlmalloc_sys_nix.c.v | 14 +- vlib/dlmalloc/dlmalloc_sys_windows.c.v | 14 +- vlib/encoding/base32/base32.v | 4 +- vlib/encoding/csv/README_csv_reader.md | 16 +- vlib/encoding/csv/csv_reader_random_access.v | 4 +- vlib/encoding/csv/csv_reader_test.v | 38 +- vlib/encoding/csv/reader.v | 4 +- vlib/encoding/csv/writer.v | 4 +- vlib/encoding/utf8/utf8_tables.v | 2 +- vlib/encoding/xml/encoding_test.v | 34 +- vlib/encoding/xml/parser.v | 20 +- vlib/encoding/xml/parser_test.v | 22 +- vlib/encoding/xml/test/gtk/gtk_test.v | 10 +- .../local/01_mdn_example/hello_world_test.v | 4 +- .../test/local/02_note_message/note_test.v | 10 +- .../xml/test/local/03_cd_catalogue/cd_test.v | 58 +- .../test/local/05_single_element/root_test.v | 2 +- .../local/06_nested_elements/nested_test.v | 12 +- .../test/local/07_mixed_contents/mixed_test.v | 8 +- .../xml/test/local/08_comments/comment_test.v | 8 +- .../test/local/11_cdata_content/cdata_test.v | 6 +- .../local/13_doctype_element/doctype_test.v | 22 +- .../local/14_attributes/attributes_test.v | 10 +- .../local/19_single_letter_tag/shared_test.v | 22 +- vlib/encoding/xml/types.v | 2 +- vlib/encoding/xml/validation.v | 14 +- vlib/eventbus/eventbus.v | 10 +- vlib/flag/README.md | 4 +- vlib/flag/flag.v | 18 +- vlib/flag/flag_from_test.v | 2 +- vlib/flag/flag_to.v | 289 +- vlib/flag/flag_to_doc_test.v | 4 +- vlib/flag/flag_to_misc_test.v | 2 +- vlib/gg/README.md | 10 +- vlib/gg/gg.c.v | 72 +- vlib/gg/image.c.v | 86 +- vlib/gg/image.v | 14 +- vlib/gg/recorder.c.v | 2 +- vlib/gg/text_rendering.c.v | 32 +- vlib/io/buffered_reader.v | 4 +- vlib/json/json_encode_enum_test.v | 4 +- vlib/json/json_encode_with_mut_test.v | 2 +- vlib/json/json_encode_with_ptr_test.v | 2 +- vlib/json/json_generic_array_test.v | 4 +- vlib/json/json_i32_test.v | 2 +- vlib/json/json_omitempty_test.v | 4 +- vlib/json/json_option_alias_test.v | 2 +- vlib/json/json_option_struct_test.v | 2 +- vlib/json/json_raw_test.v | 6 +- vlib/json/json_struct_option_test.v | 6 +- vlib/json/json_test.v | 44 +- vlib/math/big/big.v | 16 +- vlib/math/big/integer.v | 4 +- vlib/math/fractions/fraction.v | 32 +- vlib/math/modulo.v | 6 +- vlib/math/sin.v | 12 +- vlib/math/unsigned/uint128_test.v | 40 +- vlib/math/unsigned/uint256_test.v | 40 +- vlib/net/address.c.v | 6 +- vlib/net/common.c.v | 2 +- vlib/net/ftp/ftp.v | 2 +- vlib/net/html/parser.v | 6 +- vlib/net/http/backend.c.v | 8 +- vlib/net/http/chunked/dechunk.v | 2 +- vlib/net/http/cookie.v | 6 +- vlib/net/http/cookie_test.v | 76 +- vlib/net/http/file/entity.v | 6 +- vlib/net/http/file/static_server.v | 2 +- vlib/net/http/header.v | 10 +- vlib/net/http/header_test.v | 6 +- vlib/net/http/http.v | 78 +- vlib/net/http/http_proxy.v | 16 +- vlib/net/http/mime/db.v | 14122 ++++++++-------- vlib/net/http/mime/mime_test.v | 12 +- vlib/net/http/request.v | 14 +- vlib/net/http/request_test.v | 8 +- vlib/net/http/response.v | 10 +- vlib/net/http/response_test.v | 4 +- vlib/net/http/server.v | 6 +- vlib/net/http/server_test.v | 28 +- ...tls_sslconn_shutdown_does_not_panic_test.v | 6 +- vlib/net/mbedtls/ssl_connection.c.v | 4 +- vlib/net/openssl/ssl_connection.c.v | 4 +- vlib/net/smtp/smtp.v | 2 +- vlib/net/smtp/smtp_test.v | 20 +- vlib/net/socks/socks5.v | 14 +- vlib/net/tcp.c.v | 22 +- vlib/net/udp.c.v | 12 +- vlib/net/unix/common.c.v | 2 +- vlib/net/unix/stream.c.v | 14 +- vlib/net/urllib/urllib.v | 4 +- vlib/net/urllib/values.v | 2 +- vlib/net/websocket/events.v | 24 +- vlib/net/websocket/handshake.v | 6 +- vlib/net/websocket/message.v | 8 +- vlib/net/websocket/websocket_client.v | 26 +- vlib/net/websocket/websocket_server.v | 30 +- vlib/orm/orm.v | 6 +- vlib/orm/orm_create_and_drop_test.v | 4 +- vlib/orm/orm_custom_operators_test.v | 6 +- vlib/orm/orm_fk_test.v | 2 +- vlib/orm/orm_fn_calls_test.v | 4 +- vlib/orm/orm_fn_test.v | 198 +- vlib/orm/orm_insert_test.v | 16 +- vlib/orm/orm_null_test.v | 28 +- vlib/orm/orm_option_array_test.v | 6 +- vlib/orm/orm_option_time_test.v | 2 +- vlib/orm/orm_test.v | 18 +- vlib/os/fd.c.v | 2 +- vlib/os/file.c.v | 26 +- vlib/os/file.js.v | 6 +- vlib/os/filelock/lib.v | 2 +- vlib/os/inode.c.v | 10 +- vlib/os/notify/backend_darwin.c.v | 2 +- vlib/os/notify/backend_linux.c.v | 4 +- vlib/os/os.c.v | 18 +- vlib/os/os.js.v | 2 +- vlib/os/os_js.js.v | 2 +- vlib/os/os_nix.c.v | 4 +- vlib/os/os_stat_default.c.v | 38 +- vlib/os/os_stat_windows.c.v | 26 +- vlib/os/os_windows.c.v | 32 +- vlib/os/process_windows.c.v | 14 +- vlib/picoev/loop_default.c.v | 2 +- vlib/picoev/loop_freebsd.c.v | 2 +- vlib/picoev/loop_macos.c.v | 2 +- vlib/picoev/picoev.v | 22 +- vlib/regex/regex.v | 24 +- vlib/regex/regex_util.v | 2 +- vlib/semver/parse.v | 8 +- vlib/sokol/gfx/gfx_structs.c.v | 8 +- vlib/sokol/sapp/sapp.c.v | 4 +- vlib/sokol/sapp/screenshot.c.v | 4 +- vlib/sokol/sfons/sfons.c.v | 8 +- vlib/stbi/stbi.c.v | 10 +- vlib/strconv/vprintf.c.v | 84 +- vlib/strings/textscanner/textscanner.v | 2 +- .../many_writers_and_receivers_on_1_channel.v | 28 +- vlib/sync/channels.c.v | 28 +- vlib/sync/pool/pool.c.v | 12 +- vlib/sync/pool/pool_test.v | 2 +- vlib/term/ui/README.md | 8 +- vlib/term/ui/input_windows.c.v | 46 +- vlib/term/ui/termios_nix.c.v | 102 +- vlib/time/README.md | 14 +- vlib/time/chrono.v | 4 +- vlib/time/date_time_parser.v | 10 +- vlib/time/operator_test.v | 384 +- vlib/time/parse.c.v | 30 +- vlib/time/parse.v | 2 +- vlib/time/stopwatch.v | 4 +- vlib/time/time.c.v | 20 +- vlib/time/time_format_test.v | 8 +- vlib/time/time_test.v | 56 +- vlib/time/time_windows.c.v | 64 +- vlib/time/unix.v | 24 +- vlib/toml/checker/checker.v | 16 +- vlib/toml/parser/parser.v | 26 +- vlib/toml/scanner/scanner.v | 22 +- vlib/toml/tests/encode_and_decode_test.v | 14 +- vlib/toml/token/token.v | 6 +- vlib/v/ast/ast.v | 24 +- vlib/v/ast/cflags.v | 6 +- vlib/v/ast/cflags_test.v | 6 +- vlib/v/ast/init.v | 24 +- vlib/v/ast/str.v | 4 +- vlib/v/ast/table.v | 144 +- vlib/v/ast/types.v | 20 +- vlib/v/builder/builder.v | 28 +- vlib/v/builder/msvc_windows.v | 44 +- vlib/v/callgraph/callgraph.v | 6 +- vlib/v/checker/assign.v | 44 +- vlib/v/checker/checker.v | 79 +- vlib/v/checker/comptime.v | 22 +- vlib/v/checker/containers.v | 8 +- vlib/v/checker/errors.v | 30 +- vlib/v/checker/fn.v | 24 +- vlib/v/checker/if.v | 8 +- vlib/v/checker/infix.v | 50 +- vlib/v/checker/lambda_expr.v | 62 +- vlib/v/checker/match.v | 18 +- vlib/v/checker/orm.v | 48 +- vlib/v/checker/return.v | 16 +- vlib/v/checker/struct.v | 12 +- vlib/v/compiler_errors_test.v | 28 +- vlib/v/depgraph/depgraph.v | 6 +- vlib/v/doc/doc.v | 68 +- vlib/v/doc/utils.v | 8 +- vlib/v/eval/eval.v | 6 +- vlib/v/eval/expr.c.v | 38 +- vlib/v/eval/var.v | 4 +- vlib/v/fmt/fmt.v | 18 +- vlib/v/fmt/struct.v | 16 +- vlib/v/gen/c/array.v | 8 +- vlib/v/gen/c/auto_str_methods.v | 2 +- vlib/v/gen/c/cgen.v | 263 +- vlib/v/gen/c/comptime.v | 22 +- vlib/v/gen/c/coverage.v | 6 +- vlib/v/gen/c/ctempvars.v | 6 +- vlib/v/gen/c/fn.v | 10 +- vlib/v/gen/c/for.v | 12 +- vlib/v/gen/c/infix.v | 68 +- vlib/v/gen/c/json.v | 2 +- vlib/v/gen/c/orm.v | 46 +- vlib/v/gen/c/past_tmp_var.v | 10 +- vlib/v/gen/c/profile.v | 4 +- vlib/v/gen/c/struct.v | 12 +- vlib/v/gen/c/utils.v | 12 +- vlib/v/gen/golang/golang.v | 4 +- vlib/v/gen/js/array.v | 4 +- vlib/v/gen/js/auto_str_methods.v | 2 +- vlib/v/gen/js/builtin_types.v | 192 +- vlib/v/gen/js/deep_copy.v | 2 +- vlib/v/gen/js/js.v | 16 +- vlib/v/gen/js/sourcemap/basic_test.v | 72 +- vlib/v/gen/js/sourcemap/compare_test.v | 170 +- vlib/v/gen/js/sourcemap/mappings.v | 8 +- vlib/v/gen/js/sourcemap/source_map.v | 8 +- .../v/gen/js/sourcemap/source_map_generator.v | 4 +- vlib/v/gen/js/tests/js.v | 2 +- vlib/v/gen/js/util.v | 12 +- vlib/v/gen/native/amd64.v | 66 +- vlib/v/gen/native/elf.v | 56 +- vlib/v/gen/native/expr.v | 4 +- vlib/v/gen/native/gen.v | 36 +- vlib/v/gen/native/macho.v | 30 +- vlib/v/gen/native/pe.v | 30 +- vlib/v/gen/native/readdll.c.v | 20 +- vlib/v/gen/native/stmt.c.v | 26 +- vlib/v/gen/wasm/asm.v | 4 +- vlib/v/gen/wasm/gen.v | 48 +- vlib/v/gen/wasm/mem.v | 32 +- vlib/v/gen/wasm/serialise/serialise.v | 8 +- vlib/v/live/executable/reloader.c.v | 18 +- vlib/v/markused/markused.v | 10 +- vlib/v/parser/assign.v | 28 +- vlib/v/parser/comptime.v | 134 +- vlib/v/parser/containers.v | 66 +- vlib/v/parser/expr.v | 142 +- vlib/v/parser/fn.v | 324 +- vlib/v/parser/for.v | 72 +- vlib/v/parser/if_match.v | 108 +- vlib/v/parser/lock.v | 28 +- vlib/v/parser/module.v | 6 +- vlib/v/parser/orm.v | 68 +- vlib/v/parser/parse_type.v | 52 +- vlib/v/parser/parser.v | 770 +- vlib/v/parser/struct.v | 264 +- vlib/v/parser/tmpl.v | 62 +- vlib/v/parser/v_parser_test.v | 8 +- vlib/v/pkgconfig/main.v | 40 +- vlib/v/pkgconfig/pkgconfig.v | 2 +- vlib/v/pref/line_info.v | 4 +- vlib/v/preludes/test_runner.c.v | 8 +- vlib/v/scanner/scanner.v | 138 +- vlib/v/slow_tests/assembly/asm_test.amd64.v | 4 +- vlib/v/slow_tests/assembly/asm_test.i386.v | 4 +- vlib/v/slow_tests/repl/repl_test.v | 2 +- vlib/v/slow_tests/repl/runner/runner.v | 4 +- .../valgrind/struct_of_array_of_same_struct.v | 4 +- .../append_struct_to_interface_array_test.v | 4 +- .../array_filter_using_direct_closure_test.v | 2 +- ...gn_option_of_multi_return_with_heap_test.v | 2 +- vlib/v/tests/autocast_in_if_conds_1_test.v | 2 +- vlib/v/tests/autocast_in_if_conds_2_test.v | 2 +- vlib/v/tests/autocast_in_if_conds_3_test.v | 2 +- vlib/v/tests/autocast_in_if_conds_4_test.v | 2 +- vlib/v/tests/autocast_in_if_conds_5_test.v | 2 +- .../v/tests/bench/math_big_gcd/bench_euclid.v | 4 +- .../c_struct_with_reserved_field_name_test.v | 6 +- vlib/v/tests/channels_test.v | 2 +- vlib/v/tests/closure_generator_test.v | 36 +- vlib/v/tests/closure_with_sumtype_var_test.v | 2 +- vlib/v/tests/complex_assign_test.v | 2 +- vlib/v/tests/comptime_eq_test.v | 8 +- .../comptime_for_in_field_selector_test.v | 6 +- ...mptime_for_in_field_with_generic_fn_test.v | 6 +- ..._struct_with_C_reserved_word_fields_test.v | 4 +- vlib/v/tests/comptime_ref_arg_test.v | 2 +- vlib/v/tests/comptime_selector_ptr_test.v | 4 +- .../concrete_type_as_generic_fn_type_2_test.v | 2 +- vlib/v/tests/const_selector_expr_order_test.v | 2 +- .../dump_c_structs/dump_c_struct_test.c.v | 4 +- vlib/v/tests/embed_struct_name_test.v | 2 +- vlib/v/tests/for_in_mut_struct_val_test.v | 2 +- .../tests/generic_fn_infer_multi_paras_test.v | 10 +- vlib/v/tests/generic_operator_overload_test.v | 4 +- ...eneric_struct_init_with_update_expr_test.v | 2 +- vlib/v/tests/generic_sumtype_method_test.v | 4 +- vlib/v/tests/generics_T_typ_test.v | 2 +- .../generics_call_with_reference_arg_test.v | 2 +- vlib/v/tests/generics_chans_select_test.v | 8 +- ...enerics_fn_return_generic_interface_test.v | 2 +- vlib/v/tests/generics_for_in_iterate_test.v | 4 +- ...s_interface_with_non_generic_method_test.v | 4 +- .../generics_return_generics_struct_test.v | 8 +- ..._inconsistent_types_generics_struct_test.v | 8 +- ...cs_return_recursive_generics_struct_test.v | 2 +- .../generics_with_generics_struct_init_test.v | 4 +- .../tests/generics_with_pointer_index_test.v | 4 +- ...rics_with_recursive_generics_struct_test.v | 4 +- vlib/v/tests/heap_reference_test.v | 8 +- vlib/v/tests/if_smartcast_multi_conds_test.v | 4 +- vlib/v/tests/if_smartcast_test.v | 2 +- .../interface_embedding_smartcast_test.v | 2 +- vlib/v/tests/interface_embedding_test.v | 4 +- vlib/v/tests/interface_struct_test.v | 10 +- .../json_serialisation_of_fixed_arrays_test.v | 10 +- ...t_having_fields_with_default_values_test.v | 2 +- vlib/v/tests/map_clear_test.v | 2 +- vlib/v/tests/map_sumtype_value_init_test.v | 2 +- ...xpression_with_fn_names_in_branches_test.v | 6 +- vlib/v/tests/match_with_return_result_test.v | 2 +- vlib/v/tests/offsetof_test.v | 8 +- vlib/v/tests/option_arr_auto_str_test.v | 10 +- vlib/v/tests/option_auto_eq_test.v | 2 +- vlib/v/tests/option_if_option_test.v | 2 +- vlib/v/tests/option_match_expr_test.v | 2 +- vlib/v/tests/option_ptr_init_empty_test.v | 2 +- vlib/v/tests/option_struct_field_init_test.v | 2 +- .../option_struct_init_with_ref_opt_test.v | 2 +- vlib/v/tests/option_test.c.v | 4 +- vlib/v/tests/option_unwrap_test.v | 4 +- vlib/v/tests/orm_sub_array_struct_test.v | 8 +- vlib/v/tests/parse_invalid_map_type_test.v | 2 +- vlib/v/tests/pointers_multilevel_casts_test.v | 2 +- ...terpolation_struct_with_usize_field_test.v | 8 +- vlib/v/tests/struct_embed_test.v | 4 +- ...ct_field_default_fn_type_value_init_test.v | 2 +- ...union_of_structs_marked_with_noinit_test.v | 2 +- .../struct_fields_storing_functions_test.v | 2 +- vlib/v/tests/struct_init_and_assign_test.v | 2 +- ...ruct_init_with_multi_option_fn_type_test.v | 4 +- vlib/v/tests/struct_init_with_update_test.v | 8 +- vlib/v/tests/struct_test.v | 8 +- vlib/v/tests/struct_transmute_test.v | 2 +- vlib/v/tests/sum_type_common_fields_test.v | 6 +- vlib/v/tests/sum_type_test.v | 6 +- vlib/v/token/pos.v | 18 +- vlib/v/transformer/transformer.v | 12 +- vlib/v/util/suggestions.v | 6 +- vlib/v/util/surrounder.v | 2 +- vlib/v/util/timers.v | 6 +- vlib/v/vcache/vcache.v | 4 +- vlib/v/vmod/parser.v | 2 +- vlib/v/vmod/vmod.v | 4 +- vlib/v2/ast/desugar.v | 10 +- vlib/v2/gen/v/gen.v | 4 +- vlib/v2/parser/parser.v | 298 +- vlib/v2/parser/type.v | 26 +- vlib/v2/pref/pref.v | 8 +- vlib/v2/scanner/scanner.v | 4 +- vlib/v2/token/position.v | 6 +- vlib/v2/types/checker.v | 50 +- vlib/v2/types/module.v | 4 +- vlib/v2/types/types.v | 2 +- vlib/v2/types/universe.v | 28 +- vlib/v2/util/worker_pool.v | 2 +- vlib/veb/assets/assets.v | 6 +- vlib/veb/assets/assets_test.v | 8 +- vlib/veb/auth/README.md | 6 +- vlib/veb/auth/auth.v | 2 +- vlib/veb/controller.v | 2 +- vlib/veb/csrf/csrf.v | 18 +- vlib/veb/csrf/csrf_test.v | 24 +- vlib/veb/middleware.v | 4 +- vlib/veb/oauth/oauth.v | 4 +- vlib/veb/route_test.v | 96 +- vlib/veb/tests/cors_test.v | 10 +- vlib/veb/tests/large_payload_test.v | 6 +- vlib/veb/tests/persistent_connection_test.v | 2 +- vlib/veb/tests/veb_app_test.v | 6 +- vlib/veb/tests/veb_test.v | 12 +- vlib/veb/tests/veb_test_server.v | 4 +- vlib/veb/veb.v | 72 +- vlib/vweb/README.md | 8 +- vlib/vweb/assets/assets.v | 2 +- vlib/vweb/csrf/csrf.v | 12 +- vlib/vweb/csrf/csrf_test.v | 32 +- vlib/vweb/route_test.v | 96 +- vlib/vweb/tests/controller_test.v | 4 +- vlib/vweb/tests/controller_test_server.v | 2 +- .../dynamic_template_manager_test_server.v | 2 +- vlib/vweb/tests/middleware_test.v | 12 +- vlib/vweb/tests/middleware_test_server.v | 4 +- vlib/vweb/tests/vweb_test.v | 12 +- vlib/vweb/tests/vweb_test_server/server.v | 2 +- vlib/vweb/vweb.v | 46 +- vlib/vweb/vweb_app_test.v | 6 +- vlib/wasm/constant.v | 6 +- vlib/wasm/instructions.v | 14 +- vlib/wasm/module.v | 40 +- vlib/x/crypto/chacha20/chacha_test.v | 584 +- vlib/x/crypto/chacha20/xchacha_test.v | 492 +- .../chacha20poly1305/chacha20poly1305.v | 2 +- .../chacha20poly1305/chacha20poly1305_test.v | 50 +- vlib/x/crypto/poly1305/poly1305_test.v | 24 +- vlib/x/json2/README.md | 4 +- vlib/x/json2/count_test.v | 8 +- vlib/x/json2/decoder.v | 12 +- vlib/x/json2/decoder2/decode.v | 4 +- .../json2/decoder2/tests/decode_struct_test.v | 8 +- vlib/x/json2/encoder.v | 2 +- vlib/x/json2/scanner.v | 4 +- vlib/x/json2/strict/strict.v | 10 +- vlib/x/json2/strict/strict_test.v | 12 +- vlib/x/json2/tests/decode_struct_test.v | 8 +- .../encode_struct_skippable_fields_test.v | 18 +- vlib/x/json2/tests/encode_struct_test.v | 8 +- vlib/x/json2/tests/encoder_test.v | 6 +- .../json_test.v | 40 +- vlib/x/sessions/db_store.v | 2 +- vlib/x/sessions/memory_store.v | 2 +- vlib/x/sessions/sessions.v | 16 +- vlib/x/sessions/tests/db_store_test.v | 2 +- vlib/x/sessions/tests/memory_store_test.v | 2 +- vlib/x/sessions/tests/session_app_test.v | 12 +- vlib/x/sessions/tests/session_test.v | 2 +- .../templating/dtm/dynamic_template_manager.v | 26 +- ...namic_template_manager_cache_system_test.v | 8 +- .../dtm/dynamic_template_manager_test.v | 72 +- vlib/x/ttf/README.md | 50 +- vlib/x/ttf/render_sokol_cpu.v | 14 +- vlib/x/ttf/ttf.v | 20 +- vlib/x/ttf/ttf_test.v | 10 +- vlib/x/vweb/assets/assets.v | 6 +- vlib/x/vweb/assets/assets_test.v | 8 +- vlib/x/vweb/controller.v | 2 +- vlib/x/vweb/csrf/csrf.v | 18 +- vlib/x/vweb/csrf/csrf_test.v | 36 +- vlib/x/vweb/middleware.v | 4 +- vlib/x/vweb/route_test.v | 96 +- vlib/x/vweb/tests/cors_test.v | 10 +- vlib/x/vweb/tests/large_payload_test.v | 6 +- .../x/vweb/tests/persistent_connection_test.v | 2 +- vlib/x/vweb/tests/vweb_app_test.v | 6 +- vlib/x/vweb/tests/vweb_test.v | 12 +- vlib/x/vweb/tests/vweb_test_server.v | 4 +- vlib/x/vweb/vweb.v | 72 +- 656 files changed, 18777 insertions(+), 18747 deletions(-) diff --git a/cmd/tools/gen_vc.v b/cmd/tools/gen_vc.v index a0ea67e81b53e3..386d364db1776b 100644 --- a/cmd/tools/gen_vc.v +++ b/cmd/tools/gen_vc.v @@ -133,7 +133,7 @@ fn new_gen_vc(flag_options FlagOptions) &GenVC { } return &GenVC{ options: flag_options - logger: logger + logger: logger } } @@ -171,14 +171,14 @@ pub fn (ws &WebhookServer) reset() { // parse flags to FlagOptions struct fn parse_flags(mut fp flag.FlagParser) FlagOptions { return FlagOptions{ - serve: fp.bool('serve', 0, false, 'run in webhook server mode') + serve: fp.bool('serve', 0, false, 'run in webhook server mode') work_dir: fp.string('work-dir', 0, work_dir, 'gen_vc working directory') - purge: fp.bool('purge', 0, false, 'force purge the local repositories') - port: fp.int('port', 0, server_port, 'port for web server to listen on') - log_to: fp.string('log-to', 0, log_to, "log to is 'file' or 'terminal'") + purge: fp.bool('purge', 0, false, 'force purge the local repositories') + port: fp.int('port', 0, server_port, 'port for web server to listen on') + log_to: fp.string('log-to', 0, log_to, "log to is 'file' or 'terminal'") log_file: fp.string('log-file', 0, log_file, "log file to use when log-to is 'file'") - dry_run: fp.bool('dry-run', 0, dry_run, 'when specified dont push anything to remote repo') - force: fp.bool('force', 0, false, 'force update even if already up to date') + dry_run: fp.bool('dry-run', 0, dry_run, 'when specified dont push anything to remote repo') + force: fp.bool('force', 0, false, 'force update even if already up to date') } } diff --git a/cmd/tools/measure/fmt_speed.v b/cmd/tools/measure/fmt_speed.v index c14cd8d9ba084b..a213854c9bed75 100644 --- a/cmd/tools/measure/fmt_speed.v +++ b/cmd/tools/measure/fmt_speed.v @@ -84,13 +84,13 @@ fn process_files(files []string) ! { fn new_parser(path string, comments_mode scanner.CommentsMode, table &ast.Table, pref_ &pref.Preferences) &parser.Parser { mut p := &parser.Parser{ scanner: scanner.new_scanner_file(path, comments_mode, pref_) or { panic(err) } - table: table - pref: pref_ - scope: &ast.Scope{ + table: table + pref: pref_ + scope: &ast.Scope{ start_pos: 0 - parent: table.global_scope + parent: table.global_scope } - errors: []errors.Error{} + errors: []errors.Error{} warnings: []errors.Warning{} } p.set_path(path) diff --git a/cmd/tools/measure/parser_speed.v b/cmd/tools/measure/parser_speed.v index b6c75135d66f28..79afde28a1da2b 100644 --- a/cmd/tools/measure/parser_speed.v +++ b/cmd/tools/measure/parser_speed.v @@ -79,13 +79,13 @@ fn process_files(files []string) ! { fn new_parser(path string, comments_mode scanner.CommentsMode, table &ast.Table, pref_ &pref.Preferences) &parser.Parser { mut p := &parser.Parser{ scanner: scanner.new_scanner_file(path, comments_mode, pref_) or { panic(err) } - table: table - pref: pref_ - scope: &ast.Scope{ + table: table + pref: pref_ + scope: &ast.Scope{ start_pos: 0 - parent: table.global_scope + parent: table.global_scope } - errors: []errors.Error{} + errors: []errors.Error{} warnings: []errors.Warning{} } p.set_path(path) diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index 74c19d1f070987..c5aa9064c100dc 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -117,22 +117,22 @@ mut: fn (mut ts TestSession) append_message(kind MessageKind, msg string, mtc MessageThreadContext) { ts.nmessages <- LogMessage{ - file: mtc.file + file: mtc.file flow_id: mtc.flow_id message: msg - kind: kind - when: time.now() + kind: kind + when: time.now() } } fn (mut ts TestSession) append_message_with_duration(kind MessageKind, msg string, d time.Duration, mtc MessageThreadContext) { ts.nmessages <- LogMessage{ - file: mtc.file + file: mtc.file flow_id: mtc.flow_id message: msg - kind: kind - when: time.now() - took: d + kind: kind + when: time.now() + took: d } } @@ -310,16 +310,16 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession { os.setenv('VCOLORS', 'always', true) } mut ts := TestSession{ - vexe: vexe - vroot: vroot - skip_files: skip_files - fail_fast: testing.fail_fast - show_stats: '-stats' in vargs.split(' ') - show_asserts: '-show-asserts' in vargs.split(' ') - vargs: vargs - vtmp_dir: new_vtmp_dir - hash: hash - silent_mode: _vargs.contains('-silent') + vexe: vexe + vroot: vroot + skip_files: skip_files + fail_fast: testing.fail_fast + show_stats: '-stats' in vargs.split(' ') + show_asserts: '-show-asserts' in vargs.split(' ') + vargs: vargs + vtmp_dir: new_vtmp_dir + hash: hash + silent_mode: _vargs.contains('-silent') progress_mode: _vargs.contains('-progress') } ts.handle_test_runner_option() @@ -493,7 +493,7 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr { } file := os.real_path(relative_file) mtc := MessageThreadContext{ - file: file + file: file flow_id: thread_id.str() } normalised_relative_file := relative_file.replace('\\', '/') diff --git a/cmd/tools/oldv.v b/cmd/tools/oldv.v index bcf9900b954665..822888a70fd0b9 100644 --- a/cmd/tools/oldv.v +++ b/cmd/tools/oldv.v @@ -44,15 +44,15 @@ mut: fn (mut c Context) compile_oldv_if_needed() { c.vgcontext = vgit.VGitContext{ - workdir: c.vgo.workdir - v_repo_url: c.vgo.v_repo_url - vc_repo_url: c.vgo.vc_repo_url - cc: c.cc - commit_v: c.commit_v - path_v: c.path_v - path_vc: c.path_vc + workdir: c.vgo.workdir + v_repo_url: c.vgo.v_repo_url + vc_repo_url: c.vgo.vc_repo_url + cc: c.cc + commit_v: c.commit_v + path_v: c.path_v + path_vc: c.path_vc make_fresh_tcc: c.fresh_tcc - show_vccommit: c.show_vccommit + show_vccommit: c.show_vccommit } c.vgcontext.compile_oldv_if_needed() c.commit_v_hash = c.vgcontext.commit_v__hash diff --git a/cmd/tools/performance_compare.v b/cmd/tools/performance_compare.v index e59758d35f9079..56304441c0e58b 100644 --- a/cmd/tools/performance_compare.v +++ b/cmd/tools/performance_compare.v @@ -25,9 +25,9 @@ mut: fn new_context() Context { return Context{ - cwd: os.getwd() + cwd: os.getwd() commit_after: 'master' - warmups: 4 + warmups: 4 } } @@ -80,12 +80,12 @@ fn (c &Context) prepare_v(cdir string, commit string) { cc = 'cc' } mut vgit_context := vgit.VGitContext{ - cc: cc - commit_v: commit - path_v: cdir - path_vc: c.vc - workdir: c.vgo.workdir - v_repo_url: c.vgo.v_repo_url + cc: cc + commit_v: commit + path_v: cdir + path_vc: c.vc + workdir: c.vgo.workdir + v_repo_url: c.vgo.v_repo_url vc_repo_url: c.vgo.vc_repo_url } vgit_context.compile_oldv_if_needed() diff --git a/cmd/tools/vast/vast.v b/cmd/tools/vast/vast.v index 1380b618d22209..a68ace4d9ecf96 100644 --- a/cmd/tools/vast/vast.v +++ b/cmd/tools/vast/vast.v @@ -126,9 +126,9 @@ fn json(file string) string { pref_.is_fmt = true mut t := Tree{ - root: new_object() + root: new_object() table: ast.new_table() - pref: pref_ + pref: pref_ } // parse file with comment ast_file := parser.parse_file(file, mut t.table, .parse_comments, t.pref) diff --git a/cmd/tools/vbump.v b/cmd/tools/vbump.v index 2739d0cf7b6781..51a1e532de1622 100644 --- a/cmd/tools/vbump.v +++ b/cmd/tools/vbump.v @@ -144,10 +144,10 @@ Try ${tool_name} -h for more help...') options := Options{ show_help: fp.bool('help', `h`, false, 'Show this help text.') - patch: fp.bool('patch', `p`, false, 'Bump the patch version.') - minor: fp.bool('minor', `n`, false, 'Bump the minor version.') - major: fp.bool('major', `m`, false, 'Bump the major version.') - skip: fp.string('skip', `s`, '', 'Skip lines matching this substring.').trim_space() + patch: fp.bool('patch', `p`, false, 'Bump the patch version.') + minor: fp.bool('minor', `n`, false, 'Bump the minor version.') + major: fp.bool('major', `m`, false, 'Bump the major version.') + skip: fp.string('skip', `s`, '', 'Skip lines matching this substring.').trim_space() } remaining := fp.finalize() or { diff --git a/cmd/tools/vbump_test.v b/cmd/tools/vbump_test.v index 8aad9b936a9f42..7ff7c3ce7b66cb 100644 --- a/cmd/tools/vbump_test.v +++ b/cmd/tools/vbump_test.v @@ -23,7 +23,7 @@ struct BumpTestCase { const test_cases = [ BumpTestCase{ file_name: 'v.mod' - contents: "Module { + contents: "Module { name: 'Sample' description: 'Sample project' version: '1.2.6' @@ -32,28 +32,28 @@ const test_cases = [ } " - line: 3 + line: 3 expected_patch: " version: '1.2.7'" expected_minor: " version: '1.3.0'" expected_major: " version: '2.0.0'" }, BumpTestCase{ file_name: 'random_versions.vv' - contents: " + contents: " 1.1.2 1.2.5 3.21.73 version = '1.5.1' " - line: 4 + line: 4 expected_patch: "version = '1.5.2'" expected_minor: "version = '1.6.0'" expected_major: "version = '2.0.0'" }, BumpTestCase{ file_name: 'sample_tool.v' - contents: "// Module comment and copyright information + contents: "// Module comment and copyright information import os import flag @@ -64,7 +64,7 @@ fn main() { // stuff } " - line: 5 + line: 5 expected_patch: "const tool_version = '0.1.34'" expected_minor: "const tool_version = '0.2.0'" expected_major: "const tool_version = '1.0.0'" @@ -111,7 +111,7 @@ struct SkipTestCase { const skip_test_cases = [ SkipTestCase{ file_name: 'CITATION.cff' - contents: 'abstract: A sample CLI tool made in V that prints geometric shapes to the screen. + contents: 'abstract: A sample CLI tool made in V that prints geometric shapes to the screen. authors: - alias: hungrybluedev family-names: Haldar @@ -125,8 +125,8 @@ title: geo url: https://github.com/hungrybluedev/geo version: 0.2.4 ' - line: 12 - skip: 'cff-version' + line: 12 + skip: 'cff-version' expected_patch: 'version: 0.2.5' expected_minor: 'version: 0.3.0' expected_major: 'version: 1.0.0' diff --git a/cmd/tools/vcheck-md.v b/cmd/tools/vcheck-md.v index 96a2ac9d458a39..6c5cdcd6d77261 100644 --- a/cmd/tools/vcheck-md.v +++ b/cmd/tools/vcheck-md.v @@ -34,10 +34,10 @@ pub mut: fn (v1 CheckResult) + (v2 CheckResult) CheckResult { return CheckResult{ - files: v1.files + v2.files + files: v1.files + v2.files warnings: v1.warnings + v2.warnings - errors: v1.errors + v2.errors - oks: v1.oks + v2.oks + errors: v1.errors + v2.errors + oks: v1.oks + v2.oks } } @@ -77,8 +77,8 @@ fn main() { } mut mdfile := MDFile{ skip_line_length_check: skip_line_length_check - path: file_path - lines: lines + path: file_path + lines: lines } res += mdfile.check() } @@ -243,7 +243,7 @@ fn (mut f MDFile) parse_line(lnumber int, line string) { command += ' ${default_command}' } f.current = VCodeExample{ - sline: lnumber + sline: lnumber command: command } } @@ -305,7 +305,7 @@ fn (mut ad AnchorData) add_links(line_number int, line string) { re.match_string(elem) link := re.get_group_by_name(elem, 'link') ad.links[link] << AnchorLink{ - line: line_number + line: line_number label: re.get_group_by_name(elem, 'label') } } @@ -317,7 +317,7 @@ fn (mut ad AnchorData) add_link_targets(line_number int, line string) { headline := line.substr(headline_start_pos + 1, line.len) link := create_ref_link(headline) ad.anchors[link] << Headline{ - line: line_number + line: line_number label: headline level: headline_start_pos } @@ -634,7 +634,7 @@ fn (mut f MDFile) check_examples() CheckResult { } return CheckResult{ errors: errors - oks: oks + oks: oks } } diff --git a/cmd/tools/vcover/main.v b/cmd/tools/vcover/main.v index 96b659a38b966e..5e8b9e29bd44b8 100644 --- a/cmd/tools/vcover/main.v +++ b/cmd/tools/vcover/main.v @@ -81,9 +81,9 @@ fn (mut ctx Context) process_target(tfile string) ! { for { row := reader.read() or { break } mut cline := CounterLine{ - meta: row[0] + meta: row[0] point: row[1].int() - hits: row[2].u64() + hits: row[2].u64() } m := ctx.meta[cline.meta] or { ctx.verbose('> skipping invalid meta: ${cline.meta} in file: ${cline.file}, csvfile: ${tfile}') diff --git a/cmd/tools/vcreate/project_model_bin.v b/cmd/tools/vcreate/project_model_bin.v index 865fec33125a9a..679dea6fcbff55 100644 --- a/cmd/tools/vcreate/project_model_bin.v +++ b/cmd/tools/vcreate/project_model_bin.v @@ -5,7 +5,7 @@ import os fn (mut c Create) set_bin_project_files() { base := if c.new_dir { c.name } else { '' } c.files << ProjectFiles{ - path: os.join_path(base, 'src', 'main.v') + path: os.join_path(base, 'src', 'main.v') content: "module main fn main() { diff --git a/cmd/tools/vcreate/project_model_lib.v b/cmd/tools/vcreate/project_model_lib.v index 32dc101a0264e4..3aa1ac5598f6ee 100644 --- a/cmd/tools/vcreate/project_model_lib.v +++ b/cmd/tools/vcreate/project_model_lib.v @@ -5,7 +5,7 @@ import os fn (mut c Create) set_lib_project_files() { base := if c.new_dir { c.name } else { '' } c.files << ProjectFiles{ - path: os.join_path(base, 'src', c.name + '.v') + path: os.join_path(base, 'src', c.name + '.v') content: 'module ${c.name} // square calculates the second power of `x` @@ -15,7 +15,7 @@ pub fn square(x int) int { ' } c.files << ProjectFiles{ - path: os.join_path(base, 'tests', 'square_test.v') + path: os.join_path(base, 'tests', 'square_test.v') content: 'import ${c.name} fn test_square() { diff --git a/cmd/tools/vcreate/project_model_web.v b/cmd/tools/vcreate/project_model_web.v index 4758234dc5e0de..e00fd48b04b0ff 100644 --- a/cmd/tools/vcreate/project_model_web.v +++ b/cmd/tools/vcreate/project_model_web.v @@ -5,7 +5,7 @@ import os { join_path } fn (mut c Create) set_web_project_files() { base := if c.new_dir { c.name } else { '' } c.files << ProjectFiles{ - path: join_path(base, 'src', 'databases', 'config_databases_sqlite.v') + path: join_path(base, 'src', 'databases', 'config_databases_sqlite.v') content: "module databases import db.sqlite // can change to 'db.mysql', 'db.pg' @@ -17,7 +17,7 @@ pub fn create_db_connection() !sqlite.DB { " } c.files << ProjectFiles{ - path: join_path(base, 'src', 'templates', 'header_component.html') + path: join_path(base, 'src', 'templates', 'header_component.html') content: "