Author Topic: Inconsistent parsing of ":" as delimiter 7.12  (Read 12618 times)

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Inconsistent parsing of ":" as delimiter 7.12
« on: June 15, 2017, 11:42:25 AM »
I noticed that the parsing of ":" as a delimiter is very inconsistent.

This is the documented example of the use of ":" as a delimiter:
Code: [Select]
IF A >B:C=D*5:ELSE:C=D/5:ENDIF
The sample leads one to believe that the delimiter is exactly ":" with no additional whitespace requirements.  However, in some cases the parser requires " :" or " : " to be recognized as a delimiter.

This is my test sample that came up with my observed results.  The first line of code uses exactly ":" as a delimiter.  Each successive line I added white space until the parser was happy.  The last line will compile and please note that  ":" is not always recognized as a delimiter:
Code: [Select]
a#=0.0:call StrFmt:PRINT #8 A$;"\09ProductGpmGoal"      ' Error:Unknown Keyword: "all"
a#=0.0 :call StrFmt:PRINT #8 A$;"\09ProductGpmGoal"      ' Error:Unknown Keyword: "all"
a#=0.0: call StrFmt:PRINT #8 A$;"\09ProductGpmGoal"      ' Error:Undefined Custom Function Label:: "StrFmt:PRINT"
a#=0.0: call StrFmt :PRINT #8 A$;"\09ProductGpmGoal"   ' Error:Unknown Keyword: "RINT"
a#=0.0: call StrFmt :PRINT #8 A$;"\09ProductGpmGoal"   ' Error:Unknown Keyword: "RINT"
a#=0.0: call StrFmt: PRINT #8 A$;"\09ProductGpmGoal"   ' Error:Undefined Custom Function Label:: "StrFmt:"
a#=0.0: call StrFmt : PRINT #8 A$;"\09ProductGpmGoal"   ' Compiles
I know that this is not the biggest problem on the face of the earth, but it is just plain messy and very inconsistent.

Best regards,

Gary D*ckinson

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Inconsistent parsing of ":" as delimiter 7.12
« Reply #1 on: June 16, 2017, 10:34:47 AM »
Thank you for your report. The problem occurred because ':' was also used as an acceptable  character for names due to the clock pulses using it as part of the name (e.g. "Clk:.01s", "Clk:1.0s" etc).  Hence the compiler treated it as part of the string that form the name. By introducing a space the ambiguity was resolved and allows the program to be compiled.

We have fixed this bug and this will be included in the next release of the i-TRiLOGI software.

Thank you.
« Last Edit: June 16, 2017, 10:41:05 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS