eggtended-js
Version:
A extended version of the Egg programming language from the Eloquent Javascript book.
302 lines (260 loc) • 22.5 kB
HTML
<html>
<head>
<meta charset="utf-8">
<base data-ice="baseUrl" href>
<title data-ice="title">Test | eggtended-js</title>
<link type="text/css" rel="stylesheet" href="css/style.css">
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
<script src="script/prettify/prettify.js"></script>
<script src="script/manual.js"></script>
<meta name="description" content="An extended version of the Egg programming language"><meta property="og:type" content="website"><meta property="og:url" content="http://my-library.org"><meta property="og:site_name" content="eggtended-js"><meta property="og:title" content="eggtended-js"><meta property="og:image" content="https://i.imgur.com/9N4qe98.png"><meta property="og:description" content="An extended version of the Egg programming language"><meta property="og:author" content="https://github.com/Dibad"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="eggtended-js"><meta property="twitter:description" content="An extended version of the Egg programming language"><meta property="twitter:image" content="https://i.imgur.com/9N4qe98.png"></head>
<body class="layout-container" data-ice="rootContainer">
<header>
<a href="./">Home</a>
<a href="identifiers.html">Reference</a>
<a href="source.html">Source</a>
<a href="test.html" data-ice="testLink">Test</a>
<div class="search-box">
<span>
<img src="./image/search.png">
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
</span>
<ul class="search-result"></ul>
</div>
<a style="position:relative; top:3px;" href="https://github.com/Dibad/eggtended-js"><img width="20px" src="./image/github.png"></a></header>
<nav class="navigation" data-ice="nav"><div>
<ul>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkIterable">checkIterable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chunk">chunk</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getValidIndex">getValidIndex</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-ins">ins</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#interp">interp</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/interp/ast.js~Apply.html">Apply</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/interp/ast.js~Regex.html">Regex</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/interp/ast.js~Value.html">Value</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/interp/ast.js~Word.html">Word</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/interp/eggvm.js~Eggvm.html">Eggvm</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/interp/symboltable.js~SymbolTable.html">SymbolTable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SpecialForms">SpecialForms</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-TopEnv">TopEnv</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#parser">parser</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/parser/lexer.js~Lexer.html">Lexer</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/parser/parse.js~Parser.html">Parser</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/parser/tokenRegex.js~TokenRegex.html">TokenRegex</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-json2AST">json2AST</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-COMMA">COMMA</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-LP">LP</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-NEWLINE">NEWLINE</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-NUMBER">NUMBER</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-REGEX">REGEX</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-RP">RP</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-STRING">STRING</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-WHITES">WHITES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-WORD">WORD</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#repl">repl</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-eggCompleter">eggCompleter</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getPromptLine">getPromptLine</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-repl">repl</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-BLUE">BLUE</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-DEFAULT">DEFAULT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-GREEN">GREEN</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-RED">RED</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-YELLOW">YELLOW</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-eggClear">eggClear</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-eggExit">eggExit</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-eggHelp">eggHelp</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-eggInfo">eggInfo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-eggRun">eggRun</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-eggVersion">eggVersion</a></span></span></li>
</ul>
</div>
</nav>
<div class="content" data-ice="content"><h1>Test</h1>
<table class="test-summary">
<thead>
<tr>
<td class="test-description">Description</td>
<td class="test-target">Identifier</td>
</tr>
</thead>
<tbody data-ice="tests"><tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="0">
<td data-ice="testDescription" style="padding-left: 10px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/examples-test.js.html#lineNumber9"><p>Testing programs from 'examples/' folder</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/examples-test.js.html#lineNumber36">test/examples-test.js</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="2">
<td data-ice="testDescription" style="padding-left: 30px"><span><a href="test-file/test/examples-test.js.html#lineNumber38"><p>should be parsed correctly</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="2">
<td data-ice="testDescription" style="padding-left: 30px"><span><a href="test-file/test/examples-test.js.html#lineNumber47"><p>should print the expected output after execution</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="2">
<td data-ice="testDescription" style="padding-left: 30px"><span><a href="test-file/test/examples-test.js.html#lineNumber53">test/examples-test.js</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="0">
<td data-ice="testDescription" style="padding-left: 10px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/lexer-test.js.html#lineNumber7"><p>Testing Lexer class behaviour</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/lexer-test.js.html#lineNumber21"><p>should be able to tokenize a line and count the LP-RP balance</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/lexer-test.js.html#lineNumber36"><p>should tokenize from a file</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="0">
<td data-ice="testDescription" style="padding-left: 10px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber4"><p>Regex for LP token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber5"><p>should recognize ( as valid a token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber12"><p>should treat { as a synonym for (</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber19"><p>should treat [ as a synonym for (</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="0">
<td data-ice="testDescription" style="padding-left: 10px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber27"><p>Regex for RP token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber28"><p>should recognize ) as valid a token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber35"><p>should treat } as a synonym for )</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber42"><p>should treat ] as a synonym for )</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="0">
<td data-ice="testDescription" style="padding-left: 10px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber50"><p>Regex for COMMA token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber51"><p>should recognize , as valid a token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber58"><p>should recognize the : as an alias for ,</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="0">
<td data-ice="testDescription" style="padding-left: 10px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber69"><p>Regex for WHITES token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber70"><p>should recognize any quantity of space</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber77"><p>should recognize as white even strings with newlines</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber84"><p>should recognize as white one-line comments with # or ;</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber96"><p>should recognize as white multiline commments with /<em> </em>/</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="0">
<td data-ice="testDescription" style="padding-left: 10px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber109"><p>Regex for STRING token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber110"><p>should recognize anything between " " as valid a token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber122"><p>shouldn't recognize strings without " ". Those are words</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="0">
<td data-ice="testDescription" style="padding-left: 10px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber127"><p>Regex for WORD token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber128"><p>shouldn't include some special characters on the identifier</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber147"><p>should detect [] as a whole WORD, instead of LP, RP</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber154"><p>should detect := as a whole WORD; instead of COMMA, WORD</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="0">
<td data-ice="testDescription" style="padding-left: 10px"><span data-ice="testInterfaceToggle" class="toggle closed"></span><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber162"><p>Regex for NUMBER token</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber163"><p>should match integers, with and without sign</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
<tr class="test-interface" data-ice="testInterface" style="display: none;" data-test-depth="1">
<td data-ice="testDescription" style="padding-left: 20px"><span><a href="test-file/test/tokenRegex-test.js.html#lineNumber187"><p>should match for floats, floating point and exponential notation</p>
</a></span></td>
<td data-ice="testTarget" class="test-target">-</td>
</tr>
</tbody>
</table>
</div>
<footer class="footer">
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>
<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>