summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Typo - `isinstance` should be `issubclass`Paul McGuire2019-05-271-1/+1
|
* Fine tuning of statemachine example, moving InvalidStateTransition ↵Paul McGuire2019-05-277-12/+167
| | | | declaration inside generated class; added video state machine demo; added vending machine state machine demo showing how to using statemachine without importing a .pystate file
* Updated runTests to call postParse before dumping parsed results; added ↵Paul McGuire2019-05-263-208/+366
| | | | nested_markup.py and updated delta_time.py (renamed from deltaTime.py) examples
* Fix generated stateMixin class to properly implement overridable transition ↵Paul McGuire2019-04-172-9/+7
| | | | methods instead of messing with getattr; allows use of `super().transition_name()` in classes that subclass from the Mixin
* Added change note re: changes to statemachine example; some code ↵Paul McGuire2019-04-161-1/+13
| | | | reformat/cleanup/commenting in statemachine.py
* Refactor generated State code to use overridden transition methods instead ↵Paul McGuire2019-04-154-78/+117
| | | | of overriding getattr; add generation of state-managing mixin class to delegate to _state instance variable, and reworked demos to use mixin instead of replicating state code
* Code updates to current idiomspyparsing_2.4.0Paul McGuire2019-04-072-54/+117
|
* Improved support for "python setup.py test"Paul McGuire2019-04-071-219/+223
|
* Fixed dict structure in makeHTMLTags expressions, and added tag_body ↵Paul McGuire2019-04-0610-528/+452
| | | | attribute to the generated start expression giving easy access to a SkipTo(closeTag) that will parse the tag's body text; some code cleanup and removed duplication among examples
* Updated examples to current pyparsing styles, and to use runTestsPaul McGuire2019-04-062-96/+90
|
* Some reformatting for better readability, and more explanatory commentsPaul McGuire2019-04-051-22/+33
|
* Add example include_preprocessor.pyPaul McGuire2019-04-051-0/+77
|
* SimpleSQL.py update - nested select and infixNotation for 'where'Paul McGuire2019-03-301-88/+95
|
* Add example showing scraping/parsing of an HTML table into a Python dictPaul McGuire2019-03-301-0/+61
|
* Update original "Hello, World!" parser to latest coding, plus runTestsPaul McGuire2019-03-301-17/+25
|
* Add compiler from rosettacode.org; fix bug in ParserElement.runTests that ↵Paul McGuire2019-01-311-0/+278
| | | | interpreted newlines in quotes as test delimiters
* Update examples and unit tests to more preferred coding styles, imports for ↵ptmcg2019-01-3012-85/+94
| | | | pyparsing_common as ppc and pyparsing_unicode as ppu
* Merge pull request #64 from mcepl/denosepyparsing_2.3.1Paul McGuire2019-01-101-193/+190
|\ | | | | Denose
| * Remove dependency on noseMatěj Cepl2019-01-071-183/+180
| |
| * Convert CRLF to LFMatěj Cepl2019-01-071-193/+193
| |
* | Add enumerated place holders for strings that invoke str.format(), for Py2 ↵ptmcg2019-01-0917-71/+71
|/ | | | compatibility
* Clean up CHANGES notes for new examplesptmcg2018-12-312-258/+0
|
* Add document signoff and library book state examples;ptmcg2018-12-317-38/+277
|
* Update statemachine demo code to Py3Paul McGuire2018-12-313-29/+60
|
* Update Lucene grammar example, but remove from Travis-CI acceptance scriptsPaul McGuire2018-12-301-1/+5
|
* Update Travis-CI scripts to include examples; fix bug in runTests if ↵Paul McGuire2018-12-303-22/+25
| | | | postParse function returns None (or any non-str value)
* Update chemicalFormulas.py example to use new runTests postParse argument, ↵Paul McGuire2018-12-301-27/+48
| | | | add test cases that parse subscript integers
* Fix partial named results when And embedded in named MatchFirst or Orptmcg2018-12-284-0/+482
|
* Use HTTPS URLs where available in docs, examples, and commentsJon Dufresne2018-12-2517-18/+18
|
* Merge branch 'master' into psycoPaul McGuire2018-12-244-709/+708
|\
| * Replace bare 'except:' with 'except Exception;'Jon Dufresne2018-12-244-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Catching all exceptions is generally considered a bad practice under most circumstances as it will also catch KeyboardInterrupt and SystemExit. These special cases should be raised to the interpreter to allow the Python process to exit. This fix complies with pycodestyle's error code E722: https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes > do not use bare except, specify exception instead
* | Remove mentions of 'psyco' from docs and examplesJon Dufresne2018-12-241-13/+0
|/ | | | | | | | | | | | | | | The psyco package has been declared umaintained and dead. It is no longer receiving bug fixes including for security issues. From http://psyco.sourceforge.net/ > 12 March 2012 > > Psyco is unmaintained and dead. Please look at PyPy for the > state-of-the-art in JIT compilers for Python. Avoid recommending the use of an unmaintained package (since 2012). Users can continue to use PyPy for the latest and greatest in Python JIT.
* Remove unused imports throughout projectJon Dufresne2018-12-2425-47/+35
| | | | | | | | | | | | | Unused imports were discovered using flake8. By removing the unused imports, the code is a bit friendlier to new contributors as it is clearer what is being used and not simply leftover from previous refactoring. The flake8 command: $ flake8 . --select F401 http://flake8.pycqa.org/
* Merge changes from last PR, plus some more up-to-date coding styles and ↵Paul McGuire2018-12-231-5/+21
| | | | pyparsing features
* Trim trailing white space throughout the projectJon Dufresne2018-12-2276-919/+879
| | | | | | Many editors clean up trailing white space on save. By removing it all in one go, it helps keep future diffs cleaner by avoiding spurious white space changes on unrelated lines.
* Fix encoding cookie to use encoding "utf-8"Jon Dufresne2018-12-221-1/+1
| | | | | | | | | | | | | | | The all caps "UTF-8" causes warnings or errors in some editors. "utf-8" is more widely recognized. For example, when opening files in Emacs, I see: > Warning (mule): Invalid coding system ‘UTF-8’ is specified > for the current buffer/file by the :coding tag. > It is highly recommended to fix it before writing to a file. > Really proceed with writing? (yes or no) I'm then promped before saving. The CPython source code uses the lowecase form.
* Fix failing tests (both py2K and py3k)Matěj Cepl2018-11-212-4/+4
| | | | Fixes #48
* Fix Issue #40 - Py3 enforces tighter exception scoping, plus other exception ↵ptmcg2018-10-302-9/+10
| | | | typo
* Undefined name: Set() --> set()cclauss2018-10-301-2/+2
| | | | | | | | | | | | | | __Set()__ is an _undefined name_ in this context but __set()__ is used elsewhere in this class. [flake8](http://flake8.pycqa.org) testing of https://github.com/pyparsing/pyparsing on Python 3.7.1 $ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__ ``` ./examples/searchParserAppDemo.py:15:18: F821 undefined name 'Set' result = Set() ^ 1 F821 undefined name 'Set' 1 ```
* Add unicode character ranges by nameptmcg2018-10-272-10/+9
|
* Upgrade Python syntax with pyupgradeHugo2018-08-2117-108/+107
|
* Add "group by" case to select_parser.py testsPaul McGuire2018-07-141-0/+1
| | | Update test strings to demonstrate fix in group_by_terms results - original bug was reported on SF bugs by Adam Groszer
* Wrong expression grouping in select_parser.pyPaul McGuire2018-07-141-1/+1
| | | Results name "group_by_terms" was defined at the wrong level in the "having_expr", causing those names to be left out of the results.
* Move src to rootCengiz Kaygusuz2017-11-2093-0/+16518