Menu

Issues with spaces

2018-03-06
2018-05-23
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-03-06

    [RESOLVED] in version v0.98.02 May 2018

    Hello ...
    GC Basic is not CASE sensitive, but it is SPACE sensitive !
    An error appears if :
    - The keyword "If" is directly followed by an opening parenthesis (without space between), for example in case of evaluation of a complex logical expression with priorities : the compiler sees the IF as a "non-declared Array".
    - A space is put between a label and the following colon.
    Are they bugs, or normal features ? The fist time it's a little bit surprising ...

     

    Last edit: Anobium 2018-05-23
  • Anobium

    Anobium - 2018-03-06

    Can you share the explicit example of the code please ?

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-03-06

    Meanwhile the code as grown to over 280 lines, I considered and corrected these "features" ... I think You can test it with any example like :
    "If(test=0) then"
    or
    "TestLabel :"
    Those examples should give You the error message ...

     
  • Anobium

    Anobium - 2018-03-06

    May I check.   What version   of the compiler ?

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-03-06

    The version is 0.98.01 date 2017-10-27, SynWrite version 6.22.2290

     
  • Anobium

    Anobium - 2018-03-06

    Thank you. Features are now on the to do list to be resolved.

    :'-)

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-03-06

    Joke : Maybe I am a "cursed programmer" who always finds new "features" in programs ! In 1976 (!) I "succeeded" (!) in crashing a Univac 1110 system by doing a thing that nobody tried before me, and the operators answered that for this reason the (operating) system was not (yet) protected against this operation.

    :)

     

    Last edit: Bertrand BAROTH 2018-03-06
  • Anobium

    Anobium - 2018-03-11

    @Bertrand. I have a fix for the IF( error. But, can you confirm that your are programming an Atmel microcontroller? I am not seeing the error with a PIC.

    Cheers.

     
  • Anobium

    Anobium - 2018-03-11

    @Bertrand.

    Can you please update your system and test? Use the attachment and place in the ..\GCB@Syn\G+Stools folder. This preprocessor will resovle the issue until we move the main compiler.

    Let me know the result.

    Anobium

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-03-11

    In fact, I am programming for the ATmega8.
    Now there is an error message :
    Controle.gcb (92): Error: If( not permitted. Please insert a space after the IF
    And a new error appears ; in order to put a comment I used following syntax :
    Case 0 : ' Comment (etc)
    Now the space between the value 0 and the colon causes an error.
    For Your information, I run Windows 7 professional 64 bits with an I5 quadricore.

     

    Last edit: Bertrand BAROTH 2018-03-11
  • Anobium

    Anobium - 2018-03-11

    Revised preprocessor. Please test. Let me know the results.

    Note: Test program has been removed.,

     

    Last edit: Anobium 2018-03-12
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-03-11

    Still the same with "IF(" , the error with the space after the constant in the "case" disappeared again, but the issue with the space between a label and the colon is still here ... It went back to the initial state (excepted that the error message for the "IF(" is now more explicit)

     
    • Anobium

      Anobium - 2018-03-12

      OK. Thank you. I will remove the test preprocessor. I will have to move these tests to the main compiler.

      1. The if( is a generic error.
      2. The label error only happens on Atmel microcontrollers.

      Test code is:

      #chip mega328p
      
      If(test=0) then
      End if
      ' Or
      'This label with a space
      TestLabel :  'This is a label
      Testcode=0 : testcode=1:  testcode=3:
      select case testl
        case 0 : 'testcase
      end select
      

      Anobium

       

      Last edit: Anobium 2018-03-12
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-03-12

    I don't know if it is important and changes anything, but I use #option explicit ... Sometimes such details have unexpected effects !

     
    • Anobium

      Anobium - 2018-03-12

      You never know... but, this time I think that #option explicit will make little difference but will check.

       
      • Anobium

        Anobium - 2018-05-04

        FIXED in version v0.98.02 May 2018

         
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-05-23

    Thanks, it works ...

     
    • Anobium

      Anobium - 2018-05-23

      [RESOLVED]

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.