Fixed Issue #14.
This commit is contained in:
		
							
								
								
									
										3
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								CHANGES
									
									
									
									
									
								
							@@ -1,5 +1,8 @@
 | 
				
			|||||||
Version 0.4
 | 
					Version 0.4
 | 
				
			||||||
-----------
 | 
					-----------
 | 
				
			||||||
 | 
					9/8/2018   Fixed Issue #14.  YaccProduction index property causes
 | 
				
			||||||
 | 
					           AttributeError if index is 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
9/5/2018   Added support for getattr() and related functions on
 | 
					9/5/2018   Added support for getattr() and related functions on
 | 
				
			||||||
           productions.
 | 
					           productions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -139,7 +139,7 @@ class YaccProduction:
 | 
				
			|||||||
            if isinstance(tok, YaccSymbol):
 | 
					            if isinstance(tok, YaccSymbol):
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
            index = getattr(tok, 'index', None)
 | 
					            index = getattr(tok, 'index', None)
 | 
				
			||||||
            if index:
 | 
					            if index is not None:
 | 
				
			||||||
                return index
 | 
					                return index
 | 
				
			||||||
        raise AttributeError('No index attribute found')
 | 
					        raise AttributeError('No index attribute found')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user