parseQuotedFieldName function

String parseQuotedFieldName(
  1. String jsonPath,
  2. int index
)

Parses a quoted field name from a JSON path expression.

Implementation

String parseQuotedFieldName(String jsonPath, int index) {
  final buffer = StringBuffer();
  while (index < jsonPath.length && jsonPath[index] != "'") {
    buffer.write(jsonPath[index]);
    index++;
  }
  expectChar(jsonPath, index, "'");
  return buffer.toString();
}