wip
This commit is contained in:
+11
-3
@@ -1,4 +1,9 @@
|
||||
% @doc called ltr to disambiguate from
|
||||
% @doc called ltr to disambiguate from "char"
|
||||
%
|
||||
% In "A + B + AB", this is one of the individual letters.
|
||||
%
|
||||
% a letter is a binary. atom is more natural representation but this is http,
|
||||
% can't be spamming the atoms table.
|
||||
%
|
||||
% mathematically, this is a variable like "a", "b", "c", etc
|
||||
-module(wfc_ltr).
|
||||
@@ -78,6 +83,9 @@ new2(Acc, Rest = <<BadChar:8, _/binary>>) ->
|
||||
|
||||
|
||||
|
||||
-spec to_binary(ltr()) -> binary().
|
||||
-spec to_binary(ltr()) -> Result
|
||||
when Result :: {ok, binary()}
|
||||
| {error, string()}.
|
||||
|
||||
to_binary({c, X}) -> X.
|
||||
to_binary({c, X}) -> {ok, X};
|
||||
to_binary(Bad) -> {error, wfc_utils:str("wfc_ltr:to_binary: bad letter: ~tp", [Bad])}.
|
||||
|
||||
Reference in New Issue
Block a user