Skip to content

[PORT] [LG] Move "EXPRESSION" in LG from lexer to parser #1123

@tomlm

Description

@tomlm

Port this change from botbuilder-dotnet/master branch:
microsoft/botbuilder-dotnet#3898

close: #3840
Move "EXPRESSION" in LG from token to parser to get more detailed contextual information.
Which would benefit some external tools like Expression debugging tool.

Orignially, customers can not anchor the expression correctly, they can only get the context of the whole content which contains this expression. For example, for multiline context,

# template
 - ```
 ${expression1}
 ${expression2}```

in this situation, the code range of "expression1" we can get is [1 ~ 3], which is the whole content of multi-line, But after migrating experssion from token to parser, we can locate the "expression1" correctly, which starts from line 2, char 1, to line 2, char 14. That would be very helpful for some debugging tools.

For example, in adaptive-tool debugging tool, if someone wants to set a breaking point for a expression in multiline, it is not possible, because you should set the whole multiline as the breaking point. The change of this pr make is possible.
In another case, if someone wants to set a breaking point for different expressions which in the same line, originally, it is impossible.
- ${expr1} ${expr2},
Because the minimum granularity of the context is the normal template line. But, now , it is possible. You can set a single breaking point for only "expr2" or just for "expr1"

Changed projects

  • Microsoft.Bot.Builder.LanguageGeneration
  • Microsoft.Bot.Builder.LanguageGeneration.Tests

[R10]

Metadata

Metadata

Assignees

No one assigned

    Labels

    R10Release 10 - August 17th, 2020

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions