You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed when looking at the symbol table from a cpp2 file, the member variables of a class aren't showing up. The member functions/methods of the class type do, but not the member variables themselves.
Here's a simple example:
Person: type = {
public name: str = "waka";
public age: int;
dob: str;
setName: (this, newName: str) -> void = {
this.name = newName;
}
}
And here's the symbol table output if you run cppfront with the debug option
---------------------------------------------------------------------------
declaration_of: size 6
& tok #tok & sym identifier #tok in_curr_fn prev_was_this & this_param_sym
00A2A608 2 -> 00A0EA80 Person 2 0 0 00000000
00A2A878 13 -> 00A0EB10 newName 13 1 0 00000000
00A2A848 11 -> 00A0EAEC this 11 1 0 00000000
00A2A800 10 -> 00A0EAC8 setName 10 0 0 00000000
00A2A998 20 -> 00A0EB10 newName 13 1 0 00000000
00A2A938 16 -> 00A0EAEC this 11 1 0 00000000
---------------------------------------------------------------------------
symbols: size 15
idx tok# & symbol dep
0 | 2 | 00A0EA80 | 0 | type Person
1 | 0 | 00A0EAA4 | 1 | scope
2 | 10 | 00A0EAC8 | 2 | function setName
3 | 11 | 00A0EAEC | 3 | var this
4 | 13 | 00A0EB10 | 3 | var newName
5 | 0 | 00A0EB34 | 3 | scope
6 | 16 | 00A0EB58 | 4 | *** (7,5) DEFINITE LAST POTENTIALLY MOVING USE OF *** use of this
7 | 20 | 00A0EB7C | 4 | *** (7,17) DEFINITE LAST POTENTIALLY MOVING USE OF *** use of newName
8 | 0 | 00A0EBA0 | 4 | /scope
9 | 11 | 00A0EBC4 | 3 | *** use of this
10 | 13 | 00A0EBE8 | 3 | *** use of newName
11 | 0 | 00A0EC0C | 3 | /function
12 | 10 | 00A0EC30 | 2 | *** use of setName
13 | 0 | 00A0EC54 | 2 | /scope
14 | 0 | 00A0EC78 | 1 | /type
From the above table, you can see that the parameters from the setName function are captured, along with setName itself, but name, age, and dob are not captured in the table. These declarations are captured in the tokens parsing, but they never make it into sema (atleast, they didn't make it into sema as far as I've seen).
Is this a bug or is it intentional? (or maybe they are being captured somewhere and I'm just badly mistaken?)
The text was updated successfully, but these errors were encountered:
I noticed when looking at the symbol table from a cpp2 file, the member variables of a class aren't showing up. The member functions/methods of the class type do, but not the member variables themselves.
Here's a simple example:
And here's the symbol table output if you run cppfront with the debug option
From the above table, you can see that the parameters from the
setName
function are captured, along withsetName
itself, butname
,age
, anddob
are not captured in the table. These declarations are captured in the tokens parsing, but they never make it intosema
(atleast, they didn't make it intosema
as far as I've seen).Is this a bug or is it intentional? (or maybe they are being captured somewhere and I'm just badly mistaken?)
The text was updated successfully, but these errors were encountered: