mirror of
https://github.com/github/codeql.git
synced 2026-06-19 11:51:08 +02:00
Python: Add support for YAML comments.
This commit is contained in:
@@ -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,24 @@
|
||||
</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/>
|
||||
</relation>
|
||||
</stats>
|
||||
</dbstats>
|
||||
|
||||
Reference in New Issue
Block a user