Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PORT][LG] Robust Template CRUD with Two-phase parsing of LG #2074

Merged
merged 8 commits into from
Apr 22, 2020

Conversation

Danieladu
Copy link
Contributor

Close: #2062
Use two-phase to parse the LG content.
The first phase just split the templates and get a clear template division.
Second phase parse template body with more elaborate rules.

  • Advantage:
    The division of the template does not depend on some internal errors in a template, making the division of the template more robust, which makes the CRUD of the template more friendly.
  • Disadvantage:
    [Engineering]It will be more difficult to merge the two-phase diagnostics.

new features:
Import and Option definition should in front of templates.
so,

# template
- hi

[import](a.lg)  -> invalid
> !# @strict = true -> invalid
[import](a.lg)  -> valid
> !# @strict = true -> valid

# template
- hi

@coveralls
Copy link

coveralls commented Apr 21, 2020

Pull Request Test Coverage Report for Build 122755

  • 191 of 220 (86.82%) changed or added relevant lines in 14 files are covered.
  • 11 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.02%) to 77.446%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder-lg/src/sourceRange.ts 11 12 91.67%
libraries/botbuilder-lg/src/templateExtensions.ts 9 10 90.0%
libraries/botbuilder-lg/src/evaluator.ts 3 5 60.0%
libraries/botbuilder-lg/src/expander.ts 3 5 60.0%
libraries/botbuilder-lg/src/staticChecker.ts 18 20 90.0%
libraries/botbuilder-lg/src/templatesParser.ts 117 126 92.86%
libraries/botbuilder-lg/src/extractor.ts 1 13 7.69%
Files with Coverage Reduction New Missed Lines %
libraries/botbuilder-lg/src/analyzer.ts 1 93.75%
libraries/botbuilder-lg/src/staticChecker.ts 1 95.97%
libraries/botframework-streaming/src/webSocket/webSocketTransport.ts 2 80.65%
libraries/botframework-streaming/src/webSocket/webSocketServer.ts 7 66.67%
Totals Coverage Status
Change from base Build 122742: 0.02%
Covered Lines: 11879
Relevant Lines: 14618

💛 - Coveralls

@Danieladu Danieladu merged commit 13b240a into master Apr 22, 2020
@Danieladu Danieladu deleted the hond/parser branch April 22, 2020 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PORT] [LG] Robust Template CRUD with Two-phase parsing of LG
3 participants