Re: What is a token
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
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
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
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
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
:-) 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
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
What is a token
Hi all. Recently in an effort to help Mark Wieder with the formatting portion of GLX2 v4, I came across an issue where the block comments were not formatting correctly, and any handler with a block comment didn’t auto indent. In looking through the code, I discovered that the handler responsible for this was checking to see if the first TOKEN of a line was “/*” but when checking in the message box, “/*” is not a token! “?” is and “*” is, and any word is along with a list of special characters. I get that the dictionary states that this function should be used with trepidation, but my question is, since the 2 characters are like a reserved word, shouldn’t they be considered tokens, along with the reverse “*/“? Note that block comments do not have to be at the beginning of a line. So the question is, should I submit this as a bug, or no? Bob S ___ 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