I’d bet your here to learn how to make your own programming language using js! (im on mobile so I cant make code blocks :()
This Will NOT Tell You How To Do The HTML and CSS Only The Parser!
Create a function called “parse” with argument one named ttp for text to parse, it should look like this:
We now need to create something to convert the text givin into something computer readable. We're gonn replace every \n that doesnt have a ; before it with a ; then replace ;\n with just ; last we're gonna replace all \n with nothing, here's how:
Now our commands are splitted with ;'s so we can split with ; but type our commands with either ; or backspace!
Splitting The Commands So We Can Parse!
We now need to split our code in to an array so our script can understand what to do! We'll do it like this:
We Now Need To Loop Through It:
We need to check the command now. We can use if(cmd == 'CommandName')
Here's an example:
That's all! We can now do this to run the code: