Skip to content

Trigraphs are evaluated both before and after line splicing #240

@PanoramixDeDruide

Description

@PanoramixDeDruide

Just discovered that the Wave Driver (not sure about other setups) preprocesses the following code in a way that doesn't conform to the standard:

???/
?=define X 2
X

Is evaluated as 2, while the standard (at least from what I know, would love a source on this) says trigraphs aren't supposed to be evaluated after line splicing happens. Therefore, I believe the correct way to process the above snippet should be to convert ??/ to \, see there are no more trigraphs to convert, splice the first two lines into ??=define X 2, and then not to convert the ??= trigraph to a # because we've already spliced lines. Expected output is as follows:

??=define X 2
X

Metadata

Metadata

Assignees

No one assigned

    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