fix an build grammer

This commit is contained in:
mcDandy
2026-05-11 22:26:17 +02:00
parent 1571b10043
commit 4fc7e245f6
17 changed files with 27040 additions and 2487 deletions
+6 -6
View File
@@ -327,13 +327,13 @@ You can also get the node from comfy manager under the name of More math.
- accepts packed tensor/list input or separate `h, s, v`,
- optional fourth boolean argument treats hue as degrees.
- `rgb_to_oklab(...)`: convert RGB to OKLab.
- accepts packed tensor/list input or separate `r, g, b`.
- accepts packed tensor/list input or separate `r, g, b`.
- `oklab_to_rgb(...)`: convert OKLab to RGB.
- accepts packed tensor/list input or separate `L, a, b`.
- `rgb_to_cilab(...)` / `rgb_to_cielab(...)`: convert RGB to CIELAB.
- accepts packed tensor/list input or separate `r, g, b`.
- `cilab_to_rgb(...)` / `cielab_to_rgb(...)`: convert CIELAB to RGB.
- accepts packed tensor/list input or separate `L, a, b`.
- accepts packed tensor/list input or separate `L, a, b`.
- `rgb_to_cielab(...)`: convert RGB to CIELAB.
- accepts packed tensor/list input or separate `r, g, b`.
- `cielab_to_rgb(...)`: convert CIELAB to RGB.
- accepts packed tensor/list input or separate `L, a, b`.
- `int_to_rgb(value)`: convert packed integer color to RGB triplet.
- `rgb_to_int(...)`: convert RGB triplet to packed integer color.
+5 -3
View File
@@ -241,9 +241,9 @@ func3:
| RGB_TO_CILAB LPAREN expr (COMMA expr COMMA expr)? RPAREN # RgbToCilabFunc
| RGB_TO_HSV LPAREN expr (COMMA expr COMMA expr)? (COMMA expr)? RPAREN # RgbToHsvFunc
| HSV_TO_RGB LPAREN expr (COMMA expr COMMA expr)? (COMMA expr)? RPAREN # HsvToRgbFunc
| WHERE LPAREN expr COMMA expr COMMA expr RPAREN # WhereFunc;// func3
| OKLAB_TO_RGB LPAREN expr (COMMA expr COMMA expr)? RPAREN # OklabToRgbFunc
| CILAB_TO_RGB LPAREN expr (COMMA expr COMMA expr)? RPAREN # CilabToRgbFunc
| WHERE LPAREN expr COMMA expr COMMA expr RPAREN # WhereFunc
| OKLAB_TO_RGB LPAREN expr (COMMA expr COMMA expr)? RPAREN # OklabToRgbFunc
| CILAB_TO_RGB LPAREN expr (COMMA expr COMMA expr)? RPAREN # CilabToRgbFunc;
func4:
SWAP LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # SwapFunc
@@ -420,6 +420,8 @@ MORPH_OPEN: 'morph_open';
MORPH_CLOSE: 'morph_close';
RGB_TO_OKLAB: 'rgb_to_oklab';
RGB_TO_CILAB: 'rgb_to_cilab';
OKLAB_TO_RGB: 'oklab_to_rgb';
CILAB_TO_RGB: 'cielab_to_rgb';
RGB_TO_HSV: 'rgb_to_hsv';
HSV_TO_RGB: 'hsv_to_rgb';
INT_TO_RGB: 'int_to_rgb';
File diff suppressed because one or more lines are too long
+152 -144
View File
@@ -128,92 +128,96 @@ DILATE=127
ERODE=128
MORPH_OPEN=129
MORPH_CLOSE=130
RGB_TO_HSV=131
HSV_TO_RGB=132
INT_TO_RGB=133
RGB_TO_INT=134
INTERPOLATE_LINEAR=135
INTERPOLATE_AREA=136
INTERPOLATE_NEAREST=137
IF=138
ELSE=139
WHILE=140
FOR=141
IN=142
BREAK=143
CONTINUE=144
RETURN=145
TIMESTAMP=146
SORT=147
ARGSORT=148
ARGMIN=149
ARGMAX=150
SOFTMAX=151
SOFTMIN=152
UNIQUE=153
FLIP=154
ROLL=155
COV=156
CORR=157
ENTROPY=158
CROP=159
NONE=160
NOISE=161
RAND=162
CAUCHY=163
EXPONENTIAL=164
LOGNORMAL=165
BERNOULLI=166
POISSON=167
GAMMADIST=168
BETADIST=169
LAPLACEDIST=170
GUMBELDIST=171
WEIBULLDIST=172
CHI2DIST=173
STUDENTTDIST=174
PERLIN=175
CELLULAR=176
PLASMA=177
PLUS=178
MINUS=179
MULT=180
DIV=181
MOD=182
POW=183
LSHIFT=184
RSHIFT=185
GE=186
GT=187
LE=188
LT=189
EQ=190
EQUEALS=191
PLUS_EQ=192
MINUS_EQ=193
MULT_EQ=194
DIV_EQ=195
MOD_EQ=196
NE=197
PIPE=198
LPAREN=199
RPAREN=200
COMMA=201
SEMICOLON=202
ARROW=203
LBRACKET=204
RBRACKET=205
QUESTION=206
COLON=207
LBRACE=208
RBRACE=209
NUMBER=210
CONSTANT=211
STRING=212
VARIABLE=213
SL_COMMENT=214
ML_COMMENT=215
WS=216
RGB_TO_OKLAB=131
RGB_TO_CILAB=132
OKLAB_TO_RGB=133
CILAB_TO_RGB=134
RGB_TO_HSV=135
HSV_TO_RGB=136
INT_TO_RGB=137
RGB_TO_INT=138
INTERPOLATE_LINEAR=139
INTERPOLATE_AREA=140
INTERPOLATE_NEAREST=141
IF=142
ELSE=143
WHILE=144
FOR=145
IN=146
BREAK=147
CONTINUE=148
RETURN=149
TIMESTAMP=150
SORT=151
ARGSORT=152
ARGMIN=153
ARGMAX=154
SOFTMAX=155
SOFTMIN=156
UNIQUE=157
FLIP=158
ROLL=159
COV=160
CORR=161
ENTROPY=162
CROP=163
NONE=164
NOISE=165
RAND=166
CAUCHY=167
EXPONENTIAL=168
LOGNORMAL=169
BERNOULLI=170
POISSON=171
GAMMADIST=172
BETADIST=173
LAPLACEDIST=174
GUMBELDIST=175
WEIBULLDIST=176
CHI2DIST=177
STUDENTTDIST=178
PERLIN=179
CELLULAR=180
PLASMA=181
PLUS=182
MINUS=183
MULT=184
DIV=185
MOD=186
POW=187
LSHIFT=188
RSHIFT=189
GE=190
GT=191
LE=192
LT=193
EQ=194
EQUEALS=195
PLUS_EQ=196
MINUS_EQ=197
MULT_EQ=198
DIV_EQ=199
MOD_EQ=200
NE=201
PIPE=202
LPAREN=203
RPAREN=204
COMMA=205
SEMICOLON=206
ARROW=207
LBRACKET=208
RBRACKET=209
QUESTION=210
COLON=211
LBRACE=212
RBRACE=213
NUMBER=214
CONSTANT=215
STRING=216
VARIABLE=217
SL_COMMENT=218
ML_COMMENT=219
WS=220
'sin'=1
'cos'=2
'tan'=3
@@ -317,61 +321,65 @@ WS=216
'erode'=128
'morph_open'=129
'morph_close'=130
'rgb_to_hsv'=131
'hsv_to_rgb'=132
'int_to_rgb'=133
'rgb_to_int'=134
'interpolate_linear'=135
'interpolate_area'=136
'if'=138
'else'=139
'while'=140
'for'=141
'in'=142
'break'=143
'continue'=144
'return'=145
'sort'=147
'argsort'=148
'argmin'=149
'argmax'=150
'softmax'=151
'softmin'=152
'unique'=153
'flip'=154
'roll'=155
'cov'=156
'entropy'=158
'crop'=159
'+'=178
'-'=179
'*'=180
'/'=181
'%'=182
'^'=183
'<<'=184
'>>'=185
'>='=186
'>'=187
'<='=188
'<'=189
'=='=190
'='=191
'+='=192
'-='=193
'*='=194
'/='=195
'%='=196
'!='=197
'|'=198
'('=199
')'=200
','=201
';'=202
'->'=203
'['=204
']'=205
'?'=206
':'=207
'{'=208
'}'=209
'rgb_to_oklab'=131
'rgb_to_cilab'=132
'oklab_to_rgb'=133
'cielab_to_rgb'=134
'rgb_to_hsv'=135
'hsv_to_rgb'=136
'int_to_rgb'=137
'rgb_to_int'=138
'interpolate_linear'=139
'interpolate_area'=140
'if'=142
'else'=143
'while'=144
'for'=145
'in'=146
'break'=147
'continue'=148
'return'=149
'sort'=151
'argsort'=152
'argmin'=153
'argmax'=154
'softmax'=155
'softmin'=156
'unique'=157
'flip'=158
'roll'=159
'cov'=160
'entropy'=162
'crop'=163
'+'=182
'-'=183
'*'=184
'/'=185
'%'=186
'^'=187
'<<'=188
'>>'=189
'>='=190
'>'=191
'<='=192
'<'=193
'=='=194
'='=195
'+='=196
'-='=197
'*='=198
'/='=199
'%='=200
'!='=201
'|'=202
'('=203
')'=204
','=205
';'=206
'->'=207
'['=208
']'=209
'?'=210
':'=211
'{'=212
'}'=213
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+152 -144
View File
@@ -128,92 +128,96 @@ DILATE=127
ERODE=128
MORPH_OPEN=129
MORPH_CLOSE=130
RGB_TO_HSV=131
HSV_TO_RGB=132
INT_TO_RGB=133
RGB_TO_INT=134
INTERPOLATE_LINEAR=135
INTERPOLATE_AREA=136
INTERPOLATE_NEAREST=137
IF=138
ELSE=139
WHILE=140
FOR=141
IN=142
BREAK=143
CONTINUE=144
RETURN=145
TIMESTAMP=146
SORT=147
ARGSORT=148
ARGMIN=149
ARGMAX=150
SOFTMAX=151
SOFTMIN=152
UNIQUE=153
FLIP=154
ROLL=155
COV=156
CORR=157
ENTROPY=158
CROP=159
NONE=160
NOISE=161
RAND=162
CAUCHY=163
EXPONENTIAL=164
LOGNORMAL=165
BERNOULLI=166
POISSON=167
GAMMADIST=168
BETADIST=169
LAPLACEDIST=170
GUMBELDIST=171
WEIBULLDIST=172
CHI2DIST=173
STUDENTTDIST=174
PERLIN=175
CELLULAR=176
PLASMA=177
PLUS=178
MINUS=179
MULT=180
DIV=181
MOD=182
POW=183
LSHIFT=184
RSHIFT=185
GE=186
GT=187
LE=188
LT=189
EQ=190
EQUEALS=191
PLUS_EQ=192
MINUS_EQ=193
MULT_EQ=194
DIV_EQ=195
MOD_EQ=196
NE=197
PIPE=198
LPAREN=199
RPAREN=200
COMMA=201
SEMICOLON=202
ARROW=203
LBRACKET=204
RBRACKET=205
QUESTION=206
COLON=207
LBRACE=208
RBRACE=209
NUMBER=210
CONSTANT=211
STRING=212
VARIABLE=213
SL_COMMENT=214
ML_COMMENT=215
WS=216
RGB_TO_OKLAB=131
RGB_TO_CILAB=132
OKLAB_TO_RGB=133
CILAB_TO_RGB=134
RGB_TO_HSV=135
HSV_TO_RGB=136
INT_TO_RGB=137
RGB_TO_INT=138
INTERPOLATE_LINEAR=139
INTERPOLATE_AREA=140
INTERPOLATE_NEAREST=141
IF=142
ELSE=143
WHILE=144
FOR=145
IN=146
BREAK=147
CONTINUE=148
RETURN=149
TIMESTAMP=150
SORT=151
ARGSORT=152
ARGMIN=153
ARGMAX=154
SOFTMAX=155
SOFTMIN=156
UNIQUE=157
FLIP=158
ROLL=159
COV=160
CORR=161
ENTROPY=162
CROP=163
NONE=164
NOISE=165
RAND=166
CAUCHY=167
EXPONENTIAL=168
LOGNORMAL=169
BERNOULLI=170
POISSON=171
GAMMADIST=172
BETADIST=173
LAPLACEDIST=174
GUMBELDIST=175
WEIBULLDIST=176
CHI2DIST=177
STUDENTTDIST=178
PERLIN=179
CELLULAR=180
PLASMA=181
PLUS=182
MINUS=183
MULT=184
DIV=185
MOD=186
POW=187
LSHIFT=188
RSHIFT=189
GE=190
GT=191
LE=192
LT=193
EQ=194
EQUEALS=195
PLUS_EQ=196
MINUS_EQ=197
MULT_EQ=198
DIV_EQ=199
MOD_EQ=200
NE=201
PIPE=202
LPAREN=203
RPAREN=204
COMMA=205
SEMICOLON=206
ARROW=207
LBRACKET=208
RBRACKET=209
QUESTION=210
COLON=211
LBRACE=212
RBRACE=213
NUMBER=214
CONSTANT=215
STRING=216
VARIABLE=217
SL_COMMENT=218
ML_COMMENT=219
WS=220
'sin'=1
'cos'=2
'tan'=3
@@ -317,61 +321,65 @@ WS=216
'erode'=128
'morph_open'=129
'morph_close'=130
'rgb_to_hsv'=131
'hsv_to_rgb'=132
'int_to_rgb'=133
'rgb_to_int'=134
'interpolate_linear'=135
'interpolate_area'=136
'if'=138
'else'=139
'while'=140
'for'=141
'in'=142
'break'=143
'continue'=144
'return'=145
'sort'=147
'argsort'=148
'argmin'=149
'argmax'=150
'softmax'=151
'softmin'=152
'unique'=153
'flip'=154
'roll'=155
'cov'=156
'entropy'=158
'crop'=159
'+'=178
'-'=179
'*'=180
'/'=181
'%'=182
'^'=183
'<<'=184
'>>'=185
'>='=186
'>'=187
'<='=188
'<'=189
'=='=190
'='=191
'+='=192
'-='=193
'*='=194
'/='=195
'%='=196
'!='=197
'|'=198
'('=199
')'=200
','=201
';'=202
'->'=203
'['=204
']'=205
'?'=206
':'=207
'{'=208
'}'=209
'rgb_to_oklab'=131
'rgb_to_cilab'=132
'oklab_to_rgb'=133
'cielab_to_rgb'=134
'rgb_to_hsv'=135
'hsv_to_rgb'=136
'int_to_rgb'=137
'rgb_to_int'=138
'interpolate_linear'=139
'interpolate_area'=140
'if'=142
'else'=143
'while'=144
'for'=145
'in'=146
'break'=147
'continue'=148
'return'=149
'sort'=151
'argsort'=152
'argmin'=153
'argmax'=154
'softmax'=155
'softmin'=156
'unique'=157
'flip'=158
'roll'=159
'cov'=160
'entropy'=162
'crop'=163
'+'=182
'-'=183
'*'=184
'/'=185
'%'=186
'^'=187
'<<'=188
'>>'=189
'>='=190
'>'=191
'<='=192
'<'=193
'=='=194
'='=195
'+='=196
'-='=197
'*='=198
'/='=199
'%='=200
'!='=201
'|'=202
'('=203
')'=204
','=205
';'=206
'->'=207
'['=208
']'=209
'?'=210
':'=211
'{'=212
'}'=213
File diff suppressed because it is too large Load Diff
+36
View File
@@ -1808,6 +1808,24 @@ class MathExprListener(ParseTreeListener):
pass
# Enter a parse tree produced by MathExprParser#RgbToOklabFunc.
def enterRgbToOklabFunc(self, ctx:MathExprParser.RgbToOklabFuncContext):
pass
# Exit a parse tree produced by MathExprParser#RgbToOklabFunc.
def exitRgbToOklabFunc(self, ctx:MathExprParser.RgbToOklabFuncContext):
pass
# Enter a parse tree produced by MathExprParser#RgbToCilabFunc.
def enterRgbToCilabFunc(self, ctx:MathExprParser.RgbToCilabFuncContext):
pass
# Exit a parse tree produced by MathExprParser#RgbToCilabFunc.
def exitRgbToCilabFunc(self, ctx:MathExprParser.RgbToCilabFuncContext):
pass
# Enter a parse tree produced by MathExprParser#RgbToHsvFunc.
def enterRgbToHsvFunc(self, ctx:MathExprParser.RgbToHsvFuncContext):
pass
@@ -1835,6 +1853,24 @@ class MathExprListener(ParseTreeListener):
pass
# Enter a parse tree produced by MathExprParser#OklabToRgbFunc.
def enterOklabToRgbFunc(self, ctx:MathExprParser.OklabToRgbFuncContext):
pass
# Exit a parse tree produced by MathExprParser#OklabToRgbFunc.
def exitOklabToRgbFunc(self, ctx:MathExprParser.OklabToRgbFuncContext):
pass
# Enter a parse tree produced by MathExprParser#CilabToRgbFunc.
def enterCilabToRgbFunc(self, ctx:MathExprParser.CilabToRgbFuncContext):
pass
# Exit a parse tree produced by MathExprParser#CilabToRgbFunc.
def exitCilabToRgbFunc(self, ctx:MathExprParser.CilabToRgbFuncContext):
pass
# Enter a parse tree produced by MathExprParser#SwapFunc.
def enterSwapFunc(self, ctx:MathExprParser.SwapFuncContext):
pass
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+20
View File
@@ -1009,6 +1009,16 @@ class MathExprVisitor(ParseTreeVisitor):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#RgbToOklabFunc.
def visitRgbToOklabFunc(self, ctx:MathExprParser.RgbToOklabFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#RgbToCilabFunc.
def visitRgbToCilabFunc(self, ctx:MathExprParser.RgbToCilabFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#RgbToHsvFunc.
def visitRgbToHsvFunc(self, ctx:MathExprParser.RgbToHsvFuncContext):
return self.visitChildren(ctx)
@@ -1024,6 +1034,16 @@ class MathExprVisitor(ParseTreeVisitor):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#OklabToRgbFunc.
def visitOklabToRgbFunc(self, ctx:MathExprParser.OklabToRgbFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#CilabToRgbFunc.
def visitCilabToRgbFunc(self, ctx:MathExprParser.CilabToRgbFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#SwapFunc.
def visitSwapFunc(self, ctx:MathExprParser.SwapFuncContext):
return self.visitChildren(ctx)
+1 -3
View File
@@ -29,9 +29,7 @@ const FUNCTIONS = new Set([
"upper", "lower", "split", "join", "substring", "substr", "find", "trim", "replace",
"dilate", "erode", "morph_open", "morph_close",
"rgb_to_hsv", "hsv_to_rgb",
"rgb_to_oklab", "oklab_to_rgb",
"rgb_to_cilab", "rgb_to_cielab",
"cilab_to_rgb", "cielab_to_rgb",
"rgb_to_oklab", "oklab_to_rgb", "rgb_to_cielab", "cielab_to_rgb",
"int_to_rgb", "rgb_to_int",
"where", "histogram", "hist", "flow_mag", "flow_magnitude", "flow_ang", "flow_angle",
"interpolate_linear", "interpolate_area", "interpolate_nearest","interpolate_nearest_exact"]);