OutcomeSymbols
struct OutcomeSymbols : Codable, Equatable
A struct embedded inside a FormattingManagerService
struct used as a nested layer within a model used to decode Formatting JSON data.
The struct models the JSON object mapped to the outcome_symbols
key in the Formatting JSON data.
Most of the parameters within the outcome_symbols
JSON object relate to the outcome of various conditional statements. The parameters key string values are used to format the outcome symbol of node types when displaying messages in the console.
Note
The struct uses a custom semantic naming system to name properties associated with key value pairs and their position in the JSON. This system was developed as an aid to correctly map each key to its position in the struct.-
A string mapped to the
if_true_condition
key in the Formatting JSON data.Declaration
Swift
let kA: String
-
A string mapped to the
else_condition
key in the Formatting JSON data.Declaration
Swift
let kB: String
-
A string mapped to the
if_true_condition_negative_outcome
key in the Formatting JSON data.Note
The use of theif_true_condition_negative_outcome
key in place of theif_true_condition
is discretional.The
if_true_condition
andelse_condition
keys can be used for all conditional statements and still convey general outcome.The purpose of differential formatting according to the semantic outcome of conditional statements is as an additional visual aid that makes it easier to spot anomalies or unexpected routes in the control flow. It is also designed to help developers gain understanding of the functionality of unfamiliar code.
Declaration
Swift
let kC: String
-
A string mapped to the
else_condition_positive_outcome
key in the Formatting JSON data.Note
The use of theelse_condition_positive_outcome
key in place of theelse_condition
is discretional.The
if_true_condition
andelse_condition
keys can be used for all conditional statements and still convey general outcome.The purpose of differential formatting according to the semantic outcome of conditional statements is as an additional visual aid that makes it easier to spot anomalies or unexpected routes in the control flow. It is also designed to help developers gain understanding of the functionality of unfamiliar code.
Declaration
Swift
let kD: String
-
A string mapped to the
case_true_positive_outcome
key in the Formatting JSON data. This key is for print statements placed in the case branch body of Switch statements that are designated as a positive or expected outcome.Note
The purpose of differential formatting according to the semantic outcome of conditional statements is as an additional visual aid that makes it easier to spot anomalies or unexpected routes in the control flow. It is also designed to help developers gain understanding of the functionality of unfamiliar code.Declaration
Swift
let kE: String
-
A string mapped to the
case_true_negative_outcome
key in the Formatting JSON data. This key is for print statements placed in the case branch body of Switch statements that are designated as a negative or unexpected outcome.Note
The use of this feature is discretional – alternatively, the keycase_true_positive_outcome
could be used for all Switch cases.The purpose of differential formatting according to the semantic outcome of conditional statements is as an additional visual aid that makes it easier to spot anomalies or unexpected routes in the control flow. It is also designed to help developers gain understanding of the functionality of unfamiliar code.
Declaration
Swift
let kF: String
-
A string mapped to the
guard_pass
key in the Formatting JSON data.Declaration
Swift
let kG: String
-
A string mapped to the
guard_fail
key in the Formatting JSON data.Declaration
Swift
let kH: String
-
A string mapped to the
do_try_pass
key in the Formatting JSON data.Declaration
Swift
let kI: String
-
A string mapped to the
catch_try_fail
key in the Formatting JSON data.Declaration
Swift
let kJ: String
-
A string mapped to the
value_reporter
key in the Formatting JSON data.Declaration
Swift
let kK: String
-
A string mapped to the
error_reporter
key in the Formatting JSON data.Declaration
Swift
let kL: String