Skip to content

Commit

Permalink
updated Tiny Typir code
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesMeierSE committed Dec 20, 2024
1 parent c46a4cb commit 6ff8ec5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Note that the versions "0.x.0" probably will include breaking changes.

- Improved the READMEs in the packages `typir` and `typir-langium`.
- Improved the CONTRIBUTING.md.
- Improved source code for Tiny Typir in `api-example.test.ts`.


## v0.1.0 (December 2024)
Expand Down
18 changes: 2 additions & 16 deletions packages/typir/test/api-example.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,9 @@ import { describe, expect, test } from 'vitest';
import { InferenceRuleNotApplicable, InferOperatorWithMultipleOperands, ValidationMessageDetails } from '../src/index.js';
import { createTypirServices } from '../src/typir.js';

describe('Tests for the new API', () => {
test('Experiments', async () => {
const typir = createTypirServices();
describe('Tiny Typir', () => {

const booleanType = typir.factory.Primitives.create({ primitiveName: 'boolean' });
expect(booleanType).toBeTruthy();
const getBool = typir.factory.Primitives.get({ primitiveName: 'boolean' });
expect(getBool).toBe(booleanType);

typir.factory.Functions.create({ functionName: 'myFunction', inputParameters: [], outputParameter: undefined });

// operators
typir.factory.Operators.createBinary({ name: '&&', signature: { left: booleanType, right: booleanType, return: booleanType } });
});


test('Tiny Typir', async () => {
test('Set-up and test some expressions', async () => {
const typir = createTypirServices(); // set-up the type system

// primitive types
Expand Down

0 comments on commit 6ff8ec5

Please sign in to comment.