Skip to content

Commit

Permalink
feat: added colon to operators
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmasoldi3r committed Oct 24, 2023
1 parent 9ae1a63 commit 41d3aab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ fn translate_operator(ctx: code::Builder, op: String) -> code::Builder {
b'#' => "bang",
b'$' => "dollar",
b'^' => "power",
b':' => "colon",
_ => panic!(
"Error! Unexpected operator {} to be translated as a function!",
ch
Expand Down
2 changes: 1 addition & 1 deletion src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ peg::parser! {
left:(@) _ value:$(">>") _ right:@ { BinaryExpression { left, right, operator: Operator(value.into()) }.into() }
--
// Extra logic:
left:(@) _ value:$(['^'|'+'|'-'|'*'|'/'|'.'|'|'|'>'|'<'|'='|'?'|'!'|'~'|'%'|'&'|'#'|'$']+) _ right:@ {
left:(@) _ value:$(['^'|'+'|'-'|'*'|'/'|'.'|'|'|'>'|'<'|'='|'?'|'!'|'~'|'%'|'&'|'#'|'$'|':']+) _ right:@ {
BinaryExpression { left, right, operator: Operator(value.into()) }.into()
}
--
Expand Down

0 comments on commit 41d3aab

Please sign in to comment.