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

Is there anyway to make a macro function manually by calling GorillaScript directly? #143

Open
kkirby opened this issue Jan 22, 2014 · 0 comments

Comments

@kkirby
Copy link

kkirby commented Jan 22, 2014

Basically what I'm wanting to do is tell GorillaScript to generate a macro function from something like the following:

let a = @tmp \a
ASTE let $a = true

The result would be a function looking like:

(function() {
return (function () {
  "use strict";
  return function (macroFullData, __wrap, __const, __value, __symbol, __call, __macro) {
    var a, macroData, macroName;
    macroName = macroFullData.macroName;
    macroData = macroFullData.macroData;
    a = this.tmp("abc", true);
    __macro(
      void 0,
      38,
      {
        macroName: "let",
        macroData: {
          declarable: __macro(
            void 0,
            37,
            __macro(
              void 0,
              31,
              { ident: __wrap(a) },
              true,
              false,
              false,
              false
            ),
            true,
            false,
            false,
            false
          ),
          value: __const("false")
        }
      },
      true,
      false,
      false,
      false
    );
  };
}.call(this));

})

Is there anyway to do this? I'm sure there is, I just don't know the right calls to make. I would be doing this within a macro, so the parser would be available to me, as well as a macro context (not sure how that helps). I also have access to GorillaScript.

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

No branches or pull requests

1 participant