I've been thinking about creating a text parser and have spent some time researching the topic.
Although I know that JavaScript may not be the ideal choice for building text parsers, it's currently the only scripting language I'm comfortable with.
This is what my code looks like at the moment:
<script>
function makeCode() {
for (i = 0; i < userCode.length; i++) {
if (userCode.substring("print:"(0, 6)) {
document.write(usercode.substring("print:"(6,0));
}
</script>
<style>
p {
text-align: center;
color: #cc0000;
}
h1 {
text-align: center;
font-family: Impact;
color: #cc0000;
}
body {
text-align: center;
}
form {
text-align: center;
}
</style>
<h1>NCPL</h1>
<p style="font-size: 10px">In Browser NinjaCorp Programming Language Editor</p>
</head>
<body>
<form name="userCode">
<textarea id="userCode" name="userCode" cols="80" rows="20" placeholder="Type your code here"></textarea></br>
<a href="javascript:makeCode()"><button type="button">Run Code!</button></a>
</form>