We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6c6a242 + 8d813e2 commit 380163aCopy full SHA for 380163a
lib/unparser/writer/binary.rb
@@ -52,9 +52,13 @@ def symbol_name
52
end
53
54
def dispatch
55
- left_emitter.write_to_buffer
56
- write(' ', MAP.fetch(effective_symbol), ' ')
57
- visit(right)
+ if node.type.eql?(:and) && left.type.equal?(:or)
+ emit_with(KEYWORD_TOKENS)
+ else
58
+ left_emitter.write_to_buffer
59
+ write(' ', MAP.fetch(effective_symbol), ' ')
60
+ visit(right)
61
+ end
62
63
64
private
test/corpus/semantic/and.rb
@@ -6,3 +6,13 @@
6
7
if a...b and c...d
8
9
+
10
+a and b and c
11
+(a and b) and c
12
+a and (b and c)
13
+a and b or c
14
+(a and b) or c
15
+a and (b or c)
16
+a or b and c
17
+(a or b) and c
18
+a or (b and c)
test/corpus/semantic/or.rb
@@ -0,0 +1 @@
1
+a[:x] = b[:x] || c[:x] || d(:new)
0 commit comments