This commit is contained in:
Бондарев Иван 2017-11-19 20:04:04 +01:00
parent 97c97e8444
commit f4d1323d62
3 changed files with 11 additions and 8 deletions

View file

@ -1789,7 +1789,7 @@ namespace CodeCompletion
}
if (returned_scope != null /*&& cnst_val.prim_val != null*/)
{
ElementScope es = new ElementScope(new SymInfo(_simple_const_definition.const_name.name, SymbolKind.Constant, _simple_const_definition.const_name.name), returned_scope, cnst_val.prim_val, cur_scope);
ElementScope es = new ElementScope(new SymInfo(_simple_const_definition.const_name.name, SymbolKind.Constant, _simple_const_definition.const_name.name), returned_scope, cnst_val.prim_val != null? cnst_val.prim_val:_simple_const_definition.const_value.ToString(), cur_scope);
es.is_static = true;
cur_scope.AddName(_simple_const_definition.const_name.name, es);
es.loc = get_location(_simple_const_definition.const_name);
@ -1812,11 +1812,11 @@ namespace CodeCompletion
{
_typed_const_definition.const_value.visit(this);
}
catch(Exception e)
catch (Exception e)
{
}
ElementScope es = new ElementScope(new SymInfo(_typed_const_definition.const_name.name, SymbolKind.Constant,_typed_const_definition.const_name.name),cnst_type,cnst_val.prim_val,cur_scope);
ElementScope es = new ElementScope(new SymInfo(_typed_const_definition.const_name.name, SymbolKind.Constant, _typed_const_definition.const_name.name), cnst_type, cnst_val.prim_val != null?cnst_val.prim_val: _typed_const_definition.const_value.ToString(), cur_scope);
cur_scope.AddName(_typed_const_definition.const_name.name, es);
es.loc = get_location(_typed_const_definition);
es.is_static = true;

View file

@ -389,7 +389,7 @@ namespace PascalABCCompiler.SyntaxTree
{
public override string ToString()
{
return val.ToString();
return val.ToString(System.Globalization.CultureInfo.InvariantCulture);
}
}

View file

@ -1,6 +1,9 @@
const
h = Round{@function Round(x: real): integer;@}(1.3);
h {@const h: integer = Round(1.3);@}=
Round{@function Round(x: real): integer;@}(1.3);
l{@const l: integer = 1;@} = 1;
l2 = l{@const l: integer = 1;@}+1;
r{@const r: real = sin(2);@} = sin(2);
begin
end.