support of System.Diagnostics.Conditional
This commit is contained in:
parent
5865d3d431
commit
89f9751d33
|
|
@ -159,7 +159,7 @@ namespace PascalABCCompiler
|
|||
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Remove(so.Ident);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7262,6 +7262,8 @@ namespace PascalABCCompiler.NETGenerator
|
|||
//вызов статического метода
|
||||
public override void visit(SemanticTree.ICommonStaticMethodCallNode value)
|
||||
{
|
||||
if (comp_opt.dbg_attrs == DebugAttributes.Release && has_debug_conditional_attr(helper.GetMethod(value.static_method).mi))
|
||||
return;
|
||||
//if (save_debug_info)
|
||||
//MarkSequencePoint(value.Location);
|
||||
IExpressionNode[] real_parameters = value.real_parameters;
|
||||
|
|
|
|||
8
TestSuite/errors/err0418.pas
Normal file
8
TestSuite/errors/err0418.pas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function f(i: integer): boolean;
|
||||
begin
|
||||
|
||||
end;
|
||||
begin
|
||||
if f then
|
||||
exit;
|
||||
end.
|
||||
8
TestSuite/errors/err0419.pas
Normal file
8
TestSuite/errors/err0419.pas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function f(i: integer): boolean;
|
||||
begin
|
||||
|
||||
end;
|
||||
begin
|
||||
while f do
|
||||
exit;
|
||||
end.
|
||||
9
TestSuite/errors/err0420.pas
Normal file
9
TestSuite/errors/err0420.pas
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
function f(i: integer): boolean;
|
||||
begin
|
||||
|
||||
end;
|
||||
begin
|
||||
repeat
|
||||
|
||||
until f;
|
||||
end.
|
||||
12
TestSuite/errors/err0421.pas
Normal file
12
TestSuite/errors/err0421.pas
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function f(i: integer): string;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure p(s: string);
|
||||
begin
|
||||
|
||||
end;
|
||||
begin
|
||||
p(f);
|
||||
end.
|
||||
8
TestSuite/errors/err0422.pas
Normal file
8
TestSuite/errors/err0422.pas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function f(i: integer): string;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
begin
|
||||
writeln(f.GetType);
|
||||
end.
|
||||
10
TestSuite/errors/err0423.pas
Normal file
10
TestSuite/errors/err0423.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
function f(i: integer): integer;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
begin
|
||||
case f of
|
||||
1: writeln(2);
|
||||
end;
|
||||
end.
|
||||
|
|
@ -15666,7 +15666,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
{
|
||||
expression_node condition = convert_strong(_if_node.condition);
|
||||
condition = convertion_data_and_alghoritms.convert_type(condition, SystemLibrary.SystemLibrary.bool_type);
|
||||
|
||||
try_convert_typed_expression_to_function_call(ref condition, true);
|
||||
// SSM 29/08/16
|
||||
/*var cc = condition as bool_const_node;
|
||||
if (cc != null && cc.constant_value == false && _if_node.else_body == null)
|
||||
|
|
@ -15722,7 +15722,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
{
|
||||
expression_node expr = convert_strong(_while_node.expr);
|
||||
expr = convertion_data_and_alghoritms.convert_type(expr, SystemLibrary.SystemLibrary.bool_type);
|
||||
|
||||
try_convert_typed_expression_to_function_call(ref expr, true);
|
||||
CheckToEmbeddedStatementCannotBeADeclaration(_while_node.statements);
|
||||
|
||||
while_node wn = new while_node(expr, get_location(_while_node));
|
||||
|
|
@ -15770,6 +15770,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
rep.body = st;
|
||||
expression_node expr = convert_strong(_repeat_node.expr);
|
||||
expr = convertion_data_and_alghoritms.convert_type(expr, SystemLibrary.SystemLibrary.bool_type);
|
||||
try_convert_typed_expression_to_function_call(ref expr, true);
|
||||
rep.condition = expr;
|
||||
context.cycle_stack.pop();
|
||||
return_value(rep);
|
||||
|
|
|
|||
Loading…
Reference in a new issue