Skip to content

Commit

Permalink
Tweak syntax for protocol variants
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmehall committed Jul 24, 2017
1 parent 16e0ea7 commit 73ddf52
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/spi.signalspec
Expand Up @@ -2,12 +2,12 @@ let bit = #0|#1
let byte = [bit, bit, bit, bit, bit, bit, bit, bit]

protocol SPI() {
byte
#start
#end
byte,
#start,
#end,
}

with (#h|#l, #h|#l)
with (#h|#l, #h|#l, #h|#l)
def spi(): SPI() {
repeat <: #10 { (#h, <: #l, <: #l) }
repeat {
Expand Down
2 changes: 1 addition & 1 deletion src/language/signalspec.rustpeg
Expand Up @@ -53,7 +53,7 @@ block -> ast::Block
{ ast::AltArm { discriminant:expr, block:block } }

protocol_block -> Vec<ast::ProtocolEntry>
= LBRACE entries:(entry:protocol_entry**(SEMICOLON?) {entry}) RBRACE
= LBRACE entries:(protocol_entry**COMMA) COMMA? RBRACE
{ entries }

protocol_entry -> ast::ProtocolEntry
Expand Down
2 changes: 1 addition & 1 deletion tests/check/tuple.signalspec
@@ -1,6 +1,6 @@
let t = #a|#b|#c|#d

with t
with (t, t)
def main() {
(#a, #b)
(#c, #d)
Expand Down

0 comments on commit 73ddf52

Please sign in to comment.