aboutsummaryrefslogtreecommitdiffstats
path: root/lib/parsetools/src/yecc.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-06-27 15:53:21 +0200
committerSiri Hansen <[email protected]>2017-07-06 17:53:22 +0200
commite2b9eb8735416ded58fbcdfbe11a90b7885f8a31 (patch)
treeb66c244179ffa2cbd5bd3a2efcfa6e3473d39c09 /lib/parsetools/src/yecc.erl
parent4b98c91182ac5f2fcd5a616874512abe526c1634 (diff)
downloadotp-e2b9eb8735416ded58fbcdfbe11a90b7885f8a31.tar.gz
otp-e2b9eb8735416ded58fbcdfbe11a90b7885f8a31.tar.bz2
otp-e2b9eb8735416ded58fbcdfbe11a90b7885f8a31.zip
parsetools: Do not use deprecated functions in string(3)
Unicode is also handled better in a few cases.
Diffstat (limited to 'lib/parsetools/src/yecc.erl')
-rw-r--r--lib/parsetools/src/yecc.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/parsetools/src/yecc.erl b/lib/parsetools/src/yecc.erl
index 36e33b52a4..b4e1cfe5e3 100644
--- a/lib/parsetools/src/yecc.erl
+++ b/lib/parsetools/src/yecc.erl
@@ -365,10 +365,10 @@ is_filename(T) ->
shorten_filename(Name0) ->
{ok,Cwd} = file:get_cwd(),
- case lists:prefix(Cwd, Name0) of
- false -> Name0;
- true ->
- case lists:nthtail(length(Cwd), Name0) of
+ case string:prefix(Name0, Cwd) of
+ nomatch -> Name0;
+ Rest ->
+ case unicode:characters_to_list(Rest) of
"/"++N -> N;
N -> N
end
@@ -2196,8 +2196,8 @@ output_reduce(St0, State, Terminal,
St20;
true ->
Ns = "Nss",
- Tmp = string:join(lists:duplicate(NmbrOfDaughters - 1, "_"),
- ","),
+ Tmp = lists:join(",",
+ lists:duplicate(NmbrOfDaughters - 1, "_")),
fwrite(St20, <<" [~s|Nss] = Ss,\n">>, [Tmp])
end,
St40 = case tokens(RuleNmbr, St30) of