Skip to content

Commit

Permalink
Revert "Fix LU parser rules to support all comments in a file (#6744)"
Browse files Browse the repository at this point in the history
This reverts commit 9f1eb6e.
  • Loading branch information
Tracy Boehrer committed Feb 6, 2024
1 parent 8983135 commit d46f6f3
Show file tree
Hide file tree
Showing 20 changed files with 847 additions and 1,450 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,436 changes: 676 additions & 760 deletions libraries/Parsers/Microsoft.Bot.Builder.Parsers.LU/Generated/LUFileParser.cs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,6 @@ public virtual void EnterNewline([NotNull] LUFileParser.NewlineContext context)
/// <param name="context">The parse tree.</param>
public virtual void ExitNewline([NotNull] LUFileParser.NewlineContext context) { }
/// <summary>
/// Enter a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
/// <para>The default implementation does nothing.</para>
/// </summary>
/// <param name="context">The parse tree.</param>
public virtual void EnterCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context) { }
/// <summary>
/// Exit a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
/// <para>The default implementation does nothing.</para>
/// </summary>
/// <param name="context">The parse tree.</param>
public virtual void ExitCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context) { }
/// <summary>
/// Enter a parse tree produced by <see cref="LUFileParser.errorString"/>.
/// <para>The default implementation does nothing.</para>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ public partial class LUFileParserBaseVisitor<Result> : AbstractParseTreeVisitor<
/// <return>The visitor result.</return>
public virtual Result VisitNewline([NotNull] LUFileParser.NewlineContext context) { return VisitChildren(context); }
/// <summary>
/// Visit a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
/// <para>
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
/// on <paramref name="context"/>.
/// </para>
/// </summary>
/// <param name="context">The parse tree.</param>
/// <return>The visitor result.</return>
public virtual Result VisitCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context) { return VisitChildren(context); }
/// <summary>
/// Visit a parse tree produced by <see cref="LUFileParser.errorString"/>.
/// <para>
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,6 @@ public interface ILUFileParserListener : IParseTreeListener {
/// <param name="context">The parse tree.</param>
void ExitNewline([NotNull] LUFileParser.NewlineContext context);
/// <summary>
/// Enter a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
void EnterCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context);
/// <summary>
/// Exit a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
void ExitCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context);
/// <summary>
/// Enter a parse tree produced by <see cref="LUFileParser.errorString"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ public interface ILUFileParserVisitor<Result> : IParseTreeVisitor<Result> {
/// <return>The visitor result.</return>
Result VisitNewline([NotNull] LUFileParser.NewlineContext context);
/// <summary>
/// Visit a parse tree produced by <see cref="LUFileParser.commentDefinition"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
/// <return>The visitor result.</return>
Result VisitCommentDefinition([NotNull] LUFileParser.CommentDefinitionContext context);
/// <summary>
/// Visit a parse tree produced by <see cref="LUFileParser.errorString"/>.
/// </summary>
/// <param name="context">The parse tree.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ MODEL_INFO
;

COMMENT
: WS* '>' ~('\r'|'\n')*
: WS* '>' ~('\r'|'\n')* -> skip
;

QNA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ paragraph
| referenceSection
| qnaSection
| modelInfoSection
| commentDefinition
;

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

commentDefinition
: COMMENT NEWLINE?
;

errorString
: (WS|INVALID_TOKEN_DEFAULT_MODE)+
;
Expand Down Expand Up @@ -79,7 +74,7 @@ intentBody
;

normalIntentBody
: WS* ((normalIntentString newline) | errorString | commentDefinition)+
: WS* ((normalIntentString newline) | errorString)+
;

normalIntentString
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@
"errorMsgs": [

],
"contextText": " - Please set {deviceTemperature = thermostat to 72}",
"contextText": "- Please set {deviceTemperature = thermostat to 72}",
"range": {
"Start": {
"Line": 17,
"Character": 0
"Character": 4
},
"End": {
"Line": 17,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"Severity": "ERROR"
},
{
"Message": "syntax error: extraneous input 'ml' expecting {<EOF>, WS, NEWLINE, QNA_SOURCE_INFO, MODEL_INFO, COMMENT, QNA, HASH, '$', '@', IMPORT, REFERENCE, QNA_ID_MARK}",
"Message": "syntax error: extraneous input 'ml' expecting {<EOF>, WS, NEWLINE, QNA_SOURCE_INFO, MODEL_INFO, QNA, HASH, '$', '@', IMPORT, REFERENCE, QNA_ID_MARK}",
"Range": {
"Start": {
"Line": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"Severity": "ERROR"
},
{
"Message": "syntax error: extraneous input 'regex' expecting {<EOF>, WS, NEWLINE, QNA_SOURCE_INFO, MODEL_INFO, COMMENT, QNA, HASH, '$', '@', IMPORT, REFERENCE, QNA_ID_MARK}",
"Message": "syntax error: extraneous input 'regex' expecting {<EOF>, WS, NEWLINE, QNA_SOURCE_INFO, MODEL_INFO, QNA, HASH, '$', '@', IMPORT, REFERENCE, QNA_ID_MARK}",
"Range": {
"Start": {
"Line": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"Severity": "ERROR"
},
{
"Message": "syntax error: extraneous input 'abc' expecting {<EOF>, WS, NEWLINE, QNA_SOURCE_INFO, MODEL_INFO, COMMENT, QNA, HASH, '$', '@', IMPORT, REFERENCE, QNA_ID_MARK}",
"Message": "syntax error: extraneous input 'abc' expecting {<EOF>, WS, NEWLINE, QNA_SOURCE_INFO, MODEL_INFO, QNA, HASH, '$', '@', IMPORT, REFERENCE, QNA_ID_MARK}",
"Range": {
"Start": {
"Line": 2,
Expand Down
Loading

0 comments on commit d46f6f3

Please sign in to comment.