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

Auto-generate defines and metas from JSON files #8195

Merged
merged 19 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions src-json/define.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,29 @@
"doc": "Erase generic classes on C#",
"platforms": ["cs"]
},
{
"name": "EvalCallStackDepth",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I've wondered, isn't having both name and define a bit redundant (i.e. couldn't one be derived from the other, or are there exceptions)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally you could probably derive the defines from the OCaml name (except the unfortunate case of HxcppSmartStings, which somehow went by unnoticed). Since dot notation was introduced into metadata, the mapping may be less obvious – there are still many fields which use the un-dotted identifier. For defines this might be easier?

But to be honest I did not thoroughly think about unifying name and define (or metadata). I also think it's fine if it is done as part of another PR at some point.

"define": "eval_call_stack_depth",
"doc": "Set maximum call stack depth for eval. Default: 1000.",
"platforms": ["eval"]
},
{
"name": "EvalDebugger",
"define": "eval_debugger",
"doc": "Support debugger in macro/interp mode. Allows host:port value to open a socket. Implies eval_stack."
"doc": "Support debugger in macro/interp mode. Allows host:port value to open a socket. Implies eval_stack.",
"platforms": ["eval"]
},
{
"name": "EvalStack",
"define": "eval_stack",
"doc": "Record stack information in macro/interp mode"
"doc": "Record stack information in macro/interp mode",
"platforms": ["eval"]
},
{
"name": "EvalTimes",
"define": "eval_times",
"doc": "Record per-method execution times in macro/interp mode. Implies eval_stack."
"doc": "Record per-method execution times in macro/interp mode. Implies eval_stack.",
"platforms": ["eval"]
},
{
"name": "FastCast",
Expand Down Expand Up @@ -274,6 +283,12 @@
"doc": "Generate JavaScript source map even in non-debug mode",
"platforms": ["js"]
},
{
"name": "Jvm",
"define": "jvm",
"doc": "Generate jvm directly",
"platforms": ["java"]
},
{
"name": "SourceMap",
"define": "source_map",
Expand Down
13 changes: 13 additions & 0 deletions src-json/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@
"doc": "Specify xml data to be injected into Build.xml",
"platforms": ["cpp"]
},
{
"name": "BypassAccessor",
"metadata": ":bypassAccessor",
"doc": "Do not call property accessor method and access the field directly",
"targets": ["TExpr"]
},
{
"name": "Callable",
"metadata": ":callable",
Expand Down Expand Up @@ -310,6 +316,13 @@
"metadata": ":fixed",
"doc": "Delcares an anonymous object to have fixed fields"
},
{
"name": "FlashProperty",
"metadata": ":flash.property",
"doc": "",
"platforms": ["flash"],
"targets": ["TClassField"]
},
{
"name": "FlatEnum",
"metadata": ":flatEnum",
Expand Down