JEFFS SCRIPTING ENGINE

Quick Lesson on Basic Scripting Syntax

// The language is based on C, so it should look very familiar
// Comments are prefixed by two forward slashes

// All operations function just like C
x = 0;
x += 1;

// The only exception is that you must specify using parenthesis
// in any expression that has more than one operator:
x = ( x + 1 );

// White spaces is ignored in almost all cases so
x = 1 + 1;
// is the same as
x=1+1;
// The only exception is with else if statements, which must have
// a space between the words else and if

// Here is an example if statement
if(x==2) {
	x = 3;
}
else if(x==1) {
	x = 2;
}
else
{
	x = 1;
}

// Here is an example While statement
while(x==3)
{
	x += 1;
}

// There are no For statements or Switch statements.
// You must use if or while to create a similiar structure.

// the end.
// the below is notes for myself regarding the development of the language
// feel free to read it for more information, if it makes any sense...

if / else STATEMENT
	These are examples of if else pairs, note how the scripting language
	handles nested elses if they are not inside braces. It always assigns
	them to the furthest outside if statement. Make sure to use braces in
	this case.

		if (exp)
			statement
		else
			statement

		if (exp)
			if(exp)
				statement
			else
				statement

		if (exp) {
			if(exp)
				statement
		}
		else
			statement
		
		


What works
	if
	( )
	{ }
	==
	;
	

Heres What I Got:
- morpheme class
- operators: = == ( ) ;
- if
- while
- identifier table
- operators + - * /
- operators += -= *= /=
- operators > < >= <= != !
- on the fly variables (prefix with $ for strings)
- strings longer than 255 in parser
- update identifier table when strings change!
- function indentifiers (using leet asm hacks)
- speed test (anywhere from 1/300 to 1/7 the speed of C)
- tried map for identifiers, but it was slower how lame is that?)
- support for += type assignment operators when left side is type_string
- blocks in function parameters
- blocks AS function parameters (using TYPE_MORPHEME)
- if and while statements should work without ( ) around the action
- if and while statements can call functions as their action without using ( )
- support for floats!
- function support for returning strings and floats
- support for += -= *= /= if subject is String reference
- better support for math operators on strings
- better support for type evaluation in math operators
- added else and else if support
- break
- exit
- added better if support
- added curly braces
- passing of code to functions works (make sure to specify the correct type for parameters and return values tho!)
- changed useralloc to flags can be either IDENT_FLAG_CONSTANT or IDENT_FLAG_USERALLOC
- fixed some problems ith nested if else if stuff... I hope that is everything now.
- since function call parameter types override the eval_type expression of the parameter morphemes,
  I switched the way it handles ints to use eval_float and then round the result to an int in the case
  of int parameters. This allows us to use float expressions as parameter and have them properly evaluated
  before being rounded off to an int and passed.

NOTES:
	if(1) if(1) break; is okay now, but else statement must be bracketed?

1666+ lines of code

Stuff To Add:
- support for weird characters in strings like "
- add qoute block checking when doing parameter seperation checking so that , in a string wont cause a bug
- support for doubles (even if not in function calls, for game variables)
- && and || operators
- user defined functions
- object.property style references

possible expansions for future:
- clean up custom identifiers using (int / string / (function?)) declarations
- for