Skip to content

Commit

Permalink
Merge branch 'main' into raise_exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
melvic-ybanez committed Nov 10, 2023
2 parents 8c8e4b0 + 54e70b8 commit 97b5f67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ in [BNF](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form):
<expression> ::= <assignment> | <lambda>
<assignment> ::= <call> "=" <expression>
<call> ::= <primary> ("(" (<expression> | ("," <expression>)*)? ")" | "." <identifier> | <index>)*
<index> ::= "[" <constant> "]"
<index> ::= "[" <expression> "]"
<identifier> ::= <alpha>(<alpha>?<digit>?)*
<lambda> ::= "lambda" <params> <block> | <or>
<block> ::= "{" <declaration>* "}"
Expand All @@ -234,13 +234,12 @@ in [BNF](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form):
| ">>>" | "<=" <factor>)*
<factor> ::= <unary> ("/" | "*" | "%" <unary>)*
<unary> ::= ("!" | "-" | "+" | "not")* <call>
<primary> ::= <constant> | "self" | <identifier> | <list> | <tuple>
| <dictionary> | "(" <expression> ")"
<constant> ::= "false" | "true" | "none" | <number> | <string>
<primary> ::= "false" | "true" | "none" | <number> | <string> | "self" | <identifier>
| <list> | <tuple> | <dictionary> | "(" <expression> ")"
<list> ::= "[" (<expression> ("," <expression>*))? "]"
<tuple> ::= "(" (<expression> ("," | ("," <expression>)*))? ")"
<dictionary> ::= "{" (<key-value> ("," <key-value>)*)? "}"
<key-value> ::= <constant> ":" <expression>
<key-value> ::= <expression> ":" <expression>
<number> ::= <sign>?<nat>("."<nat>)?
<sign> ::= "-" | "+"
<string> ::= '"'(.?"\n"?)*'"'
Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/com/melvic/dry/parsers/ExprParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ private[parsers] trait ExprParser { _: Parser =>

/**
* {{{
* <primary> ::= <constant> | "self" | <identifier> | <tuple> | <dictionary> | "(" <expression> ")"
* <primary> ::= "false" | "true" | "none" | <number> | <string> | "self" | <identifier>
* | <list> | <tuple> | <dictionary> | "(" <expression> ")"
* }}}
*/
def primary: ParseResult[Expr] =
Expand Down Expand Up @@ -275,7 +276,7 @@ private[parsers] trait ExprParser { _: Parser =>
/**
* {{{
* <dictionary> ::= "{" (<key-value> ("," <key-value>)*)? "}"
* <key-value> ::= <constant> ":" <expression>
* <key-value> ::= <expression> ":" <expression>
* }}}
*/
def dictionary: ParseResult[Dictionary] =
Expand Down

0 comments on commit 97b5f67

Please sign in to comment.