diff --git a/cmd/tools/modules/testing/output.v b/cmd/tools/modules/testing/output.v index be6ee04be3..6303359294 100644 --- a/cmd/tools/modules/testing/output.v +++ b/cmd/tools/modules/testing/output.v @@ -4,11 +4,11 @@ import time pub enum MessageKind { compile_begin // sent right before *each* _test.v file compilation, the resulting status is not known yet, but the _test.v file itself is - compile_end // sent right after *each* _test.v file compilation, the message contains the output of that compilation - cmd_begin // sent right before *each* _test.v file execution, the resulting status is not known yet, but the _test.v file itself is - cmd_end // sent right after *each* _test.v file execution, the message contains the output of that execution + compile_end // sent right after *each* _test.v file compilation, the message contains the output of that compilation + cmd_begin // sent right before *each* _test.v file execution, the resulting status is not known yet, but the _test.v file itself is + cmd_end // sent right after *each* _test.v file execution, the message contains the output of that execution // - ok // success of a _test.v file + ok // success of a _test.v file fail // failed _test.v file, one or more assertions failed skip // the _test.v file was skipped for some reason info // a generic information message, detailing the actions of the `v test` program (some tests could be repeated for example, and the details are sent with an .info status) diff --git a/cmd/tools/vrepl.v b/cmd/tools/vrepl.v index ee48f9ac3f..226429d132 100644 --- a/cmd/tools/vrepl.v +++ b/cmd/tools/vrepl.v @@ -73,14 +73,14 @@ enum FnType { } enum DeclType { - include_ // #include ... - const_ // const ... - type_ // type ... - enum_ // enum ... - fn_ // fn ... - struct_ // struct ... + include_ // #include ... + const_ // const ... + type_ // type ... + enum_ // enum ... + fn_ // fn ... + struct_ // struct ... interface_ // interface ... - stmt_ // statement + stmt_ // statement } fn new_repl(folder string) Repl { diff --git a/cmd/tools/vtest.v b/cmd/tools/vtest.v index 868fe9765f..6b11725638 100644 --- a/cmd/tools/vtest.v +++ b/cmd/tools/vtest.v @@ -124,8 +124,8 @@ pub fn (mut ctx Context) should_test_dir(path string, backend string) ([]string, } enum ShouldTestStatus { - test // do test, print OK or FAIL, depending on if it passes - skip // print SKIP for the test + test // do test, print OK or FAIL, depending on if it passes + skip // print SKIP for the test ignore // just ignore the file, so it will not be printed at all in the list of tests } diff --git a/doc/docs.md b/doc/docs.md index eedb01ff9a..1df4d529e6 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -3443,7 +3443,7 @@ Enums can be created from string or integer value and converted into string ```v enum Cycle { one - two = 2 + two = 2 three } @@ -5852,7 +5852,7 @@ You can read [Enum](#enums) values and their attributes. ```v enum Color { - red @[RED] // first attribute + red @[RED] // first attribute blue @[BLUE] // second attribute } diff --git a/examples/viewer/file_scan.v b/examples/viewer/file_scan.v index b2e70bcb2d..157fcf8947 100644 --- a/examples/viewer/file_scan.v +++ b/examples/viewer/file_scan.v @@ -27,13 +27,13 @@ import os * ******************************************************************************/ enum Item_type { - file = 0 + file = 0 folder // archive format - zip = 16 + zip = 16 archive_file // graphic format, MUST stay after the other types!! - bmp = 32 + bmp = 32 jpg png gif diff --git a/vlib/builtin/array.v b/vlib/builtin/array.v index 44f1864686..414099b499 100644 --- a/vlib/builtin/array.v +++ b/vlib/builtin/array.v @@ -24,8 +24,8 @@ pub: pub enum ArrayFlags { noslices // when <<, `.noslices` will free the old data block immediately (you have to be sure, that there are *no slices* to that specific array). TODO: integrate with reference counting/compiler support for the static cases. noshrink // when `.noslices` and `.noshrink` are *both set*, .delete(x) will NOT allocate new memory and free the old. It will just move the elements in place, and adjust .len. - nogrow // the array will never be allowed to grow past `.cap`. set `.nogrow` and `.noshrink` for a truly fixed heap array - nofree // `.data` will never be freed + nogrow // the array will never be allowed to grow past `.cap`. set `.nogrow` and `.noshrink` for a truly fixed heap array + nofree // `.data` will never be freed } // Internal function, used by V (`nums := []int`) diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index 651b716705..86a3ec2512 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -145,9 +145,9 @@ pub: } pub enum AttributeKind { - plain // [name] - string // ['name'] - number // [123] + plain // [name] + string // ['name'] + number // [123] comptime_define // [if name] } diff --git a/vlib/compress/zstd/zstd.c.v b/vlib/compress/zstd/zstd.c.v index 4bcd8ce806..7b7a4119e2 100644 --- a/vlib/compress/zstd/zstd.c.v +++ b/vlib/compress/zstd/zstd.c.v @@ -66,7 +66,7 @@ pub enum ZSTD_cParameter { // to default. Setting this will however eventually dynamically impact the compression // parameters which have not been manually set. The manually set // ones will 'stick'. - zstd_c_compression_level = 100 + zstd_c_compression_level = 100 // Advanced compression parameters : // It's possible to pin down compression parameters to some specific values. // In which case, these values are no longer dynamically selected by the compressor @@ -79,14 +79,14 @@ pub enum ZSTD_cParameter { // Special: value 0 means "use default windowLog". // Note: Using a windowLog greater than ZSTD_WINDOWLOG_LIMIT_DEFAULT // requires explicitly allowing such size at streaming decompression stage. - zstd_c_window_log = 101 + zstd_c_window_log = 101 // Size of the initial probe table, as a power of 2. // Resulting memory usage is (1 << (hashLog+2)). // Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX. // Larger tables improve compression ratio of strategies <= dFast, // and improve speed of strategies > dFast. // Special: value 0 means "use default hashLog". - zstd_c_hash_log = 102 + zstd_c_hash_log = 102 // Size of the multi-probe search table, as a power of 2. // Resulting memory usage is (1 << (chainLog+2)). // Must be clamped between ZSTD_CHAINLOG_MIN and ZSTD_CHAINLOG_MAX. @@ -95,12 +95,12 @@ pub enum ZSTD_cParameter { // It's still useful when using "dfast" strategy, // in which case it defines a secondary probe table. // Special: value 0 means "use default chainLog". - zstd_c_chain_log = 103 + zstd_c_chain_log = 103 // Number of search attempts, as a power of 2. // More attempts result in better and slower compression. // This parameter is useless for "fast" and "dFast" strategies. // Special: value 0 means "use default searchLog". - zstd_c_search_log = 104 + zstd_c_search_log = 104 // Minimum size of searched matches. // Note that Zstandard can still find matches of smaller size, // it just tweaks its search algorithm to look for this size and larger. @@ -109,7 +109,7 @@ pub enum ZSTD_cParameter { // Note that currently, for all strategies < btopt, effective minimum is 4. // , for all strategies > fast, effective maximum is 6. // Special: value 0 means "use default minMatchLength". - zstd_c_min_match = 105 + zstd_c_min_match = 105 // Impact of this field depends on strategy. // For strategies btopt, btultra & btultra2: // Length of Match considered "good enough" to stop search. @@ -118,12 +118,12 @@ pub enum ZSTD_cParameter { // Distance between match sampling. // Larger values make compression faster, and weaker. // Special: value 0 means "use default targetLength". - zstd_c_target_length = 106 + zstd_c_target_length = 106 // See ZSTD_strategy enum definition. // The higher the value of selected strategy, the more complex it is, // resulting in stronger and slower compression. // Special: value 0 means "use default strategy". - zstd_c_strategy = 107 + zstd_c_strategy = 107 // LDM mode parameters // Enable long distance matching. // This parameter is designed to improve compression ratio @@ -140,34 +140,34 @@ pub enum ZSTD_cParameter { // Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX // default: windowlog - 7. // Special: value 0 means "automatically determine hashlog". - zstd_c_ldm_hash_log = 161 + zstd_c_ldm_hash_log = 161 // Minimum match size for long distance matcher. // Larger/too small values usually decrease compression ratio. // Must be clamped between ZSTD_LDM_MINMATCH_MIN and ZSTD_LDM_MINMATCH_MAX. // Special: value 0 means "use default value" (default: 64). - zstd_c_ldm_min_match = 162 + zstd_c_ldm_min_match = 162 // log size of each bucket in the ldm hash table for collision resolution. // Larger values improve collision resolution but decrease compression speed. // The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX. // Special: value 0 means "use default value" (default: 3). - zstd_c_ldm_bucket_size_log = 163 + zstd_c_ldm_bucket_size_log = 163 // Frequency of inserting/looking up entries into the LDM hash table. // Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN). // Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage. // Larger values improve compression speed. // Deviating far from default value will likely result in a compression ratio decrease. // Special: value 0 means "automatically determine hashRateLog". - zstd_c_ldm_hash_rate_log = 164 + zstd_c_ldm_hash_rate_log = 164 // frame parameters // Content size will be written into frame header _whenever known_ (default:1) // Content size must be known at the beginning of compression. // This is automatically the case when using ZSTD_compress2(), // For streaming scenarios, content size must be provided with ZSTD_CCtx_setPledgedSrcSize() - zstd_c_content_size_flag = 200 + zstd_c_content_size_flag = 200 // A 32-bits checksum of content is written at end of frame (default:0) - zstd_c_checksum_flag = 201 + zstd_c_checksum_flag = 201 // When applicable, dictionary's ID is written into frame header (default:1) - zstd_c_dict_id_flag = 202 + zstd_c_dict_id_flag = 202 // multi-threading parameters // These parameters are only active if multi-threading is enabled (compiled with build macro ZSTD_MULTITHREAD). // Otherwise, trying to set any other value than default (0) will be a no-op and return an error. @@ -183,13 +183,13 @@ pub enum ZSTD_cParameter { // More workers improve speed, but also increase memory usage. // Default value is `0`, aka "single-threaded mode" : no worker is spawned, // compression is performed inside Caller's thread, and all invocations are blocking - zstd_c_nb_workers = 400 + zstd_c_nb_workers = 400 // Size of a compression job. This value is enforced only when nbWorkers >= 1. // Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads. // 0 means default, which is dynamically determined based on compression parameters. // Job size must be a minimum of overlap size, or ZSTDMT_JOBSIZE_MIN (= 512 KB), whichever is largest. // The minimum size is automatically and transparently enforced. - zstd_c_job_size = 401 + zstd_c_job_size = 401 // Control the overlap size, as a fraction of window size. // The overlap size is an amount of data reloaded from previous job at the beginning of a new job. // It helps preserve compression ratio, while each job is compressed in parallel. @@ -202,7 +202,7 @@ pub enum ZSTD_cParameter { // Each intermediate rank increases/decreases load size by a factor 2 : // 9: full window; 8: w/2; 7: w/4; 6: w/8; 5:w/16; 4: w/32; 3:w/64; 2:w/128; 1:no overlap; 0:default // default value varies between 6 and 9, depending on strategy - zstd_c_overlap_log = 402 + zstd_c_overlap_log = 402 // note : additional experimental parameters are also available // within the experimental section of the API. // At the time of this writing, they include : @@ -227,25 +227,25 @@ pub enum ZSTD_cParameter { // note : never ever use experimentalParam? names directly; // also, the enums values themselves are unstable and can still change. // - zstd_c_experimental_param1 = 500 - zstd_c_experimental_param2 = 10 - zstd_c_experimental_param3 = 1000 - zstd_c_experimental_param4 = 1001 - zstd_c_experimental_param5 = 1002 - zstd_c_experimental_param6 = 1003 - zstd_c_experimental_param7 = 1004 - zstd_c_experimental_param8 = 1005 - zstd_c_experimental_param9 = 1006 - zstd_c_experimental_param10 = 1007 - zstd_c_experimental_param11 = 1008 - zstd_c_experimental_param12 = 1009 - zstd_c_experimental_param13 = 1010 - zstd_c_experimental_param14 = 1011 - zstd_c_experimental_param15 = 1012 - zstd_c_experimental_param16 = 1013 - zstd_c_experimental_param17 = 1014 - zstd_c_experimental_param18 = 1015 - zstd_c_experimental_param19 = 1016 + zstd_c_experimental_param1 = 500 + zstd_c_experimental_param2 = 10 + zstd_c_experimental_param3 = 1000 + zstd_c_experimental_param4 = 1001 + zstd_c_experimental_param5 = 1002 + zstd_c_experimental_param6 = 1003 + zstd_c_experimental_param7 = 1004 + zstd_c_experimental_param8 = 1005 + zstd_c_experimental_param9 = 1006 + zstd_c_experimental_param10 = 1007 + zstd_c_experimental_param11 = 1008 + zstd_c_experimental_param12 = 1009 + zstd_c_experimental_param13 = 1010 + zstd_c_experimental_param14 = 1011 + zstd_c_experimental_param15 = 1012 + zstd_c_experimental_param16 = 1013 + zstd_c_experimental_param17 = 1014 + zstd_c_experimental_param18 = 1015 + zstd_c_experimental_param19 = 1016 } pub struct ZSTD_bounds { @@ -274,7 +274,7 @@ pub enum ZSTD_dParameter { // This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode. // By default, a decompression context accepts window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT). // Special: value 0 means "use default maximum windowLog". - zstd_d_window_log_max = 100 + zstd_d_window_log_max = 100 // note : additional experimental parameters are also available // within the experimental section of the API. // At the time of this writing, they include : @@ -321,13 +321,13 @@ pub enum ZSTD_EndDirective { // it creates (at least) one new block, that can be decoded immediately on reception; // frame will continue: any future data can still reference previously compressed data, improving compression. // note : multithreaded compression will block to flush as much output as possible. - zstd_e_flush = 1 + zstd_e_flush = 1 // flush any remaining data _and_ close current frame. // note that frame is only closed after compressed data is fully flushed (return value == 0). // After that point, any additional data starts a new frame. // note : each frame is independent (does not reference any content from previous frame). // note : multithreaded compression will block to flush as much output as possible. - zstd_e_end = 2 + zstd_e_end = 2 } fn C.ZSTD_compressStream2(voidptr, &ZSTD_outBuffer, &ZSTD_inBuffer, ZSTD_EndDirective) usize diff --git a/vlib/db/mysql/enums.v b/vlib/db/mysql/enums.v index 0e2b38cf06..76b3edfd91 100644 --- a/vlib/db/mysql/enums.v +++ b/vlib/db/mysql/enums.v @@ -22,7 +22,7 @@ pub enum FieldType { type_timestamp2 type_datetime2 type_time2 - type_json = 245 + type_json = 245 type_newdecimal type_enum type_set diff --git a/vlib/db/pg/pg.c.v b/vlib/db/pg/pg.c.v index 882655c17c..2ffb727f18 100644 --- a/vlib/db/pg/pg.c.v +++ b/vlib/db/pg/pg.c.v @@ -80,34 +80,34 @@ pub struct C.PGresult {} pub struct C.PGconn {} pub enum ConnStatusType { - ok = C.CONNECTION_OK - bad = C.CONNECTION_BAD + ok = C.CONNECTION_OK + bad = C.CONNECTION_BAD // Non-blocking mode only below here // The existence of these should never be relied upon - they should only be used for user feedback or similar purposes. - started = C.CONNECTION_STARTED // Waiting for connection to be made. - made = C.CONNECTION_MADE // Connection OK; waiting to send. + started = C.CONNECTION_STARTED // Waiting for connection to be made. + made = C.CONNECTION_MADE // Connection OK; waiting to send. awaiting_response = C.CONNECTION_AWAITING_RESPONSE // Waiting for a response from the postmaster. - auth_ok = C.CONNECTION_AUTH_OK // Received authentication; waiting for backend startup. - setenv = C.CONNECTION_SETENV // Negotiating environment. - ssl_startup = C.CONNECTION_SSL_STARTUP // Negotiating SSL. - needed = C.CONNECTION_NEEDED // Internal state: connect() needed . Available in PG 8 - check_writable = C.CONNECTION_CHECK_WRITABLE // Check if we could make a writable connection. Available since PG 10 - consume = C.CONNECTION_CONSUME // Wait for any pending message and consume them. Available since PG 10 - gss_startup = C.CONNECTION_GSS_STARTUP // Negotiating GSSAPI; available since PG 12 + auth_ok = C.CONNECTION_AUTH_OK // Received authentication; waiting for backend startup. + setenv = C.CONNECTION_SETENV // Negotiating environment. + ssl_startup = C.CONNECTION_SSL_STARTUP // Negotiating SSL. + needed = C.CONNECTION_NEEDED // Internal state: connect() needed . Available in PG 8 + check_writable = C.CONNECTION_CHECK_WRITABLE // Check if we could make a writable connection. Available since PG 10 + consume = C.CONNECTION_CONSUME // Wait for any pending message and consume them. Available since PG 10 + gss_startup = C.CONNECTION_GSS_STARTUP // Negotiating GSSAPI; available since PG 12 } @[typedef] pub enum ExecStatusType { - empty_query = C.PGRES_EMPTY_QUERY // empty query string was executed - command_ok = C.PGRES_COMMAND_OK // a query command that doesn't return anything was executed properly by the backend - tuples_ok = C.PGRES_TUPLES_OK // a query command that returns tuples was executed properly by the backend, PGresult contains the result tuples - copy_out = C.PGRES_COPY_OUT // Copy Out data transfer in progress - copy_in = C.PGRES_COPY_IN // Copy In data transfer in progress - bad_response = C.PGRES_BAD_RESPONSE // an unexpected response was recv'd from the backend + empty_query = C.PGRES_EMPTY_QUERY // empty query string was executed + command_ok = C.PGRES_COMMAND_OK // a query command that doesn't return anything was executed properly by the backend + tuples_ok = C.PGRES_TUPLES_OK // a query command that returns tuples was executed properly by the backend, PGresult contains the result tuples + copy_out = C.PGRES_COPY_OUT // Copy Out data transfer in progress + copy_in = C.PGRES_COPY_IN // Copy In data transfer in progress + bad_response = C.PGRES_BAD_RESPONSE // an unexpected response was recv'd from the backend nonfatal_error = C.PGRES_NONFATAL_ERROR // notice or warning message - fatal_error = C.PGRES_FATAL_ERROR // query failed - copy_both = C.PGRES_COPY_BOTH // Copy In/Out data transfer in progress - single_tuple = C.PGRES_SINGLE_TUPLE // single tuple from larger resultset + fatal_error = C.PGRES_FATAL_ERROR // query failed + copy_both = C.PGRES_COPY_BOTH // Copy In/Out data transfer in progress + single_tuple = C.PGRES_SINGLE_TUPLE // single tuple from larger resultset } // diff --git a/vlib/flag/flag_to.v b/vlib/flag/flag_to.v index edf272a269..d1e98e567c 100644 --- a/vlib/flag/flag_to.v +++ b/vlib/flag/flag_to.v @@ -19,12 +19,12 @@ struct FlagContext { } pub enum Style { - short // Posix short only, allows multiple shorts -def is `-d -e -f` and "sticky" arguments e.g.: `-ofoo` = `-o foo` - long // GNU style long option *only*. E.g.: `--name` or `--name=value` + short // Posix short only, allows multiple shorts -def is `-d -e -f` and "sticky" arguments e.g.: `-ofoo` = `-o foo` + long // GNU style long option *only*. E.g.: `--name` or `--name=value` short_long // extends `posix` style shorts with GNU style long options: `--flag` or `--name=value` - v // V style flags as found in flags for the `v` compiler. Single flag denote `-` followed by string identifier e.g.: `-verbose`, `-name value`, `-v`, `-n value` or `-d ident=value` - go_flag // GO `flag` module style. Single flag denote `-` followed by string identifier e.g.: `-verbose`, `-name value`, `-v` or `-n value` and both long `--name value` and GNU long `--name=value` - cmd_exe // `cmd.exe` style flags. Single flag denote `/` followed by lower- or upper-case character + v // V style flags as found in flags for the `v` compiler. Single flag denote `-` followed by string identifier e.g.: `-verbose`, `-name value`, `-v`, `-n value` or `-d ident=value` + go_flag // GO `flag` module style. Single flag denote `-` followed by string identifier e.g.: `-verbose`, `-name value`, `-v` or `-n value` and both long `--name value` and GNU long `--name=value` + cmd_exe // `cmd.exe` style flags. Single flag denote `/` followed by lower- or upper-case character } struct StructInfo { diff --git a/vlib/fontstash/fontstash_enums.v b/vlib/fontstash/fontstash_enums.v index b311f4b052..a0991d0135 100644 --- a/vlib/fontstash/fontstash_enums.v +++ b/vlib/fontstash/fontstash_enums.v @@ -21,11 +21,11 @@ pub enum Align { pub enum ErrorCode { // Font atlas is full. - atlas_full = 1 + atlas_full = 1 // Scratch memory used to render glyphs is full, requested size reported in 'val', you may need to bump up FONS_SCRATCH_BUF_SIZE. - scratch_full = 2 + scratch_full = 2 // Calls to fonsPushState has created too large stack, if you need deep state stack bump up FONS_MAX_STATES. - states_overflow = 3 + states_overflow = 3 // Trying to pop too many states fonsPopState(). states_underflow = 4 } diff --git a/vlib/gg/enums.v b/vlib/gg/enums.v index b148f9a1a0..d1f802faed 100644 --- a/vlib/gg/enums.v +++ b/vlib/gg/enums.v @@ -23,8 +23,8 @@ pub enum MouseButtons { @[flag] pub enum Modifier { shift // (1<<0) - ctrl // (1<<1) - alt // (1<<2) + ctrl // (1<<1) + alt // (1<<2) super // (1<<3) } @@ -80,10 +80,10 @@ pub enum KeyCode { x = 88 y = 89 z = 90 - left_bracket = 91 //[ - backslash = 92 //\ - right_bracket = 93 //] - grave_accent = 96 //` + left_bracket = 91 //[ + backslash = 92 //\ + right_bracket = 93 //] + grave_accent = 96 //` world_1 = 161 // non-us #1 world_2 = 162 // non-us #2 escape = 256 diff --git a/vlib/gg/gg.js.v b/vlib/gg/gg.js.v index d6251d86fe..cb9891c74e 100644 --- a/vlib/gg/gg.js.v +++ b/vlib/gg/gg.js.v @@ -120,10 +120,10 @@ pub enum DOMKeyCode { x = 88 y = 89 z = 90 - left_bracket = 91 //[ - backslash = 92 //\ - right_bracket = 93 //] - grave_accent = 96 //` + left_bracket = 91 //[ + backslash = 92 //\ + right_bracket = 93 //] + grave_accent = 96 //` world_1 = 161 // non-us #1 world_2 = 162 // non-us #2 escape = 256 diff --git a/vlib/log/common.v b/vlib/log/common.v index 29d60eea5b..c1b0fa1640 100644 --- a/vlib/log/common.v +++ b/vlib/log/common.v @@ -4,11 +4,11 @@ import term // Level defines the possible log levels, used by Log.set_level() pub enum Level { - disabled = 0 // lowest level, disables everything else + disabled = 0 // lowest level, disables everything else fatal // disables error, warn, info and debug error // disables warn, info and debug - warn // disables info and debug - info // disables debug + warn // disables info and debug + info // disables debug debug } diff --git a/vlib/log/log.v b/vlib/log/log.v index 6d38b84626..cedeb0cd59 100644 --- a/vlib/log/log.v +++ b/vlib/log/log.v @@ -8,19 +8,19 @@ import time // TimeFormat define the log time string format, come from time/format.v pub enum TimeFormat { - tf_ss_micro // YYYY-MM-DD HH:mm:ss.123456 (24h) default - tf_default // YYYY-MM-DD HH:mm (24h) - tf_ss // YYYY-MM-DD HH:mm:ss (24h) - tf_ss_milli // YYYY-MM-DD HH:mm:ss.123 (24h) - tf_ss_nano // YYYY-MM-DD HH:mm:ss.123456789 (24h) - tf_rfc3339 // YYYY-MM-DDTHH:mm:ss.123Z (24 hours, see https://www.rfc-editor.org/rfc/rfc3339.html) - tf_rfc3339_nano // YYYY-MM-DDTHH:mm:ss.123456789Z (24 hours, see https://www.rfc-editor.org/rfc/rfc3339.html) - tf_hhmm // HH:mm (24h) - tf_hhmmss // HH:mm:ss (24h) - tf_hhmm12 // hh:mm (12h) - tf_ymmdd // YYYY-MM-DD - tf_ddmmy // DD.MM.YYYY - tf_md // MMM D + tf_ss_micro // YYYY-MM-DD HH:mm:ss.123456 (24h) default + tf_default // YYYY-MM-DD HH:mm (24h) + tf_ss // YYYY-MM-DD HH:mm:ss (24h) + tf_ss_milli // YYYY-MM-DD HH:mm:ss.123 (24h) + tf_ss_nano // YYYY-MM-DD HH:mm:ss.123456789 (24h) + tf_rfc3339 // YYYY-MM-DDTHH:mm:ss.123Z (24 hours, see https://www.rfc-editor.org/rfc/rfc3339.html) + tf_rfc3339_nano // YYYY-MM-DDTHH:mm:ss.123456789Z (24 hours, see https://www.rfc-editor.org/rfc/rfc3339.html) + tf_hhmm // HH:mm (24h) + tf_hhmmss // HH:mm:ss (24h) + tf_hhmm12 // hh:mm (12h) + tf_ymmdd // YYYY-MM-DD + tf_ddmmy // DD.MM.YYYY + tf_md // MMM D tf_custom_format // 'MMMM Do YY N kk:mm:ss A' output like: January 1st 22 AD 13:45:33 PM } diff --git a/vlib/net/net_windows.c.v b/vlib/net/net_windows.c.v index 1efcba1226..4a21ebabf8 100644 --- a/vlib/net/net_windows.c.v +++ b/vlib/net/net_windows.c.v @@ -22,185 +22,185 @@ const wsa_v22 = 0x202 // WsaError is all of the socket errors that WSA provides from WSAGetLastError pub enum WsaError { // MessageId: WSAEINTR, A blocking operation was interrupted by a call to WSACancelBlockingCall. - wsaeintr = 10004 + wsaeintr = 10004 // MessageId: WSAEBADF, The file handle supplied is not valid. - wsaebadf = 10009 + wsaebadf = 10009 // MessageId: WSAEACCES, An attempt was made to access a socket in a way forbidden by its access permissions. - wsaeacces = 10013 + wsaeacces = 10013 // MessageId: WSAEFAULT, The system detected an invalid pointer address in attempting to use a pointer argument in a call. - wsaefault = 10014 + wsaefault = 10014 // MessageId: WSAEINVAL, An invalid argument was supplied. - wsaeinval = 10022 + wsaeinval = 10022 // MessageId: WSAEMFILE, Too many open sockets. - wsaemfile = 10024 + wsaemfile = 10024 // MessageId: WSAEWOULDBLOCK, A non-blocking socket operation could not be completed immediately. - wsaewouldblock = 10035 + wsaewouldblock = 10035 // MessageId: WSAEINPROGRESS, A blocking operation is currently executing. - wsaeinprogress = 10036 + wsaeinprogress = 10036 // MessageId: WSAEALREADY, An operation was attempted on a non-blocking socket that already had an operation in progress. - wsaealready = 10037 + wsaealready = 10037 // MessageId: WSAENOTSOCK, An operation was attempted on something that is not a socket. - wsaenotsock = 10038 + wsaenotsock = 10038 // MessageId: WSAEDESTADDRREQ, A required address was omitted from an operation on a socket. - wsaedestaddrreq = 10039 + wsaedestaddrreq = 10039 // MessageId: WSAEMSGSIZE, A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself. - wsaemsgsize = 10040 + wsaemsgsize = 10040 // MessageId: WSAEPROTOTYPE, A protocol was specified in the socket function call that does not support the semantics of the socket type requested. - wsaeprototype = 10041 + wsaeprototype = 10041 // MessageId: WSAENOPROTOOPT, An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call. - wsaenoprotoopt = 10042 + wsaenoprotoopt = 10042 // MessageId: WSAEPROTONOSUPPORT, The requested protocol has not been configured into the system, or no implementation for it exists. - wsaeprotonosupport = 10043 + wsaeprotonosupport = 10043 // MessageId: WSAESOCKTNOSUPPORT, The support for the specified socket type does not exist in this address family. - wsaesocktnosupport = 10044 + wsaesocktnosupport = 10044 // MessageId: WSAEOPNOTSUPP, The attempted operation is not supported for the type of object referenced. - wsaeopnotsupp = 10045 + wsaeopnotsupp = 10045 // MessageId: WSAEPFNOSUPPORT, The protocol family has not been configured into the system or no implementation for it exists. - wsaepfnosupport = 10046 + wsaepfnosupport = 10046 // MessageId: WSAEAFNOSUPPORT, An address incompatible with the requested protocol was used. - wsaeafnosupport = 10047 + wsaeafnosupport = 10047 // MessageId: WSAEADDRINUSE, Only one usage of each socket address (protocol/network address/port) is normally permitted. - wsaeaddrinuse = 10048 + wsaeaddrinuse = 10048 // MessageId: WSAEADDRNOTAVAIL, The requested address is not valid in its context. - wsaeaddrnotavail = 10049 + wsaeaddrnotavail = 10049 // MessageId: WSAENETDOWN, A socket operation encountered a dead network. - wsaenetdown = 10050 + wsaenetdown = 10050 // MessageId: WSAENETUNREACH, A socket operation was attempted to an unreachable network. - wsaenetunreach = 10051 + wsaenetunreach = 10051 // MessageId: WSAENETRESET, The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. - wsaenetreset = 10052 + wsaenetreset = 10052 // MessageId: WSAECONNABORTED, An established connection was aborted by the software in your host machine. - wsaeconnaborted = 10053 + wsaeconnaborted = 10053 // MessageId: WSAECONNRESET, An existing connection was forcibly closed by the remote host. - wsaeconnreset = 10054 + wsaeconnreset = 10054 // MessageId: WSAENOBUFS, An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. - wsaenobufs = 10055 + wsaenobufs = 10055 // MessageId: WSAEISCONN, A connect request was made on an already connected socket. - wsaeisconn = 10056 + wsaeisconn = 10056 // MessageId: WSAENOTCONN, A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied. - wsaenotconn = 10057 + wsaenotconn = 10057 // MessageId: WSAESHUTDOWN, A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call. - wsaeshutdown = 10058 + wsaeshutdown = 10058 // MessageId: WSAETOOMANYREFS, Too many references to some kernel object. - wsaetoomanyrefs = 10059 + wsaetoomanyrefs = 10059 // MessageId: WSAETIMEDOUT, A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - wsaetimedout = 10060 + wsaetimedout = 10060 // MessageId: WSAECONNREFUSED, No connection could be made because the target machine actively refused it. - wsaeconnrefused = 10061 + wsaeconnrefused = 10061 // MessageId: WSAELOOP, Cannot translate name. - wsaeloop = 10062 + wsaeloop = 10062 // MessageId: WSAENAMETOOLONG, Name component or name was too long. - wsaenametoolong = 10063 + wsaenametoolong = 10063 // MessageId: WSAEHOSTDOWN, A socket operation failed because the destination host was down. - wsaehostdown = 10064 + wsaehostdown = 10064 // MessageId: WSAEHOSTUNREACH, A socket operation was attempted to an unreachable host. - wsaehostunreach = 10065 + wsaehostunreach = 10065 // MessageId: WSAENOTEMPTY, Cannot remove a directory that is not empty. - wsaenotempty = 10066 + wsaenotempty = 10066 // MessageId: WSAEPROCLIM, A Windows Sockets implementation may have a limit on the number of applications that may use it simultaneously. - wsaeproclim = 10067 + wsaeproclim = 10067 // MessageId: WSAEUSERS, Ran out of quota. - wsaeusers = 10068 + wsaeusers = 10068 // MessageId: WSAEDQUOT, Ran out of disk quota. - wsaedquot = 10069 + wsaedquot = 10069 // MessageId: WSAESTALE, File handle reference is no longer available. - wsaestale = 10070 + wsaestale = 10070 // MessageId: WSAEREMOTE, Item is not available locally. - wsaeremote = 10071 + wsaeremote = 10071 // MessageId: WSASYSNOTREADY, WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable. - wsasysnotready = 10091 + wsasysnotready = 10091 // MessageId: WSAVERNOTSUPPORTED, The Windows Sockets version requested is not supported. - wsavernotsupported = 10092 + wsavernotsupported = 10092 // MessageId: WSANOTINITIALISED, Either the application has not called WSAStartup, or WSAStartup failed. - wsanotinitialised = 10093 + wsanotinitialised = 10093 // MessageId: WSAEDISCON, Returned by WSARecv or WSARecvFrom to indicate the remote party has initiated a graceful shutdown sequence. - wsaediscon = 10101 + wsaediscon = 10101 // MessageId: WSAENOMORE, No more results can be returned by WSALookupServiceNext. - wsaenomore = 10102 + wsaenomore = 10102 // MessageId: WSAECANCELLED, A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled. - wsaecancelled = 10103 + wsaecancelled = 10103 // MessageId: WSAEINVALIDPROCTABLE, The procedure call table is invalid. - wsaeinvalidproctable = 10104 + wsaeinvalidproctable = 10104 // MessageId: WSAEINVALIDPROVIDER, The requested service provider is invalid. - wsaeinvalidprovider = 10105 + wsaeinvalidprovider = 10105 // MessageId: WSAEPROVIDERFAILEDINIT, The requested service provider could not be loaded or initialized. - wsaeproviderfailedinit = 10106 + wsaeproviderfailedinit = 10106 // MessageId: WSASYSCALLFAILURE, A system call has failed. - wsasyscallfailure = 10107 + wsasyscallfailure = 10107 // MessageId: WSASERVICE_NOT_FOUND, No such service is known. The service cannot be found in the specified name space. - wsaservice_not_found = 10108 + wsaservice_not_found = 10108 // MessageId: WSATYPE_NOT_FOUND, The specified class was not found. - wsatype_not_found = 10109 + wsatype_not_found = 10109 // MessageId: WSA_E_NO_MORE, No more results can be returned by WSALookupServiceNext. - wsa_e_no_more = 10110 + wsa_e_no_more = 10110 // MessageId: WSA_E_CANCELLED, A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled. - wsa_e_cancelled = 10111 + wsa_e_cancelled = 10111 // MessageId: WSAEREFUSED, A database query failed because it was actively refused. - wsaerefused = 10112 + wsaerefused = 10112 // MessageId: WSAHOST_NOT_FOUND, No such host is known. - wsahost_not_found = 11001 + wsahost_not_found = 11001 // MessageId: WSATRY_AGAIN, This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server. - wsatry_again = 11002 + wsatry_again = 11002 // MessageId: WSANO_RECOVERY, A non-recoverable error occurred during a database lookup. - wsano_recovery = 11003 + wsano_recovery = 11003 // MessageId: WSANO_DATA, The requested name is valid, but no data of the requested type was found. - wsano_data = 11004 + wsano_data = 11004 // MessageId: WSA_QOS_RECEIVERS, At least one reserve has arrived. - wsa_qos_receivers = 11005 + wsa_qos_receivers = 11005 // MessageId: WSA_QOS_SENDERS, At least one path has arrived. - wsa_qos_senders = 11006 + wsa_qos_senders = 11006 // MessageId: WSA_QOS_NO_SENDERS, There are no senders. - wsa_qos_no_senders = 11007 + wsa_qos_no_senders = 11007 // MessageId: WSA_QOS_NO_RECEIVERS, There are no receivers. - wsa_qos_no_receivers = 11008 + wsa_qos_no_receivers = 11008 // MessageId: WSA_QOS_REQUEST_CONFIRMED, Reserve has been confirmed. - wsa_qos_request_confirmed = 11009 + wsa_qos_request_confirmed = 11009 // MessageId: WSA_QOS_ADMISSION_FAILURE, Error due to lack of resources. - wsa_qos_admission_failure = 11010 + wsa_qos_admission_failure = 11010 // MessageId: WSA_QOS_POLICY_FAILURE, Rejected for administrative reasons - bad credentials. - wsa_qos_policy_failure = 11011 + wsa_qos_policy_failure = 11011 // MessageId: WSA_QOS_BAD_STYLE, Unknown or conflicting style. - wsa_qos_bad_style = 11012 + wsa_qos_bad_style = 11012 // MessageId: WSA_QOS_BAD_OBJECT, Problem with some part of the filterspec or providerspecific buffer in general. - wsa_qos_bad_object = 11013 + wsa_qos_bad_object = 11013 // MessageId: WSA_QOS_TRAFFIC_CTRL_ERROR, Problem with some part of the flowspec. - wsa_qos_traffic_ctrl_error = 11014 + wsa_qos_traffic_ctrl_error = 11014 // MessageId: WSA_QOS_GENERIC_ERROR, General QOS error. - wsa_qos_generic_error = 11015 + wsa_qos_generic_error = 11015 // MessageId: WSA_QOS_ESERVICETYPE, An invalid or unrecognized service type was found in the flowspec. - wsa_qos_eservicetype = 11016 + wsa_qos_eservicetype = 11016 // MessageId: WSA_QOS_EFLOWSPEC, An invalid or inconsistent flowspec was found in the QOS structure. - wsa_qos_eflowspec = 11017 + wsa_qos_eflowspec = 11017 // MessageId: WSA_QOS_EPROVSPECBUF, Invalid QOS provider-specific buffer. - wsa_qos_eprovspecbuf = 11018 + wsa_qos_eprovspecbuf = 11018 // MessageId: WSA_QOS_EFILTERSTYLE, An invalid QOS filter style was used. - wsa_qos_efilterstyle = 11019 + wsa_qos_efilterstyle = 11019 // MessageId: WSA_QOS_EFILTERTYPE, An invalid QOS filter type was used. - wsa_qos_efiltertype = 11020 + wsa_qos_efiltertype = 11020 // MessageId: WSA_QOS_EFILTERCOUNT, An incorrect number of QOS FILTERSPECs were specified in the FLOWDESCRIPTOR. - wsa_qos_efiltercount = 11021 + wsa_qos_efiltercount = 11021 // MessageId: WSA_QOS_EOBJLENGTH, An object with an invalid ObjectLength field was specified in the QOS provider-specific buffer. - wsa_qos_eobjlength = 11022 + wsa_qos_eobjlength = 11022 // MessageId: WSA_QOS_EFLOWCOUNT, An incorrect number of flow descriptors was specified in the QOS structure. - wsa_qos_eflowcount = 11023 + wsa_qos_eflowcount = 11023 // MessageId: WSA_QOS_EUNKOWNPSOBJ, An unrecognized object was found in the QOS provider-specific buffer. - wsa_qos_eunkownpsobj = 11024 + wsa_qos_eunkownpsobj = 11024 // MessageId: WSA_QOS_EPOLICYOBJ, An invalid policy object was found in the QOS provider-specific buffer. - wsa_qos_epolicyobj = 11025 + wsa_qos_epolicyobj = 11025 // MessageId: WSA_QOS_EFLOWDESC, An invalid QOS flow descriptor was found in the flow descriptor list. - wsa_qos_eflowdesc = 11026 + wsa_qos_eflowdesc = 11026 // MessageId: WSA_QOS_EPSFLOWSPEC, An invalid or inconsistent flowspec was found in the QOS provider specific buffer. - wsa_qos_epsflowspec = 11027 + wsa_qos_epsflowspec = 11027 // MessageId: WSA_QOS_EPSFILTERSPEC, An invalid FILTERSPEC was found in the QOS provider-specific buffer. - wsa_qos_epsfilterspec = 11028 + wsa_qos_epsfilterspec = 11028 // MessageId: WSA_QOS_ESDMODEOBJ, An invalid shape discard mode object was found in the QOS provider specific buffer. - wsa_qos_esdmodeobj = 11029 + wsa_qos_esdmodeobj = 11029 // MessageId: WSA_QOS_ESHAPERATEOBJ, An invalid shaping rate object was found in the QOS provider-specific buffer. - wsa_qos_eshaperateobj = 11030 + wsa_qos_eshaperateobj = 11030 // MessageId: WSA_QOS_RESERVED_PETYPE, A reserved policy element was found in the QOS provider-specific buffer. - wsa_qos_reserved_petype = 11031 + wsa_qos_reserved_petype = 11031 // MessageId: WSA_SECURE_HOST_NOT_FOUND, No such host is known securely. - wsa_secure_host_not_found = 11032 + wsa_secure_host_not_found = 11032 // MessageId: WSA_IPSEC_NAME_POLICY_ERROR, Name based IPSEC policy could not be added. wsa_ipsec_name_policy_error = 11033 } diff --git a/vlib/orm/orm.v b/vlib/orm/orm.v index c6a28e27b4..5159ed2048 100644 --- a/vlib/orm/orm.v +++ b/vlib/orm/orm.v @@ -56,15 +56,15 @@ pub type Primitive = InfixType pub struct Null {} pub enum OperationKind { - neq // != - eq // == - gt // > - lt // < - ge // >= - le // <= - orm_like // LIKE - orm_ilike // ILIKE - is_null // IS NULL + neq // != + eq // == + gt // > + lt // < + ge // >= + le // <= + orm_like // LIKE + orm_ilike // ILIKE + is_null // IS NULL is_not_null // IS NOT NULL } diff --git a/vlib/os/os_android_outside_termux.c.v b/vlib/os/os_android_outside_termux.c.v index fef1c4b86b..5530e6ee0f 100644 --- a/vlib/os/os_android_outside_termux.c.v +++ b/vlib/os/os_android_outside_termux.c.v @@ -5,10 +5,10 @@ module os #include pub enum AssetMode { - buffer = C.AASSET_MODE_BUFFER // Caller plans to ask for a read-only buffer with all data. - random = C.AASSET_MODE_RANDOM // Read chunks, and seek forward and backward. + buffer = C.AASSET_MODE_BUFFER // Caller plans to ask for a read-only buffer with all data. + random = C.AASSET_MODE_RANDOM // Read chunks, and seek forward and backward. streaming = C.AASSET_MODE_STREAMING // Read sequentially, with an occasional forward seek. - unknown = C.AASSET_MODE_UNKNOWN // No specific information about how data will be accessed. + unknown = C.AASSET_MODE_UNKNOWN // No specific information about how data will be accessed. } // See https://developer.android.com/ndk/reference/struct/a-native-activity for more info. diff --git a/vlib/regex/regex.v b/vlib/regex/regex.v index f4af0ff029..c693453d68 100644 --- a/vlib/regex/regex.v +++ b/vlib/regex/regex.v @@ -877,11 +877,11 @@ fn (re RE) parse_quantifier(in_txt string, in_i int) (int, int, int, bool) { // enum Group_parse_state { start - q_mark // (? - q_mark1 // (?:|P checking - p_status // (?P - p_start // (?P< - p_end // (?P<...> + q_mark // (? + q_mark1 // (?:|P checking + p_status // (?P + p_start // (?P< + p_end // (?P<...> p_in_name // (?P<... finish } @@ -1775,15 +1775,15 @@ fn (mut re RE) group_continuous_save(g_index int) { * ******************************************************************************/ enum Match_state { - start = 0 + start = 0 stop end new_line - ist_load // load and execute instruction - ist_next // go to next instruction - ist_next_ks // go to next instruction without clenaning the state - ist_quant_p // match positive ,quantifier check - ist_quant_n // match negative, quantifier check + ist_load // load and execute instruction + ist_next // go to next instruction + ist_next_ks // go to next instruction without clenaning the state + ist_quant_p // match positive ,quantifier check + ist_quant_n // match negative, quantifier check ist_quant_pg // match positive ,group quantifier check ist_quant_ng // match negative ,group quantifier check } diff --git a/vlib/sokol/gfx/enums.v b/vlib/sokol/gfx/enums.v index 57745e9cb9..c34758bee1 100644 --- a/vlib/sokol/gfx/enums.v +++ b/vlib/sokol/gfx/enums.v @@ -79,8 +79,8 @@ pub enum PixelFormat as u32 { bc6h_rgbuf bc7_rgba bc7_srgba - pvrtc_rgb_2bpp // deprecated - pvrtc_rgb_4bpp // deprecated + pvrtc_rgb_2bpp // deprecated + pvrtc_rgb_4bpp // deprecated pvrtc_rgba_2bpp // deprecated pvrtc_rgba_4bpp // deprecated etc2_rgb8 @@ -96,7 +96,7 @@ pub enum PixelFormat as u32 { astc_4x4_srgba // _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum ResourceState as u32 { @@ -123,7 +123,7 @@ pub enum BufferType as u32 { indexbuffer storagebuffer _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum IndexType as u32 { @@ -153,7 +153,7 @@ pub enum ImageSampleType as u32 { uint unfilterable_float _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum SamplerType as u32 { @@ -162,7 +162,7 @@ pub enum SamplerType as u32 { nonfiltering comparison _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum CubeFace as u32 { @@ -190,7 +190,7 @@ pub enum PrimitiveType as u32 { triangles triangle_strip _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum Filter as u32 { @@ -204,12 +204,12 @@ pub enum Filter as u32 { pub enum Wrap as u32 { _default // value 0 reserved for default-init - repeat // The default wrap mode. + repeat // The default wrap mode. clamp_to_edge clamp_to_border // not supported on all backends and platforms. To check for support, call sg_query_features(), and check the "clamp_to_border" boolean in the returned sg_features struct. Platforms which don't support SG_WRAP_CLAMP_TO_BORDER will silently fall back to clamp_to_edge without a validation error. mirrored_repeat _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum BorderColor as u32 { @@ -218,7 +218,7 @@ pub enum BorderColor as u32 { opaque_black opaque_white _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum VertexFormat as u32 { @@ -249,7 +249,7 @@ pub enum VertexStep as u32 { per_vertex per_instance _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum UniformType as u32 { @@ -296,7 +296,7 @@ pub enum CompareFunc as u32 { greater_equal always _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum StencilOp as u32 { @@ -331,7 +331,7 @@ pub enum BlendFactor as u32 { blend_alpha one_minus_blend_alpha _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum BlendOp as u32 { @@ -340,11 +340,11 @@ pub enum BlendOp as u32 { subtract reverse_subtract _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } pub enum ColorMask as u32 { - _default = 0 // value 0 reserved for default-init + _default = 0 // value 0 reserved for default-init @none = 0x10 // special value for 'all channels disabled r = 1 g = 2 @@ -380,9 +380,9 @@ pub enum StoreAction as u32 { } pub enum UniformLayout as u32 { - uniformlayout_default = 0 // value 0 reserved for default-init + uniformlayout_default = 0 // value 0 reserved for default-init uniformlayout_native // default: layout depends on currently active backend uniformlayout_std140 // std140: memory layout according to std140 _num - _force_u32 = 0x7FFFFFFF + _force_u32 = 0x7FFFFFFF } diff --git a/vlib/sokol/sapp/enums.c.v b/vlib/sokol/sapp/enums.c.v index dbed1784af..d597fb065c 100644 --- a/vlib/sokol/sapp/enums.c.v +++ b/vlib/sokol/sapp/enums.c.v @@ -106,10 +106,10 @@ pub enum KeyCode { x = 88 y = 89 z = 90 - left_bracket = 91 //[ - backslash = 92 //\ - right_bracket = 93 //] - grave_accent = 96 //` + left_bracket = 91 //[ + backslash = 92 //\ + right_bracket = 93 //] + grave_accent = 96 //` world_1 = 161 // non-us #1 world_2 = 162 // non-us #2 escape = 256 diff --git a/vlib/strconv/atof.c.v b/vlib/strconv/atof.c.v index f9dabd05fa..ea00b918ab 100644 --- a/vlib/strconv/atof.c.v +++ b/vlib/strconv/atof.c.v @@ -108,11 +108,11 @@ fn is_exp(x u8) bool { // Possible parser return values. enum ParserState { - ok // parser finished OK - pzero // no digits or number is smaller than +-2^-1022 - mzero // number is negative, module smaller - pinf // number is higher than +HUGE_VAL - minf // number is lower than -HUGE_VAL + ok // parser finished OK + pzero // no digits or number is smaller than +-2^-1022 + mzero // number is negative, module smaller + pinf // number is higher than +HUGE_VAL + minf // number is lower than -HUGE_VAL invalid_number // invalid number, used for '#@%^' for example } diff --git a/vlib/strconv/format.v b/vlib/strconv/format.v index d53af4f80b..def3da8f8e 100644 --- a/vlib/strconv/format.v +++ b/vlib/strconv/format.v @@ -12,7 +12,7 @@ This file contains the printf/sprintf functions import strings pub enum Align_text { - right = 0 + right = 0 left center } diff --git a/vlib/sync/channels.c.v b/vlib/sync/channels.c.v index 89d470d823..ba867d0b9a 100644 --- a/vlib/sync/channels.c.v +++ b/vlib/sync/channels.c.v @@ -8,7 +8,7 @@ const spinloops = 750 const spinloops_sem = 4000 enum BufferElemStat { - unused = 0 + unused = 0 writing written reading diff --git a/vlib/toml/token/token.v b/vlib/toml/token/token.v index 6818895517..0e5611b9db 100644 --- a/vlib/toml/token/token.v +++ b/vlib/toml/token/token.v @@ -18,26 +18,26 @@ pub: pub enum Kind { unknown eof - bare // user - boolean // true or false - number // 123 - quoted // 'foo', "foo", """foo""" or '''foo''' - plus // + - minus // - + bare // user + boolean // true or false + number // 123 + quoted // 'foo', "foo", """foo""" or '''foo''' + plus // + + minus // - underscore // _ - comma // , - colon // : - hash // # comment - assign // = - lcbr // { - rcbr // } - lsbr // [ - rsbr // ] - nl // \n linefeed / newline character - cr // \r carriage return - tab // \t character + comma // , + colon // : + hash // # comment + assign // = + lcbr // { + rcbr // } + lsbr // [ + rsbr // ] + nl // \n linefeed / newline character + cr // \r carriage return + tab // \t character whitespace // ` ` - period // . + period // . _end_ } diff --git a/vlib/v/ast/ast.v b/vlib/v/ast/ast.v index 6d6db5fe45..5d15ec3d0e 100644 --- a/vlib/v/ast/ast.v +++ b/vlib/v/ast/ast.v @@ -824,13 +824,13 @@ pub mut: } pub enum ComptimeVarKind { - no_comptime // it is not a comptime var - key_var // map key from `for k,v in t.$(field.name)` - value_var // map value from `for k,v in t.$(field.name)` - field_var // comptime field var `a := t.$(field.name)` + no_comptime // it is not a comptime var + key_var // map key from `for k,v in t.$(field.name)` + value_var // map value from `for k,v in t.$(field.name)` + field_var // comptime field var `a := t.$(field.name)` generic_param // generic fn parameter - generic_var // generic var - smartcast // smart cast when used in `is v` (when `v` is from $for .variants) + generic_var // generic var + smartcast // smart cast when used in `is v` (when `v` is from $for .variants) } @[minify] @@ -1644,13 +1644,13 @@ pub mut: // addressing modes: pub enum AddressingMode { invalid - displacement // displacement - base // base - base_plus_displacement // base + displacement - index_times_scale_plus_displacement // (index ∗ scale) + displacement - base_plus_index_plus_displacement // base + (index ∗ scale) + displacement + displacement // displacement + base // base + base_plus_displacement // base + displacement + index_times_scale_plus_displacement // (index ∗ scale) + displacement + base_plus_index_plus_displacement // base + (index ∗ scale) + displacement base_plus_index_times_scale_plus_displacement // base + index + displacement - rip_plus_displacement // rip + displacement + rip_plus_displacement // rip + displacement } pub struct AsmClobbered { diff --git a/vlib/v/ast/attr.v b/vlib/v/ast/attr.v index 3a70f99881..c2b4661e0c 100644 --- a/vlib/v/ast/attr.v +++ b/vlib/v/ast/attr.v @@ -6,10 +6,10 @@ module ast import v.token pub enum AttrKind { - plain // [name] - string // ['name'] - number // [123] - bool // [true] || [false] + plain // [name] + string // ['name'] + number // [123] + bool // [true] || [false] comptime_define // [if name] } diff --git a/vlib/v/ast/types.v b/vlib/v/ast/types.v index 1bb6d8cd35..bd33fbd05f 100644 --- a/vlib/v/ast/types.v +++ b/vlib/v/ast/types.v @@ -41,8 +41,8 @@ pub enum Language { i386 arm64 // 64-bit arm arm32 // 32-bit arm - rv64 // 64-bit risc-v - rv32 // 32-bit risc-v + rv64 // 64-bit risc-v + rv32 // 32-bit risc-v wasm32 } diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 2a581fad18..4448cf2a95 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -926,12 +926,6 @@ pub fn (mut f Fmt) comptime_for(node ast.ComptimeFor) { f.writeln('}') } -struct ValAlignInfo { -mut: - max int - last_idx int -} - pub fn (mut f Fmt) const_decl(node ast.ConstDecl) { if node.fields.len == 0 && node.pos.line_nr == node.pos.last_line { // remove "const()" @@ -1044,37 +1038,74 @@ pub fn (mut f Fmt) enum_decl(node ast.EnumDecl) { } f.writeln('enum ${name} {') f.comments(node.comments, same_line: true, level: .indent) - mut align_infos := []ValAlignInfo{} - mut info := ValAlignInfo{} - for i, field in node.fields { - if field.name.len > info.max { - info.max = field.name.len + + mut value_aligns := []AlignInfo{} + mut attr_aligns := []AlignInfo{} + mut comment_aligns := []AlignInfo{} + for field in node.fields { + if field.has_expr { + value_aligns.add_info(field.name.len, field.pos.line_nr) } - if !expr_is_single_line(field.expr) { - info.last_idx = i - align_infos << info - info = ValAlignInfo{} + attrs_len := inline_attrs_len(field.attrs) + if field.attrs.len > 0 { + if field.has_expr { + attr_aligns.add_info(field.expr.str().len + 2, field.pos.line_nr) + } else { + attr_aligns.add_info(field.name.len, field.pos.line_nr) + } + } + if field.comments.len > 0 { + if field.attrs.len > 0 { + comment_aligns.add_info(attrs_len, field.pos.line_nr) + } else if field.has_expr { + comment_aligns.add_info(field.expr.str().len + 2, field.pos.line_nr) + } else { + comment_aligns.add_info(field.name.len, field.pos.line_nr) + } } } - info.last_idx = node.fields.len - align_infos << info - mut align_idx := 0 - for i, field in node.fields { - if i > align_infos[align_idx].last_idx { - align_idx++ - } + mut value_align_i := 0 + mut attr_align_i := 0 + mut comment_align_i := 0 + for field in node.fields { f.write('\t${field.name}') if field.has_expr { - f.write(strings.repeat(` `, align_infos[align_idx].max - field.name.len)) + if value_aligns[value_align_i].line_nr < field.pos.line_nr { + value_align_i++ + } + f.write(strings.repeat(` `, value_aligns[value_align_i].max_len - field.name.len)) f.write(' = ') f.expr(field.expr) } + attrs_len := inline_attrs_len(field.attrs) if field.attrs.len > 0 { + if attr_aligns[attr_align_i].line_nr < field.pos.line_nr { + attr_align_i++ + } + if field.has_expr { + f.write(strings.repeat(` `, attr_aligns[attr_align_i].max_len - field.expr.str().len - 2)) + } else { + f.write(strings.repeat(` `, attr_aligns[attr_align_i].max_len - field.name.len)) + } f.write(' ') f.single_line_attrs(field.attrs, same_line: true) } - f.comments(field.comments, same_line: true, has_nl: false, level: .indent) + // f.comments(field.comments, same_line: true, has_nl: false, level: .indent) + if field.comments.len > 0 { + if comment_aligns[comment_align_i].line_nr < field.pos.line_nr { + comment_align_i++ + } + if field.attrs.len > 0 { + f.write(strings.repeat(` `, comment_aligns[comment_align_i].max_len - attrs_len)) + } else if field.has_expr { + f.write(strings.repeat(` `, comment_aligns[comment_align_i].max_len - field.expr.str().len - 2)) + } else { + f.write(strings.repeat(` `, comment_aligns[comment_align_i].max_len - field.name.len)) + } + f.write(' ') + f.comments(field.comments, same_line: true, has_nl: false) + } f.writeln('') f.comments(field.next_comments, has_nl: true, level: .indent) } diff --git a/vlib/v/fmt/tests/enum_attrs_comments_keep.vv b/vlib/v/fmt/tests/enum_attrs_comments_keep.vv new file mode 100644 index 0000000000..abb679edf4 --- /dev/null +++ b/vlib/v/fmt/tests/enum_attrs_comments_keep.vv @@ -0,0 +1,11 @@ +enum Color { + red @[RED] // first attribute + blue @[BLUE] // second attribute +} + +fn main() { + $for e in Color.values { + println(e.name) + println(e.attrs) + } +} diff --git a/vlib/v/fmt/tests/enum_values_comments_keep.vv b/vlib/v/fmt/tests/enum_values_comments_keep.vv new file mode 100644 index 0000000000..b13db45167 --- /dev/null +++ b/vlib/v/fmt/tests/enum_values_comments_keep.vv @@ -0,0 +1,22 @@ +pub enum KeyCode { + invalid = 0 + space = 32 + apostrophe = 39 //' + comma = 44 //, + minus = 45 //- + period = 46 //. + slash = 47 /// + semicolon = 59 //; + equal = 61 //= + left_bracket = 91 //[ + backslash = 92 //\ + right_bracket = 93 //] + grave_accent = 96 //` + world_1 = 161 // non-us #1 + world_2 = 162 // non-us #2 + escape = 256 + enter = 257 +} + +fn main() { +} diff --git a/vlib/v/gen/native/arm64.v b/vlib/v/gen/native/arm64.v index 3914c22a73..f3a06249a1 100644 --- a/vlib/v/gen/native/arm64.v +++ b/vlib/v/gen/native/arm64.v @@ -6,16 +6,16 @@ module native import v.ast enum Arm64Register { - x0 // v---- - x1 // | - x2 // | - x3 // | parameter and result registers - x4 // | - x5 // | - x6 // | - x7 // ^---- - x8 // XR - indirect result location register - x9 // v---- + x0 // v---- + x1 // | + x2 // | + x3 // | parameter and result registers + x4 // | + x5 // | + x6 // | + x7 // ^---- + x8 // XR - indirect result location register + x9 // v---- x10 // | x11 // | x12 // | caller saved registers diff --git a/vlib/v/gen/native/pe.v b/vlib/v/gen/native/pe.v index 181253896d..6b9ea8d4f3 100644 --- a/vlib/v/gen/native/pe.v +++ b/vlib/v/gen/native/pe.v @@ -92,7 +92,7 @@ enum PeMagic as u16 { // reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format?redirectedfrom=MSDN#windows-subsystem enum PeSubsystem as u16 { - unknown = 0 + unknown = 0 native windows_gui windows_cui diff --git a/vlib/v/parser/tmpl.v b/vlib/v/parser/tmpl.v index 9ee2ddd495..9dc5066ac8 100644 --- a/vlib/v/parser/tmpl.v +++ b/vlib/v/parser/tmpl.v @@ -14,8 +14,8 @@ enum State { // for example for interpolating arbitrary source code (even V source) templates. // html // default, only when the template extension is .html - css //