Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
043bb50
Initial prototype
cenodis Aug 14, 2021
6230ff9
Update docs
cenodis Aug 15, 2021
4ef9c79
More doc updates
cenodis Aug 15, 2021
6e210f1
Add feature flags for Vec
cenodis Aug 15, 2021
4d7b464
Add basic tests
cenodis Aug 15, 2021
e350e49
Fix formatting
cenodis Aug 15, 2021
302b021
Add precedence to choosing_a_combinator.md
cenodis Aug 15, 2021
98df3b6
Fix typo
cenodis Aug 15, 2021
859b23e
Minor refractoring
cenodis Aug 15, 2021
b412fb7
Update docs
cenodis Aug 15, 2021
68135e3
Change parameter order
cenodis Aug 15, 2021
7f99f1a
Add alloc feature to the entire precedence module
cenodis Aug 17, 2021
1480d0f
Use fail parser to express "no operators of this type"
cenodis Aug 17, 2021
3f6f2b2
Document evaluation order
cenodis Aug 17, 2021
1018888
Better documentation for parameters
cenodis Aug 17, 2021
8d50cf6
Fix precedence in documentation
cenodis Aug 17, 2021
1d64103
Fix doc formatting
cenodis Aug 17, 2021
3770929
Fix typos
cenodis Aug 17, 2021
46c7039
Use map_res when parsing integers
cenodis Aug 18, 2021
bcd6fd0
Example test for expressions with function calls and AST generation
cenodis Aug 18, 2021
10bdd3d
Typo
cenodis Aug 18, 2021
e5b722d
Make evaluation a bit easier to read
cenodis Aug 18, 2021
7dcd9bc
Update expression_ast
cenodis Aug 18, 2021
1a4c423
Update expression_ast doc
cenodis Aug 18, 2021
ea761e6
Implement ternary operator in expression_ast
cenodis Aug 19, 2021
cd37e16
Shorten ast nodes
cenodis Aug 19, 2021
c21b00f
Implement some tests for parser failures
cenodis Aug 19, 2021
ae7c6cf
Update feature flags for docs
cenodis Aug 19, 2021
355a74b
Properly append errors
cenodis Aug 19, 2021
36e9182
Properly bubble up non Error errors
cenodis Aug 19, 2021
d5cabef
Split operators into 3 distinct types to help with exhaustiveness che…
cenodis Mar 4, 2022
37d3164
Merge branch 'main' into feature_precedence
Geal Dec 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ name = "css"
[[test]]
name = "custom_errors"

[[test]]
name = "expression_ast"
required-features = ["alloc"]

[[test]]
name = "float"

Expand Down
1 change: 1 addition & 0 deletions doc/choosing_a_combinator.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ The following parsers could be found on [docs.rs number section](https://docs.rs

- [`escaped`](https://docs.rs/nom/latest/nom/bytes/complete/fn.escaped.html): Matches a byte string with escaped characters
- [`escaped_transform`](https://docs.rs/nom/latest/nom/bytes/complete/fn.escaped_transform.html): Matches a byte string with escaped characters, and returns a new string with the escaped characters replaced
- [`precedence`](https://docs.rs/nom/latest/nom/precedence/fn.precedence.html): Parses an expression with regards to operator precedence

## Binary format parsing

Expand Down
3 changes: 3 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ pub enum ErrorKind {
Fail,
Many,
Fold,
Precedence,
}

#[rustfmt::skip]
Expand Down Expand Up @@ -601,6 +602,7 @@ pub fn error_to_u32(e: &ErrorKind) -> u32 {
ErrorKind::Many => 76,
ErrorKind::Fold => 77,
ErrorKind::BinDigit => 78,
ErrorKind::Precedence => 79,
}
}

Expand Down Expand Up @@ -666,6 +668,7 @@ impl ErrorKind {
ErrorKind::Fail => "Fail",
ErrorKind::Many => "Many",
ErrorKind::Fold => "Fold",
ErrorKind::Precedence => "Precedence",
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ pub mod bytes;

pub mod character;

pub mod precedence;

mod str;

pub mod number;
Expand Down
Loading