-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Language spec must describe semantics of leading newline in multiline string #240
Comments
This comment was originally written by @mhausner This is actually a feature, not a bug. The language spec is lacking a description of this. Making this a spec bug. Changed the title to: "Language spec must describe semantics of leading newline in multiline string". |
This comment was originally written by @mhausner Added Area-Language label. |
This comment was originally written by [email protected] If this is a feature then there's still an implementation bug to fix (in dartc). Should I open another issue for that or will you adjust the title? I'd like to discuss this feature more, starting a thread about that on misc. |
This comment was originally written by [email protected] The discussion in misc suggests that this is actually a bug, not a feature. I suggest that the original title of the bugreport is restored and that it's assigned to VM. I cannot retrieve the original title but it was something along the lines of "Dart VM ignores leading newline in multiline string". <https://groups.google.com/a/dartlang.org/group/misc/browse_thread/thread/349f1cbb1bbb5ed4#> |
The current behaviour in the VM is as it was initially intended. Since this is not clear in the spec I am keeping this as a language/spec bug. The final resolution of this bug is either a clearer specification or it might be a change to the spec at which point we will update the VM implementation. |
This comment was originally written by [email protected] I filed issue #398: "dartc should ignore leading newline in multi-line strings, like VM" |
Yes, but what is NEWLINE? NEWLINE: 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". JFYI, DartC right now skips leading '\n' (and only it). |
This comment was originally written by [email protected] dartc and the VM being consistent (accepting '\r\n' as newline) would be a good thing. The spec defining it clearly, likewise. Right now try.dartlang fails on the example <http://try.dartlang.org/s/BYUf> which is a bit confusing to those trying out the language. |
Added apr30-triage label. |
Removed apr30-triage label. |
Added triage1 label. |
Issue #398 has been merged into this issue. |
Fixed in 0.09 draft. Added Done label. |
Adds: * Fix to `public_member_api_docs` to check for documented getters when checking setters (#237). * New `iterable_contains_unrelated_type` lint to detect when `Iterable.contains` is invoked with an object of an unrelated type. * New `comment_references` lint to ensure identifiers referenced in docs are in scope (#240). BUG= [email protected] Review URL: https://codereview.chromium.org/1993863002 .
…ion, convert, crypto, csslib, ffi, fixnum, glob, html, http_multi_server, http_parser, json_rpc_2, logging, mime, package_config, pool, pub_semver, source_map_stack_trace, sse, stack_trace, stream_channel, string_scanner, term_glyph, test_descriptor, tools, typed_data, web_socket_channel, webdev, yaml, yaml_edit Revisions updated by `dart tools/rev_sdk_deps.dart`. async (https://github.com/dart-lang/async/compare/b9ed219..0f368d3): 0f368d3 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#240) benchmark_harness (https://github.com/dart-lang/benchmark_harness/compare/e591ec4..f81b042): f81b042 2023-05-08 Devon Carew Update pubspec.yaml (#89) 1dc07da 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#88) boolean_selector (https://github.com/dart-lang/boolean_selector/compare/9fd3bae..7eed402): 7eed402 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#46) clock (https://github.com/dart-lang/clock/compare/6b2004c..6b9df3e): 6b9df3e 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#50) collection (https://github.com/dart-lang/collection/compare/bf27520..6abff47): 6abff47 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#282) convert (https://github.com/dart-lang/convert/compare/855aeac..b652c00): b652c00 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#82) crypto (https://github.com/dart-lang/crypto/compare/c5403c8..4e9dde1): 4e9dde1 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#147) csslib (https://github.com/dart-lang/csslib/compare/44bfbe3..923edf0): 923edf0 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#178) ffi (https://github.com/dart-lang/ffi/compare/6d8fa8d..1a859e0): 1a859e0 2023-05-09 Michael Thomsen Add topics in pubspec.yaml (#192) fixnum (https://github.com/dart-lang/fixnum/compare/92ec336..006a130): 006a130 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#111) glob (https://github.com/dart-lang/glob/compare/eaa878b..46403be): 46403be 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#76) html (https://github.com/dart-lang/html/compare/5d87dc8..593d6f6): 593d6f6 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#214) http_multi_server (https://github.com/dart-lang/http_multi_server/compare/e0b5d35..d1fffed): d1fffed 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#54) http_parser (https://github.com/dart-lang/http_parser/compare/bbe37dd..5a33f5f): 5a33f5f 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#72) json_rpc_2 (https://github.com/dart-lang/json_rpc_2/compare/5da2705..800843e): 800843e 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#96) logging (https://github.com/dart-lang/logging/compare/787030a..4779d7e): 4779d7e 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#136) mime (https://github.com/dart-lang/mime/compare/2d8496d..cd8001e): cd8001e 2023-05-09 Lara Schütt Add `text/markdown` mimeType lookup by extension (#85) a0ea506 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#93) package_config (https://github.com/dart-lang/package_config/compare/7e09db1..f41f92c): f41f92c 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#134) pool (https://github.com/dart-lang/pool/compare/650e5d3..86b4f43): 86b4f43 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#68) pub_semver (https://github.com/dart-lang/pub_semver/compare/c3e56d1..6dd1908): 6dd1908 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#85) source_map_stack_trace (https://github.com/dart-lang/source_map_stack_trace/compare/08a81a8..09715f9): 09715f9 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#38) sse (https://github.com/dart-lang/sse/compare/f947c3d..11ba89e): 11ba89e 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#83) stack_trace (https://github.com/dart-lang/stack_trace/compare/9c1b1c5..36fa0e1): 36fa0e1 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#130) stream_channel (https://github.com/dart-lang/stream_channel/compare/71d4690..a862e41): a862e41 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#90) string_scanner (https://github.com/dart-lang/string_scanner/compare/f7a656f..3bc6e54): 3bc6e54 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#57) term_glyph (https://github.com/dart-lang/term_glyph/compare/b110501..3de5f1b): 3de5f1b 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#37) test_descriptor (https://github.com/dart-lang/test_descriptor/compare/aa11162..23e49a2): 23e49a2 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#51) tools (https://github.com/dart-lang/tools/compare/6c68bca..62c9604): 62c9604 2023-05-08 dependabot[bot] Bump coverallsapp/github-action from 2.0.0 to 2.1.2 (#88) fde75bf 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#89) typed_data (https://github.com/dart-lang/typed_data/compare/d85363d..021f25a): 021f25a 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#64) web_socket_channel (https://github.com/dart-lang/web_socket_channel/compare/b28bae6..2630714): 2630714 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#265) webdev (https://github.com/dart-lang/webdev/compare/12f2285..fe5b975): fe5b9758 2023-05-08 Anna Gringauze Hide internal implementation details in type objects (#2103) yaml (https://github.com/dart-lang/yaml/compare/54e8284..1f39ffe): 1f39ffe 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#142) yaml_edit (https://github.com/dart-lang/yaml_edit/compare/e05282b..763ca94): 763ca94 2023-05-08 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#51) Change-Id: Ie2414a72f1377775a474ef976c2f9c797ed5b0a5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302360 Reviewed-by: Konstantin Shcheglov <[email protected]> Auto-Submit: Devon Carew <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
matcher (https://github.com/dart-lang/matcher/compare/fcbd361..d9cf4f6): d9cf4f6 2024-01-01 dependabot[bot] Bump actions/stale from 8.0.0 to 9.0.0 (#240) 7ea9047 2023-12-13 Kevin Moore Update test_api dependency, bump & fix lints, prepare release (#237) 050fdda 2023-12-13 Kevin Moore blast_repo fixes (#238) mockito (https://github.com/dart-lang/mockito/compare/57a7c82..e15e000): e15e000 2023-12-14 Sam Rawlins Bump mockito to 5.4.4 a2a6566 2023-12-14 Copybara-Service Merge pull request #726 from provokateurin:chore/deps/test_api-0.7 bda332c 2023-12-14 jld3103 chore(deps): Allow test_api 0.7 9bd6fb0 2023-12-12 Paul Berry Remove mockito pre-null-safety tests. test (https://github.com/dart-lang/test/compare/43ff5bf..846d73e): 846d73ee 2024-01-01 dependabot[bot] Bump actions/upload-artifact from 3.1.3 to 4.0.0 (#2165) 0ab56790 2024-01-01 dependabot[bot] Bump actions/stale from 8.0.0 to 9.0.0 (#2167) 3b960c3e 2024-01-01 dependabot[bot] Bump github/codeql-action from 2.22.8 to 3.22.12 (#2166) 30543cae 2023-12-19 Nate Bosch Add more logging around iframe startup (#2160) e56a5e22 2023-12-13 Jacob MacDonald small cleanup in catch (#2159) 15b39372 2023-12-13 Jacob MacDonald handle missing package config files (#2158) 9667cca8 2023-12-13 Jacob MacDonald release test_api 7.0.0, test_core 6.0.0, and test 1.25.0 (#2156) b3fb1486 2023-12-13 Nate Bosch Remove support for Internet Explorer (#2114) 48a2bc3d 2023-12-13 Derek Xu Update the package:vm_service constraint to allow version 14.x (#2157) Change-Id: I386444652c47cd14a61665599d86dc3a7669a2fc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345341 Reviewed-by: Nate Bosch <[email protected]> Commit-Queue: Devon Carew <[email protected]>
This issue was originally filed by [email protected]
A multiline string literal that doesn't include a leading newline (i.e. """hello...) is parsed correctly but when the literal includes at least one leading newline, the first of those is ignored. dartc doesn't have the bug.
main() {
var str = """
hello
""";
Expect.equals("\n", str[0], "str should include a leading newline");
}
The text was updated successfully, but these errors were encountered: