Skip to content

Commit 581254e

Browse files
committed
PS: A couple of small dbscheme changes.
1. Flip the name of the child and parent column for 'parent' to reflect how this is actually populated by the extractor. 2. Make some of the coumns more specific to the actual data type. 3. Make `@named_attribute_argument` an `@ast` branch.
1 parent 20e76b3 commit 581254e

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

powershell/ql/lib/semmlecode.powershell.dbscheme

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ extractor_messages(
6464
);
6565

6666
parent(
67-
int parent: @ast ref,
68-
int child: @ast ref
67+
int child: @ast ref,
68+
int parent: @ast ref
6969
);
7070

7171
/* AST Nodes */
7272
// This is all the kinds of nodes that can inherit from Ast
7373
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.ast?view=powershellsdk-7.3.0
7474
@ast = @not_implemented | @attribute_base | @catch_clause | @command_element |
75-
@member | @named_block | @param_block | @parameter | @redirection | @script_block | @statement | @statement_block;
75+
@member | @named_block | @param_block | @parameter | @redirection | @script_block | @statement | @statement_block | @named_attribute_argument;
7676
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.attributebaseast?view=powershellsdk-7.2.0
7777
@attribute_base = @attribute | @type_constraint;
7878

@@ -409,13 +409,13 @@ if_statement(
409409
if_statement_clause(
410410
int id: @if_statement ref,
411411
int index: int ref,
412-
int item1: @ast ref,
413-
int item2: @ast ref
412+
int item1: @pipeline_base ref,
413+
int item2: @statement_block ref
414414
)
415415

416416
if_statement_else(
417417
int id: @if_statement ref,
418-
int elseItem: @ast ref
418+
int elseItem: @statement_block ref
419419
)
420420

421421
if_statement_location(
@@ -467,7 +467,7 @@ statement_block_trap(
467467
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.subexpressionast?view=powershellsdk-7.3.0
468468
sub_expression(
469469
unique int id: @sub_expression,
470-
int subExpression: @ast ref
470+
int subExpression: @statement_block ref
471471
)
472472

473473
sub_expression_location(
@@ -627,7 +627,7 @@ exit_statement(
627627

628628
exit_statement_pipeline(
629629
int id: @exit_statement ref,
630-
int expression: @ast ref
630+
int expression: @pipeline_base ref
631631
)
632632

633633
exit_statement_location(
@@ -814,7 +814,7 @@ continue_statement_location(
814814

815815
statement_label(
816816
int id: @labelled_statement ref,
817-
int label: @ast ref
817+
int label: @expression ref
818818
)
819819

820820
// ReturnStatementAst
@@ -825,7 +825,7 @@ return_statement(
825825

826826
return_statement_pipeline(
827827
int id: @return_statement ref,
828-
int pipeline: @ast ref
828+
int pipeline: @pipeline_base ref
829829
)
830830

831831
return_statement_location(
@@ -837,12 +837,12 @@ return_statement_location(
837837
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.dowhilestatementast?view=powershellsdk-7.3.0
838838
do_while_statement(
839839
unique int id: @do_while_statement,
840-
int body: @ast ref
840+
int body: @statement_block ref
841841
)
842842

843843
do_while_statement_condition(
844844
int id: @do_while_statement ref,
845-
int condition: @ast ref
845+
int condition: @pipeline_base ref
846846
)
847847

848848
do_while_statement_location(
@@ -854,12 +854,12 @@ do_while_statement_location(
854854
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.dountilstatementast?view=powershellsdk-7.3.0
855855
do_until_statement(
856856
unique int id: @do_until_statement,
857-
int body: @ast ref
857+
int body: @statement_block ref
858858
)
859859

860860
do_until_statement_condition(
861861
int id: @do_until_statement ref,
862-
int condition: @ast ref
862+
int condition: @pipeline_base ref
863863
)
864864

865865
do_until_statement_location(
@@ -871,12 +871,12 @@ do_until_statement_location(
871871
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.whilestatementast?view=powershellsdk-7.3.0
872872
while_statement(
873873
unique int id: @while_statement,
874-
int body: @ast ref
874+
int body: @statement_block ref
875875
)
876876

877877
while_statement_condition(
878878
int id: @while_statement ref,
879-
int condition: @ast ref
879+
int condition: @pipeline_base ref
880880
)
881881

882882
while_statement_location(
@@ -888,9 +888,9 @@ while_statement_location(
888888
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.foreachstatementast?view=powershellsdk-7.3.0
889889
foreach_statement(
890890
unique int id: @foreach_statement,
891-
int variable: @ast ref,
892-
int condition: @ast ref,
893-
int body: @ast ref,
891+
int variable: @variable_expression ref,
892+
int condition: @pipeline_base ref,
893+
int body: @statement_block ref,
894894
int flags: int ref
895895
)
896896

@@ -903,7 +903,7 @@ foreach_statement_location(
903903
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.forstatementast?view=powershellsdk-7.3.0
904904
for_statement(
905905
unique int id: @for_statement,
906-
int body: @ast ref
906+
int body: @statement_block ref
907907
)
908908

909909
for_statement_location(
@@ -913,17 +913,17 @@ for_statement_location(
913913

914914
for_statement_condition(
915915
int id: @for_statement ref,
916-
int condition: @ast ref
916+
int condition: @pipeline_base ref
917917
)
918918

919919
for_statement_initializer(
920920
int id: @for_statement ref,
921-
int initializer: @ast ref
921+
int initializer: @pipeline_base ref
922922
)
923923

924924
for_statement_iterator(
925925
int id: @for_statement ref,
926-
int iterator: @ast ref
926+
int iterator: @pipeline_base ref
927927
)
928928

929929
// ExpandableStringExpressionAst
@@ -988,14 +988,14 @@ unary_expression_location(
988988
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.catchclauseast?view=powershellsdk-7.3.0
989989
catch_clause(
990990
unique int id: @catch_clause,
991-
int body: @ast ref,
991+
int body: @statement_block ref,
992992
boolean isCatchAll: boolean ref
993993
)
994994

995995
catch_clause_catch_type(
996996
int id: @catch_clause ref,
997997
int index: int ref,
998-
int catch_type: @ast ref
998+
int catch_type: @type_constraint ref
999999
)
10001000

10011001
catch_clause_location(
@@ -1024,7 +1024,7 @@ throw_statement_pipeline(
10241024
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.trystatementast?view=powershellsdk-7.3.0
10251025
try_statement(
10261026
unique int id: @try_statement,
1027-
int body: @ast ref
1027+
int body: @statement_block ref
10281028
)
10291029

10301030
try_statement_catch_clause(
@@ -1099,9 +1099,9 @@ token_location(
10991099
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.configurationdefinitionast?view=powershellsdk-7.3.0
11001100
configuration_definition(
11011101
unique int id: @configuration_definition,
1102-
int body: @ast ref,
1102+
int body: @script_block_expression ref,
11031103
int configurationType: int ref,
1104-
int name: @ast ref
1104+
int name: @expression ref
11051105
)
11061106

11071107
configuration_definition_location(
@@ -1113,7 +1113,7 @@ configuration_definition_location(
11131113
// https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.language.datastatementast?view=powershellsdk-7.3.0
11141114
data_statement(
11151115
unique int id: @data_statement,
1116-
int body: @ast ref
1116+
int body: @statement_block ref
11171117
)
11181118

11191119
data_statement_variable(

0 commit comments

Comments
 (0)