@effekt-lang/effekt 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/effekt +0 -0
- package/libraries/common/list.effekt +21 -0
- package/libraries/common/test.effekt +3 -3
- package/libraries/common/tty.effekt +192 -0
- package/libraries/llvm/rts.ll +84 -78
- package/licenses/eclipse public license, version 2.0 - epl-2.0.html +10 -10
- package/package.json +1 -1
- package/libraries/common/string/tty.effekt +0 -66
package/bin/effekt
CHANGED
|
Binary file
|
|
@@ -222,6 +222,27 @@ def any[A](list: List[A]) { predicate: A => Bool }: Bool = {
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
/// Count how many elements of a list satisfy the given predicate.
|
|
226
|
+
///
|
|
227
|
+
/// Examples:
|
|
228
|
+
/// ```
|
|
229
|
+
/// > ["AB", "BC", "A", "GG", "AAA"].count { x => x.length == 2 }
|
|
230
|
+
/// 3
|
|
231
|
+
///
|
|
232
|
+
/// > [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].count { x => (x * 2) > 10 }
|
|
233
|
+
/// 5
|
|
234
|
+
/// ```
|
|
235
|
+
/// O(N)
|
|
236
|
+
def count[A](list: List[A]) { predicate: A => Bool }: Int = {
|
|
237
|
+
var acc: Int = 0
|
|
238
|
+
list.foreach { el =>
|
|
239
|
+
if (predicate(el)) {
|
|
240
|
+
acc = acc + 1
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
acc
|
|
244
|
+
}
|
|
245
|
+
|
|
225
246
|
/// Fold a list using `f`, starting from the left given a starting value.
|
|
226
247
|
///
|
|
227
248
|
/// O(N)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import tty
|
|
2
2
|
import process
|
|
3
3
|
import bench
|
|
4
4
|
|
|
@@ -52,8 +52,8 @@ def assertEqual[A](obtained: A, expected: A, msg: String) { equals: (A, A) => Bo
|
|
|
52
52
|
do assert(equals(obtained, expected), msg)
|
|
53
53
|
|
|
54
54
|
def assertEqual[A](obtained: A, expected: A) { equals: (A, A) => Bool } { show: A => String }: Unit / { Assertion, Formatted } =
|
|
55
|
-
do assert(equals(obtained, expected), Formatted::tryEmit(
|
|
56
|
-
// NOTE:
|
|
55
|
+
do assert(equals(obtained, expected), Formatted::tryEmit(Escape::RESET) ++ "Expected: ".dim ++ show(expected).green ++ "\n Obtained: ".dim ++ show(obtained).red)
|
|
56
|
+
// NOTE: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
57
57
|
// Here's an accidental capture! Can we prevent this somehow nicely?
|
|
58
58
|
|
|
59
59
|
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
module tty
|
|
2
|
+
|
|
3
|
+
/// Represents a TTY color.
|
|
4
|
+
/// - ANSI for the standard 16 terminal colors
|
|
5
|
+
/// - ANSI256 for standard 256 terminal colors
|
|
6
|
+
/// - NoColor for explicit "this doesn't have a set color"
|
|
7
|
+
type Color {
|
|
8
|
+
ANSI(code: Int)
|
|
9
|
+
ANSI256(code: Int)
|
|
10
|
+
NoColor()
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/// Common terminal colors and their constructors
|
|
14
|
+
namespace Color {
|
|
15
|
+
// Standard ANSI colors
|
|
16
|
+
val BLACK = ANSI(0)
|
|
17
|
+
val RED = ANSI(1)
|
|
18
|
+
val GREEN = ANSI(2)
|
|
19
|
+
val YELLOW = ANSI(3)
|
|
20
|
+
val BLUE = ANSI(4)
|
|
21
|
+
val MAGENTA = ANSI(5)
|
|
22
|
+
val CYAN = ANSI(6)
|
|
23
|
+
val WHITE = ANSI(7)
|
|
24
|
+
|
|
25
|
+
// Bright ANSI colors
|
|
26
|
+
val BRIGHT_BLACK = ANSI(8)
|
|
27
|
+
val BRIGHT_RED = ANSI(9)
|
|
28
|
+
val BRIGHT_GREEN = ANSI(10)
|
|
29
|
+
val BRIGHT_YELLOW = ANSI(11)
|
|
30
|
+
val BRIGHT_BLUE = ANSI(12)
|
|
31
|
+
val BRIGHT_MAGENTA = ANSI(13)
|
|
32
|
+
val BRIGHT_CYAN = ANSI(14)
|
|
33
|
+
val BRIGHT_WHITE = ANSI(15)
|
|
34
|
+
|
|
35
|
+
/// Create an ANSI color from a code
|
|
36
|
+
def ansi(code: Int): Color =
|
|
37
|
+
if (code < 16) ANSI(code) else ANSI256(code)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// Converts a color to its escape code
|
|
41
|
+
def toEscapeSeq(color: Color): String = color match {
|
|
42
|
+
case ANSI(code) =>
|
|
43
|
+
if (code < 8) (code + 30).show else (code + 82).show
|
|
44
|
+
case ANSI256(code) => "38;5;" ++ code.show
|
|
45
|
+
case NoColor() => ""
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/// Common escapes
|
|
49
|
+
namespace Escape {
|
|
50
|
+
val CSI = "\u001b["
|
|
51
|
+
val OSC = "\u001b]"
|
|
52
|
+
|
|
53
|
+
val RESET = CSI ++ "0m"
|
|
54
|
+
val BOLD = CSI ++ "1m"
|
|
55
|
+
val FAINT = CSI ++ "2m"
|
|
56
|
+
val ITALIC = CSI ++ "3m"
|
|
57
|
+
val UNDERLINE = CSI ++ "4m"
|
|
58
|
+
val BLINK = CSI ++ "5m"
|
|
59
|
+
val REVERSE = CSI ++ "7m"
|
|
60
|
+
val CROSSOUT = CSI ++ "9m"
|
|
61
|
+
val OVERLINE = CSI ++ "53m"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
def escape(code: String): String = Escape::CSI ++ code
|
|
65
|
+
def escapeOSC(code: String): String = Escape::OSC ++ code
|
|
66
|
+
|
|
67
|
+
// Cursor positioning
|
|
68
|
+
def cursorUp(x: Int): String = escape(x.show ++ "A")
|
|
69
|
+
def cursorDown(x: Int): String = escape(x.show ++ "B")
|
|
70
|
+
def cursorForward(x: Int): String = escape(x.show ++ "C")
|
|
71
|
+
def cursorBack(x: Int): String = escape(x.show ++ "D")
|
|
72
|
+
def cursorNextLine(x: Int): String = escape(x.show ++ "E")
|
|
73
|
+
def cursorPreviousLine(x: Int): String = escape(x.show ++ "F")
|
|
74
|
+
def cursorHorizontal(x: Int): String = escape(x.show ++ "G")
|
|
75
|
+
def cursorPosition(x: Int, y: Int): String = escape(y.show ++ ";" ++ x.show ++ "H")
|
|
76
|
+
|
|
77
|
+
// Screen manipulation
|
|
78
|
+
def eraseDisplay(x: Int): String = escape(x.show ++ "J")
|
|
79
|
+
def eraseLine(x: Int): String = escape(x.show ++ "K")
|
|
80
|
+
def scrollUp(x: Int): String = escape(x.show ++ "S")
|
|
81
|
+
def scrollDown(x: Int): String = escape(x.show ++ "T")
|
|
82
|
+
def saveCursorPosition(): String = escape("s")
|
|
83
|
+
def restoreCursorPosition(): String = escape("u")
|
|
84
|
+
def changeScrollingRegion(x: Int, y: Int): String = escape(x.show ++ ";" ++ y.show ++ "r")
|
|
85
|
+
def insertLine(x: Int): String = escape(x.show ++ "L")
|
|
86
|
+
def deleteLine(x: Int): String = escape(x.show ++ "M")
|
|
87
|
+
|
|
88
|
+
// Explicit values for eraseLine
|
|
89
|
+
def eraseLineRight(): String = escape("0K")
|
|
90
|
+
def eraseLineLeft(): String = escape("1K")
|
|
91
|
+
def eraseEntireLine(): String = escape("2K")
|
|
92
|
+
|
|
93
|
+
// Mouse
|
|
94
|
+
def enableMousePress(): String = escape("?9h")
|
|
95
|
+
def disableMousePress(): String = escape("?9l")
|
|
96
|
+
def enableMouse(): String = escape("?1000h")
|
|
97
|
+
def disableMouse(): String = escape("?1000l")
|
|
98
|
+
def enableMouseHighlight(): String = escape("?1001h")
|
|
99
|
+
def disableMouseHighlight(): String = escape("?1001l")
|
|
100
|
+
def enableMouseCellMotion(): String = escape("?1002h")
|
|
101
|
+
def disableMouseCellMotion(): String = escape("?1002l")
|
|
102
|
+
def enableMouseAllMotion(): String = escape("?1003h")
|
|
103
|
+
def disableMouseAllMotion(): String = escape("?1003l")
|
|
104
|
+
def enableMouseExtendedMode(): String = escape("?1006h")
|
|
105
|
+
def disableMouseExtendedMode(): String = escape("?1006l")
|
|
106
|
+
def enableMousePixelsMode(): String = escape("?1016h")
|
|
107
|
+
def disableMousePixelsMode(): String = escape("?1016l")
|
|
108
|
+
|
|
109
|
+
// Screen
|
|
110
|
+
def restoreScreen(): String = escape("?47l")
|
|
111
|
+
def saveScreen(): String = escape("?47h")
|
|
112
|
+
def altScreen(): String = escape("?1049h")
|
|
113
|
+
def exitAltScreen(): String = escape("?1049l")
|
|
114
|
+
|
|
115
|
+
// Bracketed paste
|
|
116
|
+
def enableBracketedPaste(): String = escape("?2004h")
|
|
117
|
+
def disableBracketedPaste(): String = escape("?2004l")
|
|
118
|
+
def startBracketedPaste(): String = escape("200~")
|
|
119
|
+
def endBracketedPaste(): String = escape("201~")
|
|
120
|
+
|
|
121
|
+
// Session
|
|
122
|
+
def setWindowTitle(s: String): String = escape("2;" ++ s)
|
|
123
|
+
def setForegroundColor(s: String): String = escape("10;" ++ s)
|
|
124
|
+
def setBackgroundColor(s: String): String = escape("11;" ++ s)
|
|
125
|
+
def setCursorColor(s: String): String = escape("12;" ++ s)
|
|
126
|
+
def showCursor(): String = escape("?25h")
|
|
127
|
+
def hideCursor(): String = escape("?25l")
|
|
128
|
+
|
|
129
|
+
def applyForegroundColor(color: Color): String =
|
|
130
|
+
escape(color.toEscapeSeq ++ "m")
|
|
131
|
+
|
|
132
|
+
def applyBackgroundColor(color: Color): String =
|
|
133
|
+
escape("48;" ++ color.toEscapeSeq ++ "m")
|
|
134
|
+
|
|
135
|
+
/// Inline images
|
|
136
|
+
/// See https://iterm2.com/documentation-images.html for protocol description
|
|
137
|
+
/// See [imgcat](https://iterm2.com/utilities/imgcat) for more usage details
|
|
138
|
+
def inlineImage(size: Int, base64Image: String) =
|
|
139
|
+
escape("1337;File=size=" ++ size.show ++ ";inline=1:" ++ base64Image ++ "\u0007")
|
|
140
|
+
|
|
141
|
+
/// Hyperlinks
|
|
142
|
+
/// https://iterm2.com/documentation-escape-codes.html
|
|
143
|
+
def hyperlink(text: String, url: String): String =
|
|
144
|
+
escapeOSC("8;;") ++ url ++ "\u0007" ++ text ++ escapeOSC("8;;") ++ "\u0007"
|
|
145
|
+
|
|
146
|
+
def attention(value: String) =
|
|
147
|
+
escapeOSC("1337;") ++ "RequestAttention=" ++ value ++ "\u0007"
|
|
148
|
+
|
|
149
|
+
namespace Screen {
|
|
150
|
+
def clear(): String = eraseDisplay(2) ++ cursorPosition(1, 1)
|
|
151
|
+
def clearLine(): String = eraseEntireLine()
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
def red(text: String) = Formatted::colored(text, Color::RED)
|
|
155
|
+
def green(text: String) = Formatted::colored(text, Color::GREEN)
|
|
156
|
+
def yellow(text: String) = Formatted::colored(text, Color::YELLOW)
|
|
157
|
+
def blue(text: String) = Formatted::colored(text, Color::BLUE)
|
|
158
|
+
def magenta(text: String) = Formatted::colored(text, Color::MAGENTA)
|
|
159
|
+
def cyan(text: String) = Formatted::colored(text, Color::CYAN)
|
|
160
|
+
def white(text: String) = Formatted::colored(text, Color::WHITE)
|
|
161
|
+
|
|
162
|
+
def dim(text: String) = Formatted::colored(text, Escape::FAINT)
|
|
163
|
+
def bold(text: String) = Formatted::colored(text, Escape::BOLD)
|
|
164
|
+
def underline(text: String) = Formatted::colored(text, Escape::UNDERLINE)
|
|
165
|
+
def italic(text: String) = Formatted::colored(text, Escape::ITALIC)
|
|
166
|
+
|
|
167
|
+
interface Formatted {
|
|
168
|
+
def supportsEscape(escape: String): Bool
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
namespace Formatted {
|
|
172
|
+
/// Run given block of code, allowing all formatting
|
|
173
|
+
def formatting[R] { prog : => R / Formatted }: R =
|
|
174
|
+
try { prog() } with Formatted {
|
|
175
|
+
def supportsEscape(escape: String) = resume(true)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/// Run given block of code, ignoring all formatting
|
|
179
|
+
def noFormatting[R] { prog : => R / Formatted }: R =
|
|
180
|
+
try { prog() } with Formatted {
|
|
181
|
+
def supportsEscape(escape: String) = resume(false)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
def tryEmit(escape: String): String / Formatted =
|
|
185
|
+
if (do supportsEscape(escape)) escape else ""
|
|
186
|
+
|
|
187
|
+
def colored(text: String, escape: String): String / Formatted =
|
|
188
|
+
tryEmit(escape) ++ text ++ tryEmit(Escape::RESET)
|
|
189
|
+
|
|
190
|
+
def colored(text: String, color: Color): String / Formatted =
|
|
191
|
+
tryEmit(color.applyForegroundColor) ++ text ++ tryEmit(Escape::RESET)
|
|
192
|
+
}
|
package/libraries/llvm/rts.ll
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
; This is used for two purposes:
|
|
75
75
|
; - a refied first-class list of stacks (cyclic linked-list)
|
|
76
76
|
; - as part of an intrusive linked-list of stacks (meta stack)
|
|
77
|
-
%StackValue = type { %ReferenceCount, %Memory, %Prompt,
|
|
77
|
+
%StackValue = type { %ReferenceCount, %Memory, %Prompt, %Stack }
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
|
|
@@ -111,6 +111,7 @@ declare double @llvm.ceil.f64(double)
|
|
|
111
111
|
declare double @llvm.floor.f64(double)
|
|
112
112
|
declare void @print(i64)
|
|
113
113
|
declare void @exit(i64)
|
|
114
|
+
declare void @llvm.assume(i1)
|
|
114
115
|
|
|
115
116
|
|
|
116
117
|
; Prompts
|
|
@@ -258,20 +259,19 @@ define private %StackPointer @stackAllocate(%Stack %stack, i64 %n) {
|
|
|
258
259
|
%stackPointer_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 0
|
|
259
260
|
%limit_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 2
|
|
260
261
|
|
|
261
|
-
%currentStackPointer = load %StackPointer, ptr %stackPointer_pointer
|
|
262
|
-
%limit = load %Limit, ptr %limit_pointer
|
|
263
|
-
|
|
262
|
+
%currentStackPointer = load %StackPointer, ptr %stackPointer_pointer, !alias.scope !2
|
|
263
|
+
%limit = load %Limit, ptr %limit_pointer, !alias.scope !2
|
|
264
264
|
%nextStackPointer = getelementptr i8, %StackPointer %currentStackPointer, i64 %n
|
|
265
265
|
%isInside = icmp ule %StackPointer %nextStackPointer, %limit
|
|
266
266
|
br i1 %isInside, label %continue, label %realloc
|
|
267
267
|
|
|
268
268
|
continue:
|
|
269
|
-
store %StackPointer %nextStackPointer, ptr %stackPointer_pointer
|
|
269
|
+
store %StackPointer %nextStackPointer, ptr %stackPointer_pointer, !alias.scope !2
|
|
270
270
|
ret %StackPointer %currentStackPointer
|
|
271
271
|
|
|
272
272
|
realloc:
|
|
273
273
|
%base_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 1
|
|
274
|
-
%base = load %Base, ptr %base_pointer
|
|
274
|
+
%base = load %Base, ptr %base_pointer, !alias.scope !2
|
|
275
275
|
|
|
276
276
|
%intStackPointer = ptrtoint %StackPointer %currentStackPointer to i64
|
|
277
277
|
%intBase = ptrtoint %Base %base to i64
|
|
@@ -285,31 +285,48 @@ realloc:
|
|
|
285
285
|
%newStackPointer = getelementptr i8, %Base %newBase, i64 %size
|
|
286
286
|
%newNextStackPointer = getelementptr i8, %StackPointer %newStackPointer, i64 %n
|
|
287
287
|
|
|
288
|
-
store %StackPointer %newNextStackPointer, ptr %stackPointer_pointer
|
|
289
|
-
store %Base %newBase, ptr %base_pointer
|
|
290
|
-
store %Limit %newLimit, ptr %limit_pointer
|
|
288
|
+
store %StackPointer %newNextStackPointer, ptr %stackPointer_pointer, !alias.scope !2
|
|
289
|
+
store %Base %newBase, ptr %base_pointer, !alias.scope !2
|
|
290
|
+
store %Limit %newLimit, ptr %limit_pointer, !alias.scope !2
|
|
291
291
|
|
|
292
292
|
ret %StackPointer %newStackPointer
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
define private %StackPointer @stackDeallocate(%Stack %stack, i64 %n) {
|
|
296
296
|
%stackPointer_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 0
|
|
297
|
-
%stackPointer = load %StackPointer, ptr %stackPointer_pointer
|
|
297
|
+
%stackPointer = load %StackPointer, ptr %stackPointer_pointer, !alias.scope !2
|
|
298
|
+
|
|
299
|
+
%limit_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 2
|
|
300
|
+
%limit = load %Limit, ptr %limit_pointer, !alias.scope !2
|
|
301
|
+
%isInside = icmp ule %StackPointer %stackPointer, %limit
|
|
302
|
+
call void @llvm.assume(i1 %isInside)
|
|
298
303
|
|
|
299
304
|
%o = sub i64 0, %n
|
|
300
305
|
%newStackPointer = getelementptr i8, %StackPointer %stackPointer, i64 %o
|
|
301
|
-
store %StackPointer %newStackPointer, ptr %stackPointer_pointer
|
|
306
|
+
store %StackPointer %newStackPointer, ptr %stackPointer_pointer, !alias.scope !2
|
|
302
307
|
|
|
303
308
|
ret %StackPointer %newStackPointer
|
|
304
309
|
}
|
|
305
310
|
|
|
306
|
-
define i64 @nextPowerOfTwo(i64 %x) {
|
|
311
|
+
define private i64 @nextPowerOfTwo(i64 %x) {
|
|
307
312
|
%leadingZeros = call i64 @llvm.ctlz.i64(i64 %x, i1 false)
|
|
308
313
|
%numBits = sub i64 64, %leadingZeros
|
|
309
314
|
%result = shl i64 1, %numBits
|
|
310
315
|
ret i64 %result
|
|
311
316
|
}
|
|
312
317
|
|
|
318
|
+
define private void @assumeFrameHeaderWasPopped(%Stack %stack) alwaysinline {
|
|
319
|
+
%stackPointer_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 0
|
|
320
|
+
%stackPointer = load %StackPointer, ptr %stackPointer_pointer, !alias.scope !2
|
|
321
|
+
%oldStackPointer = getelementptr %FrameHeader, %StackPointer %stackPointer, i64 1
|
|
322
|
+
|
|
323
|
+
%limit_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 2
|
|
324
|
+
%limit = load %Limit, ptr %limit_pointer, !alias.scope !2
|
|
325
|
+
%isInside = icmp ule %StackPointer %oldStackPointer, %limit
|
|
326
|
+
call void @llvm.assume(i1 %isInside)
|
|
327
|
+
ret void
|
|
328
|
+
}
|
|
329
|
+
|
|
313
330
|
; Meta-stack management
|
|
314
331
|
|
|
315
332
|
define private %Memory @newMemory() {
|
|
@@ -336,7 +353,7 @@ define private %Stack @reset(%Stack %oldStack) {
|
|
|
336
353
|
|
|
337
354
|
%stack.0 = insertvalue %StackValue zeroinitializer, %Memory %stackMemory, 1
|
|
338
355
|
%stack.1 = insertvalue %StackValue %stack.0, %Prompt %prompt, 2
|
|
339
|
-
%stack.2 = insertvalue %StackValue %stack.1, %Stack %oldStack,
|
|
356
|
+
%stack.2 = insertvalue %StackValue %stack.1, %Stack %oldStack, 3
|
|
340
357
|
|
|
341
358
|
store %StackValue %stack.2, %Stack %stack
|
|
342
359
|
|
|
@@ -347,59 +364,55 @@ define private %Stack @reset(%Stack %oldStack) {
|
|
|
347
364
|
}
|
|
348
365
|
|
|
349
366
|
define private void @updatePrompts(%Stack %stack) {
|
|
350
|
-
%
|
|
351
|
-
%
|
|
352
|
-
|
|
367
|
+
%prompt_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 2
|
|
368
|
+
%prompt = load %Prompt, ptr %prompt_pointer
|
|
369
|
+
%stack_pointer = getelementptr %PromptValue, %Prompt %prompt, i64 0, i32 1
|
|
370
|
+
%promptStack = load %Stack, ptr %stack_pointer
|
|
371
|
+
%isThis = icmp eq %Stack %promptStack, %stack
|
|
372
|
+
br i1 %isThis, label %done, label %continue
|
|
353
373
|
|
|
354
374
|
done:
|
|
355
375
|
ret void
|
|
356
376
|
|
|
357
377
|
continue:
|
|
358
|
-
%prompt_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 2
|
|
359
|
-
%prompt = load %Prompt, ptr %prompt_pointer
|
|
360
|
-
%stack_pointer = getelementptr %PromptValue, %Prompt %prompt, i64 0, i32 1
|
|
361
|
-
%promptStack = load %Stack, ptr %stack_pointer
|
|
362
378
|
%isOccupied = icmp ne %Stack %promptStack, null
|
|
363
379
|
br i1 %isOccupied, label %displace, label %update
|
|
364
380
|
|
|
365
381
|
displace:
|
|
366
|
-
call void @displace(%Stack %promptStack)
|
|
382
|
+
call void @displace(%Stack %promptStack, %Stack %promptStack)
|
|
367
383
|
br label %update
|
|
368
384
|
|
|
369
385
|
update:
|
|
370
386
|
store %Stack %stack, ptr %stack_pointer
|
|
371
|
-
store i1 0, ptr %dirtyBit_pointer
|
|
372
387
|
|
|
373
|
-
%next_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32
|
|
388
|
+
%next_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 3
|
|
374
389
|
%next = load %Stack, ptr %next_pointer
|
|
375
390
|
tail call void @updatePrompts(%Stack %next)
|
|
376
391
|
ret void
|
|
377
392
|
}
|
|
378
393
|
|
|
379
|
-
define void @displace(%Stack %stack) {
|
|
394
|
+
define private void @displace(%Stack %stack, %Stack %end) {
|
|
380
395
|
%prompt_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 2
|
|
381
|
-
%next_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32
|
|
382
|
-
%dirtyBit_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 3
|
|
383
|
-
%dirtyBit = load i1, ptr %dirtyBit_pointer
|
|
384
|
-
br i1 %dirtyBit, label %done, label %continue
|
|
385
|
-
|
|
386
|
-
done:
|
|
387
|
-
ret void
|
|
388
|
-
|
|
389
|
-
continue:
|
|
396
|
+
%next_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 3
|
|
390
397
|
%prompt = load %Prompt, ptr %prompt_pointer
|
|
391
398
|
%stack_pointer = getelementptr %PromptValue, %Prompt %prompt, i64 0, i32 1
|
|
392
399
|
store %Stack null, ptr %stack_pointer
|
|
393
|
-
store i1 1, ptr %dirtyBit_pointer
|
|
394
400
|
|
|
395
401
|
%next = load %Stack, ptr %next_pointer
|
|
396
|
-
|
|
402
|
+
%isEnd = icmp eq %Stack %next, %end
|
|
403
|
+
br i1 %isEnd, label %done, label %continue
|
|
404
|
+
|
|
405
|
+
done:
|
|
406
|
+
ret void
|
|
407
|
+
|
|
408
|
+
continue:
|
|
409
|
+
tail call void @displace(%Stack %next, %Stack %end)
|
|
397
410
|
ret void
|
|
398
411
|
}
|
|
399
412
|
|
|
400
|
-
define %Stack @resume(%Resumption %resumption, %Stack %oldStack) {
|
|
413
|
+
define private %Stack @resume(%Resumption %resumption, %Stack %oldStack) {
|
|
401
414
|
%uniqueResumption = call %Resumption @uniqueStack(%Resumption %resumption)
|
|
402
|
-
%rest_pointer = getelementptr %StackValue, %Resumption %uniqueResumption, i64 0, i32
|
|
415
|
+
%rest_pointer = getelementptr %StackValue, %Resumption %uniqueResumption, i64 0, i32 3
|
|
403
416
|
%start = load %Stack, ptr %rest_pointer
|
|
404
417
|
call void @updatePrompts(%Stack %start)
|
|
405
418
|
|
|
@@ -411,7 +424,7 @@ define %Stack @resume(%Resumption %resumption, %Stack %oldStack) {
|
|
|
411
424
|
define private {%Resumption, %Stack} @shift(%Stack %stack, %Prompt %prompt) {
|
|
412
425
|
%resumpion_pointer = getelementptr %PromptValue, %Prompt %prompt, i64 0, i32 1
|
|
413
426
|
%resumption = load %Stack, ptr %resumpion_pointer
|
|
414
|
-
%next_pointer = getelementptr %StackValue, %Stack %resumption, i64 0, i32
|
|
427
|
+
%next_pointer = getelementptr %StackValue, %Stack %resumption, i64 0, i32 3
|
|
415
428
|
%next = load %Stack, ptr %next_pointer
|
|
416
429
|
|
|
417
430
|
store %Stack %stack, ptr %next_pointer
|
|
@@ -427,31 +440,7 @@ define private void @eraseMemory(%Memory %memory) {
|
|
|
427
440
|
ret void
|
|
428
441
|
}
|
|
429
442
|
|
|
430
|
-
define private void @
|
|
431
|
-
%done = icmp uge ptr %elementPointer, %end
|
|
432
|
-
br i1 %done, label %return, label %erase
|
|
433
|
-
|
|
434
|
-
erase:
|
|
435
|
-
%element = load %Pos, ptr %elementPointer
|
|
436
|
-
call void %f(%Pos %element)
|
|
437
|
-
|
|
438
|
-
%nextElementPointer = getelementptr %Pos, ptr %elementPointer, i64 1
|
|
439
|
-
tail call void @forEachObject(ptr %nextElementPointer, ptr %end, ptr %f)
|
|
440
|
-
ret void
|
|
441
|
-
|
|
442
|
-
return:
|
|
443
|
-
ret void
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
define void @erasePrompt(%Prompt %prompt, i1 %dirtyBit) alwaysinline {
|
|
447
|
-
br i1 %dirtyBit, label %continue, label %clearPrompt
|
|
448
|
-
|
|
449
|
-
clearPrompt:
|
|
450
|
-
%stack_pointer = getelementptr %PromptValue, %Prompt %prompt, i64 0, i32 1
|
|
451
|
-
store %Stack null, ptr %stack_pointer
|
|
452
|
-
br label %continue
|
|
453
|
-
|
|
454
|
-
continue:
|
|
443
|
+
define private void @erasePrompt(%Prompt %prompt) alwaysinline {
|
|
455
444
|
%referenceCount_pointer = getelementptr %PromptValue, %Prompt %prompt, i64 0, i32 0
|
|
456
445
|
%referenceCount = load %ReferenceCount, ptr %referenceCount_pointer
|
|
457
446
|
switch %ReferenceCount %referenceCount, label %decrement [%ReferenceCount 0, label %free]
|
|
@@ -466,7 +455,7 @@ free:
|
|
|
466
455
|
ret void
|
|
467
456
|
}
|
|
468
457
|
|
|
469
|
-
define void @sharePrompt(%Prompt %prompt) alwaysinline {
|
|
458
|
+
define private void @sharePrompt(%Prompt %prompt) alwaysinline {
|
|
470
459
|
%referenceCount_pointer = getelementptr %PromptValue, %Prompt %prompt, i64 0, i32 0
|
|
471
460
|
%referenceCount = load %ReferenceCount, ptr %referenceCount_pointer
|
|
472
461
|
%newReferenceCount = add %ReferenceCount %referenceCount, 1
|
|
@@ -477,16 +466,17 @@ define void @sharePrompt(%Prompt %prompt) alwaysinline {
|
|
|
477
466
|
define private %Stack @underflowStack(%Stack %stack) {
|
|
478
467
|
%stackMemory = getelementptr %StackValue, %Stack %stack, i64 0, i32 1
|
|
479
468
|
%stackPrompt = getelementptr %StackValue, %Stack %stack, i64 0, i32 2
|
|
480
|
-
%
|
|
481
|
-
%stackRest = getelementptr %StackValue, %Stack %stack, i64 0, i32 4
|
|
469
|
+
%stackRest = getelementptr %StackValue, %Stack %stack, i64 0, i32 3
|
|
482
470
|
|
|
483
471
|
%memory = load %Memory, ptr %stackMemory
|
|
484
472
|
%prompt = load %Prompt, ptr %stackPrompt
|
|
485
473
|
%rest = load %Stack, ptr %stackRest
|
|
486
|
-
|
|
474
|
+
|
|
475
|
+
%promptStack_pointer = getelementptr %PromptValue, %Prompt %prompt, i64 0, i32 1
|
|
476
|
+
store %Stack null, ptr %promptStack_pointer
|
|
487
477
|
|
|
488
478
|
call void @eraseMemory(%Memory %memory)
|
|
489
|
-
call void @erasePrompt(%Prompt %prompt
|
|
479
|
+
call void @erasePrompt(%Prompt %prompt)
|
|
490
480
|
call void @free(%Stack %stack)
|
|
491
481
|
|
|
492
482
|
ret %Stack %rest
|
|
@@ -537,7 +527,7 @@ done:
|
|
|
537
527
|
copy:
|
|
538
528
|
%newOldReferenceCount = sub %ReferenceCount %referenceCount, 1
|
|
539
529
|
store %ReferenceCount %newOldReferenceCount, ptr %referenceCount_pointer
|
|
540
|
-
%stack_pointer = getelementptr %StackValue, %Resumption %resumption, i64 0, i32
|
|
530
|
+
%stack_pointer = getelementptr %StackValue, %Resumption %resumption, i64 0, i32 3
|
|
541
531
|
%stack = load %Stack, ptr %stack_pointer
|
|
542
532
|
|
|
543
533
|
%size = ptrtoint ptr getelementptr (%StackValue, ptr null, i64 1) to i64
|
|
@@ -551,7 +541,7 @@ loop:
|
|
|
551
541
|
|
|
552
542
|
%stackMemory = getelementptr %StackValue, %Stack %old, i64 0, i32 1
|
|
553
543
|
%stackPrompt = getelementptr %StackValue, %Stack %old, i64 0, i32 2
|
|
554
|
-
%stackRest = getelementptr %StackValue, %Stack %old, i64 0, i32
|
|
544
|
+
%stackRest = getelementptr %StackValue, %Stack %old, i64 0, i32 3
|
|
555
545
|
|
|
556
546
|
%memory = load %Memory, ptr %stackMemory
|
|
557
547
|
%prompt = load %Prompt, ptr %stackPrompt
|
|
@@ -560,8 +550,7 @@ loop:
|
|
|
560
550
|
%newStackReferenceCounter = getelementptr %StackValue, %Stack %newStack, i64 0, i32 0
|
|
561
551
|
%newStackMemory = getelementptr %StackValue, %Stack %newStack, i64 0, i32 1
|
|
562
552
|
%newStackPrompt = getelementptr %StackValue, %Stack %newStack, i64 0, i32 2
|
|
563
|
-
%
|
|
564
|
-
%newStackRest = getelementptr %StackValue, %Stack %newStack, i64 0, i32 4
|
|
553
|
+
%newStackRest = getelementptr %StackValue, %Stack %newStack, i64 0, i32 3
|
|
565
554
|
|
|
566
555
|
%newMemory = call %Memory @copyMemory(%Memory %memory)
|
|
567
556
|
|
|
@@ -573,7 +562,6 @@ loop:
|
|
|
573
562
|
store %ReferenceCount 0, ptr %newStackReferenceCounter
|
|
574
563
|
store %Memory %newMemory, ptr %newStackMemory
|
|
575
564
|
store %Prompt %prompt, ptr %newStackPrompt
|
|
576
|
-
store i1 1, ptr %newStackDirtyBit
|
|
577
565
|
|
|
578
566
|
%isEnd = icmp eq %Stack %old, %resumption
|
|
579
567
|
br i1 %isEnd, label %stop, label %next
|
|
@@ -607,7 +595,7 @@ define void @eraseResumption(%Resumption %resumption) alwaysinline {
|
|
|
607
595
|
ret void
|
|
608
596
|
|
|
609
597
|
free:
|
|
610
|
-
%stack_pointer = getelementptr %StackValue, %Resumption %resumption, i64 0, i32
|
|
598
|
+
%stack_pointer = getelementptr %StackValue, %Resumption %resumption, i64 0, i32 3
|
|
611
599
|
%stack = load %Stack, ptr %stack_pointer
|
|
612
600
|
store %Stack null, ptr %stack_pointer
|
|
613
601
|
call void @eraseStack(%Stack %stack)
|
|
@@ -617,17 +605,25 @@ define void @eraseResumption(%Resumption %resumption) alwaysinline {
|
|
|
617
605
|
define void @eraseStack(%Stack %stack) alwaysinline {
|
|
618
606
|
%stackPointer_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 0
|
|
619
607
|
%prompt_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 2
|
|
620
|
-
%
|
|
621
|
-
%rest_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 4
|
|
608
|
+
%rest_pointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 3
|
|
622
609
|
|
|
623
610
|
%stackPointer = load %StackPointer, ptr %stackPointer_pointer
|
|
624
611
|
%prompt = load %Stack, ptr %prompt_pointer
|
|
625
|
-
%dirtyBit = load i1, ptr %dirtyBit_pointer
|
|
626
612
|
%rest = load %Stack, ptr %rest_pointer
|
|
627
613
|
|
|
614
|
+
%promptStack_pointer = getelementptr %PromptValue, %Prompt %prompt, i64 0, i32 1
|
|
615
|
+
%promptStack = load %Stack, ptr %promptStack_pointer
|
|
616
|
+
%isThisStack = icmp eq %Stack %promptStack, %stack
|
|
617
|
+
br i1 %isThisStack, label %clearPrompt, label %free
|
|
618
|
+
|
|
619
|
+
clearPrompt:
|
|
620
|
+
store %Stack null, ptr %promptStack_pointer
|
|
621
|
+
br label %free
|
|
622
|
+
|
|
623
|
+
free:
|
|
628
624
|
call void @free(%Stack %stack)
|
|
629
625
|
call void @eraseFrames(%StackPointer %stackPointer)
|
|
630
|
-
call void @erasePrompt(%Prompt %prompt
|
|
626
|
+
call void @erasePrompt(%Prompt %prompt)
|
|
631
627
|
|
|
632
628
|
%isNull = icmp eq %Stack %rest, null
|
|
633
629
|
br i1 %isNull, label %done, label %next
|
|
@@ -776,3 +772,13 @@ define void @run_Pos(%Neg %f, %Pos %argument) {
|
|
|
776
772
|
tail call tailcc %Pos %functionPointer(%Object %object, %Evidence 0, %Pos %argument, %Stack %stack)
|
|
777
773
|
ret void
|
|
778
774
|
}
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
; Scope domains
|
|
778
|
+
!0 = !{!"types"}
|
|
779
|
+
|
|
780
|
+
; Scopes
|
|
781
|
+
!1 = !{!"stackValues", !0}
|
|
782
|
+
|
|
783
|
+
; Scope lists
|
|
784
|
+
!2 = !{!1}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title>Eclipse Public License 2.0 (EPL) | The Eclipse Foundation</title><meta property="og:title" content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=twitter:title content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta property="og:description" content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=twitter:description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=author content="Wayne Beaton"><link href=/favicon.ico rel=icon type=image/x-icon><meta property="og:image" content="https://www.eclipse.org/images/logos/eclipse-foundation-400x400.png"><meta name=twitter:image content="https://www.eclipse.org/images/logos/eclipse-foundation-400x400.png"><meta name=twitter:card content="summary"><meta name=twitter:site content="@eclipsefdn"><meta name=twitter:creator content="@eclipsefdn"><meta property="og:url" content="https://www.eclipse.org/legal/epl-2.0/"><meta property="og:type" content="website"><meta property="og:site_name" content="Eclipse Foundation"><meta name=keywords content="epl,epl-2.0,legal,foundation,eclipse,eclipse public license,license,licenses"><meta name=generator content="Hugo 0.110.0"><link rel=canonical href=https://www.eclipse.org/legal/epl-2.0/><link rel=alternate href=/legal/epl-2.0/index.xml type=application/rss+xml title><link rel=stylesheet href="/public/css/styles.css?v=
|
|
1
|
+
<!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title>Eclipse Public License 2.0 (EPL) | The Eclipse Foundation</title><meta property="og:title" content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=twitter:title content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta property="og:description" content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=twitter:description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=author content="Wayne Beaton"><link href=/favicon.ico rel=icon type=image/x-icon><meta property="og:image" content="https://www.eclipse.org/images/logos/eclipse-foundation-400x400.png"><meta name=twitter:image content="https://www.eclipse.org/images/logos/eclipse-foundation-400x400.png"><meta name=twitter:card content="summary"><meta name=twitter:site content="@eclipsefdn"><meta name=twitter:creator content="@eclipsefdn"><meta property="og:url" content="https://www.eclipse.org/legal/epl-2.0/"><meta property="og:type" content="website"><meta property="og:site_name" content="Eclipse Foundation"><meta name=keywords content="epl,epl-2.0,legal,foundation,eclipse,eclipse public license,license,licenses"><meta name=generator content="Hugo 0.110.0"><link rel=canonical href=https://www.eclipse.org/legal/epl-2.0/><link rel=alternate href=/legal/epl-2.0/index.xml type=application/rss+xml title><link rel=stylesheet href="/public/css/styles.css?v=1734290143"><script>(function(e,t,n,s,o){e[s]=e[s]||[],e[s].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var a=t.getElementsByTagName(n)[0],i=t.createElement(n),r=s!="dataLayer"?"&l="+s:"";i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+o+r,a.parentNode.insertBefore(i,a)})(window,document,"script","dataLayer","GTM-5WLCZXC")</script><script>var tableClasses="table"</script><link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel=stylesheet type=text/css></head><body><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5WLCZXC" height=0 width=0 style=display:none;visibility:hidden></iframe></noscript><a class=sr-only href=#content>Skip to main content</a><header class="header-wrapper header-wrapper" id=header><div class=header-toolbar><div class=container><div class=header-toolbar-row><div class="toolbar-btn toolbar-search-btn dropdown"><button class=dropdown-toggle id=toolbar-search type=button data-toggle=dropdown tabindex=0 aria-label=Search>
|
|
2
2
|
<i class="fa fa-search fa-lg" aria-role=none></i></button><div class="toolbar-search-bar-wrapper dropdown-menu dropdown-menu-right" aria-labelledby=toolbar-search><form action=https://www.eclipse.org/home/search method=get><div class=search-bar><input class=search-bar-input name=q placeholder=Search>
|
|
3
3
|
<button>
|
|
4
4
|
<i class="fa fa-search" type=submit></i></button></div></form></div></div><div class="toolbar-btn toolbar-user-menu-btn dropdown"><button class=dropdown-toggle id=toolbar-user-menu type=button data-toggle=dropdown tabindex=0 aria-label="User Menu">
|
|
@@ -47,15 +47,15 @@ open source software collaboration and innovation.</p></div><div class=mega-menu
|
|
|
47
47
|
<i class="main-sidebar-item-icon fa fa-chevron-down" aria-hidden=true></i></a><div class=collapse id=legal-epl-20><ul class="main-sidebar-item-submenu list-unstyled"><li class=submenu-item><a class=link-unstyled href=/legal/epl-2.0/ target=_self>About</a></li><li class=submenu-item><a class=link-unstyled href=/org/documents/epl-2.0/EPL-2.0.html target=_self>Plain HTML</a></li><li class=submenu-item><a class=link-unstyled href=/org/documents/epl-2.0/EPL-2.0.txt target=_self>Plain Text</a></li><li class=submenu-item><a class=link-unstyled href=/org/documents/epl-2.0/EPL-2.0.pdf target=_self>PDF</a></li><li class=submenu-item><a class=link-unstyled href=/legal/epl-2.0/faq/ target=_self>FAQ</a></li></ul></div></li></li><li class="main-sidebar-item main-sidebar-item-indented"><li class="main-sidebar-item main-sidebar-item-indented"><a class=link-unstyled role=button data-toggle=collapse href=#legal-epl-10 aria-expanded=false aria-controls=legal-epl-10><span>EPL-1.0</span>
|
|
48
48
|
<i class="main-sidebar-item-icon fa fa-chevron-down" aria-hidden=true></i></a><div class=collapse id=legal-epl-10><ul class="main-sidebar-item-submenu list-unstyled"><li class=submenu-item><a class=link-unstyled href=/org/documents/epl-v10.php target=_self>About</a></li><li class=submenu-item><a class=link-unstyled href=/org/documents/epl-v10.html target=_self>Plain HTML</a></li><li class=submenu-item><a class=link-unstyled href=/org/documents/epl-1.0/EPL-1.0.txt target=_self>Plain Text</a></li><li class=submenu-item><a class=link-unstyled href=/legal/epl/faq target=_self>FAQ</a></li></ul></div></li></li><li class="main-sidebar-item main-sidebar-item-indented"><li class="main-sidebar-item main-sidebar-item-indented"><a class=link-unstyled role=button data-toggle=collapse href=#legal-licenses aria-expanded=false aria-controls=legal-licenses><span>Licenses</span>
|
|
49
49
|
<i class="main-sidebar-item-icon fa fa-chevron-down" aria-hidden=true></i></a><div class=collapse id=legal-licenses><ul class="main-sidebar-item-submenu list-unstyled"><li class=submenu-item><a class=link-unstyled href=/legal/licenses#approved target=_self>Approved 3rd Party</a></li><li class=submenu-item><a class=link-unstyled href=/legal/licenses#nonapproved target=_self>Non Approved</a></li><li class=submenu-item><a class=link-unstyled href=/projects/handbook/#ip-copyright-headers target=_self>File Headers</a></li><li class=submenu-item><a class=link-unstyled href=/legal/non-code-licenses target=_self>Docs & Examples</a></li></ul></div></li></li><li class="main-sidebar-item main-sidebar-item-indented"><li class="main-sidebar-item main-sidebar-item-indented"><a class=link-unstyled role=button data-toggle=collapse href=#legal-specs aria-expanded=false aria-controls=legal-specs><span>Specifications</span>
|
|
50
|
-
<i class="main-sidebar-item-icon fa fa-chevron-down" aria-hidden=true></i></a><div class=collapse id=legal-specs><ul class="main-sidebar-item-submenu list-unstyled"><li class=submenu-item><a class=link-unstyled href=/projects/efsp/ target=_self>Specifications Process</a></li><li class=submenu-item><a class=link-unstyled href=/projects/efsp/operations.php target=_self>Specifications Operations</a></li><li class=submenu-item><a class=link-unstyled href=/legal/efsl target=_self>Specification License</a></li><li class=submenu-item><a class=link-unstyled href=/legal/tck target=_self>TCK License</a></li></ul></div></li></li></ul></aside></div></div></div></main><div class="eclipsefdn-featured-footer featured-footer" id=featured-footer data-publish-target=eclipse_org><div class=container><div class=row><div class="col-sm-24 featured-container"></div></div></div></div><p id=back-to-top><a class=visible-xs href=#>Back to the top</a></p><footer class=footer id=footer><div class=container><div class="footer-end-social-container margin-bottom-30"><div class=footer-end-social><p class="footer-end-social-text hidden-xs">Follow Us:</p><ul class="footer-end-social-links list-inline"><li><a class=link-unstyled href=https://twitter.com/EclipseFdn title="Twitter account"><span class=
|
|
51
|
-
<i class="fa fa-twitter fa-stack-1x fa-inverse" aria-hidden=true></i>
|
|
52
|
-
<span class=sr-only>Twitter account</span></span></a></li><li><a class=link-unstyled href=https://www.facebook.com/eclipse.org title="Facebook account"><span class=
|
|
53
|
-
<i class="fa fa-facebook fa-stack-1x fa-inverse" aria-hidden=true></i>
|
|
54
|
-
<span class=sr-only>Facebook account</span></span></a></li><li><a class=link-unstyled href=https://www.youtube.com/user/EclipseFdn title="Youtube account"><span class=
|
|
55
|
-
<i class="fa fa-youtube
|
|
56
|
-
<span class=sr-only>Youtube account</span></span></a></li><li><a class=link-unstyled href=https://www.linkedin.com/company/eclipse-foundation title="Linkedin account"><span class=
|
|
57
|
-
<i class="fa fa-linkedin fa-stack-1x fa-inverse" aria-hidden=true></i>
|
|
50
|
+
<i class="main-sidebar-item-icon fa fa-chevron-down" aria-hidden=true></i></a><div class=collapse id=legal-specs><ul class="main-sidebar-item-submenu list-unstyled"><li class=submenu-item><a class=link-unstyled href=/projects/efsp/ target=_self>Specifications Process</a></li><li class=submenu-item><a class=link-unstyled href=/projects/efsp/operations.php target=_self>Specifications Operations</a></li><li class=submenu-item><a class=link-unstyled href=/legal/efsl target=_self>Specification License</a></li><li class=submenu-item><a class=link-unstyled href=/legal/tck target=_self>TCK License</a></li></ul></div></li></li></ul></aside></div></div></div></main><div class="eclipsefdn-featured-footer featured-footer" id=featured-footer data-publish-target=eclipse_org><div class=container><div class=row><div class="col-sm-24 featured-container"></div></div></div></div><p id=back-to-top><a class=visible-xs href=#>Back to the top</a></p><footer class=footer id=footer><div class=container><div class="footer-end-social-container margin-bottom-30"><div class=footer-end-social><p class="footer-end-social-text hidden-xs">Follow Us:</p><ul class="footer-end-social-links list-inline"><li><a class=link-unstyled href=https://twitter.com/EclipseFdn title="Twitter account"><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
51
|
+
<i class="fa-brands fa-x-twitter fa-stack-1x fa-inverse" aria-hidden=true></i>
|
|
52
|
+
<span class=sr-only>Twitter account</span></span></a></li><li><a class=link-unstyled href=https://www.facebook.com/eclipse.org title="Facebook account"><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
53
|
+
<i class="fa-brands fa-facebook-f fa-stack-1x fa-inverse" aria-hidden=true></i>
|
|
54
|
+
<span class=sr-only>Facebook account</span></span></a></li><li><a class=link-unstyled href=https://www.youtube.com/user/EclipseFdn title="Youtube account"><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
55
|
+
<i class="fa-brands fa-youtube fa-stack-1x fa-inverse" aria-hidden=true></i>
|
|
56
|
+
<span class=sr-only>Youtube account</span></span></a></li><li><a class=link-unstyled href=https://www.linkedin.com/company/eclipse-foundation title="Linkedin account"><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
57
|
+
<i class="fa-brands fa-linkedin-in fa-stack-1x fa-inverse" aria-hidden=true></i>
|
|
58
58
|
<span class=sr-only>Linkedin account</span></span></a></li></ul></div></div><div class="footer-sections row equal-height-md font-bold"><div class=col-md-15><div class=row><section id=footer-eclipse-foundation class="footer-section col-sm-8"><div class=menu-heading>Eclipse Foundation</div><ul class=nav><li><a href=https://www.eclipse.org/org/>About</a></li><li><a href=https://projects.eclipse.org/>Projects</a></li><li><a href=https://www.eclipse.org/collaborations/>Collaborations</a></li><li><a href=https://www.eclipse.org/membership/>Membership</a></li><li><a href=https://www.eclipse.org/sponsor/>Sponsor</a></li></ul></section><section id=footer-legal class="footer-section col-sm-8"><div class=menu-heading>Legal</div><ul class=nav><li><a href=https://www.eclipse.org/legal/privacy/>Privacy Policy</a></li><li><a href=https://www.eclipse.org/legal/terms-of-use/>Terms of Use</a></li><li><a href=https://www.eclipse.org/legal/compliance/>Compliance</a></li><li><a href=https://www.eclipse.org/org/documents/Community_Code_of_Conduct.php>Code of Conduct</a></li><li><a href=https://www.eclipse.org/legal/>Legal Resources</a></li><li><a class=toolbar-manage-cookies href=# onclick=event.preventDefault()>Manage Cookies</a></li></ul></section><section id=footer-more class="footer-section col-sm-8"><div class=menu-heading>More</div><ul class=nav><li><a href=https://www.eclipse.org/security/>Report a Vulnerability</a></li><li><a href=https://status.eclipse.org/>Service Status</a></li><li><a href=https://www.eclipse.org/org/foundation/contact.php>Contact Us</a></li><li><a href=https://www.eclipse.org/projects/support/>Support</a></li></ul></section></div></div><div id=footer-end class="footer-section col-md-8 col-md-offset-1 col-sm-24"><div class=footer-end-newsletter><form id=mc-embedded-subscribe-form action=https://eclipsecon.us6.list-manage.com/subscribe/post method=post novalidate target=_blank><label class=footer-end-newsletter-label for=email>Subscribe to our Newsletter</label><div class=footer-end-newsletter-input-wrapper><input class=footer-end-newsletter-input type=email id=email name=EMAIL autocomplete=email placeholder="Enter your email address"><div><i class="fa fa-solid fa-envelope fa-lg" aria-hidden=true></i></div></div><input type=hidden name=u value=eaf9e1f06f194eadc66788a85>
|
|
59
59
|
<input type=hidden name=id value=46e57eacf1>
|
|
60
|
-
<input id=mc-embedded-subscribe type=submit name=subscribe hidden></form></div></div></div><div class="col-sm-24 margin-top-20"><div class=row><div id=copyright class=col-md-16><p id=copyright-text>Copyright © Eclipse Foundation AISBL. All Rights Reserved.</p></div></div></div><a href=# class=scrollup>Back to the top</a></div></footer><div id=footer-js><script src="/public/js/main.js?v1.0?v=
|
|
60
|
+
<input id=mc-embedded-subscribe type=submit name=subscribe hidden></form></div></div></div><div class="col-sm-24 margin-top-20"><div class=row><div id=copyright class=col-md-16><p id=copyright-text>Copyright © Eclipse Foundation AISBL. All Rights Reserved.</p></div></div></div><a href=# class=scrollup>Back to the top</a></div></footer><div id=footer-js><script src="/public/js/main.js?v1.0?v=1734290143"></script>
|
|
61
61
|
<script>(function(){})(jQuery,document)</script></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
module string/tty
|
|
2
|
-
|
|
3
|
-
// ANSI escape codes
|
|
4
|
-
namespace ANSI {
|
|
5
|
-
val CSI = "\u001b["
|
|
6
|
-
|
|
7
|
-
def escape(s: String) = CSI ++ s ++ "m"
|
|
8
|
-
|
|
9
|
-
val BLACK = escape("30")
|
|
10
|
-
val RED = escape("31")
|
|
11
|
-
val GREEN = escape("32")
|
|
12
|
-
val YELLOW = escape("33")
|
|
13
|
-
val BLUE = escape("34")
|
|
14
|
-
val MAGENTA = escape("35")
|
|
15
|
-
val CYAN = escape("36")
|
|
16
|
-
val WHITE = escape("37")
|
|
17
|
-
|
|
18
|
-
val BG_BLACK = escape("40")
|
|
19
|
-
val BG_RED = escape("41")
|
|
20
|
-
val BG_GREEN = escape("42")
|
|
21
|
-
val BG_YELLOW = escape("43")
|
|
22
|
-
val BG_BLUE = escape("44")
|
|
23
|
-
val BG_MAGENTA = escape("45")
|
|
24
|
-
val BG_CYAN = escape("46")
|
|
25
|
-
val BG_WHITE = escape("47")
|
|
26
|
-
|
|
27
|
-
val RESET = escape("0")
|
|
28
|
-
|
|
29
|
-
val BOLD = escape("1")
|
|
30
|
-
val FAINT = escape("2")
|
|
31
|
-
val ITALIC = escape("3")
|
|
32
|
-
val UNDERLINE = escape("4")
|
|
33
|
-
val BLINK = escape("5")
|
|
34
|
-
val REVERSE = escape("7")
|
|
35
|
-
val CROSSOUT = escape("9")
|
|
36
|
-
val OVERLINE = escape("53")
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
def red(text: String) = Formatted::colored(text, ANSI::RED)
|
|
40
|
-
def green(text: String) = Formatted::colored(text, ANSI::GREEN)
|
|
41
|
-
def dim(text: String) = Formatted::colored(text, ANSI::FAINT)
|
|
42
|
-
def bold(text: String) = Formatted::colored(text, ANSI::BOLD)
|
|
43
|
-
|
|
44
|
-
interface Formatted {
|
|
45
|
-
def supportsEscape(escape: String): Bool
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
namespace Formatted {
|
|
49
|
-
/// Run given block of code, allowing all formatting
|
|
50
|
-
def formatting[R] { prog : => R / Formatted }: R =
|
|
51
|
-
try { prog() } with Formatted {
|
|
52
|
-
def supportsEscape(escape: String) = resume(true)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/// Run given block of code, ignoring all formatting
|
|
56
|
-
def noFormatting[R] { prog : => R / Formatted }: R =
|
|
57
|
-
try { prog() } with Formatted {
|
|
58
|
-
def supportsEscape(escape: String) = resume(false)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
def tryEmit(escape: String): String / Formatted =
|
|
62
|
-
if (do supportsEscape(escape)) escape else ""
|
|
63
|
-
|
|
64
|
-
def colored(text: String, colorEscape: String): String / Formatted =
|
|
65
|
-
tryEmit(colorEscape) ++ text ++ tryEmit(ANSI::RESET)
|
|
66
|
-
}
|