diff --git a/src/lua.rs b/src/lua.rs index 12668c2..71bdda8 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -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 diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 99b2ccc..8457b1d 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -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() } --