Skip to content

Commit a6264dc

Browse files
committed
Remove unnecessary macros
1 parent d12e42d commit a6264dc

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/prism.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,10 +1537,7 @@ pm_conditional_predicate(pm_parser_t *parser, pm_node_t *node, pm_conditional_pr
15371537
}
15381538
}
15391539

1540-
#define PM_LOCATION_NULL_VALUE(parser) ((pm_location_t) { .start = (parser)->start, .end = (parser)->start })
15411540
#define PM_LOCATION_TOKEN_VALUE(token) ((pm_location_t) { .start = (token)->start, .end = (token)->end })
1542-
#define PM_LOCATION_NODE_VALUE(node) ((pm_location_t) { .start = (node)->location.start, .end = (node)->location.end })
1543-
#define PM_LOCATION_NODE_BASE_VALUE(node) ((pm_location_t) { .start = (node)->base.location.start, .end = (node)->base.location.end })
15441541

15451542
/**
15461543
* This is a special out parameter to the parse_arguments_list function that
@@ -1935,7 +1932,6 @@ pm_missing_node_create(pm_parser_t *parser, const uint8_t *start, const uint8_t
19351932
#define MAYBETOKEN2SLICE(parser_, token_) ((token_) == NULL ? ((pm_slice_t) { 0 }) : TOKEN2SLICE(parser_, token_))
19361933
#define MAYBETOKENPTR(token_) ((token_).start == NULL ? NULL : &(token_))
19371934
#define LOCATION2SLICE TOKEN2SLICE
1938-
#define MAYBELOCATION2SLICE MAYBETOKEN2SLICE
19391935

19401936
/**
19411937
* Allocate and initialize a new AliasGlobalVariableNode node.
@@ -2677,7 +2673,7 @@ static pm_call_node_t *
26772673
pm_call_node_fcall_synthesized_create(pm_parser_t *parser, pm_arguments_node_t *arguments, pm_constant_id_t name) {
26782674
pm_call_node_t *node = pm_call_node_create(parser, PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY);
26792675

2680-
node->base.location = PM_LOCATION_NULL_VALUE(parser);
2676+
node->base.location = ((pm_location_t) { .start = parser->start, .end = parser->start });
26812677
node->arguments = arguments;
26822678

26832679
node->name = name;
@@ -22155,9 +22151,6 @@ pm_parse_success_p(const uint8_t *source, size_t size, const char *data) {
2215522151
#undef PM_CASE_OPERATOR
2215622152
#undef PM_CASE_WRITABLE
2215722153
#undef PM_STRING_EMPTY
22158-
#undef PM_LOCATION_NODE_BASE_VALUE
22159-
#undef PM_LOCATION_NODE_VALUE
22160-
#undef PM_LOCATION_NULL_VALUE
2216122154
#undef PM_LOCATION_TOKEN_VALUE
2216222155

2216322156
// We optionally support serializing to a binary string. For systems that don't

0 commit comments

Comments
 (0)