fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Parser error when setting property of type logical in VO dialect 04 Sep 2020 15:36 #15817

  • chiwi's Avatar

  • chiwi

  • Topic Author


  • Posts: 6
  • Hi everyone

    I have an odd parser error when trying to set a property with type logical in XSharp. What's more unusual is it only occurs in VO and not with the core dialect.

    EG
    oSentryOptions:Debug := TRUE

    Results in the error: Parser: unexpected input ':='

    I've made a quick demo solution illustrating the issue: github.com/ch-iwi/xsharp-parser-error

    Am i missing something? Or is it a bug?

    Cheers
    DV Bern AG
    Bern, CH

    Please Log in or Create an account to join the conversation.

    Parser error when setting property of type logical in VO dialect 04 Sep 2020 15:43 #15818

  • robert's Avatar

  • robert


  • Posts: 1862
  • Duncan,

    This is a common problem.
    I am sure you have the "compatible preprocessor" option enabled. This makes the preprocessor case insensitive.
    And the compiler automatically adds a define with the name "DEBUG" when compiling in debug mode with no value.
    So the preprocessor changes this to:
    oSentryOptions:  := TRUE

    There are 2 options:

    1) Disable the compatible preprocessor compiler option (Project Properties, Dialect Tab, "All dialects" category)
    2) Prefix the Debug word with @@ characters
    oSentryOptions:@@Debug := TRUE

    The @@ tells the preprocessor to leave the symbol alone. The compiler will strip this. The @@ can also be used if you want to declare a variable name or class name that conflicts with a built-in keyword.


    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Last edit: by robert.

    Parser error when setting property of type logical in VO dialect 04 Sep 2020 15:53 #15819

  • chiwi's Avatar

  • chiwi

  • Topic Author


  • Posts: 6
  • Hi Robert

    100% on the money. Thanks for the clear explanation.

    Have a great weekend. Cheers
    DV Bern AG
    Bern, CH

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1