UNPKG

esther-medina-quintero-parser-nearley

Version:
97 lines (71 loc) 3.31 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Source: src/lex.js | Source: src/lex.js</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/bootstrap.min.css"> <link type="text/css" rel="stylesheet" href="styles/prettify-jsdoc.css"> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/tui-doc.css"> </head> <body> <nav class="lnb" id="lnb"> <div class="logo" style=""> <img src="img/toast-ui.png" width="100%" height="100%"> </div> <div class="title"> <h1><a href="index.html" class="link">Source: src/lex.js</a></h1> </div> <div class="search-container" id="search-container"> <input type="text" placeholder="Search"> <ul></ul> </div> <div class="lnb-api hidden"><h3>Externals</h3><ul><li><a href="external-Grammar.html">Grammar</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="external:Grammar_sub"></div></li></ul></div><div class="lnb-api hidden"><h3>Global</h3><ul><li><a href="global.html#buildNestedApplies">buildNestedApplies</a></li><li><a href="global.html#buildNumberValue">buildNumberValue</a></li><li><a href="global.html#buildStringValue">buildStringValue</a></li><li><a href="global.html#buildWordApplies">buildWordApplies</a></li><li><a href="global.html#compile">compile</a></li><li><a href="global.html#Tokens">Tokens</a></li></ul></div> </nav> <div id="resizer"></div> <div class="main" id="main"> <section> <article> <pre class="prettyprint source linenums"><code>const { makeLexer } = require("moo-ignore"); /** Tokens object: definitions */ const Tokens = { EOF: "__EOF__", WHITES: { match: /\s+/, lineBreaks: true }, LINECOMMENTS: /#.*/, MULTILINECOMMENTS: { match: /\/[*](?:.|\n)*?[*]\//, lineBreaks: true }, NUMBER: { match: /[-+]?\d+\.?\d*(?:[eE][-+]?\d+)?/, value: s => Number(s) }, STRING: /"(?:[^"\\]|\\.)*"/, WORD: /[^\s(),"]+/, "(": "(", ")": ")", ",": ",", }; let lexer = makeLexer(Tokens, ["WHITES", "LINECOMMENTS", "MULTILINECOMMENTS"], { eof: true }); module.exports = { lexer }; </code></pre> </article> </section> </div> <footer> <img class="logo" src="img/toast-ui.png" style=""> <div class="footer-text">NHN Entertainment. Frontend Development Lab</div> </footer> <script>prettyPrint();</script> <script src="scripts/jquery.min.js"></script> <script src="scripts/tui-doc.js"></script> <script src="scripts/linenumber.js"></script> <script> var id = '_sub'.replace(/"/g, '_'); var selectedApi = document.getElementById(id); // do not use jquery selector var $selectedApi = $(selectedApi); $selectedApi.removeClass('hidden'); $selectedApi.parent().find('.glyphicon').removeClass('glyphicon-plus').addClass('glyphicon-minus'); showLnbApi(); </script> </body> </html>