Not really. The times I often use the multi-line function call syntax like that is when it is a macro and the AST is important. Look at ExSpirit for example (hmm, I need to test how elixir would format some grammars…). ^.^
EDIT1: Not very well, the grammar’s got a lot more right-heavy and the trailing comma’s all vanished, which is really important in grammars considering how much they are shuffled around while testing parsing… >.<
EDIT2: Also what on earth is it doing making this format?! o.O
pipe_result_into: List.to_tuple()
|> case do
{:started, datetime_string} ->
{:started, parse(datetime_string, parse_weirddatetimeformat()).result}
result ->
result
end
EDIT3: It turned this:
defrule parse_entry(seq([
parse_type(),
parse_body(),
])), pipe_result_into: List.to_tuple() |> (case do
{:started, datetime_string} -> {:started, parse(datetime_string, parse_weirddatetimeformat()).result}
result -> result
end)
Into this:
defrule(
parse_entry(
seq([
parse_type(),
parse_body()
])
),
pipe_result_into: List.to_tuple()
|> case do
{:started, datetime_string} ->
{:started, parse(datetime_string, parse_weirddatetimeformat()).result}
result ->
result
end
)
First of all, the function definition is all wrapped up in parenthesis, which is just wrong (that is like formatting def blah(x)
to be def(blah(x))
), and it formatted the pipe_result_into:
option with the pipe into a ‘what the heck is this’, as well as a few other oddities (more minor ones like the seq
call not being on the primary line and such).
The thing that bugs me most is how it is doing that piping in the pipe_result_into
option, it makes me confused as to if it is piping the output of the List.to_tuple()
call or if it is piping the output of the parse_entry
call. I’m still having issues mentally parsing that even though I know it is fairly obvious… >.<