Browse Source

Merge pull request #29 from basho/bwf-atom-numerals

don't quote atoms just for containing numerals
pull/32/head
Andrew Thompson 13 years ago
parent
commit
41bddc83f7
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/lager_trunc_io.erl

+ 2
- 0
src/lager_trunc_io.erl View File

@ -297,6 +297,7 @@ atom_needs_quoting([]) ->
false; false;
atom_needs_quoting([H|T]) when (H >= $a andalso H =< $z); atom_needs_quoting([H|T]) when (H >= $a andalso H =< $z);
(H >= $A andalso H =< $Z); (H >= $A andalso H =< $Z);
(H >= $0 andalso H =< $9);
H == $@; H == $_ -> H == $@; H == $_ ->
atom_needs_quoting(T); atom_needs_quoting(T);
atom_needs_quoting(_) -> atom_needs_quoting(_) ->
@ -400,6 +401,7 @@ atom_quoting_test() ->
?assertEqual("hello_world", lists:flatten(format("~p", ['hello_world'], 50))), ?assertEqual("hello_world", lists:flatten(format("~p", ['hello_world'], 50))),
?assertEqual("'node@127.0.0.1'", lists:flatten(format("~p", ['node@127.0.0.1'], 50))), ?assertEqual("'node@127.0.0.1'", lists:flatten(format("~p", ['node@127.0.0.1'], 50))),
?assertEqual("node@nohost", lists:flatten(format("~p", [node@nohost], 50))), ?assertEqual("node@nohost", lists:flatten(format("~p", [node@nohost], 50))),
?assertEqual("abc123", lists:flatten(format("~p", [abc123], 50))),
ok. ok.
sane_float_printing_test() -> sane_float_printing_test() ->

Loading…
Cancel
Save