Lines Matching refs:l
44 dc_lex_negCommand(BcLex* l) in dc_lex_negCommand() argument
46 char c = l->buf[l->i]; in dc_lex_negCommand()
56 dc_lex_register(BcLex* l) in dc_lex_register() argument
59 if (DC_X && isspace(l->buf[l->i - 1])) in dc_lex_register()
64 bc_lex_whitespace(l); in dc_lex_register()
65 c = l->buf[l->i]; in dc_lex_register()
70 bc_lex_verr(l, BC_ERR_PARSE_CHAR, c); in dc_lex_register()
74 l->i += 1; in dc_lex_register()
75 bc_lex_name(l); in dc_lex_register()
81 if (BC_ERR(l->buf[l->i - 1] == '\n')) in dc_lex_register()
83 bc_lex_verr(l, BC_ERR_PARSE_CHAR, l->buf[l->i - 1]); in dc_lex_register()
87 bc_vec_popAll(&l->str); in dc_lex_register()
88 bc_vec_pushByte(&l->str, (uchar) l->buf[l->i - 1]); in dc_lex_register()
89 bc_vec_pushByte(&l->str, '\0'); in dc_lex_register()
90 l->t = BC_LEX_NAME; in dc_lex_register()
101 dc_lex_string(BcLex* l) in dc_lex_string() argument
108 l->t = BC_LEX_STR; in dc_lex_string()
109 bc_vec_popAll(&l->str); in dc_lex_string()
117 assert(l->mode != BC_MODE_STDIN || l->buf == vm->buffer.v); in dc_lex_string()
122 for (i = l->i; (c = l->buf[i]) && depth; ++i) in dc_lex_string()
127 c = l->buf[++i]; in dc_lex_string()
139 if (depth) bc_vec_push(&l->str, &c); in dc_lex_string()
144 if (!vm->eof && l->mode != BC_MODE_FILE) in dc_lex_string()
146 got_more = bc_lex_readLine(l); in dc_lex_string()
151 bc_vec_popAll(&l->str); in dc_lex_string()
160 l->i = i; in dc_lex_string()
161 bc_lex_err(l, BC_ERR_PARSE_STRING); in dc_lex_string()
164 bc_vec_pushByte(&l->str, '\0'); in dc_lex_string()
166 l->i = i; in dc_lex_string()
167 l->line += nls; in dc_lex_string()
175 dc_lex_token(BcLex* l) in dc_lex_token() argument
177 char c = l->buf[l->i++], c2; in dc_lex_token()
187 if (l->last == dc_lex_regs[i]) in dc_lex_token()
189 dc_lex_register(l); in dc_lex_token()
197 (l->t = dc_lex_tokens[(c - '"')]) != BC_LEX_INVALID) in dc_lex_token()
214 bc_lex_commonTokens(l, c); in dc_lex_token()
222 c2 = l->buf[l->i]; in dc_lex_token()
224 if (c2 == '=') l->t = BC_LEX_OP_REL_NE; in dc_lex_token()
225 else if (c2 == '<') l->t = BC_LEX_OP_REL_LE; in dc_lex_token()
226 else if (c2 == '>') l->t = BC_LEX_OP_REL_GE; in dc_lex_token()
227 else bc_lex_invalidChar(l, c); in dc_lex_token()
229 l->i += 1; in dc_lex_token()
236 bc_lex_lineComment(l); in dc_lex_token()
242 c2 = l->buf[l->i]; in dc_lex_token()
248 bc_lex_number(l, c); in dc_lex_token()
250 else bc_lex_invalidChar(l, c); in dc_lex_token()
272 bc_lex_number(l, c); in dc_lex_token()
278 c2 = l->buf[l->i]; in dc_lex_token()
280 if (c2 == 'l') l->t = BC_LEX_KW_LINE_LENGTH; in dc_lex_token()
281 else if (c2 == 'x') l->t = BC_LEX_EXTENDED_REGISTERS; in dc_lex_token()
282 else if (c2 == 'z') l->t = BC_LEX_KW_LEADING_ZERO; in dc_lex_token()
283 else bc_lex_invalidChar(l, c2); in dc_lex_token()
285 l->i += 1; in dc_lex_token()
292 dc_lex_string(l); in dc_lex_token()
298 bc_lex_invalidChar(l, c); in dc_lex_token()