Add lua parser
This commit is contained in:
parent
547d39d73b
commit
6fd1f6a46d
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/};
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<title>Lua Playground</title>
|
||||
<meta charset="utf-8" />
|
||||
<script src="lib/codeflask.min.js"></script>
|
||||
<script src="lib/prism-lua.min.js"></script>
|
||||
<script src="lib/fengari-web.js"></script>
|
||||
<link rel="stylesheet" href="assets/css/main.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Lua Playground</h1>
|
||||
</header>
|
||||
<div id="container">
|
||||
<div id="codeContainer"><div id="code"></div></div><!--
|
||||
--><div id="console">
|
||||
</div>
|
||||
<input type="button" onclick="run()" value="Exécuter !" id="runBtn" />
|
||||
</div>
|
||||
<footer>
|
||||
Romain de Laage - CC0
|
||||
</footer>
|
||||
<script src="assets/js/editor.js"></script>
|
||||
<script>
|
||||
const flask = getEditor("#code", "lua")
|
||||
|
||||
function run() {
|
||||
fengari.load(flask.getCode())()
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue