Skip to content

Commit 857e1d2

Browse files
authored
Merge branch 'next' into Issue1867
2 parents b0665c6 + 5b6a5ed commit 857e1d2

16 files changed

+4452
-4277
lines changed

Rubberduck.Parsing/Grammar/VBALexer.cs

Lines changed: 1122 additions & 1118 deletions
Large diffs are not rendered by default.

Rubberduck.Parsing/Grammar/VBALexer.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ LSET : L S E T;
156156
ME : M E;
157157
MID : M I D;
158158
MOD : M O D;
159+
NAME : N A M E;
159160
NEXT : N E X T;
160161
NEW : N E W;
161162
NOT : N O T;

Rubberduck.Parsing/Grammar/VBAParser.cs

Lines changed: 3109 additions & 3021 deletions
Large diffs are not rendered by default.

Rubberduck.Parsing/Grammar/VBAParser.g4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ blockStmt :
129129
| circleSpecialForm
130130
| scaleSpecialForm
131131
| callStmt
132+
| nameStmt
132133
;
133134

134135

@@ -443,6 +444,8 @@ rsetStmt : RSET whiteSpace expression whiteSpace? EQ whiteSpace? expression;
443444
// 5.4.2.11 Stop Statement
444445
stopStmt : STOP;
445446

447+
nameStmt : NAME whiteSpace expression whiteSpace AS whiteSpace expression;
448+
446449
// 5.4.2.10 Select Case Statement
447450
selectCaseStmt :
448451
SELECT whiteSpace? CASE whiteSpace? selectExpression endOfStatement
@@ -756,6 +759,7 @@ keyword :
756759
| SEEK
757760
| UNLOCK
758761
| WRITE
762+
| NAME
759763
;
760764

761765
markerKeyword : AS;

Rubberduck.Parsing/Grammar/VBAParserBaseListener.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,19 @@ public virtual void EnterDefDirective([NotNull] VBAParser.DefDirectiveContext co
21392139
/// <param name="context">The parse tree.</param>
21402140
public virtual void ExitDefDirective([NotNull] VBAParser.DefDirectiveContext context) { }
21412141

2142+
/// <summary>
2143+
/// Enter a parse tree produced by <see cref="VBAParser.nameStmt"/>.
2144+
/// <para>The default implementation does nothing.</para>
2145+
/// </summary>
2146+
/// <param name="context">The parse tree.</param>
2147+
public virtual void EnterNameStmt([NotNull] VBAParser.NameStmtContext context) { }
2148+
/// <summary>
2149+
/// Exit a parse tree produced by <see cref="VBAParser.nameStmt"/>.
2150+
/// <para>The default implementation does nothing.</para>
2151+
/// </summary>
2152+
/// <param name="context">The parse tree.</param>
2153+
public virtual void ExitNameStmt([NotNull] VBAParser.NameStmtContext context) { }
2154+
21422155
/// <summary>
21432156
/// Enter a parse tree produced by <see cref="VBAParser.typeHint"/>.
21442157
/// <para>The default implementation does nothing.</para>

Rubberduck.Parsing/Grammar/VBAParserBaseVisitor.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,6 +1814,17 @@ public partial class VBAParserBaseVisitor<Result> : AbstractParseTreeVisitor<Res
18141814
/// <return>The visitor result.</return>
18151815
public virtual Result VisitDefDirective([NotNull] VBAParser.DefDirectiveContext context) { return VisitChildren(context); }
18161816

1817+
/// <summary>
1818+
/// Visit a parse tree produced by <see cref="VBAParser.nameStmt"/>.
1819+
/// <para>
1820+
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
1821+
/// on <paramref name="context"/>.
1822+
/// </para>
1823+
/// </summary>
1824+
/// <param name="context">The parse tree.</param>
1825+
/// <return>The visitor result.</return>
1826+
public virtual Result VisitNameStmt([NotNull] VBAParser.NameStmtContext context) { return VisitChildren(context); }
1827+
18171828
/// <summary>
18181829
/// Visit a parse tree produced by <see cref="VBAParser.typeHint"/>.
18191830
/// <para>

Rubberduck.Parsing/Grammar/VBAParserListener.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,17 @@ public interface IVBAParserListener : IParseTreeListener {
18691869
/// <param name="context">The parse tree.</param>
18701870
void ExitDefDirective([NotNull] VBAParser.DefDirectiveContext context);
18711871

1872+
/// <summary>
1873+
/// Enter a parse tree produced by <see cref="VBAParser.nameStmt"/>.
1874+
/// </summary>
1875+
/// <param name="context">The parse tree.</param>
1876+
void EnterNameStmt([NotNull] VBAParser.NameStmtContext context);
1877+
/// <summary>
1878+
/// Exit a parse tree produced by <see cref="VBAParser.nameStmt"/>.
1879+
/// </summary>
1880+
/// <param name="context">The parse tree.</param>
1881+
void ExitNameStmt([NotNull] VBAParser.NameStmtContext context);
1882+
18721883
/// <summary>
18731884
/// Enter a parse tree produced by <see cref="VBAParser.typeHint"/>.
18741885
/// </summary>

Rubberduck.Parsing/Grammar/VBAParserVisitor.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,13 @@ public interface IVBAParserVisitor<Result> : IParseTreeVisitor<Result> {
11931193
/// <return>The visitor result.</return>
11941194
Result VisitDefDirective([NotNull] VBAParser.DefDirectiveContext context);
11951195

1196+
/// <summary>
1197+
/// Visit a parse tree produced by <see cref="VBAParser.nameStmt"/>.
1198+
/// </summary>
1199+
/// <param name="context">The parse tree.</param>
1200+
/// <return>The visitor result.</return>
1201+
Result VisitNameStmt([NotNull] VBAParser.NameStmtContext context);
1202+
11961203
/// <summary>
11971204
/// Visit a parse tree produced by <see cref="VBAParser.typeHint"/>.
11981205
/// </summary>

Rubberduck.Parsing/Preprocessing/VBAConditionalCompilationParser.cs

Lines changed: 130 additions & 126 deletions
Large diffs are not rendered by default.

Rubberduck.Parsing/Preprocessing/VBAConditionalCompilationParser.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ keyword :
207207
| SEEK
208208
| UNLOCK
209209
| WRITE
210+
| NAME
210211
;
211212

212213
markerKeyword : AS;

0 commit comments

Comments
 (0)