diff --git a/.travis.yml b/.travis.yml index 3c55ece..8c18230 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,7 @@ python: install: - "pip install ." - "pip install pytest" - - "pip install coveralls" - # Coveralls 4.0 doesn't support Python 3.2 - - if [ "$TRAVIS_PYTHON_VERSION" == "3.2" ]; then pip install coverage==3.7.1; fi - - if [ "$TRAVIS_PYTHON_VERSION" != "3.2" ]; then pip install coverage; fi + - "pip install coverage coveralls" script: coverage run setup.py test after_success: - coveralls diff --git a/jsonpath_rw/lexer.py b/jsonpath_rw/lexer.py index b85b425..aa28ff5 100644 --- a/jsonpath_rw/lexer.py +++ b/jsonpath_rw/lexer.py @@ -61,7 +61,7 @@ def tokenize(self, string): t_ignore = ' \t' def t_ID(self, t): - r'[a-zA-Z_@#][a-zA-Z0-9_@\-]*' + r'[a-zA-Z_@][a-zA-Z0-9_@\-]*' t.type = self.reserved_words.get(t.value, 'ID') return t diff --git a/tests/test_lexer.py b/tests/test_lexer.py index 481215d..9d9fe38 100644 --- a/tests/test_lexer.py +++ b/tests/test_lexer.py @@ -53,7 +53,6 @@ def test_simple_inputs(self): self.assert_lex_equiv('`this`', [self.token('this', 'NAMED_OPERATOR')]) self.assert_lex_equiv('|', [self.token('|', '|')]) self.assert_lex_equiv('where', [self.token('where', 'WHERE')]) - self.assert_lex_equiv('a.#text', [self.token('a', 'ID'), self.token('.', '.'), self.token('#text', 'ID')]) def test_basic_errors(self): def tokenize(s): @@ -67,4 +66,4 @@ def tokenize(s): self.assertRaises(JsonPathLexerError, tokenize, '"`') self.assertRaises(JsonPathLexerError, tokenize, "'`") self.assertRaises(JsonPathLexerError, tokenize, '?') - self.assertRaises(JsonPathLexerError, tokenize, '$.foo.bar.%') + self.assertRaises(JsonPathLexerError, tokenize, '$.foo.bar.#')