Package com.redcareditor.onig

Examples of com.redcareditor.onig.Match


    logger.addHandler(MateText.consoleHandler());
  }

  public Match scanForMatch(int from, Pattern p) {
    int maxLength = Math.min(MAX_LINE_LENGTH, this.lineLength);   
    Match match = null;
    if (p instanceof SinglePattern) {
      SinglePattern sp = (SinglePattern) p;
      if (sp.match.regex != null) {
        match = sp.match.search(this.line, from, maxLength);
      }
View Full Code Here


    int newLength;
    boolean isCloseMatch = false;
    Rx closingRegex = currentScope.closingRegex;
    if (closingRegex != null && closingRegex.usable()) {
      //logger.info(String.format("closing regex: '%s'", closingRegex.pattern));
      Match match = closingRegex.search(this.line, this.position, this.lineLength);
      if (match != null &&
             !(match.getCapture(0).start == currentScope.getStart().getLineOffset() &&
               currentScope.getStart().getLine() == this.lineIx)
          ) {
        //logger.info(String.format("closing match: %s (%d-%d)", this.currentScope.name, match.getCapture(0).start, match.getCapture(0).end));
        Marker newMarker = new Marker();
        newMarker.pattern = this.currentScope.pattern;
        newMarker.match = match;
        newMarker.from = match.getCapture(0).start;
        newMarker.isCloseScope = true;
        bestMarker = newMarker;
        isCloseMatch = true;
      } else {
        // logger.info(String.format("no close match"));
View Full Code Here

  public Marker scanLine(DoublePattern dp) {
    Marker bestMarker = null;
    for (Pattern p : dp.patterns) {
      // System.out.printf("     scanning for %s (%s)\n", p.name, p.disabled);
      if (p.disabled) continue;
      Match match = scanForMatch(position, p);
      if (match != null) {
        Marker newMarker = markerFromMatch(p, match);
        if (newMarker != null) {
          bestMarker = newMarker.bestOf(bestMarker);
        }
View Full Code Here

TOP

Related Classes of com.redcareditor.onig.Match

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.