Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename MaybePointer to NullablePointer #3293

Merged
merged 6 commits into from
Sep 3, 2019
Merged

Rename MaybePointer to NullablePointer #3293

merged 6 commits into from
Sep 3, 2019

Conversation

avitkauskas
Copy link
Contributor

Resolves #3273 as of RFC 63

According to my research all the changes in files relates to MaybePointer and only MaybePointer.

Excerps from the old code follows as a proof of thought:

codegen.h

typedef struct compile_t
{
  const char* str_Maybe;
}

codegen.c

static void init_runtime(compile_t* c)
{
  c->str_Maybe = stringtab("MaybePointer");
}

genserialise.c

if(package == c->str_builtin)
{
  // Don't serialise MaybePointer[A]
  if(name == c->str_Maybe)
    return true;
}

gentype.c

if(package == c->str_builtin)
{
  if(name == c->str_Pointer)
    genprim_pointer_methods(c, t);
  else if(name == c->str_Maybe)
    genprim_maybe_methods(c, t);
}

ffi.c

// Parameter type is Pointer[None]
// If the argument is Pointer[A], MaybePointer[A] or USize, allow it
while(ast_id(arg_type) == TK_ARROW)
  arg_type = ast_childidx(arg_type, 1);

if(is_pointer(arg_type) ||
  is_maybe(arg_type) ||
  is_literal(arg_type, "USize"))
  return true;

reference.c

if(is_maybe(ast))
{
  // MaybePointer[A] must be bound to a struct.
  ...

subtype.c

bool is_maybe(ast_t* type)
{
  return is_literal(type, "MaybePointer");
}

gentrace.c

if(is_maybe(type))
  return TRACE_MAYBE;

@avitkauskas
Copy link
Contributor Author

Why did freebsd-12-debug failed?

@SeanTAllen SeanTAllen merged commit b1fe1a0 into ponylang:master Sep 3, 2019
@SeanTAllen
Copy link
Member

Thanks @avitkauskas!

@avitkauskas avitkauskas deleted the rename-maybepointer branch September 3, 2019 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC 63: Rename MaybePointer to NullablePointer
2 participants