@@ -24,25 +24,25 @@ static bool ps_parse_program_parameters(ps_compiler *compiler)
2424 // Empty list?
2525 if (lexer -> current_token .type == PS_TOKEN_LEFT_PARENTHESIS )
2626 {
27- READ_NEXT_TOKEN ()
27+ READ_NEXT_TOKEN
2828 if (lexer -> current_token .type == PS_TOKEN_RIGHT_PARENTHESIS )
2929 {
30- READ_NEXT_TOKEN ()
30+ READ_NEXT_TOKEN
3131 PARSE_END ("OK" )
3232 }
3333 }
3434 bool loop = true;
3535 do
3636 {
3737 EXPECT_TOKEN (PS_TOKEN_IDENTIFIER )
38- READ_NEXT_TOKEN ()
38+ READ_NEXT_TOKEN
3939 switch (lexer -> current_token .type )
4040 {
4141 case PS_TOKEN_COMMA :
42- READ_NEXT_TOKEN ()
42+ READ_NEXT_TOKEN
4343 break ;
4444 case PS_TOKEN_RIGHT_PARENTHESIS :
45- READ_NEXT_TOKEN ()
45+ READ_NEXT_TOKEN
4646 loop = false;
4747 break ;
4848 default :
@@ -69,20 +69,20 @@ bool ps_parse_program(ps_compiler *compiler, ps_ast_node *ast)
6969 EXPECT_TOKEN (PS_TOKEN_PROGRAM )
7070 uint16_t start_line = lexer -> start_line ;
7171 uint16_t start_column = lexer -> start_column ;
72- READ_NEXT_TOKEN ()
72+ READ_NEXT_TOKEN
7373
7474 // IDENTIFIER
7575 EXPECT_TOKEN (PS_TOKEN_IDENTIFIER )
7676 COPY_IDENTIFIER (identifier )
77- READ_NEXT_TOKEN ()
77+ READ_NEXT_TOKEN
7878
7979 // Skip optional parameters enclosed in parentheses
8080 if (!ps_parse_program_parameters (compiler ))
8181 TRACE_ERROR ("PARAMETERS ")
8282
8383 // ';'
8484 EXPECT_TOKEN (PS_TOKEN_SEMI_COLON )
85- READ_NEXT_TOKEN ()
85+ READ_NEXT_TOKEN
8686
8787 ps_ast_block * program = ps_ast_create_block (start_line , start_column , NULL , PS_AST_PROGRAM , identifier );
8888 if (NULL == program )
@@ -124,20 +124,20 @@ bool ps_parse_uses(ps_compiler *compiler, ps_ast_block *block)
124124
125125 if (lexer -> current_token .type == PS_TOKEN_USES )
126126 {
127- READ_NEXT_TOKEN ()
127+ READ_NEXT_TOKEN
128128 bool loop = true;
129129 do
130130 {
131131 if (lexer -> current_token .type != PS_TOKEN_IDENTIFIER )
132132 RETURN_ERROR (PS_ERROR_EXPECTED_IDENTIFIER )
133- READ_NEXT_TOKEN ()
133+ READ_NEXT_TOKEN
134134 switch (lexer -> current_token .type )
135135 {
136136 case PS_TOKEN_COMMA :
137- READ_NEXT_TOKEN ()
137+ READ_NEXT_TOKEN
138138 break ;
139139 case PS_TOKEN_SEMI_COLON :
140- READ_NEXT_TOKEN ()
140+ READ_NEXT_TOKEN
141141 loop = false;
142142 break ;
143143 default :
@@ -193,8 +193,6 @@ bool ps_parse_block(ps_compiler *compiler, ps_ast_block *block)
193193 // RETURN_ERROR(PS_ERROR_OUT_OF_MEMORY)
194194 // if (!ps_parse_procedure_or_function_declaration(compiler, procedure, PS_SYMBOL_KIND_PROCEDURE))
195195 // TRACE_ERROR("PROCEDURE")
196- // block->executables[block->n_executables] = procedure;
197- // block->n_executables += 1;
198196 // break;
199197 case PS_TOKEN_FUNCTION :
200198 RETURN_ERROR (PS_ERROR_NOT_IMPLEMENTED )
@@ -204,8 +202,6 @@ bool ps_parse_block(ps_compiler *compiler, ps_ast_block *block)
204202 // RETURN_ERROR(PS_ERROR_OUT_OF_MEMORY)
205203 // if (!ps_parse_procedure_or_function_declaration(compiler, function, PS_SYMBOL_KIND_FUNCTION))
206204 // TRACE_ERROR("FUNCTION")
207- // block->executables[block->n_executables] = function;
208- // block->n_executables += 1;
209205 // break;
210206 case PS_TOKEN_BEGIN :
211207 loop = false;
@@ -262,14 +258,14 @@ bool ps_parse_const(ps_compiler *compiler, ps_ast_block *block)
262258 ps_symbol * constant ;
263259
264260 EXPECT_TOKEN (PS_TOKEN_CONST )
265- READ_NEXT_TOKEN ()
261+ READ_NEXT_TOKEN
266262 do
267263 {
268264 EXPECT_TOKEN (PS_TOKEN_IDENTIFIER )
269265 COPY_IDENTIFIER (identifier )
270- READ_NEXT_TOKEN ()
266+ READ_NEXT_TOKEN
271267 EXPECT_TOKEN (PS_TOKEN_EQ )
272- READ_NEXT_TOKEN ()
268+ READ_NEXT_TOKEN
273269 value = ps_value_alloc (& ps_system_none , data );
274270 if (value == NULL )
275271 RETURN_ERROR (PS_ERROR_OUT_OF_MEMORY )
@@ -279,7 +275,7 @@ bool ps_parse_const(ps_compiler *compiler, ps_ast_block *block)
279275 TRACE_ERROR ("CONSTANT_EXPRESSION" )
280276 }
281277 EXPECT_TOKEN (PS_TOKEN_SEMI_COLON );
282- READ_NEXT_TOKEN ()
278+ READ_NEXT_TOKEN
283279 constant = ps_symbol_alloc (PS_SYMBOL_KIND_CONSTANT , identifier , value );
284280 if (constant == NULL )
285281 RETURN_ERROR (PS_ERROR_OUT_OF_MEMORY )
@@ -302,15 +298,15 @@ bool ps_parse_type(ps_compiler *compiler, ps_ast_block *block)
302298
303299 // RETURN_ERROR(PS_ERROR_NOT_IMPLEMENTED)
304300 EXPECT_TOKEN (PS_TOKEN_TYPE );
305- READ_NEXT_TOKEN ()
301+ READ_NEXT_TOKEN
306302 if (lexer -> current_token .type != PS_TOKEN_IDENTIFIER )
307303 RETURN_ERROR (PS_ERROR_UNEXPECTED_TOKEN )
308304 do
309305 {
310306 if (!ps_parse_type_definition (compiler , block ))
311307 TRACE_ERROR ("TYPE_DEFINITION" );
312308 EXPECT_TOKEN (PS_TOKEN_SEMI_COLON );
313- READ_NEXT_TOKEN ()
309+ READ_NEXT_TOKEN
314310 } while (lexer -> current_token .type == PS_TOKEN_IDENTIFIER );
315311
316312 PARSE_END ("OK" )
@@ -331,12 +327,12 @@ static bool ps_parse_var_identifier_list(ps_compiler *compiler, ps_identifier *i
331327 const ps_symbol * variable = ps_compiler_find_symbol (compiler , identifier [* var_count ], true);
332328 if (variable != NULL )
333329 RETURN_ERROR (PS_ERROR_SYMBOL_EXISTS )
334- READ_NEXT_TOKEN ()
330+ READ_NEXT_TOKEN
335331 if (lexer -> current_token .type == PS_TOKEN_COLON )
336332 break ;
337333 if (lexer -> current_token .type != PS_TOKEN_COMMA )
338334 RETURN_ERROR (PS_ERROR_UNEXPECTED_TOKEN )
339- READ_NEXT_TOKEN ()
335+ READ_NEXT_TOKEN
340336 * var_count += 1 ;
341337 if (* var_count == 8 )
342338 RETURN_ERROR (PS_ERROR_TOO_MANY_VARIABLES )
@@ -363,12 +359,12 @@ bool ps_parse_var(ps_compiler *compiler, ps_ast_block *block)
363359 ps_symbol * type_symbol = NULL ;
364360
365361 EXPECT_TOKEN (PS_TOKEN_VAR )
366- READ_NEXT_TOKEN ()
362+ READ_NEXT_TOKEN
367363 do
368364 {
369365 if (!ps_parse_var_identifier_list (compiler , identifier , & var_count ))
370366 TRACE_ERROR ("VARIABLE IDENTIFIER LIST" )
371- READ_NEXT_TOKEN ()
367+ READ_NEXT_TOKEN
372368 if (!ps_parse_type_reference (compiler , & type_symbol , NULL ))
373369 TRACE_ERROR ("TYPE REFERENCE" )
374370 EXPECT_TOKEN (PS_TOKEN_SEMI_COLON )
@@ -377,7 +373,7 @@ bool ps_parse_var(ps_compiler *compiler, ps_ast_block *block)
377373 if (!ps_compiler_add_variable (compiler , block , identifier [i ], type_symbol ))
378374 TRACE_ERROR ("ADD VARIABLE" )
379375 }
380- READ_NEXT_TOKEN ()
376+ READ_NEXT_TOKEN
381377 } while (lexer -> current_token .type == PS_TOKEN_IDENTIFIER );
382378
383379 PARSE_END ("OK" )
0 commit comments