refactor: enforce mandatory brackets for composite values
Implements Phase 1 and 2 of the syntax rework plan: - Brackets `[]` are now mandatory for all tuple and array values. - Removed the `[Type][]` array syntax; arrays now only use `Type[]`. - `[single]` is now strictly a 1-tuple rather than an array. - Updated documentation and test fixtures to reflect these breaking changes.
This commit is contained in:
@@ -3,5 +3,5 @@
|
||||
|
||||
id,type,name,description,enemies,dialogue
|
||||
string,EncounterType,string,string,EnemyList,string
|
||||
cactus_pair,minion,仙人掌怪,概念:防+强化。【尖刺X】:对攻击者造成X点伤害。,[仙人掌怪;12;[]];[仙人掌怪;12;[]],
|
||||
snake_pair,minion,蛇,概念:攻+强化。给玩家塞入蛇毒牌(1费:打出时移除此牌。弃掉时受到3点伤害)。,[蛇;10;[[poison;2];[quick;1]]],
|
||||
cactus_pair,minion,仙人掌怪,概念:防+强化。【尖刺X】:对攻击者造成X点伤害。,[[仙人掌怪;12;[]];[仙人掌怪;12;[]]],
|
||||
snake_pair,minion,蛇,概念:攻+强化。给玩家塞入蛇毒牌(1费:打出时移除此牌。弃掉时受到3点伤害)。,[[蛇;10;[[poison;2];[quick;1]]]],
|
||||
|
||||
|
@@ -4,4 +4,4 @@
|
||||
|
||||
id,enemy,initialIntent,nextIntents,brokenIntent,effects
|
||||
string,string,boolean,string[],string[],IntentEffects
|
||||
仙人掌怪-boost,仙人掌怪,true,仙人掌怪-boost;仙人掌怪-defend,,[user;spike;1];[user;defend;4]
|
||||
仙人掌怪-boost,仙人掌怪,true,[仙人掌怪-boost;仙人掌怪-defend],,[[user;spike;1];[user;defend;4]]
|
||||
|
||||
|
@@ -209,7 +209,7 @@ describe("parseCsv - type declarations", () => {
|
||||
"# type IntentEffects = IntentEffect[]",
|
||||
"id,effects",
|
||||
"string,IntentEffects",
|
||||
"boost,[user;spike;1];[user;defend;4]",
|
||||
"boost,[[user;spike;1];[user;defend;4]]",
|
||||
].join("\n");
|
||||
|
||||
const result = parseCsv(csv, { emitTypes: false });
|
||||
@@ -233,7 +233,7 @@ describe("parseCsv - type declarations", () => {
|
||||
"# type IntentEffects = IntentEffect[]",
|
||||
"id,effects",
|
||||
"string,IntentEffects",
|
||||
"boost,[user;spike;1];[user;defend;4]",
|
||||
"boost,[[user;spike;1];[user;defend;4]]",
|
||||
].join("\n");
|
||||
|
||||
const result = parseCsv(csv, {
|
||||
@@ -260,7 +260,7 @@ describe("parseCsv - type declarations", () => {
|
||||
'# type Type = "apple" | "orange"',
|
||||
"id,items",
|
||||
"string,[Type; int][]",
|
||||
"001,[apple;2];[orange;3]",
|
||||
"001,[[apple;2];[orange;3]]",
|
||||
].join("\n");
|
||||
|
||||
const result = parseCsv(csv, { emitTypes: false });
|
||||
@@ -292,7 +292,7 @@ describe("parseCsv - type declarations", () => {
|
||||
"# type Entry = [@user]",
|
||||
"id,entry",
|
||||
"string,Entry",
|
||||
"1,1",
|
||||
"1,[1]",
|
||||
].join("\n");
|
||||
|
||||
const result = parseCsv(csv, {
|
||||
|
||||
Reference in New Issue
Block a user