2020-05-19 11:43:42 +03:00

750 lines
9.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Compiler</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Compiler</h1>
<section>
<header>
<h2>Compiler</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Compiler"><span class="type-signature"></span>new Compiler<span class="signature">(mf)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Creates a new message compiler. Called internally from <a href="MessageFormat.html#compile">MessageFormat#compile</a>.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>mf</code></td>
<td class="type">
<span class="param-type"><a href="MessageFormat.html">MessageFormat</a></span>
</td>
<td class="description last"><p>A MessageFormat instance</p></td>
</tr>
</tbody>
</table>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>locales</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>The locale identifiers that are used by the compiled functions</p></td>
</tr>
<tr>
<td class="name"><code>runtime</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Names of the core runtime functions that are used by the compiled functions</p></td>
</tr>
<tr>
<td class="name"><code>formatters</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>The formatter functions that are used by the compiled functions</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="compiler.js.html">compiler.js</a>, <a href="compiler.js.html#line13">line 13</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".bidiMarkText"><span class="type-signature">(static) </span>bidiMarkText<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Utility formatter function for enforcing Bidi Structured Text by using UCC</p>
<p> List inlined from data extracted from CLDR v27 &amp; v28
To verify/recreate, use the following:</p>
<pre class="prettyprint source"><code>git clone https://github.com/unicode-cldr/cldr-misc-full.git
cd cldr-misc-full/main/
grep characterOrder -r . | tr '&quot;/' '\t' | cut -f2,6 | grep -C4 right-to-left</code></pre>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="compiler.js.html">compiler.js</a>, <a href="compiler.js.html#line59">line 59</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".funcname"><span class="type-signature">(static) </span>funcname<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Utility function for escaping a function name iff required</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="compiler.js.html">compiler.js</a>, <a href="compiler.js.html#line44">line 44</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".propname"><span class="type-signature">(static) </span>propname<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Utility function for quoting an Object's key value iff required</p>
<p> Quotes the key if it contains invalid characters or is an
ECMAScript 3rd Edition reserved word (for IE8).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="compiler.js.html">compiler.js</a>, <a href="compiler.js.html#line29">line 29</a>
</li></ul></dd>
</dl>
<h4 class="name" id="compile"><span class="type-signature"></span>compile<span class="signature">(src, lc, plurals)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Recursively compile a string or a tree of strings to JavaScript function sources</p>
<p> If <code>src</code> is an object with a key that is also present in <code>plurals</code>, the key
in question will be used as the locale identifier for its value. To disable
the compile-time checks for plural &amp; selectordinal keys while maintaining
multi-locale support, use falsy values in <code>plurals</code>.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>src</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">object</span>
</td>
<td class="description last"><p>the source for which the JS code should be generated</p></td>
</tr>
<tr>
<td class="name"><code>lc</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>the default locale</p></td>
</tr>
<tr>
<td class="name"><code>plurals</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>a map of pluralization keys for all available locales</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="compiler.js.html">compiler.js</a>, <a href="compiler.js.html#line153">line 153</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Compiler.html">Compiler</a></li><li><a href="MessageFormat.html">MessageFormat</a></li><li><a href="Runtime.html">Runtime</a></li></ul><h3>Namespaces</h3><ul><li><a href="MessageFormat.formatters.html">formatters</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Tue Sep 27 2016 00:30:24 GMT+0300 (EEST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>