@rightcapital/phpdoc-parser 0.5.3 → 0.6.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 (52) hide show
  1. package/dist/index.d.ts +10 -1
  2. package/dist/index.js +22 -4
  3. package/dist/phpdoc-parser/ast/comment.d.ts +7 -0
  4. package/dist/phpdoc-parser/ast/comment.js +14 -0
  5. package/dist/phpdoc-parser/ast/const-expr/const-expr-node.d.ts +0 -2
  6. package/dist/phpdoc-parser/ast/const-expr/const-expr-node.js +0 -3
  7. package/dist/phpdoc-parser/ast/const-expr/const-expr-string-node.d.ts +5 -1
  8. package/dist/phpdoc-parser/ast/const-expr/const-expr-string-node.js +33 -2
  9. package/dist/phpdoc-parser/ast/php-doc/param-closure-this-tag-value-node.d.ts +10 -0
  10. package/dist/phpdoc-parser/ast/php-doc/param-closure-this-tag-value-node.js +19 -0
  11. package/dist/phpdoc-parser/ast/php-doc/param-immediately-invoked-callable-tag-value-node.d.ts +8 -0
  12. package/dist/phpdoc-parser/ast/php-doc/param-immediately-invoked-callable-tag-value-node.js +18 -0
  13. package/dist/phpdoc-parser/ast/php-doc/param-later-invoked-callable-tag-value-node.d.ts +8 -0
  14. package/dist/phpdoc-parser/ast/php-doc/param-later-invoked-callable-tag-value-node.js +18 -0
  15. package/dist/phpdoc-parser/ast/php-doc/php-doc-node.d.ts +2 -0
  16. package/dist/phpdoc-parser/ast/php-doc/php-doc-node.js +6 -0
  17. package/dist/phpdoc-parser/ast/php-doc/pure-unless-callable-is-impure-tag-value-node.d.ts +8 -0
  18. package/dist/phpdoc-parser/ast/php-doc/pure-unless-callable-is-impure-tag-value-node.js +18 -0
  19. package/dist/phpdoc-parser/ast/php-doc/require-extends-tag-value-node.d.ts +9 -0
  20. package/dist/phpdoc-parser/ast/php-doc/require-extends-tag-value-node.js +18 -0
  21. package/dist/phpdoc-parser/ast/php-doc/require-implements-tag-value-node.d.ts +9 -0
  22. package/dist/phpdoc-parser/ast/php-doc/require-implements-tag-value-node.js +18 -0
  23. package/dist/phpdoc-parser/ast/php-doc/sealed-tag-value-node.d.ts +9 -0
  24. package/dist/phpdoc-parser/ast/php-doc/sealed-tag-value-node.js +18 -0
  25. package/dist/phpdoc-parser/ast/php-doc/template-tag-value-node.d.ts +2 -1
  26. package/dist/phpdoc-parser/ast/php-doc/template-tag-value-node.js +4 -2
  27. package/dist/phpdoc-parser/ast/type/array-shape-item-node.d.ts +3 -2
  28. package/dist/phpdoc-parser/ast/type/array-shape-node.d.ts +8 -2
  29. package/dist/phpdoc-parser/ast/type/array-shape-node.js +13 -3
  30. package/dist/phpdoc-parser/ast/type/array-shape-unsealed-type-node.d.ts +8 -0
  31. package/dist/phpdoc-parser/ast/type/array-shape-unsealed-type-node.js +21 -0
  32. package/dist/phpdoc-parser/ast/type/callable-type-node.d.ts +3 -1
  33. package/dist/phpdoc-parser/ast/type/callable-type-node.js +4 -2
  34. package/dist/phpdoc-parser/ast/types.d.ts +2 -1
  35. package/dist/phpdoc-parser/ast/types.js +1 -0
  36. package/dist/phpdoc-parser/lexer/lexer.d.ts +2 -0
  37. package/dist/phpdoc-parser/lexer/lexer.js +3 -0
  38. package/dist/phpdoc-parser/parser/const-expr-parser.d.ts +2 -4
  39. package/dist/phpdoc-parser/parser/const-expr-parser.js +6 -20
  40. package/dist/phpdoc-parser/parser/php-doc-parser.d.ts +11 -9
  41. package/dist/phpdoc-parser/parser/php-doc-parser.js +112 -66
  42. package/dist/phpdoc-parser/parser/string-unescaper.js +2 -2
  43. package/dist/phpdoc-parser/parser/token-iterator.d.ts +4 -0
  44. package/dist/phpdoc-parser/parser/token-iterator.js +31 -3
  45. package/dist/phpdoc-parser/parser/type-parser.d.ts +8 -2
  46. package/dist/phpdoc-parser/parser/type-parser.js +205 -76
  47. package/dist/phpdoc-parser/parser-config.d.ts +10 -0
  48. package/dist/phpdoc-parser/parser-config.js +12 -0
  49. package/dist/phpdoc-parser/transpiler/php-doc-to-typescript-type-transpiler.js +9 -2
  50. package/package.json +8 -5
  51. package/dist/phpdoc-parser/ast/const-expr/quote-aware-const-expr-string-node.d.ts +0 -10
  52. package/dist/phpdoc-parser/ast/const-expr/quote-aware-const-expr-string-node.js +0 -47
@@ -1,10 +0,0 @@
1
- import { ConstExprStringNode } from './const-expr-string-node';
2
- export declare class QuoteAwareConstExprStringNode extends ConstExprStringNode {
3
- static readonly SINGLE_QUOTED = 1;
4
- static readonly DOUBLE_QUOTED = 2;
5
- quoteType: number;
6
- constructor(value: string, quoteType: number);
7
- toString(): string;
8
- private escapeDoubleQuotedString;
9
- getNodeType(): string;
10
- }
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuoteAwareConstExprStringNode = void 0;
4
- const const_expr_string_node_1 = require("./const-expr-string-node");
5
- class QuoteAwareConstExprStringNode extends const_expr_string_node_1.ConstExprStringNode {
6
- constructor(value, quoteType) {
7
- super(value);
8
- this.quoteType = quoteType;
9
- }
10
- toString() {
11
- if (this.quoteType === QuoteAwareConstExprStringNode.SINGLE_QUOTED) {
12
- return `'${this.value.replace(/'/g, "\\'")}'`;
13
- }
14
- return `"${this.escapeDoubleQuotedString()}"`;
15
- }
16
- escapeDoubleQuotedString() {
17
- let escaped = this.value.replace(/["\n\r\t\x0B\f\v\\$]/g, '\\$&');
18
- const regexes = [
19
- /[\x00-\x08\x0E-\x1F]/g,
20
- /[\xC0-\xC1]/g,
21
- /[\xF5-\xFF]/g,
22
- /\xE0[\x80-\x9F]/g,
23
- /\xF0[\x80-\x8F]/g,
24
- /[\xC2-\xDF](?![\x80-\xBF])/g,
25
- /[\xE0-\xEF](?![\x80-\xBF]{2})/g,
26
- /[\xF0-\xF4](?![\x80-\xBF]{3})/g,
27
- /(?<=[\x00-\x7F\xF5-\xFF])[\x80-\xBF]/g,
28
- /(?<![\xC2-\xDF]|[\xE0-\xEF]|[\xE0-\xEF][\x80-\xBF]|[\xF0-\xF4]|[\xF0-\xF4][\x80-\xBF]|[\xF0-\xF4][\x80-\xBF]{2})[\x80-\xBF]/g,
29
- /(?<=[\xE0-\xEF])[\x80-\xBF](?![\x80-\xBF])/g,
30
- /(?<=[\xF0-\xF4])[\x80-\xBF](?![\x80-\xBF]{2})/g,
31
- /(?<=[\xF0-\xF4][\x80-\xBF])[\x80-\xBF](?![\x80-\xBF])/g,
32
- ];
33
- for (const regex of regexes) {
34
- escaped = escaped.replace(regex, (match) => {
35
- const hex = match.charCodeAt(0).toString(16);
36
- return `\\x${'0'.repeat(2 - hex.length) + hex}`;
37
- });
38
- }
39
- return escaped;
40
- }
41
- getNodeType() {
42
- return 'QuoteAwareConstExprStringNode';
43
- }
44
- }
45
- exports.QuoteAwareConstExprStringNode = QuoteAwareConstExprStringNode;
46
- QuoteAwareConstExprStringNode.SINGLE_QUOTED = 1;
47
- QuoteAwareConstExprStringNode.DOUBLE_QUOTED = 2;