diff options
author | Dan Gudmundsson <[email protected]> | 2018-03-01 15:00:02 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2018-03-01 15:00:02 +0100 |
commit | cc0a308533b38371e4a7fe8caa9c9e65bd15cc26 (patch) | |
tree | 880e0de93dfe345594aad6e0ba8d805a568675a5 /lib/tools/test/emacs_SUITE_data/comprehensions | |
parent | 3bba476ad0df599050ccfc0826856111f5ff1bde (diff) | |
parent | af960d82c5b8322a40bddc4bc08897b7e2d95463 (diff) | |
download | otp-cc0a308533b38371e4a7fe8caa9c9e65bd15cc26.tar.gz otp-cc0a308533b38371e4a7fe8caa9c9e65bd15cc26.tar.bz2 otp-cc0a308533b38371e4a7fe8caa9c9e65bd15cc26.zip |
Merge branch 'maint'
* maint:
emacs: delimiter first in icr works
emacs: Indent delimiter first in term elements correctly
emacs: Indent tuple (and maps) elements as list elements
Add emacs indention testcase
Diffstat (limited to 'lib/tools/test/emacs_SUITE_data/comprehensions')
-rw-r--r-- | lib/tools/test/emacs_SUITE_data/comprehensions | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/tools/test/emacs_SUITE_data/comprehensions b/lib/tools/test/emacs_SUITE_data/comprehensions new file mode 100644 index 0000000000..45279850a5 --- /dev/null +++ b/lib/tools/test/emacs_SUITE_data/comprehensions @@ -0,0 +1,47 @@ +%% -*- Mode: erlang; indent-tabs-mode: nil -*- +%% Copyright Ericsson AB 2017. All Rights Reserved. + +%%% indentation of comprehensions + +%%% Not everything in these test are set in stone +%%% better indentation rules can be added but by having +%%% these tests we can see what changes in new implementations +%%% and notice when doing unintentional changes + +list() -> + %% I don't have a good idea how we want to handle this + %% but they are here to show how they are indented today. + Result1 = [X || + #record{a=X} <- lists:seq(1, 10), + true = (X rem 2) + ], + Result2 = [X || <<X:32,_:32>> <= <<0:512>>, + true = (X rem 2) + ], + Res = [ func(X, + arg2) + || + #record{a=X} <- lists:seq(1, 10), + true = (X rem 2) + ], + Result1. + +binary(B) -> + Binary1 = << <<X:8>> || + #record{a=X} <- lists:seq(1, 10), + true = (X rem 2) + >>, + + Binary2 = << <<X:8>> || <<X:32,_:32>> <= <<0:512>>, + true = (X rem 2) + >>, + + Bin3 = << + << + X:8, + 34:8 + >> + || <<X:32,_:32>> <= <<0:512>>, + true = (X rem 2) + >>, + ok. |