@galacean/engine-shaderlab 1.4.0-alpha.3 → 1.4.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.
- package/dist/browser.js +197 -124
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/browser.verbose.js +238 -157
- package/dist/browser.verbose.js.map +1 -1
- package/dist/browser.verbose.min.js +1 -1
- package/dist/browser.verbose.min.js.map +1 -1
- package/dist/main.js +197 -124
- package/dist/main.js.map +1 -1
- package/dist/main.verbose.js +238 -157
- package/dist/main.verbose.js.map +1 -1
- package/dist/module.js +197 -124
- package/dist/module.js.map +1 -1
- package/dist/module.verbose.js +238 -157
- package/dist/module.verbose.js.map +1 -1
- package/package.json +4 -4
- package/types/common/types.d.ts +1 -0
- package/types/lexer/Utils.d.ts +1 -1
- package/types/parser/AST.d.ts +9 -0
- package/types/parser/GrammarSymbol.d.ts +97 -95
- package/types/parser/builtin/functions.d.ts +4 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-shaderlab",
|
|
3
|
-
"version": "1.4.0-
|
|
3
|
+
"version": "1.4.0-beta.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"verbose/package.json"
|
|
27
27
|
],
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@galacean/engine": "1.4.0-
|
|
30
|
-
"@galacean/engine
|
|
29
|
+
"@galacean/engine-design": "1.4.0-beta.1",
|
|
30
|
+
"@galacean/engine": "1.4.0-beta.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@galacean/engine": "1.4.0-
|
|
33
|
+
"@galacean/engine": "1.4.0-beta.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"b:types": "tsc"
|
package/types/common/types.d.ts
CHANGED
package/types/lexer/Utils.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export default class LexerUtils {
|
|
|
3
3
|
static isLetter(charCode: number): boolean;
|
|
4
4
|
static isAlpha(charCode: number): boolean;
|
|
5
5
|
static isPpCharactors(charCode: number): boolean;
|
|
6
|
-
static isSpace(charCode: number): charCode is 9 | 10 | 32;
|
|
6
|
+
static isSpace(charCode: number): charCode is 9 | 10 | 13 | 32;
|
|
7
7
|
}
|
package/types/parser/AST.d.ts
CHANGED
|
@@ -22,6 +22,9 @@ export declare abstract class TreeNode implements IPoolElement {
|
|
|
22
22
|
init(): void;
|
|
23
23
|
dispose(): void;
|
|
24
24
|
codeGen(visitor: CodeGenVisitor): string;
|
|
25
|
+
/**
|
|
26
|
+
* Do semantic analyze right after the ast node is generated.
|
|
27
|
+
*/
|
|
25
28
|
semanticAnalyze(sa: SematicAnalyzer): void;
|
|
26
29
|
}
|
|
27
30
|
export declare namespace ASTNode {
|
|
@@ -107,6 +110,7 @@ export declare namespace ASTNode {
|
|
|
107
110
|
get type(): GalaceanDataType;
|
|
108
111
|
get lexeme(): string;
|
|
109
112
|
get arraySize(): number;
|
|
113
|
+
get arraySpecifier(): ArraySpecifier;
|
|
110
114
|
get isCustom(): boolean;
|
|
111
115
|
}
|
|
112
116
|
export class ArraySpecifier extends TreeNode {
|
|
@@ -304,9 +308,14 @@ export declare namespace ASTNode {
|
|
|
304
308
|
get arraySpecifier(): ArraySpecifier | undefined;
|
|
305
309
|
}
|
|
306
310
|
export class VariableDeclaration extends TreeNode {
|
|
311
|
+
type: FullySpecifiedType;
|
|
307
312
|
semanticAnalyze(sa: SematicAnalyzer): void;
|
|
308
313
|
codeGen(visitor: CodeGenVisitor): string;
|
|
309
314
|
}
|
|
315
|
+
export class VariableDeclarationList extends TreeNode {
|
|
316
|
+
type: FullySpecifiedType;
|
|
317
|
+
semanticAnalyze(sa: SematicAnalyzer): void;
|
|
318
|
+
}
|
|
310
319
|
export class VariableIdentifier extends TreeNode {
|
|
311
320
|
symbolInfo: VarSymbol | BuiltinVariable | null;
|
|
312
321
|
get lexeme(): string;
|
|
@@ -5,101 +5,103 @@ export declare enum NoneTerminal {
|
|
|
5
5
|
gs_shader_program = 2001,
|
|
6
6
|
global_declaration = 2002,
|
|
7
7
|
variable_declaration = 2003,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
8
|
+
variable_declaration_list = 2004,
|
|
9
|
+
variable_declaration_statement = 2005,
|
|
10
|
+
array_specifier_list = 2006,
|
|
11
|
+
array_specifier = 2007,
|
|
12
|
+
ext_builtin_type_specifier_nonarray = 2008,
|
|
13
|
+
precision_specifier = 2009,
|
|
14
|
+
variable_identifier = 2010,
|
|
15
|
+
variable_identifier_node = 2011,
|
|
16
|
+
primary_expression = 2012,
|
|
17
|
+
postfix_expression = 2013,
|
|
18
|
+
integer_expression = 2014,
|
|
19
|
+
function_call = 2015,
|
|
20
|
+
function_call_generic = 2016,
|
|
21
|
+
function_call_header_no_parameters = 2017,
|
|
22
|
+
function_call_header_with_parameters = 2018,
|
|
23
|
+
function_call_parameter_list = 2019,
|
|
24
|
+
function_call_header = 2020,
|
|
25
|
+
function_identifier = 2021,
|
|
26
|
+
constructor_identifier = 2022,
|
|
27
|
+
unary_expression = 2023,
|
|
28
|
+
unary_operator = 2024,
|
|
29
|
+
multiplicative_expression = 2025,
|
|
30
|
+
additive_expression = 2026,
|
|
31
|
+
shift_expression = 2027,
|
|
32
|
+
relational_expression = 2028,
|
|
33
|
+
equality_expression = 2029,
|
|
34
|
+
and_expression = 2030,
|
|
35
|
+
inclusive_or_expression = 2031,
|
|
36
|
+
exclusive_or_expression = 2032,
|
|
37
|
+
logical_and_expression = 2033,
|
|
38
|
+
logical_xor_expression = 2034,
|
|
39
|
+
logical_or_expression = 2035,
|
|
40
|
+
conditional_expression = 2036,
|
|
41
|
+
assignment_expression = 2037,
|
|
42
|
+
assignment_operator = 2038,
|
|
43
|
+
expression = 2039,
|
|
44
|
+
integer_constant_expression = 2040,
|
|
45
|
+
integer_constant_expression_operator = 2041,
|
|
46
|
+
declaration = 2042,
|
|
47
|
+
function_prototype = 2043,
|
|
48
|
+
function_declarator = 2044,
|
|
49
|
+
function_header_with_parameters = 2045,
|
|
50
|
+
function_header = 2046,
|
|
51
|
+
function_parameter_list = 2047,
|
|
52
|
+
parameter_declarator = 2048,
|
|
53
|
+
parameter_declaration = 2049,
|
|
54
|
+
parameter_qualifier = 2050,
|
|
55
|
+
parameter_type_specifier = 2051,
|
|
56
|
+
init_declarator_list = 2052,
|
|
57
|
+
single_declaration = 2053,
|
|
58
|
+
fully_specified_type = 2054,
|
|
59
|
+
type_qualifier = 2055,
|
|
60
|
+
single_type_qualifier = 2056,
|
|
61
|
+
storage_qualifier = 2057,
|
|
62
|
+
precision_qualifier = 2058,
|
|
63
|
+
interpolation_qualifier = 2059,
|
|
64
|
+
invariant_qualifier = 2060,
|
|
65
|
+
type_specifier = 2061,
|
|
66
|
+
type_specifier_nonarray = 2062,
|
|
67
|
+
type_specifier_no_prec = 2063,
|
|
68
|
+
basic_type = 2064,
|
|
69
|
+
struct_specifier = 2065,
|
|
70
|
+
struct_declaration_list = 2066,
|
|
71
|
+
struct_declaration = 2067,
|
|
72
|
+
layout_qualifier = 2068,
|
|
73
|
+
struct_declarator_list = 2069,
|
|
74
|
+
struct_declarator = 2070,
|
|
75
|
+
identifier_list = 2071,
|
|
76
|
+
decl_identifier = 2072,
|
|
77
|
+
initializer = 2073,
|
|
78
|
+
initializer_list = 2074,
|
|
79
|
+
declaration_statement = 2075,
|
|
80
|
+
simple_statement = 2076,
|
|
81
|
+
compound_statement_no_scope = 2077,
|
|
82
|
+
statement_with_scope = 2078,
|
|
83
|
+
compound_statement = 2079,
|
|
84
|
+
statement = 2080,
|
|
85
|
+
statement_list = 2081,
|
|
86
|
+
iteration_statement_no_new_scope = 2082,
|
|
87
|
+
expression_statement = 2083,
|
|
88
|
+
selection_statement = 2084,
|
|
89
|
+
selection_rest_statement = 2085,
|
|
90
|
+
condition = 2086,
|
|
91
|
+
conditionopt = 2087,
|
|
92
|
+
iteration_statement = 2088,
|
|
93
|
+
for_init_statement = 2089,
|
|
94
|
+
for_rest_statement = 2090,
|
|
95
|
+
jump_statement = 2091,
|
|
96
|
+
external_declaration = 2092,
|
|
97
|
+
function_definition = 2093,
|
|
98
|
+
field_selection = 2094,
|
|
99
|
+
bool_constant = 2095,
|
|
100
|
+
function_identifier_node = 2096,
|
|
101
|
+
typename_identifier_node = 2097,
|
|
102
|
+
scope_brace = 2098,
|
|
103
|
+
scope_end_brace = 2099,
|
|
104
|
+
_ignore = 2100
|
|
103
105
|
}
|
|
104
106
|
export type GrammarSymbol = Terminal | NoneTerminal;
|
|
105
107
|
export type Derivation = GrammarSymbol[];
|
|
@@ -19,17 +19,16 @@ export declare enum EGenType {
|
|
|
19
19
|
export type NonGenericGalaceanType = Exclude<GalaceanDataType, string>;
|
|
20
20
|
type BuiltinType = NonGenericGalaceanType | EGenType;
|
|
21
21
|
export declare class BuiltinFunction {
|
|
22
|
-
private _returnType;
|
|
23
22
|
ident: string;
|
|
24
23
|
readonly args: BuiltinType[];
|
|
25
24
|
readonly scope: EShaderStage;
|
|
25
|
+
private _returnType;
|
|
26
|
+
private _realReturnType;
|
|
27
|
+
get realReturnType(): NonGenericGalaceanType;
|
|
26
28
|
private constructor();
|
|
27
29
|
static getReturnType(fn: BuiltinFunction, genType?: NonGenericGalaceanType): NonGenericGalaceanType;
|
|
28
30
|
static _create(ident: string, returnType: BuiltinType, ...args: BuiltinType[]): void;
|
|
29
31
|
static _createWithScop(ident: string, returnType: BuiltinType, scope: EShaderStage, ...args: BuiltinType[]): void;
|
|
30
|
-
static getFn(ident: string,
|
|
31
|
-
fun: BuiltinFunction;
|
|
32
|
-
genType: Exclude<GalaceanDataType, string>;
|
|
33
|
-
} | undefined;
|
|
32
|
+
static getFn(ident: string, parameterTypes: NonGenericGalaceanType[]): BuiltinFunction | undefined;
|
|
34
33
|
}
|
|
35
34
|
export {};
|