From 1aaf0c83b9cdd5855a3a2cbff7538ad36f55cc24 Mon Sep 17 00:00:00 2001 From: sijanec Date: Tue, 19 Jan 2021 13:43:26 +0100 Subject: added while loops, simple intager math --- src/tape.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'src/tape.c') diff --git a/src/tape.c b/src/tape.c index 0492313..88d1950 100644 --- a/src/tape.c +++ b/src/tape.c @@ -17,31 +17,40 @@ int bvr_command_processor(FILE * page_source_file, FILE * temp_output_file) { int command_handler_output = SUCCESS;; // argument_feed = fmemopen (argument_string, strlen (argument_string), "r"); switch (command_entered) { // switch command - case 'g': + case 'g': /* et */ command_handler_output = bvr_handle_get(page_source_file, temp_output_file); break; - case 's': + case 's': /* et */ command_handler_output = bvr_handle_set(page_source_file, temp_output_file); break; - case 'i': + case 'i': /* nclude */ command_handler_output = bvr_handle_include(page_source_file, temp_output_file); break; - case 'm': + case 'm': /* ove */ command_handler_output = bvr_handle_move(page_source_file, temp_output_file); break; - case 'f': + case 'f': /* i_ */ command_handler_output = bvr_handle_if(page_source_file, temp_output_file); break; - case '=': + case '=': /* */ command_handler_output = bvr_handle_equals(page_source_file, temp_output_file); break; - case '"': + case '"': /* */ command_handler_output = bvr_handle_string(page_source_file, temp_output_file); break; - case 'u': + case 'u': /* s_bstring*/ command_handler_output = bvr_handle_substring(page_source_file, temp_output_file); break; - case 'b': + case 'w': /* hile */ + command_handler_output = bvr_handle_while(page_source_file, temp_output_file); + break; + case 'e': /* xplode */ + command_handler_output = bvr_handle_explode(page_source_file, temp_output_file); + break; + case 'r': /* ačunanje */ + command_handler_output = bvr_handle_math(page_source_file, temp_output_file); + break; + case 'b': /* unden */ // fprintf(stderr, "bunden %c\n", command_entered); command_handler_output = bvr_handle_info(page_source_file, temp_output_file); break; @@ -133,7 +142,7 @@ int bvr_compose_stream(FILE * page_source_file, FILE * temp_output_file) { // continue; // } if(copy_buffer[ftell(page_source_file)% COPY_BUFFER_SIZE] == EOF) { - fputc('\n', temp_output_file); // NO POMEGRANTES! NO! NO! NO! NO POMEGRANTES! + fputc(' ', temp_output_file); // NO POMEGRANTES! NO! NO! NO! NO POMEGRANTES! break; } if (cycles++ != 0) { // da ne napišemo prvega znaka bufferja, preden je sploh kaj v bufferju. -- cgit v1.2.3