From 578766b841ff7a989f74dc2d931ed76d41e51199 Mon Sep 17 00:00:00 2001 From: Philipp Krones Date: Thu, 29 Nov 2018 23:49:12 +0100 Subject: [PATCH] Apply review --- exec/binary_ops.mj | 10 +++++----- exec/can_short_circuit.mj | 28 ++++++++++++++-------------- exec/multiassign.mj | 3 +-- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/exec/binary_ops.mj b/exec/binary_ops.mj index da4fac0..c8a1a7b 100644 --- a/exec/binary_ops.mj +++ b/exec/binary_ops.mj @@ -1,10 +1,10 @@ class A { public static void main(String[] args) { - System.out.println(2 - 1); // 1 - System.out.println(4 / 2); // 2 - System.out.println(1 + 2); // 3 - System.out.println(2 * 2); // 4 - System.out.println(11 % 6); // 5 + System.out.println(2 - 1); /* 1 */ + System.out.println(4 / 2); /* 2 */ + System.out.println(1 + 2); /* 3 */ + System.out.println(2 * 2); /* 4 */ + System.out.println(11 % 6); /* 5 */ if (false || true) { System.out.println(6); } if (true || false) { System.out.println(7); } diff --git a/exec/can_short_circuit.mj b/exec/can_short_circuit.mj index 3954359..deb0a5c 100644 --- a/exec/can_short_circuit.mj +++ b/exec/can_short_circuit.mj @@ -1,35 +1,35 @@ class A { public boolean side_effect() { - System.out.write(70); // - System.out.write(10); // newline + System.out.write(70); /* F */ + System.out.write(10); /* newline */ return false; } public static void main(String[] args) { A a = new A(); if (true || a.side_effect()) { - System.out.write(79); // O - System.out.write(75); // K - System.out.write(10); // newline + System.out.write(79); /* O */ + System.out.write(75); /* K */ + System.out.write(10); /* newline */ } if (false && a.side_effect()) { } else { - System.out.write(79); // O - System.out.write(75); // K - System.out.write(10); // newline + System.out.write(79); /* O */ + System.out.write(75); /* K */ + System.out.write(10); /* newline */ } if (!(false && a.side_effect())) { - System.out.write(79); // O - System.out.write(75); // K - System.out.write(10); // newline + System.out.write(79); /* O */ + System.out.write(75); /* K */ + System.out.write(10); /* newline */ } if ((true || a.side_effect()) && true) { - System.out.write(79); // O - System.out.write(75); // K - System.out.write(10); // newline + System.out.write(79); /* O */ + System.out.write(75); /* K */ + System.out.write(10); /* newline */ } } } diff --git a/exec/multiassign.mj b/exec/multiassign.mj index 05d333e..122dc5b 100644 --- a/exec/multiassign.mj +++ b/exec/multiassign.mj @@ -1,5 +1,4 @@ -eass A { - +class A { public static void main(String[] args) { int x = 8; int y = x = 4; -- 2.22.0