(input: ParseStream)
| 35 | |
| 36 | impl Parse for Port { |
| 37 | fn parse(input: ParseStream) -> Result<Self> { |
| 38 | let name: syn::Ident = input.parse()?; |
| 39 | Ok(if input.peek(Token![:]) { |
| 40 | input.parse::<Token![:]>()?; |
| 41 | if input.peek(syn::token::Dyn) { |
| 42 | input.parse::<syn::token::Dyn>()?; |
| 43 | Port { |
| 44 | name, |
| 45 | ty: PortType::Dyn, |
| 46 | } |
| 47 | } else if input.peek(syn::token::Bracket) { |
| 48 | let _content; |
| 49 | bracketed!(_content in input); |
| 50 | Port { |
| 51 | name, |
| 52 | ty: PortType::List, |
| 53 | } |
| 54 | } else if input.peek(syn::token::Brace) { |
| 55 | let _content; |
| 56 | braced!(_content in input); |
| 57 | Port { |
| 58 | name, |
| 59 | ty: PortType::Dict, |
| 60 | } |
| 61 | } else { |
| 62 | return Err(input.error("expect []")); |
| 63 | } |
| 64 | } else { |
| 65 | Port { |
| 66 | name, |
| 67 | ty: PortType::Unit, |
| 68 | } |
| 69 | }) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | pub struct PortSequence { |
nothing calls this directly
no outgoing calls
no test coverage detected