h0tk3y / better-parse

A nice parser combinator library for Kotlin
Apache License 2.0
421 stars 42 forks source link

Fix InvalidMutabilityException in RegexToken #41

Closed itegulov closed 3 years ago

itegulov commented 3 years ago

Mutating relativeInput makes better-parse throw InvalidMutabilityException on iosX64 (probably on other Kotlin/Native platforms as well). This PR turns relativeInput into a local immutable object.

h0tk3y commented 3 years ago

Also, how does the InvalidMutabilityException appear? Is it some native-multithreading scenario? Could you please add a test for the native platforms that reproduces the issue or describe the case so that I can add the test myself?

itegulov commented 3 years ago

@h0tk3y sorry, the last month was very busy for me. I have added a test showing how to reproduce the error in concurrent scenario.

itegulov commented 3 years ago

@h0tk3y ping

h0tk3y commented 3 years ago

It seems like the fix doesn't affect the Kotlin/Native benchmarks in any noticeable way. I'm accepting it now and will publish a new release sometime soon. Thanks a lot!

itegulov commented 3 years ago

@h0tk3y thanks for merging the PR. How soon can we expect the new version to be released?