Skip to content

Commit

Permalink
Put in more ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
Lotes committed Nov 27, 2024
1 parent f1e8a71 commit e3ecc96
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions packages/typir/src/kinds/composite-kind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ export namespace Typir {
}

export const system = Typir.System.create()
.addFeature(Typir.Features.IsSubTypeOf)
.addFeature(Typir.Features.IsCastableTo)
.addFeature(Typir.Features.IsEqualTo)
.addPlugin(Typir.Plugins.Attributes)
.addPlugin(Typir.Plugins.IsSubTypeOf)
.addPlugin(Typir.Plugins.IsCastableTo)
.addPlugin(Typir.Plugins.IsEqualTo)
.addPlugin(Typir.Plugins.Inference)
.build()
;

export const CharType = Typir.Primitives.create(system)
export const CharType = Typir.Primitives.create(system) //system.types.create()
.attribute('type', Typir.Attributes.enumeration('character', 'graphic', 'uchar', 'widechar', 'nonvarying', 'varying', 'varyingz'))
.attribute('length', Typir.Attributes.integer())
.parseBy(input => {
Expand All @@ -82,23 +84,27 @@ export const CharType = Typir.Primitives.create(system)
};
});


//CharType(20) -> CharType(100) implizit
//CharType(20) <- CharType(100) exlizit

export const ClassType = Typir.Composites.create(system)
.attribute('name', Typir.Attributes.string())
.children('members', Typir.Composites.Children.multipleByName(() => system.top())
.child('superClass', Typir.Composites.Children.single(self => self)
.children('interfaces', Typir.Composites.Children.multipleByIndex(self => self))
.children('members', Typir.Composites.Children.multipleByName(() => system.types.top())
.child('superClass', Typir.Composites.Children.single(() => ClassType)
.children('interfaces', Typir.Composites.Children.multipleByIndex(() => ClassType)))
.inferOn(isMyClass, myClass => {
return {
...
}

Check failure on line 99 in packages/typir/src/kinds/composite-kind.ts

View workflow job for this annotation

GitHub Actions / typir-build

Expression expected.
})
;
});

Check failure on line 100 in packages/typir/src/kinds/composite-kind.ts

View workflow job for this annotation

GitHub Actions / typir-build

')' expected.

// CharType.create({
// type: 'character',
// length: 100,
// value: "'123456'"
// });
//CharType.parse("'abc'")
// const value: string = CharType.parse("'abcdefg'").length;
// CharType.top({
// type: 'character',
Expand Down

0 comments on commit e3ecc96

Please sign in to comment.