https://bugs.documentfoundation.org/show_bug.cgi?id=162983
Bug ID: 162983
Summary: In VBASupport mode, it's possible to close a SUB as a
FUNCTION, or close a FUNCTION as a PROPERTY
Product: LibreOffice
Version: Inherited From OOo
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: difficultyBeginner, easyHack, skillCpp
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
Consider this Basic code:
Option VBASupport 1
Sub foo
End Function
Function bar
End Property
This compiles and runs, even though the "End" clauses don't match respective
start keywords. VBA doesn't allow that.
This was implemented in i#109075
(https://bz.apache.org/ooo/show_bug.cgi?id=109075), to support constructs like
Public Property Get Foo()
' Code...
End Sub
Yes, specifically 'Property Get' (but not 'Property Set', nor 'Property Let')
allows closing it with 'End Sub' / 'End Function'; but no other variations are
allowed.
The code is in SbiParser::Parse (basic/source/comp/parser.cxx). This easyhack
is only about closing a Sub / Function, not about closing Property Set/Let.
--
You are receiving this mail because:
You are the assignee for the bug.