mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
JS: Rename to Angular-style template
This commit is contained in:
@@ -82,8 +82,8 @@ public class ExtractorConfig {
|
||||
/** A CommonJS module that is not also an ES2015 module. */
|
||||
COMMONJS_MODULE,
|
||||
|
||||
/** An Angular template expression. */
|
||||
ANGULAR_TEMPLATE,
|
||||
/** A template expression, using a dialect similar to that of Angular. */
|
||||
ANGULAR_STYLE_TEMPLATE,
|
||||
|
||||
/** Automatically determined source type. */
|
||||
AUTO;
|
||||
@@ -98,7 +98,7 @@ public class ExtractorConfig {
|
||||
*/
|
||||
public Parser createParser(Options options, String input, int startPos) {
|
||||
switch (this) {
|
||||
case ANGULAR_TEMPLATE:
|
||||
case ANGULAR_STYLE_TEMPLATE:
|
||||
return new AngularExpressionParser(options, input, startPos);
|
||||
default:
|
||||
return new CustomParser(options, input, startPos);
|
||||
@@ -118,7 +118,7 @@ public class ExtractorConfig {
|
||||
* variables are implicitly declared in its local scope. Implies {@link #hasLocalScope()}.
|
||||
*/
|
||||
public boolean hasNoGlobalScope() {
|
||||
return this == ANGULAR_TEMPLATE;
|
||||
return this == ANGULAR_STYLE_TEMPLATE;
|
||||
}
|
||||
|
||||
/** Returns true if this source is implicitly in strict mode. */
|
||||
|
||||
@@ -126,8 +126,8 @@ public class HTMLExtractor implements IExtractor {
|
||||
}
|
||||
}
|
||||
extractSnippet(
|
||||
TopLevelKind.ANGULAR_TEMPLATE,
|
||||
config.withSourceType(SourceType.ANGULAR_TEMPLATE),
|
||||
TopLevelKind.ANGULAR_STYLE_TEMPLATE,
|
||||
config.withSourceType(SourceType.ANGULAR_STYLE_TEMPLATE),
|
||||
scopeManager,
|
||||
textualExtractor,
|
||||
source,
|
||||
@@ -437,8 +437,8 @@ public class HTMLExtractor implements IExtractor {
|
||||
int bodyGroup = getNonNullCaptureGroup(m);
|
||||
if (bodyGroup != -1) {
|
||||
extractSnippet(
|
||||
TopLevelKind.ANGULAR_TEMPLATE,
|
||||
config.withSourceType(SourceType.ANGULAR_TEMPLATE),
|
||||
TopLevelKind.ANGULAR_STYLE_TEMPLATE,
|
||||
config.withSourceType(SourceType.ANGULAR_STYLE_TEMPLATE),
|
||||
scopeManager,
|
||||
textualExtractor,
|
||||
m.group(bodyGroup),
|
||||
|
||||
@@ -8,7 +8,7 @@ public enum TopLevelKind {
|
||||
INLINE_SCRIPT(1),
|
||||
EVENT_HANDLER(2),
|
||||
JAVASCRIPT_URL(3),
|
||||
ANGULAR_TEMPLATE(4);
|
||||
ANGULAR_STYLE_TEMPLATE(4);
|
||||
|
||||
private int value;
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ class CodeInAttribute extends TopLevel {
|
||||
CodeInAttribute() {
|
||||
this instanceof @event_handler or
|
||||
this instanceof @javascript_url or
|
||||
this instanceof @angular_template_toplevel
|
||||
this instanceof @template_toplevel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ module Angular2 {
|
||||
* For example, the expression `x | f: y` is desugared to `f(x, y)` where
|
||||
* `f` is a `PipeRefExpr`.
|
||||
*/
|
||||
class PipeRefExpr extends Expr, @angular_pipe_ref {
|
||||
class PipeRefExpr extends Expr, @template_pipe_ref {
|
||||
/** Gets the identifier node naming the pipe. */
|
||||
Identifier getIdentifier() { result = getChildExpr(0) }
|
||||
|
||||
@@ -256,7 +256,7 @@ module Angular2 {
|
||||
}
|
||||
|
||||
/** The top-level containing an Angular expression. */
|
||||
class TemplateTopLevel extends TopLevel, @angular_template_toplevel {
|
||||
class TemplateTopLevel extends TopLevel, @template_toplevel {
|
||||
/** Gets the expression in this top-level. */
|
||||
Expr getExpression() { result = getChildStmt(0).(ExprStmt).getExpr() }
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ case @toplevel.kind of
|
||||
| 1 = @inline_script
|
||||
| 2 = @event_handler
|
||||
| 3 = @javascript_url
|
||||
| 4 = @angular_template_toplevel;
|
||||
| 4 = @template_toplevel;
|
||||
|
||||
is_module (int tl: @toplevel ref);
|
||||
is_nodejs (int tl: @toplevel ref);
|
||||
@@ -365,7 +365,7 @@ case @expr.kind of
|
||||
| 116 = @assignlogandexpr
|
||||
| 117 = @assignlogorexpr
|
||||
| 118 = @assignnullishcoalescingexpr
|
||||
| 119 = @angular_pipe_ref
|
||||
| 119 = @template_pipe_ref
|
||||
| 120 = @generated_code_expr
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user