@galacean/engine-shaderlab 1.6.0-alpha.2 → 1.6.0-beta.1

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 (70) hide show
  1. package/dist/browser.js +6325 -4885
  2. package/dist/browser.js.map +1 -1
  3. package/dist/browser.min.js +1 -1
  4. package/dist/browser.min.js.map +1 -1
  5. package/dist/browser.verbose.js +5956 -4985
  6. package/dist/browser.verbose.js.map +1 -1
  7. package/dist/browser.verbose.min.js +1 -1
  8. package/dist/browser.verbose.min.js.map +1 -1
  9. package/dist/main.js +6325 -4885
  10. package/dist/main.js.map +1 -1
  11. package/dist/main.verbose.js +5956 -4985
  12. package/dist/main.verbose.js.map +1 -1
  13. package/dist/module.js +6325 -4887
  14. package/dist/module.js.map +1 -1
  15. package/dist/module.verbose.js +5958 -4986
  16. package/dist/module.verbose.js.map +1 -1
  17. package/package.json +4 -4
  18. package/types/GSError.d.ts +2 -1
  19. package/types/ParserUtils.d.ts +1 -1
  20. package/types/Preprocessor.d.ts +31 -0
  21. package/types/ShaderLab.d.ts +15 -1
  22. package/types/codeGen/CodeGenVisitor.d.ts +1 -2
  23. package/types/codeGen/GLES100.d.ts +4 -8
  24. package/types/codeGen/GLES300.d.ts +9 -6
  25. package/types/codeGen/types.d.ts +2 -2
  26. package/types/common/BaseLexer.d.ts +2 -0
  27. package/types/common/IBaseSymbol.d.ts +5 -0
  28. package/types/common/SymbolTable.d.ts +7 -0
  29. package/types/common/SymbolTableStack.d.ts +13 -0
  30. package/types/common/enums/Keyword.d.ts +108 -0
  31. package/types/common/index.d.ts +1 -1
  32. package/types/common/types.d.ts +4 -5
  33. package/types/index.d.ts +0 -1
  34. package/types/lalr/CFG.d.ts +1 -1
  35. package/types/lexer/Lexer.d.ts +10 -5
  36. package/types/{preprocessor → macroProcessor}/MacroDefine.d.ts +2 -2
  37. package/types/macroProcessor/MacroParserLexer.d.ts +32 -0
  38. package/types/macroProcessor/Utils.d.ts +5 -0
  39. package/types/{preprocessor → macroProcessor}/constants.d.ts +4 -6
  40. package/types/macroProcessor/index.d.ts +1 -0
  41. package/types/parser/AST.d.ts +124 -23
  42. package/types/parser/GrammarSymbol.d.ts +21 -1
  43. package/types/parser/ShaderInfo.d.ts +4 -2
  44. package/types/parser/ShaderTargetParser.d.ts +3 -2
  45. package/types/parser/builtin/functions.d.ts +2 -1
  46. package/types/parser/builtin/variables.d.ts +1 -1
  47. package/types/parser/symbolTable/SymbolInfo.d.ts +12 -8
  48. package/types/parser/symbolTable/index.d.ts +1 -1
  49. package/types/parser/types.d.ts +7 -6
  50. package/types/sourceParser/ShaderSourceFactory.d.ts +8 -0
  51. package/types/sourceParser/ShaderSourceSymbol.d.ts +10 -0
  52. package/types/sourceParser/SourceLexer.d.ts +19 -0
  53. package/types/sourceParser/index.d.ts +1 -0
  54. package/types/common/BaseScanner.d.ts +0 -2
  55. package/types/common/BaseSymbolTable.d.ts +0 -18
  56. package/types/common/Keywords.d.ts +0 -99
  57. package/types/contentParser/ContentSymbolTable.d.ts +0 -10
  58. package/types/contentParser/KeywordMap.d.ts +0 -2
  59. package/types/contentParser/Scanner.d.ts +0 -10
  60. package/types/contentParser/index.d.ts +0 -1
  61. package/types/lexer/Utils.d.ts +0 -7
  62. package/types/parser/symbolTable/TargetSymbolTable.d.ts +0 -13
  63. package/types/preprocessor/PpScanner.d.ts +0 -51
  64. package/types/preprocessor/Preprocessor.d.ts +0 -1
  65. package/types/preprocessor/Utils.d.ts +0 -10
  66. package/types/preprocessor/index.d.ts +0 -1
  67. /package/types/common/{Enums.d.ts → enums/ShaderStage.d.ts} +0 -0
  68. /package/types/{preprocessor/PpParser.d.ts → macroProcessor/MacroParser.d.ts} +0 -0
  69. /package/types/{preprocessor → macroProcessor}/sourceMap/index.d.ts +0 -0
  70. /package/types/{contentParser/ShaderContentParser.d.ts → sourceParser/ShaderSourceParser.d.ts} +0 -0
@@ -1,51 +0,0 @@
1
- import { ShaderRange, ShaderPosition } from "../common";
2
- import PpSourceMap from "./sourceMap";
3
- import BaseScanner from "../common/BaseScanner";
4
- import { BaseToken } from "../common/BaseToken";
5
- import { EPpToken } from "./constants";
6
- export type OnToken = (token: BaseToken, scanner: PpScanner) => void;
7
- export default class PpScanner extends BaseScanner {
8
- private macroLvl;
9
- readonly sourceMap: PpSourceMap;
10
- readonly file: string;
11
- readonly blockRange?: ShaderRange;
12
- constructor(source: string, file?: string, blockRange?: ShaderRange);
13
- /**
14
- * Advance to directive
15
- * @param expandOnToken callback on encountering token.
16
- */
17
- scanDirective(expandOnToken?: OnToken): BaseToken<number>;
18
- /**
19
- * @param nonLetterChar should not be space
20
- */
21
- scanWordsUntilChar(nonLetterChar: string): BaseToken[];
22
- scanWord(skipNonLetter?: boolean): BaseToken;
23
- /**
24
- * @param offset - Offset from starting point
25
- */
26
- getShaderPosition(offset: number): ShaderPosition;
27
- /**
28
- * @param onToken callback when encounter a token
29
- * @returns token split by space
30
- */
31
- scanToken(onToken?: OnToken): BaseToken | undefined;
32
- scanQuotedString(): BaseToken<EPpToken.string_const>;
33
- scanToChar(char: string): void;
34
- scanMacroBranchChunk(): {
35
- token: BaseToken<EPpToken.chunk>;
36
- nextDirective: BaseToken;
37
- };
38
- scanPairedBlock(lc: string, rc: string): void;
39
- /**
40
- * @returns end ShaderPosition
41
- */
42
- scanRemainMacro(): ShaderPosition;
43
- peekNonSpace(): string;
44
- scanInteger(): BaseToken<number>;
45
- /**
46
- * Skip comments
47
- */
48
- scanLineRemain(): BaseToken<number>;
49
- private _advanceToDirective;
50
- private _skipComments;
51
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import { ShaderRange } from "../common";
2
- import { ExpandSegment } from "./PpParser";
3
- import PpSourceMap from "./sourceMap";
4
- export declare class PpUtils {
5
- static expand(segments: ExpandSegment[], source: string, sourceMap?: PpSourceMap): string;
6
- static assembleSegments(segments: {
7
- range: ShaderRange;
8
- replace: string;
9
- }[], source: string): string;
10
- }
@@ -1 +0,0 @@
1
- export * from "./Preprocessor";