Skip to content

Commit 124102b

Browse files
committed
Use more and and or
1 parent cf5631c commit 124102b

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

samples/brainfuck.lit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type Parser {
5555

5656
if c == "[" {
5757
bracket_stack.push(i)
58-
} else if c == "]" && !bracket_stack.is_empty?() {
58+
} else if c == "]" and !bracket_stack.is_empty?() {
5959
let left = bracket_stack.pop()
6060
let right = i
6161
bracket_map[left] = right
@@ -128,7 +128,7 @@ fn help {
128128
}
129129

130130
fn parse_options {
131-
let option = argv()[0] || help()
131+
let option = argv()[0] or help()
132132

133133
if "--hello-world".includes?(option) {
134134
"
@@ -159,9 +159,9 @@ fn parse_options {
159159
http://www.hevanet.com/cristofd/brainfuck/]
160160

161161
"
162-
} else if "--file".includes?(option) && argv()[1] {
162+
} else if "--file".includes?(option) and argv()[1] {
163163
open(argv()[1])
164-
} else if "--eval".includes?(option) && argv()[1] {
164+
} else if "--eval".includes?(option) and argv()[1] {
165165
argv()[1]
166166
} else {
167167
help()

spec/e2e/custom_types/operator_overload.lit

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ type Vector2D {
2121
}
2222

2323
eq { |other|
24-
return self.x == other.x && self.y == other.y
24+
return self.x == other.x and self.y == other.y
2525
}
2626

2727
lt { |other|
28-
return self.x < other.x || (self.x == other.x && self.y < other.y)
28+
return self.x < other.x or (self.x == other.x and self.y < other.y)
2929
}
3030

3131
lte { |other|
32-
return self.x < other.x || (self.x == other.x && self.y <= other.y)
32+
return self.x < other.x or (self.x == other.x and self.y <= other.y)
3333
}
3434

3535
gt { |other|
36-
return self.x > other.x || (self.x == other.x && self.y > other.y)
36+
return self.x > other.x or (self.x == other.x and self.y > other.y)
3737
}
3838

3939
gte { |other|
40-
return self.x > other.x || (self.x == other.x && self.y >= other.y)
40+
return self.x > other.x or (self.x == other.x and self.y >= other.y)
4141
}
4242

4343
mod { |other|

spec/e2e/loops/while/syntax.lit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ println(
4444
var e = 0
4545
println(
4646
inspect(while e < 3 {
47-
if e == 0 || e == 2 {
47+
if e == 0 or e == 2 {
4848
e += 1
4949
next # next returns nil
5050
}

spec/e2e/string/literals.lit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ println('a\nstring') # expect: a\nstring
1010
println("A~¶Þॐஃ") # expect: A~¶Þॐஃ
1111

1212
# symbol strings
13-
println(:hey == 'hey' && :hey == "hey") # expect: true
13+
println(:hey == 'hey' and :hey == "hey") # expect: true
1414
println(:hey) # expect: hey
1515
println(:123) # expect: 123
1616
println(:1a2b3c) # expect: 1a2b3c

spec/stdlib/test_runner.lit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type TestRunner {
2222
self.tests.each(fn { |t|
2323
let result = t[:block](Should())
2424

25-
if result && result[:ok] == false {
25+
if result and result[:ok] == false {
2626
print("F")
2727
failed_tests.push({ name: "{self.current_group} {t[:name]}", message: result[:message] })
2828
} else {

0 commit comments

Comments
 (0)