Skip to content

Commit

Permalink
ogma-core: Adjust to optional fields in JSON Spec. Refs #122.
Browse files Browse the repository at this point in the history
A prior commit has modified the JSON Spec parsing library to make some
fields in input JSON files optional. This will make the library more
versatile.

This commit modifies the existing modules that use the JSON parsing
library to use the new interface with optional types for some JSON
Format spec fields.
  • Loading branch information
ivanperez-keera committed Jan 24, 2024
1 parent 9a1dd69 commit 28dba7f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions ogma-core/src/Command/FPrimeApp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -741,15 +741,15 @@ ecCannotCopyTemplate = 1
-- | JSONPath selectors for a FRET file
fretFormat :: JSONFormat
fretFormat = JSONFormat
{ specInternalVars = "..Internal_variables[*]"
{ specInternalVars = Just "..Internal_variables[*]"
, specInternalVarId = ".name"
, specInternalVarExpr = ".assignmentCopilot"
, specInternalVarType = ".type"
, specExternalVars = "..Other_variables[*]"
, specInternalVarType = Just ".type"
, specExternalVars = Just "..Other_variables[*]"
, specExternalVarId = ".name"
, specExternalVarType = ".type"
, specExternalVarType = Just ".type"
, specRequirements = "..Requirements[*]"
, specRequirementId = ".name"
, specRequirementDesc = ".fretish"
, specRequirementDesc = Just ".fretish"
, specRequirementExpr = ".ptLTL"
}
10 changes: 5 additions & 5 deletions ogma-core/src/Command/FRETComponentSpec2Copilot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ fretComponentSpec2CopilotResult options fp result = case result of
-- | JSONPath selectors for a FRET file
fretFormat :: Bool -> JSONFormat
fretFormat useCoCoSpec = JSONFormat
{ specInternalVars = "..Internal_variables[*]"
{ specInternalVars = Just "..Internal_variables[*]"
, specInternalVarId = ".name"
, specInternalVarExpr = ".assignmentCopilot"
, specInternalVarType = ".type"
, specExternalVars = "..Other_variables[*]"
, specInternalVarType = Just ".type"
, specExternalVars = Just "..Other_variables[*]"
, specExternalVarId = ".name"
, specExternalVarType = ".type"
, specExternalVarType = Just ".type"
, specRequirements = "..Requirements[*]"
, specRequirementId = ".name"
, specRequirementDesc = ".fretish"
, specRequirementDesc = Just ".fretish"
, specRequirementExpr = if useCoCoSpec then ".CoCoSpecCode" else ".ptLTL"
}

Expand Down
10 changes: 5 additions & 5 deletions ogma-core/src/Command/ROSApp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -716,15 +716,15 @@ ecCannotCopyTemplate = 1
-- | JSONPath selectors for a FRET file
fretFormat :: JSONFormat
fretFormat = JSONFormat
{ specInternalVars = "..Internal_variables[*]"
{ specInternalVars = Just "..Internal_variables[*]"
, specInternalVarId = ".name"
, specInternalVarExpr = ".assignmentCopilot"
, specInternalVarType = ".type"
, specExternalVars = "..Other_variables[*]"
, specInternalVarType = Just ".type"
, specExternalVars = Just "..Other_variables[*]"
, specExternalVarId = ".name"
, specExternalVarType = ".type"
, specExternalVarType = Just ".type"
, specRequirements = "..Requirements[*]"
, specRequirementId = ".name"
, specRequirementDesc = ".fretish"
, specRequirementDesc = Just ".fretish"
, specRequirementExpr = ".ptLTL"
}

0 comments on commit 28dba7f

Please sign in to comment.