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

Improve recovery for unterminated interpolated expressions #946

Closed
jtmcdole opened this issue Dec 22, 2011 · 12 comments
Closed

Improve recovery for unterminated interpolated expressions #946

jtmcdole opened this issue Dec 22, 2011 · 12 comments
Labels
analyzer-recovery area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@jtmcdole
Copy link
Contributor

When processing the following:
  main() {
    print("${42");
    foo();
    bar();
    baz();
    print("end");
  }

The scanner will keep scanning as in an embedded expression till EOS (and then insert the STRING_EMBED_EXP_END + ILLEGAL). The part trailing ${42, ");", will be lost from the token stream.

Parsing errors consumes to much and doesn't known about the single-line string vs multi-line string state. The expression, 42, is returned while parsing the string and the ILLEGAL token is consumed and the rest of the program is encoded as part of the string:
    DartFunction
      DartBlock
        DartExprStmt
          DartUnqualifiedInvocation
            DartIdentifier (print)
            DartStringInterpolation
              DartStringLiteral ("")
              DartStringLiteral ("")
              DartStringLiteral ("")
              DartStringLiteral ("")
              DartStringLiteral ("")
              DartStringLiteral ("")
              DartStringLiteral ("")
              DartIntegerLiteral (42)
              DartSyntheticErrorExpression( (foo))
              DartSyntheticErrorExpression( (bar))
              DartSyntheticErrorExpression( (baz))
              DartSyntheticErrorExpression( (print))
              DartSyntheticErrorExpression( (end))

@kasperl
Copy link

kasperl commented Apr 17, 2012

Removed Area-Compiler label.
Added Area-Analyzer label.

@danrubel
Copy link

danrubel commented Jun 4, 2012

Added this to the M1 milestone.

@bwilkerson
Copy link
Member

Removed this from the M1 milestone.
Added this to the Later milestone.

@bwilkerson
Copy link
Member

Removed this from the Later milestone.
Added this to the M3 milestone.

@scheglov
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the Later milestone.
Added AnalysisEngine label.

@DartBot
Copy link

DartBot commented Apr 7, 2013

This comment was originally written by amouravski@google.com


Added Editor-AnalysisEngine label.

@bwilkerson
Copy link
Member

Analysis engine does a better job, but produces too many errors.


Set owner to @bwilkerson.
Removed AnalysisEngine, Editor-AnalysisEngine labels.
Changed the title to: "Improve recovery for unterminated interpolated expressions".

@bwilkerson
Copy link
Member

Added Analyzer-Recovery label.

@bwilkerson
Copy link
Member

Removed Type-Defect label.
Added Type-Enhancement label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@bwilkerson
Copy link
Member

Issue #2168 has been merged into this issue.

@jtmcdole jtmcdole added Priority-Medium area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-recovery labels Dec 8, 2014
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged type-enhancement A request for a change that isn't a bug labels Feb 29, 2016
@bwilkerson bwilkerson removed their assignment Aug 15, 2016
@lrhn lrhn added the closed-obsolete Closed as the reported issue is no longer relevant label Oct 14, 2019
@lrhn lrhn closed this as completed Oct 14, 2019
dart-bot pushed a commit that referenced this issue Oct 9, 2020
2020-10-09 irina.arkhipets@gmail.com Fixes #946: i-2-b typedef tests updated, missing Issue tags added.
2020-10-09 sgrekhov@unipro.ru Local variable reading tests fixed to not to fail on tryjobs

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try
Change-Id: I5e261e2a3a09087a44e872826eade8208aed5e83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166638
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
dart-bot pushed a commit that referenced this issue Nov 19, 2020
2020-11-19 sgrekhov@unipro.ru #926.Add Platform.executableArguments to Process.run() command to not to fail on --enable-assert configuration
2020-11-19 sgrekhov@unipro.ru #926.Add Platform.executableArguments to Process.run() command to not to fail on --enable-assert configuration
2020-11-18 sgrekhov@unipro.ru Fixes #966. Move certificates to RawSecureServerSocket directory
2020-11-18 sgrekhov@unipro.ru #926. Fixed test that fail on precompiled environment in a strong mode
2020-11-17 sgrekhov@unipro.ru Fixes #951. Remove excessive @static-warning
2020-11-17 irina.arkhipets@gmail.com Fixes #946: LanguageFeatures/Instantiate-to-bound/nonfunction_typedef tests updated according to the SDK changes, missing tests added.
2020-11-17 sgrekhov@unipro.ru #932. Some HttpRequest tests fixed to work well with cross origin requests
2020-11-16 sgrekhov@unipro.ru Process kill test fixed to work on different platforms
2020-11-16 sgrekhov@unipro.ru External variable test that expects compile time error on dart2js added
2020-11-13 sgrekhov@unipro.ru Fixes #926. Remove "--enable-experiment=non-nullable" option from script that runs another process
2020-11-12 sgrekhov@unipro.ru #926. File lock checking tests rewritten to not to fail on precompiled environment. Second part
2020-11-12 irina.arkhipets@gmail.com Fixes #602: Missing issue tags added.
2020-11-11 sgrekhov@unipro.ru #926. File lock checking tests rewritten to not to fail on precompiled environment
2020-11-11 sgrekhov@unipro.ru Issue numbers added
2020-11-11 irina.arkhipets@gmail.com Fixes #963: test expected result corrected, test template for all generic typedefs updated.
2020-11-10 sgrekhov@unipro.ru #926. ProcessSignal tests rewritten to not to fail on precompiled environment
2020-11-10 sgrekhov@unipro.ru #926. Process tests rewritten to not to fail on precompiled environment
2020-11-10 sgrekhov@unipro.ru #961. Process tests rewritten to not to use process_test tool
2020-11-10 irina.arkhipets@gmail.com Fixes #602: Missing Issue tag added.
2020-11-10 sgrekhov@unipro.ru Fixes #960. Null safety execution modes renamed and mentions of obsolete checked mode removed
2020-11-10 sgrekhov@unipro.ru Remove wrong error expectations
2020-11-09 sgrekhov@unipro.ru Fixes #962. Change CFE error messages expectations
2020-11-08 irina.arkhipets@gmail.com Fixes #602: New tests for least and greatest closures added.

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-win-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-win-release-x64-try
Change-Id: I7aff067ec96f762490de15daa20c40dff2b0ae96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172940
Reviewed-by: William Hesse <whesse@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-recovery area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

8 participants