qpremake 1.5.3 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/package.json +2 -7
- package/lib/_localizationFiles/English.d.ts +0 -2
- package/lib/_localizationFiles/English.js +0 -307
- package/lib/_mods/parserModules/addSymbol.d.ts +0 -7
- package/lib/_mods/parserModules/addSymbol.js +0 -18
- package/lib/_mods/parserModules/expression.d.ts +0 -7
- package/lib/_mods/parserModules/expression.js +0 -45
- package/lib/_mods/parserModules/expression_parser.d.ts +0 -143
- package/lib/_mods/parserModules/expression_parser.js +0 -728
- package/lib/_mods/parserModules/img.d.ts +0 -8
- package/lib/_mods/parserModules/img.js +0 -42
- package/lib/_mods/parserModules/qpOriginal.d.ts +0 -5
- package/lib/_mods/parserModules/qpOriginal.js +0 -27
- package/lib/_mods/parserModules/sectionID.d.ts +0 -13
- package/lib/_mods/parserModules/sectionID.js +0 -56
- package/lib/_mods/parserModules/tags.d.ts +0 -9
- package/lib/_mods/parserModules/tags.js +0 -29
- package/lib/_mods/parserModules/uaddminus.d.ts +0 -9
- package/lib/_mods/parserModules/uaddminus.js +0 -42
- package/lib/_mods/parserModules/variantCheck.d.ts +0 -10
- package/lib/_mods/parserModules/variantCheck.js +0 -53
- package/lib/_queenSystem/handler/actionGenrator.d.ts +0 -994
- package/lib/_queenSystem/handler/actionGenrator.js +0 -646
- package/lib/_queenSystem/handler/actionInputGenerator.d.ts +0 -95
- package/lib/_queenSystem/handler/actionInputGenerator.js +0 -373
- package/lib/_queenSystem/handler/actionInputRequesterGenerator.d.ts +0 -92
- package/lib/_queenSystem/handler/actionInputRequesterGenerator.js +0 -341
- package/lib/_queenSystem/handler/cardHandler.d.ts +0 -20
- package/lib/_queenSystem/handler/cardHandler.js +0 -61
- package/lib/_queenSystem/handler/effectGenerator.d.ts +0 -1
- package/lib/_queenSystem/handler/effectGenerator.js +0 -127
- package/lib/_queenSystem/handler/localizationHandler.d.ts +0 -28
- package/lib/_queenSystem/handler/localizationHandler.js +0 -166
- package/lib/_queenSystem/handler/modHandler.d.ts +0 -10
- package/lib/_queenSystem/handler/modHandler.js +0 -36
- package/lib/_queenSystem/handler/oldDataProcessor.d.ts +0 -9
- package/lib/_queenSystem/handler/oldDataProcessor.js +0 -129
- package/lib/_queenSystem/handler/registryHandler.d.ts +0 -36
- package/lib/_queenSystem/handler/registryHandler.js +0 -63
- package/lib/_queenSystem/handler/zoneHandler.d.ts +0 -102
- package/lib/_queenSystem/handler/zoneHandler.js +0 -606
- package/lib/_queenSystem/loader/loader_card.d.ts +0 -20
- package/lib/_queenSystem/loader/loader_card.js +0 -124
- package/lib/_queenSystem/loader/loader_effect.d.ts +0 -27
- package/lib/_queenSystem/loader/loader_effect.js +0 -163
- package/lib/_queenSystem/loader/loader_handler.d.ts +0 -11
- package/lib/_queenSystem/loader/loader_handler.js +0 -24
- package/lib/_queenSystem/loader/loader_localization.d.ts +0 -11
- package/lib/_queenSystem/loader/loader_localization.js +0 -73
- package/lib/_queenSystem/loader/loader_mod.d.ts +0 -10
- package/lib/_queenSystem/loader/loader_mod.js +0 -72
- package/lib/_queenSystem/loader/loader_subtype.d.ts +0 -9
- package/lib/_queenSystem/loader/loader_subtype.js +0 -39
- package/lib/_queenSystem/loader/loader_type.d.ts +0 -9
- package/lib/_queenSystem/loader/loader_type.js +0 -39
- package/lib/_queenSystem/loader/loader_zone.d.ts +0 -14
- package/lib/_queenSystem/loader/loader_zone.js +0 -35
- package/lib/_queenSystem/queenSystem.d.ts +0 -127
- package/lib/_queenSystem/queenSystem.js +0 -996
- package/lib/_queenSystem/renderer/rendererInterface.d.ts +0 -27
- package/lib/_queenSystem/renderer/rendererInterface.js +0 -25
- package/lib/data/actionRegistry.d.ts +0 -56
- package/lib/data/actionRegistry.js +0 -60
- package/lib/data/cardRegistry.d.ts +0 -1162
- package/lib/data/cardRegistry.js +0 -716
- package/lib/data/deckRegistry.d.ts +0 -19
- package/lib/data/deckRegistry.js +0 -41
- package/lib/data/effectRegistry.d.ts +0 -465
- package/lib/data/effectRegistry.js +0 -151
- package/lib/data/effectTypeRegistry.d.ts +0 -14
- package/lib/data/effectTypeRegistry.js +0 -14
- package/lib/data/operatorRegistry.d.ts +0 -92
- package/lib/data/operatorRegistry.js +0 -82
- package/lib/data/rarityRegistry.d.ts +0 -28
- package/lib/data/rarityRegistry.js +0 -63
- package/lib/data/registryRegistry.d.ts +0 -10
- package/lib/data/registryRegistry.js +0 -14
- package/lib/data/subtypeRegistry.d.ts +0 -15
- package/lib/data/subtypeRegistry.js +0 -15
- package/lib/data/systemRegistry.d.ts +0 -253
- package/lib/data/systemRegistry.js +0 -56
- package/lib/data/zoneRegistry.d.ts +0 -43
- package/lib/data/zoneRegistry.js +0 -157
- package/lib/effectTextParser/index.d.ts +0 -42
- package/lib/effectTextParser/index.js +0 -316
- package/lib/global/index.d.ts +0 -8
- package/lib/global/index.js +0 -12
- package/lib/index.d.ts +0 -6335
- package/lib/index.js +0 -205
- package/lib/specificEffects/e_cond.d.ts +0 -11
- package/lib/specificEffects/e_cond.js +0 -36
- package/lib/specificEffects/e_fruit.d.ts +0 -3
- package/lib/specificEffects/e_fruit.js +0 -187
- package/lib/specificEffects/e_generic.d.ts +0 -191
- package/lib/specificEffects/e_generic.js +0 -662
- package/lib/specificEffects/e_generic_cardTargetting.d.ts +0 -38
- package/lib/specificEffects/e_generic_cardTargetting.js +0 -82
- package/lib/specificEffects/e_generic_noneTargetting.d.ts +0 -10
- package/lib/specificEffects/e_generic_noneTargetting.js +0 -26
- package/lib/specificEffects/e_status.d.ts +0 -80
- package/lib/specificEffects/e_status.js +0 -151
- package/lib/specificEffects/e_test.d.ts +0 -3
- package/lib/specificEffects/e_test.js +0 -21
- package/lib/types/abstract/gameComponents/API.d.ts +0 -19
- package/lib/types/abstract/gameComponents/API.js +0 -2
- package/lib/types/abstract/gameComponents/card.d.ts +0 -108
- package/lib/types/abstract/gameComponents/card.js +0 -771
- package/lib/types/abstract/gameComponents/effect.d.ts +0 -82
- package/lib/types/abstract/gameComponents/effect.js +0 -331
- package/lib/types/abstract/gameComponents/effectSubtype.d.ts +0 -22
- package/lib/types/abstract/gameComponents/effectSubtype.js +0 -40
- package/lib/types/abstract/gameComponents/effectType.d.ts +0 -11
- package/lib/types/abstract/gameComponents/effectType.js +0 -8
- package/lib/types/abstract/gameComponents/settings.d.ts +0 -80
- package/lib/types/abstract/gameComponents/settings.js +0 -72
- package/lib/types/abstract/gameComponents/zone.d.ts +0 -113
- package/lib/types/abstract/gameComponents/zone.js +0 -614
- package/lib/types/abstract/gameComponents/zone_gridBased.d.ts +0 -18
- package/lib/types/abstract/gameComponents/zone_gridBased.js +0 -58
- package/lib/types/abstract/gameComponents/zone_stackBased.d.ts +0 -13
- package/lib/types/abstract/gameComponents/zone_stackBased.js +0 -55
- package/lib/types/abstract/generics/node.d.ts +0 -23
- package/lib/types/abstract/generics/node.js +0 -46
- package/lib/types/abstract/generics/position.d.ts +0 -23
- package/lib/types/abstract/generics/position.js +0 -91
- package/lib/types/abstract/generics/tree.d.ts +0 -25
- package/lib/types/abstract/generics/tree.js +0 -153
- package/lib/types/abstract/generics/universalResponse.d.ts +0 -4
- package/lib/types/abstract/generics/universalResponse.js +0 -2
- package/lib/types/abstract/generics/wraper.d.ts +0 -21
- package/lib/types/abstract/generics/wraper.js +0 -56
- package/lib/types/abstract/parser/component.d.ts +0 -88
- package/lib/types/abstract/parser/component.js +0 -132
- package/lib/types/abstract/parser/index.d.ts +0 -6
- package/lib/types/abstract/parser/index.js +0 -28
- package/lib/types/abstract/parser/modPack.d.ts +0 -21
- package/lib/types/abstract/parser/modPack.js +0 -48
- package/lib/types/abstract/parser/moduleInputObject.d.ts +0 -12
- package/lib/types/abstract/parser/moduleInputObject.js +0 -21
- package/lib/types/abstract/parser/options.d.ts +0 -31
- package/lib/types/abstract/parser/options.js +0 -45
- package/lib/types/abstract/serializedGameComponents/Gamestate.d.ts +0 -46
- package/lib/types/abstract/serializedGameComponents/Gamestate.js +0 -70
- package/lib/types/abstract/serializedGameComponents/Localized.d.ts +0 -69
- package/lib/types/abstract/serializedGameComponents/Localized.js +0 -84
- package/lib/types/defaultZones/ability.d.ts +0 -10
- package/lib/types/defaultZones/ability.js +0 -22
- package/lib/types/defaultZones/deck.d.ts +0 -25
- package/lib/types/defaultZones/deck.js +0 -90
- package/lib/types/defaultZones/drop.d.ts +0 -5
- package/lib/types/defaultZones/drop.js +0 -13
- package/lib/types/defaultZones/field.d.ts +0 -11
- package/lib/types/defaultZones/field.js +0 -35
- package/lib/types/defaultZones/grave.d.ts +0 -8
- package/lib/types/defaultZones/grave.js +0 -21
- package/lib/types/defaultZones/hand.d.ts +0 -5
- package/lib/types/defaultZones/hand.js +0 -14
- package/lib/types/defaultZones/storage.d.ts +0 -9
- package/lib/types/defaultZones/storage.js +0 -21
- package/lib/types/defaultZones/system.d.ts +0 -12
- package/lib/types/defaultZones/system.js +0 -35
- package/lib/types/defaultZones/void.d.ts +0 -4
- package/lib/types/defaultZones/void.js +0 -10
- package/lib/types/effects/effectSubtypes/subtype_chained.d.ts +0 -10
- package/lib/types/effects/effectSubtypes/subtype_chained.js +0 -17
- package/lib/types/effects/effectSubtypes/subtype_delayed.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_delayed.js +0 -16
- package/lib/types/effects/effectSubtypes/subtype_fieldLock.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_fieldLock.js +0 -21
- package/lib/types/effects/effectSubtypes/subtype_graveLock.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_graveLock.js +0 -21
- package/lib/types/effects/effectSubtypes/subtype_hand_or_fieldLock.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_hand_or_fieldLock.js +0 -21
- package/lib/types/effects/effectSubtypes/subtype_hardUnique.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_hardUnique.js +0 -15
- package/lib/types/effects/effectSubtypes/subtype_instant.d.ts +0 -8
- package/lib/types/effects/effectSubtypes/subtype_instant.js +0 -20
- package/lib/types/effects/effectSubtypes/subtype_once.d.ts +0 -12
- package/lib/types/effects/effectSubtypes/subtype_once.js +0 -27
- package/lib/types/effects/effectSubtypes/subtype_unique.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_unique.js +0 -16
- package/lib/types/effects/effectTypes/initEffect.d.ts +0 -7
- package/lib/types/effects/effectTypes/initEffect.js +0 -23
- package/lib/types/effects/effectTypes/lockEffect.d.ts +0 -9
- package/lib/types/effects/effectTypes/lockEffect.js +0 -25
- package/lib/types/effects/effectTypes/manualEffect.d.ts +0 -9
- package/lib/types/effects/effectTypes/manualEffect.js +0 -18
- package/lib/types/effects/effectTypes/passiveEffect.d.ts +0 -9
- package/lib/types/effects/effectTypes/passiveEffect.js +0 -23
- package/lib/types/effects/effectTypes/triggerEffect.d.ts +0 -9
- package/lib/types/effects/effectTypes/triggerEffect.js +0 -28
- package/lib/types/errors/cannotLoad.d.ts +0 -5
- package/lib/types/errors/cannotLoad.js +0 -13
- package/lib/types/errors/cardNotExist.d.ts +0 -5
- package/lib/types/errors/cardNotExist.js +0 -13
- package/lib/types/errors/cardNotInApplicableZone.d.ts +0 -5
- package/lib/types/errors/cardNotInApplicableZone.js +0 -13
- package/lib/types/errors/effectCondNotMet.d.ts +0 -5
- package/lib/types/errors/effectCondNotMet.js +0 -13
- package/lib/types/errors/effectNotExist.d.ts +0 -5
- package/lib/types/errors/effectNotExist.js +0 -13
- package/lib/types/errors/error.d.ts +0 -17
- package/lib/types/errors/error.js +0 -42
- package/lib/types/errors/incorrectActionType.d.ts +0 -5
- package/lib/types/errors/incorrectActionType.js +0 -13
- package/lib/types/errors/index.d.ts +0 -16
- package/lib/types/errors/index.js +0 -36
- package/lib/types/errors/invalidOrderMap.d.ts +0 -6
- package/lib/types/errors/invalidOrderMap.js +0 -14
- package/lib/types/errors/invalidPosition.d.ts +0 -6
- package/lib/types/errors/invalidPosition.js +0 -13
- package/lib/types/errors/subTypeOverrideConflict.d.ts +0 -7
- package/lib/types/errors/subTypeOverrideConflict.js +0 -15
- package/lib/types/errors/unknownError.d.ts +0 -5
- package/lib/types/errors/unknownError.js +0 -13
- package/lib/types/errors/unregisteredAction.d.ts +0 -6
- package/lib/types/errors/unregisteredAction.js +0 -13
- package/lib/types/errors/wrongEffectIdx.d.ts +0 -5
- package/lib/types/errors/wrongEffectIdx.js +0 -14
- package/lib/types/errors/zoneAttrConflict.d.ts +0 -5
- package/lib/types/errors/zoneAttrConflict.js +0 -15
- package/lib/types/errors/zoneFull.d.ts +0 -5
- package/lib/types/errors/zoneFull.js +0 -13
- package/lib/types/errors/zoneNotExist.d.ts +0 -5
- package/lib/types/errors/zoneNotExist.js +0 -13
- package/lib/types/misc.d.ts +0 -97
- package/lib/types/misc.js +0 -8
- package/lib/types/mods/effectTextParserModule.d.ts +0 -16
- package/lib/types/mods/effectTextParserModule.js +0 -81
- package/lib/types/mods/gameModule.d.ts +0 -5
- package/lib/types/mods/gameModule.js +0 -8
- package/lib/utils/index.d.ts +0 -78
- package/lib/utils/index.js +0 -562
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ This is a card effect processing system for the game "Quantum Protocol" remade i
|
|
|
4
4
|
|
|
5
5
|
> Quantum Protocol and Jkong reserves all rights to the game and all related assets.
|
|
6
6
|
|
|
7
|
+
This README is outdated (not correspoinding to the latest commit's project structure) and will be update soon, stay tuned
|
|
8
|
+
|
|
7
9
|
## Table of contents
|
|
8
10
|
|
|
9
11
|
- [qpRemake](#qpremake)
|
|
@@ -518,7 +520,7 @@ This child class has 5 jobs :
|
|
|
518
520
|
|
|
519
521
|
5. Return some parameters to inject into the effect text by overriding the ```getDisplayInput``` function.
|
|
520
522
|
|
|
521
|
-
Going over how to make an action, you need to invoke the const ```
|
|
523
|
+
Going over how to make an action, you need to invoke the const ```ActionGenerator```, hopefully ts takes over the rest of the guiding process if i do my magic correctly
|
|
522
524
|
|
|
523
525
|
|
|
524
526
|
Update 1.2.9:
|
|
@@ -529,9 +531,9 @@ If anyone knows how to write a better version of this rule, pls help
|
|
|
529
531
|
|
|
530
532
|
If you need more actions, please uhhh, notify me and skip that effect
|
|
531
533
|
|
|
532
|
-
Actions also have inputs with weird handling, I have made a template class for any effect that specifically wants the inputs for an
|
|
534
|
+
Actions also have inputs with weird handling, I have made a template class for any effect that specifically wants the inputs for an a_move but anything else is albeit possible, not short enough to be put on here so skip any effects that wants it
|
|
533
535
|
|
|
534
|
-
For me in the future, this requires updating
|
|
536
|
+
For me in the future, this requires updating ActionGenerator and changing the handling logic over in queenSystem
|
|
535
537
|
|
|
536
538
|
### Update effect registry
|
|
537
539
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qpremake",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "Remake of the qp engine in ts / js, with moddability in mind",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "node ./lib/testFile.js",
|
|
9
|
-
"build": "
|
|
9
|
+
"build": "IF EXIST \".\\lib\" RD /S /Q \".\\lib\" && tsc",
|
|
10
10
|
"dev": "npm run build && npm run test",
|
|
11
11
|
"prepublishOnly" : "npm run build"
|
|
12
12
|
},
|
|
@@ -29,11 +29,6 @@
|
|
|
29
29
|
"typescript": "^5.9.2",
|
|
30
30
|
"util": "^0.12.5"
|
|
31
31
|
},
|
|
32
|
-
"eslintConfig": {
|
|
33
|
-
"plugins": [
|
|
34
|
-
"local"
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
32
|
"files": [
|
|
38
33
|
"lib",
|
|
39
34
|
"README.md",
|
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = {
|
|
4
|
-
//generic symbols
|
|
5
|
-
yes: "YES",
|
|
6
|
-
no: "NO",
|
|
7
|
-
true: "TRUE",
|
|
8
|
-
false: "FALSE",
|
|
9
|
-
//operator names
|
|
10
|
-
o_null: "No operator",
|
|
11
|
-
o_aurora: "Aurora",
|
|
12
|
-
o_esper: "Esper",
|
|
13
|
-
o_idol: "Idol",
|
|
14
|
-
o_leo: "Leo",
|
|
15
|
-
o_queen: "Queen",
|
|
16
|
-
o_omega: "Omega",
|
|
17
|
-
o_kaia: "Dragoon",
|
|
18
|
-
//operator real names
|
|
19
|
-
o_real_aurora: "Alyssa Neskara",
|
|
20
|
-
o_real_esper: "Irene",
|
|
21
|
-
o_real_idol: "Lisa",
|
|
22
|
-
o_real_leo: "Leo",
|
|
23
|
-
o_real_queen: "Elaine Myras",
|
|
24
|
-
o_real_omega: "Kyril",
|
|
25
|
-
o_real_kaia: "Kaia",
|
|
26
|
-
//operator description, not filled
|
|
27
|
-
o_desc_aurora: "",
|
|
28
|
-
o_desc_esper: "",
|
|
29
|
-
o_desc_idol: "",
|
|
30
|
-
o_desc_leo: "",
|
|
31
|
-
o_desc_queen: "",
|
|
32
|
-
o_desc_omega: "",
|
|
33
|
-
o_desc_kaia: "",
|
|
34
|
-
//rarities
|
|
35
|
-
r_white: "<white> white </>",
|
|
36
|
-
r_blue: "<blue> blue </>",
|
|
37
|
-
r_green: "<green> green </>",
|
|
38
|
-
r_red: "<red> red </>",
|
|
39
|
-
r_ability: "<yellow> ability </>",
|
|
40
|
-
r_algo: "<purple> algo </>",
|
|
41
|
-
//archtype full names
|
|
42
|
-
//TODO : insert all
|
|
43
|
-
a_fruit: "All Natural",
|
|
44
|
-
a_legion: "Legion's Commanđ",
|
|
45
|
-
a_nova: "Supernova's Wake",
|
|
46
|
-
a_generic: "Generic",
|
|
47
|
-
a_other: "No archtype",
|
|
48
|
-
a_enemy: "Enemy",
|
|
49
|
-
a_boss: "Boss",
|
|
50
|
-
//UI element names
|
|
51
|
-
ui_catalog: "catalog",
|
|
52
|
-
ui_gallery: "gallery",
|
|
53
|
-
ui_play: "play",
|
|
54
|
-
ui_setting: "setting",
|
|
55
|
-
ui_credit: "credit",
|
|
56
|
-
//setting options:
|
|
57
|
-
//TODO : finish this when Setting is done
|
|
58
|
-
ui_s_language: "language",
|
|
59
|
-
ui_s_mods: "mods",
|
|
60
|
-
//helps
|
|
61
|
-
h_activate: "<green>[Click to activate]</>",
|
|
62
|
-
//errors
|
|
63
|
-
err_noActivate: "<yellow>[ will not activate ]</>",
|
|
64
|
-
err_notActiveTurn: "<red>[ card not active ]</>",
|
|
65
|
-
err_usedOnce: "<red>[</> <icon id=\"once\"></> <red>used ]</>",
|
|
66
|
-
err_disabled: "<red>[ disabled ]</>",
|
|
67
|
-
err_conditionNotMet: "<red>[ condition not met ]</>",
|
|
68
|
-
err_noValidTargets: "<yellow>[ no targets ]</>",
|
|
69
|
-
err_notLocation: "<red>[ cannot activate from this location ]</>",
|
|
70
|
-
err_noCounters: "<red>[ not enough counters ]</>",
|
|
71
|
-
err_tooManyCounters: "<red>[ too many counters ]</>",
|
|
72
|
-
err_noAttackPower: "<red>[ no attack power ]</>",
|
|
73
|
-
err_noSlots: "<red>[ no available field slots ]</>",
|
|
74
|
-
err_maxReached: "<yellow>[ max reached ]</>",
|
|
75
|
-
err_editNoAllow: "Not enough health.",
|
|
76
|
-
//keyword desc
|
|
77
|
-
key_desc_void: "<void/> - Voided cards are removed from play until the deck is RELOADED.",
|
|
78
|
-
key_desc_suspend: "<suspend/> - Delay the target, but does not make the target immune to further delays.",
|
|
79
|
-
key_desc_decompile: "<decompile/> - Send the card to the trash without destroying it. Does not claim loot on the target.",
|
|
80
|
-
key_desc_exposed: "<exposed/> - Card has no other card in front of it.",
|
|
81
|
-
key_desc_covered: "<cover/> - Card has another card in front of it.",
|
|
82
|
-
key_desc_automate: "<automate/> - Card acts on its own.",
|
|
83
|
-
key_desc_decaybuff: "<specialbuff>DECAY BUFF</> - Buff is reduced at the end of each turn.",
|
|
84
|
-
key_desc_singlebuff: "<specialbuff>SINGLE ATTACK BUFF</> - Buff is removed after attacking.",
|
|
85
|
-
key_desc_aligned: "<aligned/> - In the same column as this card.",
|
|
86
|
-
key_desc_pathed: "<pathed/> - There exists a continuous line of cards between two of your cards (excluding diagonals).",
|
|
87
|
-
key_desc_exec: "<exec/> - Activates when the card is executed, after the attack and before being sent to the grave",
|
|
88
|
-
key_void: "vOID",
|
|
89
|
-
key_suspend: "SUSPEND",
|
|
90
|
-
key_decompile: "COMPILE",
|
|
91
|
-
key_exposed: "EXPOSED",
|
|
92
|
-
key_covered: "COVER",
|
|
93
|
-
key_automate: "AUTOMATE",
|
|
94
|
-
key_aligned: "ALIGNED",
|
|
95
|
-
key_pathed: "PATHED",
|
|
96
|
-
key_exec: "EXECUTE",
|
|
97
|
-
key_decaybuff: "DECAY BUFF",
|
|
98
|
-
key_singlebuff: "SINGLE ATTACK BUFF",
|
|
99
|
-
//effect type/subtype name
|
|
100
|
-
//TODO : add more later once coded
|
|
101
|
-
e_t_none: "NO TYPE",
|
|
102
|
-
e_t_none_desc: "",
|
|
103
|
-
e_t_lock: "LOCK",
|
|
104
|
-
e_t_lock_desc: "You must do something in order to play this card from your hand manually.",
|
|
105
|
-
e_t_counter: "COUNTER",
|
|
106
|
-
e_t_counter_desc: "Dont do much, just a resource for other effects",
|
|
107
|
-
e_t_manual: "MANUAL",
|
|
108
|
-
e_t_manual_desc: "Click to activate. this card cannot attack afterwards.",
|
|
109
|
-
e_t_trigger: "TRIGGER",
|
|
110
|
-
e_t_trigger_desc: "Activates automatically when something specific happens. Does not take a turn.",
|
|
111
|
-
e_t_passive: "PASSIVE",
|
|
112
|
-
e_t_passive_desc: "Happens automatically, does not activate.",
|
|
113
|
-
e_t_status: "STATUS EFFECT",
|
|
114
|
-
e_t_status_desc: "Status effects are temporary effects.",
|
|
115
|
-
e_t_init: "INITIALIZE",
|
|
116
|
-
e_t_init_desc: "Activates when this card is played to the field.",
|
|
117
|
-
// effectTypeExec,"EXECUTE"
|
|
118
|
-
// effectTypeExec_desc,"Activates when this card is EXECUTED."
|
|
119
|
-
// effectTypeDestruction,"DESTRUCTION"
|
|
120
|
-
// effectTypeDestruction_desc,"Activates when this card is destroyed (DECOMPILE and EXECUTE do not count as destruction)."
|
|
121
|
-
// effectTypeVolatile,"VOLATILE"
|
|
122
|
-
// effectTypeVolatile_desc,"VOID thsis card when it leaves the field."
|
|
123
|
-
// effectTypeDefense,"DEFENSE"
|
|
124
|
-
// effectTypeDefense_desc,"This card cannot take more than a certain amount of damage at once."
|
|
125
|
-
// effectTypeDragoon,"DRAGOON'S LINK"
|
|
126
|
-
// effectTypeDragoon_desc,"Programs created from the same Dragoon are linked."
|
|
127
|
-
// effectTypeSingle,"CONSUMABLE"
|
|
128
|
-
// effectTypeSingle_desc,"After this card uses its effect, remove it from the game and your decklist."
|
|
129
|
-
// effectTypeArtifact,"PRELOAD"
|
|
130
|
-
// effectTypeArtifact_desc,"This card starts in your hand."
|
|
131
|
-
// effectTypeStorage,"CACHED"
|
|
132
|
-
// effectTypeStorage_desc,"This effect applies while this card is in Storage."
|
|
133
|
-
// effectFlagBonded,"BONDED"
|
|
134
|
-
// effectFlagBonded_desc,"This effect cannot be removed."
|
|
135
|
-
e_st_chained: "CHAINED",
|
|
136
|
-
e_st_chained_desc: "This effect chains directly to the event that triggered it.",
|
|
137
|
-
e_st_delayed: "DELAYED",
|
|
138
|
-
e_st_delayed_desc: "This effects chains to the event that triggers it, but activates after that event resolves.",
|
|
139
|
-
e_st_unique: "UNIQUE",
|
|
140
|
-
e_st_unique_desc: "This effect can only activate once per copy of this card in a turn.",
|
|
141
|
-
e_st_hardUnique: "HARD_UNIQUE",
|
|
142
|
-
e_st_hardUnique_desc: "This effect can only activate once across all copies of this card in a turn.",
|
|
143
|
-
e_st_instant: "INSTANT",
|
|
144
|
-
e_st_instant_desc: "This effect does not take a turn to activate.",
|
|
145
|
-
e_st_once: "ONCE",
|
|
146
|
-
e_st_once_desc: "This effect can only be activated once.",
|
|
147
|
-
e_st_fieldLock: "FIELD_LOCK",
|
|
148
|
-
e_st_fieldLock_desc: "This card has to be on the field to activate this effect.",
|
|
149
|
-
e_st_handOrFieldLock: "FIELD_OR_HAND_LOCK",
|
|
150
|
-
e_st_handOrFieldLock_desc: "This card has to be on the field or in hand to activate this effect.",
|
|
151
|
-
e_st_graveLock: "GRAVE_LOCK",
|
|
152
|
-
e_st_graveLock_desc: "This card has to be on the grave to activate this effect.",
|
|
153
|
-
//card extension
|
|
154
|
-
//TODO : fill this in,
|
|
155
|
-
ex_fruit: "fruit",
|
|
156
|
-
ex_legion: "legion",
|
|
157
|
-
ex_nova: "nova",
|
|
158
|
-
ex_generic: "generic",
|
|
159
|
-
//cardID -> cardName, except the extension part
|
|
160
|
-
//TODO : fill this in, only simple fruits for now
|
|
161
|
-
c_blank: "Blank",
|
|
162
|
-
c_knife: "Knife",
|
|
163
|
-
c_quantum_sigil: "QuantumSigil",
|
|
164
|
-
c_sentry: "Sentry",
|
|
165
|
-
c_stagemarker: "StageMarker",
|
|
166
|
-
c_security: "Security",
|
|
167
|
-
c_objective_data: "Data",
|
|
168
|
-
c_active: "ACTIVE",
|
|
169
|
-
c_dummy: "Dummy",
|
|
170
|
-
c_loot_dummy: "Dummy",
|
|
171
|
-
c_lock_core: "Core",
|
|
172
|
-
c_machine_block: "MachineBlock",
|
|
173
|
-
c_machine_coin: "MachineCoin",
|
|
174
|
-
c_brain_queen: "Brain",
|
|
175
|
-
c_story_oxygen: "O",
|
|
176
|
-
c_story_hydrogen: "H",
|
|
177
|
-
c_story_backdoor: "Backdoor",
|
|
178
|
-
c_flower_hologram: "Hologram",
|
|
179
|
-
c_stagemark: "Stagemark",
|
|
180
|
-
c_firewall: "Firewall",
|
|
181
|
-
c_target: "Target",
|
|
182
|
-
c_curse: "Curse",
|
|
183
|
-
c_dark_power: "DarkPower",
|
|
184
|
-
c_zira_defeat: "Zira",
|
|
185
|
-
c_legion_token: "Clone",
|
|
186
|
-
c_bug_passive: "Bug",
|
|
187
|
-
c_strong_bug: "Bug",
|
|
188
|
-
c_nova_protean: "Protean",
|
|
189
|
-
c_test: "Debug",
|
|
190
|
-
c_after_burner: "Afterburner",
|
|
191
|
-
c_battery: "Battery",
|
|
192
|
-
c_flash_bang: "Flashbang",
|
|
193
|
-
c_cinder: "Cinder",
|
|
194
|
-
c_ember: "Ember",
|
|
195
|
-
c_capacitor: "DamageCapacitor",
|
|
196
|
-
c_apple: "Apple",
|
|
197
|
-
c_banana: "Banana",
|
|
198
|
-
c_cherry: "Cherry",
|
|
199
|
-
c_lemon: "Lemon",
|
|
200
|
-
c_pomegranate: "Pomegranate",
|
|
201
|
-
c_pumpkin: "Pumpkin",
|
|
202
|
-
c_pollinate: "Pollinate",
|
|
203
|
-
c_greenhouse: "Greenhouse",
|
|
204
|
-
c_growth: "Growth",
|
|
205
|
-
c_spring: "Spring",
|
|
206
|
-
c_summer: "Summer",
|
|
207
|
-
c_autumn: "Autumn",
|
|
208
|
-
c_winter: "Winter",
|
|
209
|
-
c_demeter: "Demeter",
|
|
210
|
-
c_persephone: "Persephone",
|
|
211
|
-
//effectID -> display XML
|
|
212
|
-
e_apple: `Add <uadd>up to</> =a <uadd>cards</><uminus>card</> with the same name as this card from your deck to your hand`,
|
|
213
|
-
e_lemon: "Attack with all cards on your field with the same name as this card.",
|
|
214
|
-
e_pomegranate: `If this card is sent to the trash, deal =a damage to all <exposed/> enemies and =b damage to all <cover/> enemies`,
|
|
215
|
-
e_banana: `Target 1 level 1 [.fruit] card in your trash (except cards whose name are the same as this card's). Play it to the field.`,
|
|
216
|
-
e_pumpkin: `Increase the health of all cards on your field with the same name as this card by =b.`,
|
|
217
|
-
e_quick: "This card does not take a turn to play to the field.",
|
|
218
|
-
e_draw: `Draw =a cards, this is =c == 0 ? "NOT" : ""; treated as a Turn draw.`,
|
|
219
|
-
e_attack: `Attack =a times.`,
|
|
220
|
-
e_fragile: `If this card attacks, destroy it afterwards.`,
|
|
221
|
-
//zone names
|
|
222
|
-
z_deck: "Deck",
|
|
223
|
-
z_field: "Field",
|
|
224
|
-
z_grave: "GY",
|
|
225
|
-
z_hand: "Hand",
|
|
226
|
-
z_void: "Void",
|
|
227
|
-
z_ability: "Ability card zone",
|
|
228
|
-
z_system: "System",
|
|
229
|
-
z_storage: "Storage",
|
|
230
|
-
z_drop: "Drop zone",
|
|
231
|
-
//Log command
|
|
232
|
-
//action names
|
|
233
|
-
l_turnStart: "turnStart",
|
|
234
|
-
l_turnReset: "turnReset",
|
|
235
|
-
l_turnEnd: "turnEnd",
|
|
236
|
-
l_posChange: "posChange",
|
|
237
|
-
l_drawAction: "drawAction",
|
|
238
|
-
l_activateEffect: "activateEffect",
|
|
239
|
-
l_shuffle: "shuffle",
|
|
240
|
-
l_addStatusEffect: "addStatusEffect",
|
|
241
|
-
l_removeStatusEffect: "removeStatusEffect",
|
|
242
|
-
l_activateEffectSubtypeSpecificFunc: "activateEffectSubtypeSpecificFunc",
|
|
243
|
-
l_modifyAnotherAction: "modifyAnotherAction",
|
|
244
|
-
l_increaseTurnCount: "increaseTurnCount",
|
|
245
|
-
l_setThreatLevel: "setThreatLevel",
|
|
246
|
-
l_doThreatLevelBurn: "doThreatLevelBurn",
|
|
247
|
-
l_forcefullyEndTheGame: "forcefullyEndTheGame",
|
|
248
|
-
l_nullAction: "nullAction",
|
|
249
|
-
l_internalActivateEffectSignal: "[internal action] activateEffectSignal",
|
|
250
|
-
l_freeUpStatusIDs: "[internal action] free up status ids",
|
|
251
|
-
//Preset-deck names ? Maybe no need
|
|
252
|
-
//maybe just rewrite this whole section
|
|
253
|
-
d_null_deck: "Not a deck",
|
|
254
|
-
d_all_lemons: "Oops, all lemon!",
|
|
255
|
-
d_all_apples: "Oops, all apples!",
|
|
256
|
-
d_natural: "All Natural",
|
|
257
|
-
d_queenIntro: "Queen's Kit 1",
|
|
258
|
-
d_esperIntro: "All Natural",
|
|
259
|
-
d_auroraIntro: "Sakura Bloom",
|
|
260
|
-
d_leoIntro: "Mech Mayhem",
|
|
261
|
-
d_idolIntro: "Performing Art",
|
|
262
|
-
d_esperPuzzle1: "Puzzle Kit",
|
|
263
|
-
d_auroraReprogram: "Puzzle Kit",
|
|
264
|
-
d_auroraStarter1: "Sakura MKI",
|
|
265
|
-
d_idolStarter1: "Performing Art",
|
|
266
|
-
d_esperStarter1: "All Natural",
|
|
267
|
-
d_queenChess: "Checkmate",
|
|
268
|
-
d_esperDungeon1: "All Natural",
|
|
269
|
-
d_esperDungeon2: "Year's End",
|
|
270
|
-
d_esperDungeon3: "Magna Magicae",
|
|
271
|
-
d_auroraDungeon1: "Sakura Bloom",
|
|
272
|
-
d_auroraDungeonSpirit: "Spirit Calling",
|
|
273
|
-
d_idolDungeon1: "Center Stage",
|
|
274
|
-
d_idolDungeonMahou: "Trial of Heart",
|
|
275
|
-
d_leoDungeon1: "Mech Mayhem",
|
|
276
|
-
d_dragoonDungeon1: "Old and New",
|
|
277
|
-
d_dragoonDungeon2: "Stronger Together",
|
|
278
|
-
d_dragoonDungeonInf: "Infinite Curiosity",
|
|
279
|
-
d_omegaDungeon1: "Legion's Command",
|
|
280
|
-
d_collabEden: "Eden's Edge",
|
|
281
|
-
d_collabCross: "World Seekers",
|
|
282
|
-
d_collabVault: "Void's Vault",
|
|
283
|
-
d_collabNova: "Supernova's Wake",
|
|
284
|
-
d_auroraSide1: "Sakura MKII",
|
|
285
|
-
d_queenSide1: "Queen's Royal",
|
|
286
|
-
d_queenOmegaDuel: "Queen's Royal",
|
|
287
|
-
d_idolSide1: "Live Performance",
|
|
288
|
-
d_idolSide2: "Live Performance",
|
|
289
|
-
d_dragoonStory1: "Myths and Legends",
|
|
290
|
-
d_dragoonStoryFlame: "The Flame",
|
|
291
|
-
d_esperSide1: "Presentation Kit",
|
|
292
|
-
d_esperSide2: "Presentation Kit?",
|
|
293
|
-
d_leoSide1: "Mech Kit",
|
|
294
|
-
d_leoSide2: "Fire Kit",
|
|
295
|
-
d_idolExPuzzle1: "Puzzle Kit",
|
|
296
|
-
d_leoExPuzzle1: "Puzzle Kit",
|
|
297
|
-
d_exPuzzleMage: "Puzzle Kit",
|
|
298
|
-
d_collabEdenDemo: "Eden's Edge",
|
|
299
|
-
d_collabCrossDemo: "World Seekers",
|
|
300
|
-
d_collabVaultDemo: "Void's Vault",
|
|
301
|
-
d_collabNovaDemo: "Supernova's Wake",
|
|
302
|
-
//TODO : fill this in once we do story or dialog or tutorials
|
|
303
|
-
//Story dialog
|
|
304
|
-
//Tutorial
|
|
305
|
-
//Ability unlocks
|
|
306
|
-
//Credits
|
|
307
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DisplayComponent, ParserModule, moduleInputObject, parseOptions } from '../../types/abstract/parser';
|
|
2
|
-
export default class addSymbolModule extends ParserModule {
|
|
3
|
-
cmdName: string[];
|
|
4
|
-
requiredAttr: string[][];
|
|
5
|
-
doCheckRequiredAttr: boolean;
|
|
6
|
-
evaluate(cmd: string, args: moduleInputObject, option: parseOptions, raw: string): DisplayComponent[];
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const parser_1 = require("../../types/abstract/parser");
|
|
4
|
-
class addSymbolModule extends parser_1.ParserModule {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.cmdName = ['symbol'];
|
|
8
|
-
this.requiredAttr = [["id"]];
|
|
9
|
-
this.doCheckRequiredAttr = true;
|
|
10
|
-
}
|
|
11
|
-
evaluate(cmd, args, option, raw) {
|
|
12
|
-
let x = args.getAttr("id");
|
|
13
|
-
if (!x)
|
|
14
|
-
return [];
|
|
15
|
-
return [new parser_1.SymbolComponent(x, undefined, "symbol", raw).addSectionID(x)];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.default = addSymbolModule;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ParserModule, moduleInputObject, parseOptions } from '../../types/abstract/parser';
|
|
2
|
-
export default class expressionModule extends ParserModule {
|
|
3
|
-
cmdName: string[];
|
|
4
|
-
requiredAttr: string[][];
|
|
5
|
-
doCheckRequiredAttr: boolean;
|
|
6
|
-
evaluate(cmd: string, args: moduleInputObject, option: parseOptions, raw: string): any;
|
|
7
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const expression_parser_1 = __importDefault(require("./expression_parser"));
|
|
7
|
-
const parser_1 = require("../../types/abstract/parser");
|
|
8
|
-
const util_1 = __importDefault(require("util"));
|
|
9
|
-
class expressionModule extends parser_1.ParserModule {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.cmdName = ['expression', "expr", "ex"];
|
|
13
|
-
this.requiredAttr = [["expr"]];
|
|
14
|
-
this.doCheckRequiredAttr = false;
|
|
15
|
-
}
|
|
16
|
-
evaluate(cmd, args, option, raw) {
|
|
17
|
-
let expr = args.getAttr("expr");
|
|
18
|
-
if (!expr)
|
|
19
|
-
expr = this.try_collapse_child_to_text(args);
|
|
20
|
-
if (!expr)
|
|
21
|
-
return [new parser_1.TextComponent("", "No expr", cmd, raw)];
|
|
22
|
-
expression_parser_1.default.bindVariables(option.inputNumber, option.inputString);
|
|
23
|
-
try {
|
|
24
|
-
const parse_result = expression_parser_1.default.parse(expr);
|
|
25
|
-
// const debug = parse_result.flatMap(r =>
|
|
26
|
-
// r ? r.toString().split("\n").map(str => new textComponent(str, undefined, cmd, raw)) : []
|
|
27
|
-
// )
|
|
28
|
-
const eval_result = parse_result.map(expr => expr.evaluate(expression_parser_1.default)[0]);
|
|
29
|
-
const flattened_parse_result = expression_parser_1.default.flattenExpressions(eval_result);
|
|
30
|
-
const res = flattened_parse_result.map(e => {
|
|
31
|
-
if (typeof e === "string") {
|
|
32
|
-
return new parser_1.TextComponent(e, undefined, cmd, raw);
|
|
33
|
-
}
|
|
34
|
-
return e;
|
|
35
|
-
});
|
|
36
|
-
// res.unshift(...debug)
|
|
37
|
-
// res.unshift(new textComponent(`Parsed Len : ${res.length}`, undefined, cmd, raw))
|
|
38
|
-
return res;
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
return util_1.default.format(e).split("\n").map(str => new parser_1.TextComponent("", str, cmd, raw));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.default = expressionModule;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
interface I_evaluator {
|
|
2
|
-
evaluate_unary(expr: UnaryExpression): Expression;
|
|
3
|
-
evaluate_binary(expr: BinaryExpression): Expression;
|
|
4
|
-
evaluate_ternary(expr: TernaryExpression): Expression;
|
|
5
|
-
evaluate_postfix(expr: PostfixExpression): Expression;
|
|
6
|
-
evaluate_value(expr: ValueExpression): Expression;
|
|
7
|
-
}
|
|
8
|
-
declare class Expression {
|
|
9
|
-
operator: Token;
|
|
10
|
-
operands: Expression[];
|
|
11
|
-
constructor(operator: Token, operands: Expression[]);
|
|
12
|
-
get numOperands(): number;
|
|
13
|
-
toString(): string;
|
|
14
|
-
protected get collapsible(): boolean;
|
|
15
|
-
evaluate(evaluator: I_evaluator): [Expression, boolean];
|
|
16
|
-
}
|
|
17
|
-
declare class ValueExpression extends Expression {
|
|
18
|
-
constructor(val: Token);
|
|
19
|
-
}
|
|
20
|
-
declare class UnaryExpression extends Expression {
|
|
21
|
-
constructor(operator: Token, operand: Expression);
|
|
22
|
-
}
|
|
23
|
-
declare class BinaryExpression extends Expression {
|
|
24
|
-
get left(): Expression;
|
|
25
|
-
get right(): Expression;
|
|
26
|
-
constructor(operator: Token, left: Expression, right: Expression);
|
|
27
|
-
}
|
|
28
|
-
declare class TernaryExpression extends Expression {
|
|
29
|
-
get cond(): Expression;
|
|
30
|
-
get left(): Expression;
|
|
31
|
-
get right(): Expression;
|
|
32
|
-
constructor(operator: Token, cond: Expression, left: Expression, right: Expression);
|
|
33
|
-
}
|
|
34
|
-
declare class PostfixExpression extends Expression {
|
|
35
|
-
constructor(operator: Token, left: Expression);
|
|
36
|
-
}
|
|
37
|
-
declare enum TokenType {
|
|
38
|
-
immutable = 0,
|
|
39
|
-
value_number = 1,
|
|
40
|
-
value_string = 2,
|
|
41
|
-
equals = 3,
|
|
42
|
-
not_equals = 4,
|
|
43
|
-
lesser = 5,
|
|
44
|
-
greater = 6,
|
|
45
|
-
lesser_or_equal = 7,
|
|
46
|
-
greater_or_equal = 8,
|
|
47
|
-
negation = 9,
|
|
48
|
-
or = 10,
|
|
49
|
-
and = 11,
|
|
50
|
-
shift_left = 12,
|
|
51
|
-
shift_right = 13,
|
|
52
|
-
plus = 14,
|
|
53
|
-
minus = 15,
|
|
54
|
-
mul = 16,
|
|
55
|
-
div = 17,
|
|
56
|
-
slice_or_round_to_precision = 18,//..
|
|
57
|
-
forced_concat = 19,
|
|
58
|
-
bracket_open = 20,
|
|
59
|
-
bracket_end = 21,
|
|
60
|
-
question_mark = 22,
|
|
61
|
-
colon = 23,
|
|
62
|
-
EOF = 24
|
|
63
|
-
}
|
|
64
|
-
declare enum StringEncapsulation {
|
|
65
|
-
double_quote = -100,
|
|
66
|
-
single_quote = -99,
|
|
67
|
-
tick_mark = -98
|
|
68
|
-
}
|
|
69
|
-
declare class Token {
|
|
70
|
-
readonly type: TokenType;
|
|
71
|
-
readonly str: string;
|
|
72
|
-
immutable?: any | undefined;
|
|
73
|
-
constructor(type: TokenType, str: string, immutable?: any | undefined);
|
|
74
|
-
}
|
|
75
|
-
interface I_Parser {
|
|
76
|
-
pop(): Token | undefined;
|
|
77
|
-
peek(): Token | undefined;
|
|
78
|
-
assertNext(type: TokenType): void;
|
|
79
|
-
nextPrecedence(): number;
|
|
80
|
-
next(precedence: number): Expression;
|
|
81
|
-
}
|
|
82
|
-
interface I_ParseRule_No_Pre {
|
|
83
|
-
parse(parser: I_Parser, token: Token): Expression;
|
|
84
|
-
}
|
|
85
|
-
interface I_ParseRule_Has_Pre {
|
|
86
|
-
parse(parser: I_Parser, left: Expression, token: Token): Expression;
|
|
87
|
-
get precedence(): number;
|
|
88
|
-
}
|
|
89
|
-
declare class Parser implements I_Parser, I_evaluator {
|
|
90
|
-
private TokenDictionary;
|
|
91
|
-
private allTokens;
|
|
92
|
-
constructor();
|
|
93
|
-
addToken(str: string, type: TokenType | StringEncapsulation): void;
|
|
94
|
-
private splitAndInsert;
|
|
95
|
-
private splitStringByTokens;
|
|
96
|
-
tokenize(expr: string | (string | any)[], coerseUnknownToString?: boolean): Token[];
|
|
97
|
-
private preparse_rule;
|
|
98
|
-
private normal_rule;
|
|
99
|
-
registerUnaryRule(token: TokenType): void;
|
|
100
|
-
registerBinaryRule(token: TokenType, precedence: Precedence): void;
|
|
101
|
-
registerValueRule(token: TokenType): void;
|
|
102
|
-
registerRule(noPre: true, token: TokenType, rule: I_ParseRule_No_Pre): void;
|
|
103
|
-
registerRule(noPre: false, token: TokenType, rule: I_ParseRule_Has_Pre): void;
|
|
104
|
-
private tokens;
|
|
105
|
-
pop(expect?: TokenType): Token | undefined;
|
|
106
|
-
assertNext(type: TokenType): void;
|
|
107
|
-
peek(): Token | undefined;
|
|
108
|
-
nextPrecedence(): number;
|
|
109
|
-
private errorStr;
|
|
110
|
-
parse(expr: Parameters<typeof this["tokenize"]>[0]): Expression[];
|
|
111
|
-
next(basePrecedence?: Precedence): Expression;
|
|
112
|
-
private num_var;
|
|
113
|
-
private string_var;
|
|
114
|
-
bindVariables(num_var: number[], string_var: string[]): void;
|
|
115
|
-
evaluate_value(expr: ValueExpression): Expression;
|
|
116
|
-
evaluate_unary(expr: UnaryExpression): Expression;
|
|
117
|
-
evaluate_binary(expr: BinaryExpression): Expression;
|
|
118
|
-
evaluate_ternary(expr: TernaryExpression): Expression;
|
|
119
|
-
evaluate_postfix(expr: PostfixExpression): Expression;
|
|
120
|
-
flattenExpressions<T>(exprs: Expression[]): (string | T)[];
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Precedence is how far the rercursive call inside a rule is allowed to go
|
|
124
|
-
* the parser will keep consuming until the next precedence is lower than the starting value
|
|
125
|
-
* so if we pass in
|
|
126
|
-
* a) next(precedence of sum) -> everything lower than sum is consumed into the return result
|
|
127
|
-
* b) next(parser.nextPrecedence()) -> everything lower than the next expression's precedence is consumed
|
|
128
|
-
* */
|
|
129
|
-
declare enum Precedence {
|
|
130
|
-
min = 0,
|
|
131
|
-
immutable = 1,
|
|
132
|
-
cond_right_associative = 2,
|
|
133
|
-
cond = 3,
|
|
134
|
-
slightly_less_than_arithmetic = 4,
|
|
135
|
-
sum = 5,
|
|
136
|
-
product = 6,
|
|
137
|
-
exponent = 7,
|
|
138
|
-
bit_manip = 8,
|
|
139
|
-
prefix = 9,
|
|
140
|
-
postfix = 10
|
|
141
|
-
}
|
|
142
|
-
declare const DefParser: Parser;
|
|
143
|
-
export default DefParser;
|