small Analyzer quibble

Started by kdmoyers, April 29, 2019, 04:51:13 AM

Previous topic - Next topic

kdmoyers

The analyzer complains "error 5025: Expression continues past logical end" about line 6
but line 6 does work as intended.  Maybe analyzer needs a tweak?  Not sure.

(PS: I'm loving the new maps.)

Code (winbatch) Select

    Const = MapCreate()
    ptrglobaldefine(Const)
    Const["mastertitle"] = "Fancy"

    #definefunction croak(a,c)
      mt = *ptrGlobal(Const)["mastertitle"]
      terminate(a,mt,c)
      return
    #endfunction

    croak(1,"bye bye")

    exit
The mind is everything; What you think, you become.

stanl

I can't replicate your code, but maybe move the function at the beginning of the script, or after exit as a gosub :UDFS 

kdmoyers

Good idea, I'll try it....
...nope, it just follows the line around where ever you put it.

I think the syntax analyzer is just not fond of the syntax on that line.
The mind is everything; What you think, you become.

td

You certainly like to play with WIL pointers.   The problem in the syntax analyzer is not specific to WIL maps.  You can reproduce it using conventional WIL arrays as well.  The analyzer does not like a function call preceding the array expression in this case.   We will get it straightened out for the next release.

As per usual, thanks for reporting the problem.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

You won the dailydouble.  Run the following through the Analyzer and the WBS debugger.

Code (winbatch) Select
#definefunction Useless(_p)
   return _p
#endfunction

a[0] = 1
x = *Useless(&a)[0]
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

One final note on the subject.  Array brackets probably should not be permitted following function calls in WIL statements for syntax consistency's sake. But once the cat is out there is no putting it back in the bag.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kdmoyers

QuoteYou certainly like to play with WIL pointers

Guilty as charged, sir!

Quote from: td on April 30, 2019, 09:13:28 AMOne final note on the subject.  Array brackets probably should not be permitted following function calls in WIL statements for syntax consistency's sake. But once the cat is out there is no putting it back in the bag.

Thanks for making allowances for our cats Tony!  :)

             _,'|             _.-''``-...___..--';
           /_ \'.      __..-' ,      ,--...--'''
          <\    .`--'''       `     /'
           `-';'               ;   ; ;
     __...--''     ___...--_..'  .;.'
    (,__....----'''       (,..--''
The mind is everything; What you think, you become.