Use 2^index when parsing flags
1 files changed, 2 insertions(+), 1 deletions(-) M lib/tl/parse.ex
M lib/tl/parse.ex => lib/tl/parse.ex +2-1
@@ 79,8 79,9 @@ defmodule TL.Parse do ~r/^flags.(\d)\?(.*)$/ui, type ) index = String.to_integer(index) pow_index = :math.pow(2, index) |> round if (index != 0 && Bitwise.band(flags, index) == index) do if (index != 0 && Bitwise.band(flags, pow_index) == pow_index) do processed_params ++ [%{"name" => name, "type" => wrapped_type}] else processed_params