From c906dd6140a5ffdfcaf41b8b7ae358730d72d0ee Mon Sep 17 00:00:00 2001 From: cetio Date: Wed, 8 May 2024 16:37:14 -0400 Subject: [PATCH] What the rot --- source/fnc/canvas.d | 15 +++++++++++ source/fnc/metadata.d | 33 +++++++++++++++++++++--- spec/{metadata.md => metaprogramming.md} | 2 +- 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 source/fnc/canvas.d rename spec/{metadata.md => metaprogramming.md} (98%) diff --git a/source/fnc/canvas.d b/source/fnc/canvas.d new file mode 100644 index 0000000..24566c1 --- /dev/null +++ b/source/fnc/canvas.d @@ -0,0 +1,15 @@ +module fnc.canvas; + +import fnc.metadata; + +public struct Engine +{ +public: +final: + Glob glob; + + Symbol interpret(Function func) + { + return null; + } +} \ No newline at end of file diff --git a/source/fnc/metadata.d b/source/fnc/metadata.d index bebe6a9..619da53 100644 --- a/source/fnc/metadata.d +++ b/source/fnc/metadata.d @@ -87,7 +87,7 @@ final: Symbol[] attributes; } -public struct Type +public class Type { public: final: @@ -110,7 +110,7 @@ final: } } -public struct Function +public class Function { public: final: @@ -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: @@ -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; } \ No newline at end of file diff --git a/spec/metadata.md b/spec/metaprogramming.md similarity index 98% rename from spec/metadata.md rename to spec/metaprogramming.md index d205a1d..e82810f 100644 --- a/spec/metadata.md +++ b/spec/metaprogramming.md @@ -1,4 +1,4 @@ -# Metadata +# Metaprogramming ## Member Evaluations