Skip to content

Commit

Permalink
[Naga] replace unicode-xid with unicode-ident (#7135)
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyboyQCD authored Feb 15, 2025
1 parent 723abcb commit a45e2db
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ By @brodycj in [#6924](https://github.com/gfx-rs/wgpu/pull/6924).
- Improve efficiency of dropping read-only buffer mappings. By @kpreid in [#7007](https://github.com/gfx-rs/wgpu/pull/7007).
### Performance
#### Naga
- Replace `unicode-xid` with `unicode-ident`. By @CrazyboyQCD in [#7135](https://github.com/gfx-rs/wgpu/pull/7135)
### Documentation
- Improved documentation around pipeline caches and `TextureBlitter`. By @DJMcNab in [#6978](https://github.com/gfx-rs/wgpu/pull/6978) and [#7003](https://github.com/gfx-rs/wgpu/pull/7003).
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions naga/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spv-out = ["dep:spirv"]
wgsl-in = [
"dep:hexf-parse",
"dep:strum",
"dep:unicode-xid",
"dep:unicode-ident",
"indexmap/std",
"compact",
]
Expand Down Expand Up @@ -97,7 +97,7 @@ serde = { version = "1.0.217", features = [
petgraph = { version = "0.7", optional = true }
pp-rs = { version = "0.2.1", optional = true }
hexf-parse = { version = "0.2.1", optional = true }
unicode-xid = { version = "0.2.6", optional = true }
unicode-ident = { version = "1.0", optional = true }

[build-dependencies]
cfg_aliases.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions naga/src/front/wgsl/parse/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ const fn is_blankspace(c: char) -> bool {

/// Returns whether or not a char is a word start (Unicode XID_Start + '_')
fn is_word_start(c: char) -> bool {
c == '_' || unicode_xid::UnicodeXID::is_xid_start(c)
c == '_' || unicode_ident::is_xid_start(c)
}

/// Returns whether or not a char is a word part (Unicode XID_Continue)
fn is_word_part(c: char) -> bool {
unicode_xid::UnicodeXID::is_xid_continue(c)
unicode_ident::is_xid_continue(c)
}

#[derive(Clone)]
Expand Down

0 comments on commit a45e2db

Please sign in to comment.