Exemplo n.º 1
0
        public static void Apply(ExcessCompiler compiler, Scope scope = null)
        {
            scope?.AddKeywords("injector");

            compiler.extension("injector", ParseDependencyInjector);
            compiler.Environment()
            .dependency("Excess.Runtime")
            .dependency("Ninject");
        }
Exemplo n.º 2
0
        public static void Apply(ExcessCompiler compiler, Scope scope = null)
        {
            scope?.AddKeywords("sql");
            compiler.Lexical()
                .extension("sql", ExtensionKind.Code, ParseDapper);

            compiler.Environment()
                .dependency("Excess.Runtime")
                .dependency("Dapper")
                .dependency<IDbConnection>("System.Data")
                .dependency("System.Collections.Generic")
                .dependency("System.Linq");
        }
Exemplo n.º 3
0
        public static void Apply(ExcessCompiler compiler, Scope scope = null)
        {
            scope?.AddKeywords("settings");

            compiler.Lexical()
            .indented <SettingsModel, SettingsRoot>("settings", ExtensionKind.Type, null)
            .match <SettingsRoot, HeaderModel>(ParseHeader,
                                               children: child => child
                                               .match <SettingsModel, HeaderModel, AssignmentExpressionSyntax>(
                                                   then: (header, assignment) => header.Values.Add(assignment)))

            .then()
            .transform <SettingsRoot>(LinkSettings);
        }
Exemplo n.º 4
0
        public static void Apply(RoslynCompiler compiler, Options options = null, Scope scope = null)
        {
            scope?.AddKeywords("concurrent", "spawn", "await");
            scope?.set <Options>(options);

            if (options == null)
            {
                options = new Options();
            }

            var lexical = compiler.Lexical();

            lexical
            .match()
            .token("concurrent", named: "keyword")
            .token("class", named: "ref")
            .then(lexical.transform()
                  .remove("keyword")
                  .then(CompileClass(options)))

            .match()
            .token("concurrent", named: "keyword")
            .token("object", named: "ref")
            .then(lexical.transform()
                  .remove("keyword")
                  .replace("ref", "class ")
                  .then(CompileObject(options)))

            .match()
            .token("concurrent", named: "keyword")
            .token("app", named: "ref")
            .token("{")
            .then(lexical.transform()
                  .replace("keyword", "class ")
                  .replace("ref", "__app")
                  .then(CompileApp(options)));

            compiler.Syntax()
            .match <MethodDeclarationSyntax>(IsConcurrentFunction, "after-syntax")
            .then(CompileFunction);

            compiler.Environment()
            .dependency(new[]
            {
                "System.Threading",
                "System.Threading.Tasks",
            })
            .dependency <ConcurrentObject>("Excess.Concurrent.Runtime");
        }
Exemplo n.º 5
0
 public static void Apply(ExcessCompiler compiler, Scope scope = null)
 {
     scope?.AddKeywords("model");
     compiler.extension("model", ParseModel);
 }
Exemplo n.º 6
0
        public static void Apply(ExcessCompiler compiler, Scope scope = null)
        {
            scope?.AddKeywords("contract");

            compiler.extension("contract", ParseContract);
        }