License
BSD-3-Clause
CF Lexer - Tokenizer for CF Configuration Files
This module provides a lexer that converts CF source text into a stream of tokens. It implements the input range interface for convenient iteration and preserves comments as tokens for roundtrip-preserving document model support.
The lexer handles:
Lexer for CF source text.
Converts CF source into a stream of tokens, implementing the input range interface. Comments are preserved as tokens to support the roundtrip-preserving document model.
Example:
auto lexer = Lexer(`{ key = "value" }`);
foreach (token; lexer) {
writeln(token);
}this(string input, string sourceFilename = "")Constructs a lexer for the given CF source text.Lexer tokenize(string input, string filename = "") @safe pureCreates a lexer for the given CF source text.Token[] tokenizeAll(string input, string filename = "") @safe pureTokenizes the input and eagerly collects all tokens into an array.