mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-01 10:17:30 +03:00
Merge pull request #1115 from AleoHQ/bug/abnf-parser-bugs
[Fix] Abnf and Parser Alignment and Equality Change
This commit is contained in:
commit
a0dc00bbd3
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1222,6 +1222,7 @@ dependencies = [
|
||||
"leo-imports",
|
||||
"leo-input",
|
||||
"leo-package",
|
||||
"leo-parser",
|
||||
"leo-state",
|
||||
"leo-synthesizer",
|
||||
"notify",
|
||||
|
@ -61,6 +61,10 @@ version = "1.5.2"
|
||||
path = "./package"
|
||||
version = "1.5.2"
|
||||
|
||||
[dependencies.leo-parser]
|
||||
path = "./parser"
|
||||
version = "1.5.2"
|
||||
|
||||
[dependencies.leo-state]
|
||||
path = "./state"
|
||||
version = "1.5.2"
|
||||
|
@ -1,3 +1,3 @@
|
||||
function main(a: address, b: address, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: field, b: field, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: group, b: group, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i128, b: i128, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i128, b: i128, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i16, b: i16, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i16, b: i16, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i32, b: i32, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i32, b: i32, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i64, b: i64, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i64, b: i64, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i8, b: i8, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: i8, b: i8, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u128, b: u128, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u128, b: u128, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u16, b: u16, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u16, b: u16, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u32, b: u32, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u32, b: u32, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u64, b: u64, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u64, b: u64, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u8, b: u8, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u8, b: u8, c: bool) {
|
||||
console.assert(a != b == c);
|
||||
console.assert((a != b) == c);
|
||||
}
|
@ -453,7 +453,7 @@ identifier = letter *( letter / digit / "_" ) ; but not a keyword or aleo1...
|
||||
; A package name consists of one or more segments separated by single dashes,
|
||||
; where each segment is a non-empty sequence of lowercase letters and digits.
|
||||
|
||||
package-name = 1*( lowercase-letter / digit )
|
||||
package-name = lowercase-letter *( lowercase-letter / digit )
|
||||
*( "-" 1*( lowercase-letter / digit ) )
|
||||
|
||||
; Annotations have names, which are identifiers immediately preceded by `@`.
|
||||
@ -848,8 +848,8 @@ ordering-expression = additive-expression
|
||||
; the rule below makes them left-associative.
|
||||
|
||||
equality-expression = ordering-expression
|
||||
/ equality-expression "==" ordering-expression
|
||||
/ equality-expression "!=" ordering-expression
|
||||
/ ordering-expression "==" ordering-expression
|
||||
/ ordering-expression "!=" ordering-expression
|
||||
|
||||
; Next come conjunctive expressions, left-associative.
|
||||
|
||||
@ -962,7 +962,7 @@ assert-call = %s"assert" "(" expression ")"
|
||||
|
||||
print-function = %s"debug" / %s"error" / %s"log"
|
||||
|
||||
print-arguments = "(" [ string-literal *( "," expression ) ] ")"
|
||||
print-arguments = "(" string-literal *( "," expression ) ")"
|
||||
|
||||
print-call = print-function print-arguments
|
||||
|
||||
@ -1020,7 +1020,7 @@ member-function-declaration = function-declaration
|
||||
; this may be relaxed after the backward compatibility is removed,
|
||||
; allowing member variables and member functions to be intermixed.
|
||||
|
||||
circuit-declaration = *annotation %s"circuit" identifier
|
||||
circuit-declaration = %s"circuit" identifier
|
||||
"{" [ member-variable-declarations ]
|
||||
*member-function-declaration "}"
|
||||
|
||||
|
@ -20,6 +20,7 @@ use leo_package::{
|
||||
outputs::OutputsDirectory,
|
||||
root::{ZipFile, AUTHOR_PLACEHOLDER},
|
||||
};
|
||||
use leo_parser::KEYWORD_TOKENS;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use structopt::StructOpt;
|
||||
@ -47,6 +48,10 @@ impl Command for Publish {
|
||||
let manifest = context.manifest()?;
|
||||
|
||||
let package_name = manifest.get_package_name();
|
||||
if KEYWORD_TOKENS.iter().any(|keyword| keyword.to_string() == package_name) {
|
||||
return Err(anyhow!("Cannot name a package after a keyword"));
|
||||
}
|
||||
|
||||
let package_version = manifest.get_package_version();
|
||||
|
||||
match (
|
||||
|
@ -100,6 +100,10 @@ impl SyntaxError {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn unexpected_statement(got: String, expected: &str, span: &Span) -> Self {
|
||||
Self::new_from_span(format!("expected '{}', got '{}'", expected, got), span)
|
||||
}
|
||||
|
||||
pub fn unexpected_str(got: &Token, expected: &str, span: &Span) -> Self {
|
||||
Self::new_from_span(format!("expected '{}', got '{}'", expected, got.to_string()), span)
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
extern crate thiserror;
|
||||
|
||||
pub(crate) mod tokenizer;
|
||||
pub use tokenizer::KEYWORD_TOKENS;
|
||||
pub(crate) use tokenizer::*;
|
||||
|
||||
pub mod errors;
|
||||
|
@ -187,7 +187,7 @@ impl ParserContext {
|
||||
///
|
||||
pub fn parse_equality_expression(&mut self) -> SyntaxResult<Expression> {
|
||||
let mut expr = self.parse_ordering_expression()?;
|
||||
while let Some(SpannedToken { token: op, .. }) = self.eat_any(&[Token::Eq, Token::NotEq]) {
|
||||
if let Some(SpannedToken { token: op, .. }) = self.eat_any(&[Token::Eq, Token::NotEq]) {
|
||||
let right = self.parse_ordering_expression()?;
|
||||
expr = Expression::Binary(BinaryExpression {
|
||||
span: expr.span() + right.span(),
|
||||
|
@ -102,11 +102,20 @@ impl ParserContext {
|
||||
let end_span;
|
||||
let arguments = if self.eat(Token::LeftParen).is_some() {
|
||||
let mut args = Vec::new();
|
||||
let mut comma = false;
|
||||
loop {
|
||||
if let Some(end) = self.eat(Token::RightParen) {
|
||||
if comma {
|
||||
return Err(SyntaxError::unexpected(
|
||||
&Token::RightParen,
|
||||
&[Token::Ident("identifier".into()), Token::Int("number".into())],
|
||||
&end.span,
|
||||
));
|
||||
}
|
||||
end_span = end.span;
|
||||
break;
|
||||
}
|
||||
comma = false;
|
||||
if let Some(ident) = self.eat_identifier() {
|
||||
args.push(ident.name);
|
||||
} else if let Some((int, _)) = self.eat_int() {
|
||||
@ -115,10 +124,11 @@ impl ParserContext {
|
||||
let token = self.peek()?;
|
||||
return Err(SyntaxError::unexpected_str(&token.token, "ident or int", &token.span));
|
||||
}
|
||||
if self.eat(Token::Comma).is_none() {
|
||||
if self.eat(Token::Comma).is_none() && !comma {
|
||||
end_span = self.expect(Token::RightParen)?;
|
||||
break;
|
||||
}
|
||||
comma = true;
|
||||
}
|
||||
args
|
||||
} else {
|
||||
|
@ -185,7 +185,17 @@ impl ParserContext {
|
||||
self.fuzzy_struct_state = false;
|
||||
let body = self.parse_block()?;
|
||||
let next = if self.eat(Token::Else).is_some() {
|
||||
Some(Box::new(self.parse_statement()?))
|
||||
let s = self.parse_statement()?;
|
||||
match s {
|
||||
Statement::Block(_) | Statement::Conditional(_) => Some(Box::new(s)),
|
||||
s => {
|
||||
return Err(SyntaxError::unexpected_statement(
|
||||
s.to_string(),
|
||||
"Block or Conditional",
|
||||
s.span(),
|
||||
));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
@ -22,6 +22,7 @@
|
||||
pub(crate) mod token;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub use self::token::KEYWORD_TOKENS;
|
||||
pub(crate) use self::token::*;
|
||||
|
||||
pub(crate) mod lexer;
|
||||
|
@ -1,3 +1,3 @@
|
||||
function main(a: group, b: group, c: bool) {
|
||||
console.assert(a == b == c);
|
||||
console.assert((a == b) == c);
|
||||
}
|
@ -8,5 +8,5 @@ function main(y: bool) -> bool {
|
||||
const a: [u8; (2, 2, 2)] = [1u8; (2, 2, 2)];
|
||||
const b: [u8; (2, 2, 2)] = [[[1u8; 2]; 2]; 2];
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ function main(y: bool) -> bool {
|
||||
const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline
|
||||
const b: [u32; (3, 2)] = [[0; 2]; 3]; // initializer
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -10,5 +10,5 @@ function main(y: bool) -> bool {
|
||||
|
||||
const actual = arr[..2]; // Should produce [0, 1]
|
||||
|
||||
return expected == actual == y;
|
||||
return (expected == actual) == y;
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ function main(y: bool) -> bool {
|
||||
const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline
|
||||
const b: [u32; (3, 2)] = [0; (3, 2)]; // initializer
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -12,5 +12,5 @@ function main(y: bool) -> bool {
|
||||
|
||||
const b: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4]; // initializer
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -8,5 +8,5 @@ function main(y: bool) -> bool {
|
||||
const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline
|
||||
const b: [[u8; 2]; 3] = [0; (3, 2)]; // initializer
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -12,5 +12,5 @@ function main(y: bool) -> bool {
|
||||
|
||||
const b: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)]; // initializer
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ function main(y: bool) -> bool {
|
||||
|
||||
const b: [u8; (3, 2)] = [[0; 2]; 3]; // initializer
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -12,5 +12,5 @@ function main(y: bool) -> bool {
|
||||
|
||||
const b: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4]; // initializer
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ function main(y: bool) -> bool {
|
||||
|
||||
const b: [u8; (3, 2)] = [0; (3, 2)]; // initializer
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -12,5 +12,5 @@ function main(y: bool) -> bool{
|
||||
|
||||
const b: [u8; (4, 3, 2)] = [0; (4, 3, 2)]; // initializer
|
||||
|
||||
return a == b == y;
|
||||
return (a == b) == y;
|
||||
}
|
||||
|
@ -15,5 +15,5 @@ circuit Foo {
|
||||
function main(y: bool) -> bool {
|
||||
let f = Foo { a: 0u8 };
|
||||
|
||||
return 1u8 == f.use_a() == true;
|
||||
return (1u8 == f.use_a()) == true;
|
||||
}
|
||||
|
@ -25,5 +25,5 @@ function main(const x: u8, y: bool) -> bool {
|
||||
const a = Foo { x };
|
||||
const b = Foo::new(x);
|
||||
|
||||
return b.x == a.x == y;
|
||||
return (b.x == a.x) == y;
|
||||
}
|
||||
|
@ -15,5 +15,5 @@ circuit Foo {
|
||||
function main(y: bool) -> bool {
|
||||
const a = Foo { x: 1u32 };
|
||||
|
||||
return a.echo() == 1u32 == true;
|
||||
return (a.echo() == 1u32) == true;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ circuit Foo {
|
||||
function main(y: bool) -> bool {
|
||||
const a = Foo::echo(1u32);
|
||||
|
||||
return a == 1u32 == y;
|
||||
return (a == 1u32) == y;
|
||||
}
|
||||
|
@ -11,5 +11,5 @@ circuit Foo {
|
||||
function main(y: bool) -> bool {
|
||||
const a = Foo { x: 1u32 };
|
||||
|
||||
return a.x == 1u32 == y;
|
||||
return (a.x == 1u32) == y;
|
||||
}
|
||||
|
@ -16,5 +16,5 @@ function main(y: bool) -> bool {
|
||||
const a = Foo { foo: 1 };
|
||||
const b = a.foo + Foo::bar();
|
||||
|
||||
return b == 2u32 == y;
|
||||
return (b == 2u32) == y;
|
||||
}
|
||||
|
@ -18,5 +18,5 @@ function main(y: bool) -> bool {
|
||||
f.set_a(1u8);
|
||||
f.set_a(2u8);
|
||||
|
||||
return f.a == 2u8 == y;
|
||||
return (f.a == 2u8) == y;
|
||||
}
|
||||
|
@ -22,5 +22,5 @@ function main(y: bool) -> bool {
|
||||
f.set_a(false, 2u8);
|
||||
f.set_a(true, 2u8);
|
||||
|
||||
return f.a == 2u8 == y;
|
||||
return (f.a == 2u8) == y;
|
||||
}
|
||||
|
@ -14,5 +14,5 @@ function main(y: bool) -> bool {
|
||||
f.a = 1u8;
|
||||
f.a = 2u8;
|
||||
|
||||
return f.a == 2u8 == true;
|
||||
return (f.a == 2u8) == true;
|
||||
}
|
||||
|
@ -25,5 +25,5 @@ function main(y: bool) -> bool {
|
||||
const t = TestMe {x: 6u8}.test_me();
|
||||
const u = my_fn().test_me();
|
||||
const v = TestMe::new().test_me();
|
||||
return v == 2u8 == y;
|
||||
return (v == 2u8) == y;
|
||||
}
|
||||
|
@ -16,5 +16,5 @@ function main(y: bool) -> bool {
|
||||
const a = Foo { f: 1u32 };
|
||||
const b = a.bar();
|
||||
|
||||
return b == 1u32 == y;
|
||||
return (b == 1u32) == y;
|
||||
}
|
||||
|
@ -15,5 +15,5 @@ function main(y: bool) -> bool {
|
||||
a += one();
|
||||
}
|
||||
|
||||
return a == 10u32 == y;
|
||||
return (a == 10u32) == y;
|
||||
}
|
||||
|
@ -17,5 +17,5 @@ function iteration() -> u32 {
|
||||
function main(y: bool) -> bool {
|
||||
const total = iteration() + iteration();
|
||||
|
||||
return total == 20 == y;
|
||||
return (total == 20) == y;
|
||||
}
|
||||
|
@ -11,5 +11,5 @@ function one() -> bool {
|
||||
function main(y: bool) -> bool {
|
||||
const a = one() && one();
|
||||
|
||||
return a == true == y;
|
||||
return (a == true) == y;
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ function one() -> u32 {
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return one() == 1u32 == y;
|
||||
return (one() == 1u32) == y;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ function main(y: bool) -> bool {
|
||||
const a = 1u32;
|
||||
bad_mutate(a);
|
||||
|
||||
return a == 1u32 == y; // <- value `a` is still `1u32`
|
||||
return (a == 1u32) == y; // <- value `a` is still `1u32`
|
||||
}
|
||||
|
@ -6,5 +6,5 @@
|
||||
import test-import.foo as bar;
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return bar() == 1u32 == y;
|
||||
return (bar() == 1u32) == y;
|
||||
}
|
||||
|
@ -6,5 +6,5 @@
|
||||
import test-import.foo;
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return foo() == 1u32 == true;
|
||||
return (foo() == 1u32) == true;
|
||||
}
|
||||
|
@ -27,5 +27,5 @@ function main(y: bool) -> bool {
|
||||
|
||||
const car = Car { c: 1u32 };
|
||||
|
||||
return car.c == 1u32 == y;
|
||||
return (car.c == 1u32) == y;
|
||||
}
|
||||
|
@ -20,5 +20,5 @@ function main(y: bool) -> bool {
|
||||
|
||||
const car = Car { c: 1u32 };
|
||||
|
||||
return car.c == 1u32 == y;
|
||||
return (car.c == 1u32) == y;
|
||||
}
|
||||
|
@ -11,5 +11,5 @@ import test-import.(
|
||||
function main(y: bool) -> bool {
|
||||
const a = Point { x: 1u32, y: 0u32 };
|
||||
|
||||
return a.x == 1u32 == y;
|
||||
return (a.x == 1u32) == y;
|
||||
}
|
||||
|
@ -8,5 +8,5 @@ import test-import.*;
|
||||
function main(y: bool) -> bool {
|
||||
const a = Point { x: 1u32, y: 0u32 };
|
||||
|
||||
return foo() == 1u32 == y;
|
||||
return (foo() == 1u32) == y;
|
||||
}
|
||||
|
@ -5,5 +5,5 @@ input_file: input/main.in
|
||||
*/
|
||||
|
||||
function main(const a: bool, b: bool) -> bool {
|
||||
return a == true == b;
|
||||
return (a == true) == b;
|
||||
}
|
||||
|
@ -6,5 +6,5 @@ input_file: input/main_array.in
|
||||
|
||||
function main(const x: [i16; 1], y: bool) -> bool {
|
||||
console.log("{}", x);
|
||||
return x[0] == 0 == y;
|
||||
return (x[0] == 0) == y;
|
||||
}
|
||||
|
@ -5,5 +5,5 @@ input_file: input/main_multiple.in
|
||||
*/
|
||||
|
||||
function main(const a: bool, const b: bool, y: bool) -> bool {
|
||||
return a != b == y;
|
||||
return (a != b) == y;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i128, b: i128, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i128, b: i128, c: bool) -> bool{
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -7,5 +7,5 @@ input_file: ../input/dummy.in
|
||||
function main(y: bool) -> bool{
|
||||
const a = -128i128;
|
||||
const b = -a;
|
||||
return b == -a == y;
|
||||
return (b == -a) == y;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
function main(y: bool) -> bool {
|
||||
const a = 0i128;
|
||||
|
||||
return -a == 0i128 == y;
|
||||
return (-a == 0i128) == y;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i16, b: i16, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i16, b: i16, c: bool) -> bool{
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -7,5 +7,5 @@ input_file: ../input/dummy.in
|
||||
function main(y: bool) -> bool {
|
||||
const a = -128i16;
|
||||
const b = -a;
|
||||
return b == -a == y;
|
||||
return (b == -a) == y;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
function main(y: bool) -> bool {
|
||||
const a = 0i16;
|
||||
|
||||
return -a == 0i16 == y;
|
||||
return (-a == 0i16) == y;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i32, b: i32, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i32, b: i32, c: bool) -> bool{
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -7,5 +7,5 @@ input_file: ../input/dummy.in
|
||||
function main(y: bool) -> bool{
|
||||
const a = -128i32;
|
||||
const b = -a;
|
||||
return b == -a == y;
|
||||
return (b == -a) == y;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
function main(y: bool) -> bool {
|
||||
const a = 0i32;
|
||||
|
||||
return -a == 0i32 == y;
|
||||
return (-a == 0i32) == y;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i64, b: i64, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i64, b: i64, c: bool) -> bool{
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -7,5 +7,5 @@ input_file: ../input/dummy.in
|
||||
function main(y: bool) -> bool{
|
||||
const a = -128i64;
|
||||
const b = -a;
|
||||
return b == -a == y;
|
||||
return (b == -a) == y;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
function main(y: bool) -> bool {
|
||||
const a = 0i64;
|
||||
|
||||
return -a == 0i64 == y;
|
||||
return (-a == 0i64) == y;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i8, b: i8, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: i8, b: i8, c: bool) -> bool{
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
function main(y: bool) -> bool {
|
||||
const a = 0i8;
|
||||
|
||||
return -a == 0i8 == y;
|
||||
return (-a == 0i8) == y;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u128, b: u128, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u128, b: u128, c: bool) -> bool {
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u16, b: u16, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u16, b: u16, c: bool) -> bool {
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u32, b: u32, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u32, b: u32, c: bool) -> bool {
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u64, b: u64, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u64, b: u64, c: bool) -> bool {
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -21,5 +21,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u8, b: u8, c: bool) -> bool {
|
||||
return a == b == c;
|
||||
return (a == b) == c;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ inputs:
|
||||
*/
|
||||
|
||||
function main(a: u8, b: u8, c: bool) -> bool {
|
||||
return a != b == c;
|
||||
return (a != b) == c;
|
||||
}
|
||||
|
@ -8,5 +8,5 @@ function main(y: bool) -> bool {
|
||||
let a = [1u32];
|
||||
a[0] = 0;
|
||||
|
||||
return a[0] == 0u32 == y;
|
||||
return (a[0] == 0u32) == y;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user