source: trunk/ada-2012/src/parser/gela-nodes-fixed_operator_symbols.adb

Last change on this file was 482, checked in by Maxim Reznik, 4 years ago

Fix regressions

Avoid property reading in Property_Setter,

because we don't initialize them in newly created nodes, so properties
have invalid values. Initialize Full_Name of Fixed_Operator_Symbol.
We need it to distinguish string literal and operator symbol.
Reset explicitly all properties of elements in an instance.

  • Property svn:keywords set to Author Date Revision
File size: 1.1 KB
Line 
1package body Gela.Nodes.Fixed_Operator_Symbols is
2
3 --------------------------
4 -- String_Literal_Token --
5 --------------------------
6
7 overriding function String_Literal_Token
8 (Self : Operator_Symbol)
9 return Gela.Lexical_Types.Token_Count
10 is
11 begin
12 return Self.Operator_Symbol_Token;
13 end String_Literal_Token;
14
15 -----------
16 -- Visit --
17 -----------
18
19 overriding procedure Visit
20 (Self : access Operator_Symbol;
21 Visiter : in out Gela.Element_Visiters.Visiter'Class)
22 is
23 use type Gela.Lexical_Types.Symbol;
24 Comp : constant Gela.Compilations.Compilation_Access :=
25 Self.Enclosing_Compilation;
26 Token : constant Gela.Lexical_Types.Token_Count :=
27 Self.Operator_Symbol_Token;
28 begin
29 if Self.Full_Name = Gela.Lexical_Types.No_Symbol and
30 (Token not in Gela.Lexical_Types.Token_Index or else
31 Comp.Get_Token (Token).Symbol = Gela.Lexical_Types.No_Symbol)
32 then
33 Visiter.String_Literal (Self);
34 else
35 Visiter.Operator_Symbol (Self);
36 end if;
37 end Visit;
38
39end Gela.Nodes.Fixed_Operator_Symbols;
Note: See TracBrowser for help on using the repository browser.