Skip to content

Commit

Permalink
$mol_view_tree2_to_dts fix unique prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Nov 14, 2024
1 parent 43b7c87 commit 2224835
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions view/tree2/to/dts/dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace $ {
]
}

function type_enforce(this: $, name: $mol_tree2, type_suffix: number, a: readonly $mol_tree2[], b: readonly $mol_tree2[]) {
function type_enforce(this: $, name: $mol_tree2, type_suffix: string, a: readonly $mol_tree2[], b: readonly $mol_tree2[]) {
return name.struct('line', [
name.data(`type ${ name.value.replace(/<.*>/g, '') }__${ type_suffix } = $mol_type_enforce<` ),
name.struct( 'indent', [
Expand All @@ -102,10 +102,10 @@ namespace $ {
const descr = $mol_view_tree2_classes( tree )

const types = [] as $mol_tree2[]
let assert_count = 0

for( const klass of descr.kids ) {

let assert_count = 0
const parent = this.$mol_view_tree2_child(klass)
const props = this.$mol_view_tree2_class_props(klass)
const aliases = [] as $mol_tree2[]
Expand Down Expand Up @@ -178,7 +178,7 @@ namespace $ {
types.push( type_enforce.call(
this,
method,
++assert_count,
`${klass.type}_${++assert_count}`,
parameters.call(this, main, prop, 0),
parameters.call(this, second_main, second_key, 0),
) )
Expand All @@ -188,7 +188,7 @@ namespace $ {
types.push( type_enforce.call(
this,
method,
++assert_count,
`${klass.type}_${++assert_count}`,
parameters.call(this, main, prop, prop_parts.key ? 1 : 0),
parameters.call(this, second_main, second_key, (left_parts.next ? left_parts : right_parts).key ? 1 : 0),
) )
Expand Down Expand Up @@ -283,7 +283,7 @@ namespace $ {
type_enforce.call(
this,
input.data(`${ klass.type }_${prop.type.replace(/[\?\*]*/g, '')}`),
++assert_count,
`${klass.type}_${++assert_count}`,
result,
array_type
)
Expand All @@ -308,7 +308,7 @@ namespace $ {
type_enforce.call(
this,
first.data(input.type),
++assert_count,
`${klass.type}_${++assert_count}`,
[
first.data('[ '),
...args,
Expand All @@ -333,7 +333,7 @@ namespace $ {
type_enforce.call(
this,
over.data(`${ input.type }__${ name.value }`),
++assert_count,
`${klass.type}_${++assert_count}`,
over.hack( belt ),
return_type.call(
this,
Expand Down

0 comments on commit 2224835

Please sign in to comment.