Version 1.2.5

Discussion of the Regnus Parser for VB6.
Post Reply
User avatar
Ryan
Site Admin
Posts: 142
Joined: Wed Nov 11, 2009 pm30 8:19 pm
Contact:

Version 1.2.5

Post by Ryan »

This thread is for the discussion of the Regnus Parser for VB6, version 1.2.5

Changes this version:

  • Fixed bug causing numeric values not to be parsed correctly for nested references.

More details and download: http://www.regnus-scripting.info/parsers/vb6

veryalien
Posts: 13
Joined: Wed Apr 16, 2014 am30 9:13 am

Re: Version 7.20.5

Post by veryalien »

I've put this here under Windows, but this post might relate more to the VB6 implementation and slight differences to the PHP version. I've only been running Windows and PHP Regnus versions.

I accidentally forget the literal expression brackets for a label, and depending on the parser platform, Regnus returns slightly confusing errors.

Code: Select all

GROUP START
ENTRY <StartPass>#_(Truelabel);
ENTRY <StartFail>#_Truelabel;

GROUP truthtable
ENTRY <Truelabel>true


StartPass works correctly. The literal label Truelabel is found and returned as "true".

StartFail generates an error - and I understand why - that's not the issue here! Without the brackets, the reference Truelabel can't be found, but it returns different errors on Windows and PHP.
(Maybe this effect is already fixed for Regnus 5.5?)

StartFail on Regnus for Windows v7.20.5 (VB6) returns:
Regnus Script Error: Label "<>" not found!

StartFail Regnus for PHP 1.7.4 returns:
Regnus Script Error: Reference to non-existant group 'TRUELABEL'!

In this case, I would argue that the PHP version is actually giving the more correct error!
Without any literal brackets, the reference should be a group name from which to select an entry.
From this error message I realised that Regnus was looking for a group, as I'd missed the literal brackets.
(Stylewise, it might be even nicer to return the original label or reference that matches the actual script, rather than the uppercase version. I can then more easily find it in a text editor without doing a caseless search.)

However, on Windows/VB6 it seems to be silently failing with the result of the expression Truelabel.
The Windows/VB6 error is, in my opinion, very mis-leading as it shows the 'empty' result of not finding anything for the label expression.
It took me a while to notice I had, yet again, missed those literal brackets and, from the Windows/VB6 error message, I couldn't work out what was actually wrong with the label! In a large script, potentially with more label references, I'd have no idea about which reference was wrong!

Neil

User avatar
Ryan
Site Admin
Posts: 142
Joined: Wed Nov 11, 2009 pm30 8:19 pm
Contact:

Re: Version 1.2.5

Post by Ryan »

That's an interesting spot. The difference in the error reports in the two parsers is due to the fact that the PHP parser exits as soon as it finds an error, whereas the VB6 parser reports the last error encountered before parsing was completed or aborted, so error messages do vary a little sometimes when multiple errors are encountered.

In this case, it seems that the VB6 parser is attempting to continue parsing even when it encounters a non-existant group, and of course therefore trying to find a label with no name, which is a little odd! I'll look into it shortly and find out if there's a way to ensure a more helpful error message.

(In the meantime, the built-in debugger in the Windows parser should find and report the error more usefully!)

Ryan

Post Reply