-
Notifications
You must be signed in to change notification settings - Fork 42
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
Adding grammar for v0.10.0 #66
Merged
Merged
Changes from 5 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
6126433
Adding grammar for v0.10.0
b1c7e49
Allowing multiple grammar variants for the same version
e4203ac
using special grammar variant for the parser
f4ffdb0
using '.lark' extensions for the grammar files
04dabd8
fixing warning
8c48815
add more examples for testing the filter parser
62a811a
cleanup
296dbc9
creating a transformer for debugging
dd86a45
force to keep arguments for operator
4a5d135
adding rule for strings and numbers
ae1ad6b
separate int and float in the rule for numbers
e0c426c
cleanup
1e2b38e
combining tokens to reduce complexity
7644b58
first working filter example
7d8312a
local tests + combining multiple ANDs and ORs
913c626
cleanup
f8f077a
update version of lark-parser + fix test
572b468
adding tests
43f6844
fix precedence for the test case
bbaed20
fixing precedence by parentheses
415443a
installing python package in order
06dd3fe
formal definition of all rules (some of them just raise an NotImpleme…
5a41bc5
skeleton class for the transformer
465ec26
define targets for the tests + cleanup
a37691c
typo
9cf3e7b
boost code coverage
70c03b2
allowing lower-case characters only in the definition of identifiers
483939d
redefining operator as tokens instead of rules
0e47883
revere operators when the property isd on the right
7ba7769
Merge branch 'master' into filter_v0.10.0
fekad 22ba26a
Merge branch 'master' into filter_v0.10.0
CasperWA e3656c7
Merge branch 'master' into filter_v0.10.0
CasperWA 7349643
allowing white characters in strings
12fd19c
Merge branch 'master' into filter_v0.10.0
ml-evs fa9f849
Merge branch 'master' into filter_v0.10.0
ml-evs b9396e4
using repetition instead of recursion
d15330f
using the new parser and transformer
d1999a4
Update optimade/server/entry_collections.py
fekad ac9e3df
Update optimade/filterparser/tests/test_filterparser.py
fekad 6e9c1ea
Update optimade/filterparser/tests/test_filterparser.py
fekad 195a630
cleanup
17b8e68
optimized test class
3f092de
Added filter integration tests with example server
ml-evs 85e9ba5
Skip some tests for unimplemented features
ml-evs c352196
fix type mismatch warning
46af4fa
bugfix for the HAS filter
78fbc39
fixing page_filter issue
b599d80
quick dirty fix for "deep" queries
cc6685b
minimal implementation of LENGTH filter
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
__all__ = ["LarkParser", "ParserError"] | ||
|
||
from .lark_parser import LarkParser, ParserError | ||
|
||
__all__ = [LarkParser, ParserError] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this more dynamic, you could do a
*
import and specify the__all__
inlark_parser.py
.This
__all__
then becomeslark_parser.__all__
.In this way, if you decide to reveal other classes from
lark_parser
, you'll add them to that file's__all__
instead of the__init__.py
.See, e.g., here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I don't like to usage of
*
in imports. There are a lot of articles in favour and against its usage (this is just the first match on google). It is similar to the usage ofglobal
variable.Of course, I will modify it as you suggested to keep the repo consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. We should at some point have a consensus concerning this package of what we do.