Skip to content

Commit

Permalink
Make most of ddmd.builtin private
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Oct 9, 2015
1 parent 43c73c1 commit a987140
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/builtin.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@ import ddmd.root.port;
import ddmd.root.stringtable;
import ddmd.tokens;

private:

extern (C++) alias builtin_fp = Expression function(Loc loc, FuncDeclaration fd, Expressions* arguments);

extern (C++) __gshared StringTable builtins;
__gshared StringTable builtins;

extern (C++) void add_builtin(const(char)* mangle, builtin_fp fp)
public extern (C++) void add_builtin(const(char)* mangle, builtin_fp fp)
{
builtins.insert(mangle, strlen(mangle)).ptrvalue = cast(void*)fp;
}

extern (C++) builtin_fp builtin_lookup(const(char)* mangle)
builtin_fp builtin_lookup(const(char)* mangle)
{
if (StringValue* sv = builtins.lookup(mangle, strlen(mangle)))
return cast(builtin_fp)sv.ptrvalue;
Expand Down Expand Up @@ -168,7 +170,7 @@ extern (C++) Expression eval_yl2xp1(Loc loc, FuncDeclaration fd, Expressions* ar
return new RealExp(loc, result, arg0.type);
}

extern (C++) void builtin_init()
public extern (C++) void builtin_init()
{
builtins._init(47);
// @safe @nogc pure nothrow real function(real)
Expand Down Expand Up @@ -272,7 +274,7 @@ extern (C++) void builtin_init()
* Determine if function is a builtin one that we can
* evaluate at compile time.
*/
extern (C++) BUILTIN isBuiltin(FuncDeclaration fd)
public extern (C++) BUILTIN isBuiltin(FuncDeclaration fd)
{
if (fd.builtin == BUILTINunknown)
{
Expand All @@ -286,7 +288,7 @@ extern (C++) BUILTIN isBuiltin(FuncDeclaration fd)
* Evaluate builtin function.
* Return result; NULL if cannot evaluate it.
*/
extern (C++) Expression eval_builtin(Loc loc, FuncDeclaration fd, Expressions* arguments)
public extern (C++) Expression eval_builtin(Loc loc, FuncDeclaration fd, Expressions* arguments)
{
if (fd.builtin == BUILTINyes)
{
Expand Down

0 comments on commit a987140

Please sign in to comment.