Skip to content
Merged
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
49 changes: 41 additions & 8 deletions packages/web/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type SchemaIndex = {
};
};

export const schemaIndex: SchemaIndex = {
const typeSchemaIndex: SchemaIndex = {
"schema:ethdebug/format/type/base": {
title: "ethdebug/format/type/base schema",
href: "/spec/type/base"
Expand Down Expand Up @@ -61,7 +61,9 @@ export const schemaIndex: SchemaIndex = {
title: "Parameters schema",
href: "/spec/type/complex/function#parameters-schema"
},
};

const pointerSchemaIndex: SchemaIndex = {
"schema:ethdebug/format/pointer": {
href: "/spec/pointer"
},
Expand Down Expand Up @@ -159,15 +161,15 @@ export const schemaIndex: SchemaIndex = {
href: `/spec/pointer/expression${anchor}`
}
})).reduce((a, b) => ({ ...a, ...b }), {}),
};

...(
["hex", "unsigned"].map(name => ({
[`schema:ethdebug/format/data/${name}`]: {
href: `/spec/data/${name}`
}
})).reduce((a, b) => ({ ...a, ...b }), {})
),
const dataSchemaIndex: SchemaIndex = ["hex", "unsigned"].map(name => ({
[`schema:ethdebug/format/data/${name}`]: {
href: `/spec/data/${name}`
}
})).reduce((a, b) => ({ ...a, ...b }), {});

const materialsSchemaIndex: SchemaIndex = {
"schema:ethdebug/format/materials/id": {
title: "Identifier schema",
href: "/spec/materials/id#identifier-schema"
Expand All @@ -193,3 +195,34 @@ export const schemaIndex: SchemaIndex = {
href: "/spec/materials/source-range"
},
};

const programSchemaIndex: SchemaIndex = {
"schema:ethdebug/format/program": {
href: "/spec/program"
},

"schema:ethdebug/format/program/instruction": {
href: "/spec/program/instruction"
},

"schema:ethdebug/format/program/context": {
href: "/spec/program/context"
},

...(
["code", "variables"].map(name => ({
[`schema:ethdebug/format/program/context/${name}`]: {
href: `/spec/program/context/${name}`
}
})).reduce((a, b) => ({ ...a, ...b }), {})
),

};

export const schemaIndex: SchemaIndex = {
...typeSchemaIndex,
...pointerSchemaIndex,
...dataSchemaIndex,
...materialsSchemaIndex,
...programSchemaIndex,
};
Loading