Skip to content

[Rint] Correctly handle line continuation after '\'#8772

Merged
jalopezg-git merged 1 commit intoroot-project:masterfrom
jalopezg-git:trint-fix-linecontinuation
Sep 9, 2021
Merged

[Rint] Correctly handle line continuation after '\'#8772
jalopezg-git merged 1 commit intoroot-project:masterfrom
jalopezg-git:trint-fix-linecontinuation

Conversation

@jalopezg-git
Copy link
Copy Markdown
Contributor

@jalopezg-git jalopezg-git commented Jul 29, 2021

To have better diagnostics, TRint::ProcessLineNr() prepends a #line 1 "ROOT_prompt_xxx" PP directive to each input line. However, this causes problems if the previous line is continued with '\', e.g.

root [0] #define m(x) printf("%s", \
root (cont'ed, cancel with .@) [1]x);
ROOT_prompt_0:2:2: error; '#' is not followed by a macro parameter
 ^
ROOT_prompt_0:3:1: error; use of undeclared identifier 'x'
x);
^

This PR fixes issue #8762.

Checklist:

  • tested changes locally

To have better diagnostics, `TRint::ProcessLineNr()` prepends a
`#line 1 "ROOT_prompt_xxx"` PP directive to each input line.  However, this
causes problems if the previous line is continued with '\', e.g.
```
root [0] #define m(x) printf("%s", \
root (cont'ed, cancel with .@) [1]x);
ROOT_prompt_0:2:2: error: '#' is not followed by a macro parameter
 ^
ROOT_prompt_0:3:1: error: use of undeclared identifier 'x'
x);
^
```
This patch fixes issue root-project#8762.
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@jalopezg-git jalopezg-git linked an issue Jul 29, 2021 that may be closed by this pull request
1 task
@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft11.dyndns.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@jalopezg-git jalopezg-git requested a review from eguiraud July 29, 2021 15:43
@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-07-29T16:18:15.949Z] ghprbPullLongDescription=To have better diagnostics, TRint::ProcessLineNr() prepends a #line 1 \"ROOT_prompt_xxx\" PP directive to each input line. However, this causes problems if the previous line is continued with '', e.g.\r\n\r\nroot [0] #define m(x) printf(\"%s\", \\r\nroot (cont'ed, cancel with .@) [1]x);\r\nROOT_prompt_0:2:2: error: '#' is not followed by a macro parameter\r\n ^\r\nROOT_prompt_0:3:1: error: use of undeclared identifier 'x'\r\nx);\r\n^\r\n\r\n\r\nThis PR fixes issue [rint] Properly support line continuation after backslash \  #8762.\r\n\r\n## Checklist:\r\n- [X] tested changes locally

@jalopezg-git
Copy link
Copy Markdown
Contributor Author

@phsft-bot build just on windows10/cxx14

@phsft-bot
Copy link
Copy Markdown

Starting build on windows10/cxx14
How to customize builds

Copy link
Copy Markdown
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can we have a test for this? (might need #8771 to land first)

@jalopezg-git
Copy link
Copy Markdown
Contributor Author

LGTM. Can we have a test for this? (might need #8771 to land first)

Sure! (but it will have to wait until I'm back from vacations...)

Copy link
Copy Markdown
Member

@Axel-Naumann Axel-Naumann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But see comment.

@jalopezg-git
Copy link
Copy Markdown
Contributor Author

@phsft-bot build

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-09-08T11:23:00.221Z] CMake Error at cmake/modules/RootBuildOptions.cmake:407 (message):
  • [2021-09-08T11:23:00.221Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@phsft-bot
Copy link
Copy Markdown

Build failed on mac1014/python3.
Running on macphsft17.dyndns.cern.ch:/build/jenkins/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-4.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on mac11.0/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@jalopezg-git
Copy link
Copy Markdown
Contributor Author

@phsft-bot build

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-09-08T14:32:16.366Z] CMake Error at cmake/modules/RootBuildOptions.cmake:407 (message):
  • [2021-09-08T14:32:16.366Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1117 (message):

@phsft-bot
Copy link
Copy Markdown

Build failed on mac11.0/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@jalopezg-git
Copy link
Copy Markdown
Contributor Author

Build failed on mac11.0/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

* [projectroot.runtutorials.tutorial_multicore_mp001_fillHistos](https://lcgapp-services.cern.ch/root-jenkins/job/root-pullrequests-build/125699/testReport/projectroot/runtutorials/tutorial_multicore_mp001_fillHistos/)

* [](https://lcgapp-services.cern.ch/root-jenkins/job/root-pullrequests-build/125699/testReport/projectroot/runtutorials/tutorial_multicore_mtbb001_fillHistos/)

These fails are totally unrelated.

@jalopezg-git jalopezg-git merged commit 97571ef into root-project:master Sep 9, 2021
@jalopezg-git jalopezg-git deleted the trint-fix-linecontinuation branch September 9, 2021 12:42
jalopezg-git added a commit to jalopezg-git/roottest that referenced this pull request Sep 29, 2021
Test that backslash-newline works in Rint; more details available at
root-project/root#8772
jalopezg-git added a commit to jalopezg-git/roottest that referenced this pull request Sep 29, 2021
Test that backslash-newline works in Rint; more details available at
root-project/root#8772
jalopezg-git added a commit to jalopezg-git/roottest that referenced this pull request Sep 29, 2021
Test that backslash-newline works in Rint; more details available at
root-project/root#8772
jalopezg-git added a commit to jalopezg-git/roottest that referenced this pull request Sep 29, 2021
Test that backslash-newline works in Rint; more details available at
root-project/root#8772
jalopezg-git added a commit to root-project/roottest that referenced this pull request Sep 30, 2021
Test that backslash-newline works in Rint; more details available at
root-project/root#8772
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rint] Properly support line continuation after backslash \

4 participants