Skip to content

Refactoring: split TokenList::readfile() into smaller functions #735

Closed

Description

@danmar

TokenList::readfile() is about 380 lines long and handles several kinds of tokens in one loop. Several of these readers have their
own copy of the line-splicing (backslash-newline) code.

Before line splicing is moved into the character stream and the tokenizer is changed (step 2 of #708), move the readers that those
changes will touch into separate functions:

New function Reads
readNameOrNumber() names and numbers (later: pp-number grammar, e.g. 1.2.3, 0x1e+e)
readLineComment() // comments (has its own splicing code)
readBlockComment() /* */ comments (has its own splicing code)
readErrorText() the text of #error / #warning (has its own splicing code)

When splicing moves into the stream, these splicing copies can then be removed one function at a time, in small diffs.

Activity

  1. added a commit that references this issue on Nov 9, 2026
    a837f61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions