BalticAmadeus / AblFormatter

Code formatter for Progress OpenEdge (ABL)
Apache License 2.0
6 stars 0 forks source link

Define Property get and set Throws Error When Containing Additional Logic #130

Closed SSaulenas closed 2 months ago

SSaulenas commented 2 months ago

For example,

class TestClass:

    define public property m_Total as integer no-undo
        get.
        set.

    define public property Totals as integer no-undo
        get:
            if m_Total < 0 then
                return 0.
            else
                return m_Total.
            end.
        end get.

        set (newValue as integer):
            m_Total = newValue.
        end set.  
end class.

image

image

However, note that set works correctly when the set has a single statement, like this: image

eglekaz commented 2 months ago

There was some issues with the code itself, but body option was added to getter. Fixed with tree-sitter-abl version 0.0.30