mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[typer] Add inferTypes pass to playground
This commit is contained in:
@@ -20,6 +20,7 @@ const {
|
||||
enterSSA,
|
||||
Environment,
|
||||
flattenReactiveLoops,
|
||||
inferTypes,
|
||||
inferMutableRanges,
|
||||
inferReactiveScopes,
|
||||
inferReactiveScopeVariables,
|
||||
@@ -47,6 +48,7 @@ type CompilerOutput = {
|
||||
ssaOutput: string;
|
||||
hirOutput: string;
|
||||
eliminateRedundantPhiOutput: string;
|
||||
inferTypesOutput: string;
|
||||
inferReferenceEffectsOutput: string;
|
||||
inferMutableRangesOutput: string;
|
||||
inferReactiveScopeVariablesOutput: string;
|
||||
@@ -79,6 +81,9 @@ function compile(source: string): CompilerOutput | CompilerError {
|
||||
eliminateRedundantPhi(ir);
|
||||
const eliminateRedundantPhiOutput = printHIR(ir.body);
|
||||
|
||||
inferTypes(ir);
|
||||
const inferTypesOutput = printHIR(ir.body);
|
||||
|
||||
inferReferenceEffects(ir);
|
||||
const inferReferenceEffectsOutput = printHIR(ir.body);
|
||||
|
||||
@@ -124,6 +129,7 @@ function compile(source: string): CompilerOutput | CompilerError {
|
||||
hirOutput,
|
||||
ssaOutput,
|
||||
eliminateRedundantPhiOutput,
|
||||
inferTypesOutput,
|
||||
inferReferenceEffectsOutput,
|
||||
inferMutableRangesOutput,
|
||||
inferReactiveScopeVariablesOutput,
|
||||
@@ -165,6 +171,11 @@ function Output({ store, setTabsOpen, tabsOpen }: Props) {
|
||||
output={compilerOutput.eliminateRedundantPhiOutput}
|
||||
></TextTabContent>
|
||||
),
|
||||
InferTypes: (
|
||||
<TextTabContent
|
||||
output={compilerOutput.inferTypesOutput}
|
||||
></TextTabContent>
|
||||
),
|
||||
InferReferenceEffects: (
|
||||
<TextTabContent
|
||||
output={compilerOutput.inferReferenceEffectsOutput}
|
||||
|
||||
@@ -11,6 +11,7 @@ export type TabTypes =
|
||||
| "HIR"
|
||||
| "SSA"
|
||||
| "EliminateRedundantPhi"
|
||||
| "InferTypes"
|
||||
| "InferReferenceEffects"
|
||||
| "InferMutableRanges"
|
||||
| "InferReactiveScopeVariables"
|
||||
|
||||
@@ -19,6 +19,7 @@ import codegen from "./HIR/Codegen";
|
||||
import { Environment } from "./HIR/HIRBuilder";
|
||||
import { inferMutableRanges } from "./HIR/InferMutableRanges";
|
||||
import inferReferenceEffects from "./HIR/InferReferenceEffects";
|
||||
import { inferTypes } from "./HIR/InferTypes";
|
||||
import printHIR, { printFunction } from "./HIR/PrintHIR";
|
||||
import { buildReactiveFunction } from "./ReactiveScopes/BuildReactiveFunction";
|
||||
import { codegenReactiveFunction } from "./ReactiveScopes/CodegenReactiveFunction";
|
||||
@@ -63,6 +64,7 @@ export const HIR = {
|
||||
eliminateRedundantPhi,
|
||||
enterSSA,
|
||||
Environment,
|
||||
inferTypes,
|
||||
inferMutableRanges,
|
||||
inferReactiveScopes,
|
||||
inferReactiveScopeVariables,
|
||||
|
||||
Reference in New Issue
Block a user