dfix

Members

Classes

DFixVisitor
class DFixVisitor

Scans a module's parsed AST and looks for C-style array variables and parameters, storing the locations in the markers array.

Enums

SpecialMarkerType
enum SpecialMarkerType

The types of special token ranges identified by the parsing pass

Functions

printHelp
void printHelp()

Prints help message

relocateMarkers
void relocateMarkers(SpecialMarker[] markers, const(Token)[] tokens)

Converts the marker index from a byte index into the source code to an index into the tokens array.

reportErrors
void reportErrors(string fileName, size_t lineNumber, size_t columnNumber, string message, bool isError)

Dummy message output function for the lexer/parser

skip
void skip(const(Token)[] tokens, ref size_t index)

Skips balanced parens, braces, or brackets. index will be incremented to index tokens just after the balanced closing token.

skipAsmBlock
void skipAsmBlock(File output, const(Token)[] tokens, ref size_t i)

Skips over (and prints) an asm block

skipAttribute
void skipAttribute(File output, const(Token)[] tokens, ref size_t i)

Skips over an attribute

skipIdentifierChain
void skipIdentifierChain(File output, const(Token)[] tokens, ref size_t index, bool print = false)

Advances index until it indexs the token just after an identifier or template chain.

skipWhitespace
void skipWhitespace(File output, const(Token)[] tokens, ref size_t index, bool print = true)

Skips whitespace tokens, incrementing index until it indexes tokens at a non-whitespace token.

upgradeFile
void upgradeFile(string fileName, bool dip64, bool dip65, bool dip1003)

Fixes the given file.

writeToken
void writeToken(File output, ref const(Token) token)

Writes a token to the output file.

Structs

SpecialMarker
struct SpecialMarker

Identifies ranges of tokens in the source tokens that need to be rewritten

Meta