Re: What is a token

2020-04-12 Thread Mark Wieder via use-livecode

A token is passed among nodes in a network to allow subway entry. :P

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What is a token

2020-04-12 Thread Mark Wieder via use-livecode

On 4/12/20 8:51 AM, Bob Sneidar via use-livecode wrote:

How about:

if “/*" is among the words of


No, I've got it working here for the trivial case by replacing "/*" with 
numtochar(5) and then back again at the end of formatting. But that 
doesn't deal with the more general case of


put " what about /* in a string" into tVariable


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What is a token

2020-04-12 Thread Bob Sneidar via use-livecode
How about:

if “/*" is among the words of

Bob S


> On Apr 12, 2020, at 8:47 AM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 4/12/20 12:49 AM, Mark Waddingham via use-livecode wrote:
> 
>> If you want to see if a line starts with a multi-line comment then you 
>> should do:
>>   if word 1 of tLine begins with "/*" then ...
> 
> The solution isn't that simple, since multiline comments can begin anywhere 
> in a line, as in /* this is the start of one.
> 
> And once you take care of that, you'd probably trip over quoted literals, as 
> in
> 
> if word 1 of tLine begins with "/*" the
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What is a token

2020-04-12 Thread Mark Wieder via use-livecode

On 4/12/20 12:49 AM, Mark Waddingham via use-livecode wrote:

If you want to see if a line starts with a multi-line comment then you 
should do:


   if word 1 of tLine begins with "/*" then ...


The solution isn't that simple, since multiline comments can begin 
anywhere in a line, as in /* this is the start of one.


And once you take care of that, you'd probably trip over quoted 
literals, as in


if word 1 of tLine begins with "/*" the

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What is a token

2020-04-12 Thread Bob Sneidar via use-livecode
Mark Wieder, 

I think what we will have to do when you encounter an open block comment that 
is not followed by a close block comment in a single line is toggle a variable 
to true, and check each subsequent line for a close block comment, formatting 
everything in between, then toggling the variable to false. 

I’ll go ahead and try an implement that and send you a fix. If the code is on 
Github, I’ll submit there. 

Bob S


> On Apr 12, 2020, at 6:17 AM, Bob Sneidar via use-livecode 
>  wrote:
> 
> :-) That is exactly what I submitted to Mark Wieder as a fix. Am I becoming 
> as smart as Mark Waddingham?? LOL!
> 
> Bob S
> 
> 
>> On Apr 12, 2020, at 12:49 AM, Mark Waddingham via use-livecode 
>>  wrote:
>> 
>> If you want to see if a line starts with a multi-line comment then you 
>> should do:
>> 
>> if word 1 of tLine begins with "/*" then ...
>> 
>> Warmest Regards,
>> 
>> Mark.
>> 
>> -- 
>> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
>> LiveCode: Everyone can create apps
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What is a token

2020-04-12 Thread Bob Sneidar via use-livecode
:-) That is exactly what I submitted to Mark Wieder as a fix. Am I becoming as 
smart as Mark Waddingham?? LOL!

Bob S


> On Apr 12, 2020, at 12:49 AM, Mark Waddingham via use-livecode 
>  wrote:
> 
> If you want to see if a line starts with a multi-line comment then you should 
> do:
> 
>  if word 1 of tLine begins with "/*" then ...
> 
> Warmest Regards,
> 
> Mark.
> 
> -- 
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What is a token

2020-04-12 Thread Mark Waddingham via use-livecode

On 2020-04-11 22:22, Bob Sneidar via use-livecode wrote:

So the question is, should I submit this as a bug, or no?


No you shouldn't as it isn't a bug :)

The 'token' chunk is a wrapper around the internal routine the engine 
uses to divide a script text up into tokens which are then parsed. This 
routine also does the 'skipping' over of whitespace and comments. As 
'/*' is part of a comment it is ignored, just like any spaces in between 
actual tokens.


For example:

   put token 2 of "/* this is a comment */ put x into y"

Will put 'x' because the only 'tokens' in that string are 'put', 'x', 
'into' and 'y'.


If you want to see if a line starts with a multi-line comment then you 
should do:


  if word 1 of tLine begins with "/*" then ...

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode