@effekt-lang/effekt 0.71.0 → 0.73.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/effekt.effekt +3 -0
- package/libraries/common/string.effekt +17 -0
- package/licenses/eclipse public license, version 2.0 - epl-2.0.html +5 -5
- package/licenses/mit license - mit-license.html +49 -50
- package/licenses/the bsd license - bsd-license.html +49 -50
- package/licenses/the mit license - mit.html +50 -51
- package/package.json +1 -1
package/bin/effekt
CHANGED
|
Binary file
|
|
@@ -152,6 +152,9 @@ extern def infixPlusPlus(s1: String, s2: String) at {}: String =
|
|
|
152
152
|
ret %Pos %spz
|
|
153
153
|
"""
|
|
154
154
|
|
|
155
|
+
/// Beware that this function is backend-dependent.
|
|
156
|
+
/// If you want to get the number of bytes that a string would take up in a UTF-8 encoding,
|
|
157
|
+
/// use `string::utf8ByteLength` instead.
|
|
155
158
|
extern def length(str: String) at {}: Int =
|
|
156
159
|
js "${str}.length"
|
|
157
160
|
chez "(string-length ${str})"
|
|
@@ -204,6 +204,23 @@ def lastIndexOf(str: String, sub: String, from: Int): Option[Int] = {
|
|
|
204
204
|
go(from)
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
namespace internal {
|
|
208
|
+
def utf8ByteLength(str: String): Int = stream::sum {
|
|
209
|
+
for {str.each} { (c: Char) =>
|
|
210
|
+
do emit(c.utf8ByteCount)
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/// Returns the number of bytes that the given `str` would take up in a UTF-8 encoding.
|
|
216
|
+
extern def utf8ByteLength(str: String) at {io, global}: Int =
|
|
217
|
+
jsNode "Buffer.byteLength(${str}, 'utf8')"
|
|
218
|
+
llvm """
|
|
219
|
+
%x = call %Int @c_bytearray_size(%Pos ${str})
|
|
220
|
+
ret %Int %x
|
|
221
|
+
""" // via bytearray::fromString(str).length
|
|
222
|
+
default { internal::utf8ByteLength(str) }
|
|
223
|
+
|
|
207
224
|
// TODO more efficient (native) implementations could be integrated as follows
|
|
208
225
|
|
|
209
226
|
// extern def indexOf(str: String, sub: String) at {}: Option[Int] =
|
|
@@ -1,8 +1,8 @@
|
|
|
1
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>
|
|
2
|
-
<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/og-image.jpg"><meta name=twitter:image content="https://www.eclipse.org/images/og-image.jpg"><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.144.2"><link rel=canonical href=https://www.eclipse.org/legal/epl-2.0/><link rel=alternate href=https://www.eclipse.org//legal/epl-2.0/index.xml type=application/rss+xml title><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> <script type="module" crossorigin src="/public/assets/legal/epl-2.0/index-
|
|
3
|
-
<link rel="modulepreload" crossorigin href="/public/assets/main-
|
|
4
|
-
<link rel="modulepreload" crossorigin href="/public/assets/get-body-content-
|
|
5
|
-
<link rel="modulepreload" crossorigin href="/public/assets/generate-body-content-
|
|
2
|
+
<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/og-image.jpg"><meta name=twitter:image content="https://www.eclipse.org/images/og-image.jpg"><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.144.2"><link rel=canonical href=https://www.eclipse.org/legal/epl-2.0/><link rel=alternate href=https://www.eclipse.org//legal/epl-2.0/index.xml type=application/rss+xml title><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> <script type="module" crossorigin src="/public/assets/legal/epl-2.0/index-B7lJW2b4.js"></script>
|
|
3
|
+
<link rel="modulepreload" crossorigin href="/public/assets/main-DMD1QOmo.js">
|
|
4
|
+
<link rel="modulepreload" crossorigin href="/public/assets/get-body-content-D33PtpOf.js">
|
|
5
|
+
<link rel="modulepreload" crossorigin href="/public/assets/generate-body-content-BZFBJ1cI.js">
|
|
6
6
|
<link rel="stylesheet" crossorigin href="/public/assets/main-BSGkhNuL.css">
|
|
7
7
|
</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 href=#main class=skip-link>Skip to content</a><div class=eclipsefdn-featured-story-banner data-publish-target=eclipse_org></div><header class="header-wrapper header-wrapper" id=header><div class="navigation-bar dark"><div class=container><div class=navigation-bar-inner><div class=navigation-bar-left><a class="focus-highlight focus-inverse" href=/><img class=navigation-bar-brand src=https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-foundation-white-orange.svg alt="Eclipse Foundation"></a></div><nav class="navigation-bar-nav hidden-xs hidden-sm"><ul><li><button type=button class="btn btn-link" data-target=join-us-menu>Join us</button></li><li><button type=button class="btn btn-link" data-target=what-we-do-menu>What we do</button></li><li><button type=button class="btn btn-link" data-target=resources-menu>Resources</button></li><li><button type=button class="btn btn-link" data-target=about-us-menu>About us</button></li></ul></nav><div class=navigation-bar-right><div class="navigation-bar-controls hidden-xs hidden-sm"><ul><li class=dropdown><a class="dropdown-toggle link-unstyled focus-highlight" tabindex=0 id=search-dropdown-toggle data-toggle=dropdown href=# aria-label=Search><i class="fa-solid fa-magnifying-glass" aria-hidden=true></i></a><form class="search-bar dropdown-menu dropdown-menu-right" aria-labelledby=search-dropdown-toggle action=https://www.eclipse.org/home/search/ method=get><input class=search-bar-input name=q placeholder=Search>
|
|
8
8
|
<button class="btn btn-link" type=submit>
|
|
@@ -39,7 +39,7 @@ Manage cookies</a></li></ul></li></ul></div><div class="navigation-bar-ctas hidd
|
|
|
39
39
|
<i class="external-icon fa-solid fa-arrow-up-right-from-square" aria-hidden=true></i></li><li><a href=https://marketplace.eclipse.org/ target=_blank>Eclipse IDE</a>
|
|
40
40
|
<i class="external-icon fa-solid fa-arrow-up-right-from-square" aria-hidden=true></i></li><li><a href=https://open-vsx.org/ target=_blank>Open VSX</a>
|
|
41
41
|
<i class="external-icon fa-solid fa-arrow-up-right-from-square" aria-hidden=true></i></li></ul></div></nav></div></div><div class="menu hidden" id=about-us-menu><div class=container><nav><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-regular fa-moon rotate-90" aria-hidden=true></i></span><h2 class=menu-heading>The Foundation</h2></div><ul><li><a href=https://www.eclipse.org/about/>About</a></li><li><a href=https://www.eclipse.org/org/foundation/staff/>Meet the team</a></li><li><a href=https://www.eclipse.org/org/governance/>Board & governance</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-user-group" aria-hidden=true></i></span><h2 class=menu-heading>Our members</h2></div><ul><li><a href=https://www.eclipse.org/membership/>Become a member</a></li><li><a href=https://www.eclipse.org/membership/explore-membership/>View member directory</a></li><li><a href=https://membership.eclipse.org/portal target=_blank>Access member portal</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-regular fa-bookmark" aria-hidden=true></i></span><h2 class=menu-heading>Sponsorship</h2></div><ul><li><a href=https://www.eclipse.org/sponsor/>Become a sponsor</a></li><li><a href=https://www.eclipse.org/org/our-sponsors/>Sponsor directory</a></li></ul></div><div class=submenu><div class=menu-heading-group><span class=menu-pre><i class="fa-solid fa-cube" aria-hidden=true></i></span><h2 class=menu-heading>More</h2></div><ul><li><a href=https://www.eclipse.org/careers/>Join our team</a></li><li><a href=https://www.eclipse.org/org/artwork/>Explore our brand</a></li><li><a href=https://www.eclipse.org/org/foundation/contact.php>Contact us</a></li></ul></div></nav></div></div></div></header><main id=main><nav aria-label=Breadcrumb><div class=container><ol class=breadcrumb><li><a href=https://www.eclipse.org/>Home</a></li><li><a href=https://www.eclipse.org/legal/>Eclipse Foundation Legal …</a></li><li class=active>Eclipse Public License 2.0 (EPL)</li></ol></div></nav><div class="container padding-bottom-30"><div class=row><div class=col-md-6><aside class=sidebar><a class="sidebar-toggle sidebar-toggle-open" type=button href=#sidebar-open><i class="fa-solid fa-bars" aria-hidden=true></i>
|
|
42
|
-
</a><a class="sidebar-toggle sidebar-toggle-close" type=button href=#sidebar-close><i class="fa-solid fa-close" aria-hidden=true></i></a><nav><ul class=sidebar-menu><li class=menu-group><a href=#legal data-toggle=collapse aria-expanded=true class=dropdown-toggle>Legal</a><ul class="collapse in" id=legal><li class=menu-subgroup><a href=#legal-eca data-toggle=collapse aria-expanded=false class=dropdown-toggle>ECA</a><ul class=collapse id=legal-eca><li><a href=/legal/eca
|
|
42
|
+
</a><a class="sidebar-toggle sidebar-toggle-close" type=button href=#sidebar-close><i class="fa-solid fa-close" aria-hidden=true></i></a><nav><ul class=sidebar-menu><li class=menu-group><a href=#legal data-toggle=collapse aria-expanded=true class=dropdown-toggle>Legal</a><ul class="collapse in" id=legal><li class=menu-subgroup><a href=#legal-eca data-toggle=collapse aria-expanded=false class=dropdown-toggle>ECA</a><ul class=collapse id=legal-eca><li><a href=/legal/eca/>About</a></li><li><a href=https://accounts.eclipse.org/user/eca>Sign</a></li><li><a href=https://accounts.eclipse.org/user/eca>Validation tool</a></li></ul></li><li class=menu-subgroup><a href=#legal-epl-20 data-toggle=collapse aria-expanded=false class=dropdown-toggle>EPL-2.0</a><ul class=collapse id=legal-epl-20><li><a href=/legal/epl-2.0/>About</a></li><li><a href=/org/documents/epl-2.0/EPL-2.0.html>Plain HTML</a></li><li><a href=/org/documents/epl-2.0/EPL-2.0.txt>Plain text</a></li><li><a href=/org/documents/epl-2.0/EPL-2.0.pdf>PDF</a></li><li><a href=/legal/epl-2.0/faq/>FAQ</a></li></ul></li><li class=menu-subgroup><a href=#legal-epl-10 data-toggle=collapse aria-expanded=false class=dropdown-toggle>EPL-1.0</a><ul class=collapse id=legal-epl-10><li><a href=/org/documents/epl-1.0/>About</a></li><li><a href=/org/documents/epl-1.0/EPL-1.0.html>Plain HTML</a></li><li><a href=/org/documents/epl-1.0/EPL-1.0.txt>Plain text</a></li><li><a href=/legal/epl/faq/>FAQ</a></li></ul></li><li class=menu-subgroup><a href=#legal-licenses data-toggle=collapse aria-expanded=false class=dropdown-toggle>Licenses</a><ul class=collapse id=legal-licenses><li><a href=/legal/licenses#approved>Approved 3rd party</a></li><li><a href=/legal/licenses#nonapproved>Non approved</a></li><li><a href=/projects/handbook/#ip-copyright-headers>File headers</a></li><li><a href=/legal/non-code-licenses>Docs & examples</a></li></ul></li><li class=menu-subgroup><a href=#legal-specs data-toggle=collapse aria-expanded=false class=dropdown-toggle>Specifications</a><ul class=collapse id=legal-specs><li><a href=/projects/efsp/>Specifications process</a></li><li><a href=/projects/efsp/operations.php>Specifications operations</a></li><li><a href=/legal/efsl>Specification license</a></li><li><a href=/legal/tck>TCK license</a></li></ul></li></ul></li></ul></nav></aside></div><div class=col-md-18><div id=content></div></div></main><aside class=featured-footer id=featured-footer><div class="eclipsefdn-featured-footer container-fluid" data-publish-target=eclipse_org><div class=row><div class="col-sm-24 featured-container"></div></div></div></aside><footer class=footer><div class=container><div class=footer-inner><section class=links-section><ul><li>Eclipse Foundation</li><li><ul><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></li></ul><ul><li>Legal</li><li><ul><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><button type=button class="btn btn-link toolbar-manage-cookies">Manage Cookies</button></li></ul></li></ul><ul><li>More</li><li><ul><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></li></ul></section><section class=social-media-section><p class="subheading text-tertiary">See what we're up to</p><ul class=social-media-list><li><a href=https://x.com/EclipseFdn aria-label=X><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
43
43
|
<i class="fa-brands fa-x-twitter fa-stack-1x fa-inverse" aria-hidden=true></i></span></a></li><li><a href=https://bsky.app/profile/eclipse.org aria-label=Bluesky><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
44
44
|
<i class="fa-brands fa-bluesky fa-stack-1x fa-inverse" aria-hidden=true></i></span></a></li><li><a href=https://mastodon.social/@EclipseFdn aria-label=Mastodon><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|
|
45
45
|
<i class="fa-brands fa-mastodon fa-stack-1x fa-inverse" aria-hidden=true></i></span></a></li><li><a href=https://www.facebook.com/eclipse.org aria-label=Facebook><span class=fa-stack><i class="fa-solid fa-circle fa-stack-2x" aria-hidden=true></i>
|