renamed "jsParseErrors" to "js_parse_errors"

This commit is contained in:
Erik Krogh Kristensen
2020-09-04 11:52:04 +02:00
parent b5d6cbd5b3
commit fdb615fb91
35 changed files with 42 additions and 35 deletions

View File

@@ -130,7 +130,7 @@ public class JSExtractor {
if (!config.isTolerateParseErrors()) throw parseError; if (!config.isTolerateParseErrors()) throw parseError;
Label key = trapwriter.freshLabel(); Label key = trapwriter.freshLabel();
String errorLine = textualExtractor.getLine(parseError.getPosition().getLine()); String errorLine = textualExtractor.getLine(parseError.getPosition().getLine());
trapwriter.addTuple("jsParseErrors", key, toplevelLabel, "Error: " + parseError, errorLine); trapwriter.addTuple("js_parse_errors", key, toplevelLabel, "Error: " + parseError, errorLine);
locationManager.emitErrorLocation( locationManager.emitErrorLocation(
key, parseError.getPosition(), textualExtractor.getNumLines()); key, parseError.getPosition(), textualExtractor.getNumLines());
lexicalExtractor.extractLines(source, toplevelLabel); lexicalExtractor.extractLines(source, toplevelLabel);

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected character '' (U+200B)"," js_parse_errors(#20003,#20001,"Error: Unexpected character '' (U+200B)","
") ")
hasLocation(#20003,#20002) hasLocation(#20003,#20002)
#20004=* #20004=*

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected token","hi~~") js_parse_errors(#20003,#20001,"Error: Unexpected token","hi~~")
#20004=@"loc,{#10000},1,3,1,3" #20004=@"loc,{#10000},1,3,1,3"
locations_default(#20004,#10000,1,3,1,3) locations_default(#20004,#10000,1,3,1,3)
hasLocation(#20003,#20004) hasLocation(#20003,#20004)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected token","") js_parse_errors(#20003,#20001,"Error: Unexpected token","")
hasLocation(#20003,#20002) hasLocation(#20003,#20002)
#20004=* #20004=*
lines(#20004,#20001,"if (b) {"," lines(#20004,#20001,"if (b) {","

View File

@@ -105,7 +105,7 @@ successor(#20025,#20026)
successor(#20022,#20030) successor(#20022,#20030)
successor(#20028,#20021) successor(#20028,#20021)
#20031=* #20031=*
jsParseErrors(#20031,#20001,"Error: Unexpected assignment pattern.","(x = 0) = y js_parse_errors(#20031,#20001,"Error: Unexpected assignment pattern.","(x = 0) = y
") ")
hasLocation(#20031,#20007) hasLocation(#20031,#20007)
#20032=* #20032=*

View File

@@ -90,7 +90,7 @@ successor(#20021,#20022)
successor(#20019,#20025) successor(#20019,#20025)
successor(#20023,#20018) successor(#20023,#20018)
#20026=* #20026=*
jsParseErrors(#20026,#20001,"Error: Cannot use keyword 'class' as an identifier.","var class = 23; js_parse_errors(#20026,#20001,"Error: Cannot use keyword 'class' as an identifier.","var class = 23;
") ")
#20027=@"loc,{#10000},1,5,1,5" #20027=@"loc,{#10000},1,5,1,5"
locations_default(#20027,#10000,1,5,1,5) locations_default(#20027,#10000,1,5,1,5)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected token","a %*= 1") js_parse_errors(#20003,#20001,"Error: Unexpected token","a %*= 1")
#20004=@"loc,{#10000},1,4,1,4" #20004=@"loc,{#10000},1,4,1,4"
locations_default(#20004,#10000,1,4,1,4) locations_default(#20004,#10000,1,4,1,4)
hasLocation(#20003,#20004) hasLocation(#20003,#20004)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected token","function f(x, ...[y, z]) { js_parse_errors(#20003,#20001,"Error: Unexpected token","function f(x, ...[y, z]) {
") ")
#20004=@"loc,{#10000},1,18,1,18" #20004=@"loc,{#10000},1,18,1,18"
locations_default(#20004,#10000,1,18,1,18) locations_default(#20004,#10000,1,18,1,18)

View File

@@ -145,7 +145,7 @@ successor(#20044,#20035)
successor(#20032,#20031) successor(#20032,#20031)
successor(#20041,#20032) successor(#20041,#20032)
#20046=* #20046=*
jsParseErrors(#20046,#20001,"Error: The only valid meta property for new is new.target"," new.source; js_parse_errors(#20046,#20001,"Error: The only valid meta property for new is new.target"," new.source;
") ")
#20047=@"loc,{#10000},2,7,2,7" #20047=@"loc,{#10000},2,7,2,7"
locations_default(#20047,#10000,2,7,2,7) locations_default(#20047,#10000,2,7,2,7)

View File

@@ -157,7 +157,7 @@ successor(#20046,#20035)
successor(#20030,#20029) successor(#20030,#20029)
successor(#20043,#20030) successor(#20043,#20030)
#20048=* #20048=*
jsParseErrors(#20048,#20001,"Error: Illegal 'use strict' directive in function with non-simple parameter list","function f(a=2) { 'use strict'; }") js_parse_errors(#20048,#20001,"Error: Illegal 'use strict' directive in function with non-simple parameter list","function f(a=2) { 'use strict'; }")
#20049=@"loc,{#10000},1,19,1,19" #20049=@"loc,{#10000},1,19,1,19"
locations_default(#20049,#10000,1,19,1,19) locations_default(#20049,#10000,1,19,1,19)
hasLocation(#20048,#20049) hasLocation(#20048,#20049)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected token","new a?.();") js_parse_errors(#20003,#20001,"Error: Unexpected token","new a?.();")
#20004=@"loc,{#10000},1,8,1,8" #20004=@"loc,{#10000},1,8,1,8"
locations_default(#20004,#10000,1,8,1,8) locations_default(#20004,#10000,1,8,1,8)
hasLocation(#20003,#20004) hasLocation(#20003,#20004)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: An optional chain may not be used in a tagged template expression.","a?.`{b}`;") js_parse_errors(#20003,#20001,"Error: An optional chain may not be used in a tagged template expression.","a?.`{b}`;")
hasLocation(#20003,#20002) hasLocation(#20003,#20002)
#20004=* #20004=*
lines(#20004,#20001,"a?.`{b}`;","") lines(#20004,#20001,"a?.`{b}`;","")

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: An optional chain may not be used in a `new` expression.","new a?.b();") js_parse_errors(#20003,#20001,"Error: An optional chain may not be used in a `new` expression.","new a?.b();")
#20004=@"loc,{#10000},1,5,1,5" #20004=@"loc,{#10000},1,5,1,5"
locations_default(#20004,#10000,1,5,1,5) locations_default(#20004,#10000,1,5,1,5)
hasLocation(#20003,#20004) hasLocation(#20003,#20004)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: An optional chain may not be used in a tagged template expression.","a?.b`{c}`;") js_parse_errors(#20003,#20001,"Error: An optional chain may not be used in a tagged template expression.","a?.b`{c}`;")
hasLocation(#20003,#20002) hasLocation(#20003,#20002)
#20004=* #20004=*
lines(#20004,#20001,"a?.b`{c}`;","") lines(#20004,#20001,"a?.b`{c}`;","")

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Invalid left-hand side in assignment","a?.b = c;") js_parse_errors(#20003,#20001,"Error: Invalid left-hand side in assignment","a?.b = c;")
hasLocation(#20003,#20002) hasLocation(#20003,#20002)
#20004=* #20004=*
lines(#20004,#20001,"a?.b = c;","") lines(#20004,#20001,"a?.b = c;","")

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: An optional chain may not be used in a `new` expression.","new a.b?.c(); js_parse_errors(#20003,#20001,"Error: An optional chain may not be used in a `new` expression.","new a.b?.c();
") ")
#20004=@"loc,{#10000},1,5,1,5" #20004=@"loc,{#10000},1,5,1,5"
locations_default(#20004,#10000,1,5,1,5) locations_default(#20004,#10000,1,5,1,5)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected token","var b = ::o.m<T>;") js_parse_errors(#20003,#20001,"Error: Unexpected token","var b = ::o.m<T>;")
#20004=@"loc,{#10000},1,17,1,17" #20004=@"loc,{#10000},1,17,1,17"
locations_default(#20004,#10000,1,17,1,17) locations_default(#20004,#10000,1,17,1,17)
hasLocation(#20003,#20004) hasLocation(#20003,#20004)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Imports within a `declare module` body must always be `import type` or `import typeof`."," import { js_parse_errors(#20003,#20001,"Error: Imports within a `declare module` body must always be `import type` or `import typeof`."," import {
") ")
#20004=@"loc,{#10000},2,3,2,3" #20004=@"loc,{#10000},2,3,2,3"
locations_default(#20004,#10000,2,3,2,3) locations_default(#20004,#10000,2,3,2,3)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected token","</> js_parse_errors(#20003,#20001,"Error: Unexpected token","</>
") ")
#20004=@"loc,{#10000},1,2,1,2" #20004=@"loc,{#10000},1,2,1,2"
locations_default(#20004,#10000,1,2,1,2) locations_default(#20004,#10000,1,2,1,2)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unterminated JSX contents","<> js_parse_errors(#20003,#20001,"Error: Unterminated JSX contents","<>
") ")
#20004=@"loc,{#10000},1,3,1,3" #20004=@"loc,{#10000},1,3,1,3"
locations_default(#20004,#10000,1,3,1,3) locations_default(#20004,#10000,1,3,1,3)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Expected corresponding JSX closing tag for <a>","<a></> js_parse_errors(#20003,#20001,"Error: Expected corresponding JSX closing tag for <a>","<a></>
") ")
#20004=@"loc,{#10000},1,4,1,4" #20004=@"loc,{#10000},1,4,1,4"
locations_default(#20004,#10000,1,4,1,4) locations_default(#20004,#10000,1,4,1,4)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Expected corresponding JSX closing tag for <>","<></a> js_parse_errors(#20003,#20001,"Error: Expected corresponding JSX closing tag for <>","<></a>
") ")
#20004=@"loc,{#10000},1,3,1,3" #20004=@"loc,{#10000},1,3,1,3"
locations_default(#20004,#10000,1,3,1,3) locations_default(#20004,#10000,1,3,1,3)

View File

@@ -410,7 +410,7 @@ successor(#20126,#20079)
successor(#20076,#20075) successor(#20076,#20075)
successor(#20113,#20076) successor(#20113,#20076)
#20129=* #20129=*
jsParseErrors(#20129,#20001,"Error: Missing function name","function(b) { js_parse_errors(#20129,#20001,"Error: Missing function name","function(b) {
") ")
hasLocation(#20129,#20035) hasLocation(#20129,#20035)
#20130=* #20130=*

View File

@@ -14,7 +14,7 @@ toplevels(#20001,1)
locations_default(#20002,#10000,3,17,3,17) locations_default(#20002,#10000,3,17,3,17)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected token","#!/usr/bin/node js_parse_errors(#20003,#20001,"Error: Unexpected token","#!/usr/bin/node
") ")
#20004=@"loc,{#10000},4,1,4,1" #20004=@"loc,{#10000},4,1,4,1"
locations_default(#20004,#10000,4,1,4,1) locations_default(#20004,#10000,4,1,4,1)

View File

@@ -604,7 +604,7 @@ successor(#20133,#20115)
successor(#20117,#20133) successor(#20117,#20133)
successor(#20169,#20117) successor(#20169,#20117)
#20191=* #20191=*
jsParseErrors(#20191,#20001,"Error: Missing function name","function() {} js_parse_errors(#20191,#20001,"Error: Missing function name","function() {}
") ")
hasLocation(#20191,#20103) hasLocation(#20191,#20103)
#20192=* #20192=*

View File

@@ -197,7 +197,7 @@ successor(#20057,#20041)
successor(#20038,#20037) successor(#20038,#20037)
successor(#20054,#20038) successor(#20054,#20038)
#20059=* #20059=*
jsParseErrors(#20059,#20001,"Error: Assigning to arguments in strict mode"," arguments = 42; js_parse_errors(#20059,#20001,"Error: Assigning to arguments in strict mode"," arguments = 42;
") ")
#20060=@"loc,{#10000},3,3,3,3" #20060=@"loc,{#10000},3,3,3,3"
locations_default(#20060,#10000,3,3,3,3) locations_default(#20060,#10000,3,3,3,3)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Identifier expected.","import n = 5; js_parse_errors(#20003,#20001,"Error: Identifier expected.","import n = 5;
") ")
#20004=@"loc,{#10000},1,12,1,12" #20004=@"loc,{#10000},1,12,1,12"
locations_default(#20004,#10000,1,12,1,12) locations_default(#20004,#10000,1,12,1,12)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unexpected token","var; js_parse_errors(#20003,#20001,"Error: Unexpected token","var;
") ")
#20004=@"loc,{#10000},1,4,1,4" #20004=@"loc,{#10000},1,4,1,4"
locations_default(#20004,#10000,1,4,1,4) locations_default(#20004,#10000,1,4,1,4)

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Unsupported TypeScript syntax","import * as x from `x`; js_parse_errors(#20003,#20001,"Error: Unsupported TypeScript syntax","import * as x from `x`;
") ")
hasLocation(#20003,#20002) hasLocation(#20003,#20002)
#20004=* #20004=*

View File

@@ -14,7 +14,7 @@ toplevels(#20001,0)
locations_default(#20002,#10000,1,1,1,1) locations_default(#20002,#10000,1,1,1,1)
hasLocation(#20001,#20002) hasLocation(#20001,#20002)
#20003=* #20003=*
jsParseErrors(#20003,#20001,"Error: Rest patterns cannot have a default value","[...x = a] = a; // Error, rest element cannot have initializer js_parse_errors(#20003,#20001,"Error: Rest patterns cannot have a default value","[...x = a] = a; // Error, rest element cannot have initializer
") ")
#20004=@"loc,{#10000},3,5,3,5" #20004=@"loc,{#10000},3,5,3,5"
locations_default(#20004,#10000,3,5,3,5) locations_default(#20004,#10000,3,5,3,5)

View File

@@ -215,3 +215,8 @@ deprecated predicate isOptionalParameterDeclaration(Parameter parameter) { is_op
* Use `PredicateTypeExpr#hasAssertsKeyword() instead. * Use `PredicateTypeExpr#hasAssertsKeyword() instead.
*/ */
deprecated predicate hasAssertsKeyword(PredicateTypeExpr node) { has_asserts_keyword(node) } deprecated predicate hasAssertsKeyword(PredicateTypeExpr node) { has_asserts_keyword(node) }
/**
* Alias for the predicate `js_parse_errors` defined in the .dbscheme.
* Use the `JSParseError` class instead.
*/
deprecated predicate jsParseErrors(JSParseError id, TopLevel toplevel, string message, string line) { js_parse_errors(id, toplevel, message, line) }

View File

@@ -15,10 +15,10 @@ abstract class Error extends Locatable {
/** A JavaScript parse error encountered during extraction. */ /** A JavaScript parse error encountered during extraction. */
class JSParseError extends @js_parse_error, Error { class JSParseError extends @js_parse_error, Error {
/** Gets the toplevel element this error occurs in. */ /** Gets the toplevel element this error occurs in. */
TopLevel getTopLevel() { jsParseErrors(this, result, _, _) } TopLevel getTopLevel() { js_parse_errors(this, result, _, _) }
override string getMessage() { jsParseErrors(this, _, result, _) } override string getMessage() { js_parse_errors(this, _, result, _) }
/** Gets the source text of the line this error occurs on. */ /** Gets the source text of the line this error occurs on. */
string getLine() { jsParseErrors(this, _, _, result) } string getLine() { js_parse_errors(this, _, _, result) }
} }

View File

@@ -819,7 +819,7 @@ indentation (int file: @file ref,
int indentDepth: int ref); int indentDepth: int ref);
// JavaScript parse errors // JavaScript parse errors
jsParseErrors (unique int id: @js_parse_error, js_parse_errors (unique int id: @js_parse_error,
int toplevel: @toplevel ref, int toplevel: @toplevel ref,
varchar(900) message: string ref, varchar(900) message: string ref,
varchar(900) line: string ref); varchar(900) line: string ref);

View File

@@ -18734,7 +18734,7 @@
</dependencies> </dependencies>
</relation> </relation>
<relation> <relation>
<name>jsParseErrors</name> <name>js_parse_errors</name>
<cardinality>3</cardinality> <cardinality>3</cardinality>
<columnsizes> <columnsizes>
<e> <e>

View File

@@ -60,3 +60,5 @@ is_optional_parameter_declaration.rel: reorder isOptionalParameterDeclaration.re
isOptionalParameterDeclaration.rel: delete isOptionalParameterDeclaration.rel: delete
has_asserts_keyword.rel: reorder hasAssertsKeyword.rel(int node) node has_asserts_keyword.rel: reorder hasAssertsKeyword.rel(int node) node
hasAssertsKeyword.rel: delete hasAssertsKeyword.rel: delete
js_parse_errors.rel: reorder jsParseErrors.rel(int id, int toplevel, string message, string line) id toplevel message line
jsParseErrors.rel: delete