ryukzak / nitta

BSD 3-Clause "New" or "Revised" License
21 stars 6 forks source link

Reorganize LuaStatement datatype definition #185

Closed ArturGogiyan closed 1 year ago

ArturGogiyan commented 3 years ago

For now, several fields of LuaStatement data type structure (fIn, fValues, fInt) duplicate each other. All of them stand for input arguments representation. This structure can be organized more reliably: LuaStatement data type can contains a list of arguments and each of them can present separate data type.

data LuaStatement x = LuaStatement
    { fArgs :: [LuaStatementArg x]
     , fOut :: [LuaValueVersion]
     , fName :: T.Text
     }
     deriving (Show, Eq)

data LuaStatementArg x 
  = LuaValueArg T.Text
  | InternediateArg x
  | IntArg Int
  | …

Context: https://github.com/ryukzak/nitta/pull/174/files#r693559936