-
Notifications
You must be signed in to change notification settings - Fork 2
/
core.str
102 lines (82 loc) · 3.04 KB
/
core.str
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
module analysis/core
imports
nbl/collect
nbl/entries
nbl/uri
nbl/utils
index/core
task/core
task/messages
editor/origins
signature
constructors
File : Path * AST -> File
Result : Partition * AST * AST * List(URI) * List(Term) * List(Term) * List(Term) -> Result
// Result(partition, initial-ast, analyzed-ast, changed-read*, error*, warning*, note*)
rules // Analysis
analyze-collect(|language, project-path):
File(partition, initial-ast) -> Result(partition, initial-ast, analyzed-ast, changed-read*, [], [], [])
with
measure-time(
measure-time(
index-setup(|language, project-path);
index-start-collection(|partition);
task-setup(|project-path);
task-recover;
task-start-collection(|partition)
, id | "analyze-collect-setup"
); measure-time(
analyzed-ast := <nabl-collect(|partition, Language(language))> initial-ast
, id | "analyze-collect-collect"
); measure-time(
index-stop-collection => (removed-entry*, added-entry*);
task-stop-collection(|partition);
changed-read* := <filter(analyze-diff-entry; nabl-uri; try(nabl-replace-uri-qualifier(|())))> [removed-entry*, added-entry*]
, id | "analyze-collect-diff"
); measure-time(
task-invalidate-task-reads(|changed-read*)
, id | "analyze-collect-invalidate"
)
, id | "analyze-collect-total")
analyze-perform-all:
result* -> (result'*, evaluated-task*, unevaluated-task*)
with
measure-time(
measure-time(
task-evaluate-scheduled => (evaluated-task*, unevaluated-task*)
, id | "analyze-task-evaluate"
); measure-time(
result'* := <map(analyze-messages)> result*
, id | "analyze-task-messages"
)
, id | "analyze-task-total")
analyze-messages:
Result(partition, initial-ast, analyzed-ast, changed-read*, _, _, _) -> Result(partition, initial-ast, analyzed-ast, changed-read*, error*, warning*, note*)
with
(error*, warning*, note*) := <analyze-get-messages> partition
analyze-get-messages:
partition -> (error*, warning*, note*)
with
message* := <task-get-messages(|partition)>;
error* := <filter(?Error(_, _, _); analyze-message-to-tuple)> message*;
warning* := <filter(?Warning(_, _, _); analyze-message-to-tuple)> message*;
note* := <filter(?Note(_, _, _); analyze-message-to-tuple)> message*
analyze-message-to-tuple:
message -> (<origin-location-offset-set(|origin)> term, msg)
with
origin := <task-message-origin> message;
term := <task-message-term> message;
msg := <task-message> message
rules // Index entries to diff
analyze-diff-entry =
?Def(_)
analyze-diff-entry =
?Alias(_, _)
analyze-diff-entry =
?Prop(_, _, _)
rules // Projections
analyze-result-reads:
Result(_, _, _, changed-read*, _, _, _) -> changed-read*
analyze-result-analyzed-ast:
Result(_, _, analyzed-ast, _, _, _, _) -> analyzed-ast
analysis-partition(|path, project-path) = !$[[project-path]/[path]]