Skip to content

Commit

Permalink
wip : picked from -named attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
millergarym committed Apr 18, 2023
1 parent f4465af commit 54d3d06
Show file tree
Hide file tree
Showing 15 changed files with 306 additions and 180 deletions.
38 changes: 19 additions & 19 deletions adl/adl.work.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"adlc": "0.0.0",
"use_embedded_sys_loader": true,
"use": [
{
"path": "./adlc"
},
{
"path": "./tests/test31/lib"
"path": "./tests/test31/lib",
"ts_opts": {
"npm_pkg_name": "@adl-lang/common"
}
},
{
"path": "./stdlib"
"path": "./stdlib",
"ts_opts": {
"npm_pkg_name": "@adl-lang/sys"
}
},
{
"path": "./tests/test31/proj",
"genOptions": [
{
"tsgen": {
"outputs": {
"outputDir": "../generated/typescript/tests/test31/src",
"manifest": "../generated/typescript/tests/test31/.adl-manifest"
},
"includeRuntime": true,
"runtimeDir": "./runtime",
"generate_transitive": true,
"include_resolver": true,
"modules": "all",
"capitalize_branch_names_in_types": true,
"capitalize_type_names": true
"ts_opts": {
"npm_pkg_name": "@adl-lang/protoclient",
"outputs": {
"gen": {
"outputDir": "../generated/typescript/tests/test31/src",
"manifest": "../generated/typescript/tests/test31/.adl-manifest"
}
}
]
},
"include_resolver": true
}
}
]
}
}
52 changes: 30 additions & 22 deletions adl/adlc/adlc/packaging.adl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ type AdlWorkspace1 = AdlWorkspace<Pair<AdlPackageRef,AdlPackage>>;

/// Expected to live in a file named `adl.work.json`
struct AdlWorkspace<T> {
/// Version
String adlc;
Vector<GenOptions> defaultGenOptions = [];
Vector<T> use;
// AdlPackageRefs use;
Bool use_embedded_sys_loader = true;
};

// key must be a path to a directory directly under the folder containing the `adl.work.json` file.
Expand All @@ -24,36 +22,46 @@ type AdlPackageRefs = Vector<AdlPackageRef>;

struct AdlPackageRef {
String path;
Vector<GenOptions> genOptions = [];
};

union GenOptions {
TypescriptGenOptions tsgen;
Nullable<TypescriptGenOptions> ts_opts = null;
};


struct TypescriptGenOptions {
ReferenceableScopeOption referenceable = "local";
// Vector<> searchDir;
OutputOpts outputs;
Bool includeRuntime;
Nullable<String> runtimeDir;
Bool generate_transitive;
Bool include_resolver;
String npm_pkg_name;
OutputOpts outputs = { "ref": {}};
TsRuntimeOpt runtime_opts = { "packageRef": "@adl-lang/runtime" };
Bool generate_transitive = false;
Bool include_resolver = false;
TsStyle ts_style = "tsc";
ModuleSrc modules;

ModuleSrc modules = "all";
Bool capitalize_branch_names_in_types = true;
Bool capitalize_type_names = true;
// Vector<> searchDir;
// --merge-adlext=EXT
// --verbose
// --no-overwrite
// --exclude-ast
// --excluded-ast-annotations=SCOPEDNAMES
};

Bool capitalize_branch_names_in_types;
Bool capitalize_type_names;
union TsRuntimeOpt {
String packageRef;
TsGenRuntime generate;
};

struct OutputOpts {
struct TsGenRuntime {
String runtimeDir;
};

union OutputOpts {
GenOutput gen;
PkgRef ref;
};

struct PkgRef {
};

struct GenOutput {
ReferenceableScopeOption referenceable = "local";
String outputDir;
Nullable<String> manifest = null;
};
Expand Down Expand Up @@ -113,4 +121,4 @@ struct Retract {
Nullable<String> comment = null;
};

};
};
9 changes: 9 additions & 0 deletions adl/stdlib/sys/adlast2.adl
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,20 @@ union TypeRef {

// AST after initial parsing
type TypeExpr0 = TypeExpr<ScopedName>;
type Field0 = Field<TypeExpr0>;
type Struct0 = Struct<TypeExpr0>;
type Union0 = Union<TypeExpr0>;
type DeclType0 = DeclType<TypeExpr0>;
type Decl0 = Decl<TypeExpr0>;
type Module0 = Module<TypeExpr0>;


// AST after name resolution
type TypeExpr1 = TypeExpr<TypeRef>;
type Field1 = Field<TypeExpr1>;
type Struct1 = Struct<TypeExpr1>;
type Union1 = Union<TypeExpr1>;
type DeclType1 = DeclType<TypeExpr1>;
type Decl1 = Decl<TypeExpr1>;
type Module1 = Module<TypeExpr1>;

Expand Down
Loading

0 comments on commit 54d3d06

Please sign in to comment.