Skip to content

Commit ea77f6e

Browse files
remove redundant code
1 parent fa6d193 commit ea77f6e

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ instruments*.trace
1111
*.cpu
1212
*.object
1313
*.dSYM
14+
.vscode/
15+
vendor/

ext/liquid_c/block.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "liquid.h"
22
#include "block.h"
33
#include "intutil.h"
4-
//#include "tokenizer.h"
54
#include "stringutil.h"
65
#include "vm.h"
76
#include "variable.h"
@@ -107,13 +106,6 @@ static int is_id(int c)
107106
return rb_isalnum(c) || c == '_';
108107
}
109108

110-
void print_pointer(char* start, char* end) {
111-
while(start < end) {
112-
printf("%c", *start++);
113-
}
114-
printf("\n");
115-
}
116-
117109
static tag_markup_t internal_block_body_parse(block_body_t *body, parse_context_t *parse_context)
118110
{
119111
tokenizer_t *tokenizer = parse_context->tokenizer;
@@ -219,12 +211,6 @@ static tag_markup_t internal_block_body_parse(block_body_t *body, parse_context_
219211
break;
220212
}
221213

222-
if ((name_len == 4 && strncmp(name_start, "else", 4) == 0) || (name_len == 5 && strncmp(name_start, "endif", 5) == 0)) {
223-
VALUE str = rb_enc_str_new(name_start, name_len, utf8_encoding);
224-
unknown_tag = (tag_markup_t) { str, str };
225-
goto loop_break;
226-
}
227-
228214
const char *markup_start = read_while(name_end, end, rb_isspace);
229215
VALUE markup = rb_enc_str_new(markup_start, end - markup_start, utf8_encoding);
230216
VALUE tag_name = rb_enc_str_new(name_start, name_end - name_start, utf8_encoding);
@@ -318,8 +304,6 @@ tag_markup_t parse_if_tag(VALUE markup, block_body_t *body, parse_context_t *par
318304
VALUE condition_obj = parse_single_binary_comparison(markup);
319305
vm_assembler_add_op_with_constant(body_code, condition_obj, OP_EVAL_CONDITION);
320306

321-
uint8_t* instruction;
322-
323307
ptrdiff_t exit_branches[10];
324308
ptrdiff_t* exit_start = exit_branches;
325309
ptrdiff_t* exit_end = exit_branches;

ext/liquid_c/vm.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
ID id_render_node;
1111
ID id_vm;
12-
//ID id_evaluate;
1312

1413
static VALUE cLiquidCVM;
1514

@@ -370,7 +369,6 @@ static VALUE vm_render_until_error(VALUE uncast_args)
370369
constant = constants[constant_index];
371370
ip += 2;
372371
VALUE condition_eval = rb_funcall(constant, id_evaluate, 1, vm->context.self);
373-
int num = RTEST(condition_eval);
374372
vm_stack_push(vm, RTEST(condition_eval));
375373
break;
376374
}
@@ -616,7 +614,6 @@ void liquid_define_vm(void)
616614
{
617615
id_render_node = rb_intern("render_node");
618616
id_vm = rb_intern("vm");
619-
// id_evaluate = rb_intern("evaluate");
620617

621618
cLiquidCVM = rb_define_class_under(mLiquidC, "VM", rb_cObject);
622619
rb_undef_alloc_func(cLiquidCVM);

0 commit comments

Comments
 (0)