Bug 103104 - Error 'BASIC syntax error. Unexpected symbol: ..' when a space before a dot
Summary: Error 'BASIC syntax error. Unexpected symbol: ..' when a space before a dot
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.2.2.2 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: target:6.0.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-11 05:49 UTC by nvyush
Modified: 2017-08-23 09:13 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nvyush 2016-10-11 05:49:57 UTC
We can write in BASIC:
a = 1+2
a = 1+ 2
a = 1+ _
    2
a = 1 +2
a = 1 + 2
a = 1 _
    + 2

But for dot expressions:
a = b.c 'OK
a = b. c 'OK
a = b. _
    c     'OK
a = b .c  'error !
a = b _
    .c    'error !

Is this feature or bug?
Comment 1 Buovjaga 2016-10-14 19:41:15 UTC
(In reply to nvyush from comment #0)
> Is this feature or bug?

Note: in the future, it is best to use http://ask.libreoffice.org/ before filing a report.
Comment 2 nvyush 2016-10-17 11:28:55 UTC
(In reply to Buovjaga from comment #1)
> Note: in the future, it is best to use http://ask.libreoffice.org/ before
> filing a report.

I filled out the bugreport, since I think this is a bug. I tried to find an appropriate bugreport, but did not find.
Comment 3 nvyush 2016-10-25 09:41:11 UTC
I tried to write this expression:

	invokePythonFunction = getMasterScriptProvider() _
		.getScript(URL_Main & file & ".py$" & func & URL_Args) _
		.invoke(args, outIdxs, outArgs)

but get the error 'BASIC syntax error. Unexpected symbol: ..'

This expression is OK:

	invokePythonFunction = getMasterScriptProvider(). _
		getScript(URL_Main & file & ".py$" & func & URL_Args). _
		invoke(args, outIdxs, outArgs)

but the first one is more readable, IMHO.

PS. This expression is OK also:
	sum = summand1 _
		+ summand2 _
		+ summand3
Comment 4 tagezi 2016-10-25 10:02:09 UTC
I confirm this. But I put minor because this problem has easy workaround.
Comment 5 Pierre Lepage 2016-11-05 21:16:18 UTC
The treatment of "." seems to me inappropriate. The error is thrown at line 460 of the method "parse" in parser.cxx.

     if (! IsEos ())
     {
         Peek ();
         if (! IsEos () && eCurTok! = ELSE)
         {
             // If the parsing has-been aborted, jump over to the ""
             Error (ERRCODE_BASIC_UNEXPECTED, eCurTok);
         }
     }

eCurTok is "DOT" at the time of the error.
Comment 6 Commit Notification 2017-07-14 00:54:17 UTC
Takeshi Abe committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b9bda1d7916c5474aab89116757fcb7e799458b2

tdf#103104 Allow line-continuation followed by a dot in BASIC

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Xisco Faulí 2017-08-14 08:36:12 UTC
Polite ping: is this bug fixed? if so, please close it as RESOLVED FIXED