Menu

#808 Compiler ignores comment block Reserved word "Enum"

closed
nobody
compiler
2018-09-27
2016-02-03
Clive
No

Hello

Compiler is ignoring Enum comment inside a comment block and throwing an error (lots of errors)

/'

some comments

Enum is used in the following...

more comments

'/

To solve the problen I have added a single " ' " before Enum, thusly:

Some comments

'Enum is used in the following...

more comments

'/

Latest version, Win32, FF37. XP SP3

Related

Bugs: #808

Discussion

  • dkl

    dkl - 2016-02-05

    Hello,

    sorry, I don't understand. Can you show some code that triggers the problem?

     
    • Clive

      Clive - 2016-02-05

      Hello,

      Here is the entire comment block. The first line that fails is in bold red:

      "/'

      Function: heartBeat

      Purpose:

      Continuously poll V-MAC.

      Used in conjunction with <getbyteatport> to determine if V-MAC is online.</getbyteatport>

      <ping></ping> is used just once prior to conMain.

      Returns:

      Enum - vrcHeartBeat if successful.

      Const - VV_NOT_READY if number of bytes at port <> 1.

      Const - VV_FAIL on any other error.

      Error Handler:

      heartBeatError - <reef></reef>

      Called By:

      frmMain - <commain></commain>

      Calls:

      <prnstats></prnstats>

      <messagebox></messagebox>

      <getbytesatport></getbytesatport>

      <dowarningreef></dowarningreef>

      <parsehb></parsehb>

      <reef></reef>

      File:

      mGetH.inc.

      History:

      02-Feb-2016 Clive S. Richey - Modify for FB.

      09-Aug-2015 Clive S. Richey - Add these notes.

      Mod dates ...

      07-Dec-2001 Clive S. Richey - Create.


      Bit Assignments:

      - < = >  send keypad programming status To PC
      
      
      - V-MAC returns status Byte
      
      
      - Not echoed by PC
      
      
      - multitasked
      

      Status Byte [in our case heartBeat byte]:

      Bit - Description
      
      7 - Neuron packet: 1 = VMAC sending; 0 = VMAC receiving
      
      6 - |\
      
      5 - | ) TX or RX "Neuron Packet" number.
      
      4 - |/
      
      3 - 1 = waiting For Neuron ready; VMAC transmitting byte
      
      2 - 1 = waiting For Neuron ready; VMAC receiving byte
      
      1 - 1 = delay Loop in progress
      
      0 - 1 = keypad programming mode
      

      Note 1:

       "Packet Numbers" are used for this Command only and are Not otherwise
      

      involved in the Neuron logic.

      Note 2:

      Transmit and receive have individual packet numbers. Each Time V-MAC
      

      sends Or receives a Neuron packet,

      the corresponding packet number Is incremented.
      

      '/

      Function heartBeat( _

                    portParams as String _
      
                    ) as Integer
      

      function code..."

      Here is the compiler log:

      "FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win32 (32bit)

      Copyright (C) 2004-2016 The FreeBASIC development team.

      standalone

      target: win32, 486, 32bit

      compiling: CODEGEN_VK3_MAIN.bas -o CODEGEN_VK3_MAIN.asm (main module)

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(39) error 17: Syntax error,
      found '-' in 'Enum - vrcHeartBeat if successful.'

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(40) error 3: Expected
      End-of-Line, found 'Const' in 'Const - VV_NOT_READY if nuber of bytes at
      port <> 1.'

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(41) error 3: Expected
      End-of-Line, found 'Const' in 'Const - VV_FAIL on any error.'

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(42) error 3: Expected
      End-of-Line, found 'Handler' in 'Error Handler:'

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(43) error 3: Expected
      End-of-Line, found '-' in 'heartBeatError - <reef>'</reef>

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(44) error 3: Expected
      End-of-Line, found 'By' in 'Called By:'

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(45) error 3: Expected
      End-of-Line, found '-' in 'frmMain - <commain>'</commain>

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(54) error 3: Expected
      End-of-Line, found '.' in 'hGetH.inc'

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(56) error 3: Expected
      End-of-Line in '09-Aug-2015 Clive S. Richey - Add these notes.'

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(57) error 3: Expected
      End-of-Line, found '-' in '-
      ____________'

      E:\SRC\VK3\release\CODEGEN_VK3_DECLARES.inc(57) error 132: Too many errors,
      exiting"

      Upon further review I see it is as likely the "-" after "Enum" that is
      causing the problem.

      To solve this issue either of the following will work on my PC:

      Single ' before Enum

      ' Enum - vrcHeartBeat if successful.

      Single ' after Enum

      Enum' - vrcHeartBeat if successful.

      I hope this is helpful.

      Regards

      Clive Richey

       
  • fxm (freebasic.net)

    FF37 => unicode characters?

     
    • Clive

      Clive - 2016-02-05

      FireFly 3.7

      From: fxm (freebasic.net) [mailto:fx-m@users.sf.net]
      Sent: Friday, February 05, 2016 05:00
      To: [fbc:bugs]
      Subject: [fbc:bugs] #808 Compiler ignores comment block Reserved word "Enum"

      FF37 => unicode characters?


      [bugs:#808] http://sourceforge.net/p/fbc/bugs/808/ Compiler ignores
      comment block Reserved word "Enum"

      Status: open
      Labels: Enum
      Created: Wed Feb 03, 2016 05:54 AM UTC by Clive
      Last Updated: Fri Feb 05, 2016 07:27 AM UTC
      Owner: nobody

      Hello

      Compiler is ignoring Enum comment inside a comment block and throwing an
      error (lots of errors)

      /'

      some comments

      Enum is used in the following...

      more comments

      '/

      To solve the problen I have added a single " ' " before Enum, thusly:

      Some comments

      'Enum is used in the following...

      more comments

      '/

      Latest version, Win32, FF37. XP SP3


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/fbc/bugs/808/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #808

  • dkl

    dkl - 2016-02-08

    Hmm, weird. I can't reproduce the problem. Everything inside the /' ... '/ block comment is ignored here, even if it contains the word Enum...

    But, judging from the error message you got, it looks like the commentary starting with the line containing Enum - ... is parsed as code, and not treated as comment. Maybe the comment block is closed too early? (is there a '/ where it shouldn't be?)

     
    • Clive

      Clive - 2016-02-08

      Hi,

      Tried a number of variations and always compiles correctly until the single
      quote is removed from in front of Enum then the errors occur as reported
      earlier.

      From: dkl [mailto:dkls@users.sf.net]
      Sent: Monday, February 08, 2016 10:58
      To: [fbc:bugs]
      Subject: [fbc:bugs] #808 Compiler ignores comment block Reserved word "Enum"

      Hmm, weird. I can't reproduce the problem. Everything inside the /' ... '/
      block comment is ignored here, even if it contains the word Enum...

      But, judging from the error message you got, it looks like the commentary
      starting with the line containing Enum - ... is parsed as code, and not
      treated as comment. Maybe the comment block is closed too early? (is there a
      '/ where it shouldn't be?)


      [bugs:#808] http://sourceforge.net/p/fbc/bugs/808/ Compiler ignores
      comment block Reserved word "Enum"

      Status: open
      Labels: Enum
      Created: Wed Feb 03, 2016 05:54 AM UTC by Clive
      Last Updated: Fri Feb 05, 2016 12:59 PM UTC
      Owner: nobody

      Hello

      Compiler is ignoring Enum comment inside a comment block and throwing an
      error (lots of errors)

      /'

      some comments

      Enum is used in the following...

      more comments

      '/

      To solve the problen I have added a single " ' " before Enum, thusly:

      Some comments

      'Enum is used in the following...

      more comments

      '/

      Latest version, Win32, FF37. XP SP3


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/fbc/bugs/808/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #808

  • dkl

    dkl - 2016-02-09

    Hmm, that appears to confirm that for some reason the line is not inside the block comment.

    I haven't been able to reproduce it so far though. Could you post a .bas file that shows the problem? Thanks.

     
    • Clive

      Clive - 2016-02-12

      Hi,

      I sent it 6 days ago. If not enough info please let me know and I will send
      the entire file.

      From: dkl [mailto:dkls@users.sf.net]
      Sent: Tuesday, February 09, 2016 09:39
      To: [fbc:bugs]
      Subject: [fbc:bugs] #808 Compiler ignores comment block Reserved word "Enum"

      Hmm, that appears to confirm that for some reason the line is not inside the
      block comment.

      I haven't been able to reproduce it so far though. Could you post a .bas
      file that shows the problem? Thanks.


      [bugs:#808] http://sourceforge.net/p/fbc/bugs/808/ Compiler ignores
      comment block Reserved word "Enum"

      Status: open
      Labels: Enum
      Created: Wed Feb 03, 2016 05:54 AM UTC by Clive
      Last Updated: Mon Feb 08, 2016 06:58 PM UTC
      Owner: nobody

      Hello

      Compiler is ignoring Enum comment inside a comment block and throwing an
      error (lots of errors)

      /'

      some comments

      Enum is used in the following...

      more comments

      '/

      To solve the problen I have added a single " ' " before Enum, thusly:

      Some comments

      'Enum is used in the following...

      more comments

      '/

      Latest version, Win32, FF37. XP SP3


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/fbc/bugs/808/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #808

  • Jeff Marshall

    Jeff Marshall - 2018-09-27
    • labels: Enum --> comment, enum
    • status: open --> closed
     
  • Jeff Marshall

    Jeff Marshall - 2018-09-27

    Unable to reproduce error. Will re-open if example example code can be provided that demonstrates the problem. Tried all -lang dialects on many fbc versions (0.14.0 through 1.06.0).

     

Log in to post a comment.

Auth0 Logo