My own scripting language

Wessel

Newcomer
Joined
Nov 14, 2003
Messages
20
Location
The Netherlands
Hi !

I have created my own scripting language. It's pretty cool, alot of people i know are already writing small programs with it.
But i have ran into a problem with "if situations". A if-situation looks likes this in my language:

%var = "10"
%var2 = "20"

<?var < "11" & > "5"
<?var2 = "20"
console.schrijfregel("Yay!")
</var2?>
</var?>

This works perfectly. But i think this isn't the right approach. I want to be able to create if-situations NOT depending on variabele, like this <?var = "" </var?> but like this:

<?var = ""
//do something
?>
<? else
//do something
?>
//close if situation

My parser checks if the first line is true, then it checks for </variabele?>, and if the first line is true it will execute lines until the line number of </variabele?> is reached, if its false then it will skip all lines until the linenumber of </variabele?>. But i want to change it to the above example. Is this possible?
 
Do you mean that you are trying to work on implementing the Else part of the if-situation, or working on having if-situations with fixed values to check? :)
 
Back
Top