-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.jade
30 lines (30 loc) · 1.23 KB
/
index.jade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//output:index.html
doctype html
html
head
meta(charset='utf8')
title The Coding Programming Language - Interpreter
script(src='peg.js')
script(src='coding.js')
script(src='https://code.jquery.com/jquery-3.1.1.min.js')
style.
textarea{
font-family:monospace;
}
body(style='overflow:hidden')
textarea#x(style='resize:none;width:100%;height:100%;position:absolute;top:0;left:0;font-family:monospace;padding:1%;color:#333' placeholder='Code goes here...')
div(style='z-index:100;position:fixed;top:0;right:0;font-family:monospace;color:#777;margin-right:1%;text-align:right')
h3 The <a href='https://github.com/molarmanful/codinglang' target='_blank' style='color:#999'>Coding</a> Programming Language
small Official interpreter
button#r(style='z-index:100;position:fixed;bottom:0;right:0;font-family:monospace;background-color:transparent;border:1px solid #777;color:#777')
h1 Run Code
script.
r.onclick=_=>{
[a,b]=Coding.eval(x.value)
dv=document.createElement('html')
b.map(i=>$(dv).append(i.outerHTML||i))
w=window.open('')
w.document.write(dv.innerHTML)
console.log(a)
console.log(b.map(x=>x.outerHTML||x))
}