### Jetpack Compose Rust Parser
Link: https://crates.io/crates/compose_parser
Docs: https://docs.rs/compose_parser/latest/compose_parser/
### Brief Describe
* Rust parser created to parse the Jetpack Compose Text / Image View and get all text fields and images
* It is important that the function starts with @Composable and has any name
* Plus use Kotlin syntax
### Grammar
```pest
compose_function = { function_declaration }
function_declaration = { "@Composable\nfun " ~ function_name ~ "() " ~ block }
function_name = { identifier }
block = { "{\n" ~ statement* ~ "}" }
statement = { text_function | image_function }
text_function = { " Text(text = " ~ string ~ ")\n" }
image_function = { " Image(image = " ~ string_image ~ ")\n" }
string = { "\"" ~ (ASCII_ALPHANUMERIC | " ")* ~ "\"" }
string_image = { "\"" ~ ASCII_ALPHANUMERIC* ~ ".png\"" }
```kotlin
./compose_parser --file example.kt
@Composable
fun Example() {
Text(text = "World")
Image(image = "url.png")
Image(image = "image.png")
}
// In result you have function name and text and image fields
Function: Example
Text: World
Image: url.png
Image: image.png
```
### Author
* Dzhos Oleksii me@programistich.com