@auscope/angular2parse 19.0.0 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.editorconfig +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +65 -49
  4. package/angular.json +56 -0
  5. package/package.json +29 -21
  6. package/projects/angular2parse/README.md +49 -0
  7. package/projects/angular2parse/ng-package.json +7 -0
  8. package/projects/angular2parse/package.json +19 -0
  9. package/projects/angular2parse/src/lib/angular/compiler/assertions.ts +49 -0
  10. package/projects/angular2parse/src/lib/angular/compiler/ast.ts +393 -0
  11. package/projects/angular2parse/src/lib/angular/compiler/chars.ts +89 -0
  12. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.ts +25 -0
  13. package/projects/angular2parse/src/lib/angular/compiler/lexer.ts +383 -0
  14. package/projects/angular2parse/src/lib/angular/compiler/parser.ts +811 -0
  15. package/{lib/angular/compiler.d.ts → projects/angular2parse/src/lib/angular/compiler.ts} +1 -1
  16. package/projects/angular2parse/src/lib/angular/facade/lang.ts +124 -0
  17. package/projects/angular2parse/src/lib/angular/facade.ts +1 -0
  18. package/{lib/angular.d.ts → projects/angular2parse/src/lib/angular.ts} +1 -1
  19. package/projects/angular2parse/src/lib/module.ts +12 -0
  20. package/projects/angular2parse/src/lib/parse.ts +78 -0
  21. package/projects/angular2parse/src/lib/util/binary-operations.ts +17 -0
  22. package/projects/angular2parse/src/lib/util/lang.ts +15 -0
  23. package/{lib/util.d.ts → projects/angular2parse/src/lib/util.ts} +1 -1
  24. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.ts +149 -0
  25. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.ts +208 -0
  26. package/{lib/visitors.d.ts → projects/angular2parse/src/lib/visitors.ts} +1 -1
  27. package/projects/angular2parse/src/public-api.ts +5 -0
  28. package/projects/angular2parse/tsconfig.lib.json +19 -0
  29. package/projects/angular2parse/tsconfig.lib.prod.json +9 -0
  30. package/tsconfig.json +33 -0
  31. package/fesm2022/auscope-angular2parse.mjs +0 -2033
  32. package/fesm2022/auscope-angular2parse.mjs.map +0 -1
  33. package/index.d.ts +0 -5
  34. package/lib/angular/compiler/assertions.d.ts +0 -9
  35. package/lib/angular/compiler/ast.d.ts +0 -242
  36. package/lib/angular/compiler/chars.d.ts +0 -69
  37. package/lib/angular/compiler/interpolation-config.d.ts +0 -14
  38. package/lib/angular/compiler/lexer.d.ts +0 -44
  39. package/lib/angular/compiler/parser.d.ts +0 -92
  40. package/lib/angular/facade/lang.d.ts +0 -44
  41. package/lib/angular/facade.d.ts +0 -1
  42. package/lib/module.d.ts +0 -9
  43. package/lib/parse.d.ts +0 -21
  44. package/lib/util/binary-operations.d.ts +0 -1
  45. package/lib/util/lang.d.ts +0 -4
  46. package/lib/visitors/parse-visitor-compiler.d.ts +0 -23
  47. package/lib/visitors/parse-visitor-resolver.d.ts +0 -25
  48. package/public-api.d.ts +0 -2
@@ -1,69 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- export declare const $EOF = 0;
9
- export declare const $TAB = 9;
10
- export declare const $LF = 10;
11
- export declare const $VTAB = 11;
12
- export declare const $FF = 12;
13
- export declare const $CR = 13;
14
- export declare const $SPACE = 32;
15
- export declare const $BANG = 33;
16
- export declare const $DQ = 34;
17
- export declare const $HASH = 35;
18
- export declare const $$ = 36;
19
- export declare const $PERCENT = 37;
20
- export declare const $AMPERSAND = 38;
21
- export declare const $SQ = 39;
22
- export declare const $LPAREN = 40;
23
- export declare const $RPAREN = 41;
24
- export declare const $STAR = 42;
25
- export declare const $PLUS = 43;
26
- export declare const $COMMA = 44;
27
- export declare const $MINUS = 45;
28
- export declare const $PERIOD = 46;
29
- export declare const $SLASH = 47;
30
- export declare const $COLON = 58;
31
- export declare const $SEMICOLON = 59;
32
- export declare const $LT = 60;
33
- export declare const $EQ = 61;
34
- export declare const $GT = 62;
35
- export declare const $QUESTION = 63;
36
- export declare const $0 = 48;
37
- export declare const $9 = 57;
38
- export declare const $A = 65;
39
- export declare const $E = 69;
40
- export declare const $F = 70;
41
- export declare const $X = 88;
42
- export declare const $Z = 90;
43
- export declare const $LBRACKET = 91;
44
- export declare const $BACKSLASH = 92;
45
- export declare const $RBRACKET = 93;
46
- export declare const $CARET = 94;
47
- export declare const $_ = 95;
48
- export declare const $a = 97;
49
- export declare const $e = 101;
50
- export declare const $f = 102;
51
- export declare const $n = 110;
52
- export declare const $r = 114;
53
- export declare const $t = 116;
54
- export declare const $u = 117;
55
- export declare const $v = 118;
56
- export declare const $x = 120;
57
- export declare const $z = 122;
58
- export declare const $LBRACE = 123;
59
- export declare const $BAR = 124;
60
- export declare const $RBRACE = 125;
61
- export declare const $NBSP = 160;
62
- export declare const $PIPE = 124;
63
- export declare const $TILDA = 126;
64
- export declare const $AT = 64;
65
- export declare const $BT = 96;
66
- export declare function isWhitespace(code: number): boolean;
67
- export declare function isDigit(code: number): boolean;
68
- export declare function isAsciiLetter(code: number): boolean;
69
- export declare function isAsciiHexDigit(code: number): boolean;
@@ -1,14 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- export declare class InterpolationConfig {
9
- start: string;
10
- end: string;
11
- static fromArray(markers: [string, string]): InterpolationConfig;
12
- constructor(start: string, end: string);
13
- }
14
- export declare const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig;
@@ -1,44 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- export declare enum TokenType {
9
- Character = 0,
10
- Identifier = 1,
11
- Keyword = 2,
12
- String = 3,
13
- Operator = 4,
14
- Number = 5,
15
- Error = 6
16
- }
17
- export declare class Lexer {
18
- tokenize(text: string): Token[];
19
- }
20
- export declare class Token {
21
- index: number;
22
- type: TokenType;
23
- numValue: number;
24
- strValue: string;
25
- constructor(index: number, type: TokenType, numValue: number, strValue: string);
26
- isCharacter(code: number): boolean;
27
- isNumber(): boolean;
28
- isString(): boolean;
29
- isOperator(operater: string): boolean;
30
- isIdentifier(): boolean;
31
- isKeyword(): boolean;
32
- isKeywordLet(): boolean;
33
- isKeywordNull(): boolean;
34
- isKeywordUndefined(): boolean;
35
- isKeywordTrue(): boolean;
36
- isKeywordFalse(): boolean;
37
- isKeywordThis(): boolean;
38
- isError(): boolean;
39
- toNumber(): number;
40
- toString(): string;
41
- }
42
- export declare const EOF: Token;
43
- export declare function isIdentifier(input: string): boolean;
44
- export declare function isQuote(code: number): boolean;
@@ -1,92 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import { InterpolationConfig } from './interpolation-config';
9
- import { AST, ASTWithSource, BindingPipe, LiteralMap, ParseSpan, ParserError, TemplateBinding } from './ast';
10
- import { Lexer, Token } from './lexer';
11
- export declare class SplitInterpolation {
12
- strings: string[];
13
- expressions: string[];
14
- offsets: number[];
15
- constructor(strings: string[], expressions: string[], offsets: number[]);
16
- }
17
- export declare class TemplateBindingParseResult {
18
- templateBindings: TemplateBinding[];
19
- warnings: string[];
20
- errors: ParserError[];
21
- constructor(templateBindings: TemplateBinding[], warnings: string[], errors: ParserError[]);
22
- }
23
- export declare class Parser {
24
- private _lexer;
25
- private errors;
26
- constructor(_lexer: Lexer);
27
- parseAction(input: string, location: any, interpolationConfig?: InterpolationConfig): ASTWithSource;
28
- parseBinding(input: string, location: any, interpolationConfig?: InterpolationConfig): ASTWithSource;
29
- parseSimpleBinding(input: string, location: string, interpolationConfig?: InterpolationConfig): ASTWithSource;
30
- private _reportError;
31
- private _parseBindingAst;
32
- private _parseQuote;
33
- parseTemplateBindings(prefixToken: string, input: string, location: any): TemplateBindingParseResult;
34
- parseInterpolation(input: string, location: any, interpolationConfig?: InterpolationConfig): ASTWithSource;
35
- splitInterpolation(input: string, location: string, interpolationConfig?: InterpolationConfig): SplitInterpolation;
36
- wrapLiteralPrimitive(input: string, location: any): ASTWithSource;
37
- private _stripComments;
38
- private _commentStart;
39
- private _checkNoInterpolation;
40
- private _findInterpolationErrorColumn;
41
- }
42
- export declare class _ParseAST {
43
- input: string;
44
- location: any;
45
- tokens: Token[];
46
- inputLength: number;
47
- parseAction: boolean;
48
- private errors;
49
- private offset;
50
- private rparensExpected;
51
- private rbracketsExpected;
52
- private rbracesExpected;
53
- index: number;
54
- constructor(input: string, location: any, tokens: Token[], inputLength: number, parseAction: boolean, errors: ParserError[], offset: number);
55
- peek(offset: number): Token;
56
- get next(): Token;
57
- get inputIndex(): number;
58
- span(start: number): ParseSpan;
59
- advance(): void;
60
- optionalCharacter(code: number): boolean;
61
- peekKeywordLet(): boolean;
62
- expectCharacter(code: number): void;
63
- optionalOperator(op: string): boolean;
64
- expectOperator(operator: string): void;
65
- expectIdentifierOrKeyword(): string;
66
- expectIdentifierOrKeywordOrString(): string;
67
- parseChain(): AST;
68
- parsePipe(): AST;
69
- parseExpression(): AST;
70
- parseConditional(): AST;
71
- parseLogicalOr(): AST;
72
- parseLogicalAnd(): AST;
73
- parseEquality(): AST;
74
- parseRelational(): AST;
75
- parseAdditive(): AST;
76
- parseMultiplicative(): AST;
77
- parsePrefix(): AST;
78
- parseCallChain(): AST;
79
- parsePrimary(): AST;
80
- parseExpressionList(terminator: number): AST[];
81
- parseLiteralMap(): LiteralMap;
82
- parseAccessMemberOrMethodCall(receiver: AST, isSafe?: boolean): AST;
83
- parseCallArguments(): BindingPipe[];
84
- /**
85
- * An identifier, a keyword, a string with an optional `-` inbetween.
86
- */
87
- expectTemplateBindingKey(): string;
88
- parseTemplateBindings(): TemplateBindingParseResult;
89
- error(message: string, index?: number): void;
90
- private locationText;
91
- private skip;
92
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- export interface BrowserNodeGlobal {
9
- Object: typeof Object;
10
- Array: typeof Array;
11
- Map: typeof Map;
12
- Set: typeof Set;
13
- Date: DateConstructor;
14
- RegExp: RegExpConstructor;
15
- JSON: typeof JSON;
16
- Math: any;
17
- assert(condition: any): void;
18
- Reflect: any;
19
- getAngularTestability: Function;
20
- getAllAngularTestabilities: Function;
21
- getAllAngularRootElements: Function;
22
- frameworkStabilizers: Array<Function>;
23
- setTimeout: Function;
24
- clearTimeout: Function;
25
- setInterval: Function;
26
- clearInterval: Function;
27
- encodeURI: Function;
28
- }
29
- export declare function getTypeNameForDebugging(type: any): string;
30
- export declare function isPresent(obj: any): boolean;
31
- export declare function isBlank(obj: any): boolean;
32
- export declare function isStrictStringMap(obj: any): boolean;
33
- export declare function stringify(token: any): string;
34
- export declare class NumberWrapper {
35
- static parseIntAutoRadix(text: string): number;
36
- static isNumeric(value: any): boolean;
37
- }
38
- export declare function looseIdentical(a: any, b: any): boolean;
39
- export declare function isJsObject(o: any): boolean;
40
- export declare function print(obj: Error | Object): void;
41
- export declare function warn(obj: Error | Object): void;
42
- export declare function setValueOnPath(global: any, path: string, value: any): void;
43
- export declare function isPrimitive(obj: any): boolean;
44
- export declare function escapeRegExp(s: string): string;
@@ -1 +0,0 @@
1
- export * from './facade/lang';
package/lib/module.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { PipesConfig } from './parse';
3
- import * as i0 from "@angular/core";
4
- export declare class Angular2ParseModule {
5
- static forRoot(pipesConfigMap: PipesConfig[]): ModuleWithProviders<any>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<Angular2ParseModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<Angular2ParseModule, never, never, never>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<Angular2ParseModule>;
9
- }
package/lib/parse.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare const PIPES_CONFIG: InjectionToken<unknown>;
4
- export interface PipesConfig {
5
- pipeName: string;
6
- pipeInstance: any;
7
- }
8
- export declare class Parse {
9
- private _parser;
10
- private _pipesCache;
11
- private _evalCache;
12
- private _calcCache;
13
- /**
14
- * Used to dependency inject the Angular 2 parser.
15
- */
16
- constructor(pipesConfigs: PipesConfig[][]);
17
- eval(expression: string): Function;
18
- calc(expression: string): Function;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<Parse, [{ optional: true; }]>;
20
- static ɵprov: i0.ɵɵInjectableDeclaration<Parse>;
21
- }
@@ -1 +0,0 @@
1
- export declare const BinaryOperations: Map<string, any>;
@@ -1,4 +0,0 @@
1
- export declare function compileToJSON(json: any): string;
2
- export declare function isPresent(obj: any): boolean;
3
- export declare function isJsObject(obj: any): boolean;
4
- export declare function isFunction(val: any): boolean;
@@ -1,23 +0,0 @@
1
- import { AST, RecursiveAstVisitor, PropertyRead, MethodCall, KeyedRead, ImplicitReceiver, LiteralPrimitive, Binary, Chain, Conditional, BindingPipe, FunctionCall, Interpolation, KeyedWrite, LiteralArray, LiteralMap, PrefixNot, PropertyWrite, SafePropertyRead, SafeMethodCall, Quote } from '../angular';
2
- export declare class ParseVisitorCompiler extends RecursiveAstVisitor {
3
- visitBinary(ast: Binary): any;
4
- visitChain(ast: Chain): any;
5
- visitConditional(ast: Conditional): any;
6
- visitPipe(ast: BindingPipe): any;
7
- visitFunctionCall(ast: FunctionCall): any;
8
- visitImplicitReceiver(ast: ImplicitReceiver): any;
9
- visitInterpolation(ast: Interpolation): any;
10
- visitKeyedRead(ast: KeyedRead): any;
11
- visitKeyedWrite(ast: KeyedWrite): any;
12
- visitLiteralArray(ast: LiteralArray): any;
13
- visitLiteralMap(ast: LiteralMap): any;
14
- visitLiteralPrimitive(ast: LiteralPrimitive): any;
15
- visitMethodCall(ast: MethodCall): any;
16
- visitPrefixNot(ast: PrefixNot): any;
17
- visitPropertyRead(ast: PropertyRead): any;
18
- visitPropertyWrite(ast: PropertyWrite): any;
19
- visitSafePropertyRead(ast: SafePropertyRead): any;
20
- visitSafeMethodCall(ast: SafeMethodCall): any;
21
- visitAll(asts: AST[]): any;
22
- visitQuote(ast: Quote): any;
23
- }
@@ -1,25 +0,0 @@
1
- import { AST, RecursiveAstVisitor, PropertyRead, MethodCall, KeyedRead, ImplicitReceiver, LiteralPrimitive, Binary, Chain, Conditional, BindingPipe, FunctionCall, Interpolation, KeyedWrite, LiteralArray, LiteralMap, PrefixNot, PropertyWrite, SafePropertyRead, SafeMethodCall, Quote } from '../angular';
2
- export declare class ParseVisitorResolver extends RecursiveAstVisitor {
3
- private pipes;
4
- constructor(pipes: Map<string, any>);
5
- visitBinary(ast: Binary, context: any): any;
6
- visitChain(ast: Chain, context: any): any;
7
- visitConditional(ast: Conditional, context: any): any;
8
- visitPipe(ast: BindingPipe, context: any): any;
9
- visitFunctionCall(ast: FunctionCall, context: any): any;
10
- visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
11
- visitInterpolation(ast: Interpolation, context: any): any;
12
- visitKeyedRead(ast: KeyedRead, context: any): any;
13
- visitKeyedWrite(ast: KeyedWrite, context: any): any;
14
- visitLiteralArray(ast: LiteralArray, context: any): any;
15
- visitLiteralMap(ast: LiteralMap, context: any): any;
16
- visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
17
- visitMethodCall(ast: MethodCall, context: any): any;
18
- visitPrefixNot(ast: PrefixNot, context: any): any;
19
- visitPropertyRead(ast: PropertyRead, context: any): any;
20
- visitPropertyWrite(ast: PropertyWrite, context: any): any;
21
- visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
22
- visitSafeMethodCall(ast: SafeMethodCall, context: any): any;
23
- visitAll(asts: AST[], context: any): any;
24
- visitQuote(ast: Quote, context: any): any;
25
- }
package/public-api.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './lib/module';
2
- export * from './lib/parse';