Skip to content

Commit

Permalink
Allow a namespace to be nameless
Browse files Browse the repository at this point in the history
This is useful for wrapping code and enabling the features of namespace blocks
via namespace qualifiers.
  • Loading branch information
positively-charged committed Dec 7, 2016
1 parent 8478a4a commit 00aea6b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/parse/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,13 @@ void read_namespace_name( struct parse* parse ) {
}
}
else {
parse->ns = parse->task->upmost_ns;
// A nameless namespace fragment is a fragment of the parent namespace.
parse->ns_fragment->ns = parse->ns;
}
}

void read_namespace_path( struct parse* parse ) {
if ( parse->tk == TK_UPMOST ) {
p_read_tk( parse );
}
else {
p_test_tk( parse, TK_ID );
if ( parse->tk == TK_ID ) {
struct ns_path* head = mem_alloc( sizeof( *head ) );
struct ns_path* tail = head;
head->next = NULL;
Expand Down

0 comments on commit 00aea6b

Please sign in to comment.