Skip to content

Commit

Permalink
refactor: move modules into their own subdirectory (#745)
Browse files Browse the repository at this point in the history
* refactor: move modules into their own subdirectory

* docs: fixed newly broken links
  • Loading branch information
Ellpeck authored Mar 28, 2024
1 parent 2a099b5 commit 5d2c1fa
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "statistics"]
path = statistics
path = modules/statistics
url = https://github.com/Code-Inspect/flowr-statistics
[submodule "benchmark"]
path = benchmark
path = modules/benchmark
url = https://github.com/Code-Inspect/flowr-benchmark
[submodule "cli"]
path = cli
path = modules/cli
url = https://github.com/Code-Inspect/flowr-cli
Submodule cli updated from 000000 to b1df5a
12 changes: 6 additions & 6 deletions wiki/Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sequenceDiagram
</details>

After launching, for example with `docker run -it --rm flowr --server`&nbsp;(🐳️), simply connecting should present you with a `hello` message, that amongst others should reveal the versions of&nbsp;*flowR* and&nbsp;R running, using the [semver 2.0](https://semver.org/spec/v2.0.0.html) versioning scheme.
See the implementation of the [hello message](https://github.com/Code-Inspect/flowr/tree/main/cli/src/repl/server/messages/hello.ts) for more information regarding the contents of the message.
See the implementation of the [hello message](https://github.com/Code-Inspect/flowr-cli/blob/main/src/repl/server/messages/hello.ts) for more information regarding the contents of the message.


<details open>
Expand Down Expand Up @@ -111,7 +111,7 @@ The message can contain a `filetoken`, which is used to identify the file in lat
Furthermore, it must contain either a `content` field to directly pass the file's content or a `filepath` field which contains the path to the file (which must be accessible for the server to be useful).
If you add the `id` field, the answer will use the same `id` so you can match requests and the corresponding answers.
See the implementation of the [request-file-analysis message](https://github.com/Code-Inspect/flowr/tree/main/cli/src/repl/server/messages/analysis.ts) for more information.
See the implementation of the [request-file-analysis message](https://github.com/Code-Inspect/flowr-cli/blob/main/src/repl/server/messages/analysis.ts) for more information.


<details open>
Expand Down Expand Up @@ -445,7 +445,7 @@ The `results` field of the response effectively contains three keys of importanc


You receive an error if, for whatever reason, the analysis fails (e.g., the message or code you sent contained syntax errors).
It contains a human-readable description *why* the analysis failed (see the [error message](https://github.com/Code-Inspect/flowr/tree/main/cli/src/repl/server/messages/error.ts) implementation for more details).
It contains a human-readable description *why* the analysis failed (see the [error message](https://github.com/Code-Inspect/flowr-cli/blob/main/src/repl/server/messages/error.ts) implementation for more details).

<details>
<summary>Example Error Message</summary>
Expand Down Expand Up @@ -743,7 +743,7 @@ sequenceDiagram

In order to slice, you have to send a file analysis request first. The `filetoken` you assign is of use here as you can re-use it to repeatedly slice the same file.
Besides that, you only need to add an array of slicing criteria, using one of the formats described on the [terminology wiki page](https://github.com/Code-Inspect/flowr/wiki/Terminology#slicing-criterion) (however, instead of using `;`, you can simply pass separate array elements).
See the implementation of the [request-slice message](https://github.com/Code-Inspect/flowr/tree/main/cli/src/repl/server/messages/slice.ts) for more information.
See the implementation of the [request-slice message](https://github.com/Code-Inspect/flowr-cli/blob/main/src/repl/server/messages/slice.ts) for more information.

<details open>
<summary>Example Request</summary>
Expand Down Expand Up @@ -851,7 +851,7 @@ We strongly recommend you to make use of the `id` field to link answers with req
The answer on such a request is different from the other messages as the `request-repl-execution` message may be sent multiple times. This allows to better handle requests that require more time but already output intermediate results.
You can detect the end of the execution by receiving the `end-repl-execution` message.

See the implementation of the [request-repl-execution message](https://github.com/Code-Inspect/flowr/tree/main/cli/src/repl/server/messages/repl.ts) for more information.
See the implementation of the [request-repl-execution message](https://github.com/Code-Inspect/flowr-cli/blob/main/src/repl/server/messages/repl.ts) for more information.
The semantics of the error message are similar to other messages.

<details open>
Expand Down Expand Up @@ -1090,7 +1090,7 @@ Whenever this name appears, you may substitute this with whatever name fits your

The `initialExampleInfo` type holds the initial values for each counter that you want to maintain during the feature extraction (they will usually be initialized with 0). The resulting `ExampleInfo` type holds the structure of the data that is to be counted. Due to the vast amount of data processed, information like the name and location of a function call is not stored here, but instead written to disk (see below).

Every new feature must be of the [`Feature<Info>`](https://github.com/Code-Inspect/flowr/tree/main/statistics/src/features/feature.ts) type, with `Info` referring to a `FeatureInfo` (like `ExampleInfo` in this example). Next to a `name` and a `description`, each Feature must provide:
Every new feature must be of the [`Feature<Info>`](https://github.com/Code-Inspect/flowr-statistics/blob/main/src/features/feature.ts) type, with `Info` referring to a `FeatureInfo` (like `ExampleInfo` in this example). Next to a `name` and a `description`, each Feature must provide:

- a processor that extracts the information from the input, adding it to the existing information.
- a function returning the initial value of the information (in this case, `initialExampleInfo`).
Expand Down
4 changes: 2 additions & 2 deletions wiki/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ The [mermaid](https://mermaid.js.org/) diagram above presents the architecture o
Primarily, *flowR* provides a backward [program slicer](https://en.wikipedia.org/wiki/Program_slicing) for the [*R*](https://www.r-project.org/) programming language, which is available with the corresponding [slicer](https://github.com/Code-Inspect/flowr/tree/main/src/slicing) module and exposed by the [`slicer`](#generate-static-slices) script.
Its subcomponents (like the custom [R bridge](https://github.com/Code-Inspect/flowr/tree/main/src/r-bridge) or the static [dataflow analysis]("https://github.com/Code-Inspect/flowr/tree/main/src/dataflow)) are not important if you simply wish to use *flowR*.

Check warning on line 53 in wiki/Overview.md

View workflow job for this annotation

GitHub Actions / build

link checker warning

"https://github.com/Code-Inspect/flowr/tree/main/src/dataflow. Link type is not implemented yet and cannot be checked.

Check warning on line 53 in wiki/Overview.md

View workflow job for this annotation

GitHub Actions / build

link checker warning

"https://github.com/Code-Inspect/flowr/tree/main/src/dataflow. Link type is not implemented yet and cannot be checked.

The [benchmarker](https://github.com/Code-Inspect/flowr/tree/main/benchmark/src) module is only of interest if you want to benchmark/measure the runtime performance and reduction of the slicer. It is available with the [`benchmark`](#benchmark-the-slicer) script.
The [benchmarker](https://github.com/Code-Inspect/flowr-benchmark/tree/main/src) module is only of interest if you want to benchmark/measure the runtime performance and reduction of the slicer. It is available with the [`benchmark`](#benchmark-the-slicer) script.

The [statistics](https://github.com/Code-Inspect/flowr/tree/main/statistics/src) module is mostly independent of the slicer and can be used to analyze R files regarding their use of function definitions, assignments, and more. It is used to identify common patterns in R code and is available with the [`statistics`](#generate-usage-statistics-of-r-code) script.
The [statistics](https://github.com/Code-Inspect/flowr-statistics/tree/main/src) module is mostly independent of the slicer and can be used to analyze R files regarding their use of function definitions, assignments, and more. It is used to identify common patterns in R code and is available with the [`statistics`](#generate-usage-statistics-of-r-code) script.

The [core](https://github.com/Code-Inspect/flowr/tree/main/src/core) module contains *flowR*'s read-eval-print loop (REPL) and *flowR*'s server. Furthermore, it contains the root definitions of how *flowR* slices (see the [interface](https://github.com/Code-Inspect/flowr/wiki/Interface) wiki page for more information).

Expand Down

0 comments on commit 5d2c1fa

Please sign in to comment.