Welcome! Log In Create A New Profile

Advanced

[njs] Renaming node->label to node->name.

Dmitry Volyntsev
April 12, 2019 01:54PM
details: https://hg.nginx.org/njs/rev/de5127995b43
branches:
changeset: 890:de5127995b43
user: hongzhidao <hongzhidao@gmail.com>
date: Sat Apr 13 01:07:34 2019 +0800
description:
Renaming node->label to node->name.

To reuse it for function name without introducing newly field.

diffstat:

njs/njs_generator.c | 16 ++++++++--------
njs/njs_parser.c | 4 ++--
njs/njs_parser.h | 2 +-
3 files changed, 11 insertions(+), 11 deletions(-)

diffs (108 lines):

diff -r 802fe99c8881 -r de5127995b43 njs/njs_generator.c
--- a/njs/njs_generator.c Fri Apr 12 20:48:44 2019 +0300
+++ b/njs/njs_generator.c Sat Apr 13 01:07:34 2019 +0800
@@ -847,7 +847,7 @@ njs_generate_switch_statement(njs_vm_t *
}

ret = njs_generate_start_block(vm, generator, NJS_GENERATOR_SWITCH,
- &swtch->label);
+ &swtch->name);
if (nxt_slow_path(ret != NXT_OK)) {
return ret;
}
@@ -966,7 +966,7 @@ njs_generate_while_statement(njs_vm_t *v
/* The loop body. */

ret = njs_generate_start_block(vm, generator, NJS_GENERATOR_LOOP,
- &node->label);
+ &node->name);
if (nxt_slow_path(ret != NXT_OK)) {
return ret;
}
@@ -1014,7 +1014,7 @@ njs_generate_do_while_statement(njs_vm_t
/* The loop body. */

ret = njs_generate_start_block(vm, generator, NJS_GENERATOR_LOOP,
- &node->label);
+ &node->name);
if (nxt_slow_path(ret != NXT_OK)) {
return ret;
}
@@ -1059,7 +1059,7 @@ njs_generate_for_statement(njs_vm_t *vm,
njs_vmcode_cond_jump_t *cond_jump;

ret = njs_generate_start_block(vm, generator, NJS_GENERATOR_LOOP,
- &node->label);
+ &node->name);
if (nxt_slow_path(ret != NXT_OK)) {
return ret;
}
@@ -1162,7 +1162,7 @@ njs_generate_for_in_statement(njs_vm_t *
njs_vmcode_prop_foreach_t *prop_foreach;

ret = njs_generate_start_block(vm, generator, NJS_GENERATOR_LOOP,
- &node->label);
+ &node->name);
if (nxt_slow_path(ret != NXT_OK)) {
return ret;
}
@@ -1441,7 +1441,7 @@ njs_generate_continue_statement(njs_vm_t
njs_generator_patch_t *patch;
njs_generator_block_t *block;

- label = &node->label;
+ label = &node->name;

block = njs_generate_find_block(generator->block, NJS_GENERATOR_LOOP,
label);
@@ -1489,7 +1489,7 @@ njs_generate_break_statement(njs_vm_t *v
njs_generator_patch_t *patch;
njs_generator_block_t *block;

- label = &node->label;
+ label = &node->name;

block = njs_generate_find_block(generator->block, NJS_GENERATOR_ALL, label);
if (nxt_slow_path(block == NULL)) {
@@ -1548,7 +1548,7 @@ njs_generate_block_statement(njs_vm_t *v
nxt_int_t ret;

ret = njs_generate_start_block(vm, generator, NJS_GENERATOR_BLOCK,
- &node->label);
+ &node->name);
if (nxt_slow_path(ret != NXT_OK)) {
return ret;
}
diff -r 802fe99c8881 -r de5127995b43 njs/njs_parser.c
--- a/njs/njs_parser.c Fri Apr 12 20:48:44 2019 +0300
+++ b/njs/njs_parser.c Sat Apr 13 01:07:34 2019 +0800
@@ -559,7 +559,7 @@ njs_parser_labelled_statement(njs_vm_t *
if (parser->node != NULL) {
/* The statement is not empty block or just semicolon. */

- ret = njs_name_copy(vm, &parser->node->label, &name);
+ ret = njs_name_copy(vm, &parser->node->name, &name);
if (nxt_slow_path(ret != NXT_OK)) {
return NJS_TOKEN_ERROR;
}
@@ -1584,7 +1584,7 @@ njs_parser_brk_statement(njs_vm_t *vm, n
return NJS_TOKEN_ILLEGAL;
}

- ret = njs_name_copy(vm, &parser->node->label, &name);
+ ret = njs_name_copy(vm, &parser->node->name, &name);
if (nxt_slow_path(ret != NXT_OK)) {
return NJS_TOKEN_ERROR;
}
diff -r 802fe99c8881 -r de5127995b43 njs/njs_parser.h
--- a/njs/njs_parser.h Fri Apr 12 20:48:44 2019 +0300
+++ b/njs/njs_parser.h Sat Apr 13 01:07:34 2019 +0800
@@ -50,7 +50,7 @@ struct njs_parser_node_s {
njs_parser_node_t *object;
} u;

- nxt_str_t label;
+ nxt_str_t name;

njs_index_t index;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Renaming node->label to node->name.

Dmitry Volyntsev 124 April 12, 2019 01:54PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 77
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready