Asllib.DesugarSourceval desugar_setter :
AST.call AST.annotated ->
AST.identifier list ->
AST.expr ->
AST.stmt_descDesugar a setter call, in particular:
Setter(args) = rhs; --> Setter(rhs, args);
Setter(args).fld = rhs; --> var temp = Getter(args);
temp.fld = rhs;
Setter(temp, args);
Setter(args).[fld1,fld2] = rhs; --> var temp = Getter(args);
temp.[fld1,fld2] = rhs;
Setter(temp, args);val desugar_elided_parameter :
AST.local_decl_keyword ->
AST.local_decl_item ->
AST.ty ->
AST.call AST.annotated ->
AST.stmt_descDesugar an elided parameter, in particular:
let x : bits(e) = MyFunc{}(args) --> ... = MyFunc{e}(args)
let x : bits(e) = MyFunc{,e1}(args) --> ... = MyFunc{e,e1}(args)Similarly for var and constant.
type lhs_access = {base : AST.identifier AST.annotated;index : AST.expr option;fields : lhs_field list;empty means no fields
*)slices : AST.slice list AST.annotated;empty means no slices
*)}An access has a base variable, optionally followed by an array index, nested field accesses fields, and slices: base[[index]].field1.field2[slices]
Desugar an lhs_access to an lexpr.
Desugar a list of lhs_access options to an LE_Destructuring. The None entries turn in to LE_Discard, and the Some entries are desugared using desugar_lhs_access. Also check that none of the entries share a base variable, i.e. none of them attempt to write the the same variable.
val desugar_lhs_fields_tuple :
AST.identifier AST.annotated ->
lhs_field option list ->
AST.lexpr_descdesugar_lhs_fields_tuple x flds desugars a left-hand side of the form x.(fld1, ..., fldk) to (x.fld1, ..., x.fldk), ensuring that the flds are unique.
val desugar_case_stmt :
AST.expr_desc AST.annotated ->
AST.case_alt_desc AST.annotated list ->
AST.stmt ->
AST.stmt_descdesugar_case_stmt e0 cases otherwise desugars a case statement for the discriminant expression e0, case alternatives cases, and otherwise statement otherwise. The result is a conditional statement, possibly preceded by an assignment of the condition e0 to a fresh variable).