test_class.file: base/lang/src/test/java/leap/lang/jsoup/parser/TokenQueueTest.java
test_class.identifier: TokenQueueTest
test_case.body: @Test public void chompBalanced() {
          TokenQueue tq = new TokenQueue(":contains(one (two) three) four");
          String pre = tq.consumeTo("(");
          String guts = tq.chompBalanced('(', ')');
          String remainder = tq.remainder();
  
          assertEquals(":contains", pre);
          assertEquals("one (two) three", guts);
          assertEquals(" four", remainder);
      }
test_case.class_method_signature: TokenQueueTest.chompBalanced()
test_case.full_signature: @Test public void chompBalanced()
test_case.identifier: chompBalanced
test_case.invocations: consumeTo chompBalanced remainder assertEquals assertEquals assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void chompBalanced()
focal_class.declarator: queue
focal_class.modifier: private
focal_class.original_string: private String queue;
focal_class.type: String
focal_class.var_name: queue
focal_class.declarator: pos = 0
focal_class.modifier: private
focal_class.original_string: private int pos = 0;
focal_class.type: int
focal_class.var_name: pos
focal_class.declarator: ESC = '\\'
focal_class.modifier: private static final
focal_class.original_string: private static final char ESC = '\\';
focal_class.type: char
focal_class.var_name: ESC
focal_class.file: base/lang/src/main/java/leap/lang/jsoup/parser/TokenQueue.java
focal_class.identifier: TokenQueue
focal_class.class_method_signature: TokenQueue.TokenQueue(String data)
focal_class.full_signature: public  TokenQueue(String data)
focal_class.identifier: TokenQueue
focal_class.modifiers: public
focal_class.parameters: (String data)
focal_class.signature:  TokenQueue(String data)
focal_class.class_method_signature: TokenQueue.isEmpty()
focal_class.full_signature: public boolean isEmpty()
focal_class.identifier: isEmpty
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isEmpty()
focal_class.class_method_signature: TokenQueue.remainingLength()
focal_class.full_signature: private int remainingLength()
focal_class.identifier: remainingLength
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int remainingLength()
focal_class.class_method_signature: TokenQueue.peek()
focal_class.full_signature: public char peek()
focal_class.identifier: peek
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: char
focal_class.signature: char peek()
focal_class.class_method_signature: TokenQueue.addFirst(Character c)
focal_class.full_signature: public void addFirst(Character c)
focal_class.identifier: addFirst
focal_class.modifiers: public
focal_class.parameters: (Character c)
focal_class.return: void
focal_class.signature: void addFirst(Character c)
focal_class.class_method_signature: TokenQueue.addFirst(String seq)
focal_class.full_signature: public void addFirst(String seq)
focal_class.identifier: addFirst
focal_class.modifiers: public
focal_class.parameters: (String seq)
focal_class.return: void
focal_class.signature: void addFirst(String seq)
focal_class.class_method_signature: TokenQueue.matches(String seq)
focal_class.full_signature: public boolean matches(String seq)
focal_class.identifier: matches
focal_class.modifiers: public
focal_class.parameters: (String seq)
focal_class.return: boolean
focal_class.signature: boolean matches(String seq)
focal_class.class_method_signature: TokenQueue.matchesCS(String seq)
focal_class.full_signature: public boolean matchesCS(String seq)
focal_class.identifier: matchesCS
focal_class.modifiers: public
focal_class.parameters: (String seq)
focal_class.return: boolean
focal_class.signature: boolean matchesCS(String seq)
focal_class.class_method_signature: TokenQueue.matchesAny(String... seq)
focal_class.full_signature: public boolean matchesAny(String... seq)
focal_class.identifier: matchesAny
focal_class.modifiers: public
focal_class.parameters: (String... seq)
focal_class.return: boolean
focal_class.signature: boolean matchesAny(String... seq)
focal_class.class_method_signature: TokenQueue.matchesAny(char... seq)
focal_class.full_signature: public boolean matchesAny(char... seq)
focal_class.identifier: matchesAny
focal_class.modifiers: public
focal_class.parameters: (char... seq)
focal_class.return: boolean
focal_class.signature: boolean matchesAny(char... seq)
focal_class.class_method_signature: TokenQueue.matchesStartTag()
focal_class.full_signature: public boolean matchesStartTag()
focal_class.identifier: matchesStartTag
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean matchesStartTag()
focal_class.class_method_signature: TokenQueue.matchChomp(String seq)
focal_class.full_signature: public boolean matchChomp(String seq)
focal_class.identifier: matchChomp
focal_class.modifiers: public
focal_class.parameters: (String seq)
focal_class.return: boolean
focal_class.signature: boolean matchChomp(String seq)
focal_class.class_method_signature: TokenQueue.matchesWhitespace()
focal_class.full_signature: public boolean matchesWhitespace()
focal_class.identifier: matchesWhitespace
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean matchesWhitespace()
focal_class.class_method_signature: TokenQueue.matchesWord()
focal_class.full_signature: public boolean matchesWord()
focal_class.identifier: matchesWord
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean matchesWord()
focal_class.class_method_signature: TokenQueue.advance()
focal_class.full_signature: public void advance()
focal_class.identifier: advance
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void advance()
focal_class.class_method_signature: TokenQueue.consume()
focal_class.full_signature: public char consume()
focal_class.identifier: consume
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: char
focal_class.signature: char consume()
focal_class.class_method_signature: TokenQueue.consume(String seq)
focal_class.full_signature: public void consume(String seq)
focal_class.identifier: consume
focal_class.modifiers: public
focal_class.parameters: (String seq)
focal_class.return: void
focal_class.signature: void consume(String seq)
focal_class.class_method_signature: TokenQueue.consumeTo(String seq)
focal_class.full_signature: public String consumeTo(String seq)
focal_class.identifier: consumeTo
focal_class.modifiers: public
focal_class.parameters: (String seq)
focal_class.return: String
focal_class.signature: String consumeTo(String seq)
focal_class.class_method_signature: TokenQueue.consumeToIgnoreCase(String seq)
focal_class.full_signature: public String consumeToIgnoreCase(String seq)
focal_class.identifier: consumeToIgnoreCase
focal_class.modifiers: public
focal_class.parameters: (String seq)
focal_class.return: String
focal_class.signature: String consumeToIgnoreCase(String seq)
focal_class.class_method_signature: TokenQueue.consumeToAny(String... seq)
focal_class.full_signature: public String consumeToAny(String... seq)
focal_class.identifier: consumeToAny
focal_class.modifiers: public
focal_class.parameters: (String... seq)
focal_class.return: String
focal_class.signature: String consumeToAny(String... seq)
focal_class.class_method_signature: TokenQueue.chompTo(String seq)
focal_class.full_signature: public String chompTo(String seq)
focal_class.identifier: chompTo
focal_class.modifiers: public
focal_class.parameters: (String seq)
focal_class.return: String
focal_class.signature: String chompTo(String seq)
focal_class.class_method_signature: TokenQueue.chompToIgnoreCase(String seq)
focal_class.full_signature: public String chompToIgnoreCase(String seq)
focal_class.identifier: chompToIgnoreCase
focal_class.modifiers: public
focal_class.parameters: (String seq)
focal_class.return: String
focal_class.signature: String chompToIgnoreCase(String seq)
focal_class.class_method_signature: TokenQueue.chompBalanced(char open, char close)
focal_class.full_signature: public String chompBalanced(char open, char close)
focal_class.identifier: chompBalanced
focal_class.modifiers: public
focal_class.parameters: (char open, char close)
focal_class.return: String
focal_class.signature: String chompBalanced(char open, char close)
focal_class.class_method_signature: TokenQueue.unescape(String in)
focal_class.full_signature: public static String unescape(String in)
focal_class.identifier: unescape
focal_class.modifiers: public static
focal_class.parameters: (String in)
focal_class.return: String
focal_class.signature: String unescape(String in)
focal_class.class_method_signature: TokenQueue.consumeWhitespace()
focal_class.full_signature: public boolean consumeWhitespace()
focal_class.identifier: consumeWhitespace
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean consumeWhitespace()
focal_class.class_method_signature: TokenQueue.consumeWord()
focal_class.full_signature: public String consumeWord()
focal_class.identifier: consumeWord
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String consumeWord()
focal_class.class_method_signature: TokenQueue.consumeTagName()
focal_class.full_signature: public String consumeTagName()
focal_class.identifier: consumeTagName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String consumeTagName()
focal_class.class_method_signature: TokenQueue.consumeElementSelector()
focal_class.full_signature: public String consumeElementSelector()
focal_class.identifier: consumeElementSelector
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String consumeElementSelector()
focal_class.class_method_signature: TokenQueue.consumeCssIdentifier()
focal_class.full_signature: public String consumeCssIdentifier()
focal_class.identifier: consumeCssIdentifier
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String consumeCssIdentifier()
focal_class.class_method_signature: TokenQueue.consumeAttributeKey()
focal_class.full_signature: public String consumeAttributeKey()
focal_class.identifier: consumeAttributeKey
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String consumeAttributeKey()
focal_class.class_method_signature: TokenQueue.remainder()
focal_class.full_signature: public String remainder()
focal_class.identifier: remainder
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String remainder()
focal_class.class_method_signature: TokenQueue.toString()
focal_class.full_signature: public String toString()
focal_class.identifier: toString
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public String chompBalanced(char open, char close) {
          int start = -1;
          int end = -1;
          int depth = 0;
          char last = 0;
  
          do {
              if (isEmpty()) break;
              Character c = consume();
              if (last == 0 || last != ESC) {
                  if (c.equals(open)) {
                      depth++;
                      if (start == -1)
                          start = pos;
                  }
                  else if (c.equals(close))
                      depth--;
              }
  
              if (depth > 0 && last != 0)
                  end = pos; // don't include the outer match pair in the return
              last = c;
          } while (depth > 0);
          return (end >= 0) ? queue.substring(start, end) : "";
      }
focal_method.class_method_signature: TokenQueue.chompBalanced(char open, char close)
focal_method.full_signature: public String chompBalanced(char open, char close)
focal_method.identifier: chompBalanced
focal_method.invocations: isEmpty consume equals equals substring
focal_method.modifiers: public
focal_method.parameters: (char open, char close)
focal_method.return: String
focal_method.signature: String chompBalanced(char open, char close)