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

Adjacent strings auto-concatenation not implemented in VM #1867

Closed
sethladd opened this issue Feb 27, 2012 · 9 comments
Closed

Adjacent strings auto-concatenation not implemented in VM #1867

sethladd opened this issue Feb 27, 2012 · 9 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug
Milestone

Comments

@sethladd
Copy link
Contributor

The removal of + from String has necessitated a way to handle long, multi-line strings. The proposed solution:

var superLongString = 'this is a crazy long string and yet I cannot stop typing it'
                                 'even after I go to another line the typing, it just does not stop';

This is not yet implemented in VM.

@kasperl
Copy link

kasperl commented Mar 9, 2012

I think this is already implemented. Matthias?


Set owner to @mhausner.
Added Started label.

@DartBot
Copy link

DartBot commented Mar 9, 2012

This comment was originally written by @mhausner


Yes, this is done.


Added Fixed label.

@DartBot
Copy link

DartBot commented Jul 6, 2012

This comment was originally written by rodion...@unipro.ru


It seems that multi-line strings are concatenated as well now, although spec doesn't mention they should be. (10.5: Adjacent single line strings are implicitly concatenated to form a single string literal.)
Which one is in the wrong: VM or spec?

Example:
  var s = 'a'
          "b"
          '''c'''
          """d"""
          """
e"""
          '''
f''';
  Expect.equals('abcdef', s);

@DartBot
Copy link

DartBot commented Jul 6, 2012

This comment was originally written by @mhausner


Gilad, can you please clarify the spec if necessary?


Set owner to @gbracha.
Removed Area-VM label.
Added Area-Language, Triaged labels.

@gbracha
Copy link
Contributor

gbracha commented Jul 6, 2012

The grammar allows for adjacent strings to be concatenated in both the single line and multiline spec. The text did only discuss this for single line strings; I am correcting this in version 0.11.


Added this to the M1 milestone.
Added Accepted label.

@gbracha
Copy link
Contributor

gbracha commented Jul 11, 2012

Fixed in 0.11 draft


Added Done label.

@DartBot
Copy link

DartBot commented Nov 28, 2012

This comment was originally written by @tomyeh


This feature seems to be error prone. For example, when instantiating a list of strings, two consecutive strings usually imply the missing of a comma rather than concatenation:

var list = ["apple" "orange"];

With this feature, it is hard to spot an error like this. I'd suggest to simply signal an error rather than concatenate them together. After all, multiline strings are powerful enough to handle it.

@sethladd
Copy link
Contributor Author

Hi Tom, This might be a good feature request for Dart Editor. The editor could issue a warning here (or a to-be-defined "head's up" feedback) about this case. Please open a new feature request if you agree. Thanks for the feedback!

@DartBot
Copy link

DartBot commented Nov 29, 2012

This comment was originally written by @tomyeh


Could do but, IMO, it is more about the language spec. If Dart team still thinks the value greater than the cost, we have to get used it. No language is perfect. However, I think it is an over-kill feature. IMO, with multi-line string and ${}, I don't see there is a need for this feature.

BTW, I don't use Dart Editor. It is great but not fast enough comparing to Sublime or like.

@sethladd sethladd added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Nov 29, 2012
@sethladd sethladd added this to the M1 milestone Nov 29, 2012
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
copybara-service bot pushed a commit that referenced this issue Jan 31, 2023
…g, mockito, package_config, shelf, string_scanner, test, webdev

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

async (https://github.com/dart-lang/async/compare/f700e9a..f700e9a):
  f700e9a  2023-01-27  Devon Carew  blast_repo fixes (#231)

characters (https://github.com/dart-lang/characters/compare/4526aa8..4526aa8):
  4526aa8  2023-01-30  Lasse R.H. Nielsen  Update tables to Unicode 15.0. (#71)

collection (https://github.com/dart-lang/collection/compare/a566328..a566328):
  a566328  2023-01-26  Devon Carew  add a publish script; prep to publish (#267)

dartdoc (https://github.com/dart-lang/dartdoc/compare/bc7bdc4..bc7bdc4):
  bc7bdc44  2023-01-30  dependabot[bot]  Bump js from 0.6.5 to 0.6.7 (#3310)

json_rpc_2 (https://github.com/dart-lang/json_rpc_2/compare/e73c4ad..e73c4ad):
  e73c4ad  2023-01-26  Devon Carew  blast_repo fixes (#89)

logging (https://github.com/dart-lang/logging/compare/399100a..399100a):
  399100a  2023-01-26  Devon Carew  add a publish script; prep to publish 1.1.1 (#128)

mockito (https://github.com/dart-lang/mockito/compare/d2a8df1..d2a8df1):
  d2a8df1  2023-01-30  Kevin Moore  Latest build_web_compilers, move to pkg:lints, fix breaks (#605)
  13340b5  2023-01-30  dependabot[bot]  Bump dart-lang/setup-dart from 1.3 to 1.4 (#600)

package_config (https://github.com/dart-lang/package_config/compare/3fe81c4..3fe81c4):
  3fe81c4  2023-01-30  Kevin Moore  Support latest pkg:build_web_compilers, lints. Update min SDK (#129)

shelf (https://github.com/dart-lang/shelf/compare/8fca9d9..8fca9d9):
  8fca9d9  2023-01-26  Devon Carew  blast_repo fixes (#326)

string_scanner (https://github.com/dart-lang/string_scanner/compare/29e471e..29e471e):
  29e471e  2023-01-30  dependabot[bot]  Bump dart-lang/setup-dart from 1.3 to 1.4 (#53)

test (https://github.com/dart-lang/test/compare/cec47c1..cec47c1):
  cec47c1c  2023-01-27  Nate Bosch  Add missing pub requirements (#1878)
  c99d455e  2023-01-27  Nate Bosch  Prepare to publish (#1877)
  0e7ec6a7  2023-01-27  Nate Bosch  Rename `Check` to `Subject` (#1875)
  78382731  2023-01-27  Nate Bosch  Add String.matches condition (#1874)
  26e0e87b  2023-01-27  Nate Bosch  Add Iterable.containsInOrder condition (#1873)
  c9232d6b  2023-01-27  Nate Bosch  Rename `that` to `which` (#1872)
  457166b3  2023-01-26  Nate Bosch  Add missing dependency on package:lints (#1876)
  193f2a0b  2023-01-26  Nate Bosch  Retry instead of extend timeout for flaky Node tests (#1871)
  7ad9b2c3  2023-01-26  Nate Bosch  Overhaul async matchers (#1868)
  ca254546  2023-01-26  Nate Bosch  Add a withQueue utility (#1870)
  6ae2e5e9  2023-01-26  Nate Bosch  Refactor tests to a new isRejectedBy utility (#1867)
  5aeba66d  2023-01-26  Nate Bosch  Use pubspec_overrides.yaml files (#1869)

webdev (https://github.com/dart-lang/webdev/compare/ce9c581..ce9c581):
  ce9c581  2023-01-29  Anna Gringauze  Validate only needed summaries in expression_compiler_service (#1920)

Change-Id: I3ddb0ddeb3b989f6f9e78cd8aa6327aba5899018
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280078
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
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). type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants