Skip to content

Commit

Permalink
Fix an error in the Optional element class
Browse files Browse the repository at this point in the history
The default decode value is used correctly now.
  • Loading branch information
drmfinlay committed Jul 19, 2022
1 parent 97322c6 commit df83b6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dragonfly/grammar/elements_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,13 @@ def value(self, node):
"""
The *value* of a :class:`Optional` is the value of its child,
if the child did match the recognition. Otherwise the
*value* is *None*.
*value* is *None* (default).
"""
if node.children:
return node.children[0].value()
else:
return None
return self.default


#---------------------------------------------------------------------------
Expand Down

0 comments on commit df83b6a

Please sign in to comment.