mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-11-04 13:38:31 +00:00 
			
		
		
		
	Put leading | in patterns under OrPat
				
					
				
			Previously it was one level above, and that caused problems with macros that expand to it, because macros expect to get only one top-level node.
This commit is contained in:
		
							parent
							
								
									6a67a4d3cd
								
							
						
					
					
						commit
						e12a001b55
					
				
					 11 changed files with 87 additions and 31 deletions
				
			
		| 
						 | 
				
			
			@ -195,6 +195,38 @@ fn macro_pattern() {
 | 
			
		|||
            error 0: expected pattern
 | 
			
		||||
        "#]],
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    check(
 | 
			
		||||
        TopEntryPoint::Pattern,
 | 
			
		||||
        "| 42 | 43",
 | 
			
		||||
        expect![[r#"
 | 
			
		||||
            OR_PAT
 | 
			
		||||
              PIPE "|"
 | 
			
		||||
              WHITESPACE " "
 | 
			
		||||
              LITERAL_PAT
 | 
			
		||||
                LITERAL
 | 
			
		||||
                  INT_NUMBER "42"
 | 
			
		||||
              WHITESPACE " "
 | 
			
		||||
              PIPE "|"
 | 
			
		||||
              WHITESPACE " "
 | 
			
		||||
              LITERAL_PAT
 | 
			
		||||
                LITERAL
 | 
			
		||||
                  INT_NUMBER "43"
 | 
			
		||||
        "#]],
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    check(
 | 
			
		||||
        TopEntryPoint::Pattern,
 | 
			
		||||
        "| 42",
 | 
			
		||||
        expect![[r#"
 | 
			
		||||
            OR_PAT
 | 
			
		||||
              PIPE "|"
 | 
			
		||||
              WHITESPACE " "
 | 
			
		||||
              LITERAL_PAT
 | 
			
		||||
                LITERAL
 | 
			
		||||
                  INT_NUMBER "42"
 | 
			
		||||
        "#]],
 | 
			
		||||
    );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[test]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue