Skip to content

No difference between class vars and instance vars #333

Description

@chuacw

The TPasSyntaxTreeBuilder doesn't distinguish between class vars and instance vars.

Given the following code:

unit Unit1;

interface

type
  TTestProtectedClassVars = class
  protected
  var
    Var1, Var2: Boolean;
  class var
    CVar1, CVar2: string;
  var
    Var3, Var4: string;
  end;

implementation

end.

The ParserDemo generated the following XML:

<UNIT  line_seq="62389968" line="1" col="1" name="Unit1">
  <INTERFACE  line_seq="15076109" begin_line="3" begin_col="1" end_line="16" end_col="1">
    <TYPESECTION  line_seq="15076109" line="5" col="1">
      <TYPEDECL  line_seq="15076109" begin_line="6" begin_col="3" end_line="14" end_col="6" name="TTestProtectedClassVars">
        <TYPE  line_seq="15076109" line="6" col="29" type="class" class="true">
          <PROTECTED  line_seq="15076109" line="7" col="3" visibility="true">
            <FIELD  line_seq="62391504" line="9" col="5">
              <NAME  line_seq="62391504" line="9" col="5" value="Var1"/>
              <TYPE  line_seq="15076109" line="9" col="17" name="Boolean"/>
            </FIELD>
            <FIELD  line_seq="62391552" line="9" col="11">
              <NAME  line_seq="62391552" line="9" col="11" value="Var2"/>
              <TYPE  line_seq="15076109" line="9" col="17" name="Boolean"/>
            </FIELD>
            <FIELD  line_seq="62391600" line="11" col="5">
              <NAME  line_seq="62391600" line="11" col="5" value="CVar1"/>
              <TYPE  line_seq="15076109" line="11" col="19" name="string"/>
            </FIELD>
            <FIELD  line_seq="62391552" line="11" col="12">
              <NAME  line_seq="62391552" line="11" col="12" value="CVar2"/>
              <TYPE  line_seq="15076109" line="11" col="19" name="string"/>
            </FIELD>
            <FIELD  line_seq="62391504" line="13" col="5">
              <NAME  line_seq="62391504" line="13" col="5" value="Var3"/>
              <TYPE  line_seq="15076109" line="13" col="17" name="string"/>
            </FIELD>
            <FIELD  line_seq="62391552" line="13" col="11">
              <NAME  line_seq="62391552" line="13" col="11" value="Var4"/>
              <TYPE  line_seq="15076109" line="13" col="17" name="string"/>
            </FIELD>
          </PROTECTED>
        </TYPE>
      </TYPEDECL>
    </TYPESECTION>
  </INTERFACE>
  <IMPLEMENTATION  line_seq="15076109" begin_line="16" begin_col="1" end_line="18" end_col="1"/>
</UNIT>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions