Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Minor parser thing
Mon, Oct 24 2016 9:55 AMPermanent Link

Matthew Jones

uses WebCore;

TokenTypes = ( Plus, Minus, Times, Divide );

function Test : TokenTypes;
begin
 Result := Minus;
end;

This fails to compile because Minus is defined as a string in WebCore. The error is shown as being in the Result assignment, and not the redefinition of Minus.
Even better would be to allow the scope to be resolved, but just being aware of this is what is important.


Matthew Jones
Tue, Oct 25 2016 3:04 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< This fails to compile because Minus is defined as a string in WebCore. The error is shown as being in the Result assignment, and not the redefinition of Minus.  Even better would be to allow the scope to be resolved, but just being aware of this is what is important. >>

I think this is already fixed for the next build...checking...nope, must have been something else.

Noted.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 25 2016 3:22 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

Actually, that's all wrong - types are scoped to a unit in EWB, so it's perfectly valid to have that identifier declared that way in both places. However, it's still an issue for your code because EWB does not support prefacing types with unit/namespaces in order to manually declare the scope.  So, you just have to change the name. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Oct 26 2016 4:30 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

>  So, you just have to change the name. Smile

Which is what I did. I would sort of presume though that the scope rules would be "local to global" so that the value defined in the local unit would win. Not important really, but not prefixing the global "minus" and "plus" etc will stop others using it. Not that that matters to me, as I usually prefix my enums with a two letter enum matching sequence.

Hence it being a minor thing.

--

Matthew Jones
Tue, Nov 1 2016 3:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Which is what I did. I would sort of presume though that the scope rules would be "local to global" so that the value defined in the local unit would win. >>

Hmm, good point...checking...yep, you're right.  I'll see what's going on there and make sure that it's fixed.

Tim Young
Elevate Software
www.elevatesoft.com
Image