Lines Matching defs:label
157 static unsigned SayLabel(parser::Label label) {
158 return static_cast<unsigned>(label);
210 if (endStmt.label) {
215 AddTargetLabelDefinition(endStmt.label.value(), targetFlags,
226 const auto &label = statement.label;
227 if (!label) {
244 AddTargetLabelDefinition(label.value(), targetFlags, ParentScope(),
248 // the label on an END IF/SELECT is not in the last part/case
249 AddTargetLabelDefinition(label.value(), targetFlags, ParentScope(),
252 AddTargetLabelDefinition(label.value(), targetFlags, currentScope_,
256 AddTargetLabelDefinition(label.value(), targetFlags, currentScope_,
741 if (auto label{std::get<std::optional<parser::Label>>(
746 if (!endDoStmt.label || *endDoStmt.label != *label) {
749 "END DO statement must have the label '%d' matching its DO statement"_err_en_US,
750 *label)
824 void CheckLabelInRange(parser::Label label) {
825 if (label < 1 || label > 99999) {
827 SayLabel(label));
832 void AddTargetLabelDefinition(parser::Label label,
835 CheckLabelInRange(label);
839 const auto pair{targetStmtMap.emplace(label,
844 SayLabel(label));
848 void AddLabelReferenceFromDoStmt(parser::Label label) {
849 CheckLabelInRange(label);
851 label, currentScope_, currentPosition_);
854 void AddLabelReferenceToFormatStmt(parser::Label label) {
855 CheckLabelInRange(label);
857 label, currentScope_, currentPosition_);
860 void AddLabelReferenceFromAssignStmt(parser::Label label) {
861 CheckLabelInRange(label);
863 label, currentScope_, currentPosition_);
866 void AddLabelReference(parser::Label label) {
867 CheckLabelInRange(label);
869 label, currentScope_, currentPosition_);
873 for (const parser::Label &label : labels) {
874 AddLabelReference(label);
921 const TargetStmtMap &labels, const parser::Label &label) {
922 const auto iter{labels.find(label)};
935 const auto &label{branch.parserLabel};
936 auto branchTarget{GetLabel(labels, label)};
992 const auto &label{stmt.parserLabel};
995 auto doTarget{GetLabel(labels, label)};
999 position, "Label '%u' cannot be found"_err_en_US, SayLabel(label));
1004 SayLabel(label));
1023 SayLabel(label));
1042 const auto &label{stmt.parserLabel};
1045 auto target{GetLabel(labels, label)};
1048 position, "Label '%u' was not found"_err_en_US, SayLabel(label));
1076 SayLabel(label));
1082 SayLabel(label))
1092 const auto &label{stmt.parserLabel};
1093 auto branchTarget{GetLabel(labels, label)};
1101 "Label '%u' is not a branch target"_err_en_US, SayLabel(label))
1103 SayLabel(label));
1109 "Label '%u' is not a branch target"_warn_en_US, SayLabel(label))
1111 SayLabel(label))
1128 const auto &label{stmt.parserLabel};
1129 auto ioTarget{GetLabel(labels, label)};
1135 SayLabel(label))
1137 SayLabel(label));
1153 const auto &label{stmt.parserLabel};
1154 auto target{GetLabel(labels, label)};
1165 SayLabel(label));
1171 SayLabel(label))
1176 SayLabel(label));