Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/dev-playground/src/Bindings.res
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ module CompileResult = {
@get external parsetree: compileResult => option<string> = "parsetree"
@get external typedtree: compileResult => option<string> = "typedtree"
@get external lambda: compileResult => option<string> = "lambda"
@get external lam: compileResult => option<string> = "lam"
@get external gentype: compileResult => option<string> = "gentype"
@get external sourceMap: compileResult => option<string> = "source_map"
@get external errors: compileResult => option<array<diagnostic>> = "errors"
Expand Down
6 changes: 2 additions & 4 deletions packages/dev-playground/src/CompilerApi.res
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ type success = {
parsetree: string,
typedtree: string,
lambda: string,
lam: string,
gentype: option<string>,
sourceMap: option<string>,
warnings: array<string>,
Expand Down Expand Up @@ -403,9 +402,8 @@ let normalize = (compileOutput, elapsedMs): compileResult => {
compileOutput->CompileResult.parsetree,
compileOutput->CompileResult.typedtree,
compileOutput->CompileResult.lambda,
compileOutput->CompileResult.lam,
) {
| (Some(parsetree), Some(typedtree), Some(lambda), Some(lam)) =>
| (Some(parsetree), Some(typedtree), Some(lambda)) =>
let warnings = switch compileOutput->CompileResult.warnings {
| Some(warnings) => warnings->Array.map(warningToText)
| None => []
Expand All @@ -419,7 +417,7 @@ let normalize = (compileOutput, elapsedMs): compileResult => {
let gentype = compileOutput->CompileResult.gentype
let sourceMap = compileOutput->CompileResult.sourceMap

Ok({jsCode, parsetree, typedtree, lambda, lam, gentype, sourceMap, warnings, time: elapsedMs})
Ok({jsCode, parsetree, typedtree, lambda, gentype, sourceMap, warnings, time: elapsedMs})

| _ => Error(failureFromCompileOutput(compileOutput, elapsedMs))
}
Expand Down
1 change: 0 additions & 1 deletion packages/dev-playground/src/CompilerApi.resi
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type success = {
parsetree: string,
typedtree: string,
lambda: string,
lam: string,
gentype: option<string>,
sourceMap: option<string>,
warnings: array<string>,
Expand Down
7 changes: 2 additions & 5 deletions packages/dev-playground/src/Main.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ type tab =
| Parsetree
| Typedtree
| Lambda
| Lam
| JavaScript
| GenType
| SourceMap
Expand All @@ -26,15 +25,15 @@ type compileSnapshot = {
result: CompilerApi.compileResult,
}

let baseTabs: array<tab> = [Parsetree, Typedtree, Lambda, Lam, JavaScript]
let baseTabs: array<tab> = [Parsetree, Typedtree, Lambda, JavaScript]
Comment thread
fhammerschmidt marked this conversation as resolved.
let moduleSystems: array<moduleSystem> = [Esmodule, Commonjs]
let sourceMapModes: array<sourceMapMode> = [Disabled, Linked, Inline, Hidden]

let tabIsVisible = (config: PlaygroundConfig.t, tab) =>
switch tab {
| GenType => config.gentypeEnabled
| SourceMap => config.sourceMapMode !== Disabled
| Parsetree | Typedtree | Lambda | Lam | JavaScript | Settings => true
| Parsetree | Typedtree | Lambda | JavaScript | Settings => true
}

let tabsForConfig = (config: PlaygroundConfig.t) => {
Expand Down Expand Up @@ -63,7 +62,6 @@ let tabLabel = tab =>
| Parsetree => "parsetree"
| Typedtree => "typedtree"
| Lambda => "lambda"
| Lam => "lam"
| JavaScript => "js"
| GenType => "gentype"
| SourceMap => "source map"
Expand Down Expand Up @@ -225,7 +223,6 @@ let selectedOutput = (snapshot: option<compileSnapshot>, activeTab: tab) =>
| Parsetree => result.parsetree
| Typedtree => result.typedtree
| Lambda => result.lambda
| Lam => result.lam
| JavaScript => result.jsCode
| GenType =>
optionalOutput(result.gentype, "This compiler bundle does not expose gentype output yet.")
Expand Down
Loading