Skip to content

Commit

Permalink
remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
damnMeddlingKid committed Mar 1, 2022
1 parent fa6d193 commit ea77f6e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ instruments*.trace
*.cpu
*.object
*.dSYM
.vscode/
vendor/
16 changes: 0 additions & 16 deletions ext/liquid_c/block.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "liquid.h"
#include "block.h"
#include "intutil.h"
//#include "tokenizer.h"
#include "stringutil.h"
#include "vm.h"
#include "variable.h"
Expand Down Expand Up @@ -107,13 +106,6 @@ static int is_id(int c)
return rb_isalnum(c) || c == '_';
}

void print_pointer(char* start, char* end) {
while(start < end) {
printf("%c", *start++);
}
printf("\n");
}

static tag_markup_t internal_block_body_parse(block_body_t *body, parse_context_t *parse_context)
{
tokenizer_t *tokenizer = parse_context->tokenizer;
Expand Down Expand Up @@ -219,12 +211,6 @@ static tag_markup_t internal_block_body_parse(block_body_t *body, parse_context_
break;
}

if ((name_len == 4 && strncmp(name_start, "else", 4) == 0) || (name_len == 5 && strncmp(name_start, "endif", 5) == 0)) {
VALUE str = rb_enc_str_new(name_start, name_len, utf8_encoding);
unknown_tag = (tag_markup_t) { str, str };
goto loop_break;
}

const char *markup_start = read_while(name_end, end, rb_isspace);
VALUE markup = rb_enc_str_new(markup_start, end - markup_start, utf8_encoding);
VALUE tag_name = rb_enc_str_new(name_start, name_end - name_start, utf8_encoding);
Expand Down Expand Up @@ -318,8 +304,6 @@ tag_markup_t parse_if_tag(VALUE markup, block_body_t *body, parse_context_t *par
VALUE condition_obj = parse_single_binary_comparison(markup);
vm_assembler_add_op_with_constant(body_code, condition_obj, OP_EVAL_CONDITION);

uint8_t* instruction;

ptrdiff_t exit_branches[10];
ptrdiff_t* exit_start = exit_branches;
ptrdiff_t* exit_end = exit_branches;
Expand Down
3 changes: 0 additions & 3 deletions ext/liquid_c/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

ID id_render_node;
ID id_vm;
//ID id_evaluate;

static VALUE cLiquidCVM;

Expand Down Expand Up @@ -370,7 +369,6 @@ static VALUE vm_render_until_error(VALUE uncast_args)
constant = constants[constant_index];
ip += 2;
VALUE condition_eval = rb_funcall(constant, id_evaluate, 1, vm->context.self);
int num = RTEST(condition_eval);
vm_stack_push(vm, RTEST(condition_eval));
break;
}
Expand Down Expand Up @@ -616,7 +614,6 @@ void liquid_define_vm(void)
{
id_render_node = rb_intern("render_node");
id_vm = rb_intern("vm");
// id_evaluate = rb_intern("evaluate");

cLiquidCVM = rb_define_class_under(mLiquidC, "VM", rb_cObject);
rb_undef_alloc_func(cLiquidCVM);
Expand Down

0 comments on commit ea77f6e

Please sign in to comment.