This commit is contained in:
Бондарев Иван 2018-10-03 14:56:27 +02:00
parent 17897c2be6
commit 64e6961fa8
2 changed files with 12 additions and 6 deletions

View file

@ -2721,8 +2721,14 @@ namespace PascalABCCompiler.Parsers
}
else if (ch == '.' || ch == '^' || ch == '&' || ch == '?')
{
if (ch == '.' && i >= 1 && Text[i - 1] == '.') end = true; else sb.Insert(0, ch);
if (ch != '.') punkt_sym = true;
if (ch == '.' && i >= 1 && Text[i - 1] == '.')
end = true;
else if (ch == '?' && i + 1 < Text.Length && Text[i + 1] != '.')
end = true;
else
sb.Insert(0, ch);
if (ch != '.')
punkt_sym = true;
}
else if (ch == '}')
{

View file

@ -13880,7 +13880,7 @@ namespace PascalABCCompiler.TreeConverter
{
is_userdefined = ! (cnf.function_node.namespace_node.namespace_name.Equals("PABCSystem") || cnf.function_node.namespace_node.namespace_name.Equals("PABCSystem_implementation______"));
}
return convert_strong_to_constant_node(exp, exp.type, is_const_section && is_userdefined);
return convert_strong_to_constant_node(exp, exp.type, is_const_section && is_userdefined, is_const_section);
}
public expression_node convert_strong_to_constant_or_function_call_for_varinit(expression_node exp)
@ -13999,7 +13999,7 @@ namespace PascalABCCompiler.TreeConverter
is_userdefined = !(cnf.function_node.namespace_node.namespace_name.Equals("PABCSystem") || cnf.function_node.namespace_node.namespace_name.Equals("PABCSystem_implementation______"));
}
return convert_strong_to_constant_node(exp, tn, is_const_section && is_userdefined);
return convert_strong_to_constant_node(exp, tn, is_const_section && is_userdefined, is_const_section);
}
private void check_set_for_constant(common_namespace_function_call cnfc)
@ -14025,7 +14025,7 @@ namespace PascalABCCompiler.TreeConverter
if (!(en is constant_node /*|| en is statements_expression_node*/)) AddError(en.location, "CONSTANT_EXPRESSION_EXPECTED");
}
private constant_node convert_strong_to_constant_node(expression_node expr, type_node tn, bool is_const_section_and_userfuncall = false)
private constant_node convert_strong_to_constant_node(expression_node expr, type_node tn, bool is_const_section_and_userfuncall = false, bool is_const_section = false)
{
location loc = expr.location;
constant_node constant = null;
@ -14040,7 +14040,7 @@ namespace PascalABCCompiler.TreeConverter
{
compiled_static_method_call csmc = expr as compiled_static_method_call;
if (csmc.type != null && csmc.type != SystemLibrary.SystemLibrary.void_type && (csmc.function_node.IsSpecialName && csmc.function_node.is_readonly || NetHelper.NetHelper.PABCSystemType != null && csmc.function_node.cont_type.compiled_type.Assembly == NetHelper.NetHelper.PABCSystemType.Assembly))
if (csmc.type != null && csmc.type != SystemLibrary.SystemLibrary.void_type && (csmc.function_node.IsSpecialName && csmc.function_node.is_readonly || NetHelper.NetHelper.PABCSystemType != null && csmc.function_node.cont_type.compiled_type.Assembly == NetHelper.NetHelper.PABCSystemType.Assembly || !is_const_section))
constant = new compiled_static_method_call_as_constant(csmc, expr.location);
}
else if (expr is common_namespace_function_call && SystemLibrary.SystemLibInitializer.CreateSetProcedure != null && (expr as common_namespace_function_call).function_node == SystemLibrary.SystemLibInitializer.CreateSetProcedure.sym_info as common_namespace_function_node)