List<string> args = new List<string> ();
int parens = 0;
bool backticks = false;
+ bool inquotes = false;
int start = pos;
for (; pos < text.Length; ++pos) {
var ch = text [pos];
if (backticks)
continue;
+ if (ch == '\"') {
+ inquotes = !inquotes;
+ continue;
+ }
+
if (ch == '(') {
++parens;
continue;
if (parens != 0)
continue;
- if (ch == ',') {
+ if (ch == ',' && !inquotes) {
args.Add (text.Substring (start, pos - start));
start = pos + 1;
continue;