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

Dataflow v2 #526

Merged
merged 473 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
473 commits
Select commit Hold shift + click to select a range
ddb191c
tests: include if-then-else with tests
EagleoutIce Feb 10, 2024
ebb3bc0
test: label first for-loop
EagleoutIce Feb 10, 2024
67c7785
feat(desguar): for parser
EagleoutIce Feb 10, 2024
ca071be
test(desguar): for with comments test
EagleoutIce Feb 10, 2024
986296f
feat-fix: corrected wrongly used label 'normal' in labeled tests
Core5563 Feb 11, 2024
921614f
feat(test): labeled tests defined in #648
Ehcsan Feb 13, 2024
5ad0ffe
Merge branch 'main' into dataflow-v2
EagleoutIce Feb 21, 2024
02ddc47
lint-fix: handle linter errors
EagleoutIce Feb 21, 2024
2fe98e7
Merge branch 'dataflow-v2' into 572-normalize-v2-desugaring
EagleoutIce Feb 21, 2024
c2ab66b
lint-fix: dealing with minor linter issues
EagleoutIce Feb 21, 2024
3222734
feat: print uncovered ids as well in the end report
EagleoutIce Feb 21, 2024
d16bb03
lint-fix: minor code patches
EagleoutIce Feb 21, 2024
5303fd2
Test Capability Coverage Report Show Uncovered (#666)
EagleoutIce Feb 21, 2024
50a9af0
Merge branch 'dataflow-v2' into 572-normalize-v2-desugaring
EagleoutIce Feb 21, 2024
48b362e
lint-fix(label): handle linter errors
EagleoutIce Feb 21, 2024
de21623
refactor: improve label summary banner with a prefix text
EagleoutIce Feb 21, 2024
2bc66cc
refactor: creatly improve test tree output
EagleoutIce Feb 21, 2024
4f43728
648 pd labeling of tests (#654)
EagleoutIce Feb 21, 2024
60340b1
Merge branch 'dataflow-v2' into 646-ab-labeling-of-tests
EagleoutIce Feb 21, 2024
00ba290
646 ab labeling of tests (#650)
EagleoutIce Feb 21, 2024
deb6be6
Merge branch 'dataflow-v2' into 572-normalize-v2-desugaring
EagleoutIce Feb 21, 2024
99344fe
refactor: remove extra space for non-support capabilities in label print
EagleoutIce Feb 21, 2024
5b44da5
test: more labels for the access tests
EagleoutIce Feb 21, 2024
eef7c7d
wip(label): work on contexts for labels
EagleoutIce Feb 21, 2024
1972e12
feat: new type id filter to improve label autocompletion
EagleoutIce Feb 24, 2024
de5f640
Test Labels: Only Autocomplete Ids We Support (#689)
EagleoutIce Feb 24, 2024
890ebd5
Merge branch 'main' into dataflow-v2
EagleoutIce Feb 24, 2024
648080b
feat-fix: post-merge patches
EagleoutIce Feb 24, 2024
fb96a51
lint-fix: handle linter errors
EagleoutIce Feb 24, 2024
c5cf900
Merge branch 'dataflow-v2' into 572-normalize-v2-desugaring
EagleoutIce Feb 24, 2024
ca1a5f8
Merge remote-tracking branch 'origin/main' into 572-normalize-v2-desu…
EagleoutIce Feb 25, 2024
6122dfa
Merge remote-tracking branch 'origin/572-normalize-v2-desugaring' int…
EagleoutIce Feb 25, 2024
06a376c
lint-fix: handle linter erros
EagleoutIce Feb 25, 2024
8ebbe2c
feat: context support for test labels
EagleoutIce Feb 25, 2024
d314791
feat(test): improve compacted label print out
EagleoutIce Feb 25, 2024
b51b8ae
wip(test): `enableLog` helper function for convenience
EagleoutIce Feb 25, 2024
f7453e8
wip(parse): root collection as part of parse
EagleoutIce Feb 25, 2024
83a20c7
feat-fix: improve exprlist split for exprs
EagleoutIce Feb 25, 2024
1cf6890
refactor(tests): shell after location
EagleoutIce Feb 25, 2024
0c45eac
wip: trying to improve retriever performance [skip ci]
EagleoutIce Feb 25, 2024
80479a3
refactor: improve parsing for large strings
EagleoutIce Feb 25, 2024
ecacaec
refactor: use copy-`sort`
EagleoutIce Feb 26, 2024
008b223
test: labels for grouping
EagleoutIce Feb 26, 2024
d22015f
feat(test): more labeling and semi/newline capas
EagleoutIce Feb 26, 2024
cce5e8e
test(expr-lists): more labels and v2
EagleoutIce Feb 26, 2024
95b76e0
feat: ruidimentary fn support
EagleoutIce Feb 26, 2024
1a4a32a
feat: continue with anonymous calls and definitions
EagleoutIce Feb 27, 2024
0d5507d
feat: support double anonymous calls
EagleoutIce Feb 27, 2024
f378760
feat: support for f-calls, next, and break
EagleoutIce Feb 29, 2024
37ed566
test: label function-definition tests
EagleoutIce Feb 29, 2024
233563e
feat(tests): working on nested parenthesis ops
EagleoutIce Feb 29, 2024
4d739f2
feat: incorporate comment parsing
EagleoutIce Feb 29, 2024
05a5eb9
test: label operations
EagleoutIce Feb 29, 2024
6dcd869
refactor: clean up old comments
EagleoutIce Feb 29, 2024
a3ab3ca
refactor: clean up empty arguments
EagleoutIce Feb 29, 2024
c33c1c9
test: run parsing for snippet
EagleoutIce Mar 1, 2024
52b1c97
refactor: todo movement
EagleoutIce Mar 1, 2024
371f7b1
refactor(wip): enforcing list-based `assertAst`
EagleoutIce Mar 1, 2024
1d48041
test: port remaining `assertAst` calls
EagleoutIce Mar 1, 2024
994e971
refactor: clean up todos
EagleoutIce Mar 1, 2024
d4b7c63
Normalize V2 With Desugaring (#573)
EagleoutIce Mar 1, 2024
5ec4dd1
Merge branch 'main' into dataflow-v2
EagleoutIce Mar 1, 2024
5ea8e1b
refactor: pipeline executor for dataflow execution
EagleoutIce Mar 1, 2024
a8151da
feat: start with dataflow test transition
EagleoutIce Mar 1, 2024
183b053
refactor(scope): remove local and global scope flags
EagleoutIce Mar 1, 2024
5f075cd
refactor: create commands with flatMap
EagleoutIce Mar 1, 2024
fc2b440
refactor: clean up expensive traces for logging
EagleoutIce Mar 1, 2024
58fb630
refactor: remove idmap from for-call slice
EagleoutIce Mar 1, 2024
3f46dec
refactor: unify logging checks
EagleoutIce Mar 1, 2024
d8c79f8
refactor: ensure `flowr_get` command in each r session
EagleoutIce Mar 1, 2024
4e63821
refactor: continue to clean up logging
EagleoutIce Mar 1, 2024
d2e95be
refactor: readonly qualifier for R shell
EagleoutIce Mar 1, 2024
3d7618a
refactor: remove coninue on error and clear environment
EagleoutIce Mar 1, 2024
50eb666
Revert "refactor: remove coninue on error and clear environment"
EagleoutIce Mar 1, 2024
fa5dcc9
wip: benchmarking instrumentation
EagleoutIce Mar 1, 2024
b875799
refactor: more instrumentation
EagleoutIce Mar 1, 2024
c20f9c8
refactor: remove testing instrumentation
EagleoutIce Mar 1, 2024
ef295e7
wip: infrastructure for df analysis with v2
EagleoutIce Mar 1, 2024
0b10e09
refactor(dataflow): argument handling
EagleoutIce Mar 2, 2024
7609fcc
test: first draft of access test
EagleoutIce Mar 2, 2024
990a62f
refactor: cleaning up v2 function call processors
EagleoutIce Mar 2, 2024
15bdf1f
feat: undo normalize v2
EagleoutIce Mar 2, 2024
38b3f4b
refactor: clean up test shell close await
EagleoutIce Mar 2, 2024
9ee0708
refactor: clean up normalization location
EagleoutIce Mar 2, 2024
61fb4c4
refactor: remove operator flavours
EagleoutIce Mar 2, 2024
a8e22a2
refactor: clean up xml key retrieval
EagleoutIce Mar 2, 2024
50ba31e
refactor: working on retrieve data performance
EagleoutIce Mar 2, 2024
ad40ba2
refactor: remove time tracking for flowr_get_ast
EagleoutIce Mar 2, 2024
e2fc7b5
refactor: improve retrieve data performance
EagleoutIce Mar 2, 2024
4477ee7
refactor: clean up v2 dataflow instance
EagleoutIce Mar 2, 2024
890c26b
refactor(environments): one global built-in env!
EagleoutIce Mar 2, 2024
1b45da2
refactor: clean up benchmark-slicer retrieval
EagleoutIce Mar 3, 2024
4385124
wip: big function refactoring
EagleoutIce Mar 3, 2024
f21f991
refactor: move `source` call to known functions
EagleoutIce Mar 3, 2024
c4d8fe0
refactor: env-optimize todo
EagleoutIce Mar 3, 2024
ac9a7f4
refactor: clean-up old source functions
EagleoutIce Mar 3, 2024
f218997
wip: working on porting access to call
EagleoutIce Mar 3, 2024
c50349c
wip: linking parse of access
EagleoutIce Mar 3, 2024
f74c4c7
wip: first access test working
EagleoutIce Mar 3, 2024
e02a50e
lint-fix: handle linter problems
EagleoutIce Mar 3, 2024
3a9e2ec
refactor(mermaid): improve printed env readability
EagleoutIce Mar 3, 2024
7a87f8e
wip: working on acess definitions
EagleoutIce Mar 3, 2024
6e2c65b
wip: well... not working
EagleoutIce Mar 3, 2024
aabe38b
wip: porting assignment to built-in call
EagleoutIce Mar 3, 2024
b256ec6
wip: translate assignment tests
EagleoutIce Mar 3, 2024
52f8f4b
lint-fix: handle minor linter erros
EagleoutIce Mar 3, 2024
d834e68
feat-fix: correct processor for `source`
EagleoutIce Mar 3, 2024
559f364
doc: clean up `@link` usage
EagleoutIce Mar 4, 2024
2176d4a
feat: return value of `return` and `print`
EagleoutIce Mar 4, 2024
a8fd53c
wip: further work on tests
EagleoutIce Mar 5, 2024
f96a29e
feat: support for if-then(-else) as builtin
EagleoutIce Mar 6, 2024
fbf5601
feat: handle lazy bin ops
EagleoutIce Mar 8, 2024
c7acac4
feat: built in break and next
EagleoutIce Mar 8, 2024
0679a81
lint: deal with auto-fixable linter issues
EagleoutIce Mar 8, 2024
0cb1b0d
wip: working on operator processing
EagleoutIce Mar 8, 2024
c50901e
doc: add missing closing parenthesis
EagleoutIce Mar 8, 2024
ade2b15
feat(lint): handling operators
EagleoutIce Mar 8, 2024
6590419
refactor: ignore temp logs in root dir
EagleoutIce Mar 8, 2024
87610c5
refactor: basic extractor mappings for named fn calls
EagleoutIce Mar 8, 2024
a40fb9d
wip: working on for-loop processor
EagleoutIce Mar 8, 2024
708ec28
feat: support `for`, `repeat`, and `while` with new built-in env
EagleoutIce Mar 8, 2024
ff0c320
feat: move function definitions to built-in
EagleoutIce Mar 8, 2024
e04ef11
refactor: remove redundant eslint-disable
EagleoutIce Mar 8, 2024
8b68d88
refactor: shorten named call processor name
EagleoutIce Mar 8, 2024
0c1e60a
refactor: clean up df arguments and info
EagleoutIce Mar 8, 2024
8523734
doc: plan to handle parens as unary ops
EagleoutIce Mar 8, 2024
8bc0ca4
feat: group normalization
EagleoutIce Mar 8, 2024
fa9d178
refactor: handle groupings in df
EagleoutIce Mar 8, 2024
52a8634
refactor: starting Rshell client as slave
EagleoutIce Mar 8, 2024
6ae2b82
refactor: move brace and parenthesis handler into normalization
EagleoutIce Mar 8, 2024
fa2b348
refactor: clean up `normalizeMappedWithoutSemicolonBasedOnType`
EagleoutIce Mar 9, 2024
b27ffd5
refactor: mark `NamedXmlBasedJson` fields as `readonly`
EagleoutIce Mar 9, 2024
4eee20b
refactor: clean up operators
EagleoutIce Mar 9, 2024
3af2419
feat: suffix test label categories
EagleoutIce Mar 9, 2024
2b4cae0
refactor(test): incorporate group parsings into normalization tests
EagleoutIce Mar 9, 2024
7a15473
refactor(test): start to work on df tests
EagleoutIce Mar 9, 2024
1fba8bc
Merge branch 'main' into dataflow-v2
EagleoutIce Mar 9, 2024
2fd36c1
feat: improve call in graph builder (closes #700)
EagleoutIce Mar 9, 2024
6bb55f5
lint: address linter problems
EagleoutIce Mar 9, 2024
b40a4df
feat: detect expression lists with grouping
EagleoutIce Mar 9, 2024
04c67ff
test: migrate unary and binary op dataflow tests
EagleoutIce Mar 9, 2024
2fe6ef3
refactor: outsource built-in environment to new file
EagleoutIce Mar 9, 2024
7ebc96e
refactor: clean up built in memory register (closes #712)
EagleoutIce Mar 9, 2024
79c65dc
wip: work on df assignment tests
EagleoutIce Mar 9, 2024
4ad1f3a
feat: constant values in df graph (closes #713)
EagleoutIce Mar 9, 2024
47f37b0
feat: start to handle replacement functions
EagleoutIce Mar 9, 2024
aa3954c
wip: register replacement functions
EagleoutIce Mar 9, 2024
7660271
test: migrate constant-access tests
EagleoutIce Mar 9, 2024
052d35c
refactor: improve mermaid rendering and trnasport chaind br access test
EagleoutIce Mar 9, 2024
2e0975f
doc: install todo for future me
EagleoutIce Mar 9, 2024
16c6c02
doc: another todo for loop returns
EagleoutIce Mar 9, 2024
ba8622b
refactor: clear normalize prefix for normalize files
EagleoutIce Mar 9, 2024
6bf251d
refactor: clean up binary normalization
EagleoutIce Mar 9, 2024
5c768cd
refactor: process prefix
EagleoutIce Mar 9, 2024
0b753bd
feat: support string assignments in new df
EagleoutIce Mar 9, 2024
28ca04c
refactor: clean up assignments
EagleoutIce Mar 9, 2024
ecd624e
feat: trigger for replacement functions
EagleoutIce Mar 9, 2024
5060d79
refactor: improve mermaid url config
EagleoutIce Mar 9, 2024
71cb61b
refactor: do not print environments when empty (besides built-in)
EagleoutIce Mar 9, 2024
f8585cc
test: migrate assign-on-access test w. replacement fn
EagleoutIce Mar 9, 2024
2322450
refactor: df diff now alllows call/def missmatches
EagleoutIce Mar 9, 2024
0eac4e5
refactor: do not flip arguments for assignment functions
EagleoutIce Mar 10, 2024
0e02b35
feat-fix: argument process order for assignments
EagleoutIce Mar 10, 2024
363f917
feat: generalize dataflow graph over rich edge and vertex types
EagleoutIce Mar 10, 2024
f162848
feat: diff reports can be typed
EagleoutIce Mar 10, 2024
29f15d1
feat-fix: correct built-in argument return index `1` -> `0`
EagleoutIce Mar 10, 2024
660552e
perf: reduce number of environments persisted in df graph
EagleoutIce Mar 10, 2024
5df4fc4
perf: mark built-in-only functions
EagleoutIce Mar 10, 2024
cc4c167
refactor: clean up import
EagleoutIce Mar 10, 2024
516a918
perf: reduce source range memory footprint
EagleoutIce Mar 10, 2024
2a190eb
perf: improve edge type check for slicer
EagleoutIce Mar 10, 2024
2b55f7f
perf: filter built-in during slicing
EagleoutIce Mar 10, 2024
adb9348
refactor: type basics for cd in vertices
EagleoutIce Mar 10, 2024
b283510
refactor: slicer no longer incl. `cd` explicitly (new edges)
EagleoutIce Mar 10, 2024
bb936a5
feat: basic cd edges for built in defs
EagleoutIce Mar 10, 2024
db10278
perf: deny built-in from entering df queue
EagleoutIce Mar 10, 2024
6f85d47
refactor: clear test prefix for df tests
EagleoutIce Mar 10, 2024
971311f
refactor: further reduce environment passage
EagleoutIce Mar 10, 2024
1defb99
feat: mark problematic vertices and edges (relates to #494)
EagleoutIce Mar 10, 2024
09c4bd9
feat: some color for invalid refs (relates to #494)
EagleoutIce Mar 10, 2024
308c9b3
refactor: improve mermaid diff output
EagleoutIce Mar 10, 2024
f770db6
feat-fix: include `onlyBuiltin` as part of diff
EagleoutIce Mar 10, 2024
b8daa6d
feat: mermaid includes value constants
EagleoutIce Mar 10, 2024
79257aa
feat-fix: denote control-dependencies correctly in diff
EagleoutIce Mar 10, 2024
88f68da
wip: function-support for `for` and `while`
EagleoutIce Mar 10, 2024
fecdbda
feat: recover broken dataflow graph builder setups (and calling policy)
EagleoutIce Mar 10, 2024
f581bfe
feat-fix: extend md sanitation to `<` and `>`
EagleoutIce Mar 10, 2024
f544153
feat-fix: correctly handle manual argument linkages w/o `-arg`
EagleoutIce Mar 10, 2024
f7518f7
feat: improve mermaid dfg to allow pass-along edge counts
EagleoutIce Mar 10, 2024
dae1ed3
wip: post-patching cds seems to be a horrible approach :sparkles:
EagleoutIce Mar 10, 2024
82e2b56
feat: top-down control-flow-dependency passing (closes #629)
EagleoutIce Mar 10, 2024
d6f12d1
feat: v2 support for if-conditionals
EagleoutIce Mar 11, 2024
b51e755
refactor: dataflow-builder-printer now orders same-* edge fingerprints
EagleoutIce Mar 11, 2024
5bbbb8a
feat: elevate r-expr-list grouping
EagleoutIce Mar 11, 2024
f39910a
feat: pass along cfg state in df (relates to #629)
EagleoutIce Mar 11, 2024
a30f52a
feat: pseudo-handle quotes (closes #204)
EagleoutIce Mar 11, 2024
533f83f
refactor: integrate cfg mods into built-ins
EagleoutIce Mar 11, 2024
ddce4c5
refactor: adapt if-tests for return
EagleoutIce Mar 11, 2024
ba64226
feat: handle non-strict operators
EagleoutIce Mar 11, 2024
99ab4be
test: migrate atomic tests
EagleoutIce Mar 11, 2024
f5580ae
refactor: add remaining labels for atomic tests
EagleoutIce Mar 11, 2024
fb5ee5c
wip: working on recovery of redundant reads
EagleoutIce Mar 11, 2024
83a60e5
lint-fix: handle linter problems
EagleoutIce Mar 11, 2024
4a66bfe
Merge branch 'main' into dataflow-v2
EagleoutIce Mar 11, 2024
260919b
wip: patching replacement built in
EagleoutIce Mar 12, 2024
16f102e
lint-fix: handle linter problems
EagleoutIce Mar 12, 2024
fb7e6ca
Merge branch 'main' into dataflow-v2
EagleoutIce Apr 19, 2024
d964b2c
refactor: first post-merge round of patches
EagleoutIce Apr 19, 2024
b039bde
doc(log): update log documentation to exclude old serverLog
EagleoutIce Apr 19, 2024
c497b73
doc: wip todo
EagleoutIce Apr 22, 2024
898e531
refactor(test): patched df2 atomic tests
EagleoutIce Apr 25, 2024
91b92ee
refactor: reads in if
EagleoutIce Apr 25, 2024
fc40e08
wip: fn def tracing
EagleoutIce Apr 26, 2024
12093bc
wip: takeover
EagleoutIce Apr 28, 2024
93a12f5
wip: tried wihtout another edge but decide for nse
EagleoutIce Apr 28, 2024
7d5d005
feat(df): introduce non-standard-evaluation edge type
EagleoutIce Apr 28, 2024
f1e4a53
wip: trying to get everything to work
EagleoutIce Apr 29, 2024
2604b40
refactor: no call for top-level expr list
EagleoutIce Apr 30, 2024
c93a287
refactor: allow to set only builtin on calls (printer)
EagleoutIce Apr 30, 2024
eb44f5d
refactor(slice): clean up slicing code-base
EagleoutIce May 1, 2024
ebe4edf
refactor: introduce vertex-type enum
EagleoutIce May 1, 2024
d6aeb55
refactor: static slicing implementation
EagleoutIce May 1, 2024
cd84164
refactor(slice): outsource return handling
EagleoutIce May 1, 2024
5301b30
feat: introduce depth
EagleoutIce May 1, 2024
d202fbc
feat(wip): big arg handling overhaul
EagleoutIce May 1, 2024
1ccd33d
feat: impl v2 to test pass
EagleoutIce May 2, 2024
f11c9db
lint-fix: handle linter problems
EagleoutIce May 2, 2024
864124e
refactor: fallback as `toReversed` not universally present
EagleoutIce May 2, 2024
254b032
wip: fully integrating cfg information into dfg
EagleoutIce May 2, 2024
c0f6bb6
feat(cfg): refine cfg in df2, remove `exit` vertex and `relates` edge
EagleoutIce May 2, 2024
5ee3c06
perf: try to allow numeric ids (wip)
EagleoutIce May 2, 2024
b686459
perf: allow numeric ids
EagleoutIce May 2, 2024
fb57414
feat-fix(df): named arguments are no definitions! (fixes #761)
EagleoutIce May 3, 2024
cfee928
lint-fix: handle minor linter problems
EagleoutIce May 3, 2024
daf34d9
refactor: remove old todo comments
EagleoutIce May 3, 2024
88a3160
refactor(test): clean up main test spec
EagleoutIce May 3, 2024
192f8e8
refactor: improve recovery of constant conditionals
EagleoutIce May 3, 2024
0460501
refactor: improve fn arg linking and label coverage
EagleoutIce May 3, 2024
db555b9
refactor(test): adding more labels
EagleoutIce May 3, 2024
361bac2
lint-fix: handle linter problems
EagleoutIce May 3, 2024
1d676b4
test: fully labeled Calls tests
Ellpeck May 3, 2024
d94619c
test: label reconstruct tests
Ellpeck May 3, 2024
6d7de99
test: label dataflow tests fully
Ellpeck May 3, 2024
57a0965
refactor(test): reference operator database for labels
Ellpeck May 3, 2024
1a35926
refactor: clean up labels in slicing-tests
EagleoutIce May 4, 2024
341b868
doc: update desc of data main file
EagleoutIce May 4, 2024
4e3fa86
refactor(test): slicing criterion labels, and added precedence cap
Ellpeck May 4, 2024
6943ae0
refactor: nse edges for quoting
EagleoutIce May 5, 2024
a6802c9
refactor: another test-label run
EagleoutIce May 5, 2024
dc9d758
doc: outsource todos
EagleoutIce May 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .githooks/check-package-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ changed() {


echo "$changedFiles" | (grep --quiet "package.json" && changed)
exit 0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check for Broken Links
name: Check for Broken Links and Publish Wiki

'on':
push:
Expand All @@ -17,10 +17,19 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Setup the Environment"
uses: Code-Inspect/flowr/.github/actions/setup@main

- name: "Checkout Repository"
uses: actions/checkout@v4
with:
lfs: true

- name: Update the Capabilities Wiki Page
run: |
npm ci
npm run capabilities-markdown --silent > wiki/Capabilities-New.md

- name: Check the README for broken links
uses: becheran/mlc@v0.16.3
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ statistics-out*/
**/*.R.slice
**/*.R.stats
**/*.R*.dataflow
tmp*log*
temp*log*
benchmark-*.json

### VisualStudioCode template
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"scripts": {
"publish-library": "cp .npmignore package.json README.md LICENSE dist/src/ && cd dist/src && npm publish --access public",
"release": "release-it --ci",
"capabilities-markdown": "ts-node src/r-bridge/data/print.ts",
"build": "tsc --project .",
"lint-local": "eslint src/ test/ --rule \"no-warning-comments: off\"",
"lint": "npm run license-compat -- --summary && eslint src/ test/",
Expand All @@ -37,20 +38,23 @@
"mocha": {
"require": "ts-node/register",
"timeout": 60000,
"spec": "test/**/*.spec.ts"
"spec": "test/**/*.spec.ts",
"source-map": true,
"recursive": true,
"exit": true,
"produce-source-map": true
},
"nyc": {
"all": true,
"per-file": true,
"check-coverage": false,
"skip-full": false,
"skip-full": true,
"lines": 70,
"extension": [
".ts"
],
"include": "src/**/*.ts",
"reporter": [
"html",
"text",
"lcov",
"cobertura"
Expand Down Expand Up @@ -216,7 +220,7 @@
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-angular": "^18.4.3",
"@eagleoutice/eslint-config-flowr": "^1.0.2",
"@eagleoutice/eslint-config-flowr": "^1.0.5",
"@stylistic/eslint-plugin": "^1.6.2",
"@stylistic/eslint-plugin-plus": "^1.6.2",
"@stylistic/eslint-plugin-ts": "^1.6.2",
Expand Down
83 changes: 83 additions & 0 deletions scripts/normalize.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
input <- file("../test/testfiles/example-cfg.R")
exprs <- rlang::parse_exprs(input)

# the conversion code is based on lazyeval::ast_

# currently no json at all :D
flowr.expr_to_json <- function(x) {
if (base::is.expression(x) || base::is.list(x)) {
trees <- base::vapply(x, flowr.tree, character(1))
out <- base::paste0(trees, collapse = "\n\n")
} else {
out <- flowr.tree(x)
}

cat(out, "\n")
}

flowr.is_atomic <- function(x) {
typeof(x) %in% c("logical", "integer", "double", "complex", "character", "raw")
}

flowr.is_name <- function(x) {
typeof(x) == "symbol"
}

flowr.is_call <- function(x) {
typeof(x) == "language"
}

flowr.is_pairlist <- function(x) {
typeof(x) == "pairlist"
}


flowr.tree <- function(x, level = 1) {
if (flowr.is_atomic(x) && base::length(x) == 1) {
label <- base::paste0(" ", base::deparse(x)[1])
children <- NULL
} else if (flowr.is_name(x)) {
x <- base::as.character(x)
if (x == "") {
# Special case the missing argument
label <- "`MISSING"
} else {
label <- base::paste0("`", base::as.character(x))
}

children <- NULL
} else if (flowr.is_call(x)) {
label <- "()"
children <- base::vapply(base::as.list(x), flowr.tree, character(1), level = level + 1)
} else if (flowr.is_pairlist(x)) {
label <- "[]"

branches <- paste("\u2517", format(names(x)), "=")
children <- character(length(x))
for (i in seq_along(x)) {
children[i] <- flowr.tree(x[[i]], level = level + 1)
}
} else {
# Special case for srcrefs, since they're commonly seen
if (inherits(x, "srcref")) {
label <- "<srcref>"
} else {
label <- paste0("<", typeof(x), ">")
}
children <- NULL
}

indent <- paste0(str_dup(" ", level - 1), "> ")

if (is.null(children)) {
paste0(indent, label)
} else {
paste0(indent, label, "\n", paste0(children, collapse = "\n"))
}
}

str_dup <- function(x, n) {
paste0(rep(x, n), collapse = "")
}

print(flowr.expr_to_json(exprs))
14 changes: 7 additions & 7 deletions src/abstract-interpretation/handler/binop/binop.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import type { Handler } from '../handler'
import type { AINode } from '../../processor'
import { aiLogger } from '../../processor'
import type { BinaryOperatorFlavor, ParentInformation, RBinaryOp } from '../../../r-bridge'
import type { ParentInformation, RBinaryOp } from '../../../r-bridge'
import { guard } from '../../../util/assert'
import { operators } from './operators'

export type BinOpOperators = {
[key in BinaryOperatorFlavor]: (lhs: AINode, rhs: AINode, node: RBinaryOp<ParentInformation>) => AINode
}
export type BinaryOpProcessor = (lhs: AINode, rhs: AINode, node: RBinaryOp<ParentInformation>) => AINode

export class BinOp implements Handler<AINode> {
lhs: AINode | undefined
Expand All @@ -16,7 +14,7 @@ export class BinOp implements Handler<AINode> {
constructor(readonly node: RBinaryOp<ParentInformation>) {}

getName(): string {
return `Bin Op (${this.node.flavor})`
return `Bin Op (${this.node.operator})`
}

enter(): void {
Expand All @@ -27,7 +25,9 @@ export class BinOp implements Handler<AINode> {
aiLogger.trace(`Exited ${this.getName()}`)
guard(this.lhs !== undefined, `No LHS found for assignment ${this.node.info.id}`)
guard(this.rhs !== undefined, `No RHS found for assignment ${this.node.info.id}`)
return operators[this.node.flavor](this.lhs, this.rhs, this.node)
const processor: BinaryOpProcessor | undefined = operators[this.node.operator]
guard(processor !== undefined, `No processor found for binary operator ${this.node.operator}`)
return processor(this.lhs, this.rhs, this.node)
}

next(node: AINode): void {
Expand All @@ -40,4 +40,4 @@ export class BinOp implements Handler<AINode> {
guard(false, `BinOp ${this.node.info.id} already has both LHS and RHS`)
}
}
}
}
44 changes: 15 additions & 29 deletions src/abstract-interpretation/handler/binop/operators.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,26 @@
import { guard } from '../../../util/assert'
import type { BinOpOperators } from './binop'
import type { BinaryOpProcessor } from './binop'
import { addDomains, subtractDomains } from '../../domain'

export const operators: BinOpOperators = {
'assignment': (lhs, rhs, node) => {
export const operators: Record<string, BinaryOpProcessor> = {
'<-': (lhs, rhs, node) => {
return {
id: lhs.id,
domain: rhs.domain,
astNode: node.lhs,
}
},
'arithmetic': (lhs, rhs, node) => {
switch(node.operator) {
case '+':
return {
id: lhs.id,
domain: addDomains(lhs.domain, rhs.domain),
astNode: node,
}
case '-':
return {
id: lhs.id,
domain: subtractDomains(lhs.domain, rhs.domain),
astNode: node,
}
default:
guard(false, `Unknown binary operator ${node.operator}`)
'+': (lhs, rhs, node) => {
return {
id: lhs.id,
domain: addDomains(lhs.domain, rhs.domain),
astNode: node,
}
},
'logical': () => {
guard(false, 'Not implemented yet')
},
'model formula': () => {
guard(false, 'Not implemented yet')
},
'comparison': () => {
guard(false, 'Not implemented yet')
},
'-': (lhs, rhs, node) => {
return {
id: lhs.id,
domain: subtractDomains(lhs.domain, rhs.domain),
astNode: node,
}
}
}
8 changes: 4 additions & 4 deletions src/abstract-interpretation/processor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DataflowInformation } from '../dataflow/internal/info'
import type { DataflowInformation } from '../dataflow/info'
import type { NodeId, NormalizedAst, ParentInformation, RNodeWithParent } from '../r-bridge'
import { RType } from '../r-bridge'
import { CfgVertexType, extractCFG } from '../util/cfg/cfg'
Expand All @@ -23,13 +23,13 @@ class Stack<ElementType> {
private backingStore: ElementType[] = []

size(): number {
return this.backingStore.length
return this.backingStore.length
}
peek(): ElementType | undefined {
return this.backingStore[this.size() - 1]
return this.backingStore[this.size() - 1]
}
pop(): ElementType | undefined {
return this.backingStore.pop()
return this.backingStore.pop()
}
push(item: ElementType): ElementType {
this.backingStore.push(item)
Expand Down
10 changes: 7 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { MergeableRecord } from './util/objects'
import { deepMergeObject } from './util/objects'
import path from 'path'
import fs from 'fs'
import { log } from './util/log'
import { log, LogLevel } from './util/log'
import { getParentDirectory } from './util/files'
import Joi from 'joi'

Expand Down Expand Up @@ -66,7 +66,9 @@ function parseConfigOptions(workingDirectory: string, configFile: string): Flowr
if(!validate.error) {
// assign default values to all config options except for the specified ones
const ret = deepMergeObject(defaultConfigOptions, parsed)
log.info(`Using config ${JSON.stringify(ret)} from ${configPath}`)
if(log.settings.minLevel <= LogLevel.Info) {
log.info(`Using config ${JSON.stringify(ret)} from ${configPath}`)
}
return ret
} else {
log.error(`Failed to validate config file at ${configPath}: ${validate.error.message}`)
Expand All @@ -79,6 +81,8 @@ function parseConfigOptions(workingDirectory: string, configFile: string): Flowr
searchPath = getParentDirectory(searchPath)
} while(fs.existsSync(searchPath))

log.info(`Using default config ${JSON.stringify(defaultConfigOptions)}`)
if(log.settings.minLevel <= LogLevel.Info) {
log.info(`Using default config ${JSON.stringify(defaultConfigOptions)}`)
}
return defaultConfigOptions
}
4 changes: 0 additions & 4 deletions src/core/index.ts

This file was deleted.

Loading
Loading