Summary: Add support for block expressions in the translation. Reviewed By: rgrig Differential Revision: D29584072 fbshipit-source-id: 2a1a1eedamaster
parent
87626160aa
commit
c82308e586
@ -0,0 +1,37 @@
|
|||||||
|
% Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
%
|
||||||
|
% This source code is licensed under the MIT license found in the
|
||||||
|
% LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
|
-module(block).
|
||||||
|
|
||||||
|
-export([test_block_Ok/0, test_block_Bad/0]).
|
||||||
|
|
||||||
|
% Call this method with warn(1) to trigger a warning to expect
|
||||||
|
warn(0) -> ok.
|
||||||
|
|
||||||
|
test_block_Ok() ->
|
||||||
|
case
|
||||||
|
begin
|
||||||
|
X = 3,
|
||||||
|
Y = X,
|
||||||
|
Z = Y,
|
||||||
|
Z
|
||||||
|
end
|
||||||
|
of
|
||||||
|
3 -> ok;
|
||||||
|
_ -> warn(1)
|
||||||
|
end.
|
||||||
|
|
||||||
|
test_block_Bad() ->
|
||||||
|
case
|
||||||
|
begin
|
||||||
|
X = 3,
|
||||||
|
Y = X,
|
||||||
|
Z = Y,
|
||||||
|
Z
|
||||||
|
end
|
||||||
|
of
|
||||||
|
3 -> warn(1);
|
||||||
|
_ -> ok
|
||||||
|
end.
|
Loading…
Reference in new issue