Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support searching for raw text patterns
Summary: We can use this to match functions of a specific name, or to match specific operators (such as by matching binary expressions that have their operator's raw text be `+`). Reviewed By: pittsw Differential Revision: D7760889 fbshipit-source-id: d7248c1f0a0f16def365a87ab9ff6bca58bd04fb
- Loading branch information
Showing
7 changed files
with
64 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--cst-search basic_class.php |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"pattern_type": "descendant_pattern", | ||
"pattern": { | ||
"pattern_type": "node_pattern", | ||
"kind": "methodish_declaration", | ||
"children": { | ||
"methodish_function_decl_header": { | ||
"pattern_type": "node_pattern", | ||
"kind": "function_declaration_header", | ||
"children": { | ||
"function_name": { | ||
"pattern_type": "raw_text_pattern", | ||
"raw_text": "bar" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"matched_nodes":[]} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
--cst-search basic_class.php |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"pattern_type": "descendant_pattern", | ||
"pattern": { | ||
"pattern_type": "node_pattern", | ||
"kind": "methodish_declaration", | ||
"children": { | ||
"methodish_function_decl_header": { | ||
"pattern_type": "node_pattern", | ||
"kind": "function_declaration_header", | ||
"children": { | ||
"function_name": { | ||
"pattern_type": "raw_text_pattern", | ||
"raw_text": "foo" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
null |