Nigel Tao
82ea1985b4
base: add optional_u63 type
2023-11-19 12:02:24 +11:00
Patrick Georgi
f563f32f82
Add SPDX identifier to license headers
...
SPDX is an ISO standard for describing licenses in a computer readable
format, which is useful when applying license compliance tools and the
like to source code.
In addition to ensuring that the Wuffs C distribution is properly
annotated to the benefit of projects using Wuffs and SPDX-supporting
tools, add it everywhere else where there's a license in this repo for
consistency, too.
2023-10-06 20:52:36 +02:00
Nigel Tao
74a6ea2fcd
all: relicense from Apache2 to dual Apache2/MIT
...
The LICENSE has changed from a single license (Apache2) to a dual
license (Apache2 or MIT, at your option).
If you've previously used Wuffs under the Apache2 license, you are able
to keep doing so. No further action required by you.
The two files listed below (previous releases) are exceptions, as they
are older snapshots, frozen in time. Their license has not changed:
release/c/wuffs-v0.2.c
release/c/wuffs-v0.3.c
Every name in the AUTHORS file, other than Google Inc., has signed
Google's CLA (Contributor License Agreement).
2023-10-06 10:00:59 +11:00
Nigel Tao
5fb82e7d0a
std: add compact_retaining, history_retain_length
2023-10-05 13:24:44 +11:00
Nigel Tao
4dfd70928b
std: add "get_quirk(key: u32) u64"
2023-07-16 12:04:09 +10:00
Nigel Tao
6e84987d33
std: change set_quirk_enabled to set_quirk
2023-04-14 21:42:15 +10:00
Nigel Tao
49fa501f0d
lang/parse: struct private data now needs a "+"
2023-04-09 15:45:06 +10:00
Nigel Tao
f5eb38d76e
wuffsfmt: indent with 4 spaces (not a tab)
2023-04-09 15:28:07 +10:00
Nigel Tao
9c03b8c71d
wuffsfmt: double-indents hanging lines
2023-04-09 15:22:25 +10:00
Nigel Tao
7b51266642
Remove redundant json decode_comment "while true"
2022-01-25 21:26:27 +11:00
Nigel Tao
5a93c63f0a
Tweak json.decoder.decode_comment
2022-01-25 21:24:54 +11:00
Nigel Tao
656c0bdf92
Remove some redundant assignments after yields
2022-01-25 20:37:50 +11:00
Nigel Tao
b374b2b34f
Tweak json decode_trailer whitespace_length var
2022-01-25 20:36:10 +11:00
Nigel Tao
ad46513ded
Remove some redundant assignments after yields
2022-01-25 20:25:46 +11:00
Nigel Tao
77f855206d
Have JSON line-comment tokens exclude the "\n"
...
Before this commit, line-comment token chains included the final "\n"
the way block-comments included the final "*/". The "\n" was mandatory.
However, when parsing with both QUIRK_ALLOW_COMMENT_LINE and
QUIRK_ALLOW_TRAILING_FILLER, input like "123//xyz" (without a "\n"
before the EOF) was rejected before and accepted after this commit.
So that line-comments are consistent, in that they either always or
never include the final "\n", they now never include the final "\n".
An input fragment (parsed with QUIRK_ALLOW_COMMENT_LINE) like
"//abc\n\t\t" was, before this commit, parsed as a 6 byte comment token
and a 2 byte other-filler token. That split is now 5+3.
2021-07-20 14:17:09 +10:00
Nigel Tao
cd4cbc9102
Tweak JSON trailing comment/new-line quirks
2020-09-22 23:03:49 +10:00
Nigel Tao
fa50f4de67
Add json QUIRK_ALLOW_TRAILING_COMMENT
2020-09-21 11:24:22 +10:00
Nigel Tao
6c13877688
Drop WUFFS_JSON__QUIRK_ALLOW_BACKSLASH_X_AS_BYTES
...
We can always add it back later if there's demand for it.
2020-08-30 16:15:35 +10:00
Nigel Tao
6bc3f5716d
Add "#json: bad new-line in a string"
2020-08-29 23:23:15 +10:00
Nigel Tao
4284369bb8
Add TOKEN__VBD__FILLER__PUNCTUATION
2020-08-17 16:48:30 +10:00
Nigel Tao
be8542e313
Rename I/O available methods to length
2020-08-13 23:26:08 +10:00
Nigel Tao
7a5e89115d
Fix -Werror=conversion in std/json decode_tokens
2020-08-06 23:55:03 +10:00
Nigel Tao
1adbc9547f
Split std/json's QUIRK_ALLOW_BACKSLASH_X in two
2020-08-06 23:28:07 +10:00
Nigel Tao
84bb3afd87
Lower json.DECODER_NUMBER_LENGTH_MAX_INCL to 99
...
Commit b9f69264a0 "Raise
json.DECODER_NUMBER_LENGTH_MAX_INCL to 2047" might have regressed the
std/json benchmarks.
2020-07-07 23:29:30 +10:00
Nigel Tao
b9f69264a0
Raise json.DECODER_NUMBER_LENGTH_MAX_INCL to 2047
2020-07-07 23:08:11 +10:00
Nigel Tao
b9afc26387
Add TOKEN__VBD__STRING__CHAIN_ETC
2020-07-03 13:36:13 +10:00
Nigel Tao
4e2d0c1e5f
Cgen explicit type cast for (CONSTANT >> x)
2020-06-10 10:32:13 +10:00
Nigel Tao
66b0a12b6c
Add json.EXPECT_ETC constants
2020-06-09 23:50:35 +10:00
Nigel Tao
3d31ac03eb
Add base.TOKEN__ETC constants
2020-06-09 23:34:42 +10:00
Nigel Tao
8b70ad0565
Rename skip32 to skip_u32
2020-05-27 23:29:20 +10:00
Nigel Tao
e39f3cbf42
Redo Wuffs structs' quirk bool fields
2020-04-14 23:03:18 +10:00
Nigel Tao
80071730a3
Add std/json CLASS_XXX constants
2020-04-13 16:06:16 +10:00
Nigel Tao
74871344f0
Capitalize Wuffs const names
2020-04-13 15:52:36 +10:00
Nigel Tao
496e88b6c5
Remove wuffs_base__token__link_prev
2020-04-09 22:11:08 +10:00
Nigel Tao
d83bd8d036
Add std/json quirk_allow_ascii_control_codes
2020-04-07 17:50:47 +10:00
Nigel Tao
6f67bbc4b2
Add std/json quirk_allow_backslash_new_line
2020-04-07 17:24:31 +10:00
Nigel Tao
2db72dabe5
Re-assign JSON quirk numbers
2020-04-07 17:17:54 +10:00
Nigel Tao
88a449e3d7
Add perf comment to json.decoder.decode_string
2020-04-04 11:41:09 +11:00
Nigel Tao
695a72a37c
Roll back 'factor out json.decoder.decode_string'
...
See the previous commit for the rationale.
2020-04-04 11:32:35 +11:00
Nigel Tao
86d3b89f9a
Factor out json.decoder.decode_string
...
This commit will soon be followed by a rollback, but it is committed
anyway so that we can refer to these numbers in the git log.
name old speed new speed delta
wuffs_json_decode_1k/clang5 607MB/s ± 0% 543MB/s ± 1% -10.68% (p=0.008 n=5+5)
wuffs_json_decode_21k_formatted/clang5 330MB/s ± 2% 320MB/s ± 3% ~ (p=0.056 n=5+5)
wuffs_json_decode_26k_compact/clang5 468MB/s ± 2% 434MB/s ± 1% -7.26% (p=0.008 n=5+5)
wuffs_json_decode_217k_stringy/clang5 391MB/s ± 1% 363MB/s ± 0% -7.03% (p=0.008 n=5+5)
wuffs_json_decode_1k/gcc7 715MB/s ± 0% 583MB/s ± 0% -18.38% (p=0.016 n=5+4)
wuffs_json_decode_21k_formatted/gcc7 403MB/s ± 0% 350MB/s ± 0% -12.94% (p=0.016 n=5+4)
wuffs_json_decode_26k_compact/gcc7 534MB/s ± 0% 420MB/s ± 1% -21.41% (p=0.008 n=5+5)
wuffs_json_decode_217k_stringy/gcc7 435MB/s ± 0% 359MB/s ± 0% -17.44% (p=0.008 n=5+5)
2020-04-04 11:32:35 +11:00
Nigel Tao
ecd3285567
Simplify a std/json while as an if
2020-04-03 12:35:18 +11:00
Nigel Tao
3fe3f84106
Add double-curly blocks
2020-04-02 21:56:53 +11:00
Nigel Tao
3456f39f9d
Rename token_writer.write_fast_token
2020-04-02 12:26:57 +11:00
Nigel Tao
7edf71414f
Fix std/json replace_invalid_unicode copy/pasto
...
Updates https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21465
2020-03-31 22:37:43 +11:00
Nigel Tao
f3146c2ea9
Add base.token_decoder.workbuf_len
2020-03-26 08:47:42 +11:00
Nigel Tao
40d200cdab
Drop cached expr MBounds when re-checking asserts
...
Updates https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21371
2020-03-26 08:14:43 +11:00
Nigel Tao
58351d44da
Make endwhile mandatory for nameless loops
2020-03-25 21:40:00 +11:00
Nigel Tao
9e50918718
Add single-quoted strings
2020-03-25 19:41:02 +11:00
Nigel Tao
3bfed6d812
Rename std/json quirk_replace_invalid_utf_8
2020-03-24 17:44:47 +11:00
Nigel Tao
2ca0ef7bd5
Rename some std/json variables
2020-03-24 14:02:08 +11:00