MCPcopy Index your code
hub / github.com/beanshell/beanshell / isRegularForStatement

Method isRegularForStatement

src/bsh/Parser.java:96–116  ·  view source on GitHub ↗

Lookahead for the enhanced for statement. Expect "for" "(" and then see whether we hit ":" or a ";" first.

()

Source from the content-addressed store, hash-verified

94 Expect "for" "(" and then see whether we hit ":" or a ";" first.
95 */
96 boolean isRegularForStatement()
97 {
98 int curTok = 1;
99 Token tok;
100 tok = getToken(curTok++);
101 if ( tok.kind != FOR ) return false;
102 tok = getToken(curTok++);
103 if ( tok.kind != LPAREN ) return false;
104 while (true)
105 {
106 tok = getToken(curTok++);
107 switch (tok.kind) {
108 case COLON:
109 return false;
110 case SEMICOLON:
111 return true;
112 case EOF:
113 return false;
114 }
115 }
116 }
117
118 /**
119 Generate a ParseException with the specified message, pointing to the

Callers 2

StatementMethod · 0.95
jj_3R_47Method · 0.95

Calls 1

getTokenMethod · 0.95

Tested by

no test coverage detected