Swastik Baranwal
c7af2c21d1
builtin.string: fix is_upper
and is_lower
with numbers ( #21357 )
2024-04-26 16:20:21 +03:00
Turiiya
8aa9314a99
vlib: refactor empty string checks to use s == ''
or s != ''
, instead of s.len == 0
( #21300 )
2024-04-18 02:44:31 +03:00
Turiiya
27cd1b106e
builtin: cleanup compare_strings
functions ( #21255 )
2024-04-11 22:17:12 +03:00
Felipe Pena
625048c5b4
x.json2,checker,toml: allow field.typ compile-time checking with MatchExpr and add array of option checking ( #21171 )
2024-04-04 12:43:59 +03:00
Alexander Medvednikov
acf0107493
builtin: str.last_index(); pref: hide-auto-str;
2024-03-28 18:26:30 +03:00
Turiiya
f77bb32044
all: fix typos ( #21089 )
2024-03-25 12:18:27 +02:00
Felipe Pena
e6b43a166e
cgen: enable autofree for option ( #21051 )
2024-03-20 08:33:51 +02:00
Kim Shrier
094b0328e5
builtin: fix a few grammar errors in builtin.string comments ( #21010 )
2024-03-13 13:14:50 +02:00
cui fliter
78602846e5
all: fix typos in comments ( #20963 )
2024-03-04 18:41:55 +02:00
Delyan Angelov
a58f980b02
os: workaround a -prod -cc gcc
bug, affecting os.open_file ( fix #20923 ) (related to #20872 ) ( #20960 )
2024-03-04 18:15:28 +02:00
kbkpbot
7fd1b169f3
builtin: add a string.u8_array() method ( #20736 )
2024-02-06 17:53:02 +02:00
Vinicius Silva
3569635eff
builtin: add empty string verification for the new string .is_oct() etc methods, suggested on PR #20540 ( #20564 )
2024-01-17 11:00:07 +02:00
Vinicius Silva
afd74ad6e6
builtin: add is_hex()
, is_int()
, is_bin()
, and is_oct()
methods to the string type ( #20540 )
2024-01-16 23:58:28 +02:00
Anton
763f94388b
all: update copyright year ( #20334 )
2024-01-01 23:29:54 +02:00
Delyan Angelov
4b3109237d
builtin: deprecate string.last_index/1 for string.index_last/1, and string.last_index_u8/1 for string.index_u8_last/1 ( #20095 )
2023-12-05 13:56:59 +02:00
Joe C
757929392e
all: update attributes to use new syntax
2023-11-15 16:16:01 +11:00
Alexander Medvednikov
e7cad4f55d
net,vweb: reduce allocations by ~80%
2023-11-11 01:10:34 +03:00
Artem Yurchenko
97f7c3f609
builtin: move min/max integer values consts from math
to builtin ( #19809 )
2023-11-08 20:43:48 +02:00
Turiiya
1e578b1144
checker: extend byte deprecation warnings to return types ( #19668 )
2023-10-29 14:25:15 +02:00
Turiiya
90ac5dc354
builtin: fix doc comments of string split methods ( #19643 )
2023-10-25 17:13:54 +03:00
Turiiya
9051ac8921
all: fix typos ( #19634 )
2023-10-23 21:21:15 +03:00
Alexander Medvednikov
1f06476343
cgen: fix maps with i32 keys
2023-10-09 00:18:46 +03:00
yuyi
ec30256c7f
builtin: cleanup obsolete function in string.v and array.v ( #19451 )
2023-09-27 19:49:33 +03:00
yuyi
981f76cd04
builtin, cgen: fix printing slice of fn call string ( #19450 )
2023-09-27 14:53:56 +03:00
Ikko Eltociear Ashimine
7e08a50ea5
builtin: fix typo in string.v ( #19431 )
2023-09-24 15:11:47 +03:00
yuyi
815439a381
checker: fix assigning an array slice ( fix #19120 ) ( #19137 )
2023-08-15 20:37:51 +03:00
katekyy
b622dca915
builtin: fix split_nth() and rsplit_nth() on an empty delimeter ( #19005 )
2023-07-30 00:12:51 +03:00
Delyan Angelov
466c80f80a
vlib: remove methods deprecated before 2022-07-22 ( #18944 )
2023-07-22 18:11:12 +03:00
Delyan Angelov
6806086bf1
builtin: zero out internal map/array pointers on m.free(), to reduce the work for the GC mark phase for non escaping maps/arrays, used in hot loops ( #18415 )
2023-06-14 15:00:36 +03:00
Petr Makhnev
9d0a1d8496
builtin: speed up string methods with vmemcpy instead of for
loop for copying data ( #18211 )
2023-05-19 21:24:23 +03:00
Petr Makhnev
a39c26507c
builtin: speed up string concatenation and repeat()
method with vmemcpy instead of for
loop for copying data ( #18206 )
...
These changes almost do not speed up the program with the `-prod` flag,
since modern С compilers can do such optimization on their own, but in
normal mode, the performance gain is from 1.6 (concatenation) to 1.8 (repeat) times.
Concatenation:
Old (`for` loop):
Time (mean): 3.699 s +- 0.071 s [User: 3.629 s, System: 0.069 s]
Range (min ... max): 3.548 s ... 3.741 s 10 runs
New (vmemcpy):
Time (mean): 2.305 s +- 0.065 s [User: 2.263 s, System: 0.041 s]
Range (min ... max): 2.172 s ... 2.355 s 10 runs
`vmemcpy version` ran 1.60 +- 0.05 times faster than 'for loop version'
2023-05-19 16:18:23 +03:00
lapingenieur
f9c186a400
builtin: correct a small documentation mistake ( #17935 )
2023-04-11 12:37:14 +02:00
yuyi
467a1b4435
fmt: remove redundant parenthesis in the complex infix expr ( #17873 )
2023-04-04 13:47:48 +03:00
Alexander Medvednikov
6756d28595
all: 2023 copyright
2023-03-28 22:55:57 +02:00
Delyan Angelov
3793bf1c99
builtin: optimise the common case of s.contains("x")
add s.contains_byte(x)
( #17702 )
2023-03-19 01:10:13 +03:00
ChAoS_UnItY
f02b423f80
builtin: string test refactor, string functions inlining ( #17598 )
2023-03-11 20:44:45 +02:00
ChAoS_UnItY
9fa49da9d5
builtin: add rsplit
functions ( #17577 )
2023-03-11 00:07:02 +01:00
yuyi
17000ef7b6
checker: check option fn returning error ( fix #17423 ) ( #17438 )
2023-03-02 15:49:50 +02:00
Makhnev Petr
17d65db828
builtin: add string.trim_indent()
` method ( #17099 )
2023-01-24 21:41:25 +02:00
Roy Ivy III
5cd074a49e
builtin: improve multi-platform portability for string.split_into_lines()
( #17078 )
2023-01-24 10:02:25 +02:00
Carter
eb88f7e255
builtin: fix bug with string.split_into_lines, when lines have extra CR's at their end ( #16620 )
2022-12-09 09:15:50 +02:00
yuyi
017ace6ea7
vfmt: change all '$expr' to '${expr}' ( #16428 )
2022-11-15 16:53:13 +03:00
Delyan Angelov
9edb48571f
pref,cgen: support -no-bounds-checking
, instead of -d no_bounds_checking
, and make it enable direct_array_access for all fns/methods.
2022-10-30 14:39:45 +02:00
l-m
a139bed785
builtin: add string.trim_indexes method, that can be used in string.trim, but also separately from it ( #16144 )
2022-10-22 12:56:05 +03:00
yuyi
f6844e9766
all: change optional to result of io ( #16075 )
2022-10-16 09:28:57 +03:00
Delyan Angelov
fc8e3d0971
builtin,strconv: speedup str.int()
conversions (without -prod)
2022-09-08 11:28:19 +03:00
Delyan Angelov
4c0339242a
doc: fix example comment for string.strip_margin()
2022-08-14 08:06:52 +03:00
yuyi
6e8350a9c9
fmt: fix interface method with fntype argument ( #15280 )
2022-07-30 14:29:41 +03:00
l-m
10f3c9f127
builtin: add string.replace_char and string.normalize_tabs ( #15239 )
2022-07-27 22:04:39 +03:00
l-m
ed8c63cc0b
builtin: add a contains_only method on string ( #14830 )
2022-06-23 01:41:42 +03:00