You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the strengths of the Erlang bit syntax is that they can be used for pattern matching to implement a parser. Would this work with a syntax extension?
We have binary literals, and I agree that this should be a syntax extension. We also have loadable syntax extensions now, and I'm not sure that this should be included in the standard library by default, so closing.
Here's a first pass of a language extension I wrote that allows you to pattern match binaries/bitstrings modeled after Erlang's byte matching functionality: https://crates.io/crates/match_bytes
Activity
pcwalton commentedon Mar 12, 2013
I feel as though this should probably be a syntax extension.
jeltz commentedon May 30, 2013
One of the strengths of the Erlang bit syntax is that they can be used for pattern matching to implement a parser. Would this work with a syntax extension?
thestinger commentedon Sep 2, 2013
This is still unimplemented.
alexcrichton commentedon Feb 1, 2014
We have binary literals, and I agree that this should be a syntax extension. We also have loadable syntax extensions now, and I'm not sure that this should be included in the standard library by default, so closing.
alexcrichton commentedon Oct 5, 2014
One was actually created recently as well!
rust-lang/rfcs#346
Auto merge of rust-lang#5380 - lzutao:deprecate-REPLACE_CONSTS, r=pha…
masonforest commentedon Jan 29, 2023
Here's a first pass of a language extension I wrote that allows you to pattern match binaries/bitstrings modeled after Erlang's byte matching functionality: https://crates.io/crates/match_bytes
Merge pull request rust-lang#5346 from rust-lang/rustup-2026-09-25