Esempio n. 1
0
  public Gettext() {
    LangName = "GNUGettext";

    CommentSingle = new HashMap<Integer, String>();
    CommentSingle.put(0, "#:");
    CommentSingle.put(0, "#.");
    CommentSingle.put(0, "#");

    CommentMulti = new HashMap<String, String>();

    CommentRegexp = new HashMap<Integer, String>();

    CaseKeywords = Global.GESHI_CAPS_NO_CHANGE;

    Quotemarks = new ArrayList<String>();
    Quotemarks.add("\'");
    Quotemarks.add("\"");

    EscapeChar = '\\';

    Keywords = new HashMap<Integer, ArrayList<String>>();
    ArrayList<String> KeyStrList1 = new ArrayList<String>();
    KeyStrList1.add("msgid");
    KeyStrList1.add("msgstr");
    Keywords.put(1, KeyStrList1);

    Symbols = new HashMap<Integer, ArrayList<String>>();

    CaseSensitive = new HashMap<Integer, Boolean>();
    CaseSensitive.put(Global.GESHI_COMMENTS, false);
    CaseSensitive.put(1, true);

    Styles.Keywords.put(1, "color:#000000;font-weight:bold;");
    Styles.Comments.put(0, "color:#000099;");
    Styles.Comments.put(1, "color:#000099;");
    Styles.Comments.put(2, "color:#666666;font-style:italic;");
    Styles.EscapeChar.put(0, "color:#000099;font-weight:bold;");
    Styles.Strings.put(0, "color:#ff0000;");

    OOLANG = false;

    Regexps = new HashMap<Integer, HashMap<Integer, String>>();

    StrictModeApplies = Global.GESHI_NEVER;

    TabWidth = 4;
  }
Esempio n. 2
0
  public Javascript() {
    LangName = "Javascript";

    CommentSingle = new HashMap<Integer, String>();
    CommentSingle.put(1, "//");

    CommentMulti = new HashMap<String, String>();
    CommentMulti.put("/*", "*/");

    CommentRegexp = new HashMap<Integer, String>();
    CommentRegexp.put(
        2,
        "(?i)(?<=[\\s^])s\\/(?:\\\\.|[^\\/\\\\])+\\/(?:\\\\.|[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])m?\\/(?:\\\\.|[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\,\\;\\)])");

    CaseKeywords = Global.GESHI_CAPS_NO_CHANGE;

    Quotemarks = new ArrayList<String>();
    Quotemarks.add("\'");
    Quotemarks.add("\"");

    EscapeChar = '\\';

    Keywords = new HashMap<Integer, ArrayList<String>>();
    ArrayList<String> KeyStrList1 = new ArrayList<String>();
    KeyStrList1.add("as");
    KeyStrList1.add("break");
    KeyStrList1.add("case");
    KeyStrList1.add("catch");
    KeyStrList1.add("continue");
    KeyStrList1.add("decodeURI");
    KeyStrList1.add("delete");
    KeyStrList1.add("do");
    KeyStrList1.add("else");
    KeyStrList1.add("encodeURI");
    KeyStrList1.add("eval");
    KeyStrList1.add("finally");
    KeyStrList1.add("for");
    KeyStrList1.add("if");
    KeyStrList1.add("in");
    KeyStrList1.add("is");
    KeyStrList1.add("item");
    KeyStrList1.add("instanceof");
    KeyStrList1.add("return");
    KeyStrList1.add("switch");
    KeyStrList1.add("this");
    KeyStrList1.add("throw");
    KeyStrList1.add("try");
    KeyStrList1.add("typeof");
    KeyStrList1.add("void");
    KeyStrList1.add("while");
    KeyStrList1.add("write");
    KeyStrList1.add("with");
    Keywords.put(1, KeyStrList1);
    ArrayList<String> KeyStrList2 = new ArrayList<String>();
    KeyStrList2.add("class");
    KeyStrList2.add("const");
    KeyStrList2.add("default");
    KeyStrList2.add("debugger");
    KeyStrList2.add("export");
    KeyStrList2.add("extends");
    KeyStrList2.add("false");
    KeyStrList2.add("function");
    KeyStrList2.add("import");
    KeyStrList2.add("namespace");
    KeyStrList2.add("new");
    KeyStrList2.add("null");
    KeyStrList2.add("package");
    KeyStrList2.add("private");
    KeyStrList2.add("protected");
    KeyStrList2.add("public");
    KeyStrList2.add("super");
    KeyStrList2.add("true");
    KeyStrList2.add("use");
    KeyStrList2.add("var");
    Keywords.put(2, KeyStrList2);
    ArrayList<String> KeyStrList3 = new ArrayList<String>();
    KeyStrList3.add("alert");
    KeyStrList3.add("back");
    KeyStrList3.add("blur");
    KeyStrList3.add("close");
    KeyStrList3.add("confirm");
    KeyStrList3.add("focus");
    KeyStrList3.add("forward");
    KeyStrList3.add("home");
    KeyStrList3.add("name");
    KeyStrList3.add("navigate");
    KeyStrList3.add("onblur");
    KeyStrList3.add("onerror");
    KeyStrList3.add("onfocus");
    KeyStrList3.add("onload");
    KeyStrList3.add("onmove");
    KeyStrList3.add("onresize");
    KeyStrList3.add("onunload");
    KeyStrList3.add("open");
    KeyStrList3.add("print");
    KeyStrList3.add("prompt");
    KeyStrList3.add("scroll");
    KeyStrList3.add("status");
    KeyStrList3.add("stop");
    Keywords.put(3, KeyStrList3);

    Symbols = new HashMap<Integer, ArrayList<String>>();
    ArrayList<String> SymStrList = new ArrayList<String>();
    SymStrList.add("(");
    SymStrList.add(")");
    SymStrList.add("[");
    SymStrList.add("]");
    SymStrList.add("{");
    SymStrList.add("}");
    SymStrList.add("+");
    SymStrList.add("-");
    SymStrList.add("*");
    SymStrList.add("/");
    SymStrList.add("%");
    SymStrList.add("!");
    SymStrList.add("@");
    SymStrList.add("&");
    SymStrList.add("|");
    SymStrList.add("^");
    SymStrList.add("<");
    SymStrList.add(">");
    SymStrList.add("=");
    SymStrList.add(",");
    SymStrList.add(";");
    SymStrList.add("?");
    SymStrList.add(":");
    Symbols.put(Global.JASHI_STUBINDEX, SymStrList);

    CaseSensitive = new HashMap<Integer, Boolean>();
    CaseSensitive.put(Global.GESHI_COMMENTS, false);
    CaseSensitive.put(1, false);
    CaseSensitive.put(2, false);
    CaseSensitive.put(3, false);

    Styles.Keywords.put(1, "color:#000066;font-weight:bold;");
    Styles.Keywords.put(2, "color:#003366;font-weight:bold;");
    Styles.Keywords.put(3, "color:#000066;");
    Styles.Comments.put(1, "color:#006600;font-style:italic;");
    Styles.Comments.put(2, "color:#009966;font-style:italic;");
    Styles.Comments.put(Global.MULTI, "color:#006600;font-style:italic;");
    Styles.EscapeChar.put(0, "color:#000099;font-weight:bold;");
    Styles.Brackets.put(0, "color:#009900;");
    Styles.Strings.put(0, "color:#3366CC;");
    Styles.Numbers.put(0, "color:#CC0000;");
    Styles.Methods.put(1, "color:#006600;");
    Styles.Symbols.put(0, "color:#339933;");
    Styles.Script.put(0, "");
    Styles.Script.put(1, "");
    Styles.Script.put(2, "");
    Styles.Script.put(3, "");

    URLS = new HashMap<Integer, String>();
    URLS.put(1, "");
    URLS.put(2, "");
    URLS.put(3, "");

    OOLANG = true;

    ObjectSplitters = new HashMap<Integer, String>();
    ObjectSplitters.put(1, ".");

    Regexps = new HashMap<Integer, HashMap<Integer, String>>();

    StrictModeApplies = Global.GESHI_MAYBE;

    ScriptDelimiters = new HashMap<Integer, HashMap<String, String>>();
    HashMap<String, String> DelStrMap0 = new HashMap<String, String>();
    DelStrMap0.put("<scripttype=\"text/javascript\">", "</script>");
    ScriptDelimiters.put(0, DelStrMap0);
    HashMap<String, String> DelStrMap1 = new HashMap<String, String>();
    DelStrMap1.put("<scriptlanguage=\"javascript\">", "</script>");
    ScriptDelimiters.put(1, DelStrMap1);

    HighlightStrictBlock = new HashMap<Integer, Boolean>();
    HighlightStrictBlock.put(0, true);
    HighlightStrictBlock.put(1, true);
  }