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

dartc should ignore leading newline in multi-line strings, like VM #398

Closed
DartBot opened this issue Nov 9, 2011 · 9 comments
Closed

dartc should ignore leading newline in multi-line strings, like VM #398

DartBot opened this issue Nov 9, 2011 · 9 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report
Milestone

Comments

@DartBot
Copy link

DartBot commented Nov 9, 2011

This issue was originally filed by [email protected]


main() {
  var str = """
hello
""";
  Expect.equals("h", str[0], "str should begin with h (no leading newline)");
}

Background in issue #240: <http://code.google.com/p/dart/issues/detail?id=240>.

@DartBot
Copy link
Author

DartBot commented Nov 9, 2011

This comment was originally written by [email protected]


Added Area-Compiler, Triaged labels.

@scheglov
Copy link
Contributor

Set owner to @scheglov.

@scheglov
Copy link
Contributor

Yes, but what is NEWLINE?
According to spec right now:

NEWLINE:
\n' | \r'
;

  So, NEWLINE is '\n' or '\r'

  However 03_3_Strings_A03_t01.dart and all co19/src/LangGuideTest/03_Values tests use Windows style newline "\r\n".
  So, these tests are invalid, or spec should state that '\r\n' is also valid NEWLINE.

  JFYI, DartC right now skips leading '\n' (and only it).
  I can easily add '\r', but I can not add '\r\n' because it is not in spec.

@DartBot
Copy link
Author

DartBot commented Mar 28, 2012

This comment was originally written by [email protected]


Not an issue for dartc anymore, but possibly a co19 or spec issue.


Removed the owner.
Removed Area-Compiler label.
Added New label.

@anders-sandholm
Copy link
Contributor

Peter/Gilad, not sure if this is still an issue and if so whether it is a co19 or spec issue.


cc @peter-ahe-google.
Added Area-Language, Triaged labels.

@whesse
Copy link
Contributor

whesse commented Mar 29, 2012

I don't see a definition of NEWLINE in the spec any more. I think it is important that we explain exactly what is done with newline sequences in all situations, and that \r\n and \n are accepted as newlines. Is there ever a case in which we want to emit a \r\n without writing it explicitly? If there was a text-mode file write for Windows, we might.

@peter-ahe-google
Copy link
Contributor

If you search for NEWLINE, you get this hit on page 43:

NEWLINE:
\n| \r
;

This definition is not good enough. I think we should just adopt the convention from XML http://www.w3.org/TR/REC-xml/#sec-line-ends

This means that all newlines are normalized to \n. Notice that it is not good enough to simply say that \r is translated to \n.


Set owner to @gbracha.
Added Accepted label.

@anders-sandholm
Copy link
Contributor

Added this to the M1 milestone.

@gbracha
Copy link
Contributor

gbracha commented May 3, 2012

This is so close to 240 that I'm merging them.


Added Duplicate label.
Marked as being merged into #240.

@DartBot DartBot added Type-Defect area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report labels May 3, 2012
@DartBot DartBot added this to the M1 milestone May 3, 2012
nex3 pushed a commit that referenced this issue Aug 31, 2016
Allow disabling named param destructuring with --destructure-named-params (issue #396)
srburton added a commit to srburton/sdk that referenced this issue Jan 25, 2023
copybara-service bot pushed a commit that referenced this issue Jan 2, 2024
…watcher, yaml, yaml_edit

Revisions updated by `dart tools/rev_sdk_deps.dart`.

crypto (https://github.com/dart-lang/crypto/compare/63e9a90..f2efb98):
  f2efb98  2024-01-02  Kevin Moore  Require Dart 3.2, update and fix lints (#158)

logging (https://github.com/dart-lang/logging/compare/324a0b5..4d35a4e):
  4d35a4e  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#152)

mime (https://github.com/dart-lang/mime/compare/56359b0..ca9f059):
  ca9f059  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#111)

path (https://github.com/dart-lang/path/compare/115ea2a..57a049c):
  57a049c  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#157)
  5b6aac7  2023-12-20  Kevin Moore  blast_repo fixes (#156)

pool (https://github.com/dart-lang/pool/compare/3c1bd42..4c49000):
  4c49000  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#79)
  7e03d80  2023-12-20  Kevin Moore  blast_repo fixes (#78)

shelf (https://github.com/dart-lang/shelf/compare/b3adc7c..733588f):
  733588f  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#401)
  1eab426  2024-01-01  dependabot[bot]  Bump actions/labeler from 4.3.0 to 5.0.0 (#402)
  10cbffe  2023-12-14  Kevin Moore  Run web tests with wasm with dev Dart sdk (#398)

stack_trace (https://github.com/dart-lang/stack_trace/compare/4abff44..0f4710c):
  0f4710c  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#148)

tools (https://github.com/dart-lang/tools/compare/ed81684..2f59ab4):
  2f59ab4  2024-01-02  Daco Harkes  [graphs] Clean up lints for Dart 3.3 (#221)
  01fa883  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#223)
  9d4fe2f  2024-01-01  dependabot[bot]  Bump actions/labeler from 4.3.0 to 5.0.0 (#222)
  6d260b8  2023-12-14  Elias Yishak  Update USAGE_GUIDE to update the `flutterChannelCount` key in `LogFileStats` (#219)
  56a30ce  2023-12-11  Elias Yishak  Add `enabledFeatures` key to `Analytics` constructors (#217)

watcher (https://github.com/dart-lang/watcher/compare/dc45f19..66cd694):
  66cd694  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#161)
  679d308  2023-12-20  Kevin Moore  blast_repo fixes (#160)

yaml (https://github.com/dart-lang/yaml/compare/98a3aab..509fd72):
  509fd72  2023-12-11  Kevin Moore  update lints, require Dart 3.0 (#156)

yaml_edit (https://github.com/dart-lang/yaml_edit/compare/9b9d33c..47eb20e):
  47eb20e  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (#63)
  a39ec39  2023-12-20  Kevin Moore  blast_repo fixes (#62)

Change-Id: I8009f4957a0eb751f36c2ec1be8aacbfc44ca586
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344400
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Devon Carew <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

6 participants