diff --git a/src/amply/amply.py b/src/amply/amply.py index 7ebe016..68e2028 100644 --- a/src/amply/amply.py +++ b/src/amply/amply.py @@ -610,7 +610,7 @@ def mark_transposed(tokens): # What follows is a Pyparsing description of the grammar index = Word(alphanums, exact=1) -symbol = Word(alphanums, bodyChars=alphanums + "_", min=1) +symbol = Word(alphanums + "_", bodyChars=alphanums + "_", min=1) sign = Optional(oneOf("+ -")) integer = Combine(sign + Word(nums)).setParseAction(lambda t: int(t[0])) number = Combine( diff --git a/tests/test_amply.py b/tests/test_amply.py index 9c7d9a9..f212298 100644 --- a/tests/test_amply.py +++ b/tests/test_amply.py @@ -1,8 +1,8 @@ +import pytest + import unittest from io import StringIO -import pytest - from amply import amply from amply.amply import ( number, @@ -79,7 +79,6 @@ def test_not_symbol(self): 0.234 +1e-049 skj!adfk - __12 """ result = symbol.runTests(fixture, failureTests=True) assert result[0] @@ -227,7 +226,7 @@ def test_from_file(self): try: s = StringIO("param T:= 4;") except TypeError: - s = StringIO(u"param T:= 4;") + s = StringIO("param T:= 4;") assert amply.Amply.from_file(s).T == 4 def test_load_string(self): @@ -242,7 +241,7 @@ def test_load_file(self): try: s = StringIO("param S := 6; param X := 1 2;") except TypeError: - s = StringIO(u"param S := 6; param X := 1 2;") + s = StringIO("param S := 6; param X := 1 2;") a.load_file(s) assert a.T == 4 assert a.S == 6