mirror of
https://github.com/github/codeql.git
synced 2026-06-19 11:51:08 +02:00
Merge branch 'add-yaml-comments'
This commit is contained in:
@@ -1920,3 +1920,5 @@ private YamlMappingLikeNode resolveMatrixAccessPath(
|
||||
else result = resolveMatrixAccessPath(newRoot, rest)
|
||||
)
|
||||
}
|
||||
|
||||
class Comment = YamlComment;
|
||||
|
||||
@@ -52,6 +52,12 @@ private module YamlSig implements LibYaml::InputSig {
|
||||
class ParseErrorBase extends LocatableBase, @yaml_error {
|
||||
string getMessage() { yaml_errors(this, result) }
|
||||
}
|
||||
|
||||
class CommentBase extends LocatableBase, @yaml_comment {
|
||||
string getText() { yaml_comments(this, result, _) }
|
||||
|
||||
override string toString() { yaml_comments(this, _, result) }
|
||||
}
|
||||
}
|
||||
|
||||
import LibYaml::Make<YamlSig>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
description: Extract YAML comments
|
||||
compatibility: full
|
||||
yaml_comments.rel: delete
|
||||
@@ -7,21 +7,26 @@ containerparent(#10001,#10000)
|
||||
locations_default(#10002,#10000,0,0,0,0)
|
||||
hasLocation(#10000,#10002)
|
||||
#20000=*
|
||||
#20001=*
|
||||
yaml_scalars(#20001,0,"key")
|
||||
yaml(#20001,0,#20000,1,"tag:yaml.org,2002:str","key")
|
||||
#20002=@"loc,{#10000},2,1,2,3"
|
||||
locations_default(#20002,#10000,2,1,2,3)
|
||||
yaml_locations(#20001,#20002)
|
||||
yaml_comments(#20000," xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","# xxxxx ... xxxxxxx")
|
||||
#20001=@"loc,{#10000},1,1,1,1017"
|
||||
locations_default(#20001,#10000,1,1,1,1017)
|
||||
yaml_locations(#20000,#20001)
|
||||
#20002=*
|
||||
#20003=*
|
||||
yaml_scalars(#20003,0,"🚀")
|
||||
yaml(#20003,0,#20000,-1,"tag:yaml.org,2002:str","\u1f680\ude80")
|
||||
#20004=@"loc,{#10000},2,6,2,6"
|
||||
locations_default(#20004,#10000,2,6,2,6)
|
||||
yaml_scalars(#20003,0,"key")
|
||||
yaml(#20003,0,#20002,1,"tag:yaml.org,2002:str","key")
|
||||
#20004=@"loc,{#10000},2,1,2,3"
|
||||
locations_default(#20004,#10000,2,1,2,3)
|
||||
yaml_locations(#20003,#20004)
|
||||
yaml(#20000,1,#10000,0,"tag:yaml.org,2002:map","key: \u1f680\ude80")
|
||||
#20005=@"loc,{#10000},2,1,2,8"
|
||||
locations_default(#20005,#10000,2,1,2,8)
|
||||
yaml_locations(#20000,#20005)
|
||||
#20005=*
|
||||
yaml_scalars(#20005,0,"🚀")
|
||||
yaml(#20005,0,#20002,-1,"tag:yaml.org,2002:str","\u1f680\ude80")
|
||||
#20006=@"loc,{#10000},2,6,2,6"
|
||||
locations_default(#20006,#10000,2,6,2,6)
|
||||
yaml_locations(#20005,#20006)
|
||||
yaml(#20002,1,#10000,0,"tag:yaml.org,2002:map","key: \u1f680\ude80")
|
||||
#20007=@"loc,{#10000},2,1,2,8"
|
||||
locations_default(#20007,#10000,2,1,2,8)
|
||||
yaml_locations(#20002,#20007)
|
||||
numlines(#10000,2,0,0)
|
||||
filetype(#10000,"yaml")
|
||||
|
||||
@@ -87,130 +87,145 @@ yaml(#20028,0,#20017,-3,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20029=@"loc,{#10000},10,13,10,18"
|
||||
locations_default(#20029,#10000,10,13,10,18)
|
||||
yaml_locations(#20028,#20029)
|
||||
#20030=*
|
||||
yaml_comments(#20030," - xx: xxx","# - xx: xxx")
|
||||
#20031=@"loc,{#10000},11,1,11,14"
|
||||
locations_default(#20031,#10000,11,1,11,14)
|
||||
yaml_locations(#20030,#20031)
|
||||
#20032=*
|
||||
yaml_comments(#20032," xxx_xxxxx: xxxxxx.x","# ... xxxxx.x")
|
||||
#20033=@"loc,{#10000},12,1,12,26"
|
||||
locations_default(#20033,#10000,12,1,12,26)
|
||||
yaml_locations(#20032,#20033)
|
||||
yaml(#20017,1,#20016,0,"tag:yaml.org,2002:map","xx: xxxxx")
|
||||
#20030=@"loc,{#10000},8,7,12,27"
|
||||
locations_default(#20030,#10000,8,7,12,27)
|
||||
yaml_locations(#20017,#20030)
|
||||
#20034=@"loc,{#10000},8,7,12,27"
|
||||
locations_default(#20034,#10000,8,7,12,27)
|
||||
yaml_locations(#20017,#20034)
|
||||
yaml(#20016,2,#20013,-1,"tag:yaml.org,2002:seq","- xx: xxxxx")
|
||||
#20031=@"loc,{#10000},8,5,12,27"
|
||||
locations_default(#20031,#10000,8,5,12,27)
|
||||
yaml_locations(#20016,#20031)
|
||||
#20035=@"loc,{#10000},8,5,12,27"
|
||||
locations_default(#20035,#10000,8,5,12,27)
|
||||
yaml_locations(#20016,#20035)
|
||||
yaml(#20013,1,#20000,-3,"tag:yaml.org,2002:map","xxxxxxx:")
|
||||
#20032=@"loc,{#10000},7,3,12,27"
|
||||
locations_default(#20032,#10000,7,3,12,27)
|
||||
yaml_locations(#20013,#20032)
|
||||
#20033=*
|
||||
yaml_scalars(#20033,0,"xxxxx")
|
||||
yaml(#20033,0,#20000,4,"tag:yaml.org,2002:str","xxxxx")
|
||||
#20034=@"loc,{#10000},14,1,14,5"
|
||||
locations_default(#20034,#10000,14,1,14,5)
|
||||
yaml_locations(#20033,#20034)
|
||||
#20035=*
|
||||
#20036=*
|
||||
yaml_scalars(#20036,0,"xxxxxxxxxxx")
|
||||
yaml(#20036,0,#20035,1,"tag:yaml.org,2002:str","xxxxxxxxxxx")
|
||||
#20037=@"loc,{#10000},15,3,15,13"
|
||||
locations_default(#20037,#10000,15,3,15,13)
|
||||
yaml_locations(#20036,#20037)
|
||||
#20038=*
|
||||
#20036=@"loc,{#10000},7,3,12,27"
|
||||
locations_default(#20036,#10000,7,3,12,27)
|
||||
yaml_locations(#20013,#20036)
|
||||
#20037=*
|
||||
yaml_scalars(#20037,0,"xxxxx")
|
||||
yaml(#20037,0,#20000,4,"tag:yaml.org,2002:str","xxxxx")
|
||||
#20038=@"loc,{#10000},14,1,14,5"
|
||||
locations_default(#20038,#10000,14,1,14,5)
|
||||
yaml_locations(#20037,#20038)
|
||||
#20039=*
|
||||
yaml_scalars(#20039,0,"xxxx_xxxxxxx")
|
||||
yaml(#20039,0,#20038,0,"tag:yaml.org,2002:str","xxxx_xxxxxxx")
|
||||
#20040=@"loc,{#10000},16,7,16,18"
|
||||
locations_default(#20040,#10000,16,7,16,18)
|
||||
yaml_locations(#20039,#20040)
|
||||
yaml(#20038,2,#20035,-1,"tag:yaml.org,2002:seq","- xxxx_xxxxxxx")
|
||||
#20041=@"loc,{#10000},16,5,16,19"
|
||||
locations_default(#20041,#10000,16,5,16,19)
|
||||
yaml_locations(#20038,#20041)
|
||||
yaml(#20035,1,#20000,-4,"tag:yaml.org,2002:map","xxxxxxxxxxx:")
|
||||
#20042=@"loc,{#10000},15,3,16,19"
|
||||
locations_default(#20042,#10000,15,3,16,19)
|
||||
yaml_locations(#20035,#20042)
|
||||
#20040=*
|
||||
yaml_scalars(#20040,0,"xxxxxxxxxxx")
|
||||
yaml(#20040,0,#20039,1,"tag:yaml.org,2002:str","xxxxxxxxxxx")
|
||||
#20041=@"loc,{#10000},15,3,15,13"
|
||||
locations_default(#20041,#10000,15,3,15,13)
|
||||
yaml_locations(#20040,#20041)
|
||||
#20042=*
|
||||
#20043=*
|
||||
yaml_scalars(#20043,0,"xxxxxx")
|
||||
yaml(#20043,0,#20000,5,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20044=@"loc,{#10000},18,1,18,6"
|
||||
locations_default(#20044,#10000,18,1,18,6)
|
||||
yaml_scalars(#20043,0,"xxxx_xxxxxxx")
|
||||
yaml(#20043,0,#20042,0,"tag:yaml.org,2002:str","xxxx_xxxxxxx")
|
||||
#20044=@"loc,{#10000},16,7,16,18"
|
||||
locations_default(#20044,#10000,16,7,16,18)
|
||||
yaml_locations(#20043,#20044)
|
||||
#20045=*
|
||||
#20046=*
|
||||
yaml_scalars(#20046,0,"xxxx_xxxxxxx")
|
||||
yaml(#20046,0,#20045,1,"tag:yaml.org,2002:str","xxxx_xxxxxxx")
|
||||
#20047=@"loc,{#10000},19,3,19,14"
|
||||
locations_default(#20047,#10000,19,3,19,14)
|
||||
yaml_locations(#20046,#20047)
|
||||
#20048=*
|
||||
yaml_scalars(#20048,0,"xxxx")
|
||||
yaml(#20048,0,#20045,-1,"tag:yaml.org,2002:str","xxxx")
|
||||
#20049=@"loc,{#10000},19,17,19,20"
|
||||
locations_default(#20049,#10000,19,17,19,20)
|
||||
yaml_locations(#20048,#20049)
|
||||
yaml(#20042,2,#20039,-1,"tag:yaml.org,2002:seq","- xxxx_xxxxxxx")
|
||||
#20045=@"loc,{#10000},16,5,16,19"
|
||||
locations_default(#20045,#10000,16,5,16,19)
|
||||
yaml_locations(#20042,#20045)
|
||||
yaml(#20039,1,#20000,-4,"tag:yaml.org,2002:map","xxxxxxxxxxx:")
|
||||
#20046=@"loc,{#10000},15,3,16,19"
|
||||
locations_default(#20046,#10000,15,3,16,19)
|
||||
yaml_locations(#20039,#20046)
|
||||
#20047=*
|
||||
yaml_scalars(#20047,0,"xxxxxx")
|
||||
yaml(#20047,0,#20000,5,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20048=@"loc,{#10000},18,1,18,6"
|
||||
locations_default(#20048,#10000,18,1,18,6)
|
||||
yaml_locations(#20047,#20048)
|
||||
#20049=*
|
||||
#20050=*
|
||||
yaml_scalars(#20050,0,"xxxxxxxx")
|
||||
yaml(#20050,0,#20045,2,"tag:yaml.org,2002:str","xxxxxxxx")
|
||||
#20051=@"loc,{#10000},20,3,20,10"
|
||||
locations_default(#20051,#10000,20,3,20,10)
|
||||
yaml_scalars(#20050,0,"xxxx_xxxxxxx")
|
||||
yaml(#20050,0,#20049,1,"tag:yaml.org,2002:str","xxxx_xxxxxxx")
|
||||
#20051=@"loc,{#10000},19,3,19,14"
|
||||
locations_default(#20051,#10000,19,3,19,14)
|
||||
yaml_locations(#20050,#20051)
|
||||
#20052=*
|
||||
yaml_scalars(#20052,0,"xxxxxx")
|
||||
yaml(#20052,0,#20045,-2,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20053=@"loc,{#10000},20,13,20,18"
|
||||
locations_default(#20053,#10000,20,13,20,18)
|
||||
yaml_scalars(#20052,0,"xxxx")
|
||||
yaml(#20052,0,#20049,-1,"tag:yaml.org,2002:str","xxxx")
|
||||
#20053=@"loc,{#10000},19,17,19,20"
|
||||
locations_default(#20053,#10000,19,17,19,20)
|
||||
yaml_locations(#20052,#20053)
|
||||
#20054=*
|
||||
yaml_scalars(#20054,0,"xxxxxx")
|
||||
yaml(#20054,0,#20045,3,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20055=@"loc,{#10000},21,3,21,8"
|
||||
locations_default(#20055,#10000,21,3,21,8)
|
||||
yaml_scalars(#20054,0,"xxxxxxxx")
|
||||
yaml(#20054,0,#20049,2,"tag:yaml.org,2002:str","xxxxxxxx")
|
||||
#20055=@"loc,{#10000},20,3,20,10"
|
||||
locations_default(#20055,#10000,20,3,20,10)
|
||||
yaml_locations(#20054,#20055)
|
||||
#20056=*
|
||||
yaml_scalars(#20056,0,"xxx xxx xxxx")
|
||||
yaml(#20056,0,#20045,-3,"tag:yaml.org,2002:str","xxx xxx xxxx")
|
||||
#20057=@"loc,{#10000},21,11,21,22"
|
||||
locations_default(#20057,#10000,21,11,21,22)
|
||||
yaml_scalars(#20056,0,"xxxxxx")
|
||||
yaml(#20056,0,#20049,-2,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20057=@"loc,{#10000},20,13,20,18"
|
||||
locations_default(#20057,#10000,20,13,20,18)
|
||||
yaml_locations(#20056,#20057)
|
||||
yaml(#20045,1,#20000,-5,"tag:yaml.org,2002:map","xxxx_xxxxxxx: xxxx")
|
||||
#20058=@"loc,{#10000},19,3,21,23"
|
||||
locations_default(#20058,#10000,19,3,21,23)
|
||||
yaml_locations(#20045,#20058)
|
||||
#20059=*
|
||||
yaml_scalars(#20059,0,"xxx")
|
||||
yaml(#20059,0,#20000,6,"tag:yaml.org,2002:str","xxx")
|
||||
#20060=@"loc,{#10000},23,1,23,3"
|
||||
locations_default(#20060,#10000,23,1,23,3)
|
||||
yaml_locations(#20059,#20060)
|
||||
#20061=*
|
||||
#20062=*
|
||||
yaml_scalars(#20062,0,"xxxxxx")
|
||||
yaml(#20062,0,#20061,1,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20063=@"loc,{#10000},24,3,24,8"
|
||||
locations_default(#20063,#10000,24,3,24,8)
|
||||
yaml_locations(#20062,#20063)
|
||||
#20064=*
|
||||
#20058=*
|
||||
yaml_scalars(#20058,0,"xxxxxx")
|
||||
yaml(#20058,0,#20049,3,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20059=@"loc,{#10000},21,3,21,8"
|
||||
locations_default(#20059,#10000,21,3,21,8)
|
||||
yaml_locations(#20058,#20059)
|
||||
#20060=*
|
||||
yaml_scalars(#20060,0,"xxx xxx xxxx")
|
||||
yaml(#20060,0,#20049,-3,"tag:yaml.org,2002:str","xxx xxx xxxx")
|
||||
#20061=@"loc,{#10000},21,11,21,22"
|
||||
locations_default(#20061,#10000,21,11,21,22)
|
||||
yaml_locations(#20060,#20061)
|
||||
yaml(#20049,1,#20000,-5,"tag:yaml.org,2002:map","xxxx_xxxxxxx: xxxx")
|
||||
#20062=@"loc,{#10000},19,3,21,23"
|
||||
locations_default(#20062,#10000,19,3,21,23)
|
||||
yaml_locations(#20049,#20062)
|
||||
#20063=*
|
||||
yaml_scalars(#20063,0,"xxx")
|
||||
yaml(#20063,0,#20000,6,"tag:yaml.org,2002:str","xxx")
|
||||
#20064=@"loc,{#10000},23,1,23,3"
|
||||
locations_default(#20064,#10000,23,1,23,3)
|
||||
yaml_locations(#20063,#20064)
|
||||
#20065=*
|
||||
yaml_scalars(#20065,0,"xxxxxx")
|
||||
yaml(#20065,0,#20064,1,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20066=@"loc,{#10000},26,5,26,10"
|
||||
locations_default(#20066,#10000,26,5,26,10)
|
||||
yaml_locations(#20065,#20066)
|
||||
#20067=*
|
||||
yaml_scalars(#20067,0,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxx/xxxxxx/xxxxxxxxxxxxxxxxxxx/xxxxxxxxxxx/xxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxx/xxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxx=")
|
||||
yaml(#20067,0,#20064,-1,"tag:yaml.org,2002:str","xxxxxxx ... xxxxxx=")
|
||||
#20068=@"loc,{#10000},26,13,26,696"
|
||||
locations_default(#20068,#10000,26,13,26,696)
|
||||
yaml_locations(#20067,#20068)
|
||||
yaml(#20064,1,#20061,-1,"tag:yaml.org,2002:map","xxxxxx: ... xxxxxx=")
|
||||
#20069=@"loc,{#10000},26,5,26,697"
|
||||
locations_default(#20069,#10000,26,5,26,697)
|
||||
yaml_locations(#20064,#20069)
|
||||
yaml(#20061,1,#20000,-6,"tag:yaml.org,2002:map","xxxxxx:")
|
||||
#20070=@"loc,{#10000},24,3,26,697"
|
||||
locations_default(#20070,#10000,24,3,26,697)
|
||||
yaml_locations(#20061,#20070)
|
||||
#20066=*
|
||||
yaml_scalars(#20066,0,"xxxxxx")
|
||||
yaml(#20066,0,#20065,1,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20067=@"loc,{#10000},24,3,24,8"
|
||||
locations_default(#20067,#10000,24,3,24,8)
|
||||
yaml_locations(#20066,#20067)
|
||||
#20068=*
|
||||
#20069=*
|
||||
yaml_comments(#20069," xx_xxxxx","# xx_xxxxx")
|
||||
#20070=@"loc,{#10000},25,5,25,14"
|
||||
locations_default(#20070,#10000,25,5,25,14)
|
||||
yaml_locations(#20069,#20070)
|
||||
#20071=*
|
||||
yaml_scalars(#20071,0,"xxxxxx")
|
||||
yaml(#20071,0,#20068,1,"tag:yaml.org,2002:str","xxxxxx")
|
||||
#20072=@"loc,{#10000},26,5,26,10"
|
||||
locations_default(#20072,#10000,26,5,26,10)
|
||||
yaml_locations(#20071,#20072)
|
||||
#20073=*
|
||||
yaml_scalars(#20073,0,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxx/xxxxxx/xxxxxxxxxxxxxxxxxxx/xxxxxxxxxxx/xxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxx/xxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxx=")
|
||||
yaml(#20073,0,#20068,-1,"tag:yaml.org,2002:str","xxxxxxx ... xxxxxx=")
|
||||
#20074=@"loc,{#10000},26,13,26,696"
|
||||
locations_default(#20074,#10000,26,13,26,696)
|
||||
yaml_locations(#20073,#20074)
|
||||
yaml(#20068,1,#20065,-1,"tag:yaml.org,2002:map","xxxxxx: ... xxxxxx=")
|
||||
#20075=@"loc,{#10000},26,5,26,697"
|
||||
locations_default(#20075,#10000,26,5,26,697)
|
||||
yaml_locations(#20068,#20075)
|
||||
yaml(#20065,1,#20000,-6,"tag:yaml.org,2002:map","xxxxxx:")
|
||||
#20076=@"loc,{#10000},24,3,26,697"
|
||||
locations_default(#20076,#10000,24,3,26,697)
|
||||
yaml_locations(#20065,#20076)
|
||||
yaml(#20000,1,#10000,0,"tag:yaml.org,2002:map","xxxxxxxx: xxxx_xx")
|
||||
#20071=@"loc,{#10000},1,1,26,697"
|
||||
locations_default(#20071,#10000,1,1,26,697)
|
||||
yaml_locations(#20000,#20071)
|
||||
#20077=@"loc,{#10000},1,1,26,697"
|
||||
locations_default(#20077,#10000,1,1,26,697)
|
||||
yaml_locations(#20000,#20077)
|
||||
numlines(#10000,26,0,0)
|
||||
filetype(#10000,"yaml")
|
||||
|
||||
@@ -44,6 +44,12 @@ private module YamlSig implements LibYaml::InputSig {
|
||||
class ParseErrorBase extends LocatableBase, @yaml_error {
|
||||
string getMessage() { yaml_errors(this, result) }
|
||||
}
|
||||
|
||||
class CommentBase extends LocatableBase, @yaml_comment {
|
||||
string getText() { yaml_comments(this, result, _) }
|
||||
|
||||
override string toString() { yaml_comments(this, _, result) }
|
||||
}
|
||||
}
|
||||
|
||||
import LibYaml::Make<YamlSig>
|
||||
|
||||
@@ -1090,13 +1090,17 @@ yaml_scalars (unique int scalar: @yaml_scalar_node ref,
|
||||
int style: int ref,
|
||||
string value: string ref);
|
||||
|
||||
yaml_comments (unique int id: @yaml_comment,
|
||||
string text: string ref,
|
||||
string tostring: string ref);
|
||||
|
||||
yaml_errors (unique int id: @yaml_error,
|
||||
string message: string ref);
|
||||
|
||||
yaml_locations(unique int locatable: @yaml_locatable ref,
|
||||
int location: @location_default ref);
|
||||
|
||||
@yaml_locatable = @yaml_node | @yaml_error;
|
||||
@yaml_locatable = @yaml_node | @yaml_error | @yaml_comment;
|
||||
|
||||
/*- XML Files -*/
|
||||
|
||||
|
||||
@@ -1406,6 +1406,10 @@
|
||||
<v>1</v>
|
||||
</e>
|
||||
<e>
|
||||
<k>@yaml_comment</k>
|
||||
<v>1000</v>
|
||||
</e>
|
||||
<e>
|
||||
<k>@jsx_element</k>
|
||||
<v>1090</v>
|
||||
</e>
|
||||
@@ -24077,6 +24081,122 @@
|
||||
</dependencies>
|
||||
</relation>
|
||||
<relation>
|
||||
<name>yaml_comments</name>
|
||||
<cardinality>1000</cardinality>
|
||||
<columnsizes>
|
||||
<e>
|
||||
<k>id</k>
|
||||
<v>1000</v>
|
||||
</e>
|
||||
<e>
|
||||
<k>text</k>
|
||||
<v>1000</v>
|
||||
</e>
|
||||
<e>
|
||||
<k>tostring</k>
|
||||
<v>1000</v>
|
||||
</e>
|
||||
</columnsizes>
|
||||
<dependencies>
|
||||
<dep>
|
||||
<src>id</src>
|
||||
<trg>text</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>id</src>
|
||||
<trg>tostring</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>text</src>
|
||||
<trg>id</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>text</src>
|
||||
<trg>tostring</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>tostring</src>
|
||||
<trg>id</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>tostring</src>
|
||||
<trg>text</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
</dependencies>
|
||||
</relation>
|
||||
<relation>
|
||||
<name>xmlEncoding</name>
|
||||
<cardinality>39724</cardinality>
|
||||
<columnsizes>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Extract YAML comments
|
||||
compatibility: backwards
|
||||
@@ -0,0 +1,20 @@
|
||||
| comments.yml:1:1:1:22 | # leadi ... comment | leading file comment |
|
||||
| comments.yml:2:5:2:29 | # docum ... comment | document marker comment |
|
||||
| comments.yml:3:7:3:29 | #commen ... oot key | comment after root key |
|
||||
| comments.yml:4:3:4:42 | # inden ... roperty | indented comment before first property |
|
||||
| comments.yml:5:15:5:43 | # comme ... scalar | comment after quoted scalar |
|
||||
| comments.yml:6:10:6:46 | #commen ... l value | comment after an explicit null value |
|
||||
| comments.yml:7:9:7:32 | # comme ... ist key | comment after list key |
|
||||
| comments.yml:8:5:8:34 | # comme ... ce item | comment before sequence item |
|
||||
| comments.yml:9:13:9:50 | #commen ... mapping | comment after inline sequence mapping |
|
||||
| comments.yml:10:20:10:47 | # comme ... scalar | comment after plain scalar |
|
||||
| comments.yml:11:7:11:31 | # comme ... re dash | comment after bare dash |
|
||||
| comments.yml:12:13:12:51 | # comme ... equence | comment after mapping key in sequence |
|
||||
| comments.yml:13:21:13:42 | #commen ... boolean | comment after boolean |
|
||||
| comments.yml:14:27:14:55 | # comme ... equence | comment after flow sequence |
|
||||
| comments.yml:15:33:15:60 | # comme ... mapping | comment after flow mapping |
|
||||
| comments.yml:16:55:16:79 | # comme ... ow list | comment after flow list |
|
||||
| comments.yml:17:12:17:47 | #commen ... header | comment after literal scalar header |
|
||||
| comments.yml:20:13:20:47 | #commen ... header | comment after folded scalar header |
|
||||
| comments.yml:23:52:23:85 | # comme ... g value | comment after hash-looking value |
|
||||
| comments.yml:24:1:24:39 | # comme ... ent end | comment between body and document end |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from YamlComment c
|
||||
select c, c.getText()
|
||||
26
javascript/ql/test/library-tests/Comments/comments.yml
Normal file
26
javascript/ql/test/library-tests/Comments/comments.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
# leading file comment
|
||||
--- # document marker comment
|
||||
root: #comment after root key
|
||||
# indented comment before first property
|
||||
name: "odd" # comment after quoted scalar
|
||||
empty: #comment after an explicit null value
|
||||
list: # comment after list key
|
||||
# comment before sequence item
|
||||
- id: 1 #comment after inline sequence mapping
|
||||
label: plain # comment after plain scalar
|
||||
- # comment after bare dash
|
||||
id: 2 # comment after mapping key in sequence
|
||||
enabled: true #comment after boolean
|
||||
tags: [alpha, beta] # comment after flow sequence
|
||||
flow_map: {left: 1, right: 2} # comment after flow mapping
|
||||
flow_list: [first, second, "third # not a comment"] # comment after flow list
|
||||
block: | #comment after literal scalar header
|
||||
this line belongs to the scalar
|
||||
# this hash is text, not a YAML comment
|
||||
folded: > #comment after folded scalar header
|
||||
folded text with # also just text
|
||||
and another scalar line
|
||||
trailing_hash: "there is # no comment # in here" # comment after hash-looking value
|
||||
# comment between body and document end
|
||||
... # document end comment
|
||||
# final comment after document end
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
description: Extract YAML comments
|
||||
compatibility: full
|
||||
yaml_comments.rel: delete
|
||||
@@ -45,6 +45,12 @@ private module YamlSig implements LibYaml::InputSig {
|
||||
class ParseErrorBase extends LocatableBase, @yaml_error {
|
||||
string getMessage() { yaml_errors(this, result) }
|
||||
}
|
||||
|
||||
class CommentBase extends LocatableBase, @yaml_comment {
|
||||
string getText() { yaml_comments(this, result, _) }
|
||||
|
||||
override string toString() { yaml_comments(this, _, result) }
|
||||
}
|
||||
}
|
||||
|
||||
import LibYaml::Make<YamlSig>
|
||||
|
||||
@@ -280,13 +280,17 @@ yaml_scalars (unique int scalar: @yaml_scalar_node ref,
|
||||
int style: int ref,
|
||||
string value: string ref);
|
||||
|
||||
yaml_comments (unique int id: @yaml_comment,
|
||||
string text: string ref,
|
||||
string tostring: string ref);
|
||||
|
||||
yaml_errors (unique int id: @yaml_error,
|
||||
string message: string ref);
|
||||
|
||||
yaml_locations(unique int locatable: @yaml_locatable ref,
|
||||
int location: @location_default ref);
|
||||
|
||||
@yaml_locatable = @yaml_node | @yaml_error;
|
||||
@yaml_locatable = @yaml_node | @yaml_error | @yaml_comment;
|
||||
|
||||
/*- Python dbscheme -*/
|
||||
|
||||
|
||||
@@ -641,6 +641,10 @@
|
||||
<k>@yaml_error</k>
|
||||
<v>1</v>
|
||||
</e>
|
||||
<e>
|
||||
<k>@yaml_comment</k>
|
||||
<v>1000</v>
|
||||
</e>
|
||||
</typesizes>
|
||||
<stats><relation>
|
||||
<name>externalDefects</name>
|
||||
@@ -18657,5 +18661,121 @@
|
||||
</dep>
|
||||
</dependencies>
|
||||
</relation>
|
||||
<relation>
|
||||
<name>yaml_comments</name>
|
||||
<cardinality>1000</cardinality>
|
||||
<columnsizes>
|
||||
<e>
|
||||
<k>id</k>
|
||||
<v>1000</v>
|
||||
</e>
|
||||
<e>
|
||||
<k>text</k>
|
||||
<v>1000</v>
|
||||
</e>
|
||||
<e>
|
||||
<k>tostring</k>
|
||||
<v>1000</v>
|
||||
</e>
|
||||
</columnsizes>
|
||||
<dependencies>
|
||||
<dep>
|
||||
<src>id</src>
|
||||
<trg>text</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>id</src>
|
||||
<trg>tostring</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>text</src>
|
||||
<trg>id</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>text</src>
|
||||
<trg>tostring</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>tostring</src>
|
||||
<trg>id</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
<dep>
|
||||
<src>tostring</src>
|
||||
<trg>text</trg>
|
||||
<val>
|
||||
<hist>
|
||||
<budget>12</budget>
|
||||
<bs>
|
||||
<b>
|
||||
<a>1</a>
|
||||
<b>2</b>
|
||||
<v>1000</v>
|
||||
</b>
|
||||
</bs>
|
||||
</hist>
|
||||
</val>
|
||||
</dep>
|
||||
</dependencies>
|
||||
</relation>
|
||||
</stats>
|
||||
</dbstats>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Extract YAML comments
|
||||
compatibility: backwards
|
||||
@@ -2737,6 +2737,12 @@ module YAML {
|
||||
class ParseErrorBase extends LocatableBase, @yaml_error {
|
||||
string getMessage() { yaml_errors(this, result) }
|
||||
}
|
||||
|
||||
class CommentBase extends LocatableBase, @yaml_comment {
|
||||
string getText() { yaml_comments(this, result, _) }
|
||||
|
||||
override string toString() { yaml_comments(this, _, result) }
|
||||
}
|
||||
}
|
||||
|
||||
import LibYaml::Make<YamlSig>
|
||||
|
||||
@@ -46,6 +46,12 @@ private module YamlSig implements LibYaml::InputSig {
|
||||
class ParseErrorBase extends LocatableBase, @yaml_error {
|
||||
string getMessage() { yaml_errors(this, result) }
|
||||
}
|
||||
|
||||
class CommentBase extends LocatableBase, @yaml_comment {
|
||||
string getText() { yaml_comments(this, result, _) }
|
||||
|
||||
override string toString() { yaml_comments(this, _, result) }
|
||||
}
|
||||
}
|
||||
|
||||
import LibYaml::Make<YamlSig>
|
||||
|
||||
@@ -101,13 +101,17 @@ yaml_scalars (unique int scalar: @yaml_scalar_node ref,
|
||||
int style: int ref,
|
||||
string value: string ref);
|
||||
|
||||
yaml_comments (unique int id: @yaml_comment,
|
||||
string text: string ref,
|
||||
string tostring: string ref);
|
||||
|
||||
yaml_errors (unique int id: @yaml_error,
|
||||
string message: string ref);
|
||||
|
||||
yaml_locations(unique int locatable: @yaml_locatable ref,
|
||||
int location: @location_default ref);
|
||||
|
||||
@yaml_locatable = @yaml_node | @yaml_error;
|
||||
@yaml_locatable = @yaml_node | @yaml_error | @yaml_comment;
|
||||
|
||||
/*- Database metadata -*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
description: Extract YAML comments
|
||||
compatibility: full
|
||||
yaml_comments.rel: delete
|
||||
@@ -101,13 +101,17 @@ yaml_scalars (unique int scalar: @yaml_scalar_node ref,
|
||||
int style: int ref,
|
||||
string value: string ref);
|
||||
|
||||
yaml_comments (unique int id: @yaml_comment,
|
||||
string text: string ref,
|
||||
string tostring: string ref);
|
||||
|
||||
yaml_errors (unique int id: @yaml_error,
|
||||
string message: string ref);
|
||||
|
||||
yaml_locations(unique int locatable: @yaml_locatable ref,
|
||||
int location: @location_default ref);
|
||||
|
||||
@yaml_locatable = @yaml_node | @yaml_error;
|
||||
@yaml_locatable = @yaml_node | @yaml_error | @yaml_comment;
|
||||
|
||||
/*- Database metadata -*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Extract YAML comments
|
||||
compatibility: backwards
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
description: Extract YAML comments
|
||||
compatibility: full
|
||||
yaml_comments.rel: delete
|
||||
@@ -100,13 +100,17 @@ yaml_scalars (unique int scalar: @yaml_scalar_node ref,
|
||||
int style: int ref,
|
||||
string value: string ref);
|
||||
|
||||
yaml_comments (unique int id: @yaml_comment,
|
||||
string text: string ref,
|
||||
string tostring: string ref);
|
||||
|
||||
yaml_errors (unique int id: @yaml_error,
|
||||
string message: string ref);
|
||||
|
||||
yaml_locations(unique int locatable: @yaml_locatable ref,
|
||||
int location: @location_default ref);
|
||||
|
||||
@yaml_locatable = @yaml_node | @yaml_error;
|
||||
@yaml_locatable = @yaml_node | @yaml_error | @yaml_comment;
|
||||
|
||||
/*- Database metadata -*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Extract YAML comments
|
||||
compatibility: backwards
|
||||
@@ -134,6 +134,23 @@ signature module InputSig {
|
||||
*/
|
||||
string getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* A base class for comments.
|
||||
*
|
||||
* Typically `@yaml_comment`.
|
||||
*/
|
||||
class CommentBase extends LocatableBase {
|
||||
/**
|
||||
* Gets the text of this comment, not including delimiters.
|
||||
*/
|
||||
string getText();
|
||||
|
||||
/**
|
||||
* Gets a textual representation of this comment.
|
||||
*/
|
||||
string toString();
|
||||
}
|
||||
}
|
||||
|
||||
/** Provides a class hierarchy for working with YAML files. */
|
||||
@@ -607,6 +624,26 @@ module Make<InputSig Input> {
|
||||
string toString() { result = super.getMessage() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A YAML comment.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* # here is a comment
|
||||
* ```
|
||||
*/
|
||||
class YamlComment instanceof Input::CommentBase {
|
||||
/** Gets the `Location` of this comment. */
|
||||
Input::Location getLocation() { result = super.getLocation() }
|
||||
|
||||
/** Gets the text of this comment, not including delimiters. */
|
||||
string getText() { result = super.getText() }
|
||||
|
||||
/** Gets a textual representation of this comment. */
|
||||
string toString() { result = super.toString() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A YAML node that may contain sub-nodes that can be identified by a name.
|
||||
* I.e. a mapping, sequence, or scalar.
|
||||
|
||||
@@ -101,13 +101,17 @@ yaml_scalars (unique int scalar: @yaml_scalar_node ref,
|
||||
int style: int ref,
|
||||
string value: string ref);
|
||||
|
||||
yaml_comments (unique int id: @yaml_comment,
|
||||
string text: string ref,
|
||||
string tostring: string ref);
|
||||
|
||||
yaml_errors (unique int id: @yaml_error,
|
||||
string message: string ref);
|
||||
|
||||
yaml_locations(unique int locatable: @yaml_locatable ref,
|
||||
int location: @location_default ref);
|
||||
|
||||
@yaml_locatable = @yaml_node | @yaml_error;
|
||||
@yaml_locatable = @yaml_node | @yaml_error | @yaml_comment;
|
||||
|
||||
/*- Database metadata -*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user