Merge pull request #1642 from xiemaisi/json_locations

Approved by asger-semmle
This commit is contained in:
semmle-qlci
2019-07-29 14:55:33 +01:00
committed by GitHub
41 changed files with 7386 additions and 136 deletions

View File

@@ -43,6 +43,7 @@ public class JSONExtractor implements IExtractor {
throw recoverableErrors.get(0).asUserError();
Label fileLabel = locationManager.getFileLabel();
locationManager.setHasLocationTable("json_locations");
v.accept(
new Visitor<Context, Label>() {
private Label emit(JSONValue nd, int kind, Context c) {

View File

@@ -20,6 +20,7 @@ public class LocationManager {
private int startColumn;
private int startLine;
private final Set<String> locationDefaultEmitted = new LinkedHashSet<String>();
private String hasLocation = "hasLocation";
public LocationManager(File sourceFile, TrapWriter trapWriter, Label fileLabel) {
this.sourceFile = sourceFile;
@@ -58,6 +59,10 @@ public class LocationManager {
startColumn = column;
}
public void setHasLocationTable(String hasLocation) {
this.hasLocation = hasLocation;
}
/**
* Emit location information for an AST node. The node's location is translated from the parser's
* 0-based column numbering scheme into our 1-based scheme and then emitted as a snippet location.
@@ -91,7 +96,7 @@ public class LocationManager {
/** Emit an absolute location in the current file. No line or column adjustment is performed. */
public void emitFileLocation(Label lbl, int sl, int sc, int el, int ec) {
Label locLabel = emitLocationsDefault(sl, sc, el, ec);
trapWriter.addTuple("hasLocation", lbl, locLabel);
trapWriter.addTuple(hasLocation, lbl, locLabel);
}
/**

View File

@@ -37,7 +37,7 @@ public class Main {
* A version identifier that should be updated every time the extractor changes in such a way that
* it may produce different tuples for the same file under the same {@link ExtractorConfig}.
*/
public static final String EXTRACTOR_VERSION = "2019-04-17";
public static final String EXTRACTOR_VERSION = "2019-07-25";
public static final Pattern NEWLINE = Pattern.compile("\n");

View File

@@ -99,6 +99,7 @@ public class YAMLExtractor implements IExtractor {
trapWriter = textualExtractor.getTrapwriter();
Label fileLabel = locationManager.getFileLabel();
locationManager.setHasLocationTable("yaml_locations");
try {
parser = new ParserImpl(new StreamReader(textualExtractor.getSource()));
resolver = new Resolver();

View File

@@ -12,12 +12,12 @@ scopes(#20000,0)
json(#20001,5,#10000,0,"{\n ""a"": 42\n}")
#20002=@"loc,{#10000},1,1,3,1"
locations_default(#20002,#10000,1,1,3,1)
hasLocation(#20001,#20002)
json_locations(#20001,#20002)
#20003=*
json(#20003,2,#20001,0,"42")
#20004=@"loc,{#10000},2,8,2,9"
locations_default(#20004,#10000,2,8,2,9)
hasLocation(#20003,#20004)
json_locations(#20003,#20004)
json_literals("42","42",#20003)
json_properties(#20001,"a",#20003)
numlines(#10000,3,0,0)

View File

@@ -13,6 +13,6 @@ hasLocation(#10000,#10003)
json(#20000,5,#10000,0,"{}")
#20001=@"loc,{#10000},1,1,1,2"
locations_default(#20001,#10000,1,1,1,2)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
numlines(#10000,1,0,0)
filetype(#10000,"json")

View File

@@ -10,6 +10,6 @@ hasLocation(#10000,#10002)
json(#20000,4,#10000,0,"[]")
#20001=@"loc,{#10000},1,1,1,2"
locations_default(#20001,#10000,1,1,1,2)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
numlines(#10000,1,0,0)
filetype(#10000,"json")

View File

@@ -10,23 +10,23 @@ hasLocation(#10000,#10002)
json(#20000,5,#10000,0,"{\n // ... ts */\n}")
#20001=@"loc,{#10000},1,1,5,1"
locations_default(#20001,#10000,1,1,5,1)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
#20002=*
json(#20002,3,#20000,0,"""world""")
#20003=@"loc,{#10000},3,12,3,18"
locations_default(#20003,#10000,3,12,3,18)
hasLocation(#20002,#20003)
json_locations(#20002,#20003)
json_literals("world","""world""",#20002)
json_properties(#20000,"hello",#20002)
#20004=*
json_errors(#20004,"Error: Comments are not legal in JSON.")
#20005=@"loc,{#10000},2,3,2,3"
locations_default(#20005,#10000,2,3,2,3)
hasLocation(#20004,#20005)
json_locations(#20004,#20005)
#20006=*
json_errors(#20006,"Error: Comments are not legal in JSON.")
#20007=@"loc,{#10000},4,3,4,3"
locations_default(#20007,#10000,4,3,4,3)
hasLocation(#20006,#20007)
json_locations(#20006,#20007)
numlines(#10000,5,0,0)
filetype(#10000,"json")

View File

@@ -10,19 +10,19 @@ hasLocation(#10000,#10002)
json(#20000,5,#10000,0,"{\n "" ... "": 42\n}")
#20001=@"loc,{#10000},1,1,4,1"
locations_default(#20001,#10000,1,1,4,1)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
#20002=*
json(#20002,2,#20000,0,"23")
#20003=@"loc,{#10000},2,10,2,11"
locations_default(#20003,#10000,2,10,2,11)
hasLocation(#20002,#20003)
json_locations(#20002,#20003)
json_literals("23","23",#20002)
json_properties(#20000,"x",#20002)
#20004=*
json(#20004,2,#20000,1,"42")
#20005=@"loc,{#10000},3,10,3,11"
locations_default(#20005,#10000,3,10,3,11)
hasLocation(#20004,#20005)
json_locations(#20004,#20005)
json_literals("42","42",#20004)
json_properties(#20000,"x",#20004)
numlines(#10000,4,0,0)

View File

@@ -10,7 +10,7 @@ hasLocation(#10000,#10002)
json(#20000,2,#10000,0,"-1")
#20001=@"loc,{#10000},1,1,1,2"
locations_default(#20001,#10000,1,1,1,2)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
json_literals("-1","-1",#20000)
numlines(#10000,1,0,0)
filetype(#10000,"json")

View File

@@ -10,18 +10,18 @@ hasLocation(#10000,#10002)
json(#20000,4,#10000,0,"[1, -2]")
#20001=@"loc,{#10000},1,1,1,7"
locations_default(#20001,#10000,1,1,1,7)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
#20002=*
json(#20002,2,#20000,0,"1")
#20003=@"loc,{#10000},1,2,1,2"
locations_default(#20003,#10000,1,2,1,2)
hasLocation(#20002,#20003)
json_locations(#20002,#20003)
json_literals("1","1",#20002)
#20004=*
json(#20004,2,#20000,1,"-2")
#20005=@"loc,{#10000},1,5,1,6"
locations_default(#20005,#10000,1,5,1,6)
hasLocation(#20004,#20005)
json_locations(#20004,#20005)
json_literals("-2","-2",#20004)
numlines(#10000,1,0,0)
filetype(#10000,"json")

View File

@@ -10,7 +10,7 @@ hasLocation(#10000,#10002)
json(#20000,0,#10000,0,"null")
#20001=@"loc,{#10000},1,1,1,4"
locations_default(#20001,#10000,1,1,1,4)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
json_literals("null","null",#20000)
numlines(#10000,1,0,0)
filetype(#10000,"json")

View File

@@ -10,31 +10,31 @@ hasLocation(#10000,#10002)
json(#20000,5,#10000,0,"{\n "" ... }\n}")
#20001=@"loc,{#10000},1,1,7,1"
locations_default(#20001,#10000,1,1,7,1)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
#20002=*
json(#20002,3,#20000,0,"""world""")
#20003=@"loc,{#10000},2,14,2,20"
locations_default(#20003,#10000,2,14,2,20)
hasLocation(#20002,#20003)
json_locations(#20002,#20003)
json_literals("world","""world""",#20002)
json_properties(#20000,"hello",#20002)
#20004=*
json(#20004,5,#20000,1,"{\n ... 2\n }")
#20005=@"loc,{#10000},3,10,6,5"
locations_default(#20005,#10000,3,10,6,5)
hasLocation(#20004,#20005)
json_locations(#20004,#20005)
#20006=*
json(#20006,2,#20004,0,"23")
#20007=@"loc,{#10000},4,14,4,15"
locations_default(#20007,#10000,4,14,4,15)
hasLocation(#20006,#20007)
json_locations(#20006,#20007)
json_literals("23","23",#20006)
json_properties(#20004,"x",#20006)
#20008=*
json(#20008,2,#20004,1,"42")
#20009=@"loc,{#10000},5,14,5,15"
locations_default(#20009,#10000,5,14,5,15)
hasLocation(#20008,#20009)
json_locations(#20008,#20009)
json_literals("42","42",#20008)
json_properties(#20004,"y",#20008)
json_properties(#20000,"o",#20004)

View File

@@ -13,7 +13,7 @@ hasLocation(#10000,#10003)
json(#20000,3,#10000,0,"""i get extracted""")
#20001=@"loc,{#10000},1,1,1,17"
locations_default(#20001,#10000,1,1,1,17)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
json_literals("i get extracted","""i get extracted""",#20000)
numlines(#10000,1,0,0)
filetype(#10000,"json")

View File

@@ -10,12 +10,12 @@ hasLocation(#10000,#10002)
json(#20000,5,#10000,0,"{\n ""so ... dule""\n}")
#20001=@"loc,{#10000},1,1,3,1"
locations_default(#20001,#10000,1,1,3,1)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
#20002=*
json(#20002,3,#20000,0,"""module""")
#20003=@"loc,{#10000},2,17,2,24"
locations_default(#20003,#10000,2,17,2,24)
hasLocation(#20002,#20003)
json_locations(#20002,#20003)
json_literals("module","""module""",#20002)
json_properties(#20000,"sourceType",#20002)
numlines(#10000,3,0,0)

View File

@@ -10,12 +10,12 @@ hasLocation(#10000,#10002)
json(#20000,5,#10000,0,"{\n ""pa ... lint""\n}")
#20001=@"loc,{#10000},1,1,3,1"
locations_default(#20001,#10000,1,1,3,1)
hasLocation(#20000,#20001)
json_locations(#20000,#20001)
#20002=*
json(#20002,3,#20000,0,"""babel-eslint""")
#20003=@"loc,{#10000},2,13,2,26"
locations_default(#20003,#10000,2,13,2,26)
hasLocation(#20002,#20003)
json_locations(#20002,#20003)
json_literals("babel-eslint","""babel-eslint""",#20002)
json_properties(#20000,"parser",#20002)
numlines(#10000,3,0,0)

View File

@@ -11,6 +11,6 @@ yaml_scalars(#20000,0,"x:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
yaml(#20000,0,#10000,0,"tag:yaml.org,2002:str","x:xxxxx ... xxxxxxx")
#20001=@"loc,{#10000},1,1,1,1024"
locations_default(#20001,#10000,1,1,1,1024)
hasLocation(#20000,#20001)
yaml_locations(#20000,#20001)
numlines(#10000,1,0,0)
filetype(#10000,"yaml")

View File

@@ -12,7 +12,7 @@ yaml_scalars(#20001,0,"cyclic")
yaml(#20001,0,#20000,1,"tag:yaml.org,2002:str","cyclic")
#20002=@"loc,{#10000},2,1,2,6"
locations_default(#20002,#10000,2,1,2,6)
hasLocation(#20001,#20002)
yaml_locations(#20001,#20002)
#20003=*
yaml_anchors(#20003,"cyc")
#20004=*
@@ -20,20 +20,20 @@ yaml_scalars(#20004,0,"backedge")
yaml(#20004,0,#20003,1,"tag:yaml.org,2002:str","backedge")
#20005=@"loc,{#10000},3,5,3,12"
locations_default(#20005,#10000,3,5,3,12)
hasLocation(#20004,#20005)
yaml_locations(#20004,#20005)
#20006=*
yaml_aliases(#20006,"cyc")
yaml(#20006,3,#20003,-1,"","*cyc")
#20007=@"loc,{#10000},3,15,3,18"
locations_default(#20007,#10000,3,15,3,18)
hasLocation(#20006,#20007)
yaml_locations(#20006,#20007)
yaml(#20003,1,#20000,-1,"tag:yaml.org,2002:map","&cyc")
#20008=@"loc,{#10000},2,9,4,0"
locations_default(#20008,#10000,2,9,4,0)
hasLocation(#20003,#20008)
yaml_locations(#20003,#20008)
yaml(#20000,1,#10000,0,"tag:yaml.org,2002:map","cyclic: &cyc")
#20009=@"loc,{#10000},2,1,4,0"
locations_default(#20009,#10000,2,1,4,0)
hasLocation(#20000,#20009)
yaml_locations(#20000,#20009)
numlines(#10000,3,0,0)
filetype(#10000,"yaml")

View File

@@ -11,6 +11,6 @@ yaml_scalars(#20000,0,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
yaml(#20000,0,#10000,0,"tag:yaml.org,2002:str","xxxxxxx ... xxxxx:x")
#20001=@"loc,{#10000},1,1,1,1024"
locations_default(#20001,#10000,1,1,1,1024)
hasLocation(#20000,#20001)
yaml_locations(#20000,#20001)
numlines(#10000,1,0,0)
filetype(#10000,"yaml")

View File

@@ -11,6 +11,6 @@ yaml_scalars(#20000,0,"x:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
yaml(#20000,0,#10000,0,"tag:yaml.org,2002:str","x:xxxxx ... xxxxxxx")
#20001=@"loc,{#10000},1,1,1,1024"
locations_default(#20001,#10000,1,1,1,1024)
hasLocation(#20000,#20001)
yaml_locations(#20000,#20001)
numlines(#10000,1,0,0)
filetype(#10000,"yaml")

View File

@@ -14,61 +14,61 @@ yaml_scalars(#20002,0,"x")
yaml(#20002,0,#20001,1,"tag:yaml.org,2002:str","x")
#20003=@"loc,{#10000},1,8,1,8"
locations_default(#20003,#10000,1,8,1,8)
hasLocation(#20002,#20003)
yaml_locations(#20002,#20003)
#20004=*
yaml_scalars(#20004,0,"23")
yaml(#20004,0,#20001,-1,"tag:yaml.org,2002:int","23")
#20005=@"loc,{#10000},1,11,1,12"
locations_default(#20005,#10000,1,11,1,12)
hasLocation(#20004,#20005)
yaml_locations(#20004,#20005)
#20006=*
yaml_scalars(#20006,0,"y")
yaml(#20006,0,#20001,2,"tag:yaml.org,2002:str","y")
#20007=@"loc,{#10000},1,15,1,15"
locations_default(#20007,#10000,1,15,1,15)
hasLocation(#20006,#20007)
yaml_locations(#20006,#20007)
#20008=*
yaml_scalars(#20008,0,"42")
yaml(#20008,0,#20001,-2,"tag:yaml.org,2002:int","42")
#20009=@"loc,{#10000},1,18,1,19"
locations_default(#20009,#10000,1,18,1,19)
hasLocation(#20008,#20009)
yaml_locations(#20008,#20009)
yaml(#20001,1,#20000,0,"tag:yaml.org,2002:map","&A { x: 23, y: 42 }")
#20010=@"loc,{#10000},1,3,1,21"
locations_default(#20010,#10000,1,3,1,21)
hasLocation(#20001,#20010)
yaml_locations(#20001,#20010)
#20011=*
#20012=*
yaml_scalars(#20012,0,"x")
yaml(#20012,0,#20011,1,"tag:yaml.org,2002:str","x")
#20013=@"loc,{#10000},2,3,2,3"
locations_default(#20013,#10000,2,3,2,3)
hasLocation(#20012,#20013)
yaml_locations(#20012,#20013)
#20014=*
yaml_scalars(#20014,0,"56")
yaml(#20014,0,#20011,-1,"tag:yaml.org,2002:int","56")
#20015=@"loc,{#10000},2,6,2,7"
locations_default(#20015,#10000,2,6,2,7)
hasLocation(#20014,#20015)
yaml_locations(#20014,#20015)
#20016=*
yaml_scalars(#20016,0,"<<")
yaml(#20016,0,#20011,2,"tag:yaml.org,2002:merge","<<")
#20017=@"loc,{#10000},3,3,3,4"
locations_default(#20017,#10000,3,3,3,4)
hasLocation(#20016,#20017)
yaml_locations(#20016,#20017)
#20018=*
yaml_aliases(#20018,"A")
yaml(#20018,3,#20011,-2,"","*A")
#20019=@"loc,{#10000},3,7,3,8"
locations_default(#20019,#10000,3,7,3,8)
hasLocation(#20018,#20019)
yaml_locations(#20018,#20019)
yaml(#20011,1,#20000,1,"tag:yaml.org,2002:map","x: 56")
#20020=@"loc,{#10000},2,3,3,8"
locations_default(#20020,#10000,2,3,3,8)
hasLocation(#20011,#20020)
yaml_locations(#20011,#20020)
yaml(#20000,2,#10000,0,"tag:yaml.org,2002:seq","- &A { ... y: 42 }")
#20021=@"loc,{#10000},1,1,3,8"
locations_default(#20021,#10000,1,1,3,8)
hasLocation(#20000,#20021)
yaml_locations(#20000,#20021)
numlines(#10000,3,0,0)
filetype(#10000,"yaml")

View File

@@ -12,43 +12,43 @@ yaml_scalars(#20001,0,"xxxxxxxx")
yaml(#20001,0,#20000,1,"tag:yaml.org,2002:str","xxxxxxxx")
#20002=@"loc,{#10000},1,1,1,8"
locations_default(#20002,#10000,1,1,1,8)
hasLocation(#20001,#20002)
yaml_locations(#20001,#20002)
#20003=*
yaml_scalars(#20003,0,"xxxx_xx")
yaml(#20003,0,#20000,-1,"tag:yaml.org,2002:str","xxxx_xx")
#20004=@"loc,{#10000},1,11,1,17"
locations_default(#20004,#10000,1,11,1,17)
hasLocation(#20003,#20004)
yaml_locations(#20003,#20004)
#20005=*
yaml_scalars(#20005,0,"xxxxxx_xxxxxx")
yaml(#20005,0,#20000,2,"tag:yaml.org,2002:str","xxxxxx_xxxxxx")
#20006=@"loc,{#10000},3,1,3,13"
locations_default(#20006,#10000,3,1,3,13)
hasLocation(#20005,#20006)
yaml_locations(#20005,#20006)
#20007=*
#20008=*
yaml_scalars(#20008,0,"xx [[ ""$xxxxxx_xx_xxxx"" == ""xxxxx"" ]]; xxxx xxxxxx xxxxxxx=:xx.x; xx -x /xxx/xxxx.x/xxxx xxxxx; xx")
yaml(#20008,0,#20007,0,"tag:yaml.org,2002:str","xx [[ "" ... xxx; xx")
#20009=@"loc,{#10000},4,5,4,102"
locations_default(#20009,#10000,4,5,4,102)
hasLocation(#20008,#20009)
yaml_locations(#20008,#20009)
yaml(#20007,2,#20000,-2,"tag:yaml.org,2002:seq","- xx [[ ... xxx; xx")
#20010=@"loc,{#10000},4,3,6,0"
locations_default(#20010,#10000,4,3,6,0)
hasLocation(#20007,#20010)
yaml_locations(#20007,#20010)
#20011=*
yaml_scalars(#20011,0,"xxxxxx")
yaml(#20011,0,#20000,3,"tag:yaml.org,2002:str","xxxxxx")
#20012=@"loc,{#10000},6,1,6,6"
locations_default(#20012,#10000,6,1,6,6)
hasLocation(#20011,#20012)
yaml_locations(#20011,#20012)
#20013=*
#20014=*
yaml_scalars(#20014,0,"xxxxxxx")
yaml(#20014,0,#20013,1,"tag:yaml.org,2002:str","xxxxxxx")
#20015=@"loc,{#10000},7,3,7,9"
locations_default(#20015,#10000,7,3,7,9)
hasLocation(#20014,#20015)
yaml_locations(#20014,#20015)
#20016=*
#20017=*
#20018=*
@@ -56,161 +56,161 @@ yaml_scalars(#20018,0,"xx")
yaml(#20018,0,#20017,1,"tag:yaml.org,2002:str","xx")
#20019=@"loc,{#10000},8,7,8,8"
locations_default(#20019,#10000,8,7,8,8)
hasLocation(#20018,#20019)
yaml_locations(#20018,#20019)
#20020=*
yaml_scalars(#20020,0,"xxxxx")
yaml(#20020,0,#20017,-1,"tag:yaml.org,2002:str","xxxxx")
#20021=@"loc,{#10000},8,11,8,15"
locations_default(#20021,#10000,8,11,8,15)
hasLocation(#20020,#20021)
yaml_locations(#20020,#20021)
#20022=*
yaml_scalars(#20022,0,"xxxx")
yaml(#20022,0,#20017,2,"tag:yaml.org,2002:str","xxxx")
#20023=@"loc,{#10000},9,7,9,10"
locations_default(#20023,#10000,9,7,9,10)
hasLocation(#20022,#20023)
yaml_locations(#20022,#20023)
#20024=*
yaml_scalars(#20024,0,"xxxxxxxx")
yaml(#20024,0,#20017,-2,"tag:yaml.org,2002:str","xxxxxxxx")
#20025=@"loc,{#10000},9,13,9,20"
locations_default(#20025,#10000,9,13,9,20)
hasLocation(#20024,#20025)
yaml_locations(#20024,#20025)
#20026=*
yaml_scalars(#20026,0,"xxxx")
yaml(#20026,0,#20017,3,"tag:yaml.org,2002:str","xxxx")
#20027=@"loc,{#10000},10,7,10,10"
locations_default(#20027,#10000,10,7,10,10)
hasLocation(#20026,#20027)
yaml_locations(#20026,#20027)
#20028=*
yaml_scalars(#20028,0,"xxxxxx")
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)
hasLocation(#20028,#20029)
yaml_locations(#20028,#20029)
yaml(#20017,1,#20016,0,"tag:yaml.org,2002:map","xx: xxxxx")
#20030=@"loc,{#10000},8,7,14,0"
locations_default(#20030,#10000,8,7,14,0)
hasLocation(#20017,#20030)
yaml_locations(#20017,#20030)
yaml(#20016,2,#20013,-1,"tag:yaml.org,2002:seq","- xx: xxxxx")
#20031=@"loc,{#10000},8,5,14,0"
locations_default(#20031,#10000,8,5,14,0)
hasLocation(#20016,#20031)
yaml_locations(#20016,#20031)
yaml(#20013,1,#20000,-3,"tag:yaml.org,2002:map","xxxxxxx:")
#20032=@"loc,{#10000},7,3,14,0"
locations_default(#20032,#10000,7,3,14,0)
hasLocation(#20013,#20032)
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)
hasLocation(#20033,#20034)
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)
hasLocation(#20036,#20037)
yaml_locations(#20036,#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)
hasLocation(#20039,#20040)
yaml_locations(#20039,#20040)
yaml(#20038,2,#20035,-1,"tag:yaml.org,2002:seq","- xxxx_xxxxxxx")
#20041=@"loc,{#10000},16,5,18,0"
locations_default(#20041,#10000,16,5,18,0)
hasLocation(#20038,#20041)
yaml_locations(#20038,#20041)
yaml(#20035,1,#20000,-4,"tag:yaml.org,2002:map","xxxxxxxxxxx:")
#20042=@"loc,{#10000},15,3,18,0"
locations_default(#20042,#10000,15,3,18,0)
hasLocation(#20035,#20042)
yaml_locations(#20035,#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)
hasLocation(#20043,#20044)
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)
hasLocation(#20046,#20047)
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)
hasLocation(#20048,#20049)
yaml_locations(#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)
hasLocation(#20050,#20051)
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)
hasLocation(#20052,#20053)
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)
hasLocation(#20054,#20055)
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)
hasLocation(#20056,#20057)
yaml_locations(#20056,#20057)
yaml(#20045,1,#20000,-5,"tag:yaml.org,2002:map","xxxx_xxxxxxx: xxxx")
#20058=@"loc,{#10000},19,3,23,0"
locations_default(#20058,#10000,19,3,23,0)
hasLocation(#20045,#20058)
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)
hasLocation(#20059,#20060)
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)
hasLocation(#20062,#20063)
yaml_locations(#20062,#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)
hasLocation(#20065,#20066)
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)
hasLocation(#20067,#20068)
yaml_locations(#20067,#20068)
yaml(#20064,1,#20061,-1,"tag:yaml.org,2002:map","xxxxxx: ... xxxxxx=")
#20069=@"loc,{#10000},26,5,27,0"
locations_default(#20069,#10000,26,5,27,0)
hasLocation(#20064,#20069)
yaml_locations(#20064,#20069)
yaml(#20061,1,#20000,-6,"tag:yaml.org,2002:map","xxxxxx:")
#20070=@"loc,{#10000},24,3,27,0"
locations_default(#20070,#10000,24,3,27,0)
hasLocation(#20061,#20070)
yaml_locations(#20061,#20070)
yaml(#20000,1,#10000,0,"tag:yaml.org,2002:map","xxxxxxxx: xxxx_xx")
#20071=@"loc,{#10000},1,1,27,0"
locations_default(#20071,#10000,1,1,27,0)
hasLocation(#20000,#20071)
yaml_locations(#20000,#20071)
numlines(#10000,26,0,0)
filetype(#10000,"yaml")

View File

@@ -12,66 +12,66 @@ yaml_scalars(#20001,0,"receipt")
yaml(#20001,0,#20000,1,"tag:yaml.org,2002:str","receipt")
#20002=@"loc,{#10000},2,1,2,7"
locations_default(#20002,#10000,2,1,2,7)
hasLocation(#20001,#20002)
yaml_locations(#20001,#20002)
#20003=*
yaml_scalars(#20003,0,"Oz-Ware Purchase Invoice")
yaml(#20003,0,#20000,-1,"tag:yaml.org,2002:str","Oz-Ware ... Invoice")
#20004=@"loc,{#10000},2,14,2,37"
locations_default(#20004,#10000,2,14,2,37)
hasLocation(#20003,#20004)
yaml_locations(#20003,#20004)
#20005=*
yaml_scalars(#20005,0,"date")
yaml(#20005,0,#20000,2,"tag:yaml.org,2002:str","date")
#20006=@"loc,{#10000},3,1,3,4"
locations_default(#20006,#10000,3,1,3,4)
hasLocation(#20005,#20006)
yaml_locations(#20005,#20006)
#20007=*
yaml_scalars(#20007,0,"2012-08-06")
yaml(#20007,0,#20000,-2,"tag:yaml.org,2002:timestamp","2012-08-06")
#20008=@"loc,{#10000},3,14,3,23"
locations_default(#20008,#10000,3,14,3,23)
hasLocation(#20007,#20008)
yaml_locations(#20007,#20008)
#20009=*
yaml_scalars(#20009,0,"customer")
yaml(#20009,0,#20000,3,"tag:yaml.org,2002:str","customer")
#20010=@"loc,{#10000},4,1,4,8"
locations_default(#20010,#10000,4,1,4,8)
hasLocation(#20009,#20010)
yaml_locations(#20009,#20010)
#20011=*
#20012=*
yaml_scalars(#20012,0,"given")
yaml(#20012,0,#20011,1,"tag:yaml.org,2002:str","given")
#20013=@"loc,{#10000},5,5,5,9"
locations_default(#20013,#10000,5,5,5,9)
hasLocation(#20012,#20013)
yaml_locations(#20012,#20013)
#20014=*
yaml_scalars(#20014,0,"Dorothy")
yaml(#20014,0,#20011,-1,"tag:yaml.org,2002:str","Dorothy")
#20015=@"loc,{#10000},5,14,5,20"
locations_default(#20015,#10000,5,14,5,20)
hasLocation(#20014,#20015)
yaml_locations(#20014,#20015)
#20016=*
yaml_scalars(#20016,0,"family")
yaml(#20016,0,#20011,2,"tag:yaml.org,2002:str","family")
#20017=@"loc,{#10000},6,5,6,10"
locations_default(#20017,#10000,6,5,6,10)
hasLocation(#20016,#20017)
yaml_locations(#20016,#20017)
#20018=*
yaml_scalars(#20018,0,"Gale")
yaml(#20018,0,#20011,-2,"tag:yaml.org,2002:str","Gale")
#20019=@"loc,{#10000},6,14,6,17"
locations_default(#20019,#10000,6,14,6,17)
hasLocation(#20018,#20019)
yaml_locations(#20018,#20019)
yaml(#20011,1,#20000,-3,"tag:yaml.org,2002:map","given: Dorothy")
#20020=@"loc,{#10000},5,5,8,0"
locations_default(#20020,#10000,5,5,8,0)
hasLocation(#20011,#20020)
yaml_locations(#20011,#20020)
#20021=*
yaml_scalars(#20021,0,"items")
yaml(#20021,0,#20000,4,"tag:yaml.org,2002:str","items")
#20022=@"loc,{#10000},8,1,8,5"
locations_default(#20022,#10000,8,1,8,5)
hasLocation(#20021,#20022)
yaml_locations(#20021,#20022)
#20023=*
#20024=*
#20025=*
@@ -79,128 +79,128 @@ yaml_scalars(#20025,0,"part_no")
yaml(#20025,0,#20024,1,"tag:yaml.org,2002:str","part_no")
#20026=@"loc,{#10000},9,7,9,13"
locations_default(#20026,#10000,9,7,9,13)
hasLocation(#20025,#20026)
yaml_locations(#20025,#20026)
#20027=*
yaml_scalars(#20027,0,"A4786")
yaml(#20027,0,#20024,-1,"tag:yaml.org,2002:str","A4786")
#20028=@"loc,{#10000},9,18,9,22"
locations_default(#20028,#10000,9,18,9,22)
hasLocation(#20027,#20028)
yaml_locations(#20027,#20028)
#20029=*
yaml_scalars(#20029,0,"descrip")
yaml(#20029,0,#20024,2,"tag:yaml.org,2002:str","descrip")
#20030=@"loc,{#10000},10,7,10,13"
locations_default(#20030,#10000,10,7,10,13)
hasLocation(#20029,#20030)
yaml_locations(#20029,#20030)
#20031=*
yaml_scalars(#20031,0,"Water Bucket (Filled)")
yaml(#20031,0,#20024,-2,"tag:yaml.org,2002:str","Water B ... Filled)")
#20032=@"loc,{#10000},10,18,10,38"
locations_default(#20032,#10000,10,18,10,38)
hasLocation(#20031,#20032)
yaml_locations(#20031,#20032)
#20033=*
yaml_scalars(#20033,0,"price")
yaml(#20033,0,#20024,3,"tag:yaml.org,2002:str","price")
#20034=@"loc,{#10000},11,7,11,11"
locations_default(#20034,#10000,11,7,11,11)
hasLocation(#20033,#20034)
yaml_locations(#20033,#20034)
#20035=*
yaml_scalars(#20035,0,"1.47")
yaml(#20035,0,#20024,-3,"tag:yaml.org,2002:float","1.47")
#20036=@"loc,{#10000},11,18,11,21"
locations_default(#20036,#10000,11,18,11,21)
hasLocation(#20035,#20036)
yaml_locations(#20035,#20036)
#20037=*
yaml_scalars(#20037,0,"quantity")
yaml(#20037,0,#20024,4,"tag:yaml.org,2002:str","quantity")
#20038=@"loc,{#10000},12,7,12,14"
locations_default(#20038,#10000,12,7,12,14)
hasLocation(#20037,#20038)
yaml_locations(#20037,#20038)
#20039=*
yaml_scalars(#20039,0,"4")
yaml(#20039,0,#20024,-4,"tag:yaml.org,2002:int","4")
#20040=@"loc,{#10000},12,18,12,18"
locations_default(#20040,#10000,12,18,12,18)
hasLocation(#20039,#20040)
yaml_locations(#20039,#20040)
yaml(#20024,1,#20023,0,"tag:yaml.org,2002:map","part_no: A4786")
#20041=@"loc,{#10000},9,7,14,4"
locations_default(#20041,#10000,9,7,14,4)
hasLocation(#20024,#20041)
yaml_locations(#20024,#20041)
#20042=*
#20043=*
yaml_scalars(#20043,0,"part_no")
yaml(#20043,0,#20042,1,"tag:yaml.org,2002:str","part_no")
#20044=@"loc,{#10000},14,7,14,13"
locations_default(#20044,#10000,14,7,14,13)
hasLocation(#20043,#20044)
yaml_locations(#20043,#20044)
#20045=*
yaml_scalars(#20045,0,"E1628")
yaml(#20045,0,#20042,-1,"tag:yaml.org,2002:str","E1628")
#20046=@"loc,{#10000},14,18,14,22"
locations_default(#20046,#10000,14,18,14,22)
hasLocation(#20045,#20046)
yaml_locations(#20045,#20046)
#20047=*
yaml_scalars(#20047,0,"descrip")
yaml(#20047,0,#20042,2,"tag:yaml.org,2002:str","descrip")
#20048=@"loc,{#10000},15,7,15,13"
locations_default(#20048,#10000,15,7,15,13)
hasLocation(#20047,#20048)
yaml_locations(#20047,#20048)
#20049=*
yaml_scalars(#20049,0,"High Heeled ""Ruby"" Slippers")
yaml(#20049,0,#20042,-2,"tag:yaml.org,2002:str","High He ... lippers")
#20050=@"loc,{#10000},15,18,15,44"
locations_default(#20050,#10000,15,18,15,44)
hasLocation(#20049,#20050)
yaml_locations(#20049,#20050)
#20051=*
yaml_scalars(#20051,0,"size")
yaml(#20051,0,#20042,3,"tag:yaml.org,2002:str","size")
#20052=@"loc,{#10000},16,7,16,10"
locations_default(#20052,#10000,16,7,16,10)
hasLocation(#20051,#20052)
yaml_locations(#20051,#20052)
#20053=*
yaml_scalars(#20053,0,"8")
yaml(#20053,0,#20042,-3,"tag:yaml.org,2002:int","8")
#20054=@"loc,{#10000},16,18,16,18"
locations_default(#20054,#10000,16,18,16,18)
hasLocation(#20053,#20054)
yaml_locations(#20053,#20054)
#20055=*
yaml_scalars(#20055,0,"price")
yaml(#20055,0,#20042,4,"tag:yaml.org,2002:str","price")
#20056=@"loc,{#10000},17,7,17,11"
locations_default(#20056,#10000,17,7,17,11)
hasLocation(#20055,#20056)
yaml_locations(#20055,#20056)
#20057=*
yaml_scalars(#20057,0,"100.27")
yaml(#20057,0,#20042,-4,"tag:yaml.org,2002:float","100.27")
#20058=@"loc,{#10000},17,18,17,23"
locations_default(#20058,#10000,17,18,17,23)
hasLocation(#20057,#20058)
yaml_locations(#20057,#20058)
#20059=*
yaml_scalars(#20059,0,"quantity")
yaml(#20059,0,#20042,5,"tag:yaml.org,2002:str","quantity")
#20060=@"loc,{#10000},18,7,18,14"
locations_default(#20060,#10000,18,7,18,14)
hasLocation(#20059,#20060)
yaml_locations(#20059,#20060)
#20061=*
yaml_scalars(#20061,0,"1")
yaml(#20061,0,#20042,-5,"tag:yaml.org,2002:int","1")
#20062=@"loc,{#10000},18,18,18,18"
locations_default(#20062,#10000,18,18,18,18)
hasLocation(#20061,#20062)
yaml_locations(#20061,#20062)
yaml(#20042,1,#20023,1,"tag:yaml.org,2002:map","part_no: E1628")
#20063=@"loc,{#10000},14,7,20,0"
locations_default(#20063,#10000,14,7,20,0)
hasLocation(#20042,#20063)
yaml_locations(#20042,#20063)
yaml(#20023,2,#20000,-4,"tag:yaml.org,2002:seq","- part_no: A4786")
#20064=@"loc,{#10000},9,5,20,0"
locations_default(#20064,#10000,9,5,20,0)
hasLocation(#20023,#20064)
yaml_locations(#20023,#20064)
#20065=*
yaml_scalars(#20065,0,"bill-to")
yaml(#20065,0,#20000,5,"tag:yaml.org,2002:str","bill-to")
#20066=@"loc,{#10000},20,1,20,7"
locations_default(#20066,#10000,20,1,20,7)
hasLocation(#20065,#20066)
yaml_locations(#20065,#20066)
#20067=*
yaml_anchors(#20067,"id001")
#20068=*
@@ -208,7 +208,7 @@ yaml_scalars(#20068,0,"street")
yaml(#20068,0,#20067,1,"tag:yaml.org,2002:str","street")
#20069=@"loc,{#10000},21,5,21,10"
locations_default(#20069,#10000,21,5,21,10)
hasLocation(#20068,#20069)
yaml_locations(#20068,#20069)
#20070=*
yaml_scalars(#20070,124,"123 Tornado Alley
Suite 16
@@ -216,62 +216,62 @@ Suite 16
yaml(#20070,0,#20067,-1,"tag:yaml.org,2002:str","|")
#20071=@"loc,{#10000},21,13,24,0"
locations_default(#20071,#10000,21,13,24,0)
hasLocation(#20070,#20071)
yaml_locations(#20070,#20071)
#20072=*
yaml_scalars(#20072,0,"city")
yaml(#20072,0,#20067,2,"tag:yaml.org,2002:str","city")
#20073=@"loc,{#10000},24,5,24,8"
locations_default(#20073,#10000,24,5,24,8)
hasLocation(#20072,#20073)
yaml_locations(#20072,#20073)
#20074=*
yaml_scalars(#20074,0,"East Centerville")
yaml(#20074,0,#20067,-2,"tag:yaml.org,2002:str","East Centerville")
#20075=@"loc,{#10000},24,13,24,28"
locations_default(#20075,#10000,24,13,24,28)
hasLocation(#20074,#20075)
yaml_locations(#20074,#20075)
#20076=*
yaml_scalars(#20076,0,"state")
yaml(#20076,0,#20067,3,"tag:yaml.org,2002:str","state")
#20077=@"loc,{#10000},25,5,25,9"
locations_default(#20077,#10000,25,5,25,9)
hasLocation(#20076,#20077)
yaml_locations(#20076,#20077)
#20078=*
yaml_scalars(#20078,0,"KS")
yaml(#20078,0,#20067,-3,"tag:yaml.org,2002:str","KS")
#20079=@"loc,{#10000},25,13,25,14"
locations_default(#20079,#10000,25,13,25,14)
hasLocation(#20078,#20079)
yaml_locations(#20078,#20079)
yaml(#20067,1,#20000,-5,"tag:yaml.org,2002:map","&id001")
#20080=@"loc,{#10000},20,11,27,0"
locations_default(#20080,#10000,20,11,27,0)
hasLocation(#20067,#20080)
yaml_locations(#20067,#20080)
#20081=*
yaml_scalars(#20081,0,"ship-to")
yaml(#20081,0,#20000,6,"tag:yaml.org,2002:str","ship-to")
#20082=@"loc,{#10000},27,1,27,7"
locations_default(#20082,#10000,27,1,27,7)
hasLocation(#20081,#20082)
yaml_locations(#20081,#20082)
#20083=*
yaml_aliases(#20083,"id001")
yaml(#20083,3,#20000,-6,"","*id001")
#20084=@"loc,{#10000},27,11,27,16"
locations_default(#20084,#10000,27,11,27,16)
hasLocation(#20083,#20084)
yaml_locations(#20083,#20084)
#20085=*
yaml_scalars(#20085,0,"specialDelivery")
yaml(#20085,0,#20000,7,"tag:yaml.org,2002:str","specialDelivery")
#20086=@"loc,{#10000},29,1,29,15"
locations_default(#20086,#10000,29,1,29,15)
hasLocation(#20085,#20086)
yaml_locations(#20085,#20086)
#20087=*
yaml_scalars(#20087,62,"Follow the Yellow Brick Road to the Emerald City. Pay no attention to the man behind the curtain.")
yaml(#20087,0,#20000,-7,"tag:yaml.org,2002:str",">")
#20088=@"loc,{#10000},29,19,33,27"
locations_default(#20088,#10000,29,19,33,27)
hasLocation(#20087,#20088)
yaml_locations(#20087,#20088)
yaml(#20000,1,#10000,0,"tag:yaml.org,2002:map","receipt ... Invoice")
#20089=@"loc,{#10000},2,1,33,27"
locations_default(#20089,#10000,2,1,33,27)
hasLocation(#20000,#20089)
yaml_locations(#20000,#20089)
numlines(#10000,33,0,0)
filetype(#10000,"yaml")

View File

@@ -11,6 +11,6 @@ yaml_scalars(#20000,0,"x:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
yaml(#20000,0,#10000,0,"tag:yaml.org,2002:str","x:xxxxx ... xxxxxxx")
#20001=@"loc,{#10000},1,1,1,1025"
locations_default(#20001,#10000,1,1,1,1025)
hasLocation(#20000,#20001)
yaml_locations(#20000,#20001)
numlines(#10000,1,0,0)
filetype(#10000,"yaml")

View File

@@ -20,7 +20,7 @@ import javascript
* ```
*/
class JSONValue extends @json_value, Locatable {
override Location getLocation() { hasLocation(this, result) }
override Location getLocation() { json_locations(this, result) }
/** Gets the parent value to which this value belongs, if any. */
JSONValue getParent() { json(this, _, result, _, _) }
@@ -139,5 +139,7 @@ class JSONObject extends @json_object, JSONValue {
* An error reported by the JSON parser.
*/
class JSONParseError extends @json_parse_error, Error {
override Location getLocation() { json_locations(this, result) }
override string getMessage() { json_errors(this, result) }
}

View File

@@ -21,7 +21,7 @@ import javascript
* ```
*/
class YAMLNode extends @yaml_node, Locatable {
override Location getLocation() { hasLocation(this, result) }
override Location getLocation() { yaml_locations(this, result) }
/**
* Gets the parent node of this node, which is always a collection.
@@ -421,6 +421,8 @@ class YAMLDocument extends YAMLNode {
* An error message produced by the YAML parser while processing a YAML file.
*/
class YAMLParseError extends @yaml_error, Error {
override Location getLocation() { yaml_locations(this, result) }
override string getMessage() { yaml_errors(this, result) }
override string toString() { result = getMessage() }

View File

@@ -905,6 +905,9 @@ json_properties (int obj: @json_object ref,
json_errors (unique int id: @json_parse_error,
varchar(900) message: string ref);
json_locations(unique int locatable: @json_locatable ref,
int location: @location_default ref);
case @json_value.kind of
0 = @json_null
| 1 = @json_boolean
@@ -915,6 +918,8 @@ case @json_value.kind of
@json_parent = @json_object | @json_array | @file;
@json_locatable = @json_value | @json_parse_error;
// locations
@ast_node = @toplevel | @stmt | @expr | @property | @typeexpr;
@@ -922,14 +927,15 @@ case @json_value.kind of
| @ast_node
| @comment
| @line
| @js_parse_error | @regexp_parse_error | @json_parse_error
| @js_parse_error | @regexp_parse_error
| @regexpterm
| @json_value
| @json_locatable
| @token
| @cfg_node
| @jsdoc | @jsdoc_type_expr | @jsdoc_tag
| @yaml_node | @yaml_error
| @xmllocatable;
| @yaml_locatable
| @xmllocatable
| @configLocatable;
hasLocation (unique int locatable: @locatable ref,
int location: @location ref);
@@ -1022,6 +1028,11 @@ yaml_scalars (unique int scalar: @yaml_scalar_node ref,
yaml_errors (unique int id: @yaml_error,
varchar(900) message: string ref);
yaml_locations(unique int locatable: @yaml_locatable ref,
int location: @location_default ref);
@yaml_locatable = @yaml_node | @yaml_error;
/* XML Files */
xmlEncoding(
@@ -1099,4 +1110,29 @@ xmllocations(
isOptionalChaining(int id: @optionalchainable ref);
/* Last updated 2018/10/23. */
/*
* configuration files with key value pairs
*/
configs(
unique int id: @config
);
configNames(
unique int id: @configName,
int config: @config ref,
string name: string ref
);
configValues(
unique int id: @configValue,
int config: @config ref,
string value: string ref
);
configLocations(
int locatable: @configLocatable ref,
int location: @location_default ref
);
@configLocatable = @config | @configName | @configValue;

View File

@@ -1449,6 +1449,18 @@
<k>@nullishcoalescingexpr</k>
<v>100</v>
</e>
<e>
<k>@config</k>
<v>69795</v>
</e>
<e>
<k>@configName</k>
<v>69794</v>
</e>
<e>
<k>@configValue</k>
<v>69691</v>
</e>
</typesizes>
<stats>
<relation>
@@ -22547,6 +22559,54 @@
</dependencies>
</relation>
<relation>
<name>json_locations</name>
<cardinality>712</cardinality>
<columnsizes>
<e>
<k>locatable</k>
<v>712</v>
</e>
<e>
<k>location</k>
<v>712</v>
</e>
</columnsizes>
<dependencies>
<dep>
<src>locatable</src>
<trg>location</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>712</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>location</src>
<trg>locatable</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>712</v>
</b>
</bs>
</hist>
</val>
</dep>
</dependencies>
</relation>
<relation>
<name>hasLocation</name>
<cardinality>19213780</cardinality>
<columnsizes>
@@ -26932,6 +26992,54 @@
</dependencies>
</relation>
<relation>
<name>yaml_locations</name>
<cardinality>71</cardinality>
<columnsizes>
<e>
<k>locatable</k>
<v>71</v>
</e>
<e>
<k>location</k>
<v>71</v>
</e>
</columnsizes>
<dependencies>
<dep>
<src>locatable</src>
<trg>location</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>71</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>location</src>
<trg>locatable</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>71</v>
</b>
</bs>
</hist>
</val>
</dep>
</dependencies>
</relation>
<relation>
<name>xmlEncoding</name>
<cardinality>39724</cardinality>
<columnsizes>
@@ -30303,5 +30411,376 @@
</dep>
</dependencies>
</relation>
<relation>
<name>configs</name>
<cardinality>69795</cardinality>
<columnsizes>
<e>
<k>id</k>
<v>69795</v>
</e>
</columnsizes>
<dependencies/>
</relation>
<relation>
<name>configNames</name>
<cardinality>69794</cardinality>
<columnsizes>
<e>
<k>id</k>
<v>69794</v>
</e>
<e>
<k>config</k>
<v>69794</v>
</e>
<e>
<k>name</k>
<v>12859</v>
</e>
</columnsizes>
<dependencies>
<dep>
<src>id</src>
<trg>config</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>69794</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>id</src>
<trg>name</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>69794</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>config</src>
<trg>id</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>69794</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>config</src>
<trg>name</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>69794</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>name</src>
<trg>id</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>4858</v>
</b>
<b>
<a>2</a>
<b>3</b>
<v>593</v>
</b>
<b>
<a>3</a>
<b>4</b>
<v>2806</v>
</b>
<b>
<a>4</a>
<b>10</b>
<v>169</v>
</b>
<b>
<a>10</a>
<b>11</b>
<v>1900</v>
</b>
<b>
<a>11</a>
<b>12</b>
<v>1757</v>
</b>
<b>
<a>12</a>
<b>111</b>
<v>776</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>name</src>
<trg>config</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>4858</v>
</b>
<b>
<a>2</a>
<b>3</b>
<v>593</v>
</b>
<b>
<a>3</a>
<b>4</b>
<v>2806</v>
</b>
<b>
<a>4</a>
<b>10</b>
<v>169</v>
</b>
<b>
<a>10</a>
<b>11</b>
<v>1900</v>
</b>
<b>
<a>11</a>
<b>12</b>
<v>1757</v>
</b>
<b>
<a>12</a>
<b>111</b>
<v>776</v>
</b>
</bs>
</hist>
</val>
</dep>
</dependencies>
</relation>
<relation>
<name>configValues</name>
<cardinality>69691</cardinality>
<columnsizes>
<e>
<k>id</k>
<v>69691</v>
</e>
<e>
<k>config</k>
<v>69691</v>
</e>
<e>
<k>value</k>
<v>54399</v>
</e>
</columnsizes>
<dependencies>
<dep>
<src>id</src>
<trg>config</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>69691</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>id</src>
<trg>value</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>69691</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>config</src>
<trg>id</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>69691</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>config</src>
<trg>value</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>69691</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>value</src>
<trg>id</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>48220</v>
</b>
<b>
<a>2</a>
<b>4</b>
<v>4804</v>
</b>
<b>
<a>4</a>
<b>546</b>
<v>1375</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>value</src>
<trg>config</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>48220</v>
</b>
<b>
<a>2</a>
<b>4</b>
<v>4804</v>
</b>
<b>
<a>4</a>
<b>546</b>
<v>1375</v>
</b>
</bs>
</hist>
</val>
</dep>
</dependencies>
</relation>
<relation>
<name>configLocations</name>
<cardinality>209280</cardinality>
<columnsizes>
<e>
<k>locatable</k>
<v>209280</v>
</e>
<e>
<k>location</k>
<v>209280</v>
</e>
</columnsizes>
<dependencies>
<dep>
<src>locatable</src>
<trg>location</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>209280</v>
</b>
</bs>
</hist>
</val>
</dep>
<dep>
<src>location</src>
<trg>locatable</trg>
<val>
<hist>
<budget>12</budget>
<bs>
<b>
<a>1</a>
<b>2</b>
<v>209280</v>
</b>
</bs>
</hist>
</val>
</dep>
</dependencies>
</relation>
</stats>
</dbstats>

View File

@@ -0,0 +1,9 @@
class Locatable extends @locatable { string toString() { none() } }
class Location extends @location { string toString() { none() } }
from Locatable locatable, Location location
where
hasLocation(locatable, location) and
not locatable instanceof @yaml_node and
not locatable instanceof @yaml_error
select locatable, location

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
description: Split YAML location information out into separate table.
compatibility: full
hasLocation.rel: run hasLocation.qlo
yaml_locations.rel: run yaml_locations.qlo

View File

@@ -0,0 +1,9 @@
class Locatable extends @locatable { string toString() { none() } }
class Location extends @location { string toString() { none() } }
from Locatable locatable, Location location
where
hasLocation(locatable, location) and
(locatable instanceof @yaml_node or
locatable instanceof @yaml_error)
select locatable, location

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Add database tables for representing configuration files.
compatibility: full

View File

@@ -0,0 +1,9 @@
class Locatable extends @locatable { string toString() { none() } }
class Location extends @location { string toString() { none() } }
from Locatable locatable, Location location
where
hasLocation(locatable, location) and
not locatable instanceof @json_value and
not locatable instanceof @json_parse_error
select locatable, location

View File

@@ -0,0 +1,9 @@
class Locatable extends @locatable { string toString() { none() } }
class Location extends @location { string toString() { none() } }
from Locatable locatable, Location location
where
hasLocation(locatable, location) and
(locatable instanceof @json_value or
locatable instanceof @json_parse_error)
select locatable, location

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
description: Split JSON location information out into separate table.
compatibility: full
hasLocation.rel: run hasLocation.qlo
json_locations.rel: run json_locations.qlo