pub repository
mirror.p-hatan.irsource_span
1.2.1A library for identifying source spans and locations.
Readme
source_span is a library for tracking locations in source code. It's designed
to provide a standard representation for source code locations and spans so that
disparate packages can easily pass them among one another, and to make it easy
to generate human-friendly messages associated with a given piece of code.
The most commonly-used class is the package's namesake, SourceSpan. It
represents a span of characters in some source file, and is often attached to an
object that has been parsed to indicate where it was parsed from. It provides
access to the text of the span via SourceSpan.text and can be used to produce
human-friendly messages using SourceSpan.message().
When parsing code from a file, SourceFile is useful. Not only does it provide
an efficient means of computing line and column numbers, SourceFile.span()
returns special FileSpans that are able to provide more context for their
error messages.
Changelog
1.2.1
- Fix the declared type of
FileSpan.startandFileSpan.end. In 1.2.0 these were mistakenly changed fromFileLocationtoSourceLocation.
1.2.0
-
Deprecated: Extending
SourceLocationdirectly is deprecated. Instead, extend the newSourceLocationBaseclass or mix in the newSourceLocationMixinmixin. -
Dramatically improve the performance of
FileLocation.
1.1.6
- Optimize
getLine()inSourceFilewhen repeatedly called.
1.1.5
- Fixed another case in which
FileSpan.unioncould throw an exception for external implementations ofFileSpan.
1.1.4
- Eliminated dart2js warning about overriding
==, but nothashCode.
1.1.3
-
FileSpan.compareTo,FileSpan.==,FileSpan.union, andFileSpan.expandno longer throw exceptions for external implementations ofFileSpan. -
FileSpan.hashCodenow fully agrees withFileSpan.==.
1.1.2
- Fixed validation in
SourceSpanWithContextto allow multiple occurrences oftextwithincontext.
1.1.1
- Fixed
FileSpan's context to include the full span text, not just the first line of it.
1.1.0
- Added
SourceSpanWithContext: a span that also includes the full line of text that contains the span.
1.0.3
- Cleanup equality operator to accept any Object rather than just a
SourceLocation.
1.0.2
-
Avoid unintentionally allocating extra objects for internal
FileSpanoperations. -
Ensure that
SourceSpan.operator==works on arbitraryObjects.
1.0.1
- Use a more compact internal representation for
FileSpan.
1.0.0
This package was extracted from the
source_maps package, but the
API has many differences. Among them:
-
Spanhas been renamed toSourceSpanandLocationhas been renamed toSourceLocationto clarify their purpose and maintain consistency with the package name. Likewise,SpanExceptionis nowSourceSpanExceptionandSpanFormatExceptionis notSourceSpanFormatException. -
FixedSpanandFixedLocationhave been rolled into theSpanandLocationclasses, respectively. -
SourceFileis more aggressive about validating its arguments. Out-of-bounds lines, columns, and offsets will now throw errors rather than be silently clamped. -
SourceSpan.sourceUrl,SourceLocation.sourceUrl, andSourceFile.urlnow returnUriobjects rather thanStrings. The constructors allow eitherStrings orUris. -
Span.getLocationMessageandSourceFile.getLocationMessageare nowSourceSpan.messageandSourceFile.message, respectively. Rather than taking both auseColorand acolorparameter, they now take a singlecolorparameter that controls both whether and which color is used. -
Span.isIdentifierhas been removed. This property doesn't make sense outside of a source map context. -
SourceFileSegmenthas been removed. This class wasn't widely used and was inconsistent in its choice of which parameters were considered relative and which absolute.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add source_spanpubspec.yaml
name: source_span
version: 1.2.1
author: Dart Team <misc@dartlang.org>
description: A library for identifying source spans and locations.
homepage: https://github.com/dart-lang/source_span
dependencies:
path: '>=1.2.0 <2.0.0'
environment:
sdk: '>=0.8.10+6 <2.0.0'
dev_dependencies:
test: '>=0.12.0 <0.13.0'
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 1.0.0 | 2014-07-24T00:08:12.087240Z | Download | b293139cfacbda39d8f463828187b9de03f2d770eab942dee37d31a51741e159 |
| 1.0.2 | 2014-11-21T23:56:21.332220Z | Download | f04350df28bb147634c786d15b79d0db91d92749bfe61d0e0b97adefea997ae3 |
| 1.0.3 | 2015-01-27T23:36:54.384010Z | Download | d62bde36e2a003e505a6eb88a1a18f044a17dd50bb2ec95825b6c5e2cd8d18fd |
| 1.1.0 | 2015-03-26T22:15:12.023690Z | Download | dfa31dfe981ac4ac76822e6601f9c68395d654a1fb8b505334304ecf22769521 |
| 1.1.1 | 2015-03-27T21:27:05.457770Z | Download | 919b6f2bf88e6b89afc8ff2aaacdbd7e146d930f77bdb6614224b8d3ebbf9f4c |
| 1.1.2 | 2015-03-31T19:55:26.218560Z | Download | d850107d61180b35c16588794c9b841976524ddfacc4317455c6906ea896a87d |
| 1.1.3 | 2015-08-18T22:02:20.558Z | Download | 37088e8517eb517913081ac20222306d45fe414d9e501e6b41baf14b0dd0314d |
| 1.1.4 | 2015-08-28T01:15:40.048Z | Download | c306bd6ca08754dba4af8fbfeef680ee4a862240350c87741512f2e45ed30a98 |
| 1.1.5 | 2015-09-01T22:46:04.012Z | Download | 03605dfac55a9eec1b9509365af2e7976a2e328b094398e0fa59d0760c2f8a2c |
| 1.1.6 | 2015-09-02T00:43:35.510Z | Download | 00da6fc846677f47673c397ebf407c63b824b63098de0a8d03f462252b82d1be |
| 1.2.0 | 2015-09-02T20:32:43.820Z | Download | 228381f5844e7fbe45aab32c43bd8bbcd74adbbd61c2ab90bdd0d53f06e406d9 |
| 1.2.1 | 2015-09-30T20:38:51.964Z | Download | b852ee4fd1aa0acb15ee89724f01932173d38a4de90c55b2a1d72a69bb51f1b0 |
| 1.2.2 | 2016-03-02T20:46:37.826Z | Download | da088aef9183b68c0c44d5299c7bf0f0068ba4c0ec1f324b36e690e78c1b79ca |
| 1.2.3 | 2016-06-09T22:38:05.703Z | Download | 609f429c9ccda7f509106d42ea9725fb2b2455b812b04332074037805d21eba9 |
| 1.2.4 | 2016-10-21T18:33:52.176Z | Download | 6cee45ee2bebbebafa7e8b11b2850e8647de9acb7e5e0ba8d27e5d1ad213c50e |
| 1.3.0 | 2016-11-08T19:35:45.774Z | Download | 4f8990c5182821dd7632375ccbac47ccdf226b16a68bec356dbf46a3ecce19af |
| 1.3.1 | 2017-01-07T01:47:03.432Z | Download | 32c891d21baa24013f1a516d367061862daa47039f052e322d83767cbe862725 |
| 1.4.0 | 2017-05-17T05:18:27.887288Z | Download | 68a6694f302fafebd49800105bf38319487cb8b127cf8ee31fc467a9d7711c41 |
| 1.4.1 | 2018-07-18T20:51:24.362698Z | Download | 95781967e5097aa62142359998aa3c4be5c717d862a48767cbbeb1f3a29c287e |
| 1.5.0 | 2019-01-10T23:18:38.421891Z | Download | 232d786b1ddab4e17f92ed865aa1a2cba8eea817d994bcd6353a61a4d14d600d |
| 1.5.1 | 2019-01-14T22:41:17.092205Z | Download | 84c694051f01da77436ed404f7eb5fdb090384fde6616b29d39528bd1ed11658 |
| 1.5.2 | 2019-01-17T22:38:43.475980Z | Download | fa8ce4a4a4ee8596a3a3d5238a7fb5ea427b538cece55293c95db786f100c49b |
| 1.5.3 | 2019-01-24T00:50:13.815416Z | Download | 1e18ece6fa538eeffe2b7d6c2cedccf15cc27bfed460db4c612bcd63480a719a |
| 1.5.4 | 2019-01-29T00:20:21.924880Z | Download | c4a5f80a11c59232cc011a6338daa723f814af4bd2f1eb1226408646e1274085 |
| 1.5.5 | 2019-02-28T22:32:10.087963Z | Download | c0802c9ba654045f5993e7cdd167ce5ea264cafe62fdab211d3338ee8f4912e4 |
| 1.6.0 | 2020-01-15T03:49:07.372381Z | Download | c3e499e549e6473b6f4e7a7aed2fb27be74a2d9f6c02b197b829c2cd7c01e760 |
| 1.7.0 | 2020-03-18T02:42:37.130706Z | Download | c8515a2573f7c0772c6f60674a2b4d5c5631de0b9f483a477d1694f2c879b00c |
| 1.8.0-nullsafety | 2020-07-29T16:21:05.352748Z | Download | be35950b7155e5650280cbd50d4cdeb47624221e82c741b406270f014edf81ba |
| 1.8.0-nullsafety.1 | 2020-09-18T20:03:40.597406Z | Download | 88166fff7e102c87895b3848f7103a05ffecd1eedf2db2aaf14db76108f66247 |
| 1.8.0-nullsafety.2 | 2020-09-21T20:21:01.463061Z | Download | 4006c8178555df52e7647118afa77bdf3c6eb6ea3da27f800fec3ddb90953bc7 |
| 1.8.0-nullsafety.3 | 2020-10-23T20:09:00.348438Z | Download | abb70965554128fe10f7cb75e2f20255b6117fa80076b2ddb1137d78bbd2c73a |
| 1.8.0-nullsafety.4 | 2020-11-05T01:02:44.202610Z | Download | 985d284510fdd8a6d411b303e2aa82cf4e1adc09c4892c06925a5ac5ec8f0538 |
| 1.8.0 | 2021-02-02T23:42:27.767202Z | Download | f4b22294de9a549967d0033d4f30fcad4f0afc200f4bf58e82d815725feec70c |
| 1.8.1 | 2021-02-05T22:50:21.324729Z | Download | d5f89a9e52b36240a80282b3dc0667dd36e53459717bb17b8fb102d30496606a |
| 1.8.2 | 2022-01-13T19:34:51.293243Z | Download | d77dbb9d0b7469d91e42d352334b2b4bbd5cec4379542f1bdb630db368c4d9f6 |
| 1.9.0 | 2022-04-12T19:34:46.728223Z | Download | e3320978e3715725e62f04358fd249c1efe5999297b2c6acd626a817593281b0 |
| 1.9.1 | 2022-07-21T14:31:55.437658Z | Download | dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 |
| 1.10.0 | 2023-04-05T23:54:02.366713Z | Download | 53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c |
| 1.10.1 | 2024-12-11T11:13:51.416044Z | Download | 254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c |
| 1.10.2 | 2026-02-05T09:07:00.222021Z | Download | 56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab |
Dependencies
path "\u003e=1.2.0 \u003c2.0.0"