-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 714ce1a
Showing
264 changed files
with
38,438 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/** | ||
* Convert between Uint8Array and Base64 strings | ||
* Allows for any encoded JS string to be converted (as opposed to atob()/btoa() which only supports latin1) | ||
* | ||
* Original implementation by madmurphy on MDN | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_1_–_JavaScript%27s_UTF-16_%3E_base64 | ||
*/ | ||
|
||
function b64ToUint6(nChr) { | ||
return nChr > 64 && nChr < 91 | ||
? nChr - 65 | ||
: nChr > 96 && nChr < 123 | ||
? nChr - 71 | ||
: nChr > 47 && nChr < 58 | ||
? nChr + 4 | ||
: nChr === 43 | ||
? 62 | ||
: nChr === 47 | ||
? 63 | ||
: 0 | ||
} | ||
|
||
export function decodeToArray(base64string, blockSize) { | ||
var sB64Enc = base64string.replace(/[^A-Za-z0-9\+\/]/g, ''), | ||
nInLen = sB64Enc.length, | ||
nOutLen = blockSize | ||
? Math.ceil(((nInLen * 3 + 1) >>> 2) / blockSize) * blockSize | ||
: (nInLen * 3 + 1) >>> 2, | ||
aBytes = new Uint8Array(nOutLen) | ||
|
||
for ( | ||
var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; | ||
nInIdx < nInLen; | ||
nInIdx++ | ||
) { | ||
nMod4 = nInIdx & 3 | ||
nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << (18 - 6 * nMod4) | ||
if (nMod4 === 3 || nInLen - nInIdx === 1) { | ||
for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { | ||
aBytes[nOutIdx] = (nUint24 >>> ((16 >>> nMod3) & 24)) & 255 | ||
} | ||
nUint24 = 0 | ||
} | ||
} | ||
|
||
return aBytes | ||
} | ||
|
||
function uint6ToB64(nUint6) { | ||
return nUint6 < 26 | ||
? nUint6 + 65 | ||
: nUint6 < 52 | ||
? nUint6 + 71 | ||
: nUint6 < 62 | ||
? nUint6 - 4 | ||
: nUint6 === 62 | ||
? 43 | ||
: nUint6 === 63 | ||
? 47 | ||
: 65 | ||
} | ||
|
||
export function encodeFromArray(bytes) { | ||
var eqLen = (3 - (bytes.length % 3)) % 3, | ||
sB64Enc = '' | ||
|
||
for ( | ||
var nMod3, nLen = bytes.length, nUint24 = 0, nIdx = 0; | ||
nIdx < nLen; | ||
nIdx++ | ||
) { | ||
nMod3 = nIdx % 3 | ||
/* Uncomment the following line in order to split the output in lines 76-character long: */ | ||
/* | ||
if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) { sB64Enc += "\r\n"; } | ||
*/ | ||
nUint24 |= bytes[nIdx] << ((16 >>> nMod3) & 24) | ||
if (nMod3 === 2 || bytes.length - nIdx === 1) { | ||
sB64Enc += String.fromCharCode( | ||
uint6ToB64((nUint24 >>> 18) & 63), | ||
uint6ToB64((nUint24 >>> 12) & 63), | ||
uint6ToB64((nUint24 >>> 6) & 63), | ||
uint6ToB64(nUint24 & 63) | ||
) | ||
nUint24 = 0 | ||
} | ||
} | ||
|
||
return eqLen === 0 | ||
? sB64Enc | ||
: sB64Enc.substring(0, sB64Enc.length - eqLen) + (eqLen === 1 ? '=' : '==') | ||
} | ||
|
||
/** | ||
* URL-safe variants of Base64 conversion functions (aka base64url) | ||
* @see https://tools.ietf.org/html/rfc4648#section-5 | ||
*/ | ||
|
||
export function encodeFromArrayUrlSafe(bytes) { | ||
return encodeURIComponent( | ||
encodeFromArray(bytes) | ||
.replace(/\+/g, '-') | ||
.replace(/\//g, '_') | ||
) | ||
} | ||
|
||
export function decodeToArrayUrlSafe(base64string) { | ||
return decodeToArray( | ||
decodeURIComponent(base64string) | ||
.replace(/-/g, '+') | ||
.replace(/_/g, '/') | ||
) | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
window.ALL_CRATES = ["egglog"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-081576b923113409.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="egglog" data-themes="" data-resource-suffix="" data-rustdoc-version="1.79.0 (129f3b996 2024-06-10)" data-channel="1.79.0" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-e32f0c247825364d.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../egglog/index.html">egglog</a><span class="version">0.3.0</span></h2></div><div class="sidebar-elems"><section><ul class="block"><li><a href="#macros">Macros</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Aliases</a></li></ul></section></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../egglog/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><h1>List of all items</h1><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.EGraph.html">EGraph</a></li><li><a href="struct.Function.html">Function</a></li><li><a href="struct.NotFoundError.html">NotFoundError</a></li><li><a href="struct.Primitive.html">Primitive</a></li><li><a href="struct.RunReport.html">RunReport</a></li><li><a href="struct.SerializeConfig.html">SerializeConfig</a></li><li><a href="struct.SimplePrimitive.html">SimplePrimitive</a></li><li><a href="struct.TermDag.html">TermDag</a></li><li><a href="struct.TypeInfo.html">TypeInfo</a></li><li><a href="struct.Value.html">Value</a></li><li><a href="ast/struct.CorrespondingVar.html">ast::CorrespondingVar</a></li><li><a href="ast/struct.Facts.html">ast::Facts</a></li><li><a href="ast/struct.GenericActions.html">ast::GenericActions</a></li><li><a href="ast/struct.GenericFunctionDecl.html">ast::GenericFunctionDecl</a></li><li><a href="ast/struct.GenericRewrite.html">ast::GenericRewrite</a></li><li><a href="ast/struct.GenericRule.html">ast::GenericRule</a></li><li><a href="ast/struct.GenericRunConfig.html">ast::GenericRunConfig</a></li><li><a href="ast/struct.IdentSort.html">ast::IdentSort</a></li><li><a href="ast/struct.ResolvedVar.html">ast::ResolvedVar</a></li><li><a href="ast/struct.Schema.html">ast::Schema</a></li><li><a href="ast/struct.Symbol.html">ast::Symbol</a></li><li><a href="ast/struct.Variant.html">ast::Variant</a></li><li><a href="ast/parse/struct.DUMMY_SPAN.html">ast::parse::DUMMY_SPAN</a></li><li><a href="ast/parse/struct.Span.html">ast::parse::Span</a></li><li><a href="constraint/struct.AllEqualTypeConstraint.html">constraint::AllEqualTypeConstraint</a></li><li><a href="constraint/struct.Problem.html">constraint::Problem</a></li><li><a href="constraint/struct.SimpleTypeConstraint.html">constraint::SimpleTypeConstraint</a></li><li><a href="sort/struct.BigIntSort.html">sort::BigIntSort</a></li><li><a href="sort/struct.BigRatSort.html">sort::BigRatSort</a></li><li><a href="sort/struct.BoolSort.html">sort::BoolSort</a></li><li><a href="sort/struct.EqSort.html">sort::EqSort</a></li><li><a href="sort/struct.F64Sort.html">sort::F64Sort</a></li><li><a href="sort/struct.FunctionSort.html">sort::FunctionSort</a></li><li><a href="sort/struct.I64Sort.html">sort::I64Sort</a></li><li><a href="sort/struct.MapSort.html">sort::MapSort</a></li><li><a href="sort/struct.MultiSetSort.html">sort::MultiSetSort</a></li><li><a href="sort/struct.NotEqualPrimitive.html">sort::NotEqualPrimitive</a></li><li><a href="sort/struct.RationalSort.html">sort::RationalSort</a></li><li><a href="sort/struct.SetSort.html">sort::SetSort</a></li><li><a href="sort/struct.StringSort.html">sort::StringSort</a></li><li><a href="sort/struct.UnitSort.html">sort::UnitSort</a></li><li><a href="sort/struct.VecSort.html">sort::VecSort</a></li><li><a href="util/struct.SymbolGen.html">util::SymbolGen</a></li></ul><h3 id="enums">Enums</h3><ul class="all-items"><li><a href="enum.Error.html">Error</a></li><li><a href="enum.ExtractReport.html">ExtractReport</a></li><li><a href="enum.RunMode.html">RunMode</a></li><li><a href="enum.SerializedNode.html">SerializedNode</a></li><li><a href="enum.Term.html">Term</a></li><li><a href="ast/enum.Change.html">ast::Change</a></li><li><a href="ast/enum.GenericAction.html">ast::GenericAction</a></li><li><a href="ast/enum.GenericCommand.html">ast::GenericCommand</a></li><li><a href="ast/enum.GenericExpr.html">ast::GenericExpr</a></li><li><a href="ast/enum.GenericFact.html">ast::GenericFact</a></li><li><a href="ast/enum.GenericNCommand.html">ast::GenericNCommand</a></li><li><a href="ast/enum.GenericSchedule.html">ast::GenericSchedule</a></li><li><a href="ast/enum.Literal.html">ast::Literal</a></li><li><a href="ast/enum.Subdatatypes.html">ast::Subdatatypes</a></li><li><a href="ast/parse/enum.ParseError.html">ast::parse::ParseError</a></li><li><a href="constraint/enum.Constraint.html">constraint::Constraint</a></li><li><a href="constraint/enum.ConstraintError.html">constraint::ConstraintError</a></li><li><a href="constraint/enum.ImpossibleConstraint.html">constraint::ImpossibleConstraint</a></li></ul><h3 id="traits">Traits</h3><ul class="all-items"><li><a href="trait.PrimitiveLike.html">PrimitiveLike</a></li><li><a href="ast/trait.ToSexp.html">ast::ToSexp</a></li><li><a href="constraint/trait.TypeConstraint.html">constraint::TypeConstraint</a></li><li><a href="sort/trait.FromSort.html">sort::FromSort</a></li><li><a href="sort/trait.IntoSort.html">sort::IntoSort</a></li><li><a href="sort/trait.Presort.html">sort::Presort</a></li><li><a href="sort/trait.Sort.html">sort::Sort</a></li><li><a href="util/trait.FreshGen.html">util::FreshGen</a></li></ul><h3 id="macros">Macros</h3><ul class="all-items"><li><a href="macro.match_term_app.html">match_term_app</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="ast/parse/fn.parse_expr.html">ast::parse::parse_expr</a></li><li><a href="ast/parse/fn.parse_program.html">ast::parse::parse_program</a></li><li><a href="sort/fn.literal_sort.html">sort::literal_sort</a></li></ul><h3 id="types">Type Aliases</h3><ul class="all-items"><li><a href="type.ArcSort.html">ArcSort</a></li><li><a href="type.Subst.html">Subst</a></li><li><a href="type.TermId.html">TermId</a></li><li><a href="ast/type.Action.html">ast::Action</a></li><li><a href="ast/type.Actions.html">ast::Actions</a></li><li><a href="ast/type.Command.html">ast::Command</a></li><li><a href="ast/type.Expr.html">ast::Expr</a></li><li><a href="ast/type.Fact.html">ast::Fact</a></li><li><a href="ast/type.FunctionDecl.html">ast::FunctionDecl</a></li><li><a href="ast/type.NCommand.html">ast::NCommand</a></li><li><a href="ast/type.Rewrite.html">ast::Rewrite</a></li><li><a href="ast/type.Rule.html">ast::Rule</a></li><li><a href="ast/type.RunConfig.html">ast::RunConfig</a></li><li><a href="ast/type.Schedule.html">ast::Schedule</a></li><li><a href="ast/type.Subsume.html">ast::Subsume</a></li><li><a href="sort/type.PreSort.html">sort::PreSort</a></li><li><a href="util/type.IndexMap.html">util::IndexMap</a></li><li><a href="util/type.IndexSet.html">util::IndexSet</a></li></ul></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `desugar` mod in crate `egglog`."><title>egglog::ast::desugar - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-081576b923113409.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="egglog" data-themes="" data-resource-suffix="" data-rustdoc-version="1.79.0 (129f3b996 2024-06-10)" data-channel="1.79.0" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-e32f0c247825364d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../egglog/index.html">egglog</a><span class="version">0.3.0</span></h2></div><h2 class="location"><a href="#">Module desugar</a></h2><div class="sidebar-elems"><h2><a href="../index.html">In egglog::ast</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../../egglog/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../../index.html">egglog</a>::<wbr><a href="../index.html">ast</a>::<wbr><a class="mod" href="#">desugar</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../../src/egglog/ast/desugar.rs.html#1-405">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
window.SIDEBAR_ITEMS = {}; |
Oops, something went wrong.