From 697f8240ca9910c799e81637e44539efa4f75dfa Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Wed, 4 Sep 2024 11:47:47 +0800 Subject: [PATCH] fsxc: refactoring --- fsxc/Fsxc.fs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/fsxc/Fsxc.fs b/fsxc/Fsxc.fs index 240abf6..427fdf1 100644 --- a/fsxc/Fsxc.fs +++ b/fsxc/Fsxc.fs @@ -355,24 +355,26 @@ module Program = if trimmedLine.StartsWith "#if" && line.Contains "LEGACY_FRAMEWORK" then - match trimmedLine with - | "#if LEGACY_FRAMEWORK" -> + let newState = + match trimmedLine with + | "#if LEGACY_FRAMEWORK" -> #if LEGACY_FRAMEWORK - acc, - DeliverLinesUntilNextPreProcessorConditional + DeliverLinesUntilNextPreProcessorConditional #else - acc, IgnoreLinesUntilNextPreProcessorConditional + IgnoreLinesUntilNextPreProcessorConditional #endif - | "#if !LEGACY_FRAMEWORK" -> + | "#if !LEGACY_FRAMEWORK" -> #if LEGACY_FRAMEWORK - acc, IgnoreLinesUntilNextPreProcessorConditional + IgnoreLinesUntilNextPreProcessorConditional #else - acc, - DeliverLinesUntilNextPreProcessorConditional + DeliverLinesUntilNextPreProcessorConditional #endif - | _ -> - failwith - "Only simple ifdef statements are supported for the LEGACY_FRAMEWORK define" + + | _ -> + failwith + "Only simple ifdef statements are supported for the LEGACY_FRAMEWORK define" + + acc, newState else noStateChange()