Skip to content

Commit d46f6f3

Browse files
author
Tracy Boehrer
committed
Revert "Fix LU parser rules to support all comments in a file (#6744)"
This reverts commit 9f1eb6e.
1 parent 8983135 commit d46f6f3

20 files changed

+847
-1450
lines changed

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/Generated/LUFileLexer.cs

Lines changed: 161 additions & 160 deletions
Large diffs are not rendered by default.

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/Generated/LUFileLexer.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/Generated/LUFileParser.cs

Lines changed: 676 additions & 760 deletions
Large diffs are not rendered by default.

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/Generated/LUFileParser.interp

Lines changed: 1 addition & 2 deletions
Large diffs are not rendered by default.

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/Generated/LUFileParserBaseListener.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,6 @@ public virtual void EnterNewline([NotNull] LUFileParser.NewlineContext context)
7272
/// <param name="context">The parse tree.</param>
7373
public virtual void ExitNewline([NotNull] LUFileParser.NewlineContext context) { }
7474
/// <summary>
75-
/// Enter a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
76-
/// <para>The default implementation does nothing.</para>
77-
/// </summary>
78-
/// <param name="context">The parse tree.</param>
79-
public virtual void EnterCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context) { }
80-
/// <summary>
81-
/// Exit a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
82-
/// <para>The default implementation does nothing.</para>
83-
/// </summary>
84-
/// <param name="context">The parse tree.</param>
85-
public virtual void ExitCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context) { }
86-
/// <summary>
8775
/// Enter a parse tree produced by <see cref="LUFileParser.errorString"/>.
8876
/// <para>The default implementation does nothing.</para>
8977
/// </summary>

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/Generated/LUFileParserBaseVisitor.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ public partial class LUFileParserBaseVisitor<Result> : AbstractParseTreeVisitor<
6565
/// <return>The visitor result.</return>
6666
public virtual Result VisitNewline([NotNull] LUFileParser.NewlineContext context) { return VisitChildren(context); }
6767
/// <summary>
68-
/// Visit a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
69-
/// <para>
70-
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
71-
/// on <paramref name="context"/>.
72-
/// </para>
73-
/// </summary>
74-
/// <param name="context">The parse tree.</param>
75-
/// <return>The visitor result.</return>
76-
public virtual Result VisitCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context) { return VisitChildren(context); }
77-
/// <summary>
7868
/// Visit a parse tree produced by <see cref="LUFileParser.errorString"/>.
7969
/// <para>
8070
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/Generated/LUFileParserListener.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ public interface ILUFileParserListener : IParseTreeListener {
6161
/// <param name="context">The parse tree.</param>
6262
void ExitNewline([NotNull] LUFileParser.NewlineContext context);
6363
/// <summary>
64-
/// Enter a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
65-
/// </summary>
66-
/// <param name="context">The parse tree.</param>
67-
void EnterCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context);
68-
/// <summary>
69-
/// Exit a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
70-
/// </summary>
71-
/// <param name="context">The parse tree.</param>
72-
void ExitCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context);
73-
/// <summary>
7464
/// Enter a parse tree produced by <see cref="LUFileParser.errorString"/>.
7565
/// </summary>
7666
/// <param name="context">The parse tree.</param>

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/Generated/LUFileParserVisitor.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ public interface ILUFileParserVisitor<Result> : IParseTreeVisitor<Result> {
5050
/// <return>The visitor result.</return>
5151
Result VisitNewline([NotNull] LUFileParser.NewlineContext context);
5252
/// <summary>
53-
/// Visit a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
54-
/// </summary>
55-
/// <param name="context">The parse tree.</param>
56-
/// <return>The visitor result.</return>
57-
Result VisitCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context);
58-
/// <summary>
5953
/// Visit a parse tree produced by <see cref="LUFileParser.errorString"/>.
6054
/// </summary>
6155
/// <param name="context">The parse tree.</param>

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/LUFileLexer.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ MODEL_INFO
5454
;
5555

5656
COMMENT
57-
: WS* '>' ~('\r'|'\n')*
57+
: WS* '>' ~('\r'|'\n')* -> skip
5858
;
5959

6060
QNA

libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/LUFileParser.g4

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ paragraph
1616
| referenceSection
1717
| qnaSection
1818
| modelInfoSection
19-
| commentDefinition
2019
;
2120

2221
// Treat EOF as newline to hanle file end gracefully
@@ -26,10 +25,6 @@ newline
2625
: WS* (NEWLINE | EOF)
2726
;
2827

29-
commentDefinition
30-
: COMMENT NEWLINE?
31-
;
32-
3328
errorString
3429
: (WS|INVALID_TOKEN_DEFAULT_MODE)+
3530
;
@@ -79,7 +74,7 @@ intentBody
7974
;
8075

8176
normalIntentBody
82-
: WS* ((normalIntentString newline) | errorString | commentDefinition)+
77+
: WS* ((normalIntentString newline) | errorString)+
8378
;
8479

8580
normalIntentString

0 commit comments

Comments
 (0)