Skip to content

a trailing // comment is incorrectly parsed by current gpp comment processing to strip next newline #41

Description

@weatherhead99

The following code in a CDS file:

TAPLINE0="AM16L,1,100" 
TAPLINE1="AM36R,1,100"
TAPLINE2="AM32L,1,100"
TAPLINE3="AM30R,1,100"

correctly produces this output in the ACF file:

TAPLINE0="AM16L,1,100"
TAPLINE1="AM36R,1,100"
TAPLINE2="AM32L,1,100"
TAPLINE3="AM30R,1,100"

HOWEVER, the following code in a CDS file

TAPLINE0="AM16L,1,100" //tapline a
TAPLINE1="AM36R,1,100" //tapline b
TAPLINE2="AM32L,1,100" //tapline d
TAPLINE3="AM30R,1,100" //tapline c

(which should produce identical output), produces:

TAPLINE0="AM16L,1,100" TAPLINE1="AM36R,1,100" TAPLINE2="AM32L,1,100" TAPLINE3="AM30R,1,100"

(i.e. all output on the same line). This then causes the perl script that assembles ini 2 acf (ini2acf.pl) to barf. (With no error or warning, of course)

This happens because our arguments to GPP in the usual makefile include the argument +c "//" "\n", which interprets an end of line comment // as a comment. However, it also strips out the newline character as part of the comment. Reading GPP documentation I can see no way round this. Therefore the only workaround is to artificially insert extra empty newlines after any trailing comment.

Great job, author of GPP

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions