@@ -489,7 +489,7 @@ protected override void VisitReturnNode(BslSyntaxNode node)
489489 protected override void VisitRaiseNode ( BslSyntaxNode node )
490490 {
491491 int arg = - 1 ;
492- if ( node . Children . Any ( ) )
492+ if ( node . Children . Count != 0 )
493493 {
494494 VisitExpression ( node . Children [ 0 ] ) ;
495495 arg = 0 ;
@@ -728,24 +728,17 @@ private void ResolveObjectMethod(BslSyntaxNode callNode, bool asFunction)
728728
729729 PushCallArguments ( args ) ;
730730
731- var cDef = new ConstDefinition ( ) ;
732- cDef . Type = DataType . String ;
733- cDef . Presentation = name . GetIdentifier ( ) ;
734- int lastIdentifierConst = GetConstNumber ( cDef ) ;
731+ int lastIdentifierIndex = GetIdentNumber ( name . GetIdentifier ( ) ) ;
735732
736733 if ( asFunction )
737- AddCommand ( OperationCode . ResolveMethodFunc , lastIdentifierConst ) ;
734+ AddCommand ( OperationCode . ResolveMethodFunc , lastIdentifierIndex ) ;
738735 else
739- AddCommand ( OperationCode . ResolveMethodProc , lastIdentifierConst ) ;
736+ AddCommand ( OperationCode . ResolveMethodProc , lastIdentifierIndex ) ;
740737 }
741738
742739 private void ResolveProperty ( string identifier )
743740 {
744- var cDef = new ConstDefinition ( ) ;
745- cDef . Type = DataType . String ;
746- cDef . Presentation = identifier ;
747- var identifierConstIndex = GetConstNumber ( cDef ) ;
748- AddCommand ( OperationCode . ResolveProp , identifierConstIndex ) ;
741+ AddCommand ( OperationCode . ResolveProp , GetIdentNumber ( identifier ) ) ;
749742 }
750743
751744 private int PushVariable ( TerminalNode node )
@@ -1328,6 +1321,19 @@ private int GetConstNumber(in ConstDefinition cDef)
13281321 return idx ;
13291322 }
13301323
1324+ private int GetIdentNumber ( string ident )
1325+ {
1326+
1327+ var idx = _module . Identifiers . IndexOf ( ident ) ;
1328+ if ( idx < 0 )
1329+ {
1330+ idx = _module . Identifiers . Count ;
1331+ _module . Identifiers . Add ( ident ) ;
1332+ }
1333+ return idx ;
1334+ }
1335+
1336+
13311337 private int GetMethodRefNumber ( in SymbolBinding methodBinding )
13321338 {
13331339 var descriptor = _ctx . GetBinding ( methodBinding . ScopeNumber ) ;
0 commit comments