Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add builtin parameters #34

Draft
wants to merge 175 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
29b7800
feat: add first parameters
alex-senger Apr 24, 2024
41ecca1
generate conditional statements and loops
robmeth Apr 24, 2024
31054d4
tests for conditional statement grammar
robmeth Apr 24, 2024
055490f
feat: finish Arbeitslosengeld
alex-senger Apr 27, 2024
da19ac6
feat: add einkommenssteuer_abzüge
alex-senger Apr 28, 2024
f4b3d77
feat: add einkommenssteuer
alex-senger Apr 28, 2024
8459c6e
feat: add elterngeld
alex-senger Apr 28, 2024
bd9aaa9
feat: add erwerbsm_rente.yaml
alex-senger Apr 28, 2024
32021e1
feat: add erziehungsgeld parameters
alex-senger May 2, 2024
31ea155
generateFunction with Timespan blocks
robmeth May 6, 2024
1750869
utility aggregation generation
robmeth May 6, 2024
5f00c7f
add Aggregation to generateExpression
robmeth May 6, 2024
80c7317
Merge branch 'main' into 26-generate-code
robmeth May 6, 2024
3b161aa
aggregate should only have one data instead of a list of data
robmeth May 6, 2024
0d3e2a2
utility function for creating a constants class
robmeth May 7, 2024
b73226d
generating constants with utilityFunction, changed constructure of co…
robmeth May 8, 2024
e70d787
feat: add gesetzliche Rente
alex-senger May 12, 2024
054eab6
tests for functions, data and constants
robmeth May 13, 2024
2c0bcee
update TimespanStatement generation
robmeth May 14, 2024
3df119b
generate Data
robmeth May 14, 2024
07f80e2
feat: add GrundsicherungImAlter
alex-senger May 14, 2024
c231ac7
fix build
robmeth May 14, 2024
28879ca
fix build
robmeth May 14, 2024
d847caf
change comment in test files form `//` to `#`
robmeth May 15, 2024
859c115
reverse former commit (comments back to //
robmeth May 15, 2024
4f6429d
change definition of comments to //
robmeth May 15, 2024
bc7b003
fix function and conditional statement grammar tests
robmeth May 15, 2024
26ecbe7
refactor: split parameters.ttsl into multiple packages
alex-senger May 16, 2024
386f805
feat: add kindergeld parameters
alex-senger May 16, 2024
b6cca3a
feat: add kinderzuschlag
alex-senger May 18, 2024
bafb1b0
remove yaml from kinderzuschlag.ttsl
alex-senger May 20, 2024
4dc29a5
feat: add lohnsteuer.ttsl
alex-senger May 20, 2024
39f15e7
feat: add solizuschlag
alex-senger May 20, 2024
938e6bb
generation tests for constants, data, empty function, aggregation and…
robmeth May 21, 2024
b6bc6f6
data extends tsldeclaration, DATE has the time as optional addition, …
robmeth May 21, 2024
da34a83
feat: add sozialversicherungsbeitrag.ttsl
alex-senger May 21, 2024
0116342
chore: remove yaml from sozialversicherungsbeitrag.ttsl
alex-senger May 21, 2024
bf3045a
feat: add unterhalt.ttsl
alex-senger May 21, 2024
b44f1ad
feat: unterhaltvorschuss
alex-senger May 21, 2024
e30e893
feat: implement 2024 changes
alex-senger May 21, 2024
a3fa77c
chore: cleanup
alex-senger May 21, 2024
d4ed9c3
fix generate function parameter, fix generate constant, update consta…
robmeth May 22, 2024
f6094c4
feat: add wohngeld.ttsl
May 22, 2024
1134b31
Merge branch 'main' into 25-add-builtin-parameters
alex-senger May 22, 2024
7c0efd1
refactor: put parameters in own dir
May 22, 2024
c9aec33
fix aggregation parameter types
robmeth May 22, 2024
bbcf2cf
make constant extend TslDeclaration to be referenced
robmeth May 22, 2024
a0da799
purity of function doesn't have to be specified
robmeth May 22, 2024
0be6b3d
purity of function doesn't have to be specified
robmeth May 22, 2024
94f2ba9
fix: typo
alex-senger May 22, 2024
66ad1da
fix new line appention in Module generation
robmeth May 31, 2024
091789f
add our types to the primary types,
robmeth May 31, 2024
78b3cac
Merge remote-tracking branch 'origin/main'
robmeth Jun 1, 2024
d0fbe72
Merge branch 'main' into 26-generate-code
robmeth Jun 1, 2024
ae5923d
add utility functions for timeunits for functions
robmeth Jun 6, 2024
069e1cb
update syntax for function parameters
robmeth Jun 7, 2024
ac5b07a
call the timeunit utility functions when needed in the functionbody
robmeth Jun 7, 2024
1fb2097
right syntax for result type in function
robmeth Jun 7, 2024
8eae743
add timeunit agrument to the functioncall generation
robmeth Jun 7, 2024
9c03b83
Fix aggregation Test errors
robmeth Jun 7, 2024
3d9715c
add id checks for aggregation and checks for grouped functions
robmeth Jun 12, 2024
cb33995
started adding evaluations for aggregation and modifier
robmeth Jun 12, 2024
9ca99ab
function with timeunit test
robmeth Jun 17, 2024
6811b87
fix bugs in function and constant generation
robmeth Jun 17, 2024
8d389f9
fix parameter bugs in function and constant generation
robmeth Jun 18, 2024
814d31e
fix timeunit test
robmeth Jun 18, 2024
5dae488
add function scope
robmeth Jun 18, 2024
9e9ff63
fix build errors
robmeth Jun 18, 2024
c0ed8de
add keywords to textMate file
robmeth Jun 19, 2024
eb18cc2
Merge branch 'main' into 26-generate-code
robmeth Jun 20, 2024
a4b2203
change file extension to '.ttsl'
robmeth Jun 20, 2024
0afd3ab
add NodeDescription to ttsl.json file
robmeth Jun 20, 2024
147ffd0
scoping test in same file
robmeth Jun 20, 2024
682881e
update timestamp NodeDescription
robmeth Jun 21, 2024
a352b46
remove unnecessary grammar
robmeth Jun 24, 2024
0a27eb7
remove the generation of removed grammar
robmeth Jun 24, 2024
0993c3c
remove unnecessary Validators
robmeth Jun 24, 2024
d3926a5
remove unnecessary Validation tests
robmeth Jun 24, 2024
2371369
remove unnecessary validation tests
robmeth Jun 24, 2024
dcd6d72
remove unnecessary scoping functions
robmeth Jun 24, 2024
e4b5739
remove unnecessary code from package manager
robmeth Jun 24, 2024
f754026
remove unnecessary functions from nodeProperties
robmeth Jun 24, 2024
003c2c7
fix typo in node Properties
robmeth Jun 24, 2024
dd9642e
fix use of node property functions
robmeth Jun 24, 2024
bb82883
fix visibility
robmeth Jun 25, 2024
87e1a7f
remove unnecessary types
robmeth Jun 25, 2024
7f02abb
clean up lsp
robmeth Jun 25, 2024
e7d34b9
fix build error
robmeth Jun 25, 2024
e7f29b5
remove unnecessary code
robmeth Jun 25, 2024
3381938
fix build errors in python generator
robmeth Jun 25, 2024
53ff930
remove unneccesarry purity computer
robmeth Jun 25, 2024
8838880
remove unnecessary functions in call graph computer
robmeth Jun 25, 2024
a5c6c8c
remove unnecessary documentation provider
robmeth Jun 26, 2024
fc44b0d
remove unnecessary buildins
robmeth Jun 26, 2024
542b0e3
remove use of unnecessary builtins and add fuiltins for functions
robmeth Jun 28, 2024
c12da33
remove unnecessary node mapper functions
robmeth Jun 28, 2024
7c992cb
remove use of purity functions
robmeth Jun 29, 2024
1e86af4
remove statementMustDoSomething call in validator
robmeth Jun 29, 2024
45cf2c1
Merge branch 'main' into 25-add-builtin-parameters
alex-senger Jun 29, 2024
47b2e1f
fix: single line comment syntax
alex-senger Jun 29, 2024
43359fc
fix: add public visibility to each constant
alex-senger Jun 29, 2024
e1326f0
fix: replace '|' with 'or'
alex-senger Jun 29, 2024
83d0893
fix: replace 'const' with 'constant'
alex-senger Jul 1, 2024
6658b4b
add List and Dictionary Types
robmeth Jul 1, 2024
a4ef7c6
remove unnecessary Code in type computer
robmeth Jul 1, 2024
7750e2e
remove unnecessary code from type-checker
robmeth Jul 1, 2024
c8c1609
remove unnecessary code in partial evaluator
robmeth Jul 1, 2024
db9d4da
remove class hierachy
robmeth Jul 1, 2024
e6b39c0
remove unnecessary functions in model.ts
robmeth Jul 1, 2024
5f7c4b7
update syntax description
robmeth Jul 1, 2024
e59d5d4
rename fileExtensions
robmeth Jul 1, 2024
106113d
update file names and test file extensions
robmeth Jul 1, 2024
f12b3f3
fix file generation
robmeth Jul 2, 2024
8c4c582
fix grammar tests
robmeth Jul 11, 2024
e7d615b
add types in grammar definition
robmeth Jul 16, 2024
02392c3
update typechecker to new types
robmeth Jul 16, 2024
762ad34
update types in type validator
robmeth Jul 16, 2024
f29ae3d
remove callable type in chainedExpression validation
robmeth Jul 16, 2024
d8e52c1
update Types in indexedAccess validation
robmeth Jul 16, 2024
8d4e548
remove CallableType and add TypeParameter function
robmeth Jul 16, 2024
bdf81ba
add TypeParameters
robmeth Jul 22, 2024
c781ddd
remove coreTypes and add new Types
robmeth Jul 22, 2024
544c739
add len and key/value functions for list and dictionary
robmeth Jul 22, 2024
dc80bbf
add new types to formatter
robmeth Jul 22, 2024
3b0301d
update handling of calls/allables
robmeth Jul 22, 2024
d19d74d
remove purity tests
robmeth Jul 23, 2024
9ab9d89
remove partial evaluation tests
robmeth Jul 23, 2024
b1eb3eb
remove old Types in tests
robmeth Jul 23, 2024
8437452
Merge branch 'main' into 26-generate-code
robmeth Jul 29, 2024
f665388
remove anything related to member Accesses
robmeth Jul 30, 2024
59530ad
remove unneccessary imports
robmeth Jul 30, 2024
acc0f6f
remove uneccessary validations
robmeth Aug 1, 2024
adba984
add type compution for literals
robmeth Aug 1, 2024
ba9da65
fix grammar bugs
robmeth Aug 1, 2024
dddde33
fix inlay hint for placeholder
robmeth Aug 1, 2024
e6023d4
fix autocompletion
robmeth Aug 1, 2024
ab7fb7d
grammar und generation tests klappen soweit abgesehen von paar scopin…
robmeth Aug 20, 2024
ed1b7b8
update old links (code documentation doesn't have a new one yet)
robmeth Aug 20, 2024
0cc4d6f
make MegaLinter happy
robmeth Aug 20, 2024
f360959
Merge branch 'main' into 25-add-builtin-parameters
alex-senger Aug 20, 2024
40be2b5
Merge branch '26-generate-code' into 25-add-builtin-parameters
alex-senger Aug 20, 2024
118ffae
make MegaLinter happy
robmeth Aug 20, 2024
50c5d4e
make MegaLinter happy
robmeth Aug 20, 2024
2b90ff2
Merge branch '26-generate-code' into 25-add-builtin-parameters
alex-senger Aug 20, 2024
98f2cb1
add Timespan tests and semicolon after value
robmeth Aug 20, 2024
4669607
Merge branch '26-generate-code' into 25-add-builtin-parameters
alex-senger Aug 20, 2024
aa1c6d5
adding Timeunit grammar tests
robmeth Aug 20, 2024
5b46db3
adding id grammar tests
robmeth Aug 20, 2024
206fe81
add grouping grammar tests
robmeth Aug 20, 2024
f059ef1
scoping tests for loop and conditional Statement
robmeth Aug 21, 2024
871ec92
fix import generation test
robmeth Aug 21, 2024
d60f91f
fix scoping for conditionalStatements and Loops
robmeth Aug 21, 2024
123e6f9
fix indexed Access and dictionary test
robmeth Aug 21, 2024
0ba804d
fix default value generation in parameters
robmeth Aug 23, 2024
a3fded1
update tests with parameter types and fix errors
robmeth Aug 23, 2024
c59ac7e
fix ability to reassign local variables
robmeth Aug 24, 2024
75b2807
fix foreach element type computation
robmeth Aug 24, 2024
75aab3f
Update existing partial evaluation tests file extention
robmeth Aug 29, 2024
83c6916
arbeitslosengeld syntax fix
alex-senger Aug 29, 2024
38fb597
einkommenssteuer syntax fix
alex-senger Aug 29, 2024
62e8a28
elterngeld syntax fix
alex-senger Aug 29, 2024
1c691c1
erwerbsminderungsrente syntax fix
alex-senger Aug 29, 2024
fef2f51
erziehungsgeld syntax fix
alex-senger Aug 29, 2024
b7cef31
grundsicherungImAlter syntax fix
alex-senger Aug 29, 2024
0156a50
fix bug in type generation
robmeth Aug 30, 2024
f8903fe
fix syntax errors
alex-senger Sep 1, 2024
cb81d56
fix syntax errors
alex-senger Sep 1, 2024
c826b1a
remove experimental Language validation check and add Umlaute to grammar
robmeth Sep 2, 2024
13f0192
wohngeld wip
alex-senger Sep 3, 2024
6ad0173
fix typehints
alex-senger Sep 9, 2024
2349478
fix typehints
alex-senger Sep 9, 2024
882fe1a
split vertrauensschutz constants
alex-senger Sep 9, 2024
5758457
Merge remote-tracking branch 'origin/26-generate-code' into 25-add-bu…
alex-senger Sep 14, 2024
147d8f9
fix type hints
alex-senger Sep 14, 2024
d5b1313
umlaute
alex-senger Sep 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/linters/.markdown-link-check.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"pattern": "^#"
},
{
"pattern": "^https://github.com/Safe-DS/DSL/blob/main"
"pattern": "^https://github.com/TTSL/DSL/blob/main"
}
]
}
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

A domain-specific language (DSL) to simulate taxes and transfers.

This project is based on the [Safe-DS](https://github.com/Safe-DS/DSL) DSL for statically checked Data Science programs.
This project is based on the [TTSL](https://github.com/SEEDS-Group/TTSL) DSL for statically checked Data Science programs.
4 changes: 2 additions & 2 deletions docs/development/call-graph-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ graph test.

## Adding a call graph test

1. Create a new file with the extension `.Tsltest` in the `tests/resources/call graph` directory or any subdirectory.
1. Create a new file with the extension `.ttsl` in the `tests/resources/call graph` directory or any subdirectory.
Give the file a descriptive name, since the file name becomes part of the test name.

!!! tip "Skipping a test"

If you want to skip a test, add the prefix `skip-` to the file name.

2. Add the Safe-DS code that you want to test to the file.
2. Add the TTSL code that you want to test to the file.
3. Surround calls or callables for which you want to compute a call graph with test markers, e.g. `»f()«`. Add a
comment in the preceding line with the following format:
```ts
Expand Down
6 changes: 3 additions & 3 deletions docs/development/formatting-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ formatting test.

## Adding a formatting test

1. Create a new file with the extension `.Tsltest` in the `tests/resources/formatting` directory or any subdirectory.
1. Create a new file with the extension `.ttsl` in the `tests/resources/formatting` directory or any subdirectory.
Give the file a descriptive name, since the file name becomes part of the test name.

!!! tip "Skipping a test"

If you want to skip a test, add the prefix `skip-` to the file name.

2. Add the original unformatted Safe-DS code to the top of the file. The code must be syntactically valid.
2. Add the original unformatted TTSL code to the top of the file. The code must be syntactically valid.
3. Add the following separator to the file:
```Tsl
// -----------------------------------------------------------------------------
```
4. Add the expected formatted Safe-DS code to the file below the separator.
4. Add the expected formatted TTSL code to the file below the separator.
5. Run the tests. The test runner will automatically pick up the new test.
4 changes: 2 additions & 2 deletions docs/development/generation-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ generation test.

If you want to skip a test, add the prefix `skip-` to the folder name.

2. Add files with the extension `.Tsltest`, `.Tslpipe`, or `.Tslstub` **directly inside the folder**. All files in a
2. Add files with the extension `.ttsl`, `.Tslpipe`, or `.Tslstub` **directly inside the folder**. All files in a
folder will be loaded into the same workspace, so they can reference each other. Files in different folders are
loaded into different workspaces, so they cannot reference each other. Generation will be triggered for all files in
the folder.
3. Add the Safe-DS code that you want to test to the files.
3. Add the TTSL code that you want to test to the files.
4. If you want to run the program only up to a specific placeholder of a pipeline, surround **the name** of that
placeholder with test markers, e.g. `val »a« = 1;`. You may only mark a single placeholder this way. Add a comment in
the preceding line with the following format:
Expand Down
4 changes: 2 additions & 2 deletions docs/development/grammar-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test.

## Adding a grammar test

1. Create a new file with the extension `.Tsltest` in the `tests/resources/grammar` directory or any subdirectory. Give
1. Create a new file with the extension `.ttsl` in the `tests/resources/grammar` directory or any subdirectory. Give
the file a descriptive name, since the file name becomes part of the test name.

!!! note "Naming convention"
Expand Down Expand Up @@ -33,7 +33,7 @@ test.

By convention, the comment should be placed at the start of the file.

3. Add the Safe-DS code that you want to test to the file.
3. Add the TTSL code that you want to test to the file.
4. Run the tests. The test runner will automatically pick up the new test.

[^1]: We do not differentiate whether the error originated in the lexer (error code `lexing-error`) or the actual parser (error code `parsing-error`). Both are treated as syntax errors.
4 changes: 2 additions & 2 deletions docs/development/partial-evaluation-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ partial evaluation test.

If you want to skip a test, add the prefix `skip-` to the folder name.

2. Add files with the extension `.Tsltest` **directly inside the folder**. All files in a folder will be loaded into the
2. Add files with the extension `.ttsl` **directly inside the folder**. All files in a folder will be loaded into the
same workspace, so they can reference each other. Files in different folders are loaded into different workspaces, so
they cannot reference each other.
3. Add the Safe-DS code that you want to test to the files.
3. Add the TTSL code that you want to test to the files.
4. Surround entire nodes whose value you want to check with test markers, e.g. `1 + 2`.
5. For each pair of test markers, add a test comment with one of the formats listed below. Test comments and test
markers are mapped to each other by their position in the file, i.e. the first test comment corresponds to the first
Expand Down
4 changes: 2 additions & 2 deletions docs/development/scoping-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ test.

If you want to skip a test, add the prefix `skip-` to the folder name.

2. Add files with the extension `.Tsltest` **directly inside
2. Add files with the extension `.ttsl` **directly inside
the folder**. All files in a folder will be loaded into the same workspace, so they can
reference each other. Files in different folders are loaded into different workspaces, so they cannot reference each other.
3. Add the Safe-DS code that you want to test to the files.
3. Add the TTSL code that you want to test to the files.
4. Surround **the name** of any declaration that you want to reference with test markers, e.g. `class »C«`. Add a
comment in the preceding line with the following format (replace `<id>` with some unique identifier):
```ts
Expand Down
4 changes: 2 additions & 2 deletions docs/development/typing-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ test.

If you want to skip a test, add the prefix `skip-` to the folder name.

2. Add files with the extension `.Tsltest` **directly inside the folder**. All files in a folder will be loaded into the
2. Add files with the extension `.ttsl` **directly inside the folder**. All files in a folder will be loaded into the
same workspace, so they can reference each other. Files in different folders are loaded into different workspaces, so
they cannot reference each other.
3. Add the Safe-DS code that you want to test to the files.
3. Add the TTSL code that you want to test to the files.
4. Surround entire nodes whose type you want to check with test markers, e.g. `1 + 2`. For declarations, it is also
possible to surround only their name, e.g. `class »C«`.
5. For each pair of test markers, add a test comment with one of the formats listed below. Test comments and test
Expand Down
4 changes: 2 additions & 2 deletions docs/development/validation-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ validation test.

If you want to skip a test, add the prefix `skip-` to the folder name.

2. Add files with the extension `.Tsltest`, `.Tslpipe`, or `.Tslstub` **directly inside the folder**. All files in a
2. Add files with the extension `.ttsl`, `.Tslpipe`, or `.Tslstub` **directly inside the folder**. All files in a
folder will be loaded into the same workspace, so they can reference each other. Files in different folders are
loaded into different workspaces, so they cannot reference each other.
3. Add the Safe-DS code that you want to test to the files.
3. Add the TTSL code that you want to test to the files.
4. Specify the expected validation results using test comments (see [below](#format-of-test-comments)) and test
markers (e.g. `fun »F«()`). The test comments are used to specify
* the presence or absence of an issue,
Expand Down
4 changes: 2 additions & 2 deletions docs/language/common/aggregations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
To _aggregate_ [data][data] [grouped by][grouped by] an [ID][id] over a [function][functions] we can use the aggregation expression:

```ttsl
aggregate sum of salery, taxes groupedBy hh_id
aggregate sum of taxes groupedBy hh_id
```

Let's break down the syntax:

- The keyword `#!ttsl aggregate`.
- The [function][functions] to be executed on the grouped values (here `#!ttsl sum`).
- The keyword `#!ttsl of`.
- A [List][List] of [data][data] separated by a comma (here `#!ttsl salery, taxes`).
- The [data][data] that is aggregated (here `#!ttsl taxes`).
- The [grouped by][grouped by] modifier (here with the id `#!ttsl hh_id`).

An aggregation can be executed on one or multiple data values that are all connected to the same given [ID][id].
Expand Down
2 changes: 1 addition & 1 deletion docs/language/common/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ In order to interpolate text with other computed values, use [template strings](

### Boolean Literals

To work with truthiness, Safe-DS has the two boolean literals `#!ttsl false` and `#!ttsl true`.
To work with truthiness, TTSL has the two boolean literals `#!ttsl false` and `#!ttsl true`.

### `#!ttsl null` Literal

Expand Down
4 changes: 2 additions & 2 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ nav:

theme:
name: material
logo: https://raw.githubusercontent.com/Safe-DS/.github/main/branding/safe-ds_logo_rounded.svg
favicon: https://raw.githubusercontent.com/Safe-DS/.github/main/branding/safe-ds_logo_rounded.svg
logo: https://raw.githubusercontent.com/TTSL/.github/main/branding/ttsl_logo_rounded.svg
favicon: https://raw.githubusercontent.com/TTSL/.github/main/branding/ttsl_logo_rounded.svg
palette:
# Palette toggle for light mode
- scheme: default
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/ttsl-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Safe-DS CLI
# TTSL CLI

```txt
Usage: cli [options] [command]
Expand All @@ -8,7 +8,7 @@ Options:
-h, --help display help for command

Commands:
check [options] <paths...> check Safe-DS code
check [options] <paths...> check TTSL code
generate [options] <paths...> generate Python code
help [command] display help for command
```
4 changes: 2 additions & 2 deletions packages/ttsl-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"programming language",
"static checking"
],
"homepage": "https://dsl.safeds.com",
"homepage": "https://dsl.TTSL.com",
"bugs": {
"url": "https://github.com/SEEDS-Group/TTSL/issues"
},
Expand All @@ -25,7 +25,7 @@
},
"type": "module",
"bin": {
"safe-ds": "./bin/cli.js"
"ttsl": "./bin/cli.js"
},
"exports": null,
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/ttsl-cli/src/cli/check.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSafeDsServices } from '@ttsl/lang';
import { createTTSLServices } from '@ttsl/lang';
import { NodeFileSystem } from 'langium/node';
import { extractDocuments } from '../helpers/documents.js';
import { diagnosticToString, getDiagnostics } from '../helpers/diagnostics.js';
Expand All @@ -7,7 +7,7 @@ import chalk from 'chalk';
import { ExitCode } from './exitCode.js';

export const check = async (fsPaths: string[], options: CheckOptions): Promise<void> => {
const services = (await createSafeDsServices(NodeFileSystem)).SafeDs;
const services = (await createTTSLServices(NodeFileSystem)).TTSL;

let errorCount = 0;

Expand Down
4 changes: 2 additions & 2 deletions packages/ttsl-cli/src/cli/exitCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export enum ExitCode {
NotAFileOrDirectory = 101,

/**
* The given file does not have a Safe-DS extension.
* The given file does not have a TTSL extension.
*/
FileWithoutSafeDsExtension = 102,
FileWithoutTTSLExtension = 102,

/**
* The given file has errors.
Expand Down
6 changes: 3 additions & 3 deletions packages/ttsl-cli/src/cli/format.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSafeDsServices } from '@ttsl/lang';
import { createTTSLServices } from '@ttsl/lang';
import { NodeFileSystem } from 'langium/node';
import { extractDocuments } from '../helpers/documents.js';
import { exitIfDocumentHasSyntaxErrors } from '../helpers/diagnostics.js';
Expand All @@ -7,7 +7,7 @@ import { writeFile } from 'node:fs/promises';
import chalk from 'chalk';

export const format = async (fsPaths: string[]): Promise<void> => {
const services = (await createSafeDsServices(NodeFileSystem)).SafeDs;
const services = (await createTTSLServices(NodeFileSystem)).TTSL;
const documents = await extractDocuments(services, fsPaths);

// Exit if any document has syntax errors before formatting code
Expand All @@ -31,5 +31,5 @@ export const format = async (fsPaths: string[]): Promise<void> => {
await writeFile(document.uri.fsPath, editedDocument);
}

console.log(chalk.green(`Safe-DS code formatted successfully.`));
console.log(chalk.green(`TTSL code formatted successfully.`));
};
4 changes: 2 additions & 2 deletions packages/ttsl-cli/src/cli/generate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSafeDsServices } from '@ttsl/lang';
import { createTTSLServices } from '@ttsl/lang';
import chalk from 'chalk';
import { URI } from 'langium';
import { NodeFileSystem } from 'langium/node';
Expand All @@ -9,7 +9,7 @@ import { makeParentDirectoriesSync } from '../helpers/files.js';
import { exitIfDocumentHasErrors } from '../helpers/diagnostics.js';

export const generate = async (fsPaths: string[], options: GenerateOptions): Promise<void> => {
const services = (await createSafeDsServices(NodeFileSystem)).SafeDs;
const services = (await createTTSLServices(NodeFileSystem)).TTSL;
const documents = await extractDocuments(services, fsPaths);

// Exit if any document has errors before generating code
Expand Down
4 changes: 2 additions & 2 deletions packages/ttsl-cli/src/cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ program
.command('check')
.argument('<paths...>', `list of files or directories to check`)
.option('-s, --strict', 'whether the program should fail on warnings', false)
.description('check Safe-DS code')
.description('check TTSL code')
.action(check);

// Format command
program
.command('format')
.argument('<paths...>', `list of files or directories to format`)
.description('format Safe-DS code')
.description('format TTSL code')
.action(format);

// Generate command
Expand Down
10 changes: 5 additions & 5 deletions packages/ttsl-cli/src/helpers/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export const extractDocuments = async function (
};

/**
* Processes the given paths and returns the corresponding URIs. Files must have a Safe-DS extension. Directories are
* Processes the given paths and returns the corresponding URIs. Files must have a TTSL extension. Directories are
* traversed recursively.
*
* @returns The URIs of the matched files.
*/
export const processPaths = (services: LangiumServices, fsPaths: string[]): Result<URI[], ProcessPathsError> => {
// Safe-DS file extensions
// TTSL file extensions
const extensions = services.LanguageMetaData.fileExtensions;
const pattern = `**/*{${extensions.join(',')}}`;

Expand All @@ -55,11 +55,11 @@ export const processPaths = (services: LangiumServices, fsPaths: string[]): Resu
// Path must be a file or directory
const stat = fs.lstatSync(fsPath);
if (stat.isFile()) {
// File must have a Safe-DS extension
// File must have a TTSL extension
if (!extensions.includes(path.extname(fsPath))) {
return Result.err({
message: `File '${fsPath}' does not have a Safe-DS extension.`,
code: ExitCode.FileWithoutSafeDsExtension,
message: `File '${fsPath}' does not have a TTSL extension.`,
code: ExitCode.FileWithoutTTSLExtension,
});
}

Expand Down
Loading
Loading