Skip to content

Commit

Permalink
Prepare release for version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 3, 2024
1 parent 89e50e4 commit f99bfd9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## [0.1.0]

- Released @ 8/2024 (UTC)
- Initial release
3 changes: 2 additions & 1 deletion lib/src/managers/config_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class ConfigManager<TConfig extends Config> {
//

void setConfig(TConfig config) async {
final added = this.configs.firstWhereOrNull((e) => e.ref == config.ref) != null;
final added =
this.configs.firstWhereOrNull((e) => e.ref == config.ref) != null;
if (!added) {
this.configs.add(config);
}
Expand Down
3 changes: 2 additions & 1 deletion lib/src/managers/file_config_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class FileConfigManager extends ConfigManager {
//

Future<void> setFileConfig(FileConfig fileConfig) async {
final added = this.configs.firstWhereOrNull((e) => e.ref == fileConfig.ref) != null;
final added =
this.configs.firstWhereOrNull((e) => e.ref == fileConfig.ref) != null;
if (!added) {
this.configs.add(fileConfig);
await fileConfig.readAssociatedFile();
Expand Down
12 changes: 8 additions & 4 deletions lib/src/utils/parse_source_for_strings_and_comments.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ ParseSourceForStringsAndCommentsResult parseSourceForStringsAndComments(
var buffer = '';
final cNull = const Utf8Decoder().convert([0]);
final cNotNewline = RegExp('[^\n]');
final matchesMultiLineComments = RegExp(_REG_EXP_MULTI_LINE_COMMENT).allMatches(source);
final matchesMultiLineComments =
RegExp(_REG_EXP_MULTI_LINE_COMMENT).allMatches(source);
for (final match in matchesMultiLineComments) {
final a = match.group(0)!;
final b = a.replaceAll(cNotNewline, cNull);
buffer = source.replaceFirst(a, b);
}
final matchesQuotedStrings = RegExp(_REG_EXP_QUOTED_STRING).allMatches(buffer);
final matchesQuotedStrings =
RegExp(_REG_EXP_QUOTED_STRING).allMatches(buffer);
for (final match in matchesQuotedStrings) {
final a = match.group(0)!;
final b = a.replaceAll(cNotNewline, cNull);
buffer = buffer.replaceFirst(a, b);
}
final matchesSingleLineComments = RegExp(_REG_EXP_SINGLE_LINE_COMMENT).allMatches(buffer);
final matchesSingleLineComments =
RegExp(_REG_EXP_SINGLE_LINE_COMMENT).allMatches(buffer);
final multiLineComments = <String>[];
for (final match in matchesMultiLineComments) {
multiLineComments.add(source.substring(match.start, match.end));
Expand Down Expand Up @@ -60,7 +63,8 @@ ParseSourceForStringsAndCommentsResult parseSourceForStringsAndComments(

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

const _REG_EXP_MULTI_LINE_COMMENT = r'(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)';
const _REG_EXP_MULTI_LINE_COMMENT =
r'(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)';
const _REG_EXP_SINGLE_LINE_COMMENT = r'\/\/.*';
const _REG_EXP_QUOTED_STRING = r'''(["'])([^\\]*?(?:\\.[^\\]*?)*)\1''';

Expand Down
5 changes: 3 additions & 2 deletions lib/src/utils/replace_patterns.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ String replacePatterns(
final e1 = parts.elementAtOrNull(1);
final key = (e1 ?? e0)!;
final defaultValue = e0 ?? key;
final data1 =
settings.caseSensitive ? data : data.map((k, v) => MapEntry(k.toString().toLowerCase(), v));
final data1 = settings.caseSensitive
? data
: data.map((k, v) => MapEntry(k.toString().toLowerCase(), v));
final key1 = settings.caseSensitive ? key : key.toLowerCase();
final suggestedReplacementValue = data1[key1];
final replacementValue =
Expand Down

0 comments on commit f99bfd9

Please sign in to comment.