11.5Srillig/* $NetBSD: psym_if_expr_stmt.c,v 1.5 2025/01/07 03:14:24 rillig Exp $ */ 21.1Srillig 31.1Srillig/* 41.1Srillig * Tests for the parser symbol psym_if_expr_stmt, which represents the state 51.1Srillig * after reading the keyword 'if', the controlling expression and the 61.3Srillig * statement for the 'then' branch. 71.3Srillig * 81.3Srillig * At this point, the 'if' statement is not necessarily complete, it can be 91.3Srillig * completed with the keyword 'else' followed by a statement. 101.3Srillig * 111.3Srillig * Any token other than 'else' completes the 'if' statement. 121.1Srillig */ 131.1Srillig 141.4Srillig//indent input 151.3Srilligvoid 161.3Srilligfunction(void) 171.3Srillig{ 181.3Srillig if (cond) 191.3Srillig stmt(); 201.3Srillig if (cond) 211.3Srillig stmt(); 221.3Srillig else /* belongs to the second 'if' */ 231.3Srillig stmt(); 241.3Srillig} 251.4Srillig//indent end 261.1Srillig 271.4Srillig//indent run-equals-input 281.5Srillig 291.5Srillig 301.5Srillig//indent input 311.5Srillig{ 321.5Srilligfor (ever1) 331.5Srilligfor (ever2) 341.5Srilligfor (ever3) 351.5Srilligif (cond1) 361.5Srilligif (cond2) 371.5Srilligif (cond3) 381.5Srilligreturn; 391.5Srillig 401.5Srilligstmt; 411.5Srillig} 421.5Srillig//indent end 431.5Srillig 441.5Srillig//indent run 451.5Srillig{ 461.5Srillig for (ever1) 471.5Srillig for (ever2) 481.5Srillig for (ever3) 491.5Srillig if (cond1) 501.5Srillig if (cond2) 511.5Srillig if (cond3) 521.5Srillig return; 531.5Srillig 541.5Srillig stmt; 551.5Srillig} 561.5Srillig//indent end 57