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);
@ -1810,19 +1810,19 @@ namespace CodeCompletion
SymScope cnst_type = returned_scope;
try
{
_typed_const_definition.const_value.visit(this);
_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;
es.declaringUnit = entry_scope;
if (add_doc_from_text && this.converter.controller.docs != null && this.converter.controller.docs.ContainsKey(_typed_const_definition))
es.AddDocumentation(this.converter.controller.docs[_typed_const_definition]);
es.AddDocumentation(this.converter.controller.docs[_typed_const_definition]);
cnst_val.prim_val = null;
}

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.