From 6a27431f816e264abf90d4fdc2b4dcec480caccd Mon Sep 17 00:00:00 2001 From: David Beazley Date: Sat, 8 Sep 2018 15:26:00 -0500 Subject: [PATCH] Fixed Issue #14. --- CHANGES | 3 +++ sly/yacc.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 85ab6c7..18e4d93 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ 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 productions. diff --git a/sly/yacc.py b/sly/yacc.py index b6a6710..5e2fa9d 100644 --- a/sly/yacc.py +++ b/sly/yacc.py @@ -139,7 +139,7 @@ class YaccProduction: if isinstance(tok, YaccSymbol): continue index = getattr(tok, 'index', None) - if index: + if index is not None: return index raise AttributeError('No index attribute found')