chore: cleanups

This commit is contained in:
2024-03-31 01:06:55 +03:00
parent 95801a0778
commit ff0a7b1390
7 changed files with 9 additions and 8 deletions

3
.gitignore vendored
View File

@@ -8,3 +8,6 @@ pubspec.lock
# secrets
.env
# docs
doc/

View File

@@ -43,4 +43,3 @@ void main(List<String> args) async {
await client.disconnect();
}

View File

@@ -221,4 +221,3 @@ enum ConnectionStatus {
/// The client is not connected to the server.
disconnected,
}

View File

@@ -6,7 +6,7 @@ import '../consts.dart' as consts;
///
/// Can be used to store the text and color information for a single token.
///
/// Use [formatted] to get the ANSI formatted text, usable in a terminal.
/// Use [ColorToken.formatted] to get the ANSI formatted text, usable in a terminal.
class ColorToken {
/// The raw, uncoded text.
String text;
@@ -111,7 +111,7 @@ class ColorParser implements IReader {
/// Each token represents a piece of text with color information. You can join all the text
/// together (without separators) to get the original text, uncolored.
///
/// To get the colored text, use the [formatted] property of each token.
/// To get the colored text, use the [ColorToken.formatted] property of each token.
List<ColorToken> parse() {
final lexed = <ColorToken>[];
while (!reader.isDone) {
@@ -262,4 +262,3 @@ class ColorParser implements IReader {
@override
setPosition(int position) => index = position;
}

View File

@@ -7,4 +7,3 @@ const colorPatternRaw = r'\[\d*m';
const boldByte = 1;
const italicByte = 3;
const underlineByte = 4;

View File

@@ -15,7 +15,10 @@ void main() {
final input = inputs[0];
final output = ColorParser(input).parse();
expect(output, [
ColorToken(text: 'You are standing in a small clearing.', fgColor: 32, bgColor: 0),
ColorToken(
text: 'You are standing in a small clearing.',
fgColor: 32,
bgColor: 0),
ColorToken.empty(),
]);
});

View File

@@ -79,4 +79,3 @@ void main() {
expect(client.status, equals(ConnectionStatus.disconnected));
});
}