diff options
Diffstat (limited to 'lib/tools')
-rw-r--r-- | lib/tools/emacs/Makefile | 16 | ||||
-rw-r--r-- | lib/tools/emacs/erlang.el | 4 | ||||
-rw-r--r-- | lib/tools/emacs/test.erl.indented | 5 | ||||
-rw-r--r-- | lib/tools/emacs/test.erl.orig | 5 | ||||
-rw-r--r-- | lib/tools/src/xref_utils.erl | 4 | ||||
-rw-r--r-- | lib/tools/test/xref_SUITE.erl | 16 |
6 files changed, 45 insertions, 5 deletions
diff --git a/lib/tools/emacs/Makefile b/lib/tools/emacs/Makefile index e5ed56b412..69946be24a 100644 --- a/lib/tools/emacs/Makefile +++ b/lib/tools/emacs/Makefile @@ -86,3 +86,19 @@ release_docs_spec: docs $(INSTALL_DATA) $(MAN_FILES) "$(RELEASE_PATH)/man/man3" endif endif + +EMACS ?= emacs + +test_indentation: + @rm -f test.erl + @rm -f test_indent.el + @echo '(load "erlang-start")' >> test_indent.el + @echo '(find-file "test.erl.orig")' >> test_indent.el + @echo "(require 'cl) ; required with Emacs < 23 for ignore-errors" >> test_indent.el + @echo '(erlang-mode)' >> test_indent.el + @echo '(toggle-debug-on-error)' >> test_indent.el + @echo '(erlang-indent-current-buffer)' >> test_indent.el + @echo '(write-file "test.erl")' >> test_indent.el + $(EMACS) --batch -Q -L . -l test_indent.el + diff -u test.erl.indented test.erl + @echo "No differences between expected and actual indentation" diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index 2f6c7f554e..8f98d6c85c 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -1516,7 +1516,7 @@ Other commands: ;; A dollar sign right before the double quote that ends a ;; string is not a character escape. ;; - ;; And a "string" has with a double quote not escaped by a + ;; And a "string" consists of a double quote not escaped by a ;; dollar sign, any number of non-backslash non-newline ;; characters or escaped backslashes, a dollar sign ;; (otherwise we wouldn't care) and a double quote. This @@ -1525,6 +1525,8 @@ Other commands: ;; know whether matching started inside a string: limiting ;; search to a single line keeps things sane. . (("\\(?:^\\|[^$]\\)\"\\(?:[^\"\n]\\|\\\\\"\\)*\\(\\$\\)\"" 1 "w") + ;; Likewise for atoms + ("\\(?:^\\|[^$]\\)'\\(?:[^'\n]\\|\\\\'\\)*\\(\\$\\)'" 1 "w") ;; And the dollar sign in $\" escapes two characters, not ;; just one. ("\\(\\$\\)\\\\\\\"" 1 "'")))))) diff --git a/lib/tools/emacs/test.erl.indented b/lib/tools/emacs/test.erl.indented index e0593c6522..45d9593000 100644 --- a/lib/tools/emacs/test.erl.indented +++ b/lib/tools/emacs/test.erl.indented @@ -215,6 +215,11 @@ highlighting(X) % Function definitions should be highlighted "char $in string", atom, + 'atom$', atom, 'atom$', atom, + 'atom\$', atom, + + 'char $in atom', atom, + $[, ${, $\\, atom, ?MACRO_1, ?MACRO_2(foo), diff --git a/lib/tools/emacs/test.erl.orig b/lib/tools/emacs/test.erl.orig index 69356aca9e..e123150dd1 100644 --- a/lib/tools/emacs/test.erl.orig +++ b/lib/tools/emacs/test.erl.orig @@ -215,6 +215,11 @@ highlighting(X) % Function definitions should be highlighted "char $in string", atom, + 'atom$', atom, 'atom$', atom, + 'atom\$', atom, + + 'char $in atom', atom, + $[, ${, $\\, atom, ?MACRO_1, ?MACRO_2(foo), diff --git a/lib/tools/src/xref_utils.erl b/lib/tools/src/xref_utils.erl index 9d4a175d88..680563e9df 100644 --- a/lib/tools/src/xref_utils.erl +++ b/lib/tools/src/xref_utils.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -141,7 +141,7 @@ is_string([], _) -> is_string(Term, C) -> is_string1(Term, C). -is_string1([H | T], C) when H > C, H < 127 -> +is_string1([H | T], C) when H > C -> is_string1(T, C); is_string1([], _) -> true; diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl index 78e49044a5..fd3e111d8d 100644 --- a/lib/tools/test/xref_SUITE.erl +++ b/lib/tools/test/xref_SUITE.erl @@ -53,7 +53,7 @@ analyze/1, basic/1, md/1, q/1, variables/1, unused_locals/1]). -export([ - format_error/1, otp_7423/1, otp_7831/1]). + format_error/1, otp_7423/1, otp_7831/1, otp_10192/1]). -import(lists, [append/2, flatten/1, keysearch/3, member/2, sort/1, usort/1]). @@ -86,7 +86,7 @@ groups() -> fun_mfa_r14, fun_mfa_vars, qlc]}, {analyses, [], [analyze, basic, md, q, variables, unused_locals]}, - {misc, [], [format_error, otp_7423, otp_7831]}]. + {misc, [], [format_error, otp_7423, otp_7831, otp_10192]}]. init_per_suite(Config) -> init(Config). @@ -2515,6 +2515,18 @@ otp_7831(Conf) when is_list(Conf) -> ?line xref:stop(Pid2), ok. +otp_10192(suite) -> []; +otp_10192(doc) -> + ["OTP-10192. Allow filenames with character codes greater than 126."]; +otp_10192(Conf) when is_list(Conf) -> + PrivDir = ?privdir, + {ok, _Pid} = xref:start(s), + Dir = filename:join(PrivDir, "�"), + ok = file:make_dir(Dir), + {ok, []} = xref:add_directory(s, Dir), + xref:stop(s), + ok. + %%% %%% Utilities %%% |