Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs #i112383#, #i117960#, and #i126272# - Basic lang backports #150

Merged
merged 5 commits into from Jun 9, 2022

Conversation

cbmarcum
Copy link
Contributor

@cbmarcum cbmarcum commented May 29, 2022

These are a few fixes for the Basic compiler that are in trunk and AOO42X but not backported to AOO41X.

Can't cherry-pick due to file changes and two commits changed the same test file.
Each of these are covered by a test now that I've added one for i126272.

Descriptions and original commit messages and links follow:
Fix for error in Convert to Long function.
original commit:
#i112383# CLng('&HFFFFFFFF') fails on 64-bits rather than returning -1
Found-by: andrew
Patch-by: Damjan Jovanovic
323c350

Fix for using certain keywords as variable names in single line if statements
Original commit:
#i117960# Basic: Line Input doesn't work in single-line If
i92642 added the ability to use certain keywords as variable names (eg. name = 1, line = 'hi'),
but also caused a regression where "Line Input" is broken in single-line If statements.
This patch fixes that by allowing Then and Else to also be the start-of-line tokens expected to
immediately preceed the 'Line' token in order for that 'Line' token to be recognized a keyword instead
of a variable name. Also added FVT spreadsheet tests for 'Line' as both a variable name and as 'Line Input'.
Patch by: Damjan Jovanovic
725d867

Basic compile error when comment is at the end of a single line if then else statement
original commit:
#i126272# OpenOffice.org Basic compile error : if statement followed by End If - in next Line ???
Allow the Else in a single-line If statement to be terminated by a comment instead of only EOL.
Patch by: Damjan Jovanovic
0739618

Can't cherry-pick due to file changes.

Original commit messages and links follow:

Found-by: andrew
Patch-by: Damjan Jovanovic
apache@323c350

i92642 added the ability to use certain keywords as variable names (eg. name = 1, line = 'hi'),
but also caused a regression where "Line Input" is broken in single-line If statements.
This patch fixes that by allowing Then and Else to also be the start-of-line tokens expected to
immediately preceed the 'Line' token in order for that 'Line' token to be recognized a keyword instead
of a variable name. Also added FVT spreadsheet tests for 'Line' as both a variable name and as 'Line Input'.
Patch by: Damjan Jovanovic
apache@725d867
@cbmarcum cbmarcum self-assigned this May 29, 2022
@cbmarcum
Copy link
Contributor Author

I found these changes missing from AOO41X after updating the tests in trunk to be standalone and running them against AOO41X and debugging test failures and errors. To run the included test after building this branch.
From test dir:

ant -Dopenoffice.home="<path-to-openoffice4>" compile
./run -Dopenoffice.home="<path-to-openoffice4>" -tc fvt.uno.sc.formula.TestFormulaDocs

The test in trunk has been further improved as a JUnit parameterized test so each document is reported separately.

original commit to trunk:
i126272 OpenOffice.org Basic compile error : if statement followed by End If - in next Line ???

Allow the Else in a single-line If statement to be terminated by a comment instead of only EOL.

Patch by: Damjan Jovanovic
apache@0739618
@cbmarcum cbmarcum changed the title Refs #i112383# and #i117960#. - backporting to AOO41X Refs #i112383#, #i117960#, and #i126272# - Basic lang backports Jun 8, 2022
@cbmarcum
Copy link
Contributor Author

cbmarcum commented Jun 9, 2022

Based on this email thread [1] on dev@ I'm going to pull this in.

[1] https://lists.apache.org/thread/21vgh6ovcp7mnf82j7nz6rngzx7yvztn

@cbmarcum cbmarcum merged commit 0c8b819 into apache:AOO41X Jun 9, 2022
@cbmarcum cbmarcum deleted the basicBackports branch June 9, 2022 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant