Allow "or else" construct to be used for error recovery

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1016 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-07-09 17:14:49 +00:00
parent 9073764a62
commit 53808346a4
5 changed files with 65 additions and 22 deletions
@@ -8,8 +8,13 @@ $built_in_functions = array(
'to_string' =>'',
'to_int' =>'',
'to_real' =>'',
'to_number' =>'',
'to_boolean' =>'',
'to_color' =>'',
// numbers
'abs' =>'',
'random_int' =>'',
'random_real' =>'',
// text
'to_upper' =>'',
'to_lower' =>'',
@@ -36,6 +41,8 @@ $built_in_functions = array(
'number_of_items' =>'',
'sort_list' =>'',
'filter_list' =>'',
'random_shuffle' =>'',
'random_select' =>'',
// keywords
'expand_keywords' =>'', 'expand_keywords_rule'=>'expand_keywords',
'keyword_usage' =>'',
@@ -159,7 +166,7 @@ function highlight_script($code) {
if ($matches[2] == '{') $string .= 's';
} else if (preg_match("@^\\#.*@",$code, $matches)) {
$ret .= "<span class='hl-comment'>" . $matches[0] . "</span>";
} else if (preg_match("@^([-+*/=!.\@]|&lt;|&gt;)+|^:=@",$code, $matches)) {
} else if (preg_match("@^([-+*/=!.\@^]|&lt;|&gt;)+|^:=@",$code, $matches)) {
$ret .= "<span class='hl-op'>" . $matches[0] . "</span>";
} else if (preg_match("@^([}]|[\\(\\)\\[\\]{,]+)@",$code, $matches)) {
$ret .= "<span class='hl-paren'>" . $matches[0] . "</span>";