Commit Graph
118 Commits
Author SHA1 Message Date
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 ea3fbc37f5 lang: change const array to const roarray 2023-04-10 16:06:10 +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 904004e79a Let non-strict JSON Pointer syntax allow "~t" 2020-11-15 20:56:04 +11:00
Nigel Tao 178c6422b7 Delete deprecated JSON quirks 2020-09-24 12:46:00 +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 2912ea8e28 Re-assign JSON quirk numbers 2020-09-21 10:30:46 +10:00
Nigel Tao a06a89c080 Add link to previous commit (BACKSLASH_X_AS_BYTES) 2020-08-30 21:14:11 +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 b3438434ca Add json QUIRK_JSON_POINTER_ALLOW_TILDE_R_TILDE_N 2020-08-13 00:06:56 +10:00
Nigel Tao 28ef6a7862 Add fuzz/c/std/cbor_fuzzer.c 2020-08-10 22:29: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 1f424b2ea7 Propagate const-values to idents of consts 2020-04-16 09:37:05 +10:00
Nigel Tao e39f3cbf42 Redo Wuffs structs' quirk bool fields 2020-04-14 23:03:18 +10:00
Nigel Tao 532e18c4a5 Add colons to const syntax 2020-04-14 14:57:30 +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 df3acfbb21 Clarify std/json quirk_allow_backslash_x semantics 2020-04-08 11:08:01 +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