Permalink
Browse files

Dont produce special :on node, use chained :block instead

  • Loading branch information...
1 parent 513bbef commit e709b66d8c3b1e16fccd68c10e7917a085a4345b @vic committed Sep 20, 2011
Showing with 4,638 additions and 4,638 deletions.
  1. +1 −1 lib/akin/grammar.kpeg
  2. +4,634 −4,634 lib/akin/grammar.rb
  3. +3 −3 spec/grammar_spec.rb
View
2 lib/akin/grammar.kpeg
@@ -27,7 +27,7 @@ braced_(x) = braced_(x):a - "," - block(x):b {a + Array(b)}
| block(x):b ~Array(b)
block(x) = block(x):a ws* nl - block(x):b &{a.pos.column < b.pos.column}
- ~n(a.pos, :on, a, b)
+ { a.name == :chain && (a.args.push(b);a) || a.with(:chain, a, b) }
| block_(x):b {b.size > 1 && n(b.first.pos, :block, *b) || b.first}
block_(x) = block_(x):b - ";" s chain(x):c {Array(c)}:a {b + a}
| block_(x):b s chain(x):c {Array(c)}:a
View
9,268 lib/akin/grammar.rb
4,634 additions, 4,634 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
6 spec/grammar_spec.rb
@@ -224,7 +224,7 @@
man
CODE
s(code).should ==
- [:on, [:chain, [:name, "foo"], [:name, "bar"]],
+ [:chain, [:name, "foo"], [:name, "bar"],
[:block, [:kmsg, [:part, "baz", nil, [:name, "bat"]]], [:name, "man"]]]
end
@@ -236,8 +236,8 @@
man
CODE
s(code).should ==
- [:on, [:block, [:chain, [:name, "foo"], [:name, "bar"]],
- [:kmsg, [:part, "baz", nil, [:name, "bat"]]]],
+ [:chain, [:block, [:chain, [:name, "foo"], [:name, "bar"]],
+ [:kmsg, [:part, "baz", nil, [:name, "bat"]]]],
[:name, "man"]]
end

0 comments on commit e709b66

Please sign in to comment.