Examples of JsRegexp


Examples of com.github.sommeri.less4j.js.JsRegExp

    return replaced;
  }

  private Expression regexp(Expression targetExpression, String string, String pattern, String replacement, String flags, ProblemsHandler problemsHandler, FunctionExpression call) {
    try {
      JsRegExp exp = JsRegExp.compile(pattern, flags);
      String replaced = exp.replace(string, replacement);
      return buildResult(targetExpression, replaced);
    } catch (IllegalArgumentException ex) {
      problemsHandler.regexpFunctionError(call, ex.getMessage());
      return new FaultyExpression(call.getUnderlyingStructure());
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsRegExp

        throw new JsParserException("Unknown primary: " + node.getIntDatum());
    }
  }

  private JsNode<?> mapRegExp(Node regExpNode) {
    JsRegExp toRegExp = new JsRegExp(makeSourceInfo(regExpNode));

    Node fromPattern = regExpNode.getFirstChild();
    toRegExp.setPattern(fromPattern.getString());

    Node fromFlags = fromPattern.getNext();
    if (fromFlags != null) {
      toRegExp.setFlags(fromFlags.getString());
    }

    return toRegExp;
  }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsRegExp

        throw new JsParserException("Unknown primary: " + node.getIntDatum());
    }
  }

  private JsNode<?> mapRegExp(Node regExpNode) {
    JsRegExp toRegExp = new JsRegExp();

    Node fromPattern = regExpNode.getFirstChild();
    toRegExp.setPattern(fromPattern.getString());

    Node fromFlags = fromPattern.getNext();
    if (fromFlags != null) {
      toRegExp.setFlags(fromFlags.getString());
    }

    return toRegExp;
  }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsRegExp

        throw new JsParserException("Unknown primary: " + node.getIntDatum());
    }
  }

  private JsNode<?> mapRegExp(Node regExpNode) {
    JsRegExp toRegExp = new JsRegExp(makeSourceInfo(regExpNode));

    Node fromPattern = regExpNode.getFirstChild();
    toRegExp.setPattern(fromPattern.getString());

    Node fromFlags = fromPattern.getNext();
    if (fromFlags != null) {
      toRegExp.setFlags(fromFlags.getString());
    }

    return toRegExp;
  }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsRegExp

            node);
    }
  }

  private JsNode mapRegExp(Node regExpNode) {
    JsRegExp toRegExp = new JsRegExp(makeSourceInfo(regExpNode));

    Node fromPattern = regExpNode.getFirstChild();
    toRegExp.setPattern(fromPattern.getString());

    Node fromFlags = fromPattern.getNext();
    if (fromFlags != null) {
      toRegExp.setFlags(fromFlags.getString());
    }

    return toRegExp;
  }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsRegExp

        throw new JsParserException("Unknown primary: " + node.getIntDatum());
    }
  }

  private JsNode mapRegExp(Node regExpNode) {
    JsRegExp toRegExp = new JsRegExp();

    Node fromPattern = regExpNode.getFirstChild();
    toRegExp.setPattern(fromPattern.getString());

    Node fromFlags = fromPattern.getNext();
    if (fromFlags != null) {
      toRegExp.setFlags(fromFlags.getString());
    }

    return toRegExp;
  }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsRegExp

            node);
    }
  }

  private JsNode mapRegExp(Node regExpNode) {
    JsRegExp toRegExp = new JsRegExp(makeSourceInfo(regExpNode));

    Node fromPattern = regExpNode.getFirstChild();
    toRegExp.setPattern(fromPattern.getString());

    Node fromFlags = fromPattern.getNext();
    if (fromFlags != null) {
      toRegExp.setFlags(fromFlags.getString());
    }

    return toRegExp;
  }
View Full Code Here

Examples of com.google.gwt.query.client.js.JsRegexp

        if (truth(splitRule.allAttr)) {
          xPathExpression += replaceAttr(
              JsUtils.or(splitRule.allAttr, ""));
        }
        if (truth(splitRule.allPseudos)) {
          JsRegexp pseudoSplitRegExp = new JsRegexp(
              ":(\\w[\\w\\-]*)(\\(([^\\)]+)\\))?");
          JsRegexp pseudoMatchRegExp = new JsRegexp(
              "(:\\w+[\\w\\-]*)(\\([^\\)]+\\))?", "g");
          JsObjectArray<String> allPseudos = pseudoMatchRegExp.match(splitRule.allPseudos);
          for (int k = 0, kl = allPseudos.length(); k < kl; k++) {
            JsObjectArray<String> pseudo = pseudoSplitRegExp.match(allPseudos.get(k));
            String pseudoClass = truth(pseudo.get(1)) ? pseudo.get(1)
                .toLowerCase() : null;
            String pseudoValue = truth(pseudo.get(3)) ? pseudo.get(3)
View Full Code Here

Examples of com.google.gwt.query.client.js.JsRegexp

    return JsUtils.unique(elm.<JsArray<Element>>cast()).cast();
  }

  private void init() {
    if (cssSelectorRegExp == null) {
      cssSelectorRegExp = new JsRegexp(
          "^(\\w+)?(#[\\w\\u00C0-\\uFFFF\\-\\_]+|(\\*))?((\\.[\\w\\u00C0-\\uFFFF\\-_]+)*)?((\\[\\w+(\\^|\\$|\\*|\\||~)?(=[\"']*[\\w\\u00C0-\\uFFFF\\s\\-\\_\\.]+[\"']*)?\\]+)*)?(((:\\w+[\\w\\-]*)(\\((odd|even|\\-?\\d*n?((\\+|\\-)\\d+)?|[\\w\\u00C0-\\uFFFF\\-_]+|((\\w*\\.[\\w\\u00C0-\\uFFFF\\-_]+)*)?|(\\[#?\\w+(\\^|\\$|\\*|\\||~)?=?[\\w\\u00C0-\\uFFFF\\s\\-\\_\\.]+\\]+)|(:\\w+[\\w\\-]*))\\))?)*)?(>|\\+|~)?");
      selectorSplitRegExp = new JsRegexp("[^\\s]+", "g");
      combinator = new JsRegexp("(>|\\+|~)");
    }
  }
View Full Code Here

Examples of com.google.gwt.query.client.js.JsRegexp

    } else if (eq("disabled", pseudoClass)) {
      xpath = "@disabled";
    } else if (eq("checked", pseudoClass)) {
      xpath = "@checked='checked'"; // Doesn't work in Opera 9.24
    } else if (eq("not", pseudoClass)) {
      if (new JsRegexp("^(:\\w+[\\w\\-]*)$").test(pseudoValue)) {
        xpath = "not(" + pseudoToXPath(tag, pseudoValue.substring(1), "") + ")";
      } else {

        pseudoValue = pseudoValue
            .replaceFirst("^\\[#([\\w\\u00C0-\\uFFFF\\-\\_]+)\\]$", "[id=$1]");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.