Add flags for setting rules and query before starting
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -18,13 +18,13 @@ type alias Model =
|
||||
{ program : String
|
||||
, query : String
|
||||
}
|
||||
type alias Flags = ()
|
||||
type alias Flags = { rules: String, query: String }
|
||||
type Msg
|
||||
= SetProgram String
|
||||
| SetQuery String
|
||||
|
||||
init : Flags -> (Model, Cmd Msg)
|
||||
init () = ({ program = "", query = "type(?e, tint)" }, Cmd.none)
|
||||
init fs = ({ program = fs.rules, query = fs.query }, Cmd.none)
|
||||
|
||||
viewSection : String -> Html Msg -> Html Msg
|
||||
viewSection name content =
|
||||
@@ -56,7 +56,7 @@ viewProofTree progs querys = viewSection "Proof Tree" <|
|
||||
|
||||
view : Model -> Html Msg
|
||||
view m = Html.div [ class "elm-root" ]
|
||||
[ viewSection "Rules" <| Html.textarea [ onInput SetProgram ] []
|
||||
[ viewSection "Rules" <| Html.textarea [ onInput SetProgram ] [ Html.text m.program ]
|
||||
, viewSection "Query" <| Html.input [ type_ "text", onInput SetQuery, value m.query ] []
|
||||
, viewRules m.program
|
||||
, viewProofTree m.program m.query
|
||||
|
||||
Reference in New Issue
Block a user