Advertisement
JoshDreamland

Untitled

Dec 27th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. bool replace = false;
  2. for (int pars = 0, bracks = 1; bracks > 0 and pos < len; ++pos) {
  3.   if (synt[pos] == '(') {
  4.     ++pars;
  5.   } else if (synt[pos] == ')') {
  6.     --pars;
  7.   } else if (synt[pos] == '[') {
  8.     ++bracks;
  9.   } else if (synt[pos] == ']') {
  10.     --bracks;
  11.   } else if (synt[pos] == ',' and pars == 0 and bracks == 1) {
  12.     replace = true;
  13.     break;
  14.   }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement