Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more special characters #26

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fireball_projectile = Projectile {
```

For just a raw value after `#`, without using braces `{}`, the following characters are accepted:
- Special characters: `!`, `#`, `@`, `%`, `&`, `?`, `.`, `=`, `<`, `>`, `_`, `-`, `+`, `*`
- Special characters: `!`, `#`, `@`, `%`, `&`, `?`, `.`, `=`, `<`, `>`, `_`, `-`, `+`, `*`, `/`, `\`
- Alphabetical numerical characters, see (is_alphanumeric)[https://doc.rust-lang.org/std/primitive.char.html#method.is_alphanumeric].

This list is hardcoded in the library, but the list of special characters could be expanded.
Expand Down Expand Up @@ -285,4 +285,4 @@ ambiguity between variants, the earliest variant will be parsed.

## Using a custom allocator

Bauble has the capability to use a custom allocator through the `BaubleAllocator` trait. With this you can for example allocate values within an arena.
Bauble has the capability to use a custom allocator through the `BaubleAllocator` trait. With this you can for example allocate values within an arena.
2 changes: 1 addition & 1 deletion bauble/src/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub fn parser<'a>() -> impl Parser<'a, &'a str, Values, Error<'a>> {
let literal = just('#').ignore_then(
select! {
c if c.is_alphanumeric() => (),
'!' | '#' | '@' | '%' | '&' | '?' | '.' | '=' | '<' | '>' | '_' | '-' | '+' | '*' => (),
'!' | '#' | '@' | '%' | '&' | '?' | '.' | '=' | '<' | '>' | '_' | '-' | '+' | '*' | '/' | '\\' => (),
}
.repeated()
.to_slice()
Expand Down
Loading