Skip to content

Commit

Permalink
feat: add custom parser
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 1, 2022
1 parent bf1921f commit 1d02ae6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/samples/impl.fkl
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,15 @@ env Local {
port: 5432
database: "test"
}

server {
port: 9090;
}

kafka {
host: "localhost"
port: 9092
}
}

env Staging {
Expand Down
6 changes: 5 additions & 1 deletion fkl_parser/src/parser/fkl.pest
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ source_set_decl = {
}

env_decl = {
"env" ~ identifier ~ "{" ~ inline_doc? ~ (datasource_decl | server_decl )* ~ "}"
"env" ~ identifier ~ "{" ~ inline_doc? ~ (datasource_decl | server_decl | custom_decl )* ~ "}"
}

datasource_decl = {
Expand All @@ -253,6 +253,10 @@ server_decl = {
"server" ~ "{" ~ (attr_decl | inline_doc)* ~ "}"
}

custom_decl = {
identifier ~ "{" ~ (attr_decl | inline_doc)* ~ "}"
}

// ----------------------------- Attr -----------------------------

attr_decl = {
Expand Down

0 comments on commit 1d02ae6

Please sign in to comment.