checkBrackets method
Implementation
bool checkBrackets(String? ch, bool inBrackets) {
if (ch == '[') {
if (inBrackets) {
throw UcumException(
"Error processing unit '$source': Nested [ at position $start");
} else {
return true;
}
}
if (ch == ']') {
if (!inBrackets) {
throw UcumException(
"Error processing unit '$source': ] without [ at position $start");
} else {
return false;
}
}
return inBrackets;
}