From d55c3fb0931f404b749f633696aa1a4216e6ba1e Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Sun, 29 Mar 2026 10:02:24 +0200 Subject: [PATCH 01/10] jbfl: add NoComplexNewLine rules for driveModes, mirrors, soundscape, camerasInternal Add selectors for driveModes.defaultSettings[*], driveModes.modes.*.settings[*], mirrors[*], soundscape[*], and camerasInternal[*] to both minimal and complex JBFL configs. These sections contain inline objects that should stay on one line. Also adds the corresponding child-path rules for PreserveNumberFormat. --- examples/jbfl/complex.jbfl | 17 +++++++++++++++-- examples/jbfl/minimal.jbfl | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/examples/jbfl/complex.jbfl b/examples/jbfl/complex.jbfl index 3aea6111..3bc009cf 100644 --- a/examples/jbfl/complex.jbfl +++ b/examples/jbfl/complex.jbfl @@ -23,7 +23,11 @@ .*.mainEngine.burnEfficiency[*], .*.mainEngine.torqueModIntake[*], .*.mainEngine.torqueModMult[*], -.*.powertrain[*], .*.flexbodies[*] { +.*.powertrain[*], .*.flexbodies[*], +.*.driveModes.defaultSettings[*], +.*.driveModes.modes.*.settings[*], +.*.mirrors[*], .*.soundscape[*], +.*.camerasInternal[*] { PreserveNumberFormat : true; NoComplexNewLine : true; } @@ -38,7 +42,16 @@ .*.slots2[*].*, .*.slots2[*][*].*, .*.props[*].*, .*.props[*][*].*, .*.flexbodies[*].*, -.*.flexbodies[*][*].* { +.*.flexbodies[*][*].*, +.*.driveModes.defaultSettings[*].*, +.*.driveModes.defaultSettings[*][*].*, +.*.driveModes.modes.*.settings[*].*, +.*.driveModes.modes.*.settings[*][*].*, +.*.mirrors[*].*, .*.mirrors[*][*].*, +.*.soundscape[*].*, +.*.soundscape[*][*].*, +.*.camerasInternal[*].*, +.*.camerasInternal[*][*].* { PreserveNumberFormat : true; NoComplexNewLine : true; } diff --git a/examples/jbfl/minimal.jbfl b/examples/jbfl/minimal.jbfl index 65566427..a3935658 100644 --- a/examples/jbfl/minimal.jbfl +++ b/examples/jbfl/minimal.jbfl @@ -25,7 +25,11 @@ .*.mainEngine.burnEfficiency[*], .*.mainEngine.torqueModIntake[*], .*.mainEngine.torqueModMult[*], -.*.powertrain[*], .*.flexbodies[*] { +.*.powertrain[*], .*.flexbodies[*], +.*.driveModes.defaultSettings[*], +.*.driveModes.modes.*.settings[*], +.*.mirrors[*], .*.soundscape[*], +.*.camerasInternal[*] { PreserveNumberFormat : true; NoComplexNewLine : true; } @@ -40,7 +44,16 @@ .*.slots2[*].*, .*.slots2[*][*].*, .*.props[*].*, .*.props[*][*].*, .*.flexbodies[*].*, -.*.flexbodies[*][*].* { +.*.flexbodies[*][*].*, +.*.driveModes.defaultSettings[*].*, +.*.driveModes.defaultSettings[*][*].*, +.*.driveModes.modes.*.settings[*].*, +.*.driveModes.modes.*.settings[*][*].*, +.*.mirrors[*].*, .*.mirrors[*][*].*, +.*.soundscape[*].*, +.*.soundscape[*][*].*, +.*.camerasInternal[*].*, +.*.camerasInternal[*][*].* { PreserveNumberFormat : true; NoComplexNewLine : true; } From 0809e1465b03a83978c9cfefc5515a89d1d49a04 Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Sun, 29 Mar 2026 10:29:10 +0200 Subject: [PATCH 02/10] jbfl: add AutoPad for slots, slots2, and props BeamNG files use carefully column-aligned slot and prop tables. Without AutoPad these sections lose alignment after formatting. --- examples/jbfl/complex.jbfl | 3 ++- examples/jbfl/minimal.jbfl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/jbfl/complex.jbfl b/examples/jbfl/complex.jbfl index 3bc009cf..2eb22839 100644 --- a/examples/jbfl/complex.jbfl +++ b/examples/jbfl/complex.jbfl @@ -8,7 +8,8 @@ } .*.nodes, .*.beams, -.*.triangles { +.*.triangles, .*.slots, +.*.slots2, .*.props { AutoPad : true; } diff --git a/examples/jbfl/minimal.jbfl b/examples/jbfl/minimal.jbfl index a3935658..b17e6e67 100644 --- a/examples/jbfl/minimal.jbfl +++ b/examples/jbfl/minimal.jbfl @@ -7,7 +7,8 @@ } .*.nodes, .*.beams, -.*.triangles { +.*.triangles, .*.slots, +.*.slots2, .*.props { AutoPad: true; } From 4097706764b94bdf78b3d07cb26b7e5cbaef844e Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Sun, 29 Mar 2026 14:37:49 +0200 Subject: [PATCH 03/10] jbfl: add config object selectors for gearbox, turbocharger, etc. Add ForceComplexNewLine + AlignObjectKeys + PreserveNumberFormat for gearbox, clutch, turbocharger, vehicleController, radiator, waterDamage, engineBlock, gauges, gauges.configuration, and gauges.displayData. Add child selectors with ComplexNewLine: None to keep inner arrays inline. Also add mainEngine.torqueCompressionBrake[*]. --- examples/jbfl/complex.jbfl | 13 ++++++++++++- examples/jbfl/minimal.jbfl | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/examples/jbfl/complex.jbfl b/examples/jbfl/complex.jbfl index e77c6000..2cc00051 100644 --- a/examples/jbfl/complex.jbfl +++ b/examples/jbfl/complex.jbfl @@ -24,7 +24,13 @@ .*.mainEngine.burnEfficiency[*], .*.mainEngine.torqueModIntake[*], .*.mainEngine.torqueModMult[*], +.*.mainEngine.torqueCompressionBrake[*], .*.powertrain[*], .*.flexbodies[*], +.*.gearbox.*, .*.clutch.*, +.*.turbocharger.*, +.*.vehicleController.*, +.*.radiator.*, .*.waterDamage.*, +.*.engineBlock.*, .*.driveModes.defaultSettings[*], .*.driveModes.modes.*.settings[*], .*.mirrors[*], .*.soundscape[*], @@ -64,7 +70,12 @@ .*.mainEngine, .*.sounds, .*.soundConfig, .*.soundConfigExhaust, -.*.information, +.*.information, .*.gearbox, +.*.clutch, .*.turbocharger, +.*.vehicleController, .*.radiator, +.*.waterDamage, .*.engineBlock, +.*.gauges, .*.gauges.configuration, +.*.gauges.displayData, .*.glowMap.dumptruck_gaugelight_warning, .*.glowMap.chassis_gaugelight_warning { ComplexNewLine: Force; diff --git a/examples/jbfl/minimal.jbfl b/examples/jbfl/minimal.jbfl index a133b9c5..c5d6e434 100644 --- a/examples/jbfl/minimal.jbfl +++ b/examples/jbfl/minimal.jbfl @@ -26,7 +26,13 @@ .*.mainEngine.burnEfficiency[*], .*.mainEngine.torqueModIntake[*], .*.mainEngine.torqueModMult[*], +.*.mainEngine.torqueCompressionBrake[*], .*.powertrain[*], .*.flexbodies[*], +.*.gearbox.*, .*.clutch.*, +.*.turbocharger.*, +.*.vehicleController.*, +.*.radiator.*, .*.waterDamage.*, +.*.engineBlock.*, .*.driveModes.defaultSettings[*], .*.driveModes.modes.*.settings[*], .*.mirrors[*], .*.soundscape[*], @@ -61,7 +67,12 @@ .*.mainEngine, .*.sounds, .*.soundConfig, .*.soundConfigExhaust, -.*.information { +.*.information, .*.gearbox, +.*.clutch, .*.turbocharger, +.*.vehicleController, .*.radiator, +.*.waterDamage, .*.engineBlock, +.*.gauges, .*.gauges.configuration, +.*.gauges.displayData { ComplexNewLine: Force; AlignObjectKeys: true; PreserveNumberFormat: true; From 4e1807bdb4bca9d3d437074610edd5f7a68f1645 Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Sun, 29 Mar 2026 14:45:11 +0200 Subject: [PATCH 04/10] regenerate AST fixtures for updated JBFL configs --- examples/ast/jbfl/complex.hs | 1067 +++++++++++++++++++++++++++++----- examples/ast/jbfl/minimal.hs | 933 ++++++++++++++++++++++++++--- 2 files changed, 1777 insertions(+), 223 deletions(-) diff --git a/examples/ast/jbfl/complex.hs b/examples/ast/jbfl/complex.hs index a649c3a5..83968c55 100644 --- a/examples/ast/jbfl/complex.hs +++ b/examples/ast/jbfl/complex.hs @@ -5,7 +5,12 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "beams" ) + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "modes" ) + , AnyObjectKey + , Selector + ( ObjectKey "settings" ) , AnyArrayIndex , AnyArrayIndex , AnyObjectKey @@ -27,12 +32,14 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "components" ) + ( ObjectKey "driveModes" ) , Selector - ( ObjectKey "electrics" ) + ( ObjectKey "modes" ) + , AnyObjectKey , Selector - ( ObjectKey "smoothers" ) + ( ObjectKey "settings" ) , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -51,7 +58,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "flexbodies" ) + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "defaultSettings" ) , AnyArrayIndex , AnyArrayIndex , AnyObjectKey @@ -73,10 +82,13 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "nodes" ) - , AnyArrayIndex - , AnyArrayIndex + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "modes" ) , AnyObjectKey + , Selector + ( ObjectKey "settings" ) + , AnyArrayIndex ] ) , fromList @@ -95,7 +107,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "props" ) + ( ObjectKey "beams" ) , AnyArrayIndex , AnyArrayIndex , AnyObjectKey @@ -117,7 +129,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots" ) + ( ObjectKey "camerasInternal" ) , AnyArrayIndex , AnyArrayIndex , AnyObjectKey @@ -139,10 +151,12 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots2" ) - , AnyArrayIndex + ( ObjectKey "components" ) + , Selector + ( ObjectKey "electrics" ) + , Selector + ( ObjectKey "smoothers" ) , AnyArrayIndex - , AnyObjectKey ] ) , fromList @@ -161,7 +175,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "beams" ) + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "defaultSettings" ) , AnyArrayIndex , AnyObjectKey ] @@ -184,6 +200,7 @@ RuleSet , Selector ( ObjectKey "flexbodies" ) , AnyArrayIndex + , AnyArrayIndex , AnyObjectKey ] ) @@ -203,16 +220,20 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) + ( ObjectKey "mirrors" ) + , AnyArrayIndex + , AnyArrayIndex , AnyObjectKey - , Selector - ( ObjectKey "off" ) ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 10 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -221,16 +242,20 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) + ( ObjectKey "nodes" ) + , AnyArrayIndex + , AnyArrayIndex , AnyObjectKey - , Selector - ( ObjectKey "on" ) ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 10 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -239,10 +264,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "mainEngine" ) - , Selector - ( ObjectKey "burnEfficiency" ) + ( ObjectKey "props" ) , AnyArrayIndex + , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -261,10 +286,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "mainEngine" ) - , Selector - ( ObjectKey "torque" ) + ( ObjectKey "slots" ) , AnyArrayIndex + , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -283,10 +308,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "mainEngine" ) - , Selector - ( ObjectKey "torqueModIntake" ) + ( ObjectKey "slots2" ) , AnyArrayIndex + , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -305,10 +330,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "mainEngine" ) - , Selector - ( ObjectKey "torqueModMult" ) + ( ObjectKey "soundscape" ) + , AnyArrayIndex , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -327,7 +352,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "nodes" ) + ( ObjectKey "beams" ) , AnyArrayIndex , AnyObjectKey ] @@ -348,15 +373,19 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "nodes" ) - , AnyArrayIndex + ( ObjectKey "camerasInternal" ) , AnyArrayIndex + , AnyObjectKey ] ) , fromList [ - ( SomeKey PadDecimals - , SomeProperty PadDecimals 3 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -365,9 +394,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "props" ) + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "defaultSettings" ) , AnyArrayIndex - , AnyObjectKey ] ) , fromList @@ -386,7 +416,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots" ) + ( ObjectKey "flexbodies" ) , AnyArrayIndex , AnyObjectKey ] @@ -407,19 +437,16 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots2" ) - , AnyArrayIndex + ( ObjectKey "glowMap" ) , AnyObjectKey + , Selector + ( ObjectKey "off" ) ] ) , fromList [ - ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine None - ) - , - ( SomeKey PreserveNumberFormat - , SomeProperty PreserveNumberFormat True + ( SomeKey PadAmount + , SomeProperty PadAmount 10 ) ] ) @@ -428,18 +455,16 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "beams" ) - , AnyArrayIndex + ( ObjectKey "glowMap" ) + , AnyObjectKey + , Selector + ( ObjectKey "on" ) ] ) , fromList [ - ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine None - ) - , - ( SomeKey PreserveNumberFormat - , SomeProperty PreserveNumberFormat True + ( SomeKey PadAmount + , SomeProperty PadAmount 10 ) ] ) @@ -448,7 +473,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "controller" ) + ( ObjectKey "mainEngine" ) + , Selector + ( ObjectKey "burnEfficiency" ) , AnyArrayIndex ] ) @@ -468,7 +495,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "flexbodies" ) + ( ObjectKey "mainEngine" ) + , Selector + ( ObjectKey "torque" ) , AnyArrayIndex ] ) @@ -488,15 +517,20 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) + ( ObjectKey "mainEngine" ) , Selector - ( ObjectKey "abs" ) + ( ObjectKey "torqueCompressionBrake" ) + , AnyArrayIndex ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -505,15 +539,20 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) + ( ObjectKey "mainEngine" ) , Selector - ( ObjectKey "battery" ) + ( ObjectKey "torqueModIntake" ) + , AnyArrayIndex ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -522,19 +561,16 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) + ( ObjectKey "mainEngine" ) , Selector - ( ObjectKey "chassis_gaugelight_warning" ) + ( ObjectKey "torqueModMult" ) + , AnyArrayIndex ] ) , fromList [ - ( SomeKey AlignObjectKeys - , SomeProperty AlignObjectKeys True - ) - , ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine Force + , SomeProperty ComplexNewLine None ) , ( SomeKey PreserveNumberFormat @@ -547,15 +583,19 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , Selector - ( ObjectKey "checkengine" ) + ( ObjectKey "mirrors" ) + , AnyArrayIndex + , AnyObjectKey ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -564,19 +604,15 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , Selector - ( ObjectKey "dumptruck_gaugelight_warning" ) + ( ObjectKey "nodes" ) + , AnyArrayIndex + , AnyObjectKey ] ) , fromList [ - ( SomeKey AlignObjectKeys - , SomeProperty AlignObjectKeys True - ) - , ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine Force + , SomeProperty ComplexNewLine None ) , ( SomeKey PreserveNumberFormat @@ -589,15 +625,15 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , Selector - ( ObjectKey "hazard" ) + ( ObjectKey "nodes" ) + , AnyArrayIndex + , AnyArrayIndex ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey PadDecimals + , SomeProperty PadDecimals 3 ) ] ) @@ -606,15 +642,19 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , Selector - ( ObjectKey "highbeam" ) + ( ObjectKey "props" ) + , AnyArrayIndex + , AnyObjectKey ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -623,15 +663,19 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , Selector - ( ObjectKey "lowfuel" ) + ( ObjectKey "slots" ) + , AnyArrayIndex + , AnyObjectKey ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -640,15 +684,19 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , Selector - ( ObjectKey "lowpressure" ) + ( ObjectKey "slots2" ) + , AnyArrayIndex + , AnyObjectKey ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -657,15 +705,545 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , Selector - ( ObjectKey "parkingbrake" ) + ( ObjectKey "soundscape" ) + , AnyArrayIndex + , AnyObjectKey ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "beams" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "camerasInternal" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "clutch" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "controller" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "engineBlock" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "flexbodies" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "gauges" ) + , Selector + ( ObjectKey "configuration" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "gauges" ) + , Selector + ( ObjectKey "displayData" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "gearbox" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "abs" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "battery" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "chassis_gaugelight_warning" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "checkengine" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "dumptruck_gaugelight_warning" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "hazard" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "highbeam" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "lowfuel" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "lowpressure" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "parkingbrake" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "signal_L" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , Selector + ( ObjectKey "signal_R" ) + ] + ) + , fromList + [ + ( SomeKey PadAmount + , SomeProperty PadAmount 20 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "mirrors" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "nodes" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "powertrain" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "props" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "radiator" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -674,15 +1252,18 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , Selector - ( ObjectKey "signal_L" ) + ( ObjectKey "rails" ) + , AnyObjectKey ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -691,15 +1272,18 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , Selector - ( ObjectKey "signal_R" ) + ( ObjectKey "slots" ) + , AnyArrayIndex ] ) , fromList [ - ( SomeKey PadAmount - , SomeProperty PadAmount 20 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -708,8 +1292,8 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , AnyObjectKey + ( ObjectKey "slots2" ) + , AnyArrayIndex ] ) , fromList @@ -728,7 +1312,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "nodes" ) + ( ObjectKey "soundscape" ) , AnyArrayIndex ] ) @@ -737,6 +1321,10 @@ RuleSet ( SomeKey ComplexNewLine , SomeProperty ComplexNewLine None ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) ] ) , @@ -744,7 +1332,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "powertrain" ) + ( ObjectKey "triangles" ) , AnyArrayIndex ] ) @@ -764,7 +1352,27 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "props" ) + ( ObjectKey "turbocharger" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "variables" ) , AnyArrayIndex ] ) @@ -784,7 +1392,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "rails" ) + ( ObjectKey "vehicleController" ) , AnyObjectKey ] ) @@ -804,8 +1412,8 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots" ) - , AnyArrayIndex + ( ObjectKey "waterDamage" ) + , AnyObjectKey ] ) , fromList @@ -824,14 +1432,32 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots2" ) - , AnyArrayIndex + ( ObjectKey "beams" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "clutch" ) ] ) , fromList [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine None + , SomeProperty ComplexNewLine Force ) , ( SomeKey PreserveNumberFormat @@ -844,14 +1470,17 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "triangles" ) - , AnyArrayIndex + ( ObjectKey "engineBlock" ) ] ) , fromList [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine None + , SomeProperty ComplexNewLine Force ) , ( SomeKey PreserveNumberFormat @@ -864,14 +1493,17 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "variables" ) - , AnyArrayIndex + ( ObjectKey "gauges" ) ] ) , fromList [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine None + , SomeProperty ComplexNewLine Force ) , ( SomeKey PreserveNumberFormat @@ -884,13 +1516,21 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "beams" ) + ( ObjectKey "gearbox" ) ] ) , fromList [ - ( SomeKey AutoPad - , SomeProperty AutoPad True + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -978,6 +1618,74 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "props" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "radiator" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slots" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slots2" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) , ( NodePattern ( fromList @@ -1062,5 +1770,74 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "turbocharger" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "vehicleController" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "waterDamage" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) ] ) diff --git a/examples/ast/jbfl/minimal.hs b/examples/ast/jbfl/minimal.hs index d5bda16d..9e78054a 100644 --- a/examples/ast/jbfl/minimal.hs +++ b/examples/ast/jbfl/minimal.hs @@ -5,7 +5,12 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "beams" ) + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "modes" ) + , AnyObjectKey + , Selector + ( ObjectKey "settings" ) , AnyArrayIndex , AnyArrayIndex , AnyObjectKey @@ -27,12 +32,14 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "components" ) + ( ObjectKey "driveModes" ) , Selector - ( ObjectKey "electrics" ) + ( ObjectKey "modes" ) + , AnyObjectKey , Selector - ( ObjectKey "smoothers" ) + ( ObjectKey "settings" ) , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -51,7 +58,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "flexbodies" ) + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "defaultSettings" ) , AnyArrayIndex , AnyArrayIndex , AnyObjectKey @@ -73,10 +82,13 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "nodes" ) - , AnyArrayIndex - , AnyArrayIndex + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "modes" ) , AnyObjectKey + , Selector + ( ObjectKey "settings" ) + , AnyArrayIndex ] ) , fromList @@ -95,7 +107,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "props" ) + ( ObjectKey "beams" ) , AnyArrayIndex , AnyArrayIndex , AnyObjectKey @@ -117,7 +129,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots" ) + ( ObjectKey "camerasInternal" ) , AnyArrayIndex , AnyArrayIndex , AnyObjectKey @@ -139,10 +151,12 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots2" ) - , AnyArrayIndex + ( ObjectKey "components" ) + , Selector + ( ObjectKey "electrics" ) + , Selector + ( ObjectKey "smoothers" ) , AnyArrayIndex - , AnyObjectKey ] ) , fromList @@ -161,7 +175,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "beams" ) + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "defaultSettings" ) , AnyArrayIndex , AnyObjectKey ] @@ -184,6 +200,7 @@ RuleSet , Selector ( ObjectKey "flexbodies" ) , AnyArrayIndex + , AnyArrayIndex , AnyObjectKey ] ) @@ -203,10 +220,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "mainEngine" ) - , Selector - ( ObjectKey "burnEfficiency" ) + ( ObjectKey "mirrors" ) , AnyArrayIndex + , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -225,10 +242,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "mainEngine" ) - , Selector - ( ObjectKey "torque" ) + ( ObjectKey "nodes" ) , AnyArrayIndex + , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -247,10 +264,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "mainEngine" ) - , Selector - ( ObjectKey "torqueModIntake" ) + ( ObjectKey "props" ) , AnyArrayIndex + , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -269,10 +286,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "mainEngine" ) - , Selector - ( ObjectKey "torqueModMult" ) + ( ObjectKey "slots" ) , AnyArrayIndex + , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -291,7 +308,8 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "nodes" ) + ( ObjectKey "slots2" ) + , AnyArrayIndex , AnyArrayIndex , AnyObjectKey ] @@ -312,15 +330,20 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "nodes" ) + ( ObjectKey "soundscape" ) , AnyArrayIndex , AnyArrayIndex + , AnyObjectKey ] ) , fromList [ - ( SomeKey PadDecimals - , SomeProperty PadDecimals 3 + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -329,7 +352,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "props" ) + ( ObjectKey "beams" ) , AnyArrayIndex , AnyObjectKey ] @@ -350,7 +373,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots" ) + ( ObjectKey "camerasInternal" ) , AnyArrayIndex , AnyObjectKey ] @@ -371,9 +394,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots2" ) + ( ObjectKey "driveModes" ) + , Selector + ( ObjectKey "defaultSettings" ) , AnyArrayIndex - , AnyObjectKey ] ) , fromList @@ -392,8 +416,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "beams" ) + ( ObjectKey "flexbodies" ) , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -412,7 +437,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "controller" ) + ( ObjectKey "mainEngine" ) + , Selector + ( ObjectKey "burnEfficiency" ) , AnyArrayIndex ] ) @@ -432,7 +459,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "flexbodies" ) + ( ObjectKey "mainEngine" ) + , Selector + ( ObjectKey "torque" ) , AnyArrayIndex ] ) @@ -452,8 +481,10 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , AnyObjectKey + ( ObjectKey "mainEngine" ) + , Selector + ( ObjectKey "torqueCompressionBrake" ) + , AnyArrayIndex ] ) , fromList @@ -472,7 +503,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "nodes" ) + ( ObjectKey "mainEngine" ) + , Selector + ( ObjectKey "torqueModIntake" ) , AnyArrayIndex ] ) @@ -481,6 +514,10 @@ RuleSet ( SomeKey ComplexNewLine , SomeProperty ComplexNewLine None ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) ] ) , @@ -488,7 +525,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "powertrain" ) + ( ObjectKey "mainEngine" ) + , Selector + ( ObjectKey "torqueModMult" ) , AnyArrayIndex ] ) @@ -508,8 +547,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "props" ) + ( ObjectKey "mirrors" ) , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -528,7 +568,8 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "rails" ) + ( ObjectKey "nodes" ) + , AnyArrayIndex , AnyObjectKey ] ) @@ -548,8 +589,26 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots" ) + ( ObjectKey "nodes" ) + , AnyArrayIndex + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey PadDecimals + , SomeProperty PadDecimals 3 + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "props" ) , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -568,8 +627,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "slots2" ) + ( ObjectKey "slots" ) , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -588,8 +648,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "triangles" ) + ( ObjectKey "slots2" ) , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -608,8 +669,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "variables" ) + ( ObjectKey "soundscape" ) , AnyArrayIndex + , AnyObjectKey ] ) , fromList @@ -629,12 +691,17 @@ RuleSet [ AnyObjectKey , Selector ( ObjectKey "beams" ) + , AnyArrayIndex ] ) , fromList [ - ( SomeKey AutoPad - , SomeProperty AutoPad True + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -643,17 +710,18 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) + ( ObjectKey "camerasInternal" ) + , AnyArrayIndex ] ) , fromList [ - ( SomeKey AlignObjectKeys - , SomeProperty AlignObjectKeys True + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None ) , - ( SomeKey AutoPadSubObjects - , SomeProperty AutoPadSubObjects True + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -662,17 +730,14 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "information" ) + ( ObjectKey "clutch" ) + , AnyObjectKey ] ) , fromList [ - ( SomeKey AlignObjectKeys - , SomeProperty AlignObjectKeys True - ) - , ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine Force + , SomeProperty ComplexNewLine None ) , ( SomeKey PreserveNumberFormat @@ -685,17 +750,34 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "mainEngine" ) + ( ObjectKey "controller" ) + , AnyArrayIndex ] ) , fromList [ - ( SomeKey AlignObjectKeys - , SomeProperty AlignObjectKeys True + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None ) , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "engineBlock" ) + , AnyObjectKey + ] + ) + , fromList + [ ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine Force + , SomeProperty ComplexNewLine None ) , ( SomeKey PreserveNumberFormat @@ -708,17 +790,18 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "nodes" ) + ( ObjectKey "flexbodies" ) + , AnyArrayIndex ] ) , fromList [ - ( SomeKey AlignObjectKeys - , SomeProperty AlignObjectKeys True + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None ) , - ( SomeKey AutoPad - , SomeProperty AutoPad True + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) @@ -727,7 +810,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "soundConfig" ) + ( ObjectKey "gauges" ) + , Selector + ( ObjectKey "configuration" ) ] ) , fromList @@ -750,7 +835,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "soundConfigExhaust" ) + ( ObjectKey "gauges" ) + , Selector + ( ObjectKey "displayData" ) ] ) , fromList @@ -773,17 +860,34 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "sounds" ) + ( ObjectKey "gearbox" ) + , AnyObjectKey ] ) , fromList [ - ( SomeKey AlignObjectKeys - , SomeProperty AlignObjectKeys True + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None ) , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + , AnyObjectKey + ] + ) + , fromList + [ ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine Force + , SomeProperty ComplexNewLine None ) , ( SomeKey PreserveNumberFormat @@ -796,13 +900,686 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "triangles" ) + ( ObjectKey "mirrors" ) + , AnyArrayIndex ] ) , fromList [ - ( SomeKey AutoPad - , SomeProperty AutoPad True + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "nodes" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "powertrain" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "props" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "radiator" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "rails" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slots" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slots2" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "soundscape" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "triangles" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "turbocharger" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "variables" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "vehicleController" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "waterDamage" ) + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "beams" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "clutch" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "engineBlock" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "gauges" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "gearbox" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "glowMap" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey AutoPadSubObjects + , SomeProperty AutoPadSubObjects True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "information" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "mainEngine" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "nodes" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "props" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "radiator" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slots" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slots2" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "soundConfig" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "soundConfigExhaust" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "sounds" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "triangles" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "turbocharger" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "vehicleController" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "waterDamage" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True ) ] ) From e12c7734bd17451b0fd6a0cfc8fbcd90372b1b4b Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Sun, 29 Mar 2026 15:05:39 +0200 Subject: [PATCH 05/10] jbfl: add pressureWheels to PreserveNumberFormat + ComplexNewLine: None --- examples/jbfl/complex.jbfl | 1 + examples/jbfl/minimal.jbfl | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/jbfl/complex.jbfl b/examples/jbfl/complex.jbfl index 2cc00051..df32cf63 100644 --- a/examples/jbfl/complex.jbfl +++ b/examples/jbfl/complex.jbfl @@ -31,6 +31,7 @@ .*.vehicleController.*, .*.radiator.*, .*.waterDamage.*, .*.engineBlock.*, +.*.pressureWheels[*], .*.driveModes.defaultSettings[*], .*.driveModes.modes.*.settings[*], .*.mirrors[*], .*.soundscape[*], diff --git a/examples/jbfl/minimal.jbfl b/examples/jbfl/minimal.jbfl index c5d6e434..9e707a2a 100644 --- a/examples/jbfl/minimal.jbfl +++ b/examples/jbfl/minimal.jbfl @@ -33,6 +33,7 @@ .*.vehicleController.*, .*.radiator.*, .*.waterDamage.*, .*.engineBlock.*, +.*.pressureWheels[*], .*.driveModes.defaultSettings[*], .*.driveModes.modes.*.settings[*], .*.mirrors[*], .*.soundscape[*], From ec767f257c290f2acf1b5334907fb5d8bd74f96a Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Sun, 29 Mar 2026 15:14:48 +0200 Subject: [PATCH 06/10] regenerate AST fixtures for pressureWheels selector --- examples/ast/jbfl/complex.hs | 20 ++++++++++++++++++++ examples/ast/jbfl/minimal.hs | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/examples/ast/jbfl/complex.hs b/examples/ast/jbfl/complex.hs index 83968c55..248cab8e 100644 --- a/examples/ast/jbfl/complex.hs +++ b/examples/ast/jbfl/complex.hs @@ -1207,6 +1207,26 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "pressureWheels" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList diff --git a/examples/ast/jbfl/minimal.hs b/examples/ast/jbfl/minimal.hs index 9e78054a..22679c7e 100644 --- a/examples/ast/jbfl/minimal.hs +++ b/examples/ast/jbfl/minimal.hs @@ -951,6 +951,26 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "pressureWheels" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList From 507a3100187d9b86be0a34cc3f9eb8900a4941ac Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Tue, 31 Mar 2026 17:49:36 +0200 Subject: [PATCH 07/10] jbfl: add rules for slidenodes, torsionbars, deformGroups, differentials Add JBFL coverage for previously unmatched BeamNG sections: - slidenodes, torsionbars: AutoPad, inline children, PreserveNumberFormat - deformGroups: inline children - differential_R/F/C: force-multiline with AlignObjectKeys - Child-path rules for slidenodes, torsionbars, pressureWheels, powertrain --- examples/ast/jbfl/complex.hs | 243 +++++++++++++++++++++++++++++++++++ examples/ast/jbfl/minimal.hs | 243 +++++++++++++++++++++++++++++++++++ examples/jbfl/complex.jbfl | 13 +- examples/jbfl/minimal.jbfl | 15 ++- 4 files changed, 509 insertions(+), 5 deletions(-) diff --git a/examples/ast/jbfl/complex.hs b/examples/ast/jbfl/complex.hs index 248cab8e..a8518c1a 100644 --- a/examples/ast/jbfl/complex.hs +++ b/examples/ast/jbfl/complex.hs @@ -637,6 +637,48 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "powertrain" ) + , AnyArrayIndex + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "pressureWheels" ) + , AnyArrayIndex + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -658,6 +700,27 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slidenodes" ) + , AnyArrayIndex + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -721,6 +784,27 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "torsionbars" ) + , AnyArrayIndex + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -801,6 +885,26 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "deformGroups" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -1287,6 +1391,26 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slidenodes" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -1347,6 +1471,26 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "torsionbars" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -1485,6 +1629,75 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "differential_C" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "differential_F" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "differential_R" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -1676,6 +1889,21 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slidenodes" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) , ( NodePattern ( fromList @@ -1775,6 +2003,21 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "torsionbars" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) , ( NodePattern ( fromList diff --git a/examples/ast/jbfl/minimal.hs b/examples/ast/jbfl/minimal.hs index 22679c7e..24cbb706 100644 --- a/examples/ast/jbfl/minimal.hs +++ b/examples/ast/jbfl/minimal.hs @@ -601,6 +601,48 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "powertrain" ) + , AnyArrayIndex + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "pressureWheels" ) + , AnyArrayIndex + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -622,6 +664,27 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slidenodes" ) + , AnyArrayIndex + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -685,6 +748,27 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "torsionbars" ) + , AnyArrayIndex + , AnyObjectKey + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -765,6 +849,26 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "deformGroups" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -1031,6 +1135,26 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slidenodes" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -1091,6 +1215,26 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "torsionbars" ) + , AnyArrayIndex + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -1229,6 +1373,75 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "differential_C" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "differential_F" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "differential_R" ) + ] + ) + , fromList + [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine Force + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList @@ -1420,6 +1633,21 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "slidenodes" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) , ( NodePattern ( fromList @@ -1519,6 +1747,21 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "torsionbars" ) + ] + ) + , fromList + [ + ( SomeKey AutoPad + , SomeProperty AutoPad True + ) + ] + ) , ( NodePattern ( fromList diff --git a/examples/jbfl/complex.jbfl b/examples/jbfl/complex.jbfl index df32cf63..a710724b 100644 --- a/examples/jbfl/complex.jbfl +++ b/examples/jbfl/complex.jbfl @@ -9,7 +9,8 @@ .*.nodes, .*.beams, .*.triangles, .*.slots, -.*.slots2, .*.props { +.*.slots2, .*.props, +.*.slidenodes, .*.torsionbars { AutoPad : true; } @@ -32,6 +33,8 @@ .*.radiator.*, .*.waterDamage.*, .*.engineBlock.*, .*.pressureWheels[*], +.*.slidenodes[*], .*.torsionbars[*], +.*.deformGroups[*], .*.driveModes.defaultSettings[*], .*.driveModes.modes.*.settings[*], .*.mirrors[*], .*.soundscape[*], @@ -59,7 +62,11 @@ .*.soundscape[*].*, .*.soundscape[*][*].*, .*.camerasInternal[*].*, -.*.camerasInternal[*][*].* { +.*.camerasInternal[*][*].*, +.*.slidenodes[*].*, +.*.torsionbars[*].*, +.*.pressureWheels[*].*, +.*.powertrain[*].* { PreserveNumberFormat : true; ComplexNewLine : None; } @@ -77,6 +84,8 @@ .*.waterDamage, .*.engineBlock, .*.gauges, .*.gauges.configuration, .*.gauges.displayData, +.*.differential_R, .*.differential_F, +.*.differential_C, .*.glowMap.dumptruck_gaugelight_warning, .*.glowMap.chassis_gaugelight_warning { ComplexNewLine: Force; diff --git a/examples/jbfl/minimal.jbfl b/examples/jbfl/minimal.jbfl index 9e707a2a..ca52d257 100644 --- a/examples/jbfl/minimal.jbfl +++ b/examples/jbfl/minimal.jbfl @@ -8,7 +8,8 @@ .*.nodes, .*.beams, .*.triangles, .*.slots, -.*.slots2, .*.props { +.*.slots2, .*.props, +.*.slidenodes, .*.torsionbars { AutoPad: true; } @@ -34,6 +35,8 @@ .*.radiator.*, .*.waterDamage.*, .*.engineBlock.*, .*.pressureWheels[*], +.*.slidenodes[*], .*.torsionbars[*], +.*.deformGroups[*], .*.driveModes.defaultSettings[*], .*.driveModes.modes.*.settings[*], .*.mirrors[*], .*.soundscape[*], @@ -61,7 +64,11 @@ .*.soundscape[*].*, .*.soundscape[*][*].*, .*.camerasInternal[*].*, -.*.camerasInternal[*][*].* { +.*.camerasInternal[*][*].*, +.*.slidenodes[*].*, +.*.torsionbars[*].*, +.*.pressureWheels[*].*, +.*.powertrain[*].* { PreserveNumberFormat : true; ComplexNewLine : None; } @@ -73,7 +80,9 @@ .*.vehicleController, .*.radiator, .*.waterDamage, .*.engineBlock, .*.gauges, .*.gauges.configuration, -.*.gauges.displayData { +.*.gauges.displayData, +.*.differential_R, .*.differential_F, +.*.differential_C { ComplexNewLine: Force; AlignObjectKeys: true; PreserveNumberFormat: true; From a915994f83a8f2ab08128cfc274cd41a08a62b7f Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Wed, 1 Apr 2026 20:54:52 +0200 Subject: [PATCH 08/10] jbfl: use prefix match for deformGroups inside mainEngine Replace .*.deformGroups[*] with .*.mainEngine.deformGroups* to match all deformGroups variants (deformGroups_oilPan, deformGroups_turbo, deformGroups_radiator, etc.) inside mainEngine config objects using the new prefix matching syntax. --- examples/ast/jbfl/complex.hs | 41 ++++++++++++++++++------------------ examples/ast/jbfl/minimal.hs | 39 +++++++++++++++++----------------- examples/jbfl/complex.jbfl | 2 +- examples/jbfl/minimal.jbfl | 2 +- 4 files changed, 43 insertions(+), 41 deletions(-) diff --git a/examples/ast/jbfl/complex.hs b/examples/ast/jbfl/complex.hs index a8518c1a..a4782985 100644 --- a/examples/ast/jbfl/complex.hs +++ b/examples/ast/jbfl/complex.hs @@ -885,26 +885,6 @@ RuleSet ) ] ) - , - ( NodePattern - ( fromList - [ AnyObjectKey - , Selector - ( ObjectKey "deformGroups" ) - , AnyArrayIndex - ] - ) - , fromList - [ - ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine None - ) - , - ( SomeKey PreserveNumberFormat - , SomeProperty PreserveNumberFormat True - ) - ] - ) , ( NodePattern ( fromList @@ -1255,6 +1235,27 @@ RuleSet ) ] ) + , + ( NodePattern + ( fromList + [ AnyObjectKey + , Selector + ( ObjectKey "mainEngine" ) + , Selector + ( ObjectPrefixKey "deformGroups" ) + ] + ) + , fromList + [ + ( SomeKey ComplexNewLine + , SomeProperty ComplexNewLine None + ) + , + ( SomeKey PreserveNumberFormat + , SomeProperty PreserveNumberFormat True + ) + ] + ) , ( NodePattern ( fromList diff --git a/examples/ast/jbfl/minimal.hs b/examples/ast/jbfl/minimal.hs index 24cbb706..b59a1287 100644 --- a/examples/ast/jbfl/minimal.hs +++ b/examples/ast/jbfl/minimal.hs @@ -854,8 +854,8 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "deformGroups" ) - , AnyArrayIndex + ( ObjectKey "engineBlock" ) + , AnyObjectKey ] ) , fromList @@ -874,8 +874,8 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "engineBlock" ) - , AnyObjectKey + ( ObjectKey "flexbodies" ) + , AnyArrayIndex ] ) , fromList @@ -894,14 +894,19 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "flexbodies" ) - , AnyArrayIndex + ( ObjectKey "gauges" ) + , Selector + ( ObjectKey "configuration" ) ] ) , fromList [ + ( SomeKey AlignObjectKeys + , SomeProperty AlignObjectKeys True + ) + , ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine None + , SomeProperty ComplexNewLine Force ) , ( SomeKey PreserveNumberFormat @@ -916,7 +921,7 @@ RuleSet , Selector ( ObjectKey "gauges" ) , Selector - ( ObjectKey "configuration" ) + ( ObjectKey "displayData" ) ] ) , fromList @@ -939,19 +944,14 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "gauges" ) - , Selector - ( ObjectKey "displayData" ) + ( ObjectKey "gearbox" ) + , AnyObjectKey ] ) , fromList [ - ( SomeKey AlignObjectKeys - , SomeProperty AlignObjectKeys True - ) - , ( SomeKey ComplexNewLine - , SomeProperty ComplexNewLine Force + , SomeProperty ComplexNewLine None ) , ( SomeKey PreserveNumberFormat @@ -964,7 +964,7 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "gearbox" ) + ( ObjectKey "glowMap" ) , AnyObjectKey ] ) @@ -984,8 +984,9 @@ RuleSet ( fromList [ AnyObjectKey , Selector - ( ObjectKey "glowMap" ) - , AnyObjectKey + ( ObjectKey "mainEngine" ) + , Selector + ( ObjectPrefixKey "deformGroups" ) ] ) , fromList diff --git a/examples/jbfl/complex.jbfl b/examples/jbfl/complex.jbfl index a710724b..ac52fd8d 100644 --- a/examples/jbfl/complex.jbfl +++ b/examples/jbfl/complex.jbfl @@ -34,7 +34,7 @@ .*.engineBlock.*, .*.pressureWheels[*], .*.slidenodes[*], .*.torsionbars[*], -.*.deformGroups[*], +.*.mainEngine.deformGroups*, .*.driveModes.defaultSettings[*], .*.driveModes.modes.*.settings[*], .*.mirrors[*], .*.soundscape[*], diff --git a/examples/jbfl/minimal.jbfl b/examples/jbfl/minimal.jbfl index ca52d257..48ff1e97 100644 --- a/examples/jbfl/minimal.jbfl +++ b/examples/jbfl/minimal.jbfl @@ -36,7 +36,7 @@ .*.engineBlock.*, .*.pressureWheels[*], .*.slidenodes[*], .*.torsionbars[*], -.*.deformGroups[*], +.*.mainEngine.deformGroups*, .*.driveModes.defaultSettings[*], .*.driveModes.modes.*.settings[*], .*.mirrors[*], .*.soundscape[*], From 5c9ee3aa77aabbcbcf26728e27b523c0a61eacb1 Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Fri, 3 Apr 2026 23:02:10 +0200 Subject: [PATCH 09/10] bug fix: missing select for ObjectPrefixKey --- src/JbeamEdit/Core/NodePath.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/JbeamEdit/Core/NodePath.hs b/src/JbeamEdit/Core/NodePath.hs index 34193605..3a8b517a 100644 --- a/src/JbeamEdit/Core/NodePath.hs +++ b/src/JbeamEdit/Core/NodePath.hs @@ -11,7 +11,7 @@ module JbeamEdit.Core.NodePath ( import Data.Either.Extra (maybeToEither) import Data.Sequence (Seq (..)) import Data.Text (Text) -import Data.Text qualified as T (show) +import Data.Text qualified as T (show,isPrefixOf) import Data.Vector (Vector) import Data.Vector qualified as V import GHC.IsList (IsList (..)) @@ -62,6 +62,9 @@ And queryNodes allows use to chain the Selectors as a NodePath and perform compl -} select :: NodeSelector -> N.Node -> Maybe N.Node select (ArrayIndex i) (N.Array ns) = getNthNonComment i ns +select (ObjectPrefixKey k) (N.Object ov) = + extractValInKey + =<< V.find (any (T.isPrefixOf k) . N.maybeObjectKey) ov select (ObjectKey k) (N.Object ns) = extractValInKey =<< V.find (elem k . N.maybeObjectKey) ns select (ObjectIndex i) (N.Object a) = extractValInKey =<< getNthNonComment i a select _ _ = Nothing From aacf436b89b1d49a52c1c9455202842b328462c8 Mon Sep 17 00:00:00 2001 From: webdevred <148627186+webdevred@users.noreply.github.com> Date: Sat, 4 Apr 2026 20:42:37 +0200 Subject: [PATCH 10/10] Fixed NodePath select --- src/JbeamEdit/Core/NodePath.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/JbeamEdit/Core/NodePath.hs b/src/JbeamEdit/Core/NodePath.hs index 372b9a6a..998eb52c 100644 --- a/src/JbeamEdit/Core/NodePath.hs +++ b/src/JbeamEdit/Core/NodePath.hs @@ -65,12 +65,12 @@ In case the selector matches nodes at a certain point in the tree. And queryNodes allows use to chain the Selectors as a NodePath and perform complex queries. -} select :: NodeSelector -> N.Node -> Maybe N.Node -select (ArrayIndex i) (N.Array ns) = getNthNonComment i ns +select (ArrayIndex i) (N.Array av) = getNthNonComment i (N.avNodes av) select (ObjectPrefixKey k) (N.Object ov) = extractValInKey - =<< V.find (any (T.isPrefixOf k) . N.maybeObjectKey) ov -select (ObjectKey k) (N.Object ns) = extractValInKey =<< V.find (elem k . N.maybeObjectKey) ns -select (ObjectIndex i) (N.Object a) = extractValInKey =<< getNthNonComment i a + =<< V.find (any (T.isPrefixOf k) . N.maybeObjectKey) (N.ovNodes ov) +select (ObjectKey k) (N.Object ov) = extractValInKey =<< V.find (elem k . N.maybeObjectKey) (N.ovNodes ov) +select (ObjectIndex i) (N.Object ov) = extractValInKey =<< getNthNonComment i (N.ovNodes ov) select _ _ = Nothing queryNodes :: NodePath -> N.Node -> Either Text N.Node