Fix floats and doubles

This commit is contained in:
zontreck 2024-08-29 07:08:11 -07:00
parent 84192c69db
commit 842a2b8f0c
4 changed files with 11 additions and 7 deletions

View file

@ -1,3 +1,3 @@
class Constants { class Constants {
static const VERSION = "1.2.082924+0654"; static const VERSION = "1.2.082924+0707";
} }

View file

@ -50,6 +50,7 @@ enum TagType {
bool isQuoted = false; bool isQuoted = false;
bool isNumeric = true; // Assume true until proven otherwise bool isNumeric = true; // Assume true until proven otherwise
bool isAlpha = true; // Assume true until proven otherwise bool isAlpha = true; // Assume true until proven otherwise
bool hasDecimalPoint = false;
StringBuffer buffer = StringBuffer(); StringBuffer buffer = StringBuffer();
while (reader.canRead) { while (reader.canRead) {
@ -102,10 +103,13 @@ enum TagType {
buffer.write(current); buffer.write(current);
// Check if current character is a digit or numeric suffix // Updated check to allow digits, decimal points, and numeric suffixes
if (!RegExp(r'^[0-9]$').hasMatch(current) && if (!RegExp(r'^[0-9]$').hasMatch(current)) {
!RegExp(r'^[sSbBiIlLfFdD]$').hasMatch(current)) { if (current == '.' && !hasDecimalPoint) {
isNumeric = false; // Not purely numeric with possible suffix hasDecimalPoint = true; // Allow only one decimal point
} else if (!RegExp(r'^[sSbBiIlLfFdD]$').hasMatch(current)) {
isNumeric = false; // Not purely numeric or allowed decimal/suffix
}
} }
// Check if current character is purely alphabetical // Check if current character is purely alphabetical

View file

@ -1,6 +1,6 @@
name: libac_dart name: libac_dart
description: "Aria's Creations code library" description: "Aria's Creations code library"
version: 1.2.082924+0654 version: 1.2.082924+0707
homepage: "https://zontreck.com" homepage: "https://zontreck.com"

View file

@ -11,7 +11,7 @@ Future<void> main() async {
}); });
test("Test directory size checking", () async { test("Test directory size checking", () async {
expect(await getDirectorySize("test"), 9981); expect(await getDirectorySize("test"), 12819);
}); });
test("Test file info methods", () async { test("Test file info methods", () async {