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

Replace the span type #158

Merged
merged 1 commit into from
Oct 17, 2022
Merged

Replace the span type #158

merged 1 commit into from
Oct 17, 2022

Conversation

kaj
Copy link
Owner

@kaj kaj commented Sep 27, 2022

  • Changed the span type used in parsing to a local type that borrows a SourceFile instead of nom_locate dependency.
  • Changed the type SourceFile to be reference counted, so cloned SourceFile objects share the same actual data.
  • Moved the SourcePos type into the input module and converted it from keeping a copy of the relevant line to keeping a range with a (reference counted) SourceFile.

@kaj kaj force-pushed the source-span branch 4 times, most recently from fcb2b86 to 65751d7 Compare October 2, 2022 12:52
@kaj kaj force-pushed the source-span branch 16 times, most recently from 58c5c70 to bc230a8 Compare October 16, 2022 21:37
Use my own Span type instead of the locatedspan crate, and make
SourcePos behave like a Span over an owned (reference counted)
SourceFile.  My own span is the same, but borrows the SourceFile so it
can implemnet Copy, which is kind of required by nom.

Should give fewer allocations as the number of required positions to
keep track of grows.
@kaj kaj merged commit 0d878a9 into main Oct 17, 2022
@kaj kaj deleted the source-span branch October 17, 2022 12:50
kaj added a commit that referenced this pull request Jan 17, 2023
Released 2023-01-17.
See also <https://rasmus.krats.se/2023/rsass027.en>
Progress: 4604 of 6925 tests passed.

* Changed repo structure to a monorepo (PR #164).
  - The commandline interface now lives in the separate crate rsass-cli.
  - The test updater also have a separate crate, but not intended for
    publication.
  - Tests are restructured to fail faster for simple things, while
    macos and windows testing is added to the github action (appveyor
    is removed).
* Added macros (PR #163, #165).
  - The workspace now includes a `rsass-macros` crate that can be used to
    compile sass to css strings at compile time in rust crates.
* Changed numeric handing (mainly conversions to/from `f64`) to match
  improvements in how dart-sass handles numerics.  This is mainly done by
  removing some special cases as dart-sass and rust now agrees on more of
  those.
* Added new variables `$epsilon`, `$max-safe-integer`, `$min-safe-integer`,
  `$max-number`, and `$min-number` in `sass:math`, matching recent dart-sass
  additions.
* Added new `split()` function in `sass:string` module.
* Changed the span type used in parsing to a local type that borrows a
  `SourceFile` instead of `nom_locate` dependency (PR #158).
* Changed the type `SourceFile` to be reference counted, so cloned
  `SourceFile` objects share the same actual data (PR #158).
* Moved the `SourcePos` type into the `input` module and converted it from
  keeping a copy of the relevant line to keeping a range with a (reference
  counted) `SourceFile` (PR #158).
* Changed css creation from just writing to a text buffer to building
  a tree representation of the css (and serialize it to text as a
  final step) (PR #159).
* Changed `BinOp` value in both sass and css from a tuple variant with
  boxed values to a single boxed struct variant.
* Improved value checking; Report an error if trying to output invalid
  css values in some cases. Also, arithmetic involving colors that
  used to be calculated is now correctly invalid (PR #161).
* Changed `css::Item::AtRule` to wrap the new type `css::AtRule`.
* More varaints of `Invalid`, slightly fewer stringy errors.
* Changed handling of `hue` arguments to color functions, to allow
  different angle units, matching updates in sass-spec.
* Minor correctness improvent in the `calc` function handling.
* Clippy now takes MSRV from Cargo.toml.  Slightly more recent lints allowed.
* Updated clap to 4.0 for the command-line interface.
* Updated sass-spec test suite to 2023-01-06.

Thanks to @Wicpar for the initial macros implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant