@@ -105,7 +105,10 @@ public override void EnterSubStmt(AttributesParser.SubStmtContext context)
105
105
106
106
public override void ExitSubStmt ( AttributesParser . SubStmtContext context )
107
107
{
108
- _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
108
+ if ( _currentScopeAttributes . Any ( ) )
109
+ {
110
+ _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
111
+ }
109
112
}
110
113
111
114
public override void EnterFunctionStmt ( AttributesParser . FunctionStmtContext context )
@@ -115,7 +118,10 @@ public override void EnterFunctionStmt(AttributesParser.FunctionStmtContext cont
115
118
116
119
public override void ExitFunctionStmt ( AttributesParser . FunctionStmtContext context )
117
120
{
118
- _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
121
+ if ( _currentScopeAttributes . Any ( ) )
122
+ {
123
+ _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
124
+ }
119
125
}
120
126
121
127
public override void EnterPropertyGetStmt ( AttributesParser . PropertyGetStmtContext context )
@@ -125,7 +131,10 @@ public override void EnterPropertyGetStmt(AttributesParser.PropertyGetStmtContex
125
131
126
132
public override void ExitPropertyGetStmt ( AttributesParser . PropertyGetStmtContext context )
127
133
{
128
- _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
134
+ if ( _currentScopeAttributes . Any ( ) )
135
+ {
136
+ _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
137
+ }
129
138
}
130
139
131
140
public override void EnterPropertyLetStmt ( AttributesParser . PropertyLetStmtContext context )
@@ -135,7 +144,10 @@ public override void EnterPropertyLetStmt(AttributesParser.PropertyLetStmtContex
135
144
136
145
public override void ExitPropertyLetStmt ( AttributesParser . PropertyLetStmtContext context )
137
146
{
138
- _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
147
+ if ( _currentScopeAttributes . Any ( ) )
148
+ {
149
+ _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
150
+ }
139
151
}
140
152
141
153
public override void EnterPropertySetStmt ( AttributesParser . PropertySetStmtContext context )
@@ -145,7 +157,10 @@ public override void EnterPropertySetStmt(AttributesParser.PropertySetStmtContex
145
157
146
158
public override void ExitPropertySetStmt ( AttributesParser . PropertySetStmtContext context )
147
159
{
148
- _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
160
+ if ( _currentScopeAttributes . Any ( ) )
161
+ {
162
+ _attributes . Add ( _currentScope , _currentScopeAttributes ) ;
163
+ }
149
164
}
150
165
151
166
public override void ExitAttributeStmt ( AttributesParser . AttributeStmtContext context )
0 commit comments