浏览代码

ft: 修改为二进制匹配

master
SisMaker 4 年前
父节点
当前提交
7333c4bb59
共有 1 个文件被更改,包括 17 次插入6 次删除
  1. +17
    -6
      src/eFmtFormat.erl

+ 17
- 6
src/eFmtFormat.erl 查看文件

@ -72,13 +72,24 @@ scan(Format, Args) ->
collect(Format, Args) collect(Format, Args)
end. end.
doCollect(FmtBinStr, Args) ->
MatchList = binary:matches(FmtBinStr, <<"~">>),
doCollectList(MatchList, FmtBinStr, Args, 0, []).
doCollectList([], _FmtBinStr, _Args, Index, Acc) ->
doCollect(FmtBinStr, Args, Acc) ->
case binary:split(FmtBinStr, <<"~">>) of
[NotMatch] ->
[NotMatch | Acc];
[FPart, LPart] ->
doCollectList(LPart, Args, [FPart | Acc]).
end,
%% ~F.P.PadModC
doCollectList(<<>>, _Args, Acc) ->
Acc; Acc;
doCollectList([OneMatch | MatchList], FmtBinStr, Args, Index, Acc) ->
doCollectList(LPart, Args, Acc) ->
%%
case LPart of
<<"-", FBin/binary>> ->
end,
ok. ok.

正在加载...
取消
保存