| 1 |
# Changelog |
| 2 |
|
| 3 |
# 6.0.2 |
| 4 |
|
| 5 |
> Mar 23, 2023 |
| 6 |
|
| 7 |
- Switch to `nom-7`. |
| 8 |
|
| 9 |
# 6.0.1 |
| 10 |
|
| 11 |
> Jul 11, 2021 |
| 12 |
|
| 13 |
- Better scheme for parenthesis generation in the GLSL transpiler. |
| 14 |
- Fix matrices types in the GLSL transpiler. |
| 15 |
- Fix end-of-line parser, which now accepts CR LF too. |
| 16 |
|
| 17 |
# 6.0 |
| 18 |
|
| 19 |
> Dec 7th, 2020 |
| 20 |
|
| 21 |
- Change the meaning of `Visitor` and `Host`. They now take the AST nodes by simple references (`&`) and not via |
| 22 |
mutable references (`&mut`) anymore. This will allow people to use visitors in much more contexts. |
| 23 |
- Add `VisitorMut` and `HostMut` to visit AST nodes mutably. These correspond to the previous (version `<6.0`) `Visitor` |
| 24 |
and `Host` traits. If you were using them and require mutability, feel free to simply switch to `VisitorMut` and |
| 25 |
`HostMut`. |
| 26 |
|
| 27 |
# 5.0.2 |
| 28 |
|
| 29 |
> Nov 1st, 2020 |
| 30 |
|
| 31 |
- Bump `nom-6.0`. |
| 32 |
|
| 33 |
# 5.0.1 |
| 34 |
|
| 35 |
> Aug 12th, 2020 |
| 36 |
|
| 37 |
- Fix float / double literal parsing priority. Floats are parsed first now in case of a polymorphic |
| 38 |
constant. |
| 39 |
|
| 40 |
# 5.0.0 |
| 41 |
|
| 42 |
> Jul 27th, 2020 |
| 43 |
|
| 44 |
- Fix array specifiers by splitting the `ArraySpecifier` type into two types: |
| 45 |
- `ArraySpecifier`, which holds a non-empty list of `ArraySpecifierDimension`. |
| 46 |
- `ArraySpecifierDimension`, which is the “old” `ArraySpecifier`. |
| 47 |
This change allows for multidimensional array specifiers. |
| 48 |
|
| 49 |
## Migration guide |
| 50 |
|
| 51 |
- If you were using array specifiers, you need to wrap them inside an `ArraySpecifierDimension` |
| 52 |
and wrap it in a `ArraySpecifier { dimensions: NonEmpty(vec![here]) }` expression, where `here` |
| 53 |
is your specifier. |
| 54 |
|
| 55 |
# 4.1.1 |
| 56 |
|
| 57 |
> Wed Jul 1st 2020 |
| 58 |
|
| 59 |
- Fix the _identifier_ parser, that previously failed to parse identifiers starting with an |
| 60 |
underscore (`_`) while it is permitted (chapter 3.7 of the GLSLang spec). |
| 61 |
- Fix associativity for logical binary operators (`||`, `&&`). |
| 62 |
|
| 63 |
# 4.1 |
| 64 |
|
| 65 |
> Fri Jun 19th 2020 |
| 66 |
|
| 67 |
- Implement `std::error::Error` for error types. |
| 68 |
|
| 69 |
# 4.0.3 |
| 70 |
|
| 71 |
> Fri Mar 6th 2020 |
| 72 |
|
| 73 |
- Move all the unit tests code into their ow module to prevent rustc from parsing them if we |
| 74 |
don’t build with tests. |
| 75 |
|
| 76 |
# 4.0.2 |
| 77 |
|
| 78 |
> Mon 10th Feb 2020 |
| 79 |
|
| 80 |
- Remove the `lexical` feature from `nom`. It’s useful only when using functions such as the |
| 81 |
`float` combinator, which we don’t use. |
| 82 |
|
| 83 |
# 4.0.1 |
| 84 |
|
| 85 |
> Tue 21st Jan 2020 |
| 86 |
|
| 87 |
- Fix a bug occurring in the function-like `#define` parser (i.e. `#define foo(x) (y)`) that |
| 88 |
would prevent the use of whitespaces in the argument list. |
| 89 |
|
| 90 |
# 4.0 |
| 91 |
|
| 92 |
> Mon 6th Jan 2020 |
| 93 |
|
| 94 |
## Major changes |
| 95 |
|
| 96 |
- Add support for `attribute` and `varying` keyword as a backward-compatible parser. |
| 97 |
- Fix binary operator associativity. They were (_erroneously_) right-associative. They’re now |
| 98 |
parsed as left-associative. |
| 99 |
|
| 100 |
# 3.0 |
| 101 |
|
| 102 |
> Wed 14th Nov 2019 |
| 103 |
|
| 104 |
## Major changes |
| 105 |
|
| 106 |
- `JumpStatement::Return` now takes an optional `Expr` instead of an `Expr` directly. That allows |
| 107 |
for parsing statements such as `return;`, which should have |
| 108 |
been supported from the beginning. |
| 109 |
- Support for missing preprocessor directives: |
| 110 |
- `#if`. |
| 111 |
- `#ifdef`. |
| 112 |
- `#ifndef`. |
| 113 |
- `#elseif`. |
| 114 |
- `#else`. |
| 115 |
- `#endif`. |
| 116 |
- `#error`. |
| 117 |
- `#include`. |
| 118 |
- `#line`. |
| 119 |
- `#pragma`. |
| 120 |
- `#undef`. |
| 121 |
|
| 122 |
## Patch changes |
| 123 |
|
| 124 |
- Add a `rustfmt.toml` to reformat everything and stay consistent. If you want contribute, ensure |
| 125 |
you are correctly using `rustfmt` (either by running `cargo fmt` before submitting a PR or by |
| 126 |
configuring your editor to format the code for you). This is important, as not respecting the |
| 127 |
formatting would make your contribution impossible to merge due to a CI check. |
| 128 |
- Support for _multiline_ annotations (`\`). Multiline annotations are currently supported as |
| 129 |
part of _spaces_ — i.e. you cannot use them to break an identifier on two lines for instance. |
| 130 |
This choice makes it faster to parse without too much compromises (after all, `\` is mostly used |
| 131 |
in CPP directives in GLSL). |
| 132 |
- Fix a bug with _recoverable parsers_ that would produce parent parsers to ignore GLSL grammar |
| 133 |
errors. That fix also implies a boost in performance due to short-circuiting optimizations. |
| 134 |
|
| 135 |
# 2.0.1 |
| 136 |
|
| 137 |
> Fri 8th Nov 2019 |
| 138 |
|
| 139 |
- Improve performance of expression parsers. |
| 140 |
|
| 141 |
# 2.0 |
| 142 |
|
| 143 |
> Thu 24th Oct 2019 |
| 144 |
|
| 145 |
## Major changes |
| 146 |
|
| 147 |
- Add `ShaderKind::Compute`. |
| 148 |
- Remove `NonEmpty::from_iter` and `TranslationUnit::from_iter` as they were deprecated. Use |
| 149 |
`*::from_non_empty_iter` instead. |
| 150 |
|
| 151 |
## Patch changes |
| 152 |
|
| 153 |
- Fix tokenizer of `Block`. |
| 154 |
- Fix a bug while parsing floating-point numbers. |
| 155 |
- Reformat with `rustfmt`. |
| 156 |
|
| 157 |
# 1.2 |
| 158 |
|
| 159 |
> Wed 18th Sep 2019 |
| 160 |
|
| 161 |
## Deprecations |
| 162 |
|
| 163 |
- `NonEmpty::from_iter` and `TranslationUnit::from_iter` are deprecated in favor of |
| 164 |
`*::from_non_empty_iter`. |
| 165 |
|
| 166 |
## Minor changes |
| 167 |
|
| 168 |
- Add binary SPIR-V transpilation. That enables to transpile GLSL directly into a SPIR-V buffer. |
| 169 |
- Add `NonEmpty::from_non_empty_iter` and `TranslationUnit::from_non_empty_iter`. |
| 170 |
|
| 171 |
# 1.1.1 |
| 172 |
|
| 173 |
> Tue 17th Sep 2019 |
| 174 |
|
| 175 |
- Update internal code for Rust edition 2018. |
| 176 |
|
| 177 |
# 1.1 |
| 178 |
|
| 179 |
> Tue 30th of July 2019 |
| 180 |
|
| 181 |
- Add the `ShaderStage` type alias to `TranslationUnit`. |
| 182 |
- Enhance the front documentation to showcase how to use how to use the crate. |
| 183 |
|
| 184 |
# 1.0.2 |
| 185 |
|
| 186 |
> Tue 23rd of July 2019 |
| 187 |
|
| 188 |
- Change the description of the project and update documentation. |
| 189 |
|
| 190 |
# 1.0.1 |
| 191 |
|
| 192 |
> Tue 23rd of July 2019 |
| 193 |
|
| 194 |
- Change the `external_declaration` parser so that it can also accept _GLSL460_. That should be a |
| 195 |
breaking change because now, _GLSL450_ formatted input accepts feature from _GLSL460_, which |
| 196 |
shouldn’t be allowed. Nevertheless, the added feature (being able to use semicolons (`;`) on |
| 197 |
empty lines at top-level) is not really an interesting property and no breakage should happen. |
| 198 |
|
| 199 |
# 1.0 |
| 200 |
|
| 201 |
> Thu 18th of July 2019 |
| 202 |
|
| 203 |
- Migrate all parsers to [nom-5](https://crates.io/crates/nom/5.0.0). |
| 204 |
- Improve and add unit and integration tests. |
| 205 |
- Improve overall documentation. |
| 206 |
- Enhance some allocation scheme (removed them by using more adapted parsers). |
| 207 |
- Completely remove the byte (`&[u8]`) parsing. That was a bad idea, for both its impractical |
| 208 |
aspect and error removing. Parsing is done on string slices now (`&str`). |
| 209 |
|
| 210 |
# 0.13.5 |
| 211 |
|
| 212 |
> Sun 9th of December 2018 |
| 213 |
|
| 214 |
- Add the SPIR-V transpiler. Currently, it’s feature-gated and *very* experimental. Feel free to |
| 215 |
try and provide feedback about it. |
| 216 |
- Add simple accessors for `ParseResult`. |
| 217 |
- Fix a typo in the documentation of syntax. |
| 218 |
- Add some unit and integration tests. |
| 219 |
- Add `Identifier::as_str` and `TypeName::as_str` |
| 220 |
|
| 221 |
# 0.13.4 |
| 222 |
|
| 223 |
> Wed 25nd of November 2018 |
| 224 |
|
| 225 |
- Add `NonEmpty::push` and `NonEmpty::pop`. |
| 226 |
- Implement `Deref` and `DerefMut` for `TranslationUnit`. |
| 227 |
|
| 228 |
# 0.13.3 |
| 229 |
|
| 230 |
> Wed 24nd of November 2018 |
| 231 |
|
| 232 |
- Add `NonEmpty::from_iter` and `TranslationUnit::from_iter`. |
| 233 |
- Implement `IntoIterator` for `NonEmpty` and `TranslationUnit`. |
| 234 |
|
| 235 |
# 0.13.2 |
| 236 |
|
| 237 |
> Wed 22nd of November 2018 |
| 238 |
|
| 239 |
- Fix a typo in documentation. |
| 240 |
|
| 241 |
# 0.13.1 |
| 242 |
|
| 243 |
> Wed 22nd of November 2018 |
| 244 |
|
| 245 |
- Fix a link in documentation. |
| 246 |
|
| 247 |
# 0.13 |
| 248 |
|
| 249 |
> Wed 21st of November 2018 |
| 250 |
|
| 251 |
- Update/reset hyperlinks in all the documentation for types, traits, methods, etc. |
| 252 |
- General enhancement of the documentation. |
| 253 |
- `ExternalDeclaration::new_struct` can now fail. Check the doc for further details. |
| 254 |
- `NonEmpty`, `Identifier` and `TypeName` and `TranslationUnit` are now plain types and not |
| 255 |
aliases anymore. |
| 256 |
- Add AST visitors. Visitors allow for traversing through an AST and on-the-fly mutation, |
| 257 |
filtering, etc. |
| 258 |
- The `#define` preprocessor pragma is now supported in a limited form (it can only be used in |
| 259 |
the global scope). |
| 260 |
|
| 261 |
# 0.12 |
| 262 |
|
| 263 |
> Sun 11th of November 2018 |
| 264 |
|
| 265 |
- Fix the type of identifier stored in `Block`: it now uses the new encoding for arrayed |
| 266 |
identifiers. |
| 267 |
- `Block` parsers update for the arrayd identifier change. |
| 268 |
|
| 269 |
# 0.11 |
| 270 |
|
| 271 |
> Sat 10th of November 2018 |
| 272 |
|
| 273 |
- Add helper functions to build objects form the `syntax` module. Those are intended to be a |
| 274 |
simple way to build ASTs out of Rust code instead of parsing. |
| 275 |
- Enhance the documentation of the `Preprocessor` type. |
| 276 |
|
| 277 |
# 0.10.1 |
| 278 |
|
| 279 |
> Fri 2nd of November 2018 |
| 280 |
|
| 281 |
- Add some missing implementors of `Parse` for types from `glsl::syntax`. |
| 282 |
|
| 283 |
# 0.10 |
| 284 |
|
| 285 |
> Fri 2nd of November 2018 |
| 286 |
|
| 287 |
- Hide the `parsers` module. It’s not exposed anymore as it was mostly |
| 288 |
[nom](https://crates.io/crates/nom) parsers and we don’t like leaking internals. |
| 289 |
- Introduce the `Parser` trait, acting as an abstraction over the internal parsers. Implementors |
| 290 |
provide a type-driven parsing experience that is very similar to the one as |
| 291 |
[FromStr](https://doc.rust-lang.org/std/str/trait.FromStr.html). This change is actually |
| 292 |
mandatory for the [glsl-quasiquote](https://crates.io/crates/glsl-quasiquote) crate’s `glsl!` |
| 293 |
proc-macro to allow people use it for any GLSL item (and not only `TranslationUnit`). |
| 294 |
- Enhance the overall documentation. |
| 295 |
|
| 296 |
# 0.9.2 |
| 297 |
|
| 298 |
> Wed 3rd of October 2018 |
| 299 |
|
| 300 |
- Fix GLSL transpiled representation of `IVec*`. It was plain wrong. |
| 301 |
|
| 302 |
# 0.9.1 |
| 303 |
|
| 304 |
> Sat 7th of July 2018 |
| 305 |
|
| 306 |
- Fix unit testing in transpilers. |
| 307 |
|
| 308 |
# 0.9 |
| 309 |
|
| 310 |
> Sat 7th of July 2018 |
| 311 |
|
| 312 |
- Big cleanup of the module hierarchy. |
| 313 |
- Enhanced the documentation. |
| 314 |
|
| 315 |
# 0.8.1 |
| 316 |
|
| 317 |
> Sun, 17th of June 2018 |
| 318 |
|
| 319 |
- Add the `README.md` path to the `Cargo.toml` manifest. |
| 320 |
|
| 321 |
# 0.8 |
| 322 |
|
| 323 |
> Sun 17th of June 2018 |
| 324 |
|
| 325 |
This version introduces breaking changes because public types used in return positions have changed. |
| 326 |
These concern only intermediate `nom` functions, so if you do not make a fancy use of this crate, |
| 327 |
you souldn’t have to worry too much when migrating. |
| 328 |
|
| 329 |
- Fix the roundtrip issue with the GLSL writer (precedence wasn’t correctly respected). |
| 330 |
- Simplify internal code. |
| 331 |
- Error instead of panicking when parsing overflowing integer literals. |
| 332 |
- Fix panic trying to parse literals starting with whitespace. |
| 333 |
- Add fuzzing to find out panics. |
| 334 |
|
| 335 |
# 0.7.2 |
| 336 |
|
| 337 |
> Wed 13th of December 2017 |
| 338 |
|
| 339 |
- Fix the `show_expr` when the `Expr` is a `Expr::UIntConst`. |
| 340 |
|
| 341 |
# 0.7.1 |
| 342 |
|
| 343 |
> Mon 20th of November 2017 |
| 344 |
|
| 345 |
- `std::error::Error` is now implemented for `ParseError`. |
| 346 |
|
| 347 |
# 0.7 |
| 348 |
|
| 349 |
> Wed 27th of September 2017 |
| 350 |
|
| 351 |
- Add support for postfix expressions as function identifiers. |
| 352 |
|
| 353 |
# 0.6.5 |
| 354 |
|
| 355 |
> Mon 4th of September 2017 |
| 356 |
|
| 357 |
- Fix the formatting of floating values when the fractional part is `0`. |
| 358 |
|
| 359 |
# 0.6.4 |
| 360 |
|
| 361 |
> Mon 4th of September 2017 |
| 362 |
|
| 363 |
- Fix the output for `show_struct_specifier`. |
| 364 |
|
| 365 |
# 0.6.3 |
| 366 |
|
| 367 |
> Mon 4th of September 2017 |
| 368 |
|
| 369 |
- Fix the output for `show_struct_specifier`. |
| 370 |
|
| 371 |
# 0.6.2 |
| 372 |
|
| 373 |
> Mon 4th of September 2017 |
| 374 |
|
| 375 |
- Remove a warning. |
| 376 |
|
| 377 |
# 0.6.1 |
| 378 |
|
| 379 |
> Mon 4th of September 2017 |
| 380 |
|
| 381 |
- Fix `show_struct_specifier`. |
| 382 |
|
| 383 |
# 0.6 |
| 384 |
|
| 385 |
> Fri 1st of September 2017 |
| 386 |
|
| 387 |
- The `TypeSpecifier` type was wrong as it didn’t carry any `ArraySpecifier` information while the |
| 388 |
GLSL specification’s grammar about type specifiers states they should. Fixed. |
| 389 |
|
| 390 |
# 0.5 |
| 391 |
|
| 392 |
> Mon 7th of August 2017 |
| 393 |
|
| 394 |
- The `parse` and `parse_str` functions now take as second argument the parser to run. This enables |
| 395 |
using those functions and all the neat logic the wrap in dependent projects. |
| 396 |
|
| 397 |
# 0.4.2 |
| 398 |
|
| 399 |
> Fri 4th of August 2017 |
| 400 |
|
| 401 |
- A GLSL writer is now available. |
| 402 |
- Some parsers yield non-empty list of syntax trees. Those had the incorrect `Vec` type. They were |
| 403 |
replaced by `NonEmpty`, which is an alias to `Vec`, but carry the semantic that it has at least |
| 404 |
one element in it. |
| 405 |
|
| 406 |
# 0.4.1 |
| 407 |
|
| 408 |
> Thu 3rd of August 2017 |
| 409 |
|
| 410 |
- Uni/multi-line comments are now supported. |
| 411 |
|
| 412 |
# 0.4 |
| 413 |
|
| 414 |
> Wed 2nd of August 2017 |
| 415 |
|
| 416 |
- The `Declaration::Block` variant was refactored for a better usage. |
| 417 |
- Dot field selections and, in a mory general way, postfix expressions completely fixed. The |
| 418 |
`syntax` module was altered to make it easier to work with dot field selection. Also related, |
| 419 |
the function identifier syntax is now isomorphic to an identifier. |
| 420 |
|
| 421 |
# 0.3.1 |
| 422 |
|
| 423 |
> Tue 1st of August 2017 |
| 424 |
|
| 425 |
- Fix the `preprocessor` parser so that it eats surrounding blanks. |
| 426 |
|
| 427 |
# 0.3 |
| 428 |
|
| 429 |
> Mon 31st of July 2017 |
| 430 |
|
| 431 |
- Add a very minimalistic yet working preprocessor. It parses `#version` and `#extension` |
| 432 |
commands. Those have to be declared at the top of your file, even though this implementation |
| 433 |
accepts them at any place an external declaration could be defined. Feel free to submit a PR |
| 434 |
if you want to change that behavior, I don’t really mind. |
| 435 |
- Enhance the runtime error reporting. It’s not perfect, but it’s way better than before! |
| 436 |
- `void` is now recognized as `TypeSpecifier::Void` instead of the erroneous |
| 437 |
`TypeSpecifier::TypeName("void")`. |
| 438 |
|
| 439 |
# 0.2.2 |
| 440 |
|
| 441 |
> Mon 31st of July 2017 |
| 442 |
|
| 443 |
- The `layout` parser had a nasty bug that would treat a list of key-value pairs as an expression |
| 444 |
assignment. This was fixed and it now treats it as a list of pairs of identifier associated with a |
| 445 |
possible constant expression. |
| 446 |
- The `StructFieldSpecifier` type and its associated parser were wrong. Was missing: |
| 447 |
+ the type qualifier |
| 448 |
+ for each identifier defined in the field specifier, its optional array specifier, as in |
| 449 |
`float foo[3];` or `vec3 bar[];` for unsized ones. |
| 450 |
|
| 451 |
# 0.2.1 |
| 452 |
|
| 453 |
> Sun 30th of July 2017 |
| 454 |
|
| 455 |
- More documentation to help people to get their feet wet. |
| 456 |
|
| 457 |
# 0.2 |
| 458 |
|
| 459 |
> Sat 29th of July 2017 |
| 460 |
|
| 461 |
- The whole parsing API is public. |
| 462 |
|
| 463 |
# 0.1 |
| 464 |
|
| 465 |
- Initial revision. |