Changeset 5ccc733 for src/ControlStruct
- Timestamp:
- Jun 29, 2024, 5:02:06 AM (6 months ago)
- Branches:
- master
- Children:
- 4117761
- Parents:
- 7552fde
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/TranslateEnumRange.cpp
r7552fde r5ccc733 91 91 ast::UntypedExpr * condition = ast::UntypedExpr::createCall( location, 92 92 "?<=?", 93 { 94 ast::UntypedExpr::createCall(location, "posn", { new ast::NameExpr( location, indexName ) } ), 95 ast::ConstantExpr::from_ulong( location, enumDecl->members.size()-1 ) 96 }); 93 {new ast::CastExpr(location, 94 new ast::NameExpr( location, indexName ), 95 new ast::BasicType( ast::BasicKind::UnsignedInt ), 96 ast::GeneratedFlag::ExplicitCast), 97 ast::ConstantExpr::from_ulong( location, enumDecl->members.size()-1 ) }); 98 97 99 auto increment = ast::UntypedExpr::createCall( location, 98 stmt->is_inc? " succ": "pred",100 stmt->is_inc? "?++": "?--", 99 101 { new ast::NameExpr( location, indexName ) }); 102 100 103 auto assig = ast::UntypedExpr::createAssign( location, new ast::NameExpr( location, indexName ), increment ); 101 104 auto mut = ast::mutate_field( stmt, &ast::ForStmt::cond, condition );
Note: See TracChangeset
for help on using the changeset viewer.