diff options
author | Anders Svensson <[email protected]> | 2011-12-06 00:31:03 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2011-12-06 19:04:37 +0100 |
commit | 75fa191f9fc48a769e5f99f8dc6b9463d21c9e0c (patch) | |
tree | b26e559b8ceed2e646f597793a8490e2eb49cbf9 /lib/diameter/src/compiler | |
parent | f7cd24ba70e47bfdfe88ecd171c1a8badbe7e338 (diff) | |
download | otp-75fa191f9fc48a769e5f99f8dc6b9463d21c9e0c.tar.gz otp-75fa191f9fc48a769e5f99f8dc6b9463d21c9e0c.tar.bz2 otp-75fa191f9fc48a769e5f99f8dc6b9463d21c9e0c.zip |
Minor diameter_dict_scanner fix
Spec was wrong. Scanning a file that ended with $' or contained an
empty $'-delimited string would have failed.
Diffstat (limited to 'lib/diameter/src/compiler')
-rw-r--r-- | lib/diameter/src/compiler/diameter_dict_scanner.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/diameter/src/compiler/diameter_dict_scanner.erl b/lib/diameter/src/compiler/diameter_dict_scanner.erl index 963b58fdfc..45189376fb 100644 --- a/lib/diameter/src/compiler/diameter_dict_scanner.erl +++ b/lib/diameter/src/compiler/diameter_dict_scanner.erl @@ -32,7 +32,9 @@ %% # scan/1 %% ----------------------------------------------------------- --spec scan(string()) -> {ok, [Token]} | {error, {atom(), string(), Lineno}} +-spec scan(string() | binary()) + -> {ok, [Token]} + | {error, {string(), string(), Lineno}} when Token :: {word, Lineno, string()} | {number, Lineno, non_neg_integer()} | {Symbol, Lineno}, @@ -169,7 +171,7 @@ split([H|_] = L) when $a =< H, H =< $z; {word(P), Rest}; split([$'|T]) -> - case splitwith(fun(C) -> not lists:member(C, "'\r\n") end, T) of + case lists:splitwith(fun(C) -> not lists:member(C, "'\r\n") end, T) of {[_|_] = A, [$'|Rest]} -> {{word, A}, Rest}; {[], [$'|_]} -> |