[Pyparsing] escape sequences in identifiers
Brought to you by:
ptmcg
From: Diez B. R. <de...@we...> - 2010-04-02 13:12:38
|
Hi, I'm using pyparsing to parse CSS. Now I've encountered css-classes with dots in them the first time - so I need to extend my identifier definition to encompass backslash escapes. This test-program illustrates my problem. Or at least some problem, my real code throws for the same testcase an exception: ====================================================================== ERROR: Tests that various parts of the grammer parse ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/deets/projects/privat/TurboGears/ablcssprocessor/tests/ test_parser.py", line 42, in test_subexpressions (r'foo\.bar', [r"foo\.bar"]), File "/Users/deets/projects/privat/TurboGears/ablcssprocessor/tests/ test_parser.py", line 27, in parse result = g.parseString(test, True).asList() File "/Users/deets/.virtualenvs2.5/cssprocessor/lib/python2.5/site- packages/pyparsing-1.5.2-py2.5.egg/pyparsing.py", line 1076, in parseString raise exc ParseException: Expected end of text (at char 4), (line:1, col:5) ---------------------------------------------------------------------- Any suggestions how to deal with this? Thanks, Diez |