Skip to content
Unverified Commit 76f0fa96 authored by Julian Antonielli's avatar Julian Antonielli Committed by GitHub
Browse files

Compile regexes for `@pattern` strings early (#2058)



* Add docs for `compile_regex()`

* Try to pass `@pattern` string shapes to service visitor

* Add `compile_rege` calls

* Remove unwanted changes

* Fix python code generator

* Add hack for `@pattern` + `@enum` trait

* Generate tests for regexes

* Move some functionality to `TraitInfo`

* Add docs for `Symbol.testModule`

* Improve docs for `Symbol.testModule`

* Update codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedStringGenerator.kt

Co-authored-by: default avatarLuca Palmieri <20745048+LukeMathWalker@users.noreply.github.com>

* Refactor `regex_compiles` test rendering

* Refactor `Symbol.testModule` -> `SymbolProvider.testModuleForShape`

* Use `RustWriter.unitTest` instead of manually annotating `#[test]`s

* Refactor `mapNotNull` -> `filter` + `map`

* Only render doc comment when there's `@pattern` strings

* Rename `String.toRustName` -> `´String.unsafeToRustName`

* Add kotlin test for pattern with lookahead

* Update `Attribute.Cfg` to new `Attribute.CfgTest`

* Prepend `@pattern` docs

* Fix test name

Co-authored-by: default avatarLuca Palmieri <20745048+LukeMathWalker@users.noreply.github.com>
parent aaac83f9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment