Skip to content

Generalize handling of leading spaces #11

@GB609

Description

@GB609

Almost all line tests start with something like /^[[:space:]]*#/. This is completely redundant and complicates several of the advanced patterns much more than they have to be.
It's also boilerplate that makes adding new annotations more tedious.

The first modification of a line should be to detect surplus leading spaces and just strip them, e.g.

inserted at line 669, after the debug statement:

# strip any leading spaces
sub(/^[[:space:]]+#/, "#")

Once this is done, any test (and sub/gsub command) for annotations starting with /^[[:space::]]*# @.../ can be reduced to just /^# @.../.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions