{"size": 1365, "ext": "sjs", "max_stars_repo_path": "src/fxmacros.sjs", "max_stars_repo_name": "levjj/jsfxs", "max_stars_repo_stars_event_min_datetime": "2015-06-11T22:16:51.000Z", "max_stars_repo_stars_event_max_datetime": "2018-08-01T06:09:26.000Z", "max_issues_repo_path": "src/fxmacros.sjs", "max_issues_repo_name": "levjj/jsfxs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/fxmacros.sjs", "max_forks_repo_name": "levjj/jsfxs", "max_forks_repo_forks_event_min_datetime": "2018-12-01T09:43:12.000Z", "max_forks_repo_forks_event_max_datetime": "2018-12-01T09:43:12.000Z"}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 36.8918918919, "max_line_length": 115, "alphanum_fraction": 0.3963369963}
macro __fxstr {
    case { _ $fx }
      => { letstx $tokenStr = [makeValue("__@fx:" + unwrapSyntax(#{$fx}), #{$fx})];
           return #{ $tokenStr } }
}
macro __varfxstr {
    case { _ $var $fx }
      => { letstx $tokenStr = [makeValue("__@var:" + unwrapSyntax(#{$var}) + ":!" + unwrapSyntax(#{$fx}), #{$fx})];
           return #{ $tokenStr } }
}

macro funce {
    rule { () $oargs ($eff ...) { $s ... } }
      => { function $oargs { $( __fxstr $eff ;) ... $s ... } }
    rule { (, $args ...) $oargs $eff $s }
      => { funce ($args ...) $oargs $eff $s }

    rule { ($arg:ident fx[$(! $e:ident) (,) ...] $args ...) () $eff { $s ... } }
      => { funce ($args ...) ($arg) $eff { $( __varfxstr $arg $e ;) ...  $s ... } }
    rule { ($arg:ident $args ...) () $eff $s }
      => { funce ($args ...) ($arg) $eff $s }

    rule { ($arg:ident fx[$(! $e:ident) (,) ...] $args ...) ($oargs ...) $eff { $s ... } }
      => { funce ($args ...) ($arg, $oargs ...) $eff { $( __varfxstr $arg $e ;) ...  $s ... } }
    rule { ($arg:ident $args ...) ($oargs ...) $eff $s }
      => { funce ($args ...) ($arg, $oargs ...) $eff $s }
}

let function = macro {
    rule { ($args ...) { $s ... } }
      => { funce ($args ...) () () { $s ... }}
    rule { ($args ...) fx [$e:ident (,) ...] { $s ... } }
      => { funce ($args ...) () ($e ...) { $s ... }}
}

export function;
