mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Rework variable references detection in macro
This commit is contained in:
		
							parent
							
								
									efe67212b0
								
							
						
					
					
						commit
						bf907ee98b
					
				
					 4 changed files with 37 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -851,6 +851,22 @@ module Ameba::Rule
 | 
			
		|||
        )
 | 
			
		||||
        subject.catch(s).should_not be_valid
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      it "doesn't report if assignment is referenced in a macro below" do
 | 
			
		||||
        s = Source.new %(
 | 
			
		||||
          class Foo
 | 
			
		||||
            def foo
 | 
			
		||||
              a = 1
 | 
			
		||||
              macro_call
 | 
			
		||||
            end
 | 
			
		||||
 | 
			
		||||
            macro macro_call
 | 
			
		||||
              puts a
 | 
			
		||||
            end
 | 
			
		||||
          end
 | 
			
		||||
        )
 | 
			
		||||
        subject.catch(s).should be_valid
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    context "uninitialized" do
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue