Sorry to dig up an old thread but since my issue related pretty near exactly to the original question I thought it best to reopen this thread instead of open a new one. I play an online game called
Kingdom of Loathing. There is a program called KOLMafia that automates various game activities and has its own scripting language similar to javascript. I've come up with a wordfile entry for this program's scripting language that does almost everything I want it to except for my questions below. First, here is the wordfile entry:
Code: Select all
/L10"KOLMafia ASH" Line Comment = // File Extensions = ASH
//Marker Characters = "[]"
/Delimiters = !@%^&*()-+=|/{}[\];" , .?
/Function String = "%^{boolean^}^{float^} [a-zA-Z]*(*)*"
/Function String 1 = "%^{int^}^{string^} [a-zA-Z]*(*)*"
/Function String 2 = "%^{void^}^{class^} [a-zA-Z]*(*)*"
/Function String 3 = "%^{effect^}^{familiar^} [a-zA-Z]*(*)*"
/Function String 4 = "%^{item^}^{location^} [a-zA-Z]*(*)*"
/Function String 5 = "%^{skill^}^{stat^} [a-zA-Z]*(*)*"
/Indent Strings = "{" "else"
/Unindent Strings = "}" "else"
/C1"Keywords"
$class $effect $familiar $item $location $skill $stat $zodiac
boolean
class
effect else
familiar false float
if import int item
location
return
skill stat string
true
void
while
zodiac
/C2"Object References"
[
]
/C3"ASH functions"
adventure add_item_condition
boolean_to_string bounty_hunter_wants buy
can_eat can_drink can_interact class_to_string cli_execute closet_amount council create
effect_to_string equip equip_familiar
familiar_to_string float_to_string
have_bartender have_chef have_effect have_skill
int_to_string item_amount item_to_string
location_to_string
mind_control museum_amount my_adventures my_basestat my_buffedstat my_class my_closetmeat my_familiar my_hp my_inebriety
my_level my_maxhp my_maxmp my_meat my_mp my_name my_zodiac
print put_closet put_shop put_stash
shop_amount skill_to_string stash_amount stat_to_string storage_amount
take_closet take_storage trade_bounty_hunter trade_hermit trade_trapper
unequip use use_skill
zodiac_to_string
/C4"Operators"
!
%
&&
*
+
-
// /
<
=
>
||
/C5"Separators"
(
)
,
;
{
}
[
]
Question 1:
I'd like to be able to highlight everything in between the [ and ] brackets in a non-comment color. I can get the actual brackets highlighted but not the contained text (which may include spaces). I've tried the first suggestion you posted above but it did not highlight the contents.
Question 2:
This particular scripting language has a function syntax of:
returntype functionname( paramtype1 paramName1, etc..)
and you can see how I implemented checking for functions, but it only left me options for 12 different prefixes for function return types. Is there any way to string together the ^{prefix1^} expressions or is it limited to just 2 at a time?
You can grab a copy of the file I'm editing
here. The name of the file is Ascension.ash, and its in plain text format. It is not a windows executable file or script.
By the way, this tool is absolutely the best editor I've ever used. I'm incredibly impressed with how versatile the options are. Keep up the great work!