@@ -185,21 +185,23 @@ fn parse_control_operator(types: &mut IntermediateTypes, parent_visitor: &Parent
185185 Type2 :: IntValue { value, .. } => Some ( value as i128 ) ,
186186 _ => unimplemented ! ( "unsupported type in range control operator: {:?}" , operator) ,
187187 } ;
188- let max = match & inner_type. operator {
188+ match & inner_type. operator {
189+ // if there was only one value instead of a range, we take that value to be the max
190+ // ex: uint .size (1)
191+ None => ControlOperator :: Range ( ( None , min) ) ,
189192 Some ( op) => match op. operator {
190193 RangeCtlOp :: RangeOp { is_inclusive, ..} => {
191194 let value = match op. type2 {
192195 Type2 :: UintValue { value, .. } => value as i128 ,
193196 Type2 :: IntValue { value, ..} => value as i128 ,
194197 _ => unimplemented ! ( "unsupported type in range control operator: {:?}" , operator) ,
195198 } ;
196- Some ( if is_inclusive { value } else { value + 1 } )
199+ let max = Some ( if is_inclusive { value } else { value + 1 } ) ;
200+ ControlOperator :: Range ( ( min, max) )
197201 } ,
198202 RangeCtlOp :: CtlOp { .. } => panic ! ( "" ) ,
199203 } ,
200- None => min,
201- } ;
202- ControlOperator :: Range ( ( min, max) )
204+ }
203205 } ,
204206 _ => unimplemented ! ( "unsupported type in range control operator: {:?}" , operator) ,
205207 } ;
@@ -698,6 +700,9 @@ fn rust_type_from_type2(types: &mut IntermediateTypes, parent_visitor: &ParentVi
698700 Type2 :: TaggedData { tag, t, .. } => {
699701 RustType :: Tagged ( tag. expect ( "tagged data without tag not supported" ) , Box :: new ( rust_type ( types, parent_visitor, t) ) )
700702 } ,
703+ Type2 :: ParenthesizedType { pt, .. } => {
704+ rust_type ( types, parent_visitor, pt)
705+ } ,
701706 _ => {
702707 panic ! ( "Ignoring Type2: {:?}" , type2) ;
703708 } ,
0 commit comments