Skip to content

Commit

Permalink
Merge pull request #22 from scikit-hep/add-subvariables
Browse files Browse the repository at this point in the history
Add rudimentary support for nested variables
  • Loading branch information
chrisburr authored Oct 15, 2018
2 parents 3a513c2 + 04b79b3 commit ea7703d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions formulate/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from collections import defaultdict

import pyparsing
from pyparsing import Literal, Suppress, pyparsing_common, opAssoc, Word
from pyparsing import Literal, Suppress, pyparsing_common, opAssoc, Word, delimitedList

from .expression import Expression, Variable, NamedConstant, UnnamedConstant, ExpressionComponent
from .identifiers import order_of_operations
Expand Down Expand Up @@ -268,7 +268,7 @@ class ParsingException(Exception):
def create_parser(config, constants):
EXPRESSION = pyparsing.Forward()

VARIABLE = Word(pyparsing.alphas+'_', pyparsing.alphanums+'_-')
VARIABLE = delimitedList(Word(pyparsing.alphas+'_', pyparsing.alphanums+'_-'), delim='.', combine=True)
VARIABLE.setName('Variable')
VARIABLE.setParseAction(add_logging(lambda string, location, result: Variable(result[0])))

Expand Down
2 changes: 1 addition & 1 deletion formulate/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
]


__version__ = '0.0.7'
__version__ = '0.0.8'
version = __version__
version_info = __version__.split('.')

0 comments on commit ea7703d

Please sign in to comment.