tangled
alpha
login
or
join now
danabra.mov
/
typelex
56
fork
atom
An experimental TypeSpec syntax for Lexicon
56
fork
atom
overview
issues
1
pulls
2
pipelines
fix 1
danabra.mov
5 months ago
9491ad38
b6964169
+11
-4
10 changed files
expand all
collapse all
unified
split
packages
emitter
src
emitter.ts
test
integration
lexicon-examples
input
sh
tangled
repo
issue.tsp
pull.tsp
output
sh
tangled
repo
issue
state
closed.json
open.json
issue.json
pull
status
closed.json
merged.json
open.json
pull.json
+11
-4
packages/emitter/src/emitter.ts
reviewed
···
39
39
LexObjectProperty,
40
40
LexArrayItem,
41
41
LexXrpcParameterProperty,
42
42
-
LexInteger,
43
43
-
LexString,
44
42
LexRefUnion,
45
43
LexUserType,
46
44
LexRecord,
···
48
46
LexXrpcParameters,
49
47
LexBytes,
50
48
LexCidLink,
51
51
-
LexRef,
52
49
LexRefVariant,
50
50
+
LexToken,
53
51
} from "./types.js";
54
52
55
53
import {
···
267
265
};
268
266
}
269
267
270
270
-
private createMainDef(mainModel: Model): LexRecord | LexObject {
268
268
+
private createMainDef(mainModel: Model): LexRecord | LexObject | LexToken {
271
269
const modelDescription = getDoc(this.program, mainModel);
270
270
+
271
271
+
// Check if this is a token type
272
272
+
if (isToken(this.program, mainModel)) {
273
273
+
return {
274
274
+
type: "token",
275
275
+
description: modelDescription,
276
276
+
};
277
277
+
}
278
278
+
272
279
const recordKey = getRecordKey(this.program, mainModel);
273
280
const modelDef = this.modelToLexiconObject(mainModel, !!modelDescription);
274
281
packages/emitter/test/integration/lexicon-examples/input/sh/tangled/repo/issue/issue.tsp
packages/emitter/test/integration/lexicon-examples/input/sh/tangled/repo/issue.tsp
reviewed
packages/emitter/test/integration/lexicon-examples/input/sh/tangled/repo/pull/pull.tsp
packages/emitter/test/integration/lexicon-examples/input/sh/tangled/repo/pull.tsp
reviewed
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/issue/closed.json
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/issue/state/closed.json
reviewed
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/issue/issue.json
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/issue.json
reviewed
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/issue/open.json
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/issue/state/open.json
reviewed
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/pull/closed.json
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/pull/status/closed.json
reviewed
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/pull/merged.json
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/pull/status/merged.json
reviewed
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/pull/open.json
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/pull/status/open.json
reviewed
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/pull/pull.json
packages/emitter/test/integration/lexicon-examples/output/sh/tangled/repo/pull.json
reviewed