@effekt-lang/effekt 0.13.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/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
|
+
}
|
|
@@ -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
|
-
}
|