earmark_tag_cloud v0.1.3 EarmarkTagCloud.Parser

Link to this section Summary

Functions

Parses a line, which is either a set instruction or a tag spec

Link to this section Functions

Link to this function

parse_line(arg)

Parses a line, which is either a set instruction or a tag spec:

  iex> parse_line({"set font-family Helvetica sans serif", 1})
  {:set, "font-family", "Helvetica sans serif"}

  iex> parse_line({"set font-family", 4})
  {:error, 4, "missing value for variable \"font-family\""}

  iex> parse_line({"\\set font-family 1 2 3", 40})
  {:tag, "set font-family", [1, 2, 3], 40}

  iex> parse_line({"\\set font-family 1 2 ", 42})
  {:error, 42, "missing one or more of necessary integer values (font-size font-weight gray-scale) at end of tag specifcation"}