Commit graph

335 commits

Author SHA1 Message Date
David Tolnay
a59ca716e8
Change yaml_mark_t.index to count bytes not codepoints 2022-07-23 01:11:07 -07:00
David Tolnay
c7752de455
Reduce addr_of_mut usage in scanner macros 2022-07-23 01:10:58 -07:00
David Tolnay
3d30605f5b
Delegate WRITE and WRITE_BREAK macros to function 2022-07-23 01:10:57 -07:00
David Tolnay
e73ae32cec
Replace PUT_BREAK macro with function 2022-07-23 01:10:56 -07:00
David Tolnay
473f07b9f1
Replace PUT macro with function 2022-07-23 01:10:56 -07:00
David Tolnay
65b156d981
Remove yaml_char_t conversion from PUT arg 2022-07-23 01:10:55 -07:00
David Tolnay
4d9cd1d6b2
Replace FLUSH macro with function 2022-07-23 01:10:54 -07:00
David Tolnay
69a3671ee4
Replace SKIP_TOKEN macro with function 2022-07-23 01:10:54 -07:00
David Tolnay
96b8563adb
Ignore while_immutable_condition clippy false positive
https://github.com/rust-lang/rust-clippy/issues/3548

    error: variables in the condition are not mutated in the loop body
        --> src/scanner.rs:1031:15
         |
    1031 |           while CHECK!((*parser).buffer, b' ')
         |  _______________^
    1032 | |             || ((*parser).flow_level != 0 || (*parser).simple_key_allowed == 0)
    1033 | |                 && CHECK!((*parser).buffer, b'\t')
         | |__________________________________________________^
         |
         = note: `-D clippy::while-immutable-condition` implied by `-D clippy::all`
         = note: this may lead to an infinite or to a never running loop
         = note: this loop contains `return`s or `break`s
         = help: rewrite it as `if cond { loop { } }`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_immutable_condition

    error: variables in the condition are not mutated in the loop body
        --> src/macros.rs:138:9
         |
    138  |         *$string.pointer >= b'0' && *$string.pointer <= b'9'
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
        ::: src/scanner.rs:1319:11
         |
    1319 |     while IS_DIGIT!((*parser).buffer) {
         |           --------------------------- in this macro invocation
         |
         = note: this may lead to an infinite or to a never running loop
         = note: this loop contains `return`s or `break`s
         = help: rewrite it as `if cond { loop { } }`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_immutable_condition
         = note: this error originates in the macro `IS_DIGIT` (in Nightly builds, run with -Z macro-backtrace for more info)
2022-07-23 01:10:53 -07:00
David Tolnay
5b459eb8fe
Replace PEEK_TOKEN macro with function 2022-07-23 01:10:52 -07:00
David Tolnay
76c107d6a5
Replace CACHE macro with function 2022-07-23 01:10:52 -07:00
David Tolnay
3b233d13a2
Delegate READ and READ_LINE macros to function 2022-07-23 01:10:51 -07:00
David Tolnay
f6bdfbdabe
Replace SKIP_LINE macro with function 2022-07-23 01:10:51 -07:00
David Tolnay
170745c295
Replace SKIP macro with function 2022-07-23 01:10:50 -07:00
David Tolnay
58824ef3b3
Clean up COPY macro implementation 2022-07-23 01:10:49 -07:00
David Tolnay
0358f5b077
Reduce integer casting in macros 2022-07-23 01:10:49 -07:00
David Tolnay
924ba2d634
Simplify MOVE macro 2022-07-23 01:10:48 -07:00
David Tolnay
c5de022daa
Replace NULL_STRING macro with const 2022-07-23 01:10:47 -07:00
David Tolnay
e245fc53a8
Remove yaml_char_t conversion from CHECK args 2022-07-23 01:10:43 -07:00
David Tolnay
c52336a746
Delete unused macros 2022-07-23 01:09:56 -07:00
David Tolnay
e7ea1987ba
Clean up yaml_char_t casts 2022-07-23 01:09:53 -07:00
David Tolnay
049c8c1f6a
Factor out CHECK macro 2022-07-23 01:09:29 -07:00
David Tolnay
2e94cd3bdb
Factor out CHECK_AT macro 2022-07-22 19:03:36 -07:00
David Tolnay
d9917668b4
Factor out WIDTH macro 2022-07-22 18:37:14 -07:00
David Tolnay
440e55a6af
Factor out WIDTH_AT macro 2022-07-22 18:32:04 -07:00
David Tolnay
5305f1811a
Factor out IS_SPACE_AT macro 2022-07-22 18:30:00 -07:00
David Tolnay
fe99a3a5e1
Factor out IS_SPACE macro 2022-07-22 18:27:25 -07:00
David Tolnay
7415f3bfdf
Factor out IS_Z macro 2022-07-22 18:23:23 -07:00
David Tolnay
531dbb76e6
Factor out IS_BOM macro 2022-07-22 18:19:56 -07:00
David Tolnay
6893ddc2b0
Factor out IS_TAB macro 2022-07-22 18:17:47 -07:00
David Tolnay
c0143fb033
Factor out IS_CRLF macro 2022-07-22 18:14:39 -07:00
David Tolnay
76c4b57280
Factor out IS_BREAK_AT macro 2022-07-22 18:12:16 -07:00
David Tolnay
048e47b1c5
Factor out IS_BREAK macro 2022-07-22 18:11:43 -07:00
David Tolnay
5281c57de4
Factor out IS_BREAKZ macro 2022-07-22 17:47:34 -07:00
David Tolnay
a1469c85c2
Factor out IS_PRINTABLE macro 2022-07-22 17:39:55 -07:00
David Tolnay
7b299dfb83
Factor out IS_ASCII macro 2022-07-22 17:37:42 -07:00
David Tolnay
c968eba61d
Factor out AS_HEX_AT macro 2022-07-22 17:34:39 -07:00
David Tolnay
3c60f9818c
Factor out IS_HEX_AT macro 2022-07-22 17:30:22 -07:00
David Tolnay
e776070311
Factor out AS_DIGIT macro 2022-07-22 17:26:29 -07:00
David Tolnay
ff255cac45
Factor out IS_DIGIT macro 2022-07-22 17:24:23 -07:00
David Tolnay
64b1340f82
Factor out IS_ALPHA macro 2022-07-22 17:20:57 -07:00
David Tolnay
8d296adca8
Factor out STACK_LIMIT macro 2022-07-22 17:13:25 -07:00
David Tolnay
929613027b
Factor out STACK_EMPTY macro 2022-07-22 17:07:14 -07:00
David Tolnay
c4448a4c90
Factor out QUEUE_EMPTY macro 2022-07-22 17:00:18 -07:00
David Tolnay
268489873b
Factor out POP macro 2022-07-22 16:56:00 -07:00
David Tolnay
4ace40883b
Factor out QUEUE_DEL macro 2022-07-22 15:30:05 -07:00
David Tolnay
ee70411948
Factor out STACK_DEL macro 2022-07-22 15:27:04 -07:00
David Tolnay
8974a256ed
Factor out QUEUE_INIT macro 2022-07-22 15:12:32 -07:00
David Tolnay
53fa781673
Factor out STACK_INIT macro 2022-07-22 15:06:55 -07:00
David Tolnay
4af3513623
Factor out DEQUEUE macro 2022-07-22 14:36:25 -07:00