Skip to content

Commit ee145c5

Browse files
committed
Remove a couple parser workarounds that are no longer necessary
1 parent 459d007 commit ee145c5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

json_parser/parser.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ function parseType(type: FactorioType | undefined, indent: string, parent?: Fact
153153
// workaround for a LuaControlBehavior.type
154154
// 1.1.108 hoisted the `type` subkey from `control_behavior` to its own root define type, but it is still referenced in this type
155155
// seems like a bug in the spec docs. Check back on this in future versions.
156+
// https://forums.factorio.com/viewtopic.php?f=233&t=113710
156157
if(type === 'defines.control_behavior.type') {
157158
return 'defines.type';
158159
}
@@ -242,11 +243,6 @@ function parseType(type: FactorioType | undefined, indent: string, parent?: Fact
242243
}
243244
let paramStrings = parent.properties.map((p, index) => {
244245
let str = p.name;
245-
246-
// at least one type (CircularProjectileCreationSpecification) has multiple properties named _, so differentiate them since that's not valid TS
247-
if(str === '_') {
248-
str = '_' + index;
249-
}
250246

251247
if(/-/.test(str)) {
252248
str = `'${str}'`
@@ -645,12 +641,6 @@ function writePrototypeTypes(apiData: PrototypeData, apiVersion: string) {
645641

646642
for(let typeData of apiData.types)
647643
{
648-
// As far as I can tell, Resistances is improperly documented and should be an array
649-
if(typeData.name === 'Resistances')
650-
{
651-
typeData.type = { complex_type: 'array', value: typeData.type };
652-
}
653-
654644
if(typeData.type === 'builtin')
655645
{
656646
var mapped = mapBuiltin(typeData.name);

0 commit comments

Comments
 (0)