compose_parser 2.1.0

Rust parser created to parse the Jetpack Compose Text and Images
Documentation
1
2
3
4
5
6
7
8
9
10
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\"" }
identifier = { ASCII_ALPHA ~ (ASCII_ALPHANUMERIC | "_")* }