Skip to content

Commit

Permalink
What the rot
Browse files Browse the repository at this point in the history
  • Loading branch information
cetio committed May 8, 2024
1 parent d73d1c0 commit c906dd6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
15 changes: 15 additions & 0 deletions source/fnc/canvas.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module fnc.canvas;

import fnc.metadata;

public struct Engine
{
public:
final:
Glob glob;

Symbol interpret(Function func)
{
return null;
}
}
33 changes: 30 additions & 3 deletions source/fnc/metadata.d
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ final:
Symbol[] attributes;
}

public struct Type
public class Type
{
public:
final:
Expand All @@ -110,7 +110,7 @@ final:
}
}

public struct Function
public class Function
{
public:
final:
Expand All @@ -132,7 +132,13 @@ final:
}
}

public struct Field
alias Parameter = Field;
alias Variable = Field;

// Expressions and literals should also be represented by a field,
// but I haven't yet worked this out.

public class Field
{
public:
final:
Expand All @@ -146,4 +152,25 @@ final:
{
return sym.parents[$-1];
}
}

public class Module
{
public:
final:
Symbol sym;
Symbol[] imports;
Field[string] fields;
Function[string] functions;
}

public class Glob
{
public:
final:
Symbol[string] symbols;
Module[string] modules;
Type[string] types;
Field[string] fields;
Function[string] functions;
}
2 changes: 1 addition & 1 deletion spec/metadata.md → spec/metaprogramming.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Metadata
# Metaprogramming

## Member Evaluations

Expand Down

0 comments on commit c906dd6

Please sign in to comment.