|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Mon Oct 30, 2006 11:38 pm
Syntax editor eta |
Was just wondering if we could see syntax editor in the next version or not.
ALL of the errors i get are based on cmud crashing when it finds bad syntax etc. so i cant really test it to its potential using my current 15k line system, until i can fix the syntax!!
Thanks zugg |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Oct 30, 2006 11:58 pm |
CMUD already has a syntax editor. Press Ctrl-K in the settings editor to syntax-check your script, or turn on the Syntax Highlighting in the tools menu.
But if you have a 15k line script (geesh!) then it's going to take you a while since Ctrl-K will only find one error at a time and it also doesn't handle word-wrapping quite right.
It's best to syntax check each trigger and alias individually.
Also, the syntax highlighting is only a guideline...it's using a syntax highlighting engine that doesn't fully understand the scripting language. This is done because of performance issues. So always use Ctrl-K to make a real syntax check.
If this isn't what you are talking about, then tell me what you mean by a "syntax editor". But the syntax checking in CMUD is already much better than in zMUD (which often doesn't flag syntax errors that it should). |
|
|
|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Oct 31, 2006 11:50 am |
sorry i should have been more specific. yup, a feature on the menu, exactly where it should have been. its just my own stupidity.
so yeah, thousands of lines to go. lets start with line 1. heh
one problem im having is actually getting over the basic changes. the below works exactly as intended in zmud.... however in cmud i get unmatched braces row 0 col 139
Code: |
#if ((!@mist) and !(%ismember( "anorexia", @myafflictions))) {
#if (%ismember( "windpipe", @myafflictions)) {
#alarm +3 {@herbcure = 0}
outp shirolos
eat shirolos
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
} {
outp shirolos
eat shirolos
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
}
}
#if ((!@mist) and (%ismember( "anorexia", @myafflictions))) {
#if (%ismember( "windpipe", @myafflictions)) {
#alarm +3 {@herbcure = 0}
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
outp shirolos
eat shirolos
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
} {
outp shirolos
eat shirolos
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
}
} |
Thanks again |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Oct 31, 2006 5:29 pm |
Here's some good news for you:
I thought about a new feature that I'm going to add to the next version which is a "Compatibility Report". It will be a menu option in the settings editor that will run on any settings shown in the tree view (even if expanded...but this means it will use the current filter settings). For each setting that it tests, it will check for various known syntax changes from zMUD to CMUD (like "%1", %%1, etc) and also test to see if each setting compiles.
It will display the result in an HTML report, with hyperlinks to various help topics for any warnings that are detected.
This will be a good way to run through your entire package and see which settings compile and which don't. I think this will be a really useful feature for existing zMUD users. I'm going to try and add it for this week's version.
This report will also run automatically when you load a *.MUD file and it gets converted to a new package.
I'll test your script and let you know what I find with it. It looks fine on first glance, so it might be a parser bug. |
|
|
|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Oct 31, 2006 6:02 pm |
Note to everyone -
Ask advice from microsoft, they ask you for £49.99 a month for thier support package. Ask zuggsoft for advice, get a possible feature added to solve your problems for free.
That sounds really good. The main problem im getting is compatability, even with scripts that apparently have no issue. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Tue Oct 31, 2006 6:11 pm |
It's a parser bug
Try just the first #IF, and it'll still show as unmatched braces. Then remove the #ALARM line, and it works.
Same if you remove both #ALARMs then both IFs work together fine |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Tue Oct 31, 2006 6:14 pm |
Actually, it looks like a dodgy script and a parser error ;)
Unless I'm mistaken, then the #ALARM syntax is wrong
#alarm +3 {@herbcure = 0}
should be
#alarm +3 {herbcure = 0} ?
Infact, if you remove the @ from before herbcure then it compiles properly
Code: |
#if ((!@mist) and !(%ismember( "anorexia", @myafflictions))) {
#if (%ismember( "windpipe", @myafflictions)) {
#alarm +3 {herbcure = 0}
outp shirolos
eat shirolos
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
} {
outp shirolos
eat shirolos
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
}
}
#if ((!@mist) and (%ismember( "anorexia", @myafflictions))) {
#if (%ismember( "windpipe", @myafflictions)) {
#alarm +3 {herbcure = 0}
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
outp shirolos
eat shirolos
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
} {
outp shirolos
eat shirolos
#if (@equilibrium) {light %item( @megillospipe, 1)}
smoke %item( @megillospipe, 1)
}
} |
|
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Oct 31, 2006 8:15 pm |
Yep, that would do it. The @var=value indirect syntax isn't allowed. It should always be just var=value. To use the indirect syntax you can use the #VAR command: #VAR @varname value. But this was removed from the var=value syntax because most of the time when people were using @var=value they weren't getting what they expected because they didn't intended to use indirect syntax and were just confused.
|
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Tue Oct 31, 2006 9:58 pm |
The parser said the error was in the wrong place though - it detected "unmatched braces row 0 col 139" when it should have detected a different error, namely the @var=val error.
|
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Tue Oct 31, 2006 10:04 pm |
Oh, the Compatibility Report sounds very cool btw. Any chance of links in it to scripts that aren't compiling?
|
|
|
|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Oct 31, 2006 10:50 pm |
well it seems that all my problems in all my scripts are related to improperly used @s. Oh woe is me!
10 lines down, 14990 to go. heh. think ill wait for the final release before i get down to fixin it all. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Oct 31, 2006 10:50 pm |
Seb, yeah, I noticed the wrong location too. It looks like what's happening is that the new multi-line syntax is telling the parser to treat indented lines as continuations of the previous line, so it thinks it's all one long line. I'll see if I can fix that in the next version. Certainly isn't very useful at reporting syntax errors when the location is messed up like this.
Not sure about the links to the scripts yet. I'll have to wait until I implement it to see what I can do. But I think it should be possible. I already trap link clicks in the help system to display the correct topic, so I should be able to expand that to link to settings. |
|
|
|
|
|