Skip to content

Identification of CPP directives #240

Description

The current C pre-processor pattern assumes that there are no spaces between the start of a line and the # symbol:

comment_line = re.compile(r"!.*$")
cpp_command_line = re.compile(r"^#.*$")
word_splitter = re.compile(r"\b\w+\b")

However, the GNU C pre-processor manual explicitly says that spaces before the hash symbol are allowed:

Preprocessing directives are lines in your program that start with ‘#’. Whitespace is allowed before and after the ‘#’. The ‘#’ is followed by an identifier, the directive name. It specifies the operation to perform.

The pattern should probably allow leading whitespace. This doesn't seem to cause problems for the UM, but it may result in unexpected failures in other code bases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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