Menu

#4 Plugin False positive for error (ooRexx)

1.0
open
nobody
None
2017-04-21
2017-04-19
Jon Wolfers
No

I often label early returns with an arrow thus

Return 0          -->|

This is a valid line comment in oorexx.
The plugin identifies this as an error with a list of expected elements following the pipe

if the comment is on a line of it's own

                 -->|

The error on the pipe is
<keyword list=""> expected, got '|'

Also, the last line of the code below shows an error on the word self -- "instruction terminator expected got 'self'"

      if thisEvent~BookOnline = .true
      then do
         clist~deleteAll
         alist~deleteAll
         alist~setColumnWidthpx(3,'AUTO')
         alist~select(ord)
      end /* DO */
      else self~refreshRegularsAndBooked  -- refresh the regulars and customer lists

When this is the first line of the script

/* ========================================================================= */

then you get an "'=' unexpected" error

hth
Jon

Discussion

  • aseik

    aseik - 2017-04-21

    Hi,

    Thanks for the report.

    I fixed the error with '|' at the end of line comments. This fix will be in the next version of the plugin.

    I don't get the two last errors when I try out your code, could you provide more information? Also,
    do you use the latest version of the plugin?

    Alexander

     
  • Jon Wolfers

    Jon Wolfers - 2017-04-21

    Hi Alexander,

    the plugin reports version 1.0.3.1 Beta

    In case it helps, this is the entire Method for the <instruction terminator=""> expected, got 'self' error

    /* ------------------------------------------------------------------------- */
    ::method onEventSelected unguarded
    /* ------------------------------------------------------------------------- */
    /* an event has been selected                                                */
    expose elist dtev thisevent PB_Regs custEd lastdatetime alist clist
    use arg id, index, state, force? = .false
    
       if state == 'UNSELECTED'                                -- no event selected
       then PB_Regs~disable                           -- so disable regulars button
       else do
          uid = elist~itemText(index,1)                           -- find the event
    
                                    -- it is a reselection of the current event
          if thisEvent~isA(.icalEvent) -
          ,  uid = thisEvent~uid       -
          , force? \= .true
          then RETURN                                                          -->|
    
       -- set the current event variable to point to this
          custEd~title = ''
          do event over dtev
             if event~uid = uid
             then thisEvent = event
          end /* DO */
    
       -- ensure event is in mirror
          eventID = self~getclassId(thisEvent)
    
          if thisEvent~BookOnline = .true
          then do
             clist~deleteAll
             alist~deleteAll
             if .nil = thisEvent~BookingUrl
             then tag = 'BOOK ONLINE'
             else do
                tag = 'BOOK ONLINE' thisEvent~BookingURL
                self~start('EVENTBRITEATTENDEES' -
                          ,thisevent             -
                          ,thisevent~UID~copy)                       -- fork --v->|
             end /* DO */
             ord = alist~addRow(,,'','','Book','Online',tag)
             alist~setColumnWidthpx(3,'AUTO')
             alist~select(ord)
          end /* DO */
          else self~refreshRegularsAndBooked  -- refresh the regulars and booked customer lists
    
       end
    
       self~title = 'WLBC Studio -' lastDateTime~normalDate '-' ,
                     thisEvent~dtStart~normalTime~left(5) ICAL_unescape(thisEvent~summary)
    
       self~statBarTitle  -- clear StatBar
       .my.log~logQ('event selected:' ICAL_unescape(thisEvent~summary))
    

    If I put a 'say' between the 'else' and the 'self' then the error message changes to "<instruction terminator=""> expected, got 'say'"
    if I place a ';' immediately after the else then the error also goes away, but this is optional in rexx.

    As for the '=' unexpected error, II start all my scripts with a comment box of equals, but only ones with a filetype of rex seems to show the error. It may help to know that the editor offers that I may edit an ooRexx fragment, which consists of the line of '='s without the surrounding / /.

    If you 'disable inject language or reference' (whatever that means) the error goes away, so perhaps I have a setting incorrectly set that assumes first comments are injections???

    hth

    Jon

     

Log in to post a comment.