summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Back out Lox language parser (from Crafting Interpreters, by Robert Nystrom)pyparsing_3.0.9ptmcg2022-05-101-220/+0
|
* Added Lox language parser (from Crafting Interpreters, by Robert Nystrom)ptmcg2022-05-082-2911/+220
|
* Added Lox language parser (from Crafting Interpreters, by Robert Nystrom)ptmcg2022-05-081-0/+2911
|
* Added test case to bigquery_view_parser.py from #291ptmcg2022-04-301-0/+6
|
* Added another test case to bigquery_view_parser.pyptmcg2022-04-301-0/+24
|
* Fixed bigquery_view_parser.py example to parse examples from ↵ptmcg2022-04-301-88/+260
| | | | https://cloud.google.com/bigquery/docs/reference/legacy-sql
* Add unicode_denormalizer.py to examples.ptmcg2022-03-291-0/+123
|
* Fixing Unicode block range in examples/booleansearchparser.py (#342)tc-yu2021-12-151-25/+59
| | | | | * Updated range for unicode blocks, updated add char logic to include last character in each block, update some function names * Test case for CJK block and last character in block
* Added sys.setrecursionlimit for complex query strings; general reformattingPaul McGuire2021-11-131-370/+126
|
* Revert strict LineStart interpretation in 3.0.0 to 2.4.x behavior (Issue #317)ptmcg2021-10-261-4/+4
|
* Fix type annotation for ranges in unicode_sets; make _get_chars_for_ranges a ↵ptmcg2021-09-271-2/+2
| | | | lazyclassproperty
* Fix type annotation for ranges in unicode_sets; make _get_chars_for_ranges a ↵ptmcg2021-09-271-31/+43
| | | | lazyclassproperty
* Add numbers and punctuation to Cuneiform classptmcg2021-09-251-0/+1
|
* Some tweaks to cuneiform_python.pyptmcg2021-09-241-2/+4
|
* Add cuneiform_python.py exampleptmcg2021-09-231-0/+101
|
* Add pyparsing_common.url to urlExtractorNew.pyptmcg2021-09-111-7/+49
|
* Update eval_arith.py to have better representation of true and false eval ↵ptmcg2021-09-081-2/+4
| | | | expressions
* Reformat code for railroad_diagram_demo.pyptmcg2021-09-081-6/+22
|
* 226 railroad updates (#298)Paul McGuire2021-09-088-52/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add line separators to HowToUsePyparsing.rst to call attention to PEP-8 naming in this document * Update railroad diagram generation code, to show results names as group annotations, and break out all expressions with a name set using setName. * Revert dataclasses back to NamedTuples for 3.6-7 compat; add setName calls in simpleBool.py; add simpleBool to make_diagram.py * Remove default setName calls on delimitedList * Add setName calls to simpleSQL for better diagram * Remove hard-coded debug mode * Move setName on delimitedList into test code * Restore default setName() calls for delimitedList; set default vertical=3; update jsonParser.py and simpleSQL.py with better setName() calls (and update test_diagram.py accordingly); update test_diagram.py to move asserts after tempfiles are written, moved tempfiles to local dir instead of hard-to-find temp dir * Get proper railroad diags for infixNotation * Undo forced railroad_debug * Code cleanup from PR comments * Remove hard-coded base_expr name from infix_notation * Add special EachItem to compose DiagramItem for Group-OneOrMore-Choice; refactored tests to move duplicated code to function; added names to mozillaCalendarParser.py for better diagram * Make sure root element gets in the diagram, even if it has no custom name * Update tests to reflect diagram structure changes * Add LOOKAHEAD and LOOKBEHIND annotations for FollowedBy and PrecededBy elements, and changed the annotation on Each to [ALL]; renamed _first to _element_diagram_states; add expr.streamline() in create_diagram() to collapse nested exprs; added railroad_diagram_demo.py example general blackening; update CHANGES with latest enhancements; bump version date * Fix pip command * Update CHANGES and whats_new_in_3_0_0.rst with some features and acknowledgements * Updates from PR review: change user instructions to use pyparsing[diagrams]; consistent annotations for NotAny along with FollowedBy and PrecededBy; fixed up comments and type annotations * Remove unneeded pip installs for tox (already handled in tox.ini) * Refactor duplicate code into decorator; drop unused group_results_name argument * Add diagram handling for SkipTo, and for And's constructed using `expr*N` notation (use a OneOrMore diagram with a repeat count instead of a sequence of N exprs) * Fix parsing ambiguity in railroad_diagram_demo.py so that parser can actually parse a valid input string
* Clean up number word parsers for better explanatory value.ptmcg2021-08-092-45/+73
|
* Add simplified 1-99 example, extracted from number_words.pyPaul McGuire2021-08-081-0/+72
|
* Minor code cleanupsptmcg2021-08-071-37/+7
|
* Update __versionTime__; blacken core code and examplesptmcg2021-08-0117-177/+491
|
* Rename enable_left_recursion to enableLeftRecursion for consistency with ↵ptmcg2021-08-011-0/+45
| | | | other pyparsing names (left in enable_left_recursion synonym as omen of names to come); added notes to CHANGES and whats_new_in_3_0_0.rst; added left_recursion.py to examples.
* Fix misc. documentation typos (#280)luzpaz2021-05-148-22/+22
| | | Found via `codespell -q 3 -L ba,fourty,halp,inout,strng`
* #261 - fix table name in sql2dot.py exampleptmcg2021-04-131-1/+1
|
* Add IndentedBlock class; made vertical keyword arg more visible when ↵pyparsing_3.0.0b1ptmcg2020-11-024-19/+83
| | | | creating railroad diags; changed create_diagram from monkeypatch to included method on ParserElement; better debug exception if Dict is constructed with non-Group expression
* Add number_words.py example; update diagramming codeptmcg2020-10-251-0/+89
|
* ParseResults.List class to support returning an actual list from a parse ↵ptmcg2020-10-241-13/+51
| | | | action, plus aslist and asdict args to Group and Dict classes to emit native Python types instead of ParseResults; also update repr() output of ParseResults to include the type name instead of just a bare tuple.
* There will be blackPaul McGuire2020-10-111-1/+1
|
* test_bibparse includes parsed strings with leading space, no longer included ↵Paul McGuire2020-10-111-28/+29
| | | | in output
* Add lookahead on matching identifiers to ensure we aren't matching a keywordptmcg2020-08-171-1/+10
|
* Update lua_parser.py example to include associative arrays and more complete ↵ptmcg2020-08-161-22/+47
| | | | infix notation operators
* Add expression names and restructure relative time and day expressions based ↵Paul McGuire2020-06-281-22/+38
| | | | on reviewing railroad diag
* Simplify running railroad diagram examplesPaul McGuire2020-06-281-20/+21
|
* Add make_diagram.py to examples to demonstrate creating railroad diags for ↵ptmcg2020-06-2711-203/+272
| | | | selected examples
* Fix up lua parser to parse scripts of zero-or-more statementsPaul McGuire2020-05-311-2/+5
|
* Added lua parser example (see #212)Paul McGuire2020-05-311-0/+256
|
* makeRomanNumeral bug fix, added MMMMM test (#216)Jay Pedersen2020-05-221-1/+2
| | | Co-authored-by: jay <jayped007@gmail.com>
* import and exception types cleanup in statemachine examplesptmcg2020-04-272-1/+2
|
* black cleanupptmcg2020-04-261-1/+1
|
* change some lambdas to explicit methods for clarity (see discussion in ↵ptmcg2020-04-2611-226/+100
| | | | #207); deleted duplicated examples (commit *all* changes this time)
* Code cleanup in examples; move test code into main for ↵ptmcg2020-04-251-18/+25
| | | | bigquery_view_parser.py; change some lambdas to explicit methods for clarity (some discussion in #207); deleted duplicated examples
* enable packrat parsing in all examples using infixNotationptmcg2020-04-076-5/+23
|
* Blacken changesptmcg2020-02-231-3/+3
|
* Fix bug in delta_time when number of seconds/minutes/hours > 999 (confusion ↵ptmcg2020-02-231-5/+16
| | | | with 24-hour time)
* ensure test can fail (#178)Kyle Lahnakoski2020-02-231-102/+93
|
* Smedberg/various minor fixes (#173)Michael Smedberg2020-01-231-40/+87
| | | | | | | | | | | | * Support whitespace in column identifier * Support WITH clause nested in UNION clause * SELECT statements can be surrounded by parenthesis * Parse quoted table names * Formatting code with `black`
* Include 2.4.x change notes to CHANGES; add select_parser to unit tests; ↵ptmcg2019-11-181-4/+3
| | | | minor changes to select_parser
* select_parser example: misc improvements (#157)Robert Coup2019-11-181-152/+94
| | | | | | | | | | | | | | | | * select_parser example: misc improvements * sqlite now supports TRUE and FALSE as literal values * use common numeric expressions * fix identifier quoting * downcase identifiers unless they're quoted * fix string quoting * add support for sql comments * additional test cases * Reformat test-runner aspects * Improve support for NOT expressions (eg. NOT IN, NOT LIKE)