-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Python: Add support for template string literals #20708
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
Open
tausbn
wants to merge
10
commits into
main
Choose a base branch
from
tausbn/python-add-support-for-template-string-literals
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+45,582
−38,500
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7768ebe
Python: Add parser support for template strings
tausbn cd7ae34
Python: Regenerate parser files
tausbn 28e733e
Python: Support template strings in rest of extractor
tausbn 652c335
Python: Regenerate AST and dbscheme files
tausbn 414e689
Python: Add AST node wrappers
tausbn 47c967a
Python: Bump extractor version
tausbn 82c629a
Python: Add up-/downgrade scripts for template literals
tausbn b9616eb
Python: Add stats
tausbn 4d45b58
Python: Add change note
tausbn 6b03130
Python: Fix bad join in `import_points_to`
tausbn 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
1,282 changes: 1,282 additions & 0 deletions
1,282
python/downgrades/8d257a4a9bc78e39856d6cd33499389fc5148d4f/old.dbscheme
Large diffs are not rendered by default.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
python/downgrades/8d257a4a9bc78e39856d6cd33499389fc5148d4f/py_exprs.ql
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // We must wrap the DB types, as these cannot appear in argument lists | ||
| class Expr_ extends @py_expr { | ||
| string toString() { result = "Expr" } | ||
| } | ||
|
|
||
| class ExprParent_ extends @py_expr_parent { | ||
| string toString() { result = "ExprList" } | ||
| } | ||
|
|
||
| query predicate py_exprs_without_template_strings(Expr_ id, int kind, ExprParent_ parent, int idx) { | ||
| py_exprs(id, kind, parent, idx) and | ||
| // From the dbscheme: | ||
| // | ||
| // case @py_expr.kind of | ||
| // ... | ||
| // | 39 = @py_SpecialOperation | ||
| // | 40 = @py_TemplateString | ||
| // | 41 = @py_JoinedTemplateString | ||
| // | 42 = @py_TemplateStringPart; | ||
| not kind in [40, 41, 42] | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.