[mod] auf ivaldi umgestellt

This commit is contained in:
fenris 2026-09-18 10:29:39 +02:00
parent 52b2aee6ea
commit d6c8b8283e
11 changed files with 5844 additions and 108 deletions

View file

@ -1,5 +1,5 @@
## Usage
- `cat arithmetics.tp2 | ../../tools/convert > /tmp/arithmetics.tp2.json`
- `cat arithmetics.tp2 | ../../misc/convert > /tmp/arithmetics.tp2.json`
- `echo '2+3' | type2 /tmp/arithmetics.tp2.json`
- `echo '(2+3)*5' | type2 /tmp/arithmetics.tp2.json | ./eval`

View file

@ -1,6 +1,6 @@
## Usage
- `cat logic.tp2 | ../../tools/convert > /tmp/logic.tp2.json`
- `cat logic.tp2 | ../../misc/convert > /tmp/logic.tp2.json`
- `echo '0&1' | type2 /tmp/logic.tp2.json`
- `echo 'not (false and true)' | type2 /tmp/logic.tp2.json | ./eval`

34
ivaldi.json Normal file
View file

@ -0,0 +1,34 @@
{
"version": 1,
"name": "type2",
"target": "node",
"settings": {
"typescript": {
"command": "tsc --removeComments",
"libs": ["es2018"]
}
},
"libs": {
"plankton": [
"args",
"file",
"lang"
],
"node": [
]
},
"core": [
"base.ts"
],
"apps": [
{
"name": "main",
"sources": [
"type2.ts"
],
"destination": "type2",
"head": "#!/usr/bin/env node",
"executable": true
}
]
}

View file

@ -7,7 +7,23 @@ Being fed with a JSON file, which specifies the language, and a string via `stdi
A typical call looks like this: `cat input.txt | type2 language.tp2.json`
## Working principle
## Building
### Requirements
- Typescript compiler
- NodeJS
- GNU Make
### Instructions
- excute `tools/ivaldi build`
## Documentation
### Working principle
```mermaid
flowchart LR
@ -22,7 +38,7 @@ flowchart LR
```
## Language specification
### Language specification
A language is specified by a JSON file, which represents a value of the following type:
@ -61,7 +77,7 @@ where:
The recommended extension for such files is `.tp2.json`.
### Conclusion element types
#### Conclusion element types
| type | meaning | parameters |
|-- |-- |-- |

View file

@ -1,4 +0,0 @@
#!/usr/bin/env sh
make -f tools/makefile

View file

@ -1,58 +0,0 @@
{
"name": "type2",
"version": "0.1.0",
"dependencies": [
],
"roottask": {
"name": "link",
"type": "schwamm",
"parameters": {
"includes": [
"temp/type2.swm.json"
],
"output": {
}
},
"sub": [
{
"name": "build",
"type": "schwamm",
"parameters": {
"includes": [
"lib/plankton/plankton.swm.json"
],
"inputs": {
"logic-impl": [
"temp/unlinked.js"
]
},
"output": {
"dump": {
"logic-impl": "build/type2.js"
}
}
},
"sub": [
{
"name": "logic",
"type": "typescript",
"parameters": {
"target": "ES6",
"allowUnreachableCode": true,
"input_from_schwamm": {
"path": "lib/plankton/plankton.swm.json",
"group": "logic-decl"
},
"inputs": [
"source/base.ts",
"source/type2.ts"
],
"output": "temp/unlinked.js"
}
}
]
}
]
}
}

View file

@ -1,13 +1,9 @@
#!/usr/bin/env sh
## consts
dir_build="build"
## args
if [ $# -ge 1 ] ; then dir_target=$1 ; else dir_target=/usr/local/bin ; fi
dir_build="/tmp/type2"
dir_target="${HOME}/.local/bin"
## exec

5787
tools/ivaldi Executable file

File diff suppressed because it is too large Load diff

View file

@ -1,25 +0,0 @@
## dirs
dir_lib := lib
dir_source := source
dir_temp := temp
dir_build := build
## commands
cmd_log := echo "--"
cmd_directory_create := mkdir -p
cmd_concatenate := cat
cmd_chmod := chmod
cmd_typescript_compile := tsc --removeComments --lib es2018
## rules
${dir_build}/type2: ${dir_source}/head.js ${dir_lib}/plankton/plankton.js ${dir_temp}/unlinked.js
@ ${cmd_log} "linking …"
@ ${cmd_directory_create} ${dir_build}
@ ${cmd_concatenate} $^ > $@
@ ${cmd_chmod} +x $@
${dir_temp}/unlinked.js: ${dir_lib}/plankton/plankton.d.ts ${dir_source}/base.ts ${dir_source}/type2.ts
@ ${cmd_log} "compiling …"
@ ${cmd_directory_create} ${dir_temp}
@ ${cmd_typescript_compile} $^ --outFile $@

View file

@ -1,10 +0,0 @@
#!/usr/bin/env sh
modules=""
modules="${modules} args"
modules="${modules} file"
modules="${modules} lang"
cd lib/plankton
ptk bundle node ${modules}