-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chg: improve efficiency of detecting expressions and last_saved
- expression.py - remove is_single_token_expression and instead look for the token type of interest only. This requires making the lexer rules available outside of get_expression_lexer() and unfortunately compiling an extra time since the Scanner combines all regexes into one before compiling (so you can't give it pre-compiled regex). - change PYXFORM_REF regex to specifically look for optional `last-saved#` prefix instead of any ncname before a `#`. Not sure why it was like that but `last-saved` is quicker than ncname regex. - pyxform_reference.py - add some sanity checks on input `value` to avoid more expensive parsing in the remaining function body - survey.py - in _generate_last_saved_instance, combine the check performed on default/choice_filter/bind(items) into a func (in expression.py) - refactor check of bind items to more efficient method (per comment).
- Loading branch information
1 parent
fe32c6b
commit 5979b9d
Showing
4 changed files
with
51 additions
and
55 deletions.
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
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
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
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