Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: parser::error() now takes the position message format as an a…
…rgument The optional argument allows us to specify a nicer and more relevant position message format for the two parser errors that involve more than one file location: missing closing tags (expected location and opening location) and invalid closing tags (opening location and (invalid) closing location). This makes it easier to tell what's going on even when confronted with a kilometric preprocessor brace-substitution trail, e.g: > Found invalid closing tag [/tag2] for tag [tag1] > Opened at ~add-ons/My_Add-on/scenarios/24.cfg:1090 > included from ~add-ons/My_Add-on/scenarios/24.cfg:120 > included from ~add-ons/My_Add-on/_main.cfg:42 > [...] > Closed at ~add-ons/My_Add-on/scenarios/24.cfg:1098 > included from ~add-ons/My_Add-on/scenarios/24.cfg:120 > included from ~add-ons/My_Add-on/_main.cfg:42 > [...] Some day we will be able to make it easier to handle these situations by ensuring the trail format is concise and relevant, but that day will not come before 1.13.0. Messing further with the main ::lineno_string() function (in preprocessor.cpp) would be risky at this point with 1.12.0 approaching.
- Loading branch information