Skip to content

Commit

Permalink
Add support for sub variables split with .
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Oct 15, 2018
1 parent 3a513c2 commit 5afa318
Showing 1 changed file with 2 additions and 2 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

0 comments on commit 5afa318

Please sign in to comment.