Commit Graph

48 Commits

Author SHA1 Message Date
Johnni Winther 307e5a62ce [cfe] Include offended version number and package name in too high/low version message
Closes #48819

Change-Id: I8700ed909c916b9c656cc8bc0e34eb1dd6ef0c09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390200
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-10-16 06:36:21 +00:00
Johnni Winther b48d4f224f [cfe] Cleanup imports
Change-Id: I60891b46119d6451810adf2846a05a66050bacd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373246
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-27 08:54:39 +00:00
Johnni Winther 543bc03de8 [cfe] Move /fasta/ content into /base/
These files should be further reorganized but that is for a
future CL.

Part of removing uses of 'fasta'.

Change-Id: I5010789b5901ba51c58d98fe26f13177b13c81b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373080
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-27 07:54:23 +00:00
Johnni Winther 8df57398c9 [cfe] Move src/fasta/ subfolders to src/
Part of removing uses of 'fasta'.

TEST=existing

Change-Id: Ice027678e11b7da8c1a7e756a1e1c8c8284722bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372623
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-06-25 10:05:21 +00:00
Johnni Winther 2388c383ea [cfe] Handle symbolic language markers in code
The implementation for generating symbolic language markers only
handled language versions in the data but not in the code itself.
This fixes this by doing post processing on the whole file instead
of the individual annotations.

Change-Id: I451e39a40a6f1616cbd2ae70550091c19c85fa10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365220
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-05-02 10:49:48 +00:00
Johnni Winther 3c9d05f255 [cfe] Add symbolic language versions for testing
Change-Id: I0f8bb91d30fac442d781710b24908cd933d86388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365142
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-05-01 13:11:10 +00:00
Jonas Termansen 669060f8c7 [build] Omit SDK and Git hashes on RBE.
Bug: b/296994239
Change-Id: I70c10fddc3bd01fef5ed5182e1d28d0797c431e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342421
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-12-20 12:23:56 +00:00
Johnni Winther 43db6c6ba8 [cfe] Split id-testing helpers
This prepares for adding id-test support in ddc.

Change-Id: I96d35b06e5e32f464cd487dc852ec114064afc9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334161
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-11-06 14:06:46 +00:00
Jens Johansen b4e2012f5b [CFE] Remove support for .packages file
This CL:
* Removed the redirect from .packages to .dart_tool/package_config.json
  (whenever such a file existed).
* Removes support for the old format entirely.
* Updates all tests etc that were found.

Fixes https://github.com/dart-lang/sdk/issues/48939

TEST=Existing tests updated.

Change-Id: Iccf711c455ac1885189aa773ca74dd8f55012964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248603
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-06-24 08:20:39 +00:00
Nate Bosch 33e174084a Replace Uri.scheme == with Uri.isScheme
Use `hasScheme` in place of comparing against the empty string, and
`isScheme` to compare against all other schemes.

TEST=No behavior changes.

Change-Id: Ifc9fd13c6cf37933ebd4a754c4b500dedbcb291b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231185
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-02-08 21:38:57 +00:00
Johnni Winther 3e2f98d652 [cfe] Add support for custom data in id testing
This allows for using data created in the TestConfig in the computation
of test results.

Change-Id: Ia4820d0b739b01272f10d2c2561fcf77ae007031
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225731
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-12-31 15:12:32 +00:00
Johnni Winther 450ff2976d [cfe] Migrate (more) CFE tests (part 11)
Change-Id: I905adcd2125ce66d6ba9923d996354657b679cec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220965
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-11-24 11:15:41 +00:00
Jens Johansen 1197e15a7e [CFE] Enable avoid_void_async lint
This CL enables the avoid_void_async lint in the CFE, makes the needed
changes and adds the missing `await` (because the lint
`unawaited_futures` doesn't react to void async methods).

Change-Id: Iffc1f173badd3c2d48356ee02e81a9aed492ce5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213481
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-23 11:58:18 +00:00
Johnni Winther a6cc772b67 [cfe] Add always_declare_return_types lint
Change-Id: I206a7a8132b5ea79dc019acf5c2e0cd800307bcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212161
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-02 08:07:23 +00:00
Johnni Winther 3eac19026b [cfe] Add annotate_overrides lint
Change-Id: I90a6d5c7d64ed23acd94b9a8dda58d53da4fe8df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212041
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-09-01 16:24:16 +00:00
Sam Rawlins 507fe6216a Remove unnecessary imports in front_end
Change-Id: Iad1c41ae9ef2b379a0bed3899fef8cef118727c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199223
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-05-11 21:15:24 +00:00
Alexander Thomas b5c63ce757 [infra] Migrate scripts to python3
* Migrate to python3; drop python support.
* Update Windows toolchain support.
* Remove some unused methods.
* Python 2.7 is still needed on Windows.
* Update gsutil to a version that supports python3.

Fixes: https://github.com/dart-lang/sdk/issues/28793

TEST=Manually tested common user journeys.

Change-Id: I663a22b237a548bb82dc2e601e399e3bc3649211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192182
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-15 10:10:20 +00:00
Jens Johansen 30ae8e3d14 [CFE] Rename tests that require git; split unit_test_suites; filter tests better
This CL is a warm-up to a follow-up change that will make running the
CFE trybot faster.
This CL:
* Rename tests that require git (because when working with filesets
  and shards in the test system, the "checkout" is not a git checkout
  and git commands thus doesn't work properly.
* Filters the front-end unit test setup on the front-end bot the way
  it was probably intended, i.e. run tests in pkg/kernel, pkg/front_end
  and pkg/fasta (actually, the last one doesn't exist, but still)
  instead of just in folders inside the "suite" 'pkg' that somewhere in
  the path has something called 'kernel', 'front_end' or 'fasta'.
* Split unit_test_suites.dart into a "forwarding shell" and a impl.
  In a follow-up CL the impl will be converted to nnbd to allow for
  using 'required' on named parameters, but if the entry point was
  nnbd it would run in sound nnbd mode and nothing would compile
  because all imports are not nnbd.

Overall this CL should change very little, mostly just run a few less
tests, i.e. for instance skip tests that live inside a folder called
'fasta' somewhere inside the analyzer directory path.

Change-Id: I3226c7261cff8b68cc287cff07dc1715dfd85159
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181381
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-01-28 07:46:10 +00:00
Johnni Winther 34fb48bb8a [kernel,front_end] Migrate first wave of pkg/kernel and pkg/front_end
Migrates libraries dependent only on already migrated libraries.

Change-Id: I0e85ee8dbc2afce031b92e0009e71c206a55af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179502
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-01-18 15:40:21 +00:00
Johnni Winther 1d6eac5ebf [cfe] Only use experimental release version when flag is not on by default
Change-Id: I06267c6d3f0e5abb289e25fde8098aa0e3bead34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166844
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-12 12:57:41 +00:00
Johnni Winther 07aa9ec332 [cfe] Add test for issue 42537
This adds a language versioning test that shows that the language
version for a package defined in a `.packages` will have version 2.7
and whereas a package defined in a `.packages_config.json` will have
the current language version (2.8 in the test). Therefore the
former will not have the non-nullable experiment enabled even when
the package is in allowed_experiments.json.

Change-Id: Iabf5d6882e21538cfc1237d848bad03a37825dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156000
Reviewed-by: Jens Johansen <jensj@google.com>
2020-07-29 08:15:33 +00:00
Johnni Winther 22e3406ba8 [cfe] Add regression test for issue 42661
The issue has already been fixed in
https://dart-review.googlesource.com/c/sdk/+/152151

Closes #42661

Change-Id: I28e482924b17d09bd7c4fa8cd0948c267487b690
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154680
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-16 12:22:53 +00:00
Johnni Winther 711da04fb4 [cfe] Associate package uris with bin/test files in packages
This CL adds a package uri to SourceLibraryBuilder based on the
package information computated by package:package_config. This uri is
used to determine whether experimental flags are enabled and thus using
allowed_experiments.json in bin/test folders as well as the lib folder.

Change-Id: I60e6e97139a4a24b8d4d27d314cfc0f7d7bfc816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152151
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-06-24 14:33:31 +00:00
Jens Johansen 4084c4cc24 [kernel/CFE] Use kernel 'Version' class for versions
Define a "Version" class in kernel that allows easy comparison between
versions (e.g. a < b, a >= b etc).

Use this Version class in CFE.

Change-Id: I2f382e7bb3c2083258743b9b66a909a88d575dbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144283
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-04-21 09:44:52 +00:00
Jens Johansen 7d4d26a013 [CFE] Add api to get language version for uri
Closes #41205

Change-Id: I9e55257341e7c53f4f68f9d636b04f8fd6bffb68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141250
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-30 09:14:25 +00:00
Michael Thomsen 9ef6c1e1a4 Update deps to new version of package_config
Fixes https://github.com/dart-lang/language/issues/879

Closes https://github.com/dart-lang/sdk/pull/41127
https://github.com/dart-lang/sdk/pull/41127

GitOrigin-RevId: ab6f2b79c28b0261d334e802ab8acb538b328249
Change-Id: Iff648b71d6e4d3982a3c7580b64e813e63be43fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140244
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2020-03-25 13:07:32 +00:00
Jens Johansen a55fed2e5f [CFE] Get in line with update on which package description file to use
Fixes #40864

Change-Id: I681186660162c55e66c1deee68a4052de4cfcfe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139201
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-12 11:33:52 +00:00
Jens Johansen 4e2a1a1b0f [CFE/kernel] Generate dart files with versions in them from tools/experimental_features.yaml
Use the version from tools/experimental_features.yaml as the current
language version (as specified in kernel).

Use the "enabledIn" from tools/experimental_features.yaml to write out
the major and minor version for enabling features. This replaces the
hard-coding of when nnbd is enabled (in front-end).

Change-Id: I5b5dd7c2bb0c1a412ef1e660dfbe61e227193e1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138284
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-04 14:15:05 +00:00
Johnni Winther 5829fc7829 [analyzer,cfe,dart2js] Add marker.options files to automate running id tests on all configurations
Change-Id: Ib5eb7f3967634721047f8dcc57b9e6c350b91a41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136226
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-21 08:34:26 +00:00
Jens Johansen 81d4ac07d4 [CFE] Use package config v2
Change-Id: I32da9e8b2c1040db1521af4345f8e952c22bd30d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130864
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-12 10:07:25 +00:00
Johnni Winther 5e389080a4 [cfe] Test supertypes computed from ClassHierarchyBuilder
Change-Id: Ia079754bd8272d7b5689a3bdab1e69d5188082be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132342
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-22 07:08:36 +00:00
Johnni Winther e3a20bf361 [analyzer,cfe,dart2js] Support annotated code generation
Add support for generating annotations from actual data using
option -g

Change-Id: I88d9cdb62a38d579234b15097c9e9bb3d81ebe8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129708
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-03 13:57:39 +00:00
Johnni Winther 8d874a5bd8 [cfe] Avoid cascading errors from part versioning mismatch
Change-Id: I8a233ff6c3b727176b812db203dac87f022f8a84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126643
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-28 10:48:34 +00:00
Paul Berry c4b6df5009 Move ID testing infrastructure into _fe_analyzer_shared.
Change-Id: I9f2692dbe750f3c31f8c86e86fe732f34e166517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-01 12:39:00 +00:00
Johnni Winther dd028547ce [cfe] Support patching of extension methods
Change-Id: I453e17e63f97a0ca2477371541c6a9602bee2404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119322
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-09-30 09:51:31 +00:00
Jens Johansen 1400ab4136 [CFE] Language versioning max/default also setable via compiler options
* Max and default for language version controllable via language options
* Default (if not set) comes from kernel static fields
* Kernel static fields updated to 2.6
* (Also set version for debug expression library)
* Test added that checks that the kernel static fields aren't out-of-date
  (checked against python script "tools/make_version.py").

Change-Id: I65f26053081e4c55c215b677128f37fa970693c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114944
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-02 07:43:05 +00:00
Jens Johansen 10f8a00e9f [CFE] Update language versioning implementation to conform with specification v1.3
In the feature specification v1.2 libraries in a package with a default
version wasn't allowed to specify a language version higher than that.
In v1.3 thats allowed as long as its below the sdk limit.

Change-Id: I85f5c36a9c9c427da03fc540f9175195134ad47f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114604
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-28 09:30:12 +00:00
Jens Johansen b99df2be86 [CFE] Language versioning - additional tests
Change-Id: I0dd93c3a1d422bbbbbd920fae21569a7bdc91e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112341
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-20 10:08:20 +00:00
Jens Johansen 10e63b7840 [CFE] Get fragment from default package - use language version if any
Language versioning specifies that an empty-name-entry in .packages
specifies a sort of "default package" that a non-package file should
pretend to be a part of "for any purpose where that matters,
including choosing the default language level."

Change-Id: I16f4b2f5e4d3ca1e82d2189321e2be5c43e3b260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112089
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-20 09:06:32 +00:00
Jens Johansen b9217efc77 [CFE] [Language versioning] Issue error on multiple 'dart=' entries
Issue error when the .packages file specifies more than on 'dart=' entry.
Also add another test of the library and part mismatch being an error.

Change-Id: I0a894e6ef86eb9f976b9fbdce67f0c9adb03be9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112881
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-13 10:07:39 +00:00
Johnni Winther 19654f30d0 [cfe+vm+ddc] Return ClassHierarchy and CoreTypes together with Component
Users of the CFE often need the ClassHierarchy and may CoreTypes after
invoking the CFE. This CL extends the result of `kernelForProgram` and
`kernelForComponent` to a `CompilerResult` that includes these objects.

Change-Id: I08491198fe876b6514e49993ad794388d6662c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112259
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-09 13:02:12 +00:00
Jens Johansen aac8204ad3 [CFE] Error when library and part(s) doesn't agree on language version
From the feature spec: "Part files must be marked with the same version
as their library. They must always be treated the same way as the
library they belong to, so it is a compile-time error if a part file has
a different language level override than its library. It is also a
compile-time error if a part file has no language version marker,
and the importing library does".

Change-Id: I29805e261e63b89a7d8832770ed2b007fb6df37f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112247
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-08 08:07:53 +00:00
Jens Johansen b9c0f5c09f [CFE] Issue error when .packages specifies wrong language version
From the feature specification: "If an entry contains an invalid dart
version value, #dart=arglebargle or #dart= or any other value which is
not a semantic versioning version, then tools which need the version
should report an error."

Change-Id: Ieb54dbbad6f2fecb341e27b468e3ffdf90717a7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112245
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-08 07:05:00 +00:00
Jens Johansen 21b026dd88 [CFE] Issue error when langauge version is specified too high
Specifying a language version higher than the highest supported version
(aka the default version) is an error.

Specifying a language verison in code that is higher than the one
specified in .packages is an error.

Change-Id: I44e1c8c45cef715038786dbf248925b73bd6cd7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-08 06:55:38 +00:00
Jens Johansen ef9b09abe3 [CFE] Language versioning positive tests
Add a bunch of positive tests to the langauge versioning.

Change-Id: Ic3f85c49a82e47f2c192fb7ac38fda1210b5d32e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112090
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-07 06:23:47 +00:00
Jens Johansen 574c4a51c6 [CFE] Initial support for parsing language version from .packages
If the .packages file specifies a fragment on a uri on the form
"dart=x.y", x.y becomes the default lanaguage version for libraries in
that package.

Change-Id: I69cb4157fdf5852184cc3519b033c3624792f783
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112082
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-06 12:42:47 +00:00
Jens Johansen 69ae29076a Default language version if nothing is specified
A kernel library will say it has the newest language version if no
language version is set.
This basically preserves the current semantics of always being on the
newest version (if nothing is explicitly done), e.g. if creating a kernel
library by hand and not setting it.
The front_end also utilize this and just doesn't set it, if it isn't set.

Change-Id: I033fef13626ee034030ba8fc9d141b182ba1a5ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111739
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-06 09:13:29 +00:00
Jens Johansen 6d1c9975d7 [CFE] Initial language versioning "support"
This CL sets up the bare minimum support for saving the language version
specified in a file on the kernel library, and adds simple support for
testing it.

The data is not serialized out, error checked or similar in this change.

Change-Id: I4b061ce617acae7964b85be105e0ad0e3e031aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111640
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-05 07:03:04 +00:00