summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* 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)
* Blacken the project (#141)Jon Dufresne2019-10-3192-3863/+6316
|
* Use pyupgrade to upgrade the code to use Python3 conventions (#138)Jon Dufresne2019-10-2433-160/+145
| | | | | | | | | | | | The pyupgrade project is available at https://github.com/asottile/pyupgrade and can be installed through pip. The pyupgrade tool automatically upgrades syntax for newer versions of the language. As pyparsing is now Python 3 only, can apply some cleanups and simplifications. Ran the tool using the following command: $ find . -name \*.py -exec pyupgrade --py3-plus {} \; For now, pyparsing.py was skipped while it is refactored to a package.
* Py3 cleanup: Remove workaround for Python2 urllib (#143)Jon Dufresne2019-10-192-16/+3
| | | | For Python 3 only code, the import path is known and stable. Can remove the ImportError workaround.
* Remove unused imports (#147)Jon Dufresne2019-10-197-9/+6
| | | | | Discovered using the command: flake8 --select F401 .
* Py3 cleanup: Remove workaround from Python3 unichr() (#144)Jon Dufresne2019-10-171-6/+1
| | | On Python3, always use chr().
* Py3 cleanup: Remove use of closing() with urlopen() (#145)Jon Dufresne2019-10-175-14/+11
| | | | | | | | | In Python 3, urlopen() can always be used as a context manager. Wrapping with closing() is not necessary. https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen > This function always returns an object which can work as a context > manager …
* Py3 cleanup: Remove unnecessary __ne__ method (#140)Jon Dufresne2019-10-171-2/+0
| | | | | | | | | | Unlink Python 2, in Python 3, __ne__ defaults to the inverse of the __eq__ method. Can remove the definitions that follow this default. From the Python docs https://docs.python.org/3/reference/datamodel.html#object.__ne__ > By default, __ne__() delegates to __eq__() and inverts the result > unless it is NotImplemented.
* Py3 cleanup: Remove __nonzero__ method (#142)Jon Dufresne2019-10-171-3/+3
| | | | In Python 3, the __nonzero__ method was renamed to __bool__. It no longer exists as a magic method.
* BigQuery View parse fails on IGNORE NULLS (#126)Michael Smedberg2019-09-271-3/+14
|
* BigQuery SQL parser: handle WINDOW clause in WITH section (#122)Michael Smedberg2019-09-081-0/+19
|
* Add Py2 compat code at submitter's request; add non-Western test case; more ↵Paul McGuire2019-08-181-98/+109
| | | | helpful message when tests fail; exit with exit code to include with package tests; trim trailing whitespace
* Boolean Search query parser: allows to perform searches with the common ↵xecgr2019-08-131-0/+394
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | boolean search syntax against a text (#21) * Add files via upload Boolean Search query parser, based on searchparser, that allows to perform searches with the common boolean search syntax against a text (western + non-western alphabets) SAMPLE USAGE: from booleansearchparser import BooleanSearchParser bsp = BooleanSearchParser() text = u"wildcards at the begining of a search term " exprs= [ u"*cards and term", #True u"wild* and term", #True u"not terms", #True u"terms or begin", #False ] for expr in exprs: print bsp.match(text,expr) #non-western samples text = u"안녕하세요, 당신은 어떠세요?" exprs= [ u"*신은 and 어떠세요", #True u"not 당신은", #False u"당신 or 당", #False ] for expr in exprs: print bsp.match(text,expr) * from __future__ import print_function and changing this over to be Python 2/3 compatible * ptmcg conversation issues
* Update example to proto3 syntax (#113)Andrew Artyushok2019-08-131-5/+18
| | | Thanks again for submitting!
* Typo and spelling cleanup, add helpful commentsPaul McGuire2019-08-071-3/+10
|
* Fixed bug in CloseMatch where end location was incorrectly computed; and ↵Paul McGuire2019-08-051-88/+51
| | | | updated partial_gene_match.py example.
* Code style updates; remove deprecated methodsPaul McGuire2019-08-053-144/+147
|
* Example BigQuery view SQL parser (#112)Michael Smedberg2019-08-041-0/+1510
| | | | Example BigQuery view SQL parser
* fourFn.py updates - handle leading '+' and '-' unary signs for parenthesized ↵Paul McGuire2019-08-041-4/+11
| | | | expressions; and real numbers with no leading digit before the decimal
* Update fourFn.py to handle functions that take multiple args, and nested ↵Paul McGuire2019-08-032-309/+354
| | | | functions
* Version 2.4.2a1 - changing [...] notation to ZeroOrMore, not OneOrMorePaul McGuire2019-07-232-267/+267
|
* Update coding styles; better comments, attribution of example filePaul McGuire2019-07-201-9/+21
|
* Change example to use addCondition instead of parse action that raises ↵Paul McGuire2019-07-191-10/+10
| | | | ParseException
* Update/cleanup code in examplesPaul McGuire2019-07-137-1187/+1244
|
* Code reorg/reformat, added results namesPaul McGuire2019-07-061-127/+151
|
* Add support for multiple '...' skips in a single expression; `_skippped` ↵Paul McGuire2019-07-061-4/+5
| | | | results name will always return a list of skipped items
* Update examples to reflect newer pyparsing and coding styles, and use '...' ↵ptmcg2019-07-053-91/+93
| | | | to illustrate repetition and skipping
* Add compatibility results name; ungroup qty expression to simplify accessing ↵Paul McGuire2019-05-291-6/+8
| | | | qty value
* Some code cleanup, and added tests and test validationsPaul McGuire2019-05-281-6/+27
|
* Fix description in module headerPaul McGuire2019-05-281-1/+3
|
* delta_time fixes: add more time validations; add 1-second epsilon when ↵ptmcg2019-05-281-2/+24
| | | | verifying computed times; add 'an' for 'an hour' times
* Update generated code for both unnamed and named state transition state machinesPaul McGuire2019-05-271-1/+9
|