File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2279,8 +2279,13 @@ impl<'i> Parser<'i> {
22792279 for part in parts {
22802280 let trimmed = part. trim_ascii ( ) ;
22812281
2282- // Check if it's a role '@'
2283- if let Some ( captures) = regex ! ( r"^@([a-z][a-z0-9_]*)$" ) . captures ( trimmed) {
2282+ // Check if it's the special @* "reset attribute" role
2283+ if trimmed == "@*" {
2284+ let identifier = Identifier ( "*" ) ;
2285+ attributes. push ( Attribute :: Role ( identifier) ) ;
2286+ }
2287+ // Check if it's a regular role '@'
2288+ else if let Some ( captures) = regex ! ( r"^@([a-z][a-z0-9_]*)$" ) . captures ( trimmed) {
22842289 let role_name = captures
22852290 . get ( 1 )
22862291 . ok_or ( ParsingError :: Expected ( inner. offset , "role name after @" ) ) ?
@@ -2830,7 +2835,8 @@ fn is_string_literal(content: &str) -> bool {
28302835
28312836fn is_attribute_assignment ( input : & str ) -> bool {
28322837 // Matches any combination of @ and ^ attributes separated by +
2833- let re = regex ! ( r"^\s*[@^][a-z][a-z0-9_]*(\s*\+\s*[@^][a-z][a-z0-9_]*)*" ) ;
2838+ // Also matches the special @* "reset to all" role
2839+ let re = regex ! ( r"^\s*(@\*|[@^][a-z][a-z0-9_]*)(\s*\+\s*[@^][a-z][a-z0-9_]*)*" ) ;
28342840 re. is_match ( input)
28352841}
28362842
You can’t perform that action at this time.
0 commit comments