Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for regex type in parser #52

Merged
merged 1 commit into from Jul 17, 2020

Conversation

psanford
Copy link
Contributor

This simply allows you to distinguish regex from
words. It does no internal parsing of the regex
text.

Before:

>>> parser.parse('/foo bar/')
UnknownOperation(Word('/foo'), Word('bar/'))

After:

>>> parser.parse('/foo bar/')
Regex('/foo bar/')

@alexgarel
Copy link
Member

Wow thank you for this was in the TODO !

Could you fix the flake8 minor problem, reported by travis:

make quality

flake8 luqum

/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/pep8.py:110: FutureWarning: Possible nested set at position 1

  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')

luqum/tree.py:208:1: E302 expected 2 blank lines, found 1

Makefile:5: recipe for target 'quality' failed

make: *** [quality] Error 1

The command "make quality" exited with 2.

This simply allows you to distinguish regex from
words. It does no internal parsing of the regex
text.

Before:

    >>> parser.parse('/foo bar/')
    UnknownOperation(Word('/foo'), Word('bar/'))

After:

    >>> parser.parse('/foo bar/')
    Regex('/foo bar/')
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 0ab316c on psanford:support-parsing-regex into 08be8e5 on jurismarches:master.

@psanford
Copy link
Contributor Author

Fixed!

Thanks for this library!

@alexgarel alexgarel merged commit 55c9cdc into jurismarches:master Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants