From c2d8589b7ea7a7fb5572c2414bc8a14df3509ca1 Mon Sep 17 00:00:00 2001 From: mgreminger Date: Sat, 28 Sep 2024 22:10:19 -0500 Subject: [PATCH] feat: implement units applied to pi Commonly occurs when users attempt to apply radians directly to pi symbol --- src/parser/LatexParser.g4 | 2 +- src/parser/LatexParser.ts | 1393 ++++++++++++++++++------------------ src/parser/LatexToSympy.ts | 24 +- tests/test_basic.spec.mjs | 33 +- 4 files changed, 767 insertions(+), 685 deletions(-) diff --git a/src/parser/LatexParser.g4 b/src/parser/LatexParser.g4 index 84615a12..2a5c6fb8 100644 --- a/src/parser/LatexParser.g4 +++ b/src/parser/LatexParser.g4 @@ -17,7 +17,7 @@ id: ID ; number: SUB? NUMBER ; -number_with_units: number u_block; +number_with_units: (number | PI | id) u_block; assign: (id | PI) EQ expr ; // recognize PI here so that error can be generated for assigning to pi diff --git a/src/parser/LatexParser.ts b/src/parser/LatexParser.ts index 8c237b1d..91bccda2 100644 --- a/src/parser/LatexParser.ts +++ b/src/parser/LatexParser.ts @@ -786,9 +786,32 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 170; - this.number_(); - this.state = 171; + this.state = 173; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case 53: + case 64: + { + this.state = 170; + this.number_(); + } + break; + case 12: + { + this.state = 171; + this.match(LatexParser.PI); + } + break; + case 71: + { + this.state = 172; + this.id(); + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 175; this.u_block(); } } @@ -813,27 +836,27 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 175; + this.state = 179; this._errHandler.sync(this); switch (this._input.LA(1)) { case 71: { - this.state = 173; + this.state = 177; this.id(); } break; case 12: { - this.state = 174; + this.state = 178; this.match(LatexParser.PI); } break; default: throw new NoViableAltException(this); } - this.state = 177; + this.state = 181; this.match(LatexParser.EQ); - this.state = 178; + this.state = 182; this.expr(0); } } @@ -859,21 +882,21 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 180; + this.state = 184; this.assign(); - this.state = 183; + this.state = 187; this._errHandler.sync(this); _la = this._input.LA(1); do { { { - this.state = 181; + this.state = 185; this.match(LatexParser.COMMA); - this.state = 182; + this.state = 186; this.assign(); } } - this.state = 185; + this.state = 189; this._errHandler.sync(this); _la = this._input.LA(1); } while (_la===60); @@ -901,16 +924,16 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 187; + this.state = 191; this.assign(); - this.state = 188; + this.state = 192; this.match(LatexParser.EQ); - this.state = 190; + this.state = 194; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===1 || _la===2) { { - this.state = 189; + this.state = 193; this.u_block(); } } @@ -939,16 +962,16 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 192; + this.state = 196; this.expr(0); - this.state = 193; + this.state = 197; this.match(LatexParser.EQ); - this.state = 195; + this.state = 199; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===1 || _la===2) { { - this.state = 194; + this.state = 198; this.u_block(); } } @@ -976,11 +999,11 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 197; + this.state = 201; this.expr(0); - this.state = 198; + this.state = 202; this.match(LatexParser.EQ); - this.state = 199; + this.state = 203; this.expr(0); } } @@ -1006,51 +1029,51 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 203; + this.state = 207; this._errHandler.sync(this); switch (this._input.LA(1)) { case 71: { - this.state = 201; + this.state = 205; this.id(); } break; case 12: { - this.state = 202; + this.state = 206; this.match(LatexParser.PI); } break; default: throw new NoViableAltException(this); } - this.state = 205; + this.state = 209; this.match(LatexParser.EQ); - this.state = 206; + this.state = 210; this.id(); - this.state = 207; + this.state = 211; this.match(LatexParser.L_PAREN); { - this.state = 208; + this.state = 212; this.piecewise_arg(); - this.state = 213; + this.state = 217; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===60) { { { - this.state = 209; + this.state = 213; this.match(LatexParser.COMMA); - this.state = 210; + this.state = 214; this.piecewise_arg(); } } - this.state = 215; + this.state = 219; this._errHandler.sync(this); _la = this._input.LA(1); } } - this.state = 216; + this.state = 220; this.match(LatexParser.R_PAREN); } } @@ -1075,15 +1098,15 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 218; + this.state = 222; this.match(LatexParser.L_PAREN); - this.state = 219; + this.state = 223; this.expr(0); - this.state = 220; + this.state = 224; this.match(LatexParser.COMMA); - this.state = 221; + this.state = 225; this.condition(); - this.state = 222; + this.state = 226; this.match(LatexParser.R_PAREN); } } @@ -1109,17 +1132,17 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 225; + this.state = 229; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===28) { { - this.state = 224; + this.state = 228; this.match(LatexParser.BACKSLASH); } } - this.state = 227; + this.state = 231; _la = this._input.LA(1); if(!(((((_la - 30)) & ~0x1F) === 0 && ((1 << (_la - 30)) & 8191) !== 0))) { this._errHandler.recoverInline(this); @@ -1128,11 +1151,11 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 228; + this.state = 232; this.match(LatexParser.L_PAREN); - this.state = 229; + this.state = 233; this.expr(0); - this.state = 230; + this.state = 234; this.match(LatexParser.R_PAREN); } } @@ -1157,29 +1180,29 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 239; + this.state = 243; this._errHandler.sync(this); switch (this._input.LA(1)) { case 13: { - this.state = 232; + this.state = 236; this.match(LatexParser.CMD_INT); } break; case 14: { { - this.state = 233; + this.state = 237; this.match(LatexParser.CMD_INT_UNDERSCORE); - this.state = 234; + this.state = 238; this.match(LatexParser.L_BRACE); - this.state = 235; + this.state = 239; this.match(LatexParser.R_BRACE); - this.state = 236; + this.state = 240; this.match(LatexParser.CARET); - this.state = 237; + this.state = 241; this.match(LatexParser.L_BRACE); - this.state = 238; + this.state = 242; this.match(LatexParser.R_BRACE); } } @@ -1187,41 +1210,41 @@ export default class LatexParser extends Parser { default: throw new NoViableAltException(this); } - this.state = 241; + this.state = 245; this.match(LatexParser.L_PAREN); - this.state = 242; + this.state = 246; this.expr(0); - this.state = 243; + this.state = 247; this.match(LatexParser.R_PAREN); - this.state = 250; + this.state = 254; this._errHandler.sync(this); switch (this._input.LA(1)) { case 17: { - this.state = 244; + this.state = 248; this.match(LatexParser.CMD_MATHRM); - this.state = 245; + this.state = 249; this.match(LatexParser.L_BRACE); - this.state = 246; + this.state = 250; this.id(); - this.state = 247; + this.state = 251; this.match(LatexParser.R_BRACE); } break; case 71: { - this.state = 249; + this.state = 253; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 252; + this.state = 256; this.match(LatexParser.L_PAREN); - this.state = 253; + this.state = 257; this.id(); - this.state = 254; + this.state = 258; this.match(LatexParser.R_PAREN); } } @@ -1247,19 +1270,19 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 262; + this.state = 266; this._errHandler.sync(this); switch (this._input.LA(1)) { case 14: { { - this.state = 256; + this.state = 260; this.match(LatexParser.CMD_INT_UNDERSCORE); - this.state = 257; + this.state = 261; this.match(LatexParser.L_BRACE); - this.state = 258; + this.state = 262; localctx._lower_lim_expr = this.expr(0); - this.state = 259; + this.state = 263; this.match(LatexParser.R_BRACE); } } @@ -1267,7 +1290,7 @@ export default class LatexParser extends Parser { case 15: case 16: { - this.state = 261; + this.state = 265; _la = this._input.LA(1); if(!(_la===15 || _la===16)) { this._errHandler.recoverInline(this); @@ -1281,19 +1304,19 @@ export default class LatexParser extends Parser { default: throw new NoViableAltException(this); } - this.state = 270; + this.state = 274; this._errHandler.sync(this); switch (this._input.LA(1)) { case 54: { { - this.state = 264; + this.state = 268; this.match(LatexParser.CARET); - this.state = 265; + this.state = 269; this.match(LatexParser.L_BRACE); - this.state = 266; + this.state = 270; localctx._upper_lim_expr = this.expr(0); - this.state = 267; + this.state = 271; this.match(LatexParser.R_BRACE); } } @@ -1301,7 +1324,7 @@ export default class LatexParser extends Parser { case 62: case 63: { - this.state = 269; + this.state = 273; _la = this._input.LA(1); if(!(_la===62 || _la===63)) { this._errHandler.recoverInline(this); @@ -1315,41 +1338,41 @@ export default class LatexParser extends Parser { default: throw new NoViableAltException(this); } - this.state = 272; + this.state = 276; this.match(LatexParser.L_PAREN); - this.state = 273; + this.state = 277; localctx._integrand_expr = this.expr(0); - this.state = 274; + this.state = 278; this.match(LatexParser.R_PAREN); - this.state = 281; + this.state = 285; this._errHandler.sync(this); switch (this._input.LA(1)) { case 17: { - this.state = 275; + this.state = 279; this.match(LatexParser.CMD_MATHRM); - this.state = 276; + this.state = 280; this.match(LatexParser.L_BRACE); - this.state = 277; + this.state = 281; this.id(); - this.state = 278; + this.state = 282; this.match(LatexParser.R_BRACE); } break; case 71: { - this.state = 280; + this.state = 284; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 283; + this.state = 287; this.match(LatexParser.L_PAREN); - this.state = 284; + this.state = 288; this.id(); - this.state = 285; + this.state = 289; this.match(LatexParser.R_PAREN); } } @@ -1374,75 +1397,75 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 287; + this.state = 291; this.match(LatexParser.CMD_FRAC); - this.state = 288; + this.state = 292; this.match(LatexParser.L_BRACE); - this.state = 295; + this.state = 299; this._errHandler.sync(this); switch (this._input.LA(1)) { case 17: { - this.state = 289; + this.state = 293; localctx._MATHRM_0 = this.match(LatexParser.CMD_MATHRM); - this.state = 290; + this.state = 294; this.match(LatexParser.L_BRACE); - this.state = 291; + this.state = 295; this.id(); - this.state = 292; + this.state = 296; this.match(LatexParser.R_BRACE); } break; case 71: { - this.state = 294; + this.state = 298; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 297; + this.state = 301; this.match(LatexParser.R_BRACE); - this.state = 298; + this.state = 302; this.match(LatexParser.L_BRACE); - this.state = 305; + this.state = 309; this._errHandler.sync(this); switch (this._input.LA(1)) { case 17: { - this.state = 299; + this.state = 303; localctx._MATHRM_1 = this.match(LatexParser.CMD_MATHRM); - this.state = 300; + this.state = 304; this.match(LatexParser.L_BRACE); - this.state = 301; + this.state = 305; this.id(); - this.state = 302; + this.state = 306; this.match(LatexParser.R_BRACE); } break; case 71: { - this.state = 304; + this.state = 308; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 307; + this.state = 311; this.match(LatexParser.L_PAREN); - this.state = 308; + this.state = 312; this.id(); - this.state = 309; + this.state = 313; this.match(LatexParser.R_PAREN); - this.state = 310; + this.state = 314; this.match(LatexParser.R_BRACE); - this.state = 311; + this.state = 315; this.match(LatexParser.L_PAREN); - this.state = 312; + this.state = 316; this.expr(0); - this.state = 313; + this.state = 317; this.match(LatexParser.R_PAREN); } } @@ -1467,127 +1490,127 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 315; + this.state = 319; this.match(LatexParser.CMD_FRAC); - this.state = 316; + this.state = 320; this.match(LatexParser.L_BRACE); - this.state = 323; + this.state = 327; this._errHandler.sync(this); switch (this._input.LA(1)) { case 17: { - this.state = 317; + this.state = 321; localctx._MATHRM_0 = this.match(LatexParser.CMD_MATHRM); - this.state = 318; + this.state = 322; this.match(LatexParser.L_BRACE); - this.state = 319; + this.state = 323; this.id(); - this.state = 320; + this.state = 324; this.match(LatexParser.R_BRACE); } break; case 71: { - this.state = 322; + this.state = 326; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 331; + this.state = 335; this._errHandler.sync(this); switch (this._input.LA(1)) { case 54: { { - this.state = 325; + this.state = 329; this.match(LatexParser.CARET); - this.state = 326; + this.state = 330; this.match(LatexParser.L_BRACE); - this.state = 327; + this.state = 331; this.number_(); - this.state = 328; + this.state = 332; this.match(LatexParser.R_BRACE); } } break; case 62: { - this.state = 330; + this.state = 334; localctx._single_char_exp1 = this.match(LatexParser.CARET_SINGLE_CHAR_NUMBER); } break; default: throw new NoViableAltException(this); } - this.state = 333; + this.state = 337; this.match(LatexParser.R_BRACE); - this.state = 334; + this.state = 338; this.match(LatexParser.L_BRACE); - this.state = 341; + this.state = 345; this._errHandler.sync(this); switch (this._input.LA(1)) { case 17: { - this.state = 335; + this.state = 339; localctx._MATHRM_1 = this.match(LatexParser.CMD_MATHRM); - this.state = 336; + this.state = 340; this.match(LatexParser.L_BRACE); - this.state = 337; + this.state = 341; this.id(); - this.state = 338; + this.state = 342; this.match(LatexParser.R_BRACE); } break; case 71: { - this.state = 340; + this.state = 344; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 343; + this.state = 347; this.match(LatexParser.L_PAREN); - this.state = 344; + this.state = 348; this.id(); - this.state = 345; + this.state = 349; this.match(LatexParser.R_PAREN); - this.state = 352; + this.state = 356; this._errHandler.sync(this); switch (this._input.LA(1)) { case 54: { { - this.state = 346; + this.state = 350; this.match(LatexParser.CARET); - this.state = 347; + this.state = 351; this.match(LatexParser.L_BRACE); - this.state = 348; + this.state = 352; this.number_(); - this.state = 349; + this.state = 353; this.match(LatexParser.R_BRACE); } } break; case 62: { - this.state = 351; + this.state = 355; localctx._single_char_exp2 = this.match(LatexParser.CARET_SINGLE_CHAR_NUMBER); } break; default: throw new NoViableAltException(this); } - this.state = 354; + this.state = 358; this.match(LatexParser.R_BRACE); - this.state = 355; + this.state = 359; this.match(LatexParser.L_PAREN); - this.state = 356; + this.state = 360; this.expr(0); - this.state = 357; + this.state = 361; this.match(LatexParser.R_PAREN); } } @@ -1611,18 +1634,18 @@ export default class LatexParser extends Parser { this.enterRule(localctx, 38, LatexParser.RULE_argument); let _la: number; try { - this.state = 369; + this.state = 373; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 28, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 29, this._ctx) ) { case 1: this.enterOuterAlt(localctx, 1); { { - this.state = 359; + this.state = 363; this.id(); - this.state = 360; + this.state = 364; this.match(LatexParser.EQ); - this.state = 361; + this.state = 365; this.expr(0); } } @@ -1631,9 +1654,9 @@ export default class LatexParser extends Parser { this.enterOuterAlt(localctx, 2); { { - this.state = 363; + this.state = 367; this.expr(0); - this.state = 364; + this.state = 368; localctx._lower = this._input.LT(1); _la = this._input.LA(1); if(!(_la===56 || _la===58)) { @@ -1643,9 +1666,9 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 365; + this.state = 369; this.id(); - this.state = 366; + this.state = 370; localctx._upper = this._input.LT(1); _la = this._input.LA(1); if(!(_la===56 || _la===58)) { @@ -1655,7 +1678,7 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 367; + this.state = 371; this.expr(0); } } @@ -1681,20 +1704,20 @@ export default class LatexParser extends Parser { let localctx: ConditionContext = new ConditionContext(this, this._ctx, this.state); this.enterRule(localctx, 40, LatexParser.RULE_condition); try { - this.state = 373; + this.state = 377; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 29, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 30, this._ctx) ) { case 1: this.enterOuterAlt(localctx, 1); { - this.state = 371; + this.state = 375; this.condition_single(); } break; case 2: this.enterOuterAlt(localctx, 2); { - this.state = 372; + this.state = 376; this.condition_chain(); } break; @@ -1722,21 +1745,21 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 375; + this.state = 379; this.id(); - this.state = 378; + this.state = 382; this._errHandler.sync(this); _la = this._input.LA(1); do { { { - this.state = 376; + this.state = 380; this.match(LatexParser.COMMA); - this.state = 377; + this.state = 381; this.id(); } } - this.state = 380; + this.state = 384; this._errHandler.sync(this); _la = this._input.LA(1); } while (_la===60); @@ -1764,9 +1787,9 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 382; + this.state = 386; this.id(); - this.state = 383; + this.state = 387; _la = this._input.LA(1); if(!(_la===24 || _la===25)) { this._errHandler.recoverInline(this); @@ -1775,18 +1798,18 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 386; + this.state = 390; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 31, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 32, this._ctx) ) { case 1: { - this.state = 384; + this.state = 388; this.number_(); } break; case 2: { - this.state = 385; + this.state = 389; this.number_with_units(); } break; @@ -1815,21 +1838,21 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 388; + this.state = 392; this.guess(); - this.state = 391; + this.state = 395; this._errHandler.sync(this); _la = this._input.LA(1); do { { { - this.state = 389; + this.state = 393; this.match(LatexParser.COMMA); - this.state = 390; + this.state = 394; this.guess(); } } - this.state = 393; + this.state = 397; this._errHandler.sync(this); _la = this._input.LA(1); } while (_la===60); @@ -1857,9 +1880,9 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 395; + this.state = 399; this.expr(0); - this.state = 396; + this.state = 400; localctx._operator = this._input.LT(1); _la = this._input.LA(1); if(!(((((_la - 56)) & ~0x1F) === 0 && ((1 << (_la - 56)) & 15) !== 0))) { @@ -1869,7 +1892,7 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 397; + this.state = 401; this.expr(0); } } @@ -1895,9 +1918,9 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 399; + this.state = 403; this.expr(0); - this.state = 400; + this.state = 404; localctx._lower = this._input.LT(1); _la = this._input.LA(1); if(!(((((_la - 56)) & ~0x1F) === 0 && ((1 << (_la - 56)) & 15) !== 0))) { @@ -1907,9 +1930,9 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 401; + this.state = 405; this.expr(0); - this.state = 402; + this.state = 406; localctx._upper = this._input.LT(1); _la = this._input.LA(1); if(!(((((_la - 56)) & ~0x1F) === 0 && ((1 << (_la - 56)) & 15) !== 0))) { @@ -1919,7 +1942,7 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 403; + this.state = 407; this.expr(0); } } @@ -1945,21 +1968,21 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 405; + this.state = 409; this.expr(0); - this.state = 410; + this.state = 414; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===67) { { { - this.state = 406; + this.state = 410; this.match(LatexParser.AMPERSAND); - this.state = 407; + this.state = 411; this.expr(0); } } - this.state = 412; + this.state = 416; this._errHandler.sync(this); _la = this._input.LA(1); } @@ -1987,42 +2010,42 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 413; + this.state = 417; this.id(); - this.state = 414; + this.state = 418; this.match(LatexParser.L_PAREN); { - this.state = 415; + this.state = 419; this.argument(); - this.state = 420; + this.state = 424; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===60) { { { - this.state = 416; + this.state = 420; this.match(LatexParser.COMMA); - this.state = 417; + this.state = 421; this.argument(); } } - this.state = 422; + this.state = 426; this._errHandler.sync(this); _la = this._input.LA(1); } } - this.state = 423; + this.state = 427; this.match(LatexParser.R_PAREN); - this.state = 428; + this.state = 432; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 35, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 36, this._ctx) ) { case 1: { - this.state = 424; + this.state = 428; localctx._points_id_0 = this.match(LatexParser.ID); - this.state = 425; + this.state = 429; localctx._num_points = this.number_(); - this.state = 426; + this.state = 430; localctx._points_id_1 = this.match(LatexParser.ID); } break; @@ -2051,53 +2074,53 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 436; + this.state = 440; this._errHandler.sync(this); switch (this._input.LA(1)) { case 17: { - this.state = 430; + this.state = 434; this.match(LatexParser.CMD_MATHRM); - this.state = 431; + this.state = 435; this.match(LatexParser.L_BRACE); - this.state = 432; + this.state = 436; this.id(); - this.state = 433; + this.state = 437; this.match(LatexParser.R_BRACE); } break; case 71: { - this.state = 435; + this.state = 439; this.id(); } break; default: throw new NoViableAltException(this); } - this.state = 438; + this.state = 442; this.match(LatexParser.L_PAREN); { - this.state = 439; + this.state = 443; this.expr(0); - this.state = 444; + this.state = 448; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===60) { { { - this.state = 440; + this.state = 444; this.match(LatexParser.COMMA); - this.state = 441; + this.state = 445; this.expr(0); } } - this.state = 446; + this.state = 450; this._errHandler.sync(this); _la = this._input.LA(1); } } - this.state = 447; + this.state = 451; this.match(LatexParser.R_PAREN); } } @@ -2135,18 +2158,18 @@ export default class LatexParser extends Parser { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 578; + this.state = 582; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 45, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 46, this._ctx) ) { case 1: { localctx = new ExponentContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 450; + this.state = 454; this.id(); - this.state = 451; + this.state = 455; this.match(LatexParser.CARET_SINGLE_CHAR_ID_UNDERSCORE_SUBSCRIPT); } break; @@ -2155,9 +2178,9 @@ export default class LatexParser extends Parser { localctx = new ExponentContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 453; + this.state = 457; this.id(); - this.state = 454; + this.state = 458; _la = this._input.LA(1); if(!(_la===62 || _la===63)) { this._errHandler.recoverInline(this); @@ -2166,7 +2189,7 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 455; + this.state = 459; this.match(LatexParser.UNDERSCORE_SUBSCRIPT); } break; @@ -2175,17 +2198,17 @@ export default class LatexParser extends Parser { localctx = new ExponentContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 457; + this.state = 461; this.id(); - this.state = 458; + this.state = 462; this.match(LatexParser.CARET); - this.state = 459; + this.state = 463; this.match(LatexParser.L_BRACE); - this.state = 460; + this.state = 464; this.expr(0); - this.state = 461; + this.state = 465; this.match(LatexParser.R_BRACE); - this.state = 462; + this.state = 466; this.match(LatexParser.UNDERSCORE_SUBSCRIPT); } break; @@ -2194,7 +2217,7 @@ export default class LatexParser extends Parser { localctx = new SingleIntSqrtContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 464; + this.state = 468; this.match(LatexParser.CMD_SQRT_INT); } break; @@ -2203,13 +2226,13 @@ export default class LatexParser extends Parser { localctx = new SqrtContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 465; + this.state = 469; this.match(LatexParser.CMD_SQRT); - this.state = 466; + this.state = 470; this.match(LatexParser.L_BRACE); - this.state = 467; + this.state = 471; this.expr(0); - this.state = 468; + this.state = 472; this.match(LatexParser.R_BRACE); } break; @@ -2218,27 +2241,27 @@ export default class LatexParser extends Parser { localctx = new MatrixContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 470; + this.state = 474; this.match(LatexParser.BEGIN_MATRIX); - this.state = 471; + this.state = 475; this.matrix_row(); - this.state = 476; + this.state = 480; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===68) { { { - this.state = 472; + this.state = 476; this.match(LatexParser.DOUBLE_BACKSLASH); - this.state = 473; + this.state = 477; this.matrix_row(); } } - this.state = 478; + this.state = 482; this._errHandler.sync(this); _la = this._input.LA(1); } - this.state = 479; + this.state = 483; this.match(LatexParser.END_MATRIX); } break; @@ -2247,7 +2270,7 @@ export default class LatexParser extends Parser { localctx = new TrigFunctionContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 481; + this.state = 485; this.trig_function(); } break; @@ -2256,7 +2279,7 @@ export default class LatexParser extends Parser { localctx = new IndefiniteIntegralContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 482; + this.state = 486; this.indefinite_integral_cmd(); } break; @@ -2265,7 +2288,7 @@ export default class LatexParser extends Parser { localctx = new IntegralContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 483; + this.state = 487; this.integral_cmd(); } break; @@ -2274,7 +2297,7 @@ export default class LatexParser extends Parser { localctx = new DerivativeContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 484; + this.state = 488; this.derivative_cmd(); } break; @@ -2283,7 +2306,7 @@ export default class LatexParser extends Parser { localctx = new NDerivativeContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 485; + this.state = 489; this.n_derivative_cmd(); } break; @@ -2292,23 +2315,23 @@ export default class LatexParser extends Parser { localctx = new LnContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 487; + this.state = 491; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===28) { { - this.state = 486; + this.state = 490; this.match(LatexParser.BACKSLASH); } } - this.state = 489; + this.state = 493; this.match(LatexParser.CMD_LN); - this.state = 490; + this.state = 494; this.match(LatexParser.L_PAREN); - this.state = 491; + this.state = 495; this.expr(0); - this.state = 492; + this.state = 496; this.match(LatexParser.R_PAREN); } break; @@ -2317,23 +2340,23 @@ export default class LatexParser extends Parser { localctx = new LogContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 495; + this.state = 499; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===28) { { - this.state = 494; + this.state = 498; this.match(LatexParser.BACKSLASH); } } - this.state = 497; + this.state = 501; this.match(LatexParser.CMD_LOG); - this.state = 498; + this.state = 502; this.match(LatexParser.L_PAREN); - this.state = 499; + this.state = 503; this.expr(0); - this.state = 500; + this.state = 504; this.match(LatexParser.R_PAREN); } break; @@ -2342,19 +2365,19 @@ export default class LatexParser extends Parser { localctx = new BaseLogContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 502; + this.state = 506; this.match(LatexParser.CMD_SLASH_LOG_UNDERSCORE); - this.state = 503; + this.state = 507; this.match(LatexParser.L_BRACE); - this.state = 504; + this.state = 508; this.expr(0); - this.state = 505; + this.state = 509; this.match(LatexParser.R_BRACE); - this.state = 506; + this.state = 510; this.match(LatexParser.L_PAREN); - this.state = 507; + this.state = 511; this.expr(0); - this.state = 508; + this.state = 512; this.match(LatexParser.R_PAREN); } break; @@ -2363,7 +2386,7 @@ export default class LatexParser extends Parser { localctx = new BaseLogSingleCharContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 510; + this.state = 514; _la = this._input.LA(1); if(!(_la===46 || _la===47)) { this._errHandler.recoverInline(this); @@ -2372,11 +2395,11 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 511; + this.state = 515; this.match(LatexParser.L_PAREN); - this.state = 512; + this.state = 516; this.expr(0); - this.state = 513; + this.state = 517; this.match(LatexParser.R_PAREN); } break; @@ -2385,11 +2408,11 @@ export default class LatexParser extends Parser { localctx = new NormContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 515; + this.state = 519; this.match(LatexParser.DOUBLE_VBAR); - this.state = 516; + this.state = 520; this.expr(0); - this.state = 517; + this.state = 521; this.match(LatexParser.DOUBLE_VBAR); } break; @@ -2398,11 +2421,11 @@ export default class LatexParser extends Parser { localctx = new AbsContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 519; + this.state = 523; this.match(LatexParser.VBAR); - this.state = 520; + this.state = 524; this.expr(0); - this.state = 521; + this.state = 525; this.match(LatexParser.VBAR); } break; @@ -2411,7 +2434,7 @@ export default class LatexParser extends Parser { localctx = new NumberWithUnitsExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 523; + this.state = 527; this.number_with_units(); } break; @@ -2420,7 +2443,7 @@ export default class LatexParser extends Parser { localctx = new NumberExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 524; + this.state = 528; this.number_(); } break; @@ -2429,9 +2452,9 @@ export default class LatexParser extends Parser { localctx = new UnaryMinusContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 525; + this.state = 529; this.match(LatexParser.SUB); - this.state = 526; + this.state = 530; this.expr(30); } break; @@ -2440,19 +2463,19 @@ export default class LatexParser extends Parser { localctx = new DivideContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 527; + this.state = 531; this.match(LatexParser.CMD_FRAC); - this.state = 528; + this.state = 532; this.match(LatexParser.L_BRACE); - this.state = 529; + this.state = 533; this.expr(0); - this.state = 530; + this.state = 534; this.match(LatexParser.R_BRACE); - this.state = 531; + this.state = 535; this.match(LatexParser.L_BRACE); - this.state = 532; + this.state = 536; this.expr(0); - this.state = 533; + this.state = 537; this.match(LatexParser.R_BRACE); } break; @@ -2461,7 +2484,7 @@ export default class LatexParser extends Parser { localctx = new DivideIntsContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 535; + this.state = 539; this.match(LatexParser.CMD_FRAC_INTS); } break; @@ -2470,7 +2493,7 @@ export default class LatexParser extends Parser { localctx = new VariableContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 536; + this.state = 540; this.id(); } break; @@ -2479,7 +2502,7 @@ export default class LatexParser extends Parser { localctx = new UserFunctionContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 537; + this.state = 541; this.user_function(); } break; @@ -2488,7 +2511,7 @@ export default class LatexParser extends Parser { localctx = new BuiltinFunctionContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 538; + this.state = 542; this.builtin_function(); } break; @@ -2497,7 +2520,7 @@ export default class LatexParser extends Parser { localctx = new PiExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 539; + this.state = 543; this.match(LatexParser.PI); } break; @@ -2506,11 +2529,11 @@ export default class LatexParser extends Parser { localctx = new SubExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 540; + this.state = 544; this.match(LatexParser.L_PAREN); - this.state = 541; + this.state = 545; this.expr(0); - this.state = 542; + this.state = 546; this.match(LatexParser.R_PAREN); } break; @@ -2519,9 +2542,9 @@ export default class LatexParser extends Parser { localctx = new MissingMultiplicationContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 544; + this.state = 548; this.number_(); - this.state = 545; + this.state = 549; this.expr(12); } break; @@ -2530,9 +2553,9 @@ export default class LatexParser extends Parser { localctx = new MissingMultiplicationContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 547; + this.state = 551; this.number_with_units(); - this.state = 548; + this.state = 552; this.expr(11); } break; @@ -2541,9 +2564,9 @@ export default class LatexParser extends Parser { localctx = new MissingMultiplicationContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 550; + this.state = 554; this.match(LatexParser.PI); - this.state = 551; + this.state = 555; this.expr(10); } break; @@ -2552,16 +2575,16 @@ export default class LatexParser extends Parser { localctx = new EmptyPlaceholderContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 552; + this.state = 556; this.match(LatexParser.CMD_PLACEHOLDER); - this.state = 555; + this.state = 559; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 41, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 42, this._ctx) ) { case 1: { - this.state = 553; + this.state = 557; this.match(LatexParser.L_BRACE); - this.state = 554; + this.state = 558; this.match(LatexParser.R_BRACE); } break; @@ -2573,41 +2596,41 @@ export default class LatexParser extends Parser { localctx = new RemoveOperatorFontContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 562; + this.state = 566; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 42, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 43, this._ctx) ) { case 1: { - this.state = 557; + this.state = 561; this.match(LatexParser.CMD_MATHRM); - this.state = 558; + this.state = 562; this.match(LatexParser.L_BRACE); - this.state = 559; + this.state = 563; this.expr(0); - this.state = 560; + this.state = 564; this.match(LatexParser.R_BRACE); } break; } - this.state = 567; + this.state = 571; this._errHandler.sync(this); switch (this._input.LA(1)) { case 61: { - this.state = 564; + this.state = 568; this.match(LatexParser.DECIMAL_POINT); } break; case 53: case 64: { - this.state = 565; + this.state = 569; this.number_(); } break; case 55: { - this.state = 566; + this.state = 570; this.match(LatexParser.EQ); } break; @@ -2616,32 +2639,32 @@ export default class LatexParser extends Parser { default: break; } - this.state = 569; + this.state = 573; this.match(LatexParser.CMD_MATHRM); - this.state = 570; + this.state = 574; this.match(LatexParser.L_BRACE); - this.state = 571; + this.state = 575; this.expr(0); - this.state = 572; - this.match(LatexParser.R_BRACE); this.state = 576; + this.match(LatexParser.R_BRACE); + this.state = 580; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 44, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 45, this._ctx) ) { case 1: { - this.state = 573; + this.state = 577; this.match(LatexParser.DECIMAL_POINT); } break; case 2: { - this.state = 574; + this.state = 578; this.number_(); } break; case 3: { - this.state = 575; + this.state = 579; this.match(LatexParser.EQ); } break; @@ -2650,9 +2673,9 @@ export default class LatexParser extends Parser { break; } this._ctx.stop = this._input.LT(-1); - this.state = 644; + this.state = 648; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 47, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 48, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { if (this._parseListeners != null) { @@ -2660,20 +2683,20 @@ export default class LatexParser extends Parser { } _prevctx = localctx; { - this.state = 642; + this.state = 646; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 46, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 47, this._ctx) ) { case 1: { localctx = new MatrixMultiplyContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 580; + this.state = 584; if (!(this.precpred(this._ctx, 29))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 29)"); } - this.state = 581; + this.state = 585; this.match(LatexParser.CMD_TIMES); - this.state = 582; + this.state = 586; this.expr(30); } break; @@ -2681,13 +2704,13 @@ export default class LatexParser extends Parser { { localctx = new MultiplyContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 583; + this.state = 587; if (!(this.precpred(this._ctx, 28))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 28)"); } - this.state = 584; + this.state = 588; this.match(LatexParser.CMD_CDOT); - this.state = 585; + this.state = 589; this.expr(29); } break; @@ -2695,13 +2718,13 @@ export default class LatexParser extends Parser { { localctx = new SubtractContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 586; + this.state = 590; if (!(this.precpred(this._ctx, 25))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 25)"); } - this.state = 587; + this.state = 591; this.match(LatexParser.SUB); - this.state = 588; + this.state = 592; this.expr(26); } break; @@ -2709,13 +2732,13 @@ export default class LatexParser extends Parser { { localctx = new AddContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 589; + this.state = 593; if (!(this.precpred(this._ctx, 24))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 24)"); } - this.state = 590; + this.state = 594; this.match(LatexParser.ADD); - this.state = 591; + this.state = 595; this.expr(25); } break; @@ -2723,11 +2746,11 @@ export default class LatexParser extends Parser { { localctx = new ExponentContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 592; + this.state = 596; if (!(this.precpred(this._ctx, 51))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 51)"); } - this.state = 593; + this.state = 597; _la = this._input.LA(1); if(!(_la===62 || _la===63)) { this._errHandler.recoverInline(this); @@ -2742,17 +2765,17 @@ export default class LatexParser extends Parser { { localctx = new ExponentContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 594; + this.state = 598; if (!(this.precpred(this._ctx, 50))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 50)"); } - this.state = 595; + this.state = 599; this.match(LatexParser.CARET); - this.state = 596; + this.state = 600; this.match(LatexParser.L_BRACE); - this.state = 597; + this.state = 601; this.expr(0); - this.state = 598; + this.state = 602; this.match(LatexParser.R_BRACE); } break; @@ -2760,21 +2783,21 @@ export default class LatexParser extends Parser { { localctx = new IndexContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 600; + this.state = 604; if (!(this.precpred(this._ctx, 49))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 49)"); } - this.state = 601; + this.state = 605; this.match(LatexParser.UNDERSCORE); - this.state = 602; + this.state = 606; this.match(LatexParser.L_BRACE); - this.state = 603; + this.state = 607; this.expr(0); - this.state = 604; + this.state = 608; this.match(LatexParser.COMMA); - this.state = 605; + this.state = 609; this.expr(0); - this.state = 606; + this.state = 610; this.match(LatexParser.R_BRACE); } break; @@ -2782,11 +2805,11 @@ export default class LatexParser extends Parser { { localctx = new TransposeContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 608; + this.state = 612; if (!(this.precpred(this._ctx, 48))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 48)"); } - this.state = 609; + this.state = 613; this.match(LatexParser.TRANSPOSE); } break; @@ -2794,11 +2817,11 @@ export default class LatexParser extends Parser { { localctx = new FactorialContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 610; + this.state = 614; if (!(this.precpred(this._ctx, 47))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 47)"); } - this.state = 611; + this.state = 615; this.match(LatexParser.EXCLAMATION); } break; @@ -2806,15 +2829,15 @@ export default class LatexParser extends Parser { { localctx = new EmptySubscriptContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 612; + this.state = 616; if (!(this.precpred(this._ctx, 18))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 18)"); } - this.state = 613; + this.state = 617; this.match(LatexParser.UNDERSCORE); - this.state = 614; + this.state = 618; this.match(LatexParser.L_BRACE); - this.state = 615; + this.state = 619; this.match(LatexParser.R_BRACE); } break; @@ -2822,15 +2845,15 @@ export default class LatexParser extends Parser { { localctx = new EmptySuperscriptContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 616; + this.state = 620; if (!(this.precpred(this._ctx, 17))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 17)"); } - this.state = 617; + this.state = 621; this.match(LatexParser.CARET); - this.state = 618; + this.state = 622; this.match(LatexParser.L_BRACE); - this.state = 619; + this.state = 623; this.match(LatexParser.R_BRACE); } break; @@ -2838,11 +2861,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 620; + this.state = 624; if (!(this.precpred(this._ctx, 16))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 16)"); } - this.state = 621; + this.state = 625; this.id(); } break; @@ -2850,11 +2873,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 622; + this.state = 626; if (!(this.precpred(this._ctx, 15))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 15)"); } - this.state = 623; + this.state = 627; this.number_(); } break; @@ -2862,11 +2885,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 624; + this.state = 628; if (!(this.precpred(this._ctx, 14))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 14)"); } - this.state = 625; + this.state = 629; this.number_with_units(); } break; @@ -2874,11 +2897,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 626; + this.state = 630; if (!(this.precpred(this._ctx, 13))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 13)"); } - this.state = 627; + this.state = 631; this.match(LatexParser.PI); } break; @@ -2886,11 +2909,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 628; + this.state = 632; if (!(this.precpred(this._ctx, 9))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 9)"); } - this.state = 629; + this.state = 633; this.user_function(); } break; @@ -2898,11 +2921,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 630; + this.state = 634; if (!(this.precpred(this._ctx, 8))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 8)"); } - this.state = 631; + this.state = 635; this.builtin_function(); } break; @@ -2910,11 +2933,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 632; + this.state = 636; if (!(this.precpred(this._ctx, 7))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 7)"); } - this.state = 633; + this.state = 637; this.trig_function(); } break; @@ -2922,11 +2945,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 634; + this.state = 638; if (!(this.precpred(this._ctx, 6))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 6)"); } - this.state = 635; + this.state = 639; this.indefinite_integral_cmd(); } break; @@ -2934,11 +2957,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 636; + this.state = 640; if (!(this.precpred(this._ctx, 5))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); } - this.state = 637; + this.state = 641; this.integral_cmd(); } break; @@ -2946,11 +2969,11 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 638; + this.state = 642; if (!(this.precpred(this._ctx, 4))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 4)"); } - this.state = 639; + this.state = 643; this.derivative_cmd(); } break; @@ -2958,20 +2981,20 @@ export default class LatexParser extends Parser { { localctx = new MissingMultiplicationContext(this, new ExprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_expr); - this.state = 640; + this.state = 644; if (!(this.precpred(this._ctx, 3))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); } - this.state = 641; + this.state = 645; this.n_derivative_cmd(); } break; } } } - this.state = 646; + this.state = 650; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 47, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 48, this._ctx); } } } @@ -2997,7 +3020,7 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 647; + this.state = 651; _la = this._input.LA(1); if(!(_la===1 || _la===2)) { this._errHandler.recoverInline(this); @@ -3006,9 +3029,9 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 648; + this.state = 652; this.u_expr(0); - this.state = 649; + this.state = 653; _la = this._input.LA(1); if(!(_la===77 || _la===78)) { this._errHandler.recoverInline(this); @@ -3041,7 +3064,7 @@ export default class LatexParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 651; + this.state = 655; _la = this._input.LA(1); if(!(_la===1 || _la===2)) { this._errHandler.recoverInline(this); @@ -3050,7 +3073,7 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 652; + this.state = 656; localctx._numRows = this._input.LT(1); _la = this._input.LA(1); if(!(_la===91 || _la===92)) { @@ -3060,7 +3083,7 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 653; + this.state = 657; _la = this._input.LA(1); if(!(_la===82 || _la===84)) { this._errHandler.recoverInline(this); @@ -3069,7 +3092,7 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 654; + this.state = 658; localctx._numColumns = this._input.LT(1); _la = this._input.LA(1); if(!(_la===91 || _la===92)) { @@ -3079,7 +3102,7 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 655; + this.state = 659; _la = this._input.LA(1); if(!(_la===77 || _la===78)) { this._errHandler.recoverInline(this); @@ -3110,17 +3133,17 @@ export default class LatexParser extends Parser { this.enterRule(localctx, 64, LatexParser.RULE_u_fraction); let _la: number; try { - this.state = 665; + this.state = 669; this._errHandler.sync(this); switch (this._input.LA(1)) { case 79: this.enterOuterAlt(localctx, 1); { - this.state = 657; + this.state = 661; this.match(LatexParser.U_CMD_FRAC); - this.state = 658; + this.state = 662; this.match(LatexParser.U_L_BRACE); - this.state = 659; + this.state = 663; _la = this._input.LA(1); if(!(_la===91 || _la===92)) { this._errHandler.recoverInline(this); @@ -3129,20 +3152,20 @@ export default class LatexParser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 660; + this.state = 664; this.match(LatexParser.U_R_BRACE); - this.state = 661; + this.state = 665; this.match(LatexParser.U_L_BRACE); - this.state = 662; + this.state = 666; this.match(LatexParser.U_NUMBER); - this.state = 663; + this.state = 667; this.match(LatexParser.U_R_BRACE); } break; case 80: this.enterOuterAlt(localctx, 2); { - this.state = 664; + this.state = 668; this.match(LatexParser.U_CMD_FRAC_INTS); } break; @@ -3183,7 +3206,7 @@ export default class LatexParser extends Parser { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 689; + this.state = 693; this._errHandler.sync(this); switch (this._input.LA(1)) { case 83: @@ -3192,13 +3215,13 @@ export default class LatexParser extends Parser { this._ctx = localctx; _prevctx = localctx; - this.state = 668; + this.state = 672; this.match(LatexParser.U_CMD_SQRT); - this.state = 669; + this.state = 673; this.match(LatexParser.U_L_BRACE); - this.state = 670; + this.state = 674; this.expr(0); - this.state = 671; + this.state = 675; this.match(LatexParser.U_R_BRACE); } break; @@ -3207,11 +3230,11 @@ export default class LatexParser extends Parser { localctx = new UnitDivideContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 673; + this.state = 677; this.match(LatexParser.U_CMD_FRAC); - this.state = 674; + this.state = 678; this.match(LatexParser.U_L_BRACE); - this.state = 677; + this.state = 681; this._errHandler.sync(this); switch (this._input.LA(1)) { case 79: @@ -3219,26 +3242,26 @@ export default class LatexParser extends Parser { case 86: case 87: { - this.state = 675; + this.state = 679; this.u_expr(0); } break; case 91: { - this.state = 676; + this.state = 680; this.match(LatexParser.U_ONE); } break; default: throw new NoViableAltException(this); } - this.state = 679; + this.state = 683; this.match(LatexParser.U_R_BRACE); - this.state = 680; + this.state = 684; this.match(LatexParser.U_L_BRACE); - this.state = 681; + this.state = 685; this.u_expr(0); - this.state = 682; + this.state = 686; this.match(LatexParser.U_R_BRACE); } break; @@ -3247,7 +3270,7 @@ export default class LatexParser extends Parser { localctx = new UnitNameContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 684; + this.state = 688; this.match(LatexParser.U_NAME); } break; @@ -3256,11 +3279,11 @@ export default class LatexParser extends Parser { localctx = new UnitSubExprContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 685; + this.state = 689; this.match(LatexParser.U_L_PAREN); - this.state = 686; + this.state = 690; this.u_expr(0); - this.state = 687; + this.state = 691; this.match(LatexParser.U_R_PAREN); } break; @@ -3268,9 +3291,9 @@ export default class LatexParser extends Parser { throw new NoViableAltException(this); } this._ctx.stop = this._input.LT(-1); - this.state = 713; + this.state = 717; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 52, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 53, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { if (this._parseListeners != null) { @@ -3278,20 +3301,20 @@ export default class LatexParser extends Parser { } _prevctx = localctx; { - this.state = 711; + this.state = 715; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 51, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 52, this._ctx) ) { case 1: { localctx = new UnitMultiplyContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 691; + this.state = 695; if (!(this.precpred(this._ctx, 4))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 4)"); } - this.state = 692; + this.state = 696; this.match(LatexParser.U_CMD_CDOT); - this.state = 693; + this.state = 697; this.u_expr(5); } break; @@ -3299,13 +3322,13 @@ export default class LatexParser extends Parser { { localctx = new UnitExponentContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 694; + this.state = 698; if (!(this.precpred(this._ctx, 9))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 9)"); } - this.state = 695; + this.state = 699; this.match(LatexParser.U_CARET); - this.state = 696; + this.state = 700; this.match(LatexParser.U_NUMBER); } break; @@ -3313,17 +3336,17 @@ export default class LatexParser extends Parser { { localctx = new UnitExponentContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 697; + this.state = 701; if (!(this.precpred(this._ctx, 8))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 8)"); } - this.state = 698; + this.state = 702; this.match(LatexParser.U_CARET); - this.state = 699; + this.state = 703; this.match(LatexParser.U_L_BRACE); - this.state = 700; + this.state = 704; this.match(LatexParser.U_NUMBER); - this.state = 701; + this.state = 705; this.match(LatexParser.U_R_BRACE); } break; @@ -3331,13 +3354,13 @@ export default class LatexParser extends Parser { { localctx = new UnitFractionalExponentContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 702; + this.state = 706; if (!(this.precpred(this._ctx, 7))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 7)"); } - this.state = 703; + this.state = 707; this.match(LatexParser.U_CARET); - this.state = 704; + this.state = 708; this.u_fraction(); } break; @@ -3345,26 +3368,26 @@ export default class LatexParser extends Parser { { localctx = new UnitFractionalExponentContext(this, new U_exprContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, LatexParser.RULE_u_expr); - this.state = 705; + this.state = 709; if (!(this.precpred(this._ctx, 6))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 6)"); } - this.state = 706; + this.state = 710; this.match(LatexParser.U_CARET); - this.state = 707; + this.state = 711; this.match(LatexParser.U_L_BRACE); - this.state = 708; + this.state = 712; this.u_fraction(); - this.state = 709; + this.state = 713; this.match(LatexParser.U_R_BRACE); } break; } } } - this.state = 715; + this.state = 719; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 52, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 53, this._ctx); } } } @@ -3457,7 +3480,7 @@ export default class LatexParser extends Parser { return true; } - public static readonly _serializedATN: number[] = [4,1,99,717,2,0,7,0,2, + public static readonly _serializedATN: number[] = [4,1,99,721,2,0,7,0,2, 1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2, 10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17, 7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7, @@ -3468,238 +3491,240 @@ export default class LatexParser extends Parser { 1,1,3,1,116,8,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, 3,2,132,8,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3,2,145,8,2,1,3, 5,3,148,8,3,10,3,12,3,151,9,3,1,3,1,3,5,3,155,8,3,10,3,12,3,158,9,3,4,3, - 160,8,3,11,3,12,3,161,1,4,1,4,1,5,3,5,167,8,5,1,5,1,5,1,6,1,6,1,6,1,7,1, - 7,3,7,176,8,7,1,7,1,7,1,7,1,8,1,8,1,8,4,8,184,8,8,11,8,12,8,185,1,9,1,9, - 1,9,3,9,191,8,9,1,10,1,10,1,10,3,10,196,8,10,1,11,1,11,1,11,1,11,1,12,1, - 12,3,12,204,8,12,1,12,1,12,1,12,1,12,1,12,1,12,5,12,212,8,12,10,12,12,12, - 215,9,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,14,3,14,226,8,14,1,14, - 1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,15,3,15,240,8,15,1, - 15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,3,15,251,8,15,1,15,1,15,1,15, - 1,15,1,16,1,16,1,16,1,16,1,16,1,16,3,16,263,8,16,1,16,1,16,1,16,1,16,1, - 16,1,16,3,16,271,8,16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,3,16, - 282,8,16,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,3, - 17,296,8,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,3,17,306,8,17,1,17, - 1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1, - 18,3,18,324,8,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18,332,8,18,1,18,1,18, - 1,18,1,18,1,18,1,18,1,18,1,18,3,18,342,8,18,1,18,1,18,1,18,1,18,1,18,1, - 18,1,18,1,18,1,18,3,18,353,8,18,1,18,1,18,1,18,1,18,1,18,1,19,1,19,1,19, - 1,19,1,19,1,19,1,19,1,19,1,19,1,19,3,19,370,8,19,1,20,1,20,3,20,374,8,20, - 1,21,1,21,1,21,4,21,379,8,21,11,21,12,21,380,1,22,1,22,1,22,1,22,3,22,387, - 8,22,1,23,1,23,1,23,4,23,392,8,23,11,23,12,23,393,1,24,1,24,1,24,1,24,1, - 25,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,5,26,409,8,26,10,26,12,26,412, - 9,26,1,27,1,27,1,27,1,27,1,27,5,27,419,8,27,10,27,12,27,422,9,27,1,27,1, - 27,1,27,1,27,1,27,3,27,429,8,27,1,28,1,28,1,28,1,28,1,28,1,28,3,28,437, - 8,28,1,28,1,28,1,28,1,28,5,28,443,8,28,10,28,12,28,446,9,28,1,28,1,28,1, - 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29, - 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,5,29,475,8,29,10,29,12, - 29,478,9,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,3,29,488,8,29,1,29, - 1,29,1,29,1,29,1,29,1,29,3,29,496,8,29,1,29,1,29,1,29,1,29,1,29,1,29,1, + 160,8,3,11,3,12,3,161,1,4,1,4,1,5,3,5,167,8,5,1,5,1,5,1,6,1,6,1,6,3,6,174, + 8,6,1,6,1,6,1,7,1,7,3,7,180,8,7,1,7,1,7,1,7,1,8,1,8,1,8,4,8,188,8,8,11, + 8,12,8,189,1,9,1,9,1,9,3,9,195,8,9,1,10,1,10,1,10,3,10,200,8,10,1,11,1, + 11,1,11,1,11,1,12,1,12,3,12,208,8,12,1,12,1,12,1,12,1,12,1,12,1,12,5,12, + 216,8,12,10,12,12,12,219,9,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1, + 14,3,14,230,8,14,1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15, + 1,15,3,15,244,8,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,3,15,255, + 8,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,16,1,16,3,16,267,8,16,1, + 16,1,16,1,16,1,16,1,16,1,16,3,16,275,8,16,1,16,1,16,1,16,1,16,1,16,1,16, + 1,16,1,16,1,16,3,16,286,8,16,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1, + 17,1,17,1,17,1,17,3,17,300,8,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17, + 3,17,310,8,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,1, + 18,1,18,1,18,1,18,1,18,3,18,328,8,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18, + 336,8,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18,346,8,18,1,18,1,18, + 1,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18,357,8,18,1,18,1,18,1,18,1,18,1, + 18,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,3,19,374,8,19,1,20, + 1,20,3,20,378,8,20,1,21,1,21,1,21,4,21,383,8,21,11,21,12,21,384,1,22,1, + 22,1,22,1,22,3,22,391,8,22,1,23,1,23,1,23,4,23,396,8,23,11,23,12,23,397, + 1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,5,26,413, + 8,26,10,26,12,26,416,9,26,1,27,1,27,1,27,1,27,1,27,5,27,423,8,27,10,27, + 12,27,426,9,27,1,27,1,27,1,27,1,27,1,27,3,27,433,8,27,1,28,1,28,1,28,1, + 28,1,28,1,28,3,28,441,8,28,1,28,1,28,1,28,1,28,5,28,447,8,28,10,28,12,28, + 450,9,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29, + 5,29,479,8,29,10,29,12,29,482,9,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, + 29,3,29,492,8,29,1,29,1,29,1,29,1,29,1,29,1,29,3,29,500,8,29,1,29,1,29, 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29, - 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,3,29,556,8,29,1,29,1,29,1,29,1, - 29,1,29,3,29,563,8,29,1,29,1,29,1,29,3,29,568,8,29,1,29,1,29,1,29,1,29, - 1,29,1,29,1,29,3,29,577,8,29,3,29,579,8,29,1,29,1,29,1,29,1,29,1,29,1,29, + 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, + 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,3,29,560, + 8,29,1,29,1,29,1,29,1,29,1,29,3,29,567,8,29,1,29,1,29,1,29,3,29,572,8,29, + 1,29,1,29,1,29,1,29,1,29,1,29,1,29,3,29,581,8,29,3,29,583,8,29,1,29,1,29, 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29, 1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1, - 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,5,29,643, - 8,29,10,29,12,29,646,9,29,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,31,1,31, - 1,31,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,3,32,666,8,32,1,33,1,33,1, - 33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,3,33,678,8,33,1,33,1,33,1,33,1,33, - 1,33,1,33,1,33,1,33,1,33,1,33,3,33,690,8,33,1,33,1,33,1,33,1,33,1,33,1, - 33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33, - 5,33,712,8,33,10,33,12,33,715,9,33,1,33,2,149,156,2,58,66,34,0,2,4,6,8, - 10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56, - 58,60,62,64,66,0,11,1,0,30,42,1,0,15,16,1,0,62,63,2,0,56,56,58,58,1,0,24, - 25,1,0,56,59,1,0,46,47,1,0,1,2,1,0,77,78,1,0,91,92,2,0,82,82,84,84,812, - 0,85,1,0,0,0,2,99,1,0,0,0,4,117,1,0,0,0,6,149,1,0,0,0,8,163,1,0,0,0,10, - 166,1,0,0,0,12,170,1,0,0,0,14,175,1,0,0,0,16,180,1,0,0,0,18,187,1,0,0,0, - 20,192,1,0,0,0,22,197,1,0,0,0,24,203,1,0,0,0,26,218,1,0,0,0,28,225,1,0, - 0,0,30,239,1,0,0,0,32,262,1,0,0,0,34,287,1,0,0,0,36,315,1,0,0,0,38,369, - 1,0,0,0,40,373,1,0,0,0,42,375,1,0,0,0,44,382,1,0,0,0,46,388,1,0,0,0,48, - 395,1,0,0,0,50,399,1,0,0,0,52,405,1,0,0,0,54,413,1,0,0,0,56,436,1,0,0,0, - 58,578,1,0,0,0,60,647,1,0,0,0,62,651,1,0,0,0,64,665,1,0,0,0,66,689,1,0, - 0,0,68,86,3,14,7,0,69,86,3,16,8,0,70,86,3,18,9,0,71,86,3,20,10,0,72,86, - 3,22,11,0,73,86,3,60,30,0,74,86,3,10,5,0,75,86,3,8,4,0,76,86,3,42,21,0, - 77,86,3,44,22,0,78,86,3,46,23,0,79,86,3,58,29,0,80,86,3,40,20,0,81,86,3, - 24,12,0,82,86,3,6,3,0,83,86,3,2,1,0,84,86,3,4,2,0,85,68,1,0,0,0,85,69,1, - 0,0,0,85,70,1,0,0,0,85,71,1,0,0,0,85,72,1,0,0,0,85,73,1,0,0,0,85,74,1,0, - 0,0,85,75,1,0,0,0,85,76,1,0,0,0,85,77,1,0,0,0,85,78,1,0,0,0,85,79,1,0,0, - 0,85,80,1,0,0,0,85,81,1,0,0,0,85,82,1,0,0,0,85,83,1,0,0,0,85,84,1,0,0,0, - 85,86,1,0,0,0,86,87,1,0,0,0,87,88,5,0,0,1,88,1,1,0,0,0,89,90,5,6,0,0,90, - 91,3,58,29,0,91,92,5,60,0,0,92,93,3,58,29,0,93,94,5,7,0,0,94,100,1,0,0, - 0,95,96,3,58,29,0,96,97,5,60,0,0,97,98,3,58,29,0,98,100,1,0,0,0,99,89,1, - 0,0,0,99,95,1,0,0,0,100,102,1,0,0,0,101,103,5,29,0,0,102,101,1,0,0,0,102, - 103,1,0,0,0,103,104,1,0,0,0,104,115,5,55,0,0,105,106,5,6,0,0,106,107,3, - 60,30,0,107,108,5,60,0,0,108,109,3,60,30,0,109,110,5,7,0,0,110,116,1,0, - 0,0,111,112,3,60,30,0,112,113,5,60,0,0,113,114,3,60,30,0,114,116,1,0,0, - 0,115,105,1,0,0,0,115,111,1,0,0,0,115,116,1,0,0,0,116,3,1,0,0,0,117,118, - 5,6,0,0,118,119,3,58,29,0,119,120,5,60,0,0,120,121,3,58,29,0,121,122,5, - 7,0,0,122,123,1,0,0,0,123,124,5,71,0,0,124,125,5,6,0,0,125,126,3,38,19, - 0,126,131,5,7,0,0,127,128,5,71,0,0,128,129,3,10,5,0,129,130,5,71,0,0,130, - 132,1,0,0,0,131,127,1,0,0,0,131,132,1,0,0,0,132,133,1,0,0,0,133,144,5,55, - 0,0,134,135,5,6,0,0,135,136,3,60,30,0,136,137,5,60,0,0,137,138,3,60,30, - 0,138,139,5,7,0,0,139,145,1,0,0,0,140,141,3,60,30,0,141,142,5,60,0,0,142, - 143,3,60,30,0,143,145,1,0,0,0,144,134,1,0,0,0,144,140,1,0,0,0,144,145,1, - 0,0,0,145,5,1,0,0,0,146,148,9,0,0,0,147,146,1,0,0,0,148,151,1,0,0,0,149, - 150,1,0,0,0,149,147,1,0,0,0,150,159,1,0,0,0,151,149,1,0,0,0,152,156,3,62, - 31,0,153,155,9,0,0,0,154,153,1,0,0,0,155,158,1,0,0,0,156,157,1,0,0,0,156, - 154,1,0,0,0,157,160,1,0,0,0,158,156,1,0,0,0,159,152,1,0,0,0,160,161,1,0, - 0,0,161,159,1,0,0,0,161,162,1,0,0,0,162,7,1,0,0,0,163,164,5,71,0,0,164, - 9,1,0,0,0,165,167,5,53,0,0,166,165,1,0,0,0,166,167,1,0,0,0,167,168,1,0, - 0,0,168,169,5,64,0,0,169,11,1,0,0,0,170,171,3,10,5,0,171,172,3,60,30,0, - 172,13,1,0,0,0,173,176,3,8,4,0,174,176,5,12,0,0,175,173,1,0,0,0,175,174, - 1,0,0,0,176,177,1,0,0,0,177,178,5,55,0,0,178,179,3,58,29,0,179,15,1,0,0, - 0,180,183,3,14,7,0,181,182,5,60,0,0,182,184,3,14,7,0,183,181,1,0,0,0,184, - 185,1,0,0,0,185,183,1,0,0,0,185,186,1,0,0,0,186,17,1,0,0,0,187,188,3,14, - 7,0,188,190,5,55,0,0,189,191,3,60,30,0,190,189,1,0,0,0,190,191,1,0,0,0, - 191,19,1,0,0,0,192,193,3,58,29,0,193,195,5,55,0,0,194,196,3,60,30,0,195, - 194,1,0,0,0,195,196,1,0,0,0,196,21,1,0,0,0,197,198,3,58,29,0,198,199,5, - 55,0,0,199,200,3,58,29,0,200,23,1,0,0,0,201,204,3,8,4,0,202,204,5,12,0, - 0,203,201,1,0,0,0,203,202,1,0,0,0,204,205,1,0,0,0,205,206,5,55,0,0,206, - 207,3,8,4,0,207,208,5,6,0,0,208,213,3,26,13,0,209,210,5,60,0,0,210,212, - 3,26,13,0,211,209,1,0,0,0,212,215,1,0,0,0,213,211,1,0,0,0,213,214,1,0,0, - 0,214,216,1,0,0,0,215,213,1,0,0,0,216,217,5,7,0,0,217,25,1,0,0,0,218,219, - 5,6,0,0,219,220,3,58,29,0,220,221,5,60,0,0,221,222,3,40,20,0,222,223,5, - 7,0,0,223,27,1,0,0,0,224,226,5,28,0,0,225,224,1,0,0,0,225,226,1,0,0,0,226, - 227,1,0,0,0,227,228,7,0,0,0,228,229,5,6,0,0,229,230,3,58,29,0,230,231,5, - 7,0,0,231,29,1,0,0,0,232,240,5,13,0,0,233,234,5,14,0,0,234,235,5,4,0,0, - 235,236,5,5,0,0,236,237,5,54,0,0,237,238,5,4,0,0,238,240,5,5,0,0,239,232, - 1,0,0,0,239,233,1,0,0,0,240,241,1,0,0,0,241,242,5,6,0,0,242,243,3,58,29, - 0,243,250,5,7,0,0,244,245,5,17,0,0,245,246,5,4,0,0,246,247,3,8,4,0,247, - 248,5,5,0,0,248,251,1,0,0,0,249,251,3,8,4,0,250,244,1,0,0,0,250,249,1,0, - 0,0,251,252,1,0,0,0,252,253,5,6,0,0,253,254,3,8,4,0,254,255,5,7,0,0,255, - 31,1,0,0,0,256,257,5,14,0,0,257,258,5,4,0,0,258,259,3,58,29,0,259,260,5, - 5,0,0,260,263,1,0,0,0,261,263,7,1,0,0,262,256,1,0,0,0,262,261,1,0,0,0,263, - 270,1,0,0,0,264,265,5,54,0,0,265,266,5,4,0,0,266,267,3,58,29,0,267,268, - 5,5,0,0,268,271,1,0,0,0,269,271,7,2,0,0,270,264,1,0,0,0,270,269,1,0,0,0, - 271,272,1,0,0,0,272,273,5,6,0,0,273,274,3,58,29,0,274,281,5,7,0,0,275,276, - 5,17,0,0,276,277,5,4,0,0,277,278,3,8,4,0,278,279,5,5,0,0,279,282,1,0,0, - 0,280,282,3,8,4,0,281,275,1,0,0,0,281,280,1,0,0,0,282,283,1,0,0,0,283,284, - 5,6,0,0,284,285,3,8,4,0,285,286,5,7,0,0,286,33,1,0,0,0,287,288,5,18,0,0, - 288,295,5,4,0,0,289,290,5,17,0,0,290,291,5,4,0,0,291,292,3,8,4,0,292,293, - 5,5,0,0,293,296,1,0,0,0,294,296,3,8,4,0,295,289,1,0,0,0,295,294,1,0,0,0, - 296,297,1,0,0,0,297,298,5,5,0,0,298,305,5,4,0,0,299,300,5,17,0,0,300,301, - 5,4,0,0,301,302,3,8,4,0,302,303,5,5,0,0,303,306,1,0,0,0,304,306,3,8,4,0, - 305,299,1,0,0,0,305,304,1,0,0,0,306,307,1,0,0,0,307,308,5,6,0,0,308,309, - 3,8,4,0,309,310,5,7,0,0,310,311,5,5,0,0,311,312,5,6,0,0,312,313,3,58,29, - 0,313,314,5,7,0,0,314,35,1,0,0,0,315,316,5,18,0,0,316,323,5,4,0,0,317,318, - 5,17,0,0,318,319,5,4,0,0,319,320,3,8,4,0,320,321,5,5,0,0,321,324,1,0,0, - 0,322,324,3,8,4,0,323,317,1,0,0,0,323,322,1,0,0,0,324,331,1,0,0,0,325,326, - 5,54,0,0,326,327,5,4,0,0,327,328,3,10,5,0,328,329,5,5,0,0,329,332,1,0,0, - 0,330,332,5,62,0,0,331,325,1,0,0,0,331,330,1,0,0,0,332,333,1,0,0,0,333, - 334,5,5,0,0,334,341,5,4,0,0,335,336,5,17,0,0,336,337,5,4,0,0,337,338,3, - 8,4,0,338,339,5,5,0,0,339,342,1,0,0,0,340,342,3,8,4,0,341,335,1,0,0,0,341, - 340,1,0,0,0,342,343,1,0,0,0,343,344,5,6,0,0,344,345,3,8,4,0,345,352,5,7, - 0,0,346,347,5,54,0,0,347,348,5,4,0,0,348,349,3,10,5,0,349,350,5,5,0,0,350, - 353,1,0,0,0,351,353,5,62,0,0,352,346,1,0,0,0,352,351,1,0,0,0,353,354,1, - 0,0,0,354,355,5,5,0,0,355,356,5,6,0,0,356,357,3,58,29,0,357,358,5,7,0,0, - 358,37,1,0,0,0,359,360,3,8,4,0,360,361,5,55,0,0,361,362,3,58,29,0,362,370, - 1,0,0,0,363,364,3,58,29,0,364,365,7,3,0,0,365,366,3,8,4,0,366,367,7,3,0, - 0,367,368,3,58,29,0,368,370,1,0,0,0,369,359,1,0,0,0,369,363,1,0,0,0,370, - 39,1,0,0,0,371,374,3,48,24,0,372,374,3,50,25,0,373,371,1,0,0,0,373,372, - 1,0,0,0,374,41,1,0,0,0,375,378,3,8,4,0,376,377,5,60,0,0,377,379,3,8,4,0, - 378,376,1,0,0,0,379,380,1,0,0,0,380,378,1,0,0,0,380,381,1,0,0,0,381,43, - 1,0,0,0,382,383,3,8,4,0,383,386,7,4,0,0,384,387,3,10,5,0,385,387,3,12,6, - 0,386,384,1,0,0,0,386,385,1,0,0,0,387,45,1,0,0,0,388,391,3,44,22,0,389, - 390,5,60,0,0,390,392,3,44,22,0,391,389,1,0,0,0,392,393,1,0,0,0,393,391, - 1,0,0,0,393,394,1,0,0,0,394,47,1,0,0,0,395,396,3,58,29,0,396,397,7,5,0, - 0,397,398,3,58,29,0,398,49,1,0,0,0,399,400,3,58,29,0,400,401,7,5,0,0,401, - 402,3,58,29,0,402,403,7,5,0,0,403,404,3,58,29,0,404,51,1,0,0,0,405,410, - 3,58,29,0,406,407,5,67,0,0,407,409,3,58,29,0,408,406,1,0,0,0,409,412,1, - 0,0,0,410,408,1,0,0,0,410,411,1,0,0,0,411,53,1,0,0,0,412,410,1,0,0,0,413, - 414,3,8,4,0,414,415,5,6,0,0,415,420,3,38,19,0,416,417,5,60,0,0,417,419, - 3,38,19,0,418,416,1,0,0,0,419,422,1,0,0,0,420,418,1,0,0,0,420,421,1,0,0, - 0,421,423,1,0,0,0,422,420,1,0,0,0,423,428,5,7,0,0,424,425,5,71,0,0,425, - 426,3,10,5,0,426,427,5,71,0,0,427,429,1,0,0,0,428,424,1,0,0,0,428,429,1, - 0,0,0,429,55,1,0,0,0,430,431,5,17,0,0,431,432,5,4,0,0,432,433,3,8,4,0,433, - 434,5,5,0,0,434,437,1,0,0,0,435,437,3,8,4,0,436,430,1,0,0,0,436,435,1,0, - 0,0,437,438,1,0,0,0,438,439,5,6,0,0,439,444,3,58,29,0,440,441,5,60,0,0, - 441,443,3,58,29,0,442,440,1,0,0,0,443,446,1,0,0,0,444,442,1,0,0,0,444,445, - 1,0,0,0,445,447,1,0,0,0,446,444,1,0,0,0,447,448,5,7,0,0,448,57,1,0,0,0, - 449,450,6,29,-1,0,450,451,3,8,4,0,451,452,5,70,0,0,452,579,1,0,0,0,453, - 454,3,8,4,0,454,455,7,2,0,0,455,456,5,69,0,0,456,579,1,0,0,0,457,458,3, - 8,4,0,458,459,5,54,0,0,459,460,5,4,0,0,460,461,3,58,29,0,461,462,5,5,0, - 0,462,463,5,69,0,0,463,579,1,0,0,0,464,579,5,23,0,0,465,466,5,22,0,0,466, - 467,5,4,0,0,467,468,3,58,29,0,468,469,5,5,0,0,469,579,1,0,0,0,470,471,5, - 65,0,0,471,476,3,52,26,0,472,473,5,68,0,0,473,475,3,52,26,0,474,472,1,0, - 0,0,475,478,1,0,0,0,476,474,1,0,0,0,476,477,1,0,0,0,477,479,1,0,0,0,478, - 476,1,0,0,0,479,480,5,66,0,0,480,579,1,0,0,0,481,579,3,28,14,0,482,579, - 3,30,15,0,483,579,3,32,16,0,484,579,3,34,17,0,485,579,3,36,18,0,486,488, - 5,28,0,0,487,486,1,0,0,0,487,488,1,0,0,0,488,489,1,0,0,0,489,490,5,43,0, - 0,490,491,5,6,0,0,491,492,3,58,29,0,492,493,5,7,0,0,493,579,1,0,0,0,494, - 496,5,28,0,0,495,494,1,0,0,0,495,496,1,0,0,0,496,497,1,0,0,0,497,498,5, - 44,0,0,498,499,5,6,0,0,499,500,3,58,29,0,500,501,5,7,0,0,501,579,1,0,0, - 0,502,503,5,45,0,0,503,504,5,4,0,0,504,505,3,58,29,0,505,506,5,5,0,0,506, - 507,5,6,0,0,507,508,3,58,29,0,508,509,5,7,0,0,509,579,1,0,0,0,510,511,7, - 6,0,0,511,512,5,6,0,0,512,513,3,58,29,0,513,514,5,7,0,0,514,579,1,0,0,0, - 515,516,5,9,0,0,516,517,3,58,29,0,517,518,5,9,0,0,518,579,1,0,0,0,519,520, - 5,8,0,0,520,521,3,58,29,0,521,522,5,8,0,0,522,579,1,0,0,0,523,579,3,12, - 6,0,524,579,3,10,5,0,525,526,5,53,0,0,526,579,3,58,29,30,527,528,5,18,0, - 0,528,529,5,4,0,0,529,530,3,58,29,0,530,531,5,5,0,0,531,532,5,4,0,0,532, - 533,3,58,29,0,533,534,5,5,0,0,534,579,1,0,0,0,535,579,5,19,0,0,536,579, - 3,8,4,0,537,579,3,54,27,0,538,579,3,56,28,0,539,579,5,12,0,0,540,541,5, - 6,0,0,541,542,3,58,29,0,542,543,5,7,0,0,543,579,1,0,0,0,544,545,3,10,5, - 0,545,546,3,58,29,12,546,579,1,0,0,0,547,548,3,12,6,0,548,549,3,58,29,11, - 549,579,1,0,0,0,550,551,5,12,0,0,551,579,3,58,29,10,552,555,5,26,0,0,553, - 554,5,4,0,0,554,556,5,5,0,0,555,553,1,0,0,0,555,556,1,0,0,0,556,579,1,0, - 0,0,557,558,5,17,0,0,558,559,5,4,0,0,559,560,3,58,29,0,560,561,5,5,0,0, - 561,563,1,0,0,0,562,557,1,0,0,0,562,563,1,0,0,0,563,567,1,0,0,0,564,568, - 5,61,0,0,565,568,3,10,5,0,566,568,5,55,0,0,567,564,1,0,0,0,567,565,1,0, - 0,0,567,566,1,0,0,0,567,568,1,0,0,0,568,569,1,0,0,0,569,570,5,17,0,0,570, - 571,5,4,0,0,571,572,3,58,29,0,572,576,5,5,0,0,573,577,5,61,0,0,574,577, - 3,10,5,0,575,577,5,55,0,0,576,573,1,0,0,0,576,574,1,0,0,0,576,575,1,0,0, - 0,576,577,1,0,0,0,577,579,1,0,0,0,578,449,1,0,0,0,578,453,1,0,0,0,578,457, - 1,0,0,0,578,464,1,0,0,0,578,465,1,0,0,0,578,470,1,0,0,0,578,481,1,0,0,0, - 578,482,1,0,0,0,578,483,1,0,0,0,578,484,1,0,0,0,578,485,1,0,0,0,578,487, - 1,0,0,0,578,495,1,0,0,0,578,502,1,0,0,0,578,510,1,0,0,0,578,515,1,0,0,0, - 578,519,1,0,0,0,578,523,1,0,0,0,578,524,1,0,0,0,578,525,1,0,0,0,578,527, - 1,0,0,0,578,535,1,0,0,0,578,536,1,0,0,0,578,537,1,0,0,0,578,538,1,0,0,0, - 578,539,1,0,0,0,578,540,1,0,0,0,578,544,1,0,0,0,578,547,1,0,0,0,578,550, - 1,0,0,0,578,552,1,0,0,0,578,562,1,0,0,0,579,644,1,0,0,0,580,581,10,29,0, - 0,581,582,5,21,0,0,582,643,3,58,29,30,583,584,10,28,0,0,584,585,5,20,0, - 0,585,643,3,58,29,29,586,587,10,25,0,0,587,588,5,53,0,0,588,643,3,58,29, - 26,589,590,10,24,0,0,590,591,5,52,0,0,591,643,3,58,29,25,592,593,10,51, - 0,0,593,643,7,2,0,0,594,595,10,50,0,0,595,596,5,54,0,0,596,597,5,4,0,0, - 597,598,3,58,29,0,598,599,5,5,0,0,599,643,1,0,0,0,600,601,10,49,0,0,601, - 602,5,10,0,0,602,603,5,4,0,0,603,604,3,58,29,0,604,605,5,60,0,0,605,606, - 3,58,29,0,606,607,5,5,0,0,607,643,1,0,0,0,608,609,10,48,0,0,609,643,5,27, - 0,0,610,611,10,47,0,0,611,643,5,11,0,0,612,613,10,18,0,0,613,614,5,10,0, - 0,614,615,5,4,0,0,615,643,5,5,0,0,616,617,10,17,0,0,617,618,5,54,0,0,618, - 619,5,4,0,0,619,643,5,5,0,0,620,621,10,16,0,0,621,643,3,8,4,0,622,623,10, - 15,0,0,623,643,3,10,5,0,624,625,10,14,0,0,625,643,3,12,6,0,626,627,10,13, - 0,0,627,643,5,12,0,0,628,629,10,9,0,0,629,643,3,54,27,0,630,631,10,8,0, - 0,631,643,3,56,28,0,632,633,10,7,0,0,633,643,3,28,14,0,634,635,10,6,0,0, - 635,643,3,30,15,0,636,637,10,5,0,0,637,643,3,32,16,0,638,639,10,4,0,0,639, - 643,3,34,17,0,640,641,10,3,0,0,641,643,3,36,18,0,642,580,1,0,0,0,642,583, - 1,0,0,0,642,586,1,0,0,0,642,589,1,0,0,0,642,592,1,0,0,0,642,594,1,0,0,0, - 642,600,1,0,0,0,642,608,1,0,0,0,642,610,1,0,0,0,642,612,1,0,0,0,642,616, - 1,0,0,0,642,620,1,0,0,0,642,622,1,0,0,0,642,624,1,0,0,0,642,626,1,0,0,0, - 642,628,1,0,0,0,642,630,1,0,0,0,642,632,1,0,0,0,642,634,1,0,0,0,642,636, - 1,0,0,0,642,638,1,0,0,0,642,640,1,0,0,0,643,646,1,0,0,0,644,642,1,0,0,0, - 644,645,1,0,0,0,645,59,1,0,0,0,646,644,1,0,0,0,647,648,7,7,0,0,648,649, - 3,66,33,0,649,650,7,8,0,0,650,61,1,0,0,0,651,652,7,7,0,0,652,653,7,9,0, - 0,653,654,7,10,0,0,654,655,7,9,0,0,655,656,7,8,0,0,656,63,1,0,0,0,657,658, - 5,79,0,0,658,659,5,89,0,0,659,660,7,9,0,0,660,661,5,90,0,0,661,662,5,89, - 0,0,662,663,5,92,0,0,663,666,5,90,0,0,664,666,5,80,0,0,665,657,1,0,0,0, - 665,664,1,0,0,0,666,65,1,0,0,0,667,668,6,33,-1,0,668,669,5,83,0,0,669,670, - 5,89,0,0,670,671,3,58,29,0,671,672,5,90,0,0,672,690,1,0,0,0,673,674,5,79, - 0,0,674,677,5,89,0,0,675,678,3,66,33,0,676,678,5,91,0,0,677,675,1,0,0,0, - 677,676,1,0,0,0,678,679,1,0,0,0,679,680,5,90,0,0,680,681,5,89,0,0,681,682, - 3,66,33,0,682,683,5,90,0,0,683,690,1,0,0,0,684,690,5,86,0,0,685,686,5,87, - 0,0,686,687,3,66,33,0,687,688,5,88,0,0,688,690,1,0,0,0,689,667,1,0,0,0, - 689,673,1,0,0,0,689,684,1,0,0,0,689,685,1,0,0,0,690,713,1,0,0,0,691,692, - 10,4,0,0,692,693,5,81,0,0,693,712,3,66,33,5,694,695,10,9,0,0,695,696,5, - 85,0,0,696,712,5,92,0,0,697,698,10,8,0,0,698,699,5,85,0,0,699,700,5,89, - 0,0,700,701,5,92,0,0,701,712,5,90,0,0,702,703,10,7,0,0,703,704,5,85,0,0, - 704,712,3,64,32,0,705,706,10,6,0,0,706,707,5,85,0,0,707,708,5,89,0,0,708, - 709,3,64,32,0,709,710,5,90,0,0,710,712,1,0,0,0,711,691,1,0,0,0,711,694, - 1,0,0,0,711,697,1,0,0,0,711,702,1,0,0,0,711,705,1,0,0,0,712,715,1,0,0,0, - 713,711,1,0,0,0,713,714,1,0,0,0,714,67,1,0,0,0,715,713,1,0,0,0,53,85,99, - 102,115,131,144,149,156,161,166,175,185,190,195,203,213,225,239,250,262, - 270,281,295,305,323,331,341,352,369,373,380,386,393,410,420,428,436,444, - 476,487,495,555,562,567,576,578,642,644,665,677,689,711,713]; + 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29, + 1,29,1,29,5,29,647,8,29,10,29,12,29,650,9,29,1,30,1,30,1,30,1,30,1,31,1, + 31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,3,32,670, + 8,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,3,33,682,8,33,1, + 33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,3,33,694,8,33,1,33,1,33, + 1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1, + 33,1,33,1,33,1,33,5,33,716,8,33,10,33,12,33,719,9,33,1,33,2,149,156,2,58, + 66,34,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46, + 48,50,52,54,56,58,60,62,64,66,0,11,1,0,30,42,1,0,15,16,1,0,62,63,2,0,56, + 56,58,58,1,0,24,25,1,0,56,59,1,0,46,47,1,0,1,2,1,0,77,78,1,0,91,92,2,0, + 82,82,84,84,818,0,85,1,0,0,0,2,99,1,0,0,0,4,117,1,0,0,0,6,149,1,0,0,0,8, + 163,1,0,0,0,10,166,1,0,0,0,12,173,1,0,0,0,14,179,1,0,0,0,16,184,1,0,0,0, + 18,191,1,0,0,0,20,196,1,0,0,0,22,201,1,0,0,0,24,207,1,0,0,0,26,222,1,0, + 0,0,28,229,1,0,0,0,30,243,1,0,0,0,32,266,1,0,0,0,34,291,1,0,0,0,36,319, + 1,0,0,0,38,373,1,0,0,0,40,377,1,0,0,0,42,379,1,0,0,0,44,386,1,0,0,0,46, + 392,1,0,0,0,48,399,1,0,0,0,50,403,1,0,0,0,52,409,1,0,0,0,54,417,1,0,0,0, + 56,440,1,0,0,0,58,582,1,0,0,0,60,651,1,0,0,0,62,655,1,0,0,0,64,669,1,0, + 0,0,66,693,1,0,0,0,68,86,3,14,7,0,69,86,3,16,8,0,70,86,3,18,9,0,71,86,3, + 20,10,0,72,86,3,22,11,0,73,86,3,60,30,0,74,86,3,10,5,0,75,86,3,8,4,0,76, + 86,3,42,21,0,77,86,3,44,22,0,78,86,3,46,23,0,79,86,3,58,29,0,80,86,3,40, + 20,0,81,86,3,24,12,0,82,86,3,6,3,0,83,86,3,2,1,0,84,86,3,4,2,0,85,68,1, + 0,0,0,85,69,1,0,0,0,85,70,1,0,0,0,85,71,1,0,0,0,85,72,1,0,0,0,85,73,1,0, + 0,0,85,74,1,0,0,0,85,75,1,0,0,0,85,76,1,0,0,0,85,77,1,0,0,0,85,78,1,0,0, + 0,85,79,1,0,0,0,85,80,1,0,0,0,85,81,1,0,0,0,85,82,1,0,0,0,85,83,1,0,0,0, + 85,84,1,0,0,0,85,86,1,0,0,0,86,87,1,0,0,0,87,88,5,0,0,1,88,1,1,0,0,0,89, + 90,5,6,0,0,90,91,3,58,29,0,91,92,5,60,0,0,92,93,3,58,29,0,93,94,5,7,0,0, + 94,100,1,0,0,0,95,96,3,58,29,0,96,97,5,60,0,0,97,98,3,58,29,0,98,100,1, + 0,0,0,99,89,1,0,0,0,99,95,1,0,0,0,100,102,1,0,0,0,101,103,5,29,0,0,102, + 101,1,0,0,0,102,103,1,0,0,0,103,104,1,0,0,0,104,115,5,55,0,0,105,106,5, + 6,0,0,106,107,3,60,30,0,107,108,5,60,0,0,108,109,3,60,30,0,109,110,5,7, + 0,0,110,116,1,0,0,0,111,112,3,60,30,0,112,113,5,60,0,0,113,114,3,60,30, + 0,114,116,1,0,0,0,115,105,1,0,0,0,115,111,1,0,0,0,115,116,1,0,0,0,116,3, + 1,0,0,0,117,118,5,6,0,0,118,119,3,58,29,0,119,120,5,60,0,0,120,121,3,58, + 29,0,121,122,5,7,0,0,122,123,1,0,0,0,123,124,5,71,0,0,124,125,5,6,0,0,125, + 126,3,38,19,0,126,131,5,7,0,0,127,128,5,71,0,0,128,129,3,10,5,0,129,130, + 5,71,0,0,130,132,1,0,0,0,131,127,1,0,0,0,131,132,1,0,0,0,132,133,1,0,0, + 0,133,144,5,55,0,0,134,135,5,6,0,0,135,136,3,60,30,0,136,137,5,60,0,0,137, + 138,3,60,30,0,138,139,5,7,0,0,139,145,1,0,0,0,140,141,3,60,30,0,141,142, + 5,60,0,0,142,143,3,60,30,0,143,145,1,0,0,0,144,134,1,0,0,0,144,140,1,0, + 0,0,144,145,1,0,0,0,145,5,1,0,0,0,146,148,9,0,0,0,147,146,1,0,0,0,148,151, + 1,0,0,0,149,150,1,0,0,0,149,147,1,0,0,0,150,159,1,0,0,0,151,149,1,0,0,0, + 152,156,3,62,31,0,153,155,9,0,0,0,154,153,1,0,0,0,155,158,1,0,0,0,156,157, + 1,0,0,0,156,154,1,0,0,0,157,160,1,0,0,0,158,156,1,0,0,0,159,152,1,0,0,0, + 160,161,1,0,0,0,161,159,1,0,0,0,161,162,1,0,0,0,162,7,1,0,0,0,163,164,5, + 71,0,0,164,9,1,0,0,0,165,167,5,53,0,0,166,165,1,0,0,0,166,167,1,0,0,0,167, + 168,1,0,0,0,168,169,5,64,0,0,169,11,1,0,0,0,170,174,3,10,5,0,171,174,5, + 12,0,0,172,174,3,8,4,0,173,170,1,0,0,0,173,171,1,0,0,0,173,172,1,0,0,0, + 174,175,1,0,0,0,175,176,3,60,30,0,176,13,1,0,0,0,177,180,3,8,4,0,178,180, + 5,12,0,0,179,177,1,0,0,0,179,178,1,0,0,0,180,181,1,0,0,0,181,182,5,55,0, + 0,182,183,3,58,29,0,183,15,1,0,0,0,184,187,3,14,7,0,185,186,5,60,0,0,186, + 188,3,14,7,0,187,185,1,0,0,0,188,189,1,0,0,0,189,187,1,0,0,0,189,190,1, + 0,0,0,190,17,1,0,0,0,191,192,3,14,7,0,192,194,5,55,0,0,193,195,3,60,30, + 0,194,193,1,0,0,0,194,195,1,0,0,0,195,19,1,0,0,0,196,197,3,58,29,0,197, + 199,5,55,0,0,198,200,3,60,30,0,199,198,1,0,0,0,199,200,1,0,0,0,200,21,1, + 0,0,0,201,202,3,58,29,0,202,203,5,55,0,0,203,204,3,58,29,0,204,23,1,0,0, + 0,205,208,3,8,4,0,206,208,5,12,0,0,207,205,1,0,0,0,207,206,1,0,0,0,208, + 209,1,0,0,0,209,210,5,55,0,0,210,211,3,8,4,0,211,212,5,6,0,0,212,217,3, + 26,13,0,213,214,5,60,0,0,214,216,3,26,13,0,215,213,1,0,0,0,216,219,1,0, + 0,0,217,215,1,0,0,0,217,218,1,0,0,0,218,220,1,0,0,0,219,217,1,0,0,0,220, + 221,5,7,0,0,221,25,1,0,0,0,222,223,5,6,0,0,223,224,3,58,29,0,224,225,5, + 60,0,0,225,226,3,40,20,0,226,227,5,7,0,0,227,27,1,0,0,0,228,230,5,28,0, + 0,229,228,1,0,0,0,229,230,1,0,0,0,230,231,1,0,0,0,231,232,7,0,0,0,232,233, + 5,6,0,0,233,234,3,58,29,0,234,235,5,7,0,0,235,29,1,0,0,0,236,244,5,13,0, + 0,237,238,5,14,0,0,238,239,5,4,0,0,239,240,5,5,0,0,240,241,5,54,0,0,241, + 242,5,4,0,0,242,244,5,5,0,0,243,236,1,0,0,0,243,237,1,0,0,0,244,245,1,0, + 0,0,245,246,5,6,0,0,246,247,3,58,29,0,247,254,5,7,0,0,248,249,5,17,0,0, + 249,250,5,4,0,0,250,251,3,8,4,0,251,252,5,5,0,0,252,255,1,0,0,0,253,255, + 3,8,4,0,254,248,1,0,0,0,254,253,1,0,0,0,255,256,1,0,0,0,256,257,5,6,0,0, + 257,258,3,8,4,0,258,259,5,7,0,0,259,31,1,0,0,0,260,261,5,14,0,0,261,262, + 5,4,0,0,262,263,3,58,29,0,263,264,5,5,0,0,264,267,1,0,0,0,265,267,7,1,0, + 0,266,260,1,0,0,0,266,265,1,0,0,0,267,274,1,0,0,0,268,269,5,54,0,0,269, + 270,5,4,0,0,270,271,3,58,29,0,271,272,5,5,0,0,272,275,1,0,0,0,273,275,7, + 2,0,0,274,268,1,0,0,0,274,273,1,0,0,0,275,276,1,0,0,0,276,277,5,6,0,0,277, + 278,3,58,29,0,278,285,5,7,0,0,279,280,5,17,0,0,280,281,5,4,0,0,281,282, + 3,8,4,0,282,283,5,5,0,0,283,286,1,0,0,0,284,286,3,8,4,0,285,279,1,0,0,0, + 285,284,1,0,0,0,286,287,1,0,0,0,287,288,5,6,0,0,288,289,3,8,4,0,289,290, + 5,7,0,0,290,33,1,0,0,0,291,292,5,18,0,0,292,299,5,4,0,0,293,294,5,17,0, + 0,294,295,5,4,0,0,295,296,3,8,4,0,296,297,5,5,0,0,297,300,1,0,0,0,298,300, + 3,8,4,0,299,293,1,0,0,0,299,298,1,0,0,0,300,301,1,0,0,0,301,302,5,5,0,0, + 302,309,5,4,0,0,303,304,5,17,0,0,304,305,5,4,0,0,305,306,3,8,4,0,306,307, + 5,5,0,0,307,310,1,0,0,0,308,310,3,8,4,0,309,303,1,0,0,0,309,308,1,0,0,0, + 310,311,1,0,0,0,311,312,5,6,0,0,312,313,3,8,4,0,313,314,5,7,0,0,314,315, + 5,5,0,0,315,316,5,6,0,0,316,317,3,58,29,0,317,318,5,7,0,0,318,35,1,0,0, + 0,319,320,5,18,0,0,320,327,5,4,0,0,321,322,5,17,0,0,322,323,5,4,0,0,323, + 324,3,8,4,0,324,325,5,5,0,0,325,328,1,0,0,0,326,328,3,8,4,0,327,321,1,0, + 0,0,327,326,1,0,0,0,328,335,1,0,0,0,329,330,5,54,0,0,330,331,5,4,0,0,331, + 332,3,10,5,0,332,333,5,5,0,0,333,336,1,0,0,0,334,336,5,62,0,0,335,329,1, + 0,0,0,335,334,1,0,0,0,336,337,1,0,0,0,337,338,5,5,0,0,338,345,5,4,0,0,339, + 340,5,17,0,0,340,341,5,4,0,0,341,342,3,8,4,0,342,343,5,5,0,0,343,346,1, + 0,0,0,344,346,3,8,4,0,345,339,1,0,0,0,345,344,1,0,0,0,346,347,1,0,0,0,347, + 348,5,6,0,0,348,349,3,8,4,0,349,356,5,7,0,0,350,351,5,54,0,0,351,352,5, + 4,0,0,352,353,3,10,5,0,353,354,5,5,0,0,354,357,1,0,0,0,355,357,5,62,0,0, + 356,350,1,0,0,0,356,355,1,0,0,0,357,358,1,0,0,0,358,359,5,5,0,0,359,360, + 5,6,0,0,360,361,3,58,29,0,361,362,5,7,0,0,362,37,1,0,0,0,363,364,3,8,4, + 0,364,365,5,55,0,0,365,366,3,58,29,0,366,374,1,0,0,0,367,368,3,58,29,0, + 368,369,7,3,0,0,369,370,3,8,4,0,370,371,7,3,0,0,371,372,3,58,29,0,372,374, + 1,0,0,0,373,363,1,0,0,0,373,367,1,0,0,0,374,39,1,0,0,0,375,378,3,48,24, + 0,376,378,3,50,25,0,377,375,1,0,0,0,377,376,1,0,0,0,378,41,1,0,0,0,379, + 382,3,8,4,0,380,381,5,60,0,0,381,383,3,8,4,0,382,380,1,0,0,0,383,384,1, + 0,0,0,384,382,1,0,0,0,384,385,1,0,0,0,385,43,1,0,0,0,386,387,3,8,4,0,387, + 390,7,4,0,0,388,391,3,10,5,0,389,391,3,12,6,0,390,388,1,0,0,0,390,389,1, + 0,0,0,391,45,1,0,0,0,392,395,3,44,22,0,393,394,5,60,0,0,394,396,3,44,22, + 0,395,393,1,0,0,0,396,397,1,0,0,0,397,395,1,0,0,0,397,398,1,0,0,0,398,47, + 1,0,0,0,399,400,3,58,29,0,400,401,7,5,0,0,401,402,3,58,29,0,402,49,1,0, + 0,0,403,404,3,58,29,0,404,405,7,5,0,0,405,406,3,58,29,0,406,407,7,5,0,0, + 407,408,3,58,29,0,408,51,1,0,0,0,409,414,3,58,29,0,410,411,5,67,0,0,411, + 413,3,58,29,0,412,410,1,0,0,0,413,416,1,0,0,0,414,412,1,0,0,0,414,415,1, + 0,0,0,415,53,1,0,0,0,416,414,1,0,0,0,417,418,3,8,4,0,418,419,5,6,0,0,419, + 424,3,38,19,0,420,421,5,60,0,0,421,423,3,38,19,0,422,420,1,0,0,0,423,426, + 1,0,0,0,424,422,1,0,0,0,424,425,1,0,0,0,425,427,1,0,0,0,426,424,1,0,0,0, + 427,432,5,7,0,0,428,429,5,71,0,0,429,430,3,10,5,0,430,431,5,71,0,0,431, + 433,1,0,0,0,432,428,1,0,0,0,432,433,1,0,0,0,433,55,1,0,0,0,434,435,5,17, + 0,0,435,436,5,4,0,0,436,437,3,8,4,0,437,438,5,5,0,0,438,441,1,0,0,0,439, + 441,3,8,4,0,440,434,1,0,0,0,440,439,1,0,0,0,441,442,1,0,0,0,442,443,5,6, + 0,0,443,448,3,58,29,0,444,445,5,60,0,0,445,447,3,58,29,0,446,444,1,0,0, + 0,447,450,1,0,0,0,448,446,1,0,0,0,448,449,1,0,0,0,449,451,1,0,0,0,450,448, + 1,0,0,0,451,452,5,7,0,0,452,57,1,0,0,0,453,454,6,29,-1,0,454,455,3,8,4, + 0,455,456,5,70,0,0,456,583,1,0,0,0,457,458,3,8,4,0,458,459,7,2,0,0,459, + 460,5,69,0,0,460,583,1,0,0,0,461,462,3,8,4,0,462,463,5,54,0,0,463,464,5, + 4,0,0,464,465,3,58,29,0,465,466,5,5,0,0,466,467,5,69,0,0,467,583,1,0,0, + 0,468,583,5,23,0,0,469,470,5,22,0,0,470,471,5,4,0,0,471,472,3,58,29,0,472, + 473,5,5,0,0,473,583,1,0,0,0,474,475,5,65,0,0,475,480,3,52,26,0,476,477, + 5,68,0,0,477,479,3,52,26,0,478,476,1,0,0,0,479,482,1,0,0,0,480,478,1,0, + 0,0,480,481,1,0,0,0,481,483,1,0,0,0,482,480,1,0,0,0,483,484,5,66,0,0,484, + 583,1,0,0,0,485,583,3,28,14,0,486,583,3,30,15,0,487,583,3,32,16,0,488,583, + 3,34,17,0,489,583,3,36,18,0,490,492,5,28,0,0,491,490,1,0,0,0,491,492,1, + 0,0,0,492,493,1,0,0,0,493,494,5,43,0,0,494,495,5,6,0,0,495,496,3,58,29, + 0,496,497,5,7,0,0,497,583,1,0,0,0,498,500,5,28,0,0,499,498,1,0,0,0,499, + 500,1,0,0,0,500,501,1,0,0,0,501,502,5,44,0,0,502,503,5,6,0,0,503,504,3, + 58,29,0,504,505,5,7,0,0,505,583,1,0,0,0,506,507,5,45,0,0,507,508,5,4,0, + 0,508,509,3,58,29,0,509,510,5,5,0,0,510,511,5,6,0,0,511,512,3,58,29,0,512, + 513,5,7,0,0,513,583,1,0,0,0,514,515,7,6,0,0,515,516,5,6,0,0,516,517,3,58, + 29,0,517,518,5,7,0,0,518,583,1,0,0,0,519,520,5,9,0,0,520,521,3,58,29,0, + 521,522,5,9,0,0,522,583,1,0,0,0,523,524,5,8,0,0,524,525,3,58,29,0,525,526, + 5,8,0,0,526,583,1,0,0,0,527,583,3,12,6,0,528,583,3,10,5,0,529,530,5,53, + 0,0,530,583,3,58,29,30,531,532,5,18,0,0,532,533,5,4,0,0,533,534,3,58,29, + 0,534,535,5,5,0,0,535,536,5,4,0,0,536,537,3,58,29,0,537,538,5,5,0,0,538, + 583,1,0,0,0,539,583,5,19,0,0,540,583,3,8,4,0,541,583,3,54,27,0,542,583, + 3,56,28,0,543,583,5,12,0,0,544,545,5,6,0,0,545,546,3,58,29,0,546,547,5, + 7,0,0,547,583,1,0,0,0,548,549,3,10,5,0,549,550,3,58,29,12,550,583,1,0,0, + 0,551,552,3,12,6,0,552,553,3,58,29,11,553,583,1,0,0,0,554,555,5,12,0,0, + 555,583,3,58,29,10,556,559,5,26,0,0,557,558,5,4,0,0,558,560,5,5,0,0,559, + 557,1,0,0,0,559,560,1,0,0,0,560,583,1,0,0,0,561,562,5,17,0,0,562,563,5, + 4,0,0,563,564,3,58,29,0,564,565,5,5,0,0,565,567,1,0,0,0,566,561,1,0,0,0, + 566,567,1,0,0,0,567,571,1,0,0,0,568,572,5,61,0,0,569,572,3,10,5,0,570,572, + 5,55,0,0,571,568,1,0,0,0,571,569,1,0,0,0,571,570,1,0,0,0,571,572,1,0,0, + 0,572,573,1,0,0,0,573,574,5,17,0,0,574,575,5,4,0,0,575,576,3,58,29,0,576, + 580,5,5,0,0,577,581,5,61,0,0,578,581,3,10,5,0,579,581,5,55,0,0,580,577, + 1,0,0,0,580,578,1,0,0,0,580,579,1,0,0,0,580,581,1,0,0,0,581,583,1,0,0,0, + 582,453,1,0,0,0,582,457,1,0,0,0,582,461,1,0,0,0,582,468,1,0,0,0,582,469, + 1,0,0,0,582,474,1,0,0,0,582,485,1,0,0,0,582,486,1,0,0,0,582,487,1,0,0,0, + 582,488,1,0,0,0,582,489,1,0,0,0,582,491,1,0,0,0,582,499,1,0,0,0,582,506, + 1,0,0,0,582,514,1,0,0,0,582,519,1,0,0,0,582,523,1,0,0,0,582,527,1,0,0,0, + 582,528,1,0,0,0,582,529,1,0,0,0,582,531,1,0,0,0,582,539,1,0,0,0,582,540, + 1,0,0,0,582,541,1,0,0,0,582,542,1,0,0,0,582,543,1,0,0,0,582,544,1,0,0,0, + 582,548,1,0,0,0,582,551,1,0,0,0,582,554,1,0,0,0,582,556,1,0,0,0,582,566, + 1,0,0,0,583,648,1,0,0,0,584,585,10,29,0,0,585,586,5,21,0,0,586,647,3,58, + 29,30,587,588,10,28,0,0,588,589,5,20,0,0,589,647,3,58,29,29,590,591,10, + 25,0,0,591,592,5,53,0,0,592,647,3,58,29,26,593,594,10,24,0,0,594,595,5, + 52,0,0,595,647,3,58,29,25,596,597,10,51,0,0,597,647,7,2,0,0,598,599,10, + 50,0,0,599,600,5,54,0,0,600,601,5,4,0,0,601,602,3,58,29,0,602,603,5,5,0, + 0,603,647,1,0,0,0,604,605,10,49,0,0,605,606,5,10,0,0,606,607,5,4,0,0,607, + 608,3,58,29,0,608,609,5,60,0,0,609,610,3,58,29,0,610,611,5,5,0,0,611,647, + 1,0,0,0,612,613,10,48,0,0,613,647,5,27,0,0,614,615,10,47,0,0,615,647,5, + 11,0,0,616,617,10,18,0,0,617,618,5,10,0,0,618,619,5,4,0,0,619,647,5,5,0, + 0,620,621,10,17,0,0,621,622,5,54,0,0,622,623,5,4,0,0,623,647,5,5,0,0,624, + 625,10,16,0,0,625,647,3,8,4,0,626,627,10,15,0,0,627,647,3,10,5,0,628,629, + 10,14,0,0,629,647,3,12,6,0,630,631,10,13,0,0,631,647,5,12,0,0,632,633,10, + 9,0,0,633,647,3,54,27,0,634,635,10,8,0,0,635,647,3,56,28,0,636,637,10,7, + 0,0,637,647,3,28,14,0,638,639,10,6,0,0,639,647,3,30,15,0,640,641,10,5,0, + 0,641,647,3,32,16,0,642,643,10,4,0,0,643,647,3,34,17,0,644,645,10,3,0,0, + 645,647,3,36,18,0,646,584,1,0,0,0,646,587,1,0,0,0,646,590,1,0,0,0,646,593, + 1,0,0,0,646,596,1,0,0,0,646,598,1,0,0,0,646,604,1,0,0,0,646,612,1,0,0,0, + 646,614,1,0,0,0,646,616,1,0,0,0,646,620,1,0,0,0,646,624,1,0,0,0,646,626, + 1,0,0,0,646,628,1,0,0,0,646,630,1,0,0,0,646,632,1,0,0,0,646,634,1,0,0,0, + 646,636,1,0,0,0,646,638,1,0,0,0,646,640,1,0,0,0,646,642,1,0,0,0,646,644, + 1,0,0,0,647,650,1,0,0,0,648,646,1,0,0,0,648,649,1,0,0,0,649,59,1,0,0,0, + 650,648,1,0,0,0,651,652,7,7,0,0,652,653,3,66,33,0,653,654,7,8,0,0,654,61, + 1,0,0,0,655,656,7,7,0,0,656,657,7,9,0,0,657,658,7,10,0,0,658,659,7,9,0, + 0,659,660,7,8,0,0,660,63,1,0,0,0,661,662,5,79,0,0,662,663,5,89,0,0,663, + 664,7,9,0,0,664,665,5,90,0,0,665,666,5,89,0,0,666,667,5,92,0,0,667,670, + 5,90,0,0,668,670,5,80,0,0,669,661,1,0,0,0,669,668,1,0,0,0,670,65,1,0,0, + 0,671,672,6,33,-1,0,672,673,5,83,0,0,673,674,5,89,0,0,674,675,3,58,29,0, + 675,676,5,90,0,0,676,694,1,0,0,0,677,678,5,79,0,0,678,681,5,89,0,0,679, + 682,3,66,33,0,680,682,5,91,0,0,681,679,1,0,0,0,681,680,1,0,0,0,682,683, + 1,0,0,0,683,684,5,90,0,0,684,685,5,89,0,0,685,686,3,66,33,0,686,687,5,90, + 0,0,687,694,1,0,0,0,688,694,5,86,0,0,689,690,5,87,0,0,690,691,3,66,33,0, + 691,692,5,88,0,0,692,694,1,0,0,0,693,671,1,0,0,0,693,677,1,0,0,0,693,688, + 1,0,0,0,693,689,1,0,0,0,694,717,1,0,0,0,695,696,10,4,0,0,696,697,5,81,0, + 0,697,716,3,66,33,5,698,699,10,9,0,0,699,700,5,85,0,0,700,716,5,92,0,0, + 701,702,10,8,0,0,702,703,5,85,0,0,703,704,5,89,0,0,704,705,5,92,0,0,705, + 716,5,90,0,0,706,707,10,7,0,0,707,708,5,85,0,0,708,716,3,64,32,0,709,710, + 10,6,0,0,710,711,5,85,0,0,711,712,5,89,0,0,712,713,3,64,32,0,713,714,5, + 90,0,0,714,716,1,0,0,0,715,695,1,0,0,0,715,698,1,0,0,0,715,701,1,0,0,0, + 715,706,1,0,0,0,715,709,1,0,0,0,716,719,1,0,0,0,717,715,1,0,0,0,717,718, + 1,0,0,0,718,67,1,0,0,0,719,717,1,0,0,0,54,85,99,102,115,131,144,149,156, + 161,166,173,179,189,194,199,207,217,229,243,254,266,274,285,299,309,327, + 335,345,356,373,377,384,390,397,414,424,432,440,448,480,491,499,559,566, + 571,580,582,646,648,669,681,693,715,717]; private static __ATN: ATN; public static get _ATN(): ATN { @@ -3988,11 +4013,17 @@ export class Number_with_unitsContext extends ParserRuleContext { super(parent, invokingState); this.parser = parser; } + public u_block(): U_blockContext { + return this.getTypedRuleContext(U_blockContext, 0) as U_blockContext; + } public number_(): NumberContext { return this.getTypedRuleContext(NumberContext, 0) as NumberContext; } - public u_block(): U_blockContext { - return this.getTypedRuleContext(U_blockContext, 0) as U_blockContext; + public PI(): TerminalNode { + return this.getToken(LatexParser.PI, 0); + } + public id(): IdContext { + return this.getTypedRuleContext(IdContext, 0) as IdContext; } public get ruleIndex(): number { return LatexParser.RULE_number_with_units; diff --git a/src/parser/LatexToSympy.ts b/src/parser/LatexToSympy.ts index 39c4edff..306cc5d4 100644 --- a/src/parser/LatexToSympy.ts +++ b/src/parser/LatexToSympy.ts @@ -1989,7 +1989,13 @@ export class LatexToSympy extends LatexParserVisitor { await page.waitForSelector('text=Updating...', {state: 'detached'}); await expect(page.locator('#cell-0 >> text=Dimension Error')).toBeVisible(); -}); \ No newline at end of file +}); + +test('Test units applied to pi', async () => { + await page.locator('#cell-0 >> math-field.editable').type("2*pi[rad]=[deg]"); + + await page.locator('#add-math-cell').click(); + await page.setLatex(1, String.raw`2\cdot \pi\left\lbrack rad\right\rbrack=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(360, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe('deg'); + + content = await page.textContent('#result-value-1'); + expect(parseLatexFloat(content)).toBeCloseTo(2*pi, precision); + content = await page.textContent('#result-units-1'); + expect(content).toBe('rad'); +}); + +test('Test error if relative temperature applied to pi', async () => { + await page.locator('#cell-0 >> math-field.editable').type("pi[degC]="); + + await expect(page.locator('#cell-0 >> text=Only absolute temperature units may be applied directly to the pi symbol')).toBeVisible(); +}); + +test('Test error units applied to variable name', async () => { + await page.locator('#cell-0 >> math-field.editable').type("a[m]="); + + await expect(page.locator('#cell-0 >> text=Units cannot be applied directly to a variable name')).toBeVisible(); +});