forked from mirrors/jj
revset: move whitespace rule to top
The whitespace rule is a bit special, and it seemed weird that the rule is defined between literals and operator tokens.
This commit is contained in:
parent
c8f93c50fc
commit
7f1f73b0fa
2 changed files with 3 additions and 3 deletions
|
@ -12,6 +12,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
whitespace = _{ " " | "\t" | "\r" | "\n" | "\x0c" }
|
||||
|
||||
identifier_part = @{ (ASCII_ALPHANUMERIC | "_" | "/")+ }
|
||||
identifier = @{
|
||||
identifier_part ~ ("." | "-" | "+" ) ~ identifier
|
||||
|
@ -27,8 +29,6 @@ string_content_char = @{ !("\"" | "\\") ~ ANY }
|
|||
string_content = @{ string_content_char+ }
|
||||
string_literal = ${ "\"" ~ (string_content | string_escape)* ~ "\"" }
|
||||
|
||||
whitespace = _{ " " | "\t" | "\r" | "\n" | "\x0c" }
|
||||
|
||||
at_op = { "@" }
|
||||
pattern_kind_op = { ":" }
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ impl Rule {
|
|||
fn to_symbol(self) -> Option<&'static str> {
|
||||
match self {
|
||||
Rule::EOI => None,
|
||||
Rule::whitespace => None,
|
||||
Rule::identifier_part => None,
|
||||
Rule::identifier => None,
|
||||
Rule::symbol => None,
|
||||
|
@ -107,7 +108,6 @@ impl Rule {
|
|||
Rule::string_content_char => None,
|
||||
Rule::string_content => None,
|
||||
Rule::string_literal => None,
|
||||
Rule::whitespace => None,
|
||||
Rule::at_op => Some("@"),
|
||||
Rule::pattern_kind_op => Some(":"),
|
||||
Rule::parents_op => Some("-"),
|
||||
|
|
Loading…
Reference in a new issue