From cc61f8942f0e44ddf73c3f04de43991e1d507740 Mon Sep 17 00:00:00 2001 From: "Natalia.Ukhorskaya" Date: Thu, 19 Apr 2012 14:46:52 +0400 Subject: [PATCH 01/16] Correct formatting for IE and PDF export --- .../org/jetbrains/jet/lexer/JetMacro.java | 32 ++++++++++++++++++- confluence/src/main/resources/kotlin.css | 13 +++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java index b7dd3d91577..431fb120511 100644 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java +++ b/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java @@ -226,6 +226,9 @@ public class JetMacro extends BaseMacro { case '&': builder.append("&"); break; + case ' ': + builder.append(" "); + break; case '"': builder.append("""); break; @@ -235,6 +238,24 @@ public class JetMacro extends BaseMacro { } } + private String addNewLineOpenTag() { + return "
"; + } + + private String addNewLineCloseTag() { + return "
"; + } + + private void addNewLines(StringBuilder result, String yytext) { + for (int i = 0; i < yytext.length(); i++) { + if (yytext.charAt(i) == '\n') { + result.append(" "); + result.append(addNewLineCloseTag()); + result.append(addNewLineOpenTag()); + } + } + } + @Override public String execute(Map map, String code, RenderContext renderContext) throws MacroException { try { @@ -252,6 +273,8 @@ public class JetMacro extends BaseMacro { "
" ); + result.append(addNewLineOpenTag()); + _JetLexer jetLexer = new _JetLexer(DUMMY_READER); jetLexer.reset(afterPreprocessing, 0, afterPreprocessing.length(), _JetLexer.YYINITIAL); @@ -284,7 +307,13 @@ public class JetMacro extends BaseMacro { IElementType token = jetLexer.advance(); if (token == null) break; // CharSequence yytext = jetLexer.yytext(); - String yytext = jetLexer.yytext().toString().replaceAll("\n", "\r\n"); + String yytext = jetLexer.yytext().toString(); + + if (yytext.contains("\n")) { + addNewLines(result, yytext); + yytext = yytext.replaceAll("\n", ""); + } + String style = null; if (token instanceof JetKeywordToken) { style = "keyword"; @@ -306,6 +335,7 @@ public class JetMacro extends BaseMacro { result.append(""); } + result.append(addNewLineCloseTag()); result.append("
"); result.append(""); result.append(""); diff --git a/confluence/src/main/resources/kotlin.css b/confluence/src/main/resources/kotlin.css index c63d0d60613..29449e81d79 100644 --- a/confluence/src/main/resources/kotlin.css +++ b/confluence/src/main/resources/kotlin.css @@ -1,8 +1,19 @@ .jet { - white-space: pre; display: inline; } +.code { + padding: 5px !important; +} + +.codeContent { + margin: 5px !important; +} + +.line { + white-space: pre !important; +} + .jet.keyword { font-weight: bold; color: #369; From bbc8e37d7fb364172375869000ff3e77c13a06b5 Mon Sep 17 00:00:00 2001 From: "Natalia.Ukhorskaya" Date: Thu, 19 Apr 2012 15:16:38 +0400 Subject: [PATCH 02/16] JetLexer update --- .../org/jetbrains/jet/lexer/JetTokens.java | 24 +- .../org/jetbrains/jet/lexer/_JetLexer.java | 1471 +++++++++-------- 2 files changed, 788 insertions(+), 707 deletions(-) diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java index 437213997ca..368b102bf55 100644 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java +++ b/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java @@ -45,9 +45,7 @@ public interface JetTokens { JetToken LONG_TEMPLATE_ENTRY_END = new JetToken("LONG_TEMPLATE_ENTRY_END"); JetToken DANGLING_NEWLINE = new JetToken("DANGLING_NEWLINE"); - JetToken RAW_STRING_LITERAL = new JetToken("RAW_STRING_LITERAL"); - - JetKeywordToken NAMESPACE_KEYWORD = JetKeywordToken.keyword("namespace"); + JetKeywordToken PACKAGE_KEYWORD = JetKeywordToken.keyword("package"); JetKeywordToken AS_KEYWORD = JetKeywordToken.keyword("as"); JetKeywordToken TYPE_KEYWORD = JetKeywordToken.keyword("type"); JetKeywordToken CLASS_KEYWORD = JetKeywordToken.keyword("class"); @@ -109,6 +107,7 @@ public interface JetTokens { JetToken EXCLEQEQEQ = new JetToken("EXCLEQEQEQ"); JetToken EQEQ = new JetToken("EQEQ"); JetToken EXCLEQ = new JetToken("EXCLEQ"); + JetToken EXCLEXCL = new JetToken("EXCLEXCL"); JetToken ANDAND = new JetToken("ANDAND"); JetToken OROR = new JetToken("OROR"); JetToken SAFE_ACCESS = new JetToken("SAFE_ACCESS"); @@ -130,6 +129,9 @@ public interface JetTokens { JetToken HASH = new JetToken("HASH"); JetToken AT = new JetToken("AT"); JetToken ATAT = new JetToken("ATAT"); + + JetToken IDE_TEMPLATE_START = new JetToken("IDE_TEMPLATE_START"); + JetToken IDE_TEMPLATE_END = new JetToken("IDE_TEMPLATE_END"); TokenSet LABELS = TokenSet.create(AT, ATAT, LABEL_IDENTIFIER); @@ -154,14 +156,12 @@ public interface JetTokens { JetKeywordToken OUT_KEYWORD = JetKeywordToken.softKeyword("out"); JetKeywordToken VARARG_KEYWORD = JetKeywordToken.softKeyword("vararg"); JetKeywordToken INLINE_KEYWORD = JetKeywordToken.softKeyword("inline"); + JetKeywordToken ERASED_KEYWORD = JetKeywordToken.softKeyword("erased"); JetKeywordToken FINALLY_KEYWORD = JetKeywordToken.softKeyword("finally"); JetKeywordToken FINAL_KEYWORD = JetKeywordToken.softKeyword("final"); - // TODO: support this as an annotation on arguments. Then, they it probably can not be a soft keyword - JetKeywordToken REF_KEYWORD = JetKeywordToken.softKeyword("ref"); - - TokenSet KEYWORDS = TokenSet.create(NAMESPACE_KEYWORD, AS_KEYWORD, TYPE_KEYWORD, CLASS_KEYWORD, TRAIT_KEYWORD, + TokenSet KEYWORDS = TokenSet.create(PACKAGE_KEYWORD, AS_KEYWORD, TYPE_KEYWORD, CLASS_KEYWORD, TRAIT_KEYWORD, THIS_KEYWORD, SUPER_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, FUN_KEYWORD, FOR_KEYWORD, NULL_KEYWORD, TRUE_KEYWORD, FALSE_KEYWORD, IS_KEYWORD, @@ -173,23 +173,23 @@ public interface JetTokens { TokenSet SOFT_KEYWORDS = TokenSet.create(IMPORT_KEYWORD, WHERE_KEYWORD, BY_KEYWORD, GET_KEYWORD, SET_KEYWORD, ABSTRACT_KEYWORD, ENUM_KEYWORD, OPEN_KEYWORD, ANNOTATION_KEYWORD, OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, PROTECTED_KEYWORD, - CATCH_KEYWORD, FINALLY_KEYWORD, REF_KEYWORD, OUT_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD + CATCH_KEYWORD, FINALLY_KEYWORD, OUT_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD, ERASED_KEYWORD ); TokenSet MODIFIER_KEYWORDS = TokenSet.create(ABSTRACT_KEYWORD, ENUM_KEYWORD, OPEN_KEYWORD, ANNOTATION_KEYWORD, OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, - PROTECTED_KEYWORD, REF_KEYWORD, OUT_KEYWORD, IN_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD + PROTECTED_KEYWORD, OUT_KEYWORD, IN_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD, ERASED_KEYWORD ); TokenSet WHITE_SPACE_OR_COMMENT_BIT_SET = TokenSet.create(WHITE_SPACE, BLOCK_COMMENT, EOL_COMMENT, DOC_COMMENT); TokenSet WHITESPACES = TokenSet.create(TokenType.WHITE_SPACE); TokenSet COMMENTS = TokenSet.create(EOL_COMMENT, BLOCK_COMMENT, DOC_COMMENT); - TokenSet STRINGS = TokenSet.create(CHARACTER_LITERAL, REGULAR_STRING_PART, RAW_STRING_LITERAL); - TokenSet OPERATIONS = TokenSet.create(AS_KEYWORD, AS_SAFE, IS_KEYWORD, IN_KEYWORD, DOT, PLUSPLUS, MINUSMINUS, MUL, PLUS, + TokenSet STRINGS = TokenSet.create(CHARACTER_LITERAL, REGULAR_STRING_PART); + TokenSet OPERATIONS = TokenSet.create(AS_KEYWORD, AS_SAFE, IS_KEYWORD, IN_KEYWORD, DOT, PLUSPLUS, MINUSMINUS, EXCLEXCL, MUL, PLUS, MINUS, EXCL, DIV, PERC, LT, GT, LTEQ, GTEQ, EQEQEQ, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR, SAFE_ACCESS, ELVIS, // MAP, FILTER, - QUEST, COLON, + COLON, RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ, NOT_IN, NOT_IS, // HASH, diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java b/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java index b6660dde6f0..65cef273047 100644 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java +++ b/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java @@ -1,20 +1,4 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* The following code was generated by JFlex 1.4.3 on 1/10/12 4:31 PM */ +/* The following code was generated by JFlex 1.4.3 on 4/19/12 3:09 PM */ package org.jetbrains.jet.lexer; @@ -29,8 +13,8 @@ import org.jetbrains.jet.lexer.JetTokens; /** * This class is a scanner generated by * JFlex 1.4.3 - * on 1/10/12 4:31 PM from the specification file - * /Users/abreslav/work/jet/confluence/../compiler/frontend/src/org/jetbrains/jet/lexer/Jet.flex + * on 4/19/12 3:09 PM from the specification file + * C:/Development/kotlin-fork/kotlin/confluence/../compiler/frontend/src/org/jetbrains/jet/lexer/Jet.flex */ class _JetLexer implements FlexLexer { /** initial size of the lookahead buffer */ @@ -38,9 +22,12 @@ class _JetLexer implements FlexLexer { /** lexical states */ public static final int STRING = 2; + public static final int BLOCK_COMMENT = 8; public static final int YYINITIAL = 0; - public static final int LONG_TEMPLATE_ENTRY = 6; - public static final int SHORT_TEMPLATE_ENTRY = 4; + public static final int LONG_TEMPLATE_ENTRY = 12; + public static final int DOC_COMMENT = 10; + public static final int RAW_STRING = 4; + public static final int SHORT_TEMPLATE_ENTRY = 6; /** * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l @@ -49,21 +36,21 @@ class _JetLexer implements FlexLexer { * l is of the form l = 2*k, k a non negative integer */ private static final int ZZ_LEXSTATE[] = { - 0, 0, 1, 1, 2, 2, 3, 3 + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5 }; /** * Translates characters to character classes */ private static final String ZZ_CMAP_PACKED = - "\11\0\1\3\1\7\1\0\1\3\23\0\1\3\1\57\1\25\1\77"+ - "\1\10\1\67\1\65\1\23\1\72\1\73\1\13\1\62\1\76\1\21"+ - "\1\17\1\12\1\14\11\1\1\74\1\75\1\63\1\60\1\64\1\61"+ - "\1\11\1\2\1\16\2\2\1\20\1\2\11\4\1\22\3\4\1\54"+ - "\3\4\1\15\2\4\1\70\1\24\1\71\1\0\1\4\1\6\1\42"+ - "\1\46\1\35\1\56\1\40\1\52\1\44\1\32\1\33\1\47\1\43"+ - "\1\51\1\4\1\37\1\36\1\41\1\4\1\45\1\34\1\31\1\26"+ - "\1\55\1\50\1\15\1\53\1\4\1\27\1\66\1\30\54\0\1\4"+ + "\11\0\1\3\1\7\1\0\1\3\23\0\1\3\1\57\1\24\1\61"+ + "\1\10\1\70\1\66\1\22\1\73\1\74\1\34\1\65\1\77\1\20"+ + "\1\16\1\12\1\13\11\1\1\75\1\76\1\60\1\63\1\62\1\64"+ + "\1\11\1\2\1\15\2\2\1\17\1\2\11\4\1\21\3\4\1\54"+ + "\3\4\1\14\2\4\1\71\1\23\1\72\1\0\1\4\1\6\1\42"+ + "\1\46\1\35\1\56\1\40\1\52\1\44\1\31\1\32\1\47\1\43"+ + "\1\51\1\4\1\37\1\36\1\41\1\4\1\45\1\33\1\30\1\25"+ + "\1\55\1\50\1\14\1\53\1\4\1\26\1\67\1\27\54\0\1\4"+ "\12\0\1\4\4\0\1\4\5\0\27\4\1\0\37\4\1\0\u013f\4"+ "\31\0\162\4\4\0\14\4\16\0\5\4\11\0\1\4\213\0\1\4"+ "\13\0\1\4\1\0\3\4\1\0\1\4\1\0\24\4\1\0\54\4"+ @@ -135,29 +122,29 @@ class _JetLexer implements FlexLexer { private static final int [] ZZ_ACTION = zzUnpackAction(); private static final String ZZ_ACTION_PACKED_0 = - "\4\0\1\1\1\2\1\3\1\4\2\1\1\5\1\6"+ - "\1\7\1\2\1\10\1\11\1\12\1\13\1\14\1\15"+ - "\20\3\1\16\1\17\1\20\1\21\1\22\1\23\2\1"+ - "\1\24\1\25\1\26\1\27\1\30\1\31\1\32\1\33"+ - "\1\34\1\35\1\36\1\35\1\0\1\37\1\40\1\0"+ - "\1\40\1\41\1\42\1\0\1\43\1\0\1\44\1\0"+ - "\1\45\1\0\1\46\1\47\1\50\1\51\1\52\1\43"+ - "\2\2\1\43\1\53\1\54\1\55\1\56\2\12\1\0"+ - "\3\3\1\57\1\60\1\61\7\3\1\62\10\3\1\63"+ - "\1\0\1\64\1\65\1\66\1\67\1\70\1\71\1\72"+ - "\1\73\1\74\1\75\1\76\1\0\1\77\2\100\1\0"+ - "\1\40\1\101\1\43\1\3\2\0\1\50\1\102\4\0"+ - "\1\103\4\3\1\104\10\3\1\105\4\3\1\106\1\107"+ - "\2\3\1\110\1\111\1\112\1\113\1\114\1\115\2\0"+ - "\2\40\1\44\1\45\1\0\2\102\1\43\2\0\1\116"+ - "\1\3\1\117\1\3\1\120\4\3\1\121\1\122\4\3"+ - "\1\123\1\3\1\124\1\125\1\76\1\0\1\126\1\50"+ - "\2\0\1\127\1\130\1\131\1\3\1\132\3\3\1\133"+ - "\1\134\1\135\1\0\1\103\1\3\1\136\1\3\1\137"+ - "\1\3\1\140\1\141"; + "\6\0\1\1\1\2\1\3\1\4\2\1\1\5\1\6"+ + "\1\2\1\7\1\10\1\11\1\12\1\13\1\14\3\3"+ + "\1\15\15\3\1\16\1\17\1\20\1\21\1\22\1\23"+ + "\1\24\2\1\1\25\1\26\1\27\1\30\1\31\1\32"+ + "\1\33\1\34\1\35\1\36\1\35\1\0\1\37\2\35"+ + "\1\40\1\0\1\40\3\41\1\42\1\43\1\0\1\44"+ + "\1\0\1\45\1\0\1\46\1\0\1\47\1\50\1\51"+ + "\1\52\1\44\2\2\1\44\1\53\1\54\1\55\1\56"+ + "\2\11\1\0\3\3\1\57\1\60\1\61\1\3\1\62"+ + "\6\3\1\63\10\3\1\64\1\0\1\65\1\0\1\66"+ + "\1\0\1\67\1\70\1\71\1\72\1\73\1\74\1\75"+ + "\1\76\1\77\1\0\1\100\2\101\2\0\1\40\1\102"+ + "\1\103\1\104\1\44\1\3\2\0\1\105\4\0\1\106"+ + "\4\3\1\107\10\3\1\110\4\3\1\111\1\112\2\3"+ + "\1\113\1\114\1\115\1\116\1\117\1\120\1\121\1\122"+ + "\2\0\2\40\1\45\1\46\1\123\1\44\1\0\1\124"+ + "\1\3\1\125\1\3\1\126\4\3\1\127\1\130\4\3"+ + "\1\131\1\3\1\132\1\133\1\77\1\0\1\134\1\135"+ + "\1\136\1\137\1\3\1\140\3\3\1\141\1\142\1\143"+ + "\1\0\1\3\1\144\1\3\1\145\1\3\1\146\1\147"; private static int [] zzUnpackAction() { - int [] result = new int[224]; + int [] result = new int[230]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -184,35 +171,36 @@ class _JetLexer implements FlexLexer { private static final String ZZ_ROWMAP_PACKED_0 = "\0\0\0\100\0\200\0\300\0\u0100\0\u0140\0\u0180\0\u01c0"+ "\0\u0200\0\u0240\0\u0280\0\u02c0\0\u0300\0\u0340\0\u0380\0\u03c0"+ - "\0\u0400\0\u0440\0\u0100\0\u0100\0\u0480\0\u04c0\0\u0500\0\u0540"+ + "\0\u0400\0\u0440\0\u0480\0\u0180\0\u0180\0\u04c0\0\u0500\0\u0540"+ "\0\u0580\0\u05c0\0\u0600\0\u0640\0\u0680\0\u06c0\0\u0700\0\u0740"+ - "\0\u0780\0\u07c0\0\u0800\0\u0840\0\u0880\0\u08c0\0\u0100\0\u0900"+ - "\0\u0940\0\u0980\0\u09c0\0\u0a00\0\u0a40\0\u0100\0\u0100\0\u0100"+ - "\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100\0\u0a80\0\u0100\0\u0ac0"+ - "\0\u0b00\0\u0100\0\u0b40\0\u0b80\0\u0bc0\0\u0100\0\u0100\0\u0c00"+ - "\0\u0c40\0\u0c80\0\u0cc0\0\u0d00\0\u0d40\0\u0d80\0\u0100\0\u0dc0"+ - "\0\u0e00\0\u0100\0\u0100\0\u0e40\0\u0e80\0\u0ec0\0\u0f00\0\u0100"+ - "\0\u0100\0\u0100\0\u0100\0\u0100\0\u0f40\0\u0f80\0\u0fc0\0\u1000"+ - "\0\u1040\0\u0180\0\u0180\0\u0180\0\u1080\0\u10c0\0\u1100\0\u1140"+ - "\0\u1180\0\u11c0\0\u1200\0\u1240\0\u1280\0\u12c0\0\u1300\0\u1340"+ - "\0\u1380\0\u13c0\0\u1400\0\u1440\0\u0180\0\u1480\0\u14c0\0\u1500"+ - "\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100"+ - "\0\u1540\0\u1580\0\u0100\0\u0100\0\u15c0\0\u1600\0\u1640\0\u0100"+ - "\0\u1680\0\u0100\0\u16c0\0\u1700\0\u1740\0\u1780\0\u17c0\0\u1800"+ - "\0\u1840\0\u1880\0\u18c0\0\u1900\0\u1940\0\u1980\0\u19c0\0\u0180"+ - "\0\u1a00\0\u1a40\0\u1a80\0\u1ac0\0\u1b00\0\u1b40\0\u1b80\0\u1bc0"+ - "\0\u0100\0\u1c00\0\u1c40\0\u1c80\0\u1cc0\0\u0180\0\u0180\0\u1d00"+ - "\0\u1d40\0\u0180\0\u0180\0\u1d80\0\u1d80\0\u0100\0\u0100\0\u1dc0"+ - "\0\u1e00\0\u0100\0\u1e40\0\u0100\0\u0100\0\u1e80\0\u1ec0\0\u0100"+ - "\0\u1f00\0\u1680\0\u1f40\0\u0180\0\u1f80\0\u0180\0\u1fc0\0\u0180"+ - "\0\u2000\0\u2040\0\u2080\0\u20c0\0\u0180\0\u0180\0\u2100\0\u2140"+ - "\0\u2180\0\u21c0\0\u0180\0\u2200\0\u0180\0\u0100\0\u0100\0\u2240"+ - "\0\u0b40\0\u0100\0\u2280\0\u22c0\0\u0180\0\u0180\0\u0180\0\u2300"+ - "\0\u0180\0\u2340\0\u2380\0\u23c0\0\u0180\0\u0180\0\u0180\0\u2400"+ - "\0\u0100\0\u2440\0\u0180\0\u2480\0\u0180\0\u24c0\0\u0180\0\u0180"; + "\0\u0780\0\u07c0\0\u0800\0\u0840\0\u0880\0\u08c0\0\u0900\0\u0940"+ + "\0\u0180\0\u0980\0\u09c0\0\u0180\0\u0a00\0\u0a40\0\u0a80\0\u0ac0"+ + "\0\u0180\0\u0180\0\u0180\0\u0180\0\u0180\0\u0180\0\u0180\0\u0b00"+ + "\0\u0180\0\u0b40\0\u0b80\0\u0180\0\u0180\0\u0bc0\0\u0c00\0\u0c40"+ + "\0\u0c80\0\u0180\0\u0cc0\0\u0d00\0\u0180\0\u0180\0\u0d40\0\u0d80"+ + "\0\u0dc0\0\u0e00\0\u0e40\0\u0e80\0\u0ec0\0\u0180\0\u0f00\0\u0f40"+ + "\0\u0180\0\u0f80\0\u0fc0\0\u1000\0\u1040\0\u0180\0\u0180\0\u0180"+ + "\0\u0180\0\u0180\0\u1080\0\u10c0\0\u1100\0\u1140\0\u1180\0\u0200"+ + "\0\u0200\0\u0200\0\u11c0\0\u0180\0\u1200\0\u1240\0\u1280\0\u12c0"+ + "\0\u1300\0\u1340\0\u1380\0\u13c0\0\u1400\0\u1440\0\u1480\0\u14c0"+ + "\0\u1500\0\u1540\0\u1580\0\u0200\0\u15c0\0\u1600\0\u1640\0\u0180"+ + "\0\u1680\0\u0180\0\u0180\0\u16c0\0\u0180\0\u0180\0\u0180\0\u0180"+ + "\0\u0180\0\u1700\0\u1740\0\u0180\0\u0180\0\u1780\0\u17c0\0\u1800"+ + "\0\u1840\0\u0180\0\u0180\0\u0180\0\u1880\0\u0180\0\u18c0\0\u1900"+ + "\0\u1940\0\u1980\0\u19c0\0\u1a00\0\u1a40\0\u0180\0\u1a80\0\u1ac0"+ + "\0\u1b00\0\u1b40\0\u0200\0\u1b80\0\u1bc0\0\u1c00\0\u1c40\0\u1c80"+ + "\0\u1cc0\0\u1d00\0\u1d40\0\u0180\0\u1d80\0\u1dc0\0\u1e00\0\u1e40"+ + "\0\u0200\0\u0200\0\u1e80\0\u1ec0\0\u0200\0\u0200\0\u1f00\0\u1f00"+ + "\0\u0180\0\u0180\0\u0180\0\u0180\0\u1f40\0\u1f80\0\u0180\0\u1fc0"+ + "\0\u0180\0\u0180\0\u0180\0\u2000\0\u1880\0\u0200\0\u2040\0\u0200"+ + "\0\u2080\0\u0200\0\u20c0\0\u2100\0\u2140\0\u2180\0\u0200\0\u0200"+ + "\0\u21c0\0\u2200\0\u2240\0\u2280\0\u0200\0\u22c0\0\u0200\0\u0180"+ + "\0\u0180\0\u2300\0\u0c00\0\u0200\0\u0200\0\u0200\0\u2340\0\u0200"+ + "\0\u2380\0\u23c0\0\u2400\0\u0200\0\u0200\0\u0200\0\u2440\0\u2480"+ + "\0\u0200\0\u24c0\0\u0200\0\u2500\0\u0200\0\u0200"; private static int [] zzUnpackRowMap() { - int [] result = new int[224]; + int [] result = new int[230]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -235,242 +223,261 @@ class _JetLexer implements FlexLexer { private static final int [] ZZ_TRANS = zzUnpackTrans(); private static final String ZZ_TRANS_PACKED_0 = - "\1\5\1\6\1\7\1\10\1\7\1\5\1\11\1\10"+ - "\1\12\1\13\1\14\1\15\1\16\2\7\1\17\1\7"+ - "\1\20\1\7\1\21\1\5\1\22\1\7\1\23\1\24"+ - "\1\25\1\7\1\26\1\27\1\30\1\31\1\32\1\33"+ - "\1\34\1\35\2\7\1\36\1\37\1\7\1\40\1\7"+ - "\1\41\1\7\1\42\1\43\1\44\1\45\1\46\1\47"+ - "\1\50\1\51\1\52\1\53\1\54\1\55\1\56\1\57"+ - "\1\60\1\61\1\62\1\63\1\64\1\65\7\66\1\67"+ - "\1\70\13\66\1\71\1\72\52\66\2\0\1\73\1\0"+ - "\1\73\1\0\1\74\6\0\2\73\1\0\1\73\1\0"+ - "\1\73\3\0\1\73\2\0\1\75\25\73\21\0\1\5"+ - "\1\6\1\7\1\10\1\7\1\5\1\11\1\10\1\12"+ - "\1\13\1\14\1\15\1\16\2\7\1\17\1\7\1\20"+ - "\1\7\1\21\1\5\1\22\1\7\1\76\1\77\1\25"+ - "\1\7\1\26\1\27\1\30\1\31\1\32\1\33\1\34"+ - "\1\35\2\7\1\36\1\37\1\7\1\40\1\7\1\41"+ - "\1\7\1\42\1\43\1\44\1\45\1\46\1\47\1\50"+ - "\1\51\1\52\1\53\1\54\1\55\1\56\1\57\1\60"+ - "\1\61\1\62\1\63\1\64\1\65\101\0\1\6\12\0"+ - "\1\6\2\0\1\100\1\101\17\0\1\101\40\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\26\7\24\0\1\10\3\0\1\10"+ - "\70\0\6\102\2\0\70\102\2\0\1\103\1\0\1\103"+ - "\1\0\1\104\6\0\2\103\1\0\1\103\1\0\1\103"+ - "\3\0\1\103\2\0\26\103\23\0\1\105\1\0\1\105"+ - "\1\0\1\106\2\0\1\107\3\0\2\105\1\0\1\105"+ - "\1\0\1\105\3\0\1\105\2\0\26\105\33\0\1\110"+ - "\1\111\44\0\1\112\77\0\1\113\20\0\1\114\12\0"+ - "\1\114\1\115\1\116\1\100\1\101\17\0\1\101\5\0"+ - "\1\116\32\0\1\117\12\0\1\117\2\0\1\120\101\0"+ - "\1\121\36\0\1\122\3\0\1\123\13\0\7\21\1\0"+ - "\13\21\1\124\1\125\53\21\25\0\1\126\53\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\1\7\1\127\12\7\1\130\5\7"+ - "\1\131\3\7\22\0\2\7\1\0\2\7\6\0\3\7"+ - "\1\0\1\7\1\0\1\7\3\0\1\7\2\0\3\7"+ - "\1\132\2\7\1\133\12\7\1\134\4\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\135\2\0\26\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\5\7\1\136\12\7\1\137\5\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\15\7\1\140\10\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\141\2\0\26\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\20\7\1\142\5\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\11\7\1\143\14\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\3\7\1\144\22\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\7\7\1\145\16\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\14\7\1\146\11\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\1\7\1\147\24\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\150"+ - "\2\0\5\7\1\151\3\7\1\152\14\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\1\7\1\153\24\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\11\7\1\154\14\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\5\7\1\155\20\7\54\0\1\156"+ - "\24\0\1\157\77\0\1\160\3\0\1\161\73\0\1\162"+ - "\1\0\1\163\75\0\1\164\77\0\1\165\104\0\1\166"+ - "\100\0\1\167\71\0\1\170\17\0\7\66\2\0\13\66"+ - "\2\0\52\66\2\0\1\171\1\0\1\171\1\0\1\172"+ - "\6\0\2\171\1\0\1\171\1\0\1\171\3\0\1\171"+ - "\1\173\1\0\26\171\21\0\7\174\1\0\16\174\1\175"+ - "\51\174\1\0\2\73\1\0\2\73\6\0\3\73\1\0"+ - "\1\73\1\0\1\73\3\0\1\73\2\0\26\73\21\0"+ - "\6\176\2\0\70\176\1\0\2\73\1\0\2\73\6\0"+ - "\3\73\1\0\1\73\1\0\1\73\3\0\1\73\2\0"+ - "\1\73\1\177\24\73\22\0\1\117\12\0\1\117\2\0"+ - "\1\200\61\0\1\201\12\0\1\201\4\0\1\201\40\0"+ - "\1\201\15\0\6\102\1\202\1\0\70\102\1\0\2\103"+ - "\1\0\2\103\6\0\3\103\1\0\1\103\1\0\1\103"+ - "\3\0\1\103\2\0\26\103\21\0\6\203\2\0\70\203"+ - "\1\0\2\105\1\0\2\105\6\0\3\105\1\0\1\105"+ - "\1\0\1\105\3\0\1\105\2\0\26\105\21\0\6\204"+ - "\2\0\70\204\7\110\1\0\70\110\13\205\1\206\64\205"+ - "\1\0\1\114\12\0\1\114\2\0\1\207\1\101\17\0"+ - "\1\101\40\0\2\115\11\0\1\115\1\0\1\115\1\210"+ - "\1\115\1\0\1\211\12\0\1\115\2\0\1\115\1\211"+ - "\1\115\3\0\1\115\3\0\1\115\3\0\1\115\22\0"+ - "\1\116\12\0\1\116\2\0\1\212\61\0\1\117\12\0"+ - "\1\117\3\0\1\101\17\0\1\101\37\0\7\21\1\0"+ - "\70\21\25\0\1\213\53\0\2\7\1\0\2\7\6\0"+ - "\3\7\1\0\1\7\1\0\1\7\3\0\1\7\2\0"+ - "\2\7\1\214\11\7\1\215\11\7\22\0\2\7\1\0"+ - "\2\7\6\0\3\7\1\0\1\7\1\0\1\7\3\0"+ - "\1\216\2\0\11\7\1\217\10\7\1\220\3\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\10\7\1\221\15\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\10\7\1\222\15\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\6\7\1\223\17\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\11\7\1\224\14\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\16\7\1\225\7\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\20\7\1\226\5\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\3\7\1\227\22\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\4\7\1\230\21\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\26\7\2\0\1\231\17\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\1\232\25\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\7\7\1\233\16\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\2\7\1\234\4\7\1\235\16\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\6\7\1\236\17\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\14\7\1\237\11\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\20\7\1\240\5\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\2\7\1\241\23\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\14\7\1\242\3\7"+ - "\1\243\5\7\55\0\1\244\2\0\1\245\120\0\1\246"+ - "\77\0\1\247\20\0\2\171\1\0\2\171\6\0\3\171"+ - "\1\0\1\171\1\0\1\171\3\0\1\171\2\0\26\171"+ - "\21\0\6\250\2\0\70\250\1\0\2\251\11\0\1\251"+ - "\1\0\1\251\1\0\1\251\14\0\1\251\2\0\1\251"+ - "\1\0\1\251\3\0\1\251\3\0\1\251\3\0\1\251"+ - "\21\0\6\176\1\252\1\0\70\176\1\0\2\73\1\0"+ - "\2\73\6\0\3\73\1\0\1\73\1\0\1\73\3\0"+ - "\1\73\2\0\2\73\1\253\23\73\22\0\1\201\12\0"+ - "\1\201\63\0\6\203\1\254\1\0\70\203\6\204\1\255"+ - "\1\0\70\204\13\205\1\256\64\205\12\257\1\260\1\206"+ - "\64\257\1\0\1\117\12\0\1\117\64\0\2\261\11\0"+ - "\1\261\1\0\1\261\1\200\1\261\14\0\1\261\2\0"+ - "\1\261\1\0\1\261\3\0\1\261\3\0\1\261\3\0"+ - "\1\261\22\0\1\201\12\0\1\201\4\0\1\262\40\0"+ - "\1\262\34\0\1\200\60\0\25\213\1\263\52\213\1\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\3\7\1\264\22\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\5\7\1\265\20\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\7\7\1\266\16\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\2\7\1\267\23\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\7\7\1\270\16\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\7\7\1\271\16\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\1\272\25\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\3\7\1\273\22\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\7\7\1\274\16\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\20\7\1\275\5\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\7\7\1\276\16\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\12\7\1\277\13\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\300\2\0\26\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\11\7\1\301\14\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\20\7\1\302\5\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\6\7\1\303\17\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\3\7\1\304\22\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\3\7\1\305\22\7\22\0\2\306\1\0\2\306"+ - "\6\0\3\306\1\0\1\306\1\0\1\306\3\0\1\306"+ - "\2\0\26\306\21\0\6\250\1\307\1\0\70\250\1\0"+ - "\2\310\11\0\1\310\1\0\1\310\1\0\1\310\14\0"+ - "\1\310\2\0\1\310\1\0\1\310\3\0\1\310\3\0"+ - "\1\310\3\0\1\310\22\0\2\73\1\0\2\73\6\0"+ - "\3\73\1\0\1\73\1\0\1\73\3\0\1\73\2\0"+ - "\3\73\1\311\22\73\21\0\12\205\1\312\1\256\64\205"+ - "\13\257\1\313\64\257\1\0\2\261\11\0\1\261\1\0"+ - "\1\261\1\0\1\261\1\0\1\211\12\0\1\261\2\0"+ - "\1\261\1\211\1\261\3\0\1\261\3\0\1\261\3\0"+ - "\1\261\21\0\25\213\1\314\52\213\1\0\2\7\1\0"+ - "\2\7\6\0\3\7\1\0\1\7\1\0\1\7\3\0"+ - "\1\7\2\0\17\7\1\315\6\7\22\0\2\7\1\0"+ - "\2\7\6\0\3\7\1\0\1\7\1\0\1\7\3\0"+ - "\1\7\2\0\1\316\25\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\14\7\1\317\11\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\2\7\1\320\23\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\3\7\1\321\22\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\4\7\1\322\21\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\11\7\1\323\14\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\14\7\1\324\11\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\12\7\1\325\13\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\7\7\1\326\16\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\7\7\1\327\16\7\22\0\2\330\11\0\1\330"+ - "\1\0\1\330\1\0\1\330\14\0\1\330\2\0\1\330"+ - "\1\0\1\330\3\0\1\330\3\0\1\330\3\0\1\330"+ - "\21\0\12\257\1\260\1\313\64\257\25\213\1\331\52\213"+ - "\1\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\6\7\1\332\17\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\1\333\25\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\13\7\1\334\12\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\6\7\1\335\17\7\22\0"+ - "\2\174\11\0\1\174\1\0\1\174\1\0\1\174\14\0"+ - "\1\174\2\0\1\174\1\0\1\174\3\0\1\174\3\0"+ - "\1\174\3\0\1\174\22\0\2\7\1\0\2\7\6\0"+ - "\3\7\1\0\1\7\1\0\1\7\3\0\1\336\2\0"+ - "\26\7\22\0\2\7\1\0\2\7\6\0\3\7\1\0"+ - "\1\7\1\0\1\7\3\0\1\7\2\0\7\7\1\337"+ - "\16\7\22\0\2\7\1\0\2\7\6\0\3\7\1\0"+ - "\1\7\1\0\1\7\3\0\1\7\2\0\7\7\1\340"+ - "\16\7\21\0"; + "\1\7\1\10\1\11\1\12\1\11\1\7\1\13\1\12"+ + "\1\14\1\15\1\16\1\17\2\11\1\20\1\11\1\21"+ + "\1\11\1\22\1\7\1\23\1\11\1\24\1\25\1\26"+ + "\1\11\1\27\1\30\1\31\1\32\1\33\1\34\1\35"+ + "\1\36\1\37\2\11\1\40\1\41\1\11\1\42\1\11"+ + "\1\43\1\11\1\44\1\45\1\46\1\47\1\50\1\51"+ + "\1\52\1\53\1\54\1\55\1\56\1\57\1\60\1\61"+ + "\1\62\1\63\1\64\1\65\1\66\1\67\7\70\1\71"+ + "\1\72\12\70\1\73\1\74\62\70\1\75\1\72\12\70"+ + "\1\75\1\76\53\70\2\0\1\77\1\0\1\77\1\0"+ + "\1\100\5\0\2\77\1\0\1\77\1\0\1\77\3\0"+ + "\1\77\2\0\1\101\3\77\1\0\22\77\21\0\12\102"+ + "\1\103\21\102\1\104\43\102\1\7\1\10\1\11\1\12"+ + "\1\11\1\7\1\13\1\12\1\14\1\15\1\16\1\17"+ + "\2\11\1\20\1\11\1\21\1\11\1\22\1\7\1\23"+ + "\1\11\1\105\1\106\1\26\1\11\1\27\1\30\1\31"+ + "\1\32\1\33\1\34\1\35\1\36\1\37\2\11\1\40"+ + "\1\41\1\11\1\42\1\11\1\43\1\11\1\44\1\45"+ + "\1\46\1\47\1\50\1\51\1\52\1\53\1\54\1\55"+ + "\1\56\1\57\1\60\1\61\1\62\1\63\1\64\1\65"+ + "\1\66\1\67\101\0\1\10\11\0\1\10\2\0\1\107"+ + "\1\110\20\0\1\110\40\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\4\11\1\0\22\11\24\0\1\12\3\0\1\12\70\0"+ + "\6\111\2\0\70\111\2\0\1\112\1\0\1\112\1\0"+ + "\1\113\5\0\2\112\1\0\1\112\1\0\1\112\3\0"+ + "\1\112\2\0\4\112\1\0\22\112\23\0\1\114\1\0"+ + "\1\114\1\0\1\115\2\0\1\116\2\0\2\114\1\0"+ + "\1\114\1\0\1\114\3\0\1\114\2\0\4\114\1\0"+ + "\22\114\33\0\1\117\21\0\1\120\26\0\1\121\15\0"+ + "\1\122\11\0\1\122\1\123\1\124\1\107\1\110\20\0"+ + "\1\110\5\0\1\124\32\0\1\125\11\0\1\125\2\0"+ + "\1\126\101\0\1\127\41\0\1\130\1\131\14\0\7\22"+ + "\1\0\12\22\1\132\1\133\54\22\24\0\1\134\54\0"+ + "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ + "\1\11\3\0\1\11\2\0\1\11\1\135\2\11\1\0"+ + "\10\11\1\136\5\11\1\137\3\11\22\0\2\11\1\0"+ + "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ + "\1\11\2\0\3\11\1\140\1\0\2\11\1\141\12\11"+ + "\1\142\4\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\143\2\0\4\11"+ + "\1\0\22\11\104\0\1\144\15\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ + "\2\0\4\11\1\0\1\11\1\145\12\11\1\146\5\11"+ + "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ + "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\11\11"+ + "\1\147\10\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\150\2\0\4\11"+ + "\1\0\22\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\4\11"+ + "\1\0\14\11\1\151\5\11\22\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ + "\2\0\4\11\1\0\5\11\1\152\14\11\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\3\11\1\153\1\0\22\11\22\0"+ + "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ + "\1\11\3\0\1\11\2\0\4\11\1\0\3\11\1\154"+ + "\16\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ + "\1\11\1\0\1\11\3\0\1\11\2\0\4\11\1\0"+ + "\10\11\1\155\11\11\22\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\1\11\1\156\2\11\1\0\22\11\22\0\2\11\1\0"+ + "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ + "\1\157\2\0\4\11\1\0\1\11\1\160\3\11\1\161"+ + "\14\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ + "\1\11\1\0\1\11\3\0\1\11\2\0\1\11\1\162"+ + "\2\11\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\4\11\1\0\5\11\1\163\14\11\22\0\2\11\1\0"+ + "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ + "\1\11\2\0\4\11\1\0\1\11\1\164\20\11\53\0"+ + "\1\165\30\0\1\166\75\0\1\167\1\0\1\170\75\0"+ + "\1\171\1\0\1\172\76\0\1\173\1\174\77\0\1\175"+ + "\1\0\1\176\100\0\1\177\100\0\1\200\73\0\1\201"+ + "\14\0\7\70\2\0\12\70\2\0\53\70\2\0\1\202"+ + "\1\0\1\202\1\0\1\203\5\0\2\202\1\0\1\202"+ + "\1\0\1\202\3\0\1\202\1\204\1\0\4\202\1\0"+ + "\22\202\21\0\7\205\1\0\15\205\1\206\52\205\24\0"+ + "\1\207\54\0\2\77\1\0\2\77\5\0\3\77\1\0"+ + "\1\77\1\0\1\77\3\0\1\77\2\0\4\77\1\0"+ + "\22\77\21\0\6\210\2\0\70\210\1\0\2\77\1\0"+ + "\2\77\5\0\3\77\1\0\1\77\1\0\1\77\3\0"+ + "\1\77\2\0\1\77\1\211\2\77\1\0\22\77\55\0"+ + "\1\212\55\0\1\213\66\0\1\125\11\0\1\125\2\0"+ + "\1\214\62\0\1\215\11\0\1\215\4\0\1\215\44\0"+ + "\1\215\12\0\6\111\1\216\1\0\70\111\1\0\2\112"+ + "\1\0\2\112\5\0\3\112\1\0\1\112\1\0\1\112"+ + "\3\0\1\112\2\0\4\112\1\0\22\112\21\0\6\217"+ + "\2\0\70\217\1\0\2\114\1\0\2\114\5\0\3\114"+ + "\1\0\1\114\1\0\1\114\3\0\1\114\2\0\4\114"+ + "\1\0\22\114\21\0\6\220\2\0\70\220\7\117\1\0"+ + "\70\117\34\0\1\221\44\0\1\122\11\0\1\122\2\0"+ + "\1\222\1\110\20\0\1\110\40\0\2\123\10\0\1\123"+ + "\1\0\1\123\1\223\1\123\1\0\1\224\13\0\1\123"+ + "\2\0\1\123\1\224\1\123\3\0\1\123\3\0\1\123"+ + "\3\0\1\123\22\0\1\124\11\0\1\124\2\0\1\225"+ + "\62\0\1\125\11\0\1\125\3\0\1\110\20\0\1\110"+ + "\37\0\7\22\1\0\70\22\24\0\1\226\54\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\2\11\1\227\1\11\1\0\10\11"+ + "\1\230\11\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\231\2\0\4\11"+ + "\1\0\5\11\1\232\10\11\1\233\3\11\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\4\11\1\0\4\11\1\234\15\11"+ + "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ + "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\4\11"+ + "\1\235\15\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\4\11"+ + "\1\0\2\11\1\236\17\11\22\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ + "\2\0\4\11\1\0\5\11\1\237\14\11\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\4\11\1\0\12\11\1\240\7\11"+ + "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ + "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\14\11"+ + "\1\241\5\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\3\11"+ + "\1\242\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\4\11\1\0\1\243\21\11\22\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ + "\2\0\4\11\1\0\22\11\5\0\1\244\14\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\1\245\3\11\1\0\22\11\22\0"+ + "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ + "\1\11\3\0\1\11\2\0\4\11\1\0\3\11\1\246"+ + "\16\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ + "\1\11\1\0\1\11\3\0\1\11\2\0\2\11\1\247"+ + "\1\11\1\0\3\11\1\250\16\11\22\0\2\11\1\0"+ + "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ + "\1\11\2\0\4\11\1\0\2\11\1\251\17\11\22\0"+ + "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ + "\1\11\3\0\1\11\2\0\4\11\1\0\10\11\1\252"+ + "\11\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ + "\1\11\1\0\1\11\3\0\1\11\2\0\4\11\1\0"+ + "\14\11\1\253\5\11\22\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\2\11\1\254\1\11\1\0\22\11\22\0\2\11\1\0"+ + "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ + "\1\11\2\0\4\11\1\0\10\11\1\255\3\11\1\256"+ + "\5\11\54\0\1\257\3\0\1\260\123\0\1\261\74\0"+ + "\1\262\101\0\1\263\100\0\1\264\15\0\2\202\1\0"+ + "\2\202\5\0\3\202\1\0\1\202\1\0\1\202\3\0"+ + "\1\202\2\0\4\202\1\0\22\202\21\0\6\265\2\0"+ + "\70\265\1\0\2\266\10\0\1\266\1\0\1\266\1\0"+ + "\1\266\15\0\1\266\2\0\1\266\1\0\1\266\3\0"+ + "\1\266\3\0\1\266\3\0\1\266\45\0\1\74\53\0"+ + "\6\210\1\267\1\0\70\210\1\0\2\77\1\0\2\77"+ + "\5\0\3\77\1\0\1\77\1\0\1\77\3\0\1\77"+ + "\2\0\2\77\1\270\1\77\1\0\22\77\22\0\1\215"+ + "\11\0\1\215\64\0\6\217\1\271\1\0\70\217\6\220"+ + "\1\272\1\0\70\220\12\0\1\273\66\0\1\125\11\0"+ + "\1\125\65\0\2\274\10\0\1\274\1\0\1\274\1\214"+ + "\1\274\15\0\1\274\2\0\1\274\1\0\1\274\3\0"+ + "\1\274\3\0\1\274\3\0\1\274\22\0\1\215\11\0"+ + "\1\215\4\0\1\275\44\0\1\275\30\0\1\214\62\0"+ + "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ + "\1\11\3\0\1\11\2\0\3\11\1\276\1\0\22\11"+ + "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ + "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\1\11"+ + "\1\277\20\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\4\11"+ + "\1\0\3\11\1\300\16\11\22\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ + "\2\0\2\11\1\301\1\11\1\0\22\11\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\4\11\1\0\3\11\1\302\16\11"+ + "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ + "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\3\11"+ + "\1\303\16\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\1\304"+ + "\3\11\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\3\11\1\305\1\0\22\11\22\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ + "\2\0\4\11\1\0\3\11\1\306\16\11\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\4\11\1\0\14\11\1\307\5\11"+ + "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ + "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\3\11"+ + "\1\310\16\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\4\11"+ + "\1\0\6\11\1\311\13\11\22\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\312"+ + "\2\0\4\11\1\0\22\11\22\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ + "\2\0\4\11\1\0\5\11\1\313\14\11\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\4\11\1\0\14\11\1\314\5\11"+ + "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ + "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\2\11"+ + "\1\315\17\11\22\0\2\11\1\0\2\11\5\0\3\11"+ + "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\3\11"+ + "\1\316\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\3\11\1\317\1\0\22\11\22\0\2\320\1\0\2\320"+ + "\5\0\3\320\1\0\1\320\1\0\1\320\3\0\1\320"+ + "\2\0\4\320\1\0\22\320\21\0\6\265\1\321\1\0"+ + "\70\265\1\0\2\322\10\0\1\322\1\0\1\322\1\0"+ + "\1\322\15\0\1\322\2\0\1\322\1\0\1\322\3\0"+ + "\1\322\3\0\1\322\3\0\1\322\22\0\2\77\1\0"+ + "\2\77\5\0\3\77\1\0\1\77\1\0\1\77\3\0"+ + "\1\77\2\0\3\77\1\323\1\0\22\77\22\0\2\274"+ + "\10\0\1\274\1\0\1\274\1\0\1\274\1\0\1\224"+ + "\13\0\1\274\2\0\1\274\1\224\1\274\3\0\1\274"+ + "\3\0\1\274\3\0\1\274\22\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ + "\2\0\4\11\1\0\13\11\1\324\6\11\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\1\325\3\11\1\0\22\11\22\0"+ + "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ + "\1\11\3\0\1\11\2\0\4\11\1\0\10\11\1\326"+ + "\11\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ + "\1\11\1\0\1\11\3\0\1\11\2\0\2\11\1\327"+ + "\1\11\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\3\11\1\330\1\0\22\11\22\0\2\11\1\0\2\11"+ + "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ + "\2\0\4\11\1\0\1\331\21\11\22\0\2\11\1\0"+ + "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ + "\1\11\2\0\4\11\1\0\5\11\1\332\14\11\22\0"+ + "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ + "\1\11\3\0\1\11\2\0\4\11\1\0\10\11\1\333"+ + "\11\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ + "\1\11\1\0\1\11\3\0\1\11\2\0\4\11\1\0"+ + "\6\11\1\334\13\11\22\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\4\11\1\0\3\11\1\335\16\11\22\0\2\11\1\0"+ + "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ + "\1\11\2\0\4\11\1\0\3\11\1\336\16\11\22\0"+ + "\2\337\10\0\1\337\1\0\1\337\1\0\1\337\15\0"+ + "\1\337\2\0\1\337\1\0\1\337\3\0\1\337\3\0"+ + "\1\337\3\0\1\337\22\0\2\11\1\0\2\11\5\0"+ + "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ + "\4\11\1\0\2\11\1\340\17\11\22\0\2\11\1\0"+ + "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ + "\1\11\2\0\1\341\3\11\1\0\22\11\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\4\11\1\0\7\11\1\342\12\11"+ + "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ + "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\2\11"+ + "\1\343\17\11\22\0\2\205\10\0\1\205\1\0\1\205"+ + "\1\0\1\205\15\0\1\205\2\0\1\205\1\0\1\205"+ + "\3\0\1\205\3\0\1\205\3\0\1\205\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\344\2\0\4\11\1\0\22\11\22\0\2\11"+ + "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ + "\3\0\1\11\2\0\4\11\1\0\3\11\1\345\16\11"+ + "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ + "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\3\11"+ + "\1\346\16\11\21\0"; private static int [] zzUnpackTrans() { - int [] result = new int[9472]; + int [] result = new int[9536]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -511,18 +518,19 @@ class _JetLexer implements FlexLexer { private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\4\0\1\11\15\1\2\11\22\1\1\11\6\1\10\11"+ - "\1\1\1\11\1\1\1\0\1\11\1\1\1\0\1\1"+ - "\2\11\1\0\1\1\1\0\1\1\1\0\1\1\1\0"+ - "\1\11\2\1\2\11\4\1\5\11\1\1\1\0\27\1"+ - "\1\0\2\1\10\11\1\1\1\0\2\11\1\1\1\0"+ - "\1\1\1\11\1\1\1\11\2\0\2\1\4\0\16\1"+ - "\1\11\14\1\2\11\2\0\1\11\1\1\2\11\1\0"+ - "\1\1\1\11\1\1\2\0\22\1\2\11\1\0\1\1"+ - "\1\11\2\0\13\1\1\0\1\11\7\1"; + "\6\0\1\11\14\1\2\11\23\1\1\11\2\1\1\11"+ + "\4\1\7\11\1\1\1\11\1\1\1\0\2\11\2\1"+ + "\1\0\1\1\1\11\2\1\2\11\1\0\1\1\1\0"+ + "\1\1\1\0\1\1\1\0\1\11\2\1\1\11\4\1"+ + "\5\11\1\1\1\0\7\1\1\11\20\1\1\0\1\1"+ + "\1\0\1\11\1\0\2\11\1\1\5\11\1\1\1\0"+ + "\2\11\1\1\2\0\1\1\3\11\1\1\1\11\2\0"+ + "\1\1\4\0\1\11\15\1\1\11\14\1\4\11\2\0"+ + "\1\11\1\1\3\11\1\1\1\0\22\1\2\11\1\0"+ + "\14\1\1\0\7\1"; private static int [] zzUnpackAttribute() { - int [] result = new int[224]; + int [] result = new int[230]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -589,11 +597,19 @@ class _JetLexer implements FlexLexer { this.state = state; this.lBraceCount = lBraceCount; } + + @Override + public String toString() { + return "yystate = " + state + (lBraceCount == 0 ? "" : "lBraceCount = " + lBraceCount); + } } private final Stack states = new Stack(); private int lBraceCount; + private int commentStart; + private int commentDepth; + private void pushState(int state) { states.push(new State(yystate(), lBraceCount)); lBraceCount = 0; @@ -606,6 +622,17 @@ class _JetLexer implements FlexLexer { yybegin(state.state); } + private IElementType commentStateToTokenType(int state) { + switch (state) { + case BLOCK_COMMENT: + return JetTokens.BLOCK_COMMENT; + case DOC_COMMENT: + return JetTokens.DOC_COMMENT; + default: + throw new IllegalArgumentException("Unexpected state: " + state); + } + } + _JetLexer(java.io.Reader in) { this.zzReader = in; @@ -770,7 +797,8 @@ class _JetLexer implements FlexLexer { private void zzDoEOF() { if (!zzEOFDone) { zzEOFDone = true; - + return; + } } @@ -856,24 +884,422 @@ class _JetLexer implements FlexLexer { case 3: { return JetTokens.IDENTIFIER; } - case 98: break; - case 11: + case 104: break; + case 10: { pushState(STRING); return JetTokens.OPEN_QUOTE; } - case 99: break; - case 71: + case 105: break; + case 74: { return JetTokens.FOR_KEYWORD ; } - case 100: break; - case 95: + case 106: break; + case 101: { return JetTokens.RETURN_KEYWORD ; } - case 101: break; - case 81: + case 107: break; + case 87: { return JetTokens.NULL_KEYWORD ; } - case 102: break; + case 108: break; + case 15: + { return JetTokens.LT ; + } + case 109: break; + case 52: + { return JetTokens.DO_KEYWORD ; + } + case 110: break; + case 20: + { return JetTokens.PLUS ; + } + case 111: break; + case 58: + { return JetTokens.PLUSEQ ; + } + case 112: break; + case 92: + { popState(); return JetTokens.THIS_KEYWORD; + } + case 113: break; + case 28: + { return JetTokens.COMMA ; + } + case 114: break; + case 17: + { return JetTokens.GT ; + } + case 115: break; + case 4: + { return JetTokens.WHITE_SPACE; + } + case 116: break; + case 25: + { return JetTokens.RPAR ; + } + case 117: break; + case 56: + { return JetTokens.DOUBLE_ARROW; + } + case 118: break; + case 85: + { return JetTokens.TRUE_KEYWORD ; + } + case 119: break; + case 80: + { return JetTokens.IDE_TEMPLATE_START ; + } + case 120: break; + case 37: + { return JetTokens.FIELD_IDENTIFIER; + } + case 121: break; + case 60: + { return JetTokens.ANDAND ; + } + case 122: break; + case 64: + { pushState(LONG_TEMPLATE_ENTRY); return JetTokens.LONG_TEMPLATE_ENTRY_START; + } + case 123: break; + case 36: + { return JetTokens.FLOAT_LITERAL; + } + case 124: break; + case 40: + { return JetTokens.EOL_COMMENT; + } + case 125: break; + case 89: + { return JetTokens.WHEN_KEYWORD ; + } + case 126: break; + case 70: + { pushState(RAW_STRING); return JetTokens.OPEN_QUOTE; + } + case 127: break; + case 26: + { return JetTokens.COLON ; + } + case 128: break; + case 54: + { return JetTokens.LTEQ ; + } + case 129: break; + case 45: + { return JetTokens.ARROW ; + } + case 130: break; + case 32: + { popState(); return JetTokens.IDENTIFIER; + } + case 131: break; + case 22: + { return JetTokens.LBRACKET ; + } + case 132: break; + case 68: + { yypushback(2); return JetTokens.INTEGER_LITERAL; + } + case 133: break; + case 9: + { return JetTokens.CHARACTER_LITERAL; + } + case 134: break; + case 75: + { return JetTokens.VAR_KEYWORD ; + } + case 135: break; + case 55: + { return JetTokens.GTEQ ; + } + case 136: break; + case 2: + { return JetTokens.INTEGER_LITERAL; + } + case 137: break; + case 12: + { return JetTokens.RBRACE ; + } + case 138: break; + case 96: + { return JetTokens.CLASS_KEYWORD ; + } + case 139: break; + case 14: + { return JetTokens.EXCL ; + } + case 140: break; + case 71: + { return JetTokens.TRY_KEYWORD ; + } + case 141: break; + case 53: + { return JetTokens.EXCLEQ ; + } + case 142: break; + case 46: + { return JetTokens.MINUSEQ ; + } + case 143: break; + case 102: + { return JetTokens.PACKAGE_KEYWORD ; + } + case 144: break; + case 93: + { return JetTokens.THROW_KEYWORD ; + } + case 145: break; + case 95: + { return JetTokens.SUPER_KEYWORD ; + } + case 146: break; + case 98: + { return JetTokens.WHILE_KEYWORD ; + } + case 147: break; + case 44: + { return JetTokens.MINUSMINUS; + } + case 148: break; + case 103: + { return JetTokens.CONTINUE_KEYWORD ; + } + case 149: break; + case 78: + { return JetTokens.NOT_IN; + } + case 150: break; + case 39: + { return JetTokens.ATAT ; + } + case 151: break; + case 69: + { pushState(DOC_COMMENT); + commentDepth = 0; + commentStart = getTokenStart(); + } + case 152: break; + case 6: + { return JetTokens.DIV ; + } + case 153: break; + case 63: + { pushState(SHORT_TEMPLATE_ENTRY); + yypushback(yylength() - 1); + return JetTokens.SHORT_TEMPLATE_ENTRY_START; + } + case 154: break; + case 81: + { return JetTokens.IDE_TEMPLATE_END ; + } + case 155: break; + case 38: + { return JetTokens.LABEL_IDENTIFIER; + } + case 156: break; + case 29: + { return JetTokens.REGULAR_STRING_PART; + } + case 157: break; + case 19: + { return JetTokens.QUEST ; + } + case 158: break; + case 61: + { return JetTokens.OROR ; + } + case 159: break; + case 21: + { return JetTokens.PERC ; + } + case 160: break; + case 79: + { return JetTokens.EXCLEQEQEQ; + } + case 161: break; + case 62: + { return JetTokens.PERCEQ ; + } + case 162: break; + case 43: + { return JetTokens.RANGE ; + } + case 163: break; + case 1: + { return TokenType.BAD_CHARACTER; + } + case 164: break; + case 77: + { return JetTokens.NOT_IS; + } + case 165: break; + case 13: + { return JetTokens.MUL ; + } + case 166: break; + case 23: + { return JetTokens.RBRACKET ; + } + case 167: break; + case 59: + { return JetTokens.PLUSPLUS ; + } + case 168: break; + case 84: + { return JetTokens.THIS_KEYWORD ; + } + case 169: break; + case 7: + { return JetTokens.DOT ; + } + case 170: break; + case 27: + { return JetTokens.SEMICOLON ; + } + case 171: break; + case 49: + { return JetTokens.IF_KEYWORD ; + } + case 172: break; + case 65: + { return JetTokens.ESCAPE_SEQUENCE; + } + case 173: break; + case 41: + { pushState(BLOCK_COMMENT); + commentDepth = 0; + commentStart = getTokenStart(); + } + case 174: break; + case 31: + { popState(); return JetTokens.CLOSING_QUOTE; + } + case 175: break; + case 18: + { return JetTokens.EQ ; + } + case 176: break; + case 5: + { return JetTokens.AT ; + } + case 177: break; + case 72: + { return JetTokens.AS_SAFE; + } + case 178: break; + case 24: + { return JetTokens.LPAR ; + } + case 179: break; + case 8: + { return JetTokens.MINUS ; + } + case 180: break; + case 67: + { if (commentDepth > 0) { + commentDepth--; + } + else { + int state = yystate(); + popState(); + zzStartRead = commentStart; + return commentStateToTokenType(state); + } + } + case 181: break; + case 99: + { return JetTokens.FALSE_KEYWORD ; + } + case 182: break; + case 86: + { return JetTokens.TYPE_KEYWORD ; + } + case 183: break; + case 66: + { commentDepth++; + } + case 184: break; + case 73: + { return JetTokens.FUN_KEYWORD ; + } + case 185: break; + case 47: + { return JetTokens.IS_KEYWORD ; + } + case 186: break; + case 30: + { popState(); yypushback(1); return JetTokens.DANGLING_NEWLINE; + } + case 187: break; case 34: + { lBraceCount++; return JetTokens.LBRACE; + } + case 188: break; + case 91: + { yypushback(3); return JetTokens.EXCL; + } + case 189: break; + case 42: + { return JetTokens.DIVEQ ; + } + case 190: break; + case 88: + { return JetTokens.ELSE_KEYWORD ; + } + case 191: break; + case 51: + { return JetTokens.AS_KEYWORD ; + } + case 192: break; + case 48: + { return JetTokens.IN_KEYWORD ; + } + case 193: break; + case 57: + { return JetTokens.EQEQ ; + } + case 194: break; + case 82: + { return JetTokens.EQEQEQ ; + } + case 195: break; + case 76: + { return JetTokens.VAL_KEYWORD ; + } + case 196: break; + case 90: + { return JetTokens.CAPITALIZED_THIS_KEYWORD ; + } + case 197: break; + case 50: + { return JetTokens.MULTEQ ; + } + case 198: break; + case 11: + { return JetTokens.LBRACE ; + } + case 199: break; + case 100: + { return JetTokens.OBJECT_KEYWORD ; + } + case 200: break; + case 97: + { return JetTokens.BREAK_KEYWORD ; + } + case 201: break; + case 83: + { return JetTokens.BLOCK_COMMENT; + } + case 202: break; + case 94: + { return JetTokens.TRAIT_KEYWORD ; + } + case 203: break; + case 33: + { + } + case 204: break; + case 35: { if (lBraceCount == 0) { popState(); return JetTokens.LONG_TEMPLATE_ENTRY_END; @@ -881,378 +1307,33 @@ class _JetLexer implements FlexLexer { lBraceCount--; return JetTokens.RBRACE; } - case 103: break; - case 18: - { return JetTokens.LT ; - } - case 104: break; - case 51: - { return JetTokens.DO_KEYWORD ; - } - case 105: break; - case 17: - { return JetTokens.PLUS ; - } - case 106: break; - case 67: - { return JetTokens.RAW_STRING_LITERAL; - } - case 107: break; - case 55: - { return JetTokens.PLUSEQ ; - } - case 108: break; - case 86: - { popState(); return JetTokens.THIS_KEYWORD; - } - case 109: break; - case 27: - { return JetTokens.COMMA ; - } - case 110: break; - case 19: - { return JetTokens.GT ; - } - case 111: break; - case 4: - { return JetTokens.WHITE_SPACE; - } - case 112: break; - case 24: - { return JetTokens.RPAR ; - } - case 113: break; - case 54: - { return JetTokens.DOUBLE_ARROW; - } - case 114: break; - case 79: - { return JetTokens.TRUE_KEYWORD ; - } - case 115: break; - case 36: - { return JetTokens.FIELD_IDENTIFIER; - } - case 116: break; - case 59: - { return JetTokens.ANDAND ; - } - case 117: break; - case 63: - { pushState(LONG_TEMPLATE_ENTRY); return JetTokens.LONG_TEMPLATE_ENTRY_START; - } - case 118: break; - case 66: - { return JetTokens.DOC_COMMENT; - } - case 119: break; - case 35: - { return JetTokens.FLOAT_LITERAL; - } - case 120: break; - case 39: - { return JetTokens.EOL_COMMENT; - } - case 121: break; - case 83: - { return JetTokens.WHEN_KEYWORD ; - } - case 122: break; - case 25: - { return JetTokens.COLON ; - } - case 123: break; - case 57: - { return JetTokens.LTEQ ; - } - case 124: break; - case 46: - { return JetTokens.ARROW ; - } - case 125: break; - case 32: - { popState(); return JetTokens.IDENTIFIER; - } - case 126: break; - case 21: - { return JetTokens.LBRACKET ; - } - case 127: break; - case 65: - { yypushback(2); return JetTokens.INTEGER_LITERAL; - } - case 128: break; - case 10: - { return JetTokens.CHARACTER_LITERAL; - } - case 129: break; - case 72: - { return JetTokens.VAR_KEYWORD ; - } - case 130: break; - case 58: - { return JetTokens.GTEQ ; - } - case 131: break; - case 2: - { return JetTokens.INTEGER_LITERAL; - } - case 132: break; - case 13: - { return JetTokens.RBRACE ; - } - case 133: break; - case 90: - { return JetTokens.CLASS_KEYWORD ; - } - case 134: break; - case 14: - { return JetTokens.EXCL ; - } - case 135: break; - case 68: - { return JetTokens.TRY_KEYWORD ; - } - case 136: break; - case 52: - { return JetTokens.EXCLEQ ; - } - case 137: break; - case 45: - { return JetTokens.MINUSEQ ; - } - case 138: break; - case 87: - { return JetTokens.THROW_KEYWORD ; - } - case 139: break; - case 89: - { return JetTokens.SUPER_KEYWORD ; - } - case 140: break; - case 92: - { return JetTokens.WHILE_KEYWORD ; - } - case 141: break; - case 44: - { return JetTokens.MINUSMINUS; - } - case 142: break; - case 97: - { return JetTokens.CONTINUE_KEYWORD ; - } - case 143: break; - case 75: - { return JetTokens.NOT_IN; - } - case 144: break; - case 38: - { return JetTokens.ATAT ; - } - case 145: break; - case 6: - { return JetTokens.DIV ; - } - case 146: break; - case 37: - { return JetTokens.LABEL_IDENTIFIER; - } - case 147: break; - case 29: - { return JetTokens.REGULAR_STRING_PART; - } - case 148: break; + case 205: break; case 16: - { return JetTokens.QUEST ; - } - case 149: break; - case 60: - { return JetTokens.OROR ; - } - case 150: break; - case 20: - { return JetTokens.PERC ; - } - case 151: break; - case 76: - { return JetTokens.EXCLEQEQEQ; - } - case 152: break; - case 61: - { return JetTokens.PERCEQ ; - } - case 153: break; - case 43: - { return JetTokens.RANGE ; - } - case 154: break; - case 1: - { return TokenType.BAD_CHARACTER; - } - case 155: break; - case 96: - { return JetTokens.NAMESPACE_KEYWORD ; - } - case 156: break; - case 74: - { return JetTokens.NOT_IS; - } - case 157: break; - case 7: - { return JetTokens.MUL ; - } - case 158: break; - case 22: - { return JetTokens.RBRACKET ; - } - case 159: break; - case 56: - { return JetTokens.PLUSPLUS ; - } - case 160: break; - case 78: - { return JetTokens.THIS_KEYWORD ; - } - case 161: break; - case 8: - { return JetTokens.DOT ; - } - case 162: break; - case 26: - { return JetTokens.SEMICOLON ; - } - case 163: break; - case 49: - { return JetTokens.IF_KEYWORD ; - } - case 164: break; - case 64: - { return JetTokens.ESCAPE_SEQUENCE; - } - case 165: break; - case 31: - { popState(); return JetTokens.CLOSING_QUOTE; - } - case 166: break; - case 15: - { return JetTokens.EQ ; - } - case 167: break; - case 5: - { return JetTokens.AT ; - } - case 168: break; - case 69: - { return JetTokens.AS_SAFE; - } - case 169: break; - case 23: - { return JetTokens.LPAR ; - } - case 170: break; - case 9: - { return JetTokens.MINUS ; - } - case 171: break; - case 93: - { return JetTokens.FALSE_KEYWORD ; - } - case 172: break; - case 80: - { return JetTokens.TYPE_KEYWORD ; - } - case 173: break; - case 70: - { return JetTokens.FUN_KEYWORD ; - } - case 174: break; - case 47: - { return JetTokens.IS_KEYWORD ; - } - case 175: break; - case 30: - { popState(); yypushback(1); return JetTokens.DANGLING_NEWLINE; - } - case 176: break; - case 33: - { lBraceCount++; return JetTokens.LBRACE; - } - case 177: break; - case 85: - { yypushback(3); return JetTokens.EXCL; - } - case 178: break; - case 41: - { return JetTokens.DIVEQ ; - } - case 179: break; - case 82: - { return JetTokens.ELSE_KEYWORD ; - } - case 180: break; - case 50: - { return JetTokens.AS_KEYWORD ; - } - case 181: break; - case 48: - { return JetTokens.IN_KEYWORD ; - } - case 182: break; - case 53: - { return JetTokens.EQEQ ; - } - case 183: break; - case 77: - { return JetTokens.EQEQEQ ; - } - case 184: break; - case 73: - { return JetTokens.VAL_KEYWORD ; - } - case 185: break; - case 84: - { return JetTokens.CAPITALIZED_THIS_KEYWORD ; - } - case 186: break; - case 42: - { return JetTokens.MULTEQ ; - } - case 187: break; - case 62: - { pushState(SHORT_TEMPLATE_ENTRY); - yypushback(yylength() - 1); - return JetTokens.SHORT_TEMPLATE_ENTRY_START; - } - case 188: break; - case 12: - { return JetTokens.LBRACE ; - } - case 189: break; - case 94: - { return JetTokens.OBJECT_KEYWORD ; - } - case 190: break; - case 91: - { return JetTokens.BREAK_KEYWORD ; - } - case 191: break; - case 40: - { return JetTokens.BLOCK_COMMENT; - } - case 192: break; - case 88: - { return JetTokens.TRAIT_KEYWORD ; - } - case 193: break; - case 28: { return JetTokens.HASH ; } - case 194: break; + case 206: break; default: if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { zzAtEOF = true; zzDoEOF(); + switch (zzLexicalState) { + case BLOCK_COMMENT: { + int state = yystate(); + popState(); + zzStartRead = commentStart; + return commentStateToTokenType(state); + } + case 231: break; + case DOC_COMMENT: { + int state = yystate(); + popState(); + zzStartRead = commentStart; + return commentStateToTokenType(state); + } + case 232: break; + default: return null; + } } else { zzScanError(ZZ_NO_MATCH); From 216cbf7d9af73d0527b684cc246e3337a2007e12 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Thu, 19 Apr 2012 18:56:05 +0400 Subject: [PATCH 03/16] assert error/NonExistentClass is only generated when mode = SIGNATURES move classBuilderMode to injector and GenerationState from ClassBuilder --- .../jet/codegen/ClassBodyCodegen.java | 3 +- .../jetbrains/jet/codegen/ClassBuilder.java | 26 ++++------------- .../jet/codegen/ClassBuilderFactories.java | 17 +++++++++-- .../jet/codegen/ClassBuilderFactory.java | 3 ++ .../jet/codegen/ClassBuilderMode.java | 29 +++++++++++++++++++ .../jetbrains/jet/codegen/ClassCodegen.java | 4 +-- .../jetbrains/jet/codegen/ClosureCodegen.java | 12 ++++---- .../jet/codegen/FunctionCodegen.java | 18 ++++++------ .../jet/codegen/GenerationState.java | 10 ++++++- .../codegen/ImplementationBodyCodegen.java | 24 +++++++-------- .../jetbrains/jet/codegen/JetTypeMapper.java | 9 ++++++ .../jet/codegen/NamespaceCodegen.java | 2 +- .../jet/codegen/PropertyCodegen.java | 8 ++--- .../jet/di/InjectorForJetTypeMapper.java | 3 ++ .../jet/di/InjectorForJvmCodegen.java | 4 +++ .../jetbrains/jet/asJava/JetLightClass.java | 7 +++++ .../jet/asJava/StubClassBuilder.java | 5 ---- .../jet/di/AllInjectorsGenerator.java | 3 ++ 18 files changed, 123 insertions(+), 64 deletions(-) create mode 100644 compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderMode.java diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java index 89eddf97855..ea431b29b9b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.codegen; -import com.intellij.psi.PsiElement; import org.jetbrains.jet.lang.descriptors.ClassDescriptor; import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; import org.jetbrains.jet.lang.psi.*; @@ -148,7 +147,7 @@ public abstract class ClassBodyCodegen { private void generateStaticInitializer() { if (staticInitializerChunks.size() > 0) { final MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | Opcodes.ACC_STATIC,"", "()V", null, null); - if (v.generateCode() == ClassBuilder.Mode.FULL) { + if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter v = new InstructionAdapter(mv); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilder.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilder.java index 4fda5422ef4..12b51fe7ef7 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilder.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilder.java @@ -21,27 +21,24 @@ package org.jetbrains.jet.codegen; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.Nullable; -import org.objectweb.asm.*; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; public abstract class ClassBuilder { public static class Concrete extends ClassBuilder { private final ClassVisitor v; - private final boolean stubs; - public Concrete(ClassVisitor v, boolean stubs) { + public Concrete(ClassVisitor v) { this.v = v; - this.stubs = stubs; } @Override public ClassVisitor getVisitor() { return v; } - - @Override - public Mode generateCode() { - return stubs ? Mode.STUBS : Mode.FULL; - } } public FieldVisitor newField(@Nullable PsiElement origin, int access, @@ -88,15 +85,4 @@ public abstract class ClassBuilder { public void visitInnerClass(String name, String outerName, String innerName, int access) { getVisitor().visitInnerClass(name, outerName, innerName, access); } - - public enum Mode { - /** Full function bodies */ - FULL, - /** Only function signatures */ - SIGNATURES, - /** Function with stub bodies: just throw exception */ - STUBS, - } - - public abstract Mode generateCode(); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactories.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactories.java index 06604f797ba..485c049037b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactories.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactories.java @@ -16,6 +16,7 @@ package org.jetbrains.jet.codegen; +import org.jetbrains.annotations.NotNull; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.util.TraceClassVisitor; @@ -28,9 +29,15 @@ import java.io.StringWriter; public class ClassBuilderFactories { public static ClassBuilderFactory TEXT = new ClassBuilderFactory() { + @NotNull + @Override + public ClassBuilderMode getClassBuilderMode() { + return ClassBuilderMode.FULL; + } + @Override public ClassBuilder newClassBuilder() { - return new ClassBuilder.Concrete(new TraceClassVisitor(new PrintWriter(new StringWriter())), false); + return new ClassBuilder.Concrete(new TraceClassVisitor(new PrintWriter(new StringWriter()))); } @Override @@ -51,6 +58,12 @@ public class ClassBuilderFactories { public static ClassBuilderFactory binaries(final boolean stubs) { return new ClassBuilderFactory() { + @NotNull + @Override + public ClassBuilderMode getClassBuilderMode() { + return stubs ? ClassBuilderMode.STUBS : ClassBuilderMode.FULL; + } + @Override public ClassBuilder newClassBuilder() { return new ClassBuilder.Concrete(new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS){ @@ -64,7 +77,7 @@ public class ClassBuilderFactories { return "java/lang/Object"; } } - }, stubs); + }); } @Override diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactory.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactory.java index e46d50c4fe2..9806778934b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactory.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactory.java @@ -16,6 +16,7 @@ package org.jetbrains.jet.codegen; +import org.jetbrains.annotations.NotNull; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.util.TraceClassVisitor; @@ -26,6 +27,8 @@ import java.io.StringWriter; * @author max */ public interface ClassBuilderFactory { + @NotNull + ClassBuilderMode getClassBuilderMode(); ClassBuilder newClassBuilder(); String asText(ClassBuilder builder); byte[] asBytes(ClassBuilder builder); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderMode.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderMode.java new file mode 100644 index 00000000000..096391c2be8 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderMode.java @@ -0,0 +1,29 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.codegen; + +/** +* @author Stepan Koltsov +*/ +public enum ClassBuilderMode { + /** Full function bodies */ + FULL, + /** Only function signatures */ + SIGNATURES, + /** Function with stub bodies: just throw exception */ + STUBS, +} diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassCodegen.java index f596669dff8..a585ef6b737 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassCodegen.java @@ -40,7 +40,7 @@ public class ClassCodegen { final CodegenContext contextForInners = context.intoClass(descriptor, OwnerKind.IMPLEMENTATION, state.getInjector().getJetTypeMapper()); - if (classBuilder.generateCode() == ClassBuilder.Mode.SIGNATURES) { + if (state.getClassBuilderMode() == ClassBuilderMode.SIGNATURES) { // Outer class implementation must happen prior inner classes so we get proper scoping tree in JetLightClass's delegate generateImplementation(context, aClass, OwnerKind.IMPLEMENTATION, contextForInners.accessors, classBuilder); } @@ -54,7 +54,7 @@ public class ClassCodegen { } } - if (classBuilder.generateCode() != ClassBuilder.Mode.SIGNATURES) { + if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES) { generateImplementation(context, aClass, OwnerKind.IMPLEMENTATION, contextForInners.accessors, classBuilder); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java index 8f4c2bdd3f3..46fa697d5cb 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java @@ -170,10 +170,10 @@ public class ClosureCodegen extends ObjectOrClosureCodegen { cv.newField(fun, ACC_PRIVATE | ACC_STATIC | ACC_FINAL, "$instance", classDescr, null, null); MethodVisitor mv = cv.newMethod(fun, ACC_PUBLIC | ACC_STATIC, "$getInstance", "()" + classDescr, null, new String[0]); - if (cv.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (cv.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); mv.visitFieldInsn(GETSTATIC, name, "$instance", classDescr); mv.visitInsn(DUP); @@ -211,10 +211,10 @@ public class ClosureCodegen extends ObjectOrClosureCodegen { return; final MethodVisitor mv = cv.newMethod(fun, ACC_PUBLIC, "invoke", bridge.getAsmMethod().getDescriptor(), null, new String[0]); - if (cv.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - if (cv.generateCode() == ClassBuilder.Mode.FULL) { + if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); @@ -296,10 +296,10 @@ public class ClosureCodegen extends ObjectOrClosureCodegen { final Method constructor = new Method("", Type.VOID_TYPE, argTypes); final MethodVisitor mv = cv.newMethod(fun, ACC_PUBLIC, "", constructor.getDescriptor(), null, new String[0]); - if (cv.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (cv.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java index 7238ed6bbb3..0a828995516 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java @@ -124,7 +124,7 @@ public class FunctionCodegen { final MethodVisitor mv = v.newMethod(fun, flags, jvmSignature.getAsmMethod().getName(), jvmSignature.getAsmMethod().getDescriptor(), jvmSignature.getGenericsSignature(), null); AnnotationCodegen.forMethod(mv, state.getInjector().getJetTypeMapper()).genAnnotations(functionDescriptor); - if(v.generateCode() != ClassBuilder.Mode.SIGNATURES) { + if(state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES) { int start = 0; if (needJetAnnotations) { if (functionDescriptor instanceof PropertyAccessorDescriptor) { @@ -169,12 +169,12 @@ public class FunctionCodegen { } } - if (!isAbstract && v.generateCode() == ClassBuilder.Mode.STUBS) { + if (!isAbstract && state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - if (!isAbstract && v.generateCode() == ClassBuilder.Mode.FULL) { + if (!isAbstract && state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); Label methodBegin = new Label(); @@ -345,10 +345,10 @@ public class FunctionCodegen { descriptor = descriptor.replace("(","(L" + ownerInternalName + ";"); final MethodVisitor mv = v.newMethod(null, flags | (isConstructor ? 0 : ACC_STATIC), isConstructor ? "" : jvmSignature.getName() + JvmAbi.DEFAULT_PARAMS_IMPL_SUFFIX, descriptor, null, null); InstructionAdapter iv = new InstructionAdapter(mv); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); FrameMap frameMap = owner.prepareFrame(state.getInjector().getJetTypeMapper()); @@ -474,10 +474,10 @@ public class FunctionCodegen { int flags = ACC_PUBLIC | ACC_BRIDGE; // TODO. final MethodVisitor mv = v.newMethod(null, flags, jvmSignature.getName(), overriden.getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); Type[] argTypes = overriden.getArgumentTypes(); @@ -515,10 +515,10 @@ public class FunctionCodegen { int flags = ACC_PUBLIC | ACC_SYNTHETIC; // TODO. final MethodVisitor mv = v.newMethod(null, flags, method.getName(), method.getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); Type[] argTypes = method.getArgumentTypes(); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java b/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java index fd583a67fee..33bb005af93 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java @@ -49,6 +49,8 @@ public class GenerationState { private final List files; @NotNull private final InjectorForJvmCodegen injector; + @NotNull + private final ClassBuilderMode classBuilderMode; public GenerationState(Project project, ClassBuilderFactory builderFactory, AnalyzeExhaust analyzeExhaust, List files) { @@ -61,9 +63,10 @@ public class GenerationState { this.progress = progress; this.analyzeExhaust = exhaust; this.files = files; + this.classBuilderMode = builderFactory.getClassBuilderMode(); this.injector = new InjectorForJvmCodegen( analyzeExhaust.getStandardLibrary(), analyzeExhaust.getBindingContext(), - this.files, project, compilerSpecialMode, this, builderFactory); + this.files, project, compilerSpecialMode, builderFactory.getClassBuilderMode(), this, builderFactory); } @NotNull @@ -83,6 +86,11 @@ public class GenerationState { return analyzeExhaust.getBindingContext(); } + @NotNull + public ClassBuilderMode getClassBuilderMode() { + return classBuilderMode; + } + public ClassCodegen forClass() { return new ClassCodegen(this); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java index 71719b9a217..7a7b2cd023d 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java @@ -296,10 +296,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { Type[] argTypes = method.getArgumentTypes(); MethodVisitor mv = v.newMethod(null, ACC_PUBLIC| ACC_BRIDGE| ACC_FINAL, bridge.getName(), method.getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); @@ -327,10 +327,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { Method originalMethod = originalSignature.getJvmMethodSignature().getAsmMethod(); MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | ACC_BRIDGE | ACC_FINAL, method.getName(), method.getDescriptor(), null, null); PropertyCodegen.generateJetPropertyAnnotation(mv, originalSignature.getPropertyTypeKotlinSignature(), originalSignature.getJvmMethodSignature().getKotlinTypeParameter()); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); @@ -353,10 +353,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { Method originalMethod = originalSignature2.getJvmMethodSignature().getAsmMethod(); MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | ACC_BRIDGE | ACC_FINAL, method.getName(), method.getDescriptor(), null, null); PropertyCodegen.generateJetPropertyAnnotation(mv, originalSignature2.getPropertyTypeKotlinSignature(), originalSignature2.getJvmMethodSignature().getKotlinTypeParameter()); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); @@ -531,7 +531,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { int flags = ACC_PUBLIC; // TODO final MethodVisitor mv = v.newMethod(myClass, flags, constructorMethod.getName(), constructorMethod.getAsmMethod().getDescriptor(), constructorMethod.getGenericsSignature(), null); - if (v.generateCode() == ClassBuilder.Mode.SIGNATURES) return; + if (state.getClassBuilderMode() == ClassBuilderMode.SIGNATURES) return; AnnotationVisitor jetConstructorVisitor = mv.visitAnnotation(JvmStdlibNames.JET_CONSTRUCTOR.getDescriptor(), true); if (constructorDescriptor == null) { @@ -558,7 +558,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { } } - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); return; } @@ -733,10 +733,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { Method functionOriginal = typeMapper.mapSignature(fun.getName(), fun.getOriginal()).getAsmMethod(); final MethodVisitor mv = v.newMethod(myClass, flags, function.getName(), function.getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); codegen.generateThisOrOuter(descriptor); @@ -872,10 +872,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { CallableMethod method = typeMapper.mapToCallableMethod(constructorDescriptor, kind, typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration())); int flags = ACC_PUBLIC; // TODO final MethodVisitor mv = v.newMethod(constructor, flags, "", method.getSignature().getAsmMethod().getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); ConstructorFrameMap frameMap = new ConstructorFrameMap(method, constructorDescriptor, typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration())); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java index 3508bb9eb03..c19b4e25aa9 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java @@ -65,6 +65,7 @@ public class JetTypeMapper { public BindingContext bindingContext; private ClosureAnnotator closureAnnotator; private CompilerSpecialMode compilerSpecialMode; + private ClassBuilderMode classBuilderMode; @Inject @@ -87,6 +88,11 @@ public class JetTypeMapper { this.compilerSpecialMode = compilerSpecialMode; } + @Inject + public void setClassBuilderMode(ClassBuilderMode classBuilderMode) { + this.classBuilderMode = classBuilderMode; + } + @PostConstruct public void init() { initKnownTypes(); @@ -335,6 +341,9 @@ public class JetTypeMapper { DeclarationDescriptor descriptor = jetType.getConstructor().getDeclarationDescriptor(); if (ErrorUtils.isError(descriptor)) { + if (classBuilderMode != ClassBuilderMode.SIGNATURES) { + throw new IllegalStateException("error types are not allowed when classBuilderMode = " + classBuilderMode); + } Type asmType = Type.getObjectType("error/NonExistentClass"); if (signatureVisitor != null) { visitAsmType(signatureVisitor, asmType, true); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java index ca2fe73e250..2a3338c7510 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java @@ -92,7 +92,7 @@ public class NamespaceCodegen { private void generateStaticInitializers(JetFile namespace) { MethodVisitor mv = v.newMethod(namespace, ACC_PUBLIC | ACC_STATIC, "", "()V", null, null); - if (v.generateCode() == ClassBuilder.Mode.FULL) { + if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); FrameMap frameMap = new FrameMap(); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java index f8070e10c35..d9d4e9f9373 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java @@ -182,10 +182,10 @@ public class PropertyCodegen { AnnotationCodegen.forMethod(mv, state.getInjector().getJetTypeMapper()).genAnnotations(propertyDescriptor.getGetter()); } - if (v.generateCode() != ClassBuilder.Mode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) { + if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) { if(propertyDescriptor.getModality() != Modality.ABSTRACT) { mv.visitCode(); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubThrow(mv); } else { @@ -266,10 +266,10 @@ public class PropertyCodegen { AnnotationCodegen.forMethod(mv, state.getInjector().getJetTypeMapper()).genAnnotations(propertyDescriptor.getSetter()); } - if (v.generateCode() != ClassBuilder.Mode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) { + if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) { if(propertyDescriptor.getModality() != Modality.ABSTRACT) { mv.visitCode(); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubThrow(mv); } else { diff --git a/compiler/backend/src/org/jetbrains/jet/di/InjectorForJetTypeMapper.java b/compiler/backend/src/org/jetbrains/jet/di/InjectorForJetTypeMapper.java index ddbaad7230d..30a4db600be 100644 --- a/compiler/backend/src/org/jetbrains/jet/di/InjectorForJetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/jet/di/InjectorForJetTypeMapper.java @@ -23,6 +23,7 @@ import java.util.List; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.codegen.JetTypeMapper; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.ClosureAnnotator; import org.jetbrains.jet.lang.types.lang.JetStandardLibrary; import org.jetbrains.jet.lang.resolve.BindingContext; @@ -42,9 +43,11 @@ public class InjectorForJetTypeMapper { ) { this.jetTypeMapper = new JetTypeMapper(); CompilerSpecialMode compilerSpecialMode = CompilerSpecialMode.REGULAR; + ClassBuilderMode classBuilderMode = ClassBuilderMode.FULL; ClosureAnnotator closureAnnotator = new ClosureAnnotator(); this.jetTypeMapper.setBindingContext(bindingContext); + this.jetTypeMapper.setClassBuilderMode(classBuilderMode); this.jetTypeMapper.setClosureAnnotator(closureAnnotator); this.jetTypeMapper.setCompilerSpecialMode(compilerSpecialMode); this.jetTypeMapper.setStandardLibrary(jetStandardLibrary); diff --git a/compiler/backend/src/org/jetbrains/jet/di/InjectorForJvmCodegen.java b/compiler/backend/src/org/jetbrains/jet/di/InjectorForJvmCodegen.java index 626c27bbf54..e54bef57e52 100644 --- a/compiler/backend/src/org/jetbrains/jet/di/InjectorForJvmCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/di/InjectorForJvmCodegen.java @@ -23,6 +23,7 @@ import java.util.List; import org.jetbrains.jet.lang.psi.JetFile; import com.intellij.openapi.project.Project; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.GenerationState; import org.jetbrains.jet.codegen.ClassBuilderFactory; import org.jetbrains.jet.codegen.JetTypeMapper; @@ -35,6 +36,7 @@ import java.util.List; import org.jetbrains.jet.lang.psi.JetFile; import com.intellij.openapi.project.Project; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.GenerationState; import org.jetbrains.jet.codegen.ClassBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -54,6 +56,7 @@ public class InjectorForJvmCodegen { @NotNull List listOfJetFile, @NotNull Project project, @NotNull CompilerSpecialMode compilerSpecialMode, + @NotNull ClassBuilderMode classBuilderMode, @NotNull GenerationState generationState, @NotNull ClassBuilderFactory classBuilderFactory ) { @@ -65,6 +68,7 @@ public class InjectorForJvmCodegen { ClosureAnnotator closureAnnotator = new ClosureAnnotator(); this.jetTypeMapper.setBindingContext(bindingContext); + this.jetTypeMapper.setClassBuilderMode(classBuilderMode); this.jetTypeMapper.setClosureAnnotator(closureAnnotator); this.jetTypeMapper.setCompilerSpecialMode(compilerSpecialMode); this.jetTypeMapper.setStandardLibrary(jetStandardLibrary); diff --git a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/JetLightClass.java b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/JetLightClass.java index 0108405be00..ba04aeacfba 100644 --- a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/JetLightClass.java +++ b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/JetLightClass.java @@ -44,6 +44,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.analyzer.AnalyzeExhaust; import org.jetbrains.jet.codegen.ClassBuilder; import org.jetbrains.jet.codegen.ClassBuilderFactory; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.CompilationErrorHandler; import org.jetbrains.jet.codegen.GenerationState; import org.jetbrains.jet.lang.psi.JetFile; @@ -141,6 +142,12 @@ public class JetLightClass extends AbstractLightClass implements JetJavaMirrorMa final Stack stubStack = new Stack(); final ClassBuilderFactory builderFactory = new ClassBuilderFactory() { + @NotNull + @Override + public ClassBuilderMode getClassBuilderMode() { + return ClassBuilderMode.SIGNATURES; + } + @Override public ClassBuilder newClassBuilder() { return new StubClassBuilder(stubStack); diff --git a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/StubClassBuilder.java b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/StubClassBuilder.java index 3939934acdd..f9b40f80121 100644 --- a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/StubClassBuilder.java +++ b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/StubClassBuilder.java @@ -107,9 +107,4 @@ public class StubClassBuilder extends ClassBuilder { } super.done(); } - - @Override - public Mode generateCode() { - return Mode.SIGNATURES; - } } diff --git a/injector-generator/src/org/jetbrains/jet/di/AllInjectorsGenerator.java b/injector-generator/src/org/jetbrains/jet/di/AllInjectorsGenerator.java index ccf3d1e2420..4ab6505c257 100644 --- a/injector-generator/src/org/jetbrains/jet/di/AllInjectorsGenerator.java +++ b/injector-generator/src/org/jetbrains/jet/di/AllInjectorsGenerator.java @@ -18,6 +18,7 @@ package org.jetbrains.jet.di; import com.intellij.openapi.project.Project; import org.jetbrains.jet.codegen.ClassBuilderFactory; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.ClassFileFactory; import org.jetbrains.jet.codegen.GenerationState; import org.jetbrains.jet.codegen.JetTypeMapper; @@ -149,6 +150,7 @@ public class AllInjectorsGenerator { generator.addParameter(DiType.listOf(JetFile.class)); generator.addParameter(Project.class); generator.addParameter(CompilerSpecialMode.class); + generator.addParameter(ClassBuilderMode.class); generator.addPublicParameter(GenerationState.class); generator.addParameter(ClassBuilderFactory.class); generator.addPublicField(JetTypeMapper.class); @@ -164,6 +166,7 @@ public class AllInjectorsGenerator { generator.addParameter(DiType.listOf(JetFile.class)); generator.addPublicField(JetTypeMapper.class); generator.addField(CompilerSpecialMode.REGULAR); + generator.addField(ClassBuilderMode.FULL); generator.generate("compiler/backend/src", "org.jetbrains.jet.di", "InjectorForJetTypeMapper"); } From 8074629b7762fd685ab249aea3c1fe9f4895b76e Mon Sep 17 00:00:00 2001 From: "Natalia.Ukhorskaya" Date: Thu, 19 Apr 2012 20:09:47 +0400 Subject: [PATCH 04/16] Refactoring in JetMacro --- confluence/buildConfluenceLexer.xml | 2 +- .../org/jetbrains/jet/ConfluenceUtils.java | 47 +++++ .../org/jetbrains/jet/lexer/JetMacro.java | 167 +++++------------- .../jetbrains/jet/tags/StyledDivTagType.java | 31 ++++ .../java/org/jetbrains/jet/tags/TagData.java | 44 +++++ .../java/org/jetbrains/jet/tags/TagType.java | 25 +++ 6 files changed, 195 insertions(+), 121 deletions(-) create mode 100644 confluence/src/main/java/org/jetbrains/jet/ConfluenceUtils.java create mode 100644 confluence/src/main/java/org/jetbrains/jet/tags/StyledDivTagType.java create mode 100644 confluence/src/main/java/org/jetbrains/jet/tags/TagData.java create mode 100644 confluence/src/main/java/org/jetbrains/jet/tags/TagType.java diff --git a/confluence/buildConfluenceLexer.xml b/confluence/buildConfluenceLexer.xml index e0f993ff491..3d22623e2ed 100644 --- a/confluence/buildConfluenceLexer.xml +++ b/confluence/buildConfluenceLexer.xml @@ -1,6 +1,6 @@ - + diff --git a/confluence/src/main/java/org/jetbrains/jet/ConfluenceUtils.java b/confluence/src/main/java/org/jetbrains/jet/ConfluenceUtils.java new file mode 100644 index 00000000000..da0dd0145eb --- /dev/null +++ b/confluence/src/main/java/org/jetbrains/jet/ConfluenceUtils.java @@ -0,0 +1,47 @@ +package org.jetbrains.jet; + +/** + * @author Natalia.Ukhorskaya + */ + +public class ConfluenceUtils { + + public static void escapeHTML(StringBuilder builder, CharSequence seq) { + if (seq == null) return; + for (int i = 0; i < seq.length(); i++) { + char c = seq.charAt(i); + switch (c) { + case '<': + builder.append("<"); + break; + case '>': + builder.append(">"); + break; + case '&': + builder.append("&"); + break; + case ' ': + builder.append(" "); + break; + case '"': + builder.append("""); + break; + default: + builder.append(c); + } + } + } + + public static String getErrorInHtml(Throwable e, String info) { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("
Jet highlighter error [").append(e.getClass().getSimpleName()).append("]: "); + ConfluenceUtils.escapeHTML(stringBuilder, e.getMessage()); + stringBuilder.append("
"); + stringBuilder.append("Original text:"); + stringBuilder.append("
");
+        ConfluenceUtils.escapeHTML(stringBuilder, info);
+        stringBuilder.append("
"); + stringBuilder.append("
"); + return stringBuilder.toString(); + } +} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java index 431fb120511..09bfa123fb2 100644 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java +++ b/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java @@ -25,6 +25,10 @@ import com.atlassian.renderer.v2.macro.MacroException; import com.intellij.psi.TokenType; import com.intellij.psi.tree.IElementType; import org.apache.velocity.VelocityContext; +import org.jetbrains.jet.ConfluenceUtils; +import org.jetbrains.jet.tags.StyledDivTagType; +import org.jetbrains.jet.tags.TagData; +import org.jetbrains.jet.tags.TagType; import java.io.StringReader; import java.util.*; @@ -38,61 +42,6 @@ public class JetMacro extends BaseMacro { public static final StringReader DUMMY_READER = new StringReader(""); - private static class TagData { - final TagType type; - final String message; - final int start; - final boolean nextToken; - int end; - - TagData(TagType type, String message, int start, boolean nextToken) { - this.type = type; - this.message = message; - this.start = start; - this.nextToken = nextToken; - } - } - - private static abstract class TagType { - public final String tagName; - - private TagType(String tagName) { - this.tagName = tagName; - } - - public abstract void appendOpenTag(StringBuilder builder, TagData tagData); - public abstract void appendCloseTag(StringBuilder builder, TagData tagData); - - @Override - public String toString() { - return tagName; - } - } - - private static class StyledDivTagType extends TagType { - - private StyledDivTagType(String tagName) { - super(tagName); - } - - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - assert tagData.type == this; - builder.append("
"); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - } - private static final TagType[] knownExtraTagTypes = { new StyledDivTagType("error"), new StyledDivTagType("warning"), @@ -101,7 +50,7 @@ public class JetMacro extends BaseMacro { @Override public void appendOpenTag(StringBuilder builder, TagData tagData) { builder.append(""); } @@ -114,7 +63,7 @@ public class JetMacro extends BaseMacro { @Override public void appendOpenTag(StringBuilder builder, TagData tagData) { builder.append(""); } @@ -127,7 +76,7 @@ public class JetMacro extends BaseMacro { @Override public void appendOpenTag(StringBuilder builder, TagData tagData) { builder.append(""); } @@ -140,7 +89,7 @@ public class JetMacro extends BaseMacro { @Override public void appendOpenTag(StringBuilder builder, TagData tagData) { builder.append("
"); } @@ -153,7 +102,7 @@ public class JetMacro extends BaseMacro { @Override public void appendOpenTag(StringBuilder builder, TagData tagData) { builder.append("
"); } @@ -167,9 +116,10 @@ public class JetMacro extends BaseMacro { private static final Map nextTokenTags = new HashMap(); private static final Map closedTags = new HashMap(); private static final Map closeTags = new HashMap(); + static { for (TagType type : knownExtraTagTypes) { - String tagName = type.tagName; + String tagName = type.getTagName(); openTags.put(type, Pattern.compile("<" + tagName + "\\s*((desc)?=\\\"([^\n\"]*?)\\\")?>", Pattern.MULTILINE)); closeTags.put(type, Pattern.compile("")); @@ -179,6 +129,7 @@ public class JetMacro extends BaseMacro { } private static final Map styleMap = new HashMap(); + static { styleMap.put(JetTokens.BLOCK_COMMENT, "jet-comment"); styleMap.put(JetTokens.DOC_COMMENT, "jet-comment"); @@ -198,7 +149,6 @@ public class JetMacro extends BaseMacro { styleMap.put(JetTokens.LABEL_IDENTIFIER, "label"); styleMap.put(JetTokens.ATAT, "label"); styleMap.put(JetTokens.FIELD_IDENTIFIER, "field"); - styleMap.put(JetTokens.RAW_STRING_LITERAL, "string"); styleMap.put(TokenType.BAD_CHARACTER, "bad"); } @@ -212,32 +162,6 @@ public class JetMacro extends BaseMacro { return RenderMode.allow(0); } - private static void escapeHTML(StringBuilder builder, CharSequence seq) { - if (seq == null) return; - for (int i = 0; i < seq.length(); i++) { - char c = seq.charAt(i); - switch (c) { - case '<': - builder.append("<"); - break; - case '>': - builder.append(">"); - break; - case '&': - builder.append("&"); - break; - case ' ': - builder.append(" "); - break; - case '"': - builder.append("""); - break; - default: - builder.append(c); - } - } - } - private String addNewLineOpenTag() { return "
"; } @@ -246,7 +170,7 @@ public class JetMacro extends BaseMacro { return "
"; } - private void addNewLines(StringBuilder result, String yytext) { + private void convertNewLines(StringBuilder result, String yytext) { for (int i = 0; i < yytext.length(); i++) { if (yytext.charAt(i) == '\n') { result.append(" "); @@ -259,14 +183,23 @@ public class JetMacro extends BaseMacro { @Override public String execute(Map map, String code, RenderContext renderContext) throws MacroException { try { - List tags = new ArrayList(); - - StringBuilder afterPreprocessing = preprocess(code.trim(), tags); - VelocityContext context = new VelocityContext(MacroUtils.defaultVelocityContext()); String renderedTemplate = VelocityUtils.getRenderedTemplate("template.velocity", context); - StringBuilder result = new StringBuilder(renderedTemplate); + + generateHtmlFromCode(code, result); + + return result.toString(); + } catch (Throwable e) { + return ConfluenceUtils.getErrorInHtml(e, code); + } + } + + public void generateHtmlFromCode(String code, StringBuilder result) throws java.io.IOException { + try { + List tags = new ArrayList(); + StringBuilder afterPreprocessing = preprocess(code.trim(), tags); + result.append( "
" + "
" + @@ -282,24 +215,24 @@ public class JetMacro extends BaseMacro { TagData tag = iterator.hasNext() ? iterator.next() : null; while (true) { int tokenEnd = jetLexer.getTokenEnd(); - while (tag != null && tag.end < tokenEnd) { - result.append("
Skipping a tag in the middle of a token: <").append(tag.type).append(">
"); + while (tag != null && tag.getEnd() < tokenEnd) { + result.append("
Skipping a tag in the middle of a token: <").append(tag.getType()).append(">
"); tag = iterator.hasNext() ? iterator.next() : null; } if (tag != null) { - if (tag.start == tokenEnd) { + if (tag.getStart() == tokenEnd) { // result.append("
"); - tag.type.appendOpenTag(result, tag); + tag.getType().appendOpenTag(result, tag); } } if (tag != null) { - if (tag.end == tokenEnd || (tag.nextToken && tag.start < tokenEnd)) { - tag.type.appendCloseTag(result, tag); + if (tag.getEnd() == tokenEnd || (tag.isNextToken() && tag.getStart() < tokenEnd)) { + tag.getType().appendCloseTag(result, tag); tag = iterator.hasNext() ? iterator.next() : null; } } @@ -310,14 +243,15 @@ public class JetMacro extends BaseMacro { String yytext = jetLexer.yytext().toString(); if (yytext.contains("\n")) { - addNewLines(result, yytext); + convertNewLines(result, yytext); yytext = yytext.replaceAll("\n", ""); } String style = null; if (token instanceof JetKeywordToken) { style = "keyword"; - } else if (token == JetTokens.IDENTIFIER) { + } + else if (token == JetTokens.IDENTIFIER) { for (IElementType softKeyword : JetTokens.SOFT_KEYWORDS.asSet()) { if (((JetKeywordToken) softKeyword).getValue().equals(yytext.toString())) { style = "softkeyword"; @@ -325,13 +259,15 @@ public class JetMacro extends BaseMacro { } } style = style == null ? "plain" : style; - } else if (styleMap.containsKey(token)) { + } + else if (styleMap.containsKey(token)) { style = styleMap.get(token); - } else { + } + else { style = "plain"; } result.append(""); - escapeHTML(result, yytext); + ConfluenceUtils.escapeHTML(result, yytext); result.append(""); } @@ -339,19 +275,10 @@ public class JetMacro extends BaseMacro { result.append("
"); result.append("
"); result.append("
"); - return result.toString(); } catch (Throwable e) { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("
Jet highlighter error [").append(e.getClass().getSimpleName()).append("]: "); - escapeHTML(stringBuilder, e.getMessage()); - stringBuilder.append("
"); - stringBuilder.append("Original text:"); - stringBuilder.append("
");
-            escapeHTML(stringBuilder, code);
-            stringBuilder.append("
"); - stringBuilder.append("
"); - return stringBuilder.toString(); + result = new StringBuilder(ConfluenceUtils.getErrorInHtml(e, code)); } + } private StringBuilder preprocess(CharSequence code, Collection tags) { @@ -382,11 +309,11 @@ public class JetMacro extends BaseMacro { } else { TagData tag = tagStack.pop(); - if (type != tag.type) { + if (type != tag.getType()) { throw new IllegalArgumentException("Unmatched closing tag: " + closeMatcher.group()); } - tag.end = position; + tag.setEnd(position); tags.add(tag); i += closeMatcher.end() - 1; continue charLoop; @@ -397,7 +324,7 @@ public class JetMacro extends BaseMacro { Matcher closedMatcher = matchFrom(code, i, closed); if (closedMatcher != null) { TagData tag = new TagData(type, closedMatcher.group(3), position, false); - tag.end = position; + tag.setEnd(position); tags.add(tag); i += closedMatcher.end() - 1; continue charLoop; @@ -408,7 +335,7 @@ public class JetMacro extends BaseMacro { if (nextMatcher != null) { TagData tag = new TagData(type, nextMatcher.group(3), position, true); tags.add(tag); - tag.end = code.length(); + tag.setEnd(code.length()); i += nextMatcher.end() - 1; continue charLoop; } diff --git a/confluence/src/main/java/org/jetbrains/jet/tags/StyledDivTagType.java b/confluence/src/main/java/org/jetbrains/jet/tags/StyledDivTagType.java new file mode 100644 index 00000000000..a6a4b7bbe25 --- /dev/null +++ b/confluence/src/main/java/org/jetbrains/jet/tags/StyledDivTagType.java @@ -0,0 +1,31 @@ +package org.jetbrains.jet.tags; + +import org.jetbrains.jet.ConfluenceUtils; + +/** + * @author abreslav + */ + +public class StyledDivTagType extends TagType { + + public StyledDivTagType(String tagName) { + super(tagName); + } + + @Override + public void appendOpenTag(StringBuilder builder, TagData tagData) { + assert tagData.getType() == this; + builder.append("
"); + } + + @Override + public void appendCloseTag(StringBuilder builder, TagData tagData) { + builder.append("
"); + } +} diff --git a/confluence/src/main/java/org/jetbrains/jet/tags/TagData.java b/confluence/src/main/java/org/jetbrains/jet/tags/TagData.java new file mode 100644 index 00000000000..0bf112f7986 --- /dev/null +++ b/confluence/src/main/java/org/jetbrains/jet/tags/TagData.java @@ -0,0 +1,44 @@ +package org.jetbrains.jet.tags; + +/** + * @author abreslav + */ + +public class TagData { + private final TagType type; + private final String message; + private final int start; + private final boolean nextToken; + private int end; + + public TagData(TagType type, String message, int start, boolean nextToken) { + this.type = type; + this.message = message; + this.start = start; + this.nextToken = nextToken; + } + + public TagType getType() { + return type; + } + + public String getMessage() { + return message; + } + + public int getStart() { + return start; + } + + public boolean isNextToken() { + return nextToken; + } + + public int getEnd() { + return end; + } + + public void setEnd(int end) { + this.end = end; + } +} diff --git a/confluence/src/main/java/org/jetbrains/jet/tags/TagType.java b/confluence/src/main/java/org/jetbrains/jet/tags/TagType.java new file mode 100644 index 00000000000..dcaea651a7b --- /dev/null +++ b/confluence/src/main/java/org/jetbrains/jet/tags/TagType.java @@ -0,0 +1,25 @@ +package org.jetbrains.jet.tags; + +/** + * @author abreslav + */ + +public abstract class TagType { + private final String tagName; + + protected TagType(String tagName) { + this.tagName = tagName; + } + + public abstract void appendOpenTag(StringBuilder builder, TagData tagData); + public abstract void appendCloseTag(StringBuilder builder, TagData tagData); + + @Override + public String toString() { + return tagName; + } + + public String getTagName() { + return tagName; + } +} From 3d86084a8e4c9653f5b945003d90ffe1a0c9fd31 Mon Sep 17 00:00:00 2001 From: "Natalia.Ukhorskaya" Date: Thu, 19 Apr 2012 20:11:56 +0400 Subject: [PATCH 05/16] Add tests for rendering: examples from actual confluence, special tags --- confluence/confluence.iml | 1 + .../TestUtils.java | 34 ++++++ .../rendering/ConfluenceRenderingTest.java | 71 +++++++++++ .../testData/rendering/elements/class.kt | 7 ++ .../testData/rendering/elements/class.txt | 8 ++ .../testData/rendering/elements/variable.kt | 5 + .../testData/rendering/elements/variable.txt | 6 + .../testData/rendering/elements/when.kt | 7 ++ .../testData/rendering/elements/when.txt | 8 ++ .../rendering/examples/adress_book.kt | 47 +++++++ .../rendering/examples/adress_book.txt | 48 ++++++++ .../basic_syntax_define_a_function.kt | 4 + .../basic_syntax_define_a_function.txt | 5 + .../basic_syntax_define_a_variable.kt | 4 + .../basic_syntax_define_a_variable.txt | 5 + .../examples/basic_syntax_null_checks.kt | 32 +++++ .../examples/basic_syntax_null_checks.txt | 32 +++++ ...sic_syntax_use_a_conditional_expression.kt | 6 + ...ic_syntax_use_a_conditional_expression.txt | 7 ++ .../hello_world_a_multi_language_hello.kt | 9 ++ .../hello_world_a_multi_language_hello.txt | 10 ++ .../hello_world_an_object_oriented_hello.kt | 9 ++ .../hello_world_an_object_oriented_hello.txt | 10 ++ ..._world_reading_a_name_from_command_line.kt | 7 ++ ...world_reading_a_name_from_command_line.txt | 8 ++ .../rendering/examples/html_builder.kt | 31 +++++ .../rendering/examples/html_builder.txt | 32 +++++ .../examples/html_builder_with_refs.kt | 114 +++++++++++++++++ .../examples/html_builder_with_refs.txt | 115 ++++++++++++++++++ .../rendering/examples/welcome_hello.kt | 5 + .../rendering/examples/welcome_hello.txt | 6 + .../rendering/tagTypes/a/a_closed_tag.kt | 1 + .../rendering/tagTypes/a/a_next_token_tag.kt | 1 + .../rendering/tagTypes/a/a_with_close_tag.kt | 1 + .../tagTypes/class/class_closed_tag.kt | 1 + .../tagTypes/class/class_next_token_tag.kt | 1 + .../tagTypes/class/class_with_close_tag.kt | 1 + .../tagTypes/label/label_closed_tag.kt | 1 + .../tagTypes/label/label_next_token_tag.kt | 1 + .../tagTypes/label/label_with_close_tag.kt | 1 + .../rendering/tagTypes/ref/ref_closed_tag.kt | 1 + .../tagTypes/ref/ref_next_token_tag.kt | 1 + .../tagTypes/ref/ref_with_close_tag.kt | 1 + .../tagTypes/style/style_closed_tag.kt | 1 + .../tagTypes/style/style_next_token_tag.kt | 1 + .../tagTypes/style/style_with_close_tag.kt | 1 + .../unresolved/unresolved_closed_tag.kt | 1 + .../unresolved/unresolved_next_token_tag.kt | 1 + .../unresolved/unresolved_with_close_tag.kt | 1 + .../tagTypes/warnings/warning_closed_tag.kt | 1 + .../tagTypes/warnings/warning_closed_tag.txt | 2 + .../warnings/warning_next_token_tag.kt | 1 + .../warnings/warning_next_token_tag.txt | 2 + .../warnings/warning_with_close_tag.kt | 1 + .../warnings/warning_with_close_tag.txt | 2 + 55 files changed, 720 insertions(+) create mode 100644 confluence/src/test/java/org.jetbrains.jet.confluence/TestUtils.java create mode 100644 confluence/src/test/java/org.jetbrains.jet.confluence/rendering/ConfluenceRenderingTest.java create mode 100644 confluence/testData/rendering/elements/class.kt create mode 100644 confluence/testData/rendering/elements/class.txt create mode 100644 confluence/testData/rendering/elements/variable.kt create mode 100644 confluence/testData/rendering/elements/variable.txt create mode 100644 confluence/testData/rendering/elements/when.kt create mode 100644 confluence/testData/rendering/elements/when.txt create mode 100644 confluence/testData/rendering/examples/adress_book.kt create mode 100644 confluence/testData/rendering/examples/adress_book.txt create mode 100644 confluence/testData/rendering/examples/basic_syntax_define_a_function.kt create mode 100644 confluence/testData/rendering/examples/basic_syntax_define_a_function.txt create mode 100644 confluence/testData/rendering/examples/basic_syntax_define_a_variable.kt create mode 100644 confluence/testData/rendering/examples/basic_syntax_define_a_variable.txt create mode 100644 confluence/testData/rendering/examples/basic_syntax_null_checks.kt create mode 100644 confluence/testData/rendering/examples/basic_syntax_null_checks.txt create mode 100644 confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.kt create mode 100644 confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.txt create mode 100644 confluence/testData/rendering/examples/hello_world_a_multi_language_hello.kt create mode 100644 confluence/testData/rendering/examples/hello_world_a_multi_language_hello.txt create mode 100644 confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.kt create mode 100644 confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.txt create mode 100644 confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.kt create mode 100644 confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.txt create mode 100644 confluence/testData/rendering/examples/html_builder.kt create mode 100644 confluence/testData/rendering/examples/html_builder.txt create mode 100644 confluence/testData/rendering/examples/html_builder_with_refs.kt create mode 100644 confluence/testData/rendering/examples/html_builder_with_refs.txt create mode 100644 confluence/testData/rendering/examples/welcome_hello.kt create mode 100644 confluence/testData/rendering/examples/welcome_hello.txt create mode 100644 confluence/testData/rendering/tagTypes/a/a_closed_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/a/a_next_token_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/a/a_with_close_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/class/class_closed_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/class/class_next_token_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/class/class_with_close_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/label/label_closed_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/label/label_next_token_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/label/label_with_close_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/ref/ref_closed_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/ref/ref_next_token_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/ref/ref_with_close_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/style/style_closed_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/style/style_next_token_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/style/style_with_close_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/unresolved/unresolved_closed_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/unresolved/unresolved_next_token_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/unresolved/unresolved_with_close_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.txt create mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.txt create mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.kt create mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.txt diff --git a/confluence/confluence.iml b/confluence/confluence.iml index ab4a8b1a4e5..b7031cfb474 100644 --- a/confluence/confluence.iml +++ b/confluence/confluence.iml @@ -6,6 +6,7 @@ + diff --git a/confluence/src/test/java/org.jetbrains.jet.confluence/TestUtils.java b/confluence/src/test/java/org.jetbrains.jet.confluence/TestUtils.java new file mode 100644 index 00000000000..fb86e10779c --- /dev/null +++ b/confluence/src/test/java/org.jetbrains.jet.confluence/TestUtils.java @@ -0,0 +1,34 @@ +package org.jetbrains.jet.confluence; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; + +/** + * @author Natalia.Ukhorskaya + */ + +public class TestUtils { + + public static String readFile(File file) throws IOException { + FileReader reader = new FileReader(file); + StringBuilder builder = new StringBuilder(); + int c; + while ((c = reader.read()) >= 0) { + builder.append((char) c); + } + reader.close(); + return builder.toString(); + } + + public static void writeFile(File file, String str) throws IOException { + FileWriter writer = new FileWriter(file); + writer.write(str); + writer.close(); + } + + public static String divideResultForLines(String result) { + return result.replaceAll("
", "\n
"); + } +} diff --git a/confluence/src/test/java/org.jetbrains.jet.confluence/rendering/ConfluenceRenderingTest.java b/confluence/src/test/java/org.jetbrains.jet.confluence/rendering/ConfluenceRenderingTest.java new file mode 100644 index 00000000000..b0ae2a407a7 --- /dev/null +++ b/confluence/src/test/java/org.jetbrains.jet.confluence/rendering/ConfluenceRenderingTest.java @@ -0,0 +1,71 @@ +package org.jetbrains.jet.confluence.rendering; + +import com.atlassian.renderer.v2.macro.MacroException; +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; +import org.jetbrains.jet.confluence.TestUtils; +import org.jetbrains.jet.lexer.JetMacro; + +import java.io.File; +import java.io.IOException; + +/** + * @author Natalia.Ukhorskaya + */ + +public class ConfluenceRenderingTest extends TestCase { + + public static Test suite() { + TestSuite suite = new TestSuite(); + TestSuite ats = new TestSuite(); + suite.addTest(ats); + File parsingSourceDir = new File("./testData/rendering"); + addFilesFromDirToSuite(parsingSourceDir, ats); + return suite; + } + + private static void addFilesFromDirToSuite(File file, TestSuite ats) { + if (file.isDirectory()) { + for (File sourceFile : file.listFiles()) { + addFilesFromDirToSuite(sourceFile, ats); + } + } else { + if (file.getName().endsWith(".kt")) { + ats.addTest(new ConfluenceRenderingTest(file.getName(), file)); + } + } + } + + private final File sourceFile; + + public ConfluenceRenderingTest(String name, File sourceFile) { + super(name); + this.sourceFile = sourceFile; + } + + @Override + protected void runTest() throws Throwable { + checkSourceFile(sourceFile); + } + + private void checkSourceFile(File sourceFile) throws IOException, MacroException { + String source = TestUtils.readFile(sourceFile); + + StringBuilder actualResult = new StringBuilder(); + new JetMacro().generateHtmlFromCode(source, actualResult); + + File expectedResultFile = new File(sourceFile.getAbsolutePath().replace(".kt", ".txt")); + if (!expectedResultFile.exists()) { + expectedResultFile.createNewFile(); + TestUtils.writeFile(expectedResultFile, TestUtils.divideResultForLines(actualResult.toString())); + assertTrue("File with expected result for " + expectedResultFile.getAbsolutePath() + " is absent.", false); + } + + String expectedResult = TestUtils.readFile(expectedResultFile); + + + assertEquals(expectedResult, + TestUtils.divideResultForLines(actualResult.toString())); + } +} diff --git a/confluence/testData/rendering/elements/class.kt b/confluence/testData/rendering/elements/class.kt new file mode 100644 index 00000000000..a082c511e08 --- /dev/null +++ b/confluence/testData/rendering/elements/class.kt @@ -0,0 +1,7 @@ +class Greeter1() { + +} + +class Greeter2(val name : String) { + +} \ No newline at end of file diff --git a/confluence/testData/rendering/elements/class.txt b/confluence/testData/rendering/elements/class.txt new file mode 100644 index 00000000000..a579e219588 --- /dev/null +++ b/confluence/testData/rendering/elements/class.txt @@ -0,0 +1,8 @@ +
+
class Greeter1() { 
+
 
+
} 
+
 
+
class Greeter2(val name : String) { 
+
 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/elements/variable.kt b/confluence/testData/rendering/elements/variable.kt new file mode 100644 index 00000000000..7364e4d32c7 --- /dev/null +++ b/confluence/testData/rendering/elements/variable.kt @@ -0,0 +1,5 @@ +val a : Int = 1 +val b = 1 +val c : Int +c = 1 +var a : String = "sss" \ No newline at end of file diff --git a/confluence/testData/rendering/elements/variable.txt b/confluence/testData/rendering/elements/variable.txt new file mode 100644 index 00000000000..bdfa9adad8b --- /dev/null +++ b/confluence/testData/rendering/elements/variable.txt @@ -0,0 +1,6 @@ +
+
val a : Int = 1 
+
val b = 1 
+
val c : Int 
+
c = 1 
+
var a : String = "sss"
\ No newline at end of file diff --git a/confluence/testData/rendering/elements/when.kt b/confluence/testData/rendering/elements/when.kt new file mode 100644 index 00000000000..6faddf20ae9 --- /dev/null +++ b/confluence/testData/rendering/elements/when.kt @@ -0,0 +1,7 @@ +val language = if (args.size == 0) "EN" else args[0] +when (language) { + "EN" -> "Hello!" + "ES" -> "¡Hola!" + "RU" -> "Привет!" + else -> "Sorry, I can't greet you in $language yet" +} \ No newline at end of file diff --git a/confluence/testData/rendering/elements/when.txt b/confluence/testData/rendering/elements/when.txt new file mode 100644 index 00000000000..b316772466b --- /dev/null +++ b/confluence/testData/rendering/elements/when.txt @@ -0,0 +1,8 @@ +
+
val language = if (args.size == 0) "EN" else args[0] 
+
when (language) { 
+
 "EN" -> "Hello!" 
+
 "ES" -> "¡Hola!" 
+
 "RU" -> "Привет!" 
+
 else -> "Sorry, I can't greet you in $language yet" 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/adress_book.kt b/confluence/testData/rendering/examples/adress_book.kt new file mode 100644 index 00000000000..9cb0446a0e9 --- /dev/null +++ b/confluence/testData/rendering/examples/adress_book.kt @@ -0,0 +1,47 @@ +namespace addressbook + +class Contact( + val name : String, + val emails : List, + val addresses : List, + val phonenums : List +) + +class EmailAddress( + val user : String, + val host : String +) + +class PostalAddress( + val streetAddress : String, + val city : String, + val zip : String, + val state : USState?, + val country : Country +) { + assert {(state == null) xor (country == Countries["US"]) } +} + +class PhoneNumber( + val country : Country, + val areaCode : Int, + val number : Long +) + +object Countries { + fun get(id : CountryID) : Country = countryTable[id] + + private var table : Map? = null + private val countryTable : Map + get() { + if (table == null) { + table = HashMap() + for (line in TextFile("countries.txt").lines(stripWhiteSpace = true)) { + table[line] = Country(line) + } + } + return table + } +} + +class Country(val name : String) \ No newline at end of file diff --git a/confluence/testData/rendering/examples/adress_book.txt b/confluence/testData/rendering/examples/adress_book.txt new file mode 100644 index 00000000000..a650d815f59 --- /dev/null +++ b/confluence/testData/rendering/examples/adress_book.txt @@ -0,0 +1,48 @@ +
+
namespace addressbook 
+
 
+
class Contact( 
+
  val name : String, 
+
  val emails : List<EmailAddress>, 
+
  val addresses : List<PostalAddress>, 
+
  val phonenums : List<PhoneNumber> 
+
) 
+
 
+
class EmailAddress( 
+
  val user : String, 
+
  val host : String 
+
) 
+
 
+
class PostalAddress( 
+
  val streetAddress : String, 
+
  val city : String, 
+
  val zip : String, 
+
  val state : USState?, 
+
  val country : Country 
+
) { 
+
   assert {(state == null) xor (country == Countries["US"]) } 
+
} 
+
 
+
class PhoneNumber( 
+
  val country : Country, 
+
  val areaCode : Int, 
+
  val number : Long 
+
) 
+
 
+
object Countries { 
+
  fun get(id : CountryID) : Country = countryTable[id] 
+
 
+
  private var table : Map<String, Country>? = null 
+
  private val countryTable : Map<String, Country> 
+
    get() { 
+
      if (table == null) { 
+
        table = HashMap() 
+
        for (line in TextFile("countries.txt").lines(stripWhiteSpace = true)) { 
+
          table[line] = Country(line) 
+
        } 
+
      } 
+
      return table 
+
    } 
+
} 
+
 
+
class Country(val name : String)
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_define_a_function.kt b/confluence/testData/rendering/examples/basic_syntax_define_a_function.kt new file mode 100644 index 00000000000..3c0054a9da7 --- /dev/null +++ b/confluence/testData/rendering/examples/basic_syntax_define_a_function.kt @@ -0,0 +1,4 @@ +// Return type mandatory +fun sum(a : Int, b : Int) : Int { + return a + b +} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_define_a_function.txt b/confluence/testData/rendering/examples/basic_syntax_define_a_function.txt new file mode 100644 index 00000000000..5f330cc898d --- /dev/null +++ b/confluence/testData/rendering/examples/basic_syntax_define_a_function.txt @@ -0,0 +1,5 @@ +
+
// Return type mandatory 
+
fun sum(a : Int, b : Int) : Int { 
+
  return a + b 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_define_a_variable.kt b/confluence/testData/rendering/examples/basic_syntax_define_a_variable.kt new file mode 100644 index 00000000000..84edfdb2aed --- /dev/null +++ b/confluence/testData/rendering/examples/basic_syntax_define_a_variable.kt @@ -0,0 +1,4 @@ +val a : Int = 1 +val b = 1 // Type is inferred +val c : Int // Type required when no initializer provided +c = 1 // definite assignment \ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_define_a_variable.txt b/confluence/testData/rendering/examples/basic_syntax_define_a_variable.txt new file mode 100644 index 00000000000..51ee4531913 --- /dev/null +++ b/confluence/testData/rendering/examples/basic_syntax_define_a_variable.txt @@ -0,0 +1,5 @@ +
+
val a : Int = 1 
+
val b = 1 // Type is inferred 
+
val c : Int // Type required when no initializer provided 
+
c = 1 // definite assignment
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_null_checks.kt b/confluence/testData/rendering/examples/basic_syntax_null_checks.kt new file mode 100644 index 00000000000..b33f0088667 --- /dev/null +++ b/confluence/testData/rendering/examples/basic_syntax_null_checks.kt @@ -0,0 +1,32 @@ +package multiplier + +// Return null if str does not hold a number +fun parseInt(str : String) : Int? { + // ... +} + +fun main(args : Array) { + if (args.size < 2) { + print("No number supplied"); + } + val x = parseInt(args[0]) + val y = parseInt(args[1]) + + // We cannot say 'x * y' now because they may hold nulls + + if (x != null && y != null) { + print(x * y) // Now we can + } + + // ... + if (x == null) { + print("Wrong number format in '${args[0]}'") + return + } + if (y == null) { + print("Wrong number format in '${args[1]}'") + return + } + print(x * y) // Now we know that x and y are not nulls +} + diff --git a/confluence/testData/rendering/examples/basic_syntax_null_checks.txt b/confluence/testData/rendering/examples/basic_syntax_null_checks.txt new file mode 100644 index 00000000000..d35c9839f0b --- /dev/null +++ b/confluence/testData/rendering/examples/basic_syntax_null_checks.txt @@ -0,0 +1,32 @@ +
+
package multiplier 
+
 
+
// Return null if str does not hold a number 
+
fun parseInt(str : String) : Int? { 
+
  // ... 
+
} 
+
 
+
fun main(args : Array<String>) { 
+
  if (args.size < 2) { 
+
    print("No number supplied"); 
+
  } 
+
  val x = parseInt(args[0]) 
+
  val y = parseInt(args[1]) 
+
 
+
  // We cannot say 'x * y' now because they may hold nulls 
+
 
+
  if (x != null && y != null) { 
+
    print(x * y) // Now we can 
+
  } 
+
 
+
  // ... 
+
    if  (x == null) { 
+
      print("Wrong number format in '${args[0]}'") 
+
      return 
+
    } 
+
    if  (y == null) { 
+
      print("Wrong number format in '${args[1]}'") 
+
      return 
+
    } 
+
    print(x * y) // Now we know that x and y are not nulls 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.kt b/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.kt new file mode 100644 index 00000000000..68c5739a540 --- /dev/null +++ b/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.kt @@ -0,0 +1,6 @@ +fun max(a : Int, b : Int) : Int { + if (a > b) + return a + else + return b +} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.txt b/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.txt new file mode 100644 index 00000000000..648c9af2ce2 --- /dev/null +++ b/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.txt @@ -0,0 +1,7 @@ +
+
fun max(a : Int, b : Int) : Int { 
+
  if (a > b) 
+
    return a 
+
  else 
+
    return b 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.kt b/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.kt new file mode 100644 index 00000000000..2d44afdbca6 --- /dev/null +++ b/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.kt @@ -0,0 +1,9 @@ +fun main(args : Array) { + val language = if (args.size == 0) "EN" else args[0] + println(when (language) { + "EN" -> "Hello!" + "ES" -> "¡Hola!" + "RU" -> "Привет!" + else -> "Sorry, I can't greet you in $language yet" + }) +} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.txt b/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.txt new file mode 100644 index 00000000000..48b9d279c0a --- /dev/null +++ b/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.txt @@ -0,0 +1,10 @@ +
+
fun main(args : Array<String>) { 
+
  val language = if (args.size == 0) "EN" else args[0] 
+
  println(when (language) { 
+
    "EN" -> "Hello!" 
+
    "ES" -> "¡Hola!" 
+
    "RU" -> "Привет!" 
+
    else -> "Sorry, I can't greet you in $language yet" 
+
  }) 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.kt b/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.kt new file mode 100644 index 00000000000..03499b9e807 --- /dev/null +++ b/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.kt @@ -0,0 +1,9 @@ +class Greeter(val name : String) { + fun greet() { + println("Hello, ${name}"); + } +} + +fun main(args : Array) { + Greeter(args[0]).greet() +} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.txt b/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.txt new file mode 100644 index 00000000000..d85c333e4cd --- /dev/null +++ b/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.txt @@ -0,0 +1,10 @@ +
+
class Greeter(val name : String) { 
+
  fun greet() { 
+
    println("Hello, ${name}"); 
+
  } 
+
} 
+
 
+
fun main(args : Array<String>) { 
+
  Greeter(args[0]).greet() 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.kt b/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.kt new file mode 100644 index 00000000000..c1db6631119 --- /dev/null +++ b/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.kt @@ -0,0 +1,7 @@ +fun main(args : Array) { + if (args.size == 0) { + println("Please provide a name as a command-line argument") + return + } + println("Hello, ${args[0]}!") +} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.txt b/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.txt new file mode 100644 index 00000000000..272661aa570 --- /dev/null +++ b/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.txt @@ -0,0 +1,8 @@ +
+
fun main(args : Array<String>) { 
+
  if (args.size == 0) { 
+
    println("Please provide a name as a command-line argument") 
+
    return 
+
  } 
+
  println("Hello, ${args[0]}!") 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/html_builder.kt b/confluence/testData/rendering/examples/html_builder.kt new file mode 100644 index 00000000000..00bee9aa529 --- /dev/null +++ b/confluence/testData/rendering/examples/html_builder.kt @@ -0,0 +1,31 @@ +import html.* + +fun result(args : Array) = + html { + head { + title {+"XML encoding with Kotlin"} + } + body { + h1 {+"XML encoding with Kotlin"} + p {+"this format can be used as an alternative markup to XML"} + + // an element with attributes and text content + a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} + + // mixed content + p { + +"This is some" + b {+"mixed"} + +"text. For more see the" + a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} + +"project" + } + p {+"some text"} + + // content generated by + p { + for (arg in args) + +arg + } + } + } \ No newline at end of file diff --git a/confluence/testData/rendering/examples/html_builder.txt b/confluence/testData/rendering/examples/html_builder.txt new file mode 100644 index 00000000000..a4e0257d8fd --- /dev/null +++ b/confluence/testData/rendering/examples/html_builder.txt @@ -0,0 +1,32 @@ +
+
import html.* 
+
 
+
fun result(args : Array<String>) = 
+
  html { 
+
    head { 
+
      title {+"XML encoding with Kotlin"} 
+
    } 
+
    body { 
+
      h1 {+"XML encoding with Kotlin"} 
+
      p {+"this format can be used as an alternative markup to XML"} 
+
 
+
      // an element with attributes and text content 
+
      a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} 
+
 
+
      // mixed content 
+
      p { 
+
        +"This is some" 
+
        b {+"mixed"} 
+
        +"text. For more see the" 
+
        a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} 
+
        +"project" 
+
      } 
+
      p {+"some text"} 
+
 
+
      // content generated by 
+
      p { 
+
        for (arg in args) 
+
          +arg 
+
      } 
+
    } 
+
  }
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/html_builder_with_refs.kt b/confluence/testData/rendering/examples/html_builder_with_refs.kt new file mode 100644 index 00000000000..70ce56a58d5 --- /dev/null +++ b/confluence/testData/rendering/examples/html_builder_with_refs.kt @@ -0,0 +1,114 @@ +import html.* + +fun result(args : Array) = + html { + head { + title {+"XML encoding with Kotlin"} + } + body { + h1 {+"XML encoding with Kotlin"} + p {+"this format can be used as an alternative markup to XML"} + + // an element with attributes and text content + a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} + + // mixed content + p { + +"This is some" + b {+"mixed"} + +"text. For more see the" + a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} + +"project" + } + p {+"some text"} + + // content generated by + p { + for (arg in args) + +arg + } + } + } + +namespace html { + + abstract class Factory { + fun create() : T + } + + abstract class Element + + class TextElement(val text : String) : Element + + abstract class Tag(val name : String) : Element { + val children = ArrayList() + val attributes = HashMap() + + protected fun initTag(init : T.() -> Unit) : T + where class object T : Factory { + val tag = T.create() + tag.init() + children.add(tag) + return tag + } + } + + abstract class TagWithText(name : String) : Tag(name) { + fun String.plus() { + children.add(TextElement(this)) + } + } + + class HTML() : TagWithText("html") { + class object : Factory { + override fun create() = HTML() + } + + fun head(init : Head.() -> Unit) = initTag(init) + + fun body(init : Body.() -> Unit) = initTag(init) + } + + class Head() : TagWithText("head") { + class object : Factory { + override fun create() = Head() + } + + fun title(init : Title.() -> Unit) = initTag(init) + } + + class Title() : TagWithText("title") + + abstract class BodyTag(name : String) : TagWithText(name) { + } + + class Body() : BodyTag("body") { + class object : Factory { + override fun create() = Body() + } + + fun b(init : B.() -> Unit) = initTag(init) + fun p(init : P.() -> Unit) = initTag(init) + fun h1(init : H1.() -> Unit) = initTag(init) + fun a(href : String, init : A.() -> Unit) { + val a = initTag(init) + a.href = href + } + } + + class B() : BodyTag("b") + class P() : BodyTag("p") + class H1() : BodyTag("h1") + class A() : BodyTag("a") { + var href : String + get() = attributes["href"] + set(value) { attributes["href"] = value } + } + + fun html(init : HTML.() -> Unit) : HTML { + val html = HTML() + html.init() + return html + } + +} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/html_builder_with_refs.txt b/confluence/testData/rendering/examples/html_builder_with_refs.txt new file mode 100644 index 00000000000..2e723e94802 --- /dev/null +++ b/confluence/testData/rendering/examples/html_builder_with_refs.txt @@ -0,0 +1,115 @@ +
+ +
 
+
fun result(args : Array<String>) = 
+
+
    head { 
+
      title {+"XML encoding with Kotlin"} 
+
    } 
+
    body { 
+
      h1 {+"XML encoding with Kotlin"} 
+
      p {+"this format can be used as an alternative markup to XML"} 
+
 
+
      // an element with attributes and text content 
+
      a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} 
+
 
+
      // mixed content 
+
      p { 
+
        +"This is some" 
+
        b {+"mixed"} 
+
        +"text. For more see the" 
+
        a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} 
+
        +"project" 
+
      } 
+
      p {+"some text"} 
+
 
+
      // content generated by 
+
      p { 
+
        for (arg in args) 
+
          +arg 
+
      } 
+
    } 
+
  } 
+
 
+
namespace html { 
+
 
+
  abstract class Factory<T> { 
+
    fun create() : T 
+
  } 
+
 
+
  abstract class Element 
+
 
+
  class TextElement(val text : String) : Element 
+
 
+
  abstract class Tag(val name : String) : Element { 
+
    val children = ArrayList<Element>() 
+
    val attributes = HashMap<String, String>() 
+
 
+
    protected fun initTag<T : Element>(init : T.() -> Unit) : T 
+
      where class object T : Factory<T> { 
+
      val tag = T.create() 
+
      tag.init() 
+
      children.add(tag) 
+
      return tag 
+
    } 
+
  } 
+
 
+
  abstract class TagWithText(name : String) : Tag(name) { 
+
    fun String.plus() { 
+
      children.add(TextElement(this)) 
+
    } 
+
  } 
+
 
+
  class HTML() : TagWithText("html") { 
+
    class object : Factory<HTML> { 
+
      override fun create() = HTML() 
+
    } 
+
 
+
    fun head(init : Head.() -> Unit) = initTag(init) 
+
 
+
    fun body(init : Body.() -> Unit) = initTag(init) 
+
  } 
+
 
+
  class Head() : TagWithText("head") { 
+
    class object : Factory<Head> { 
+
      override fun create() = Head() 
+
    } 
+
 
+
    fun title(init : Title.() -> Unit) = initTag(init) 
+
  } 
+
 
+
  class Title() : TagWithText("title") 
+
 
+
  abstract class BodyTag(name : String) : TagWithText(name) { 
+
  } 
+
 
+
  class Body() : BodyTag("body") { 
+
    class object : Factory<Body> { 
+
      override fun create() = Body() 
+
    } 
+
 
+
    fun b(init : B.() -> Unit) = initTag(init) 
+
    fun p(init : P.() -> Unit) = initTag(init) 
+
    fun h1(init : H1.() -> Unit) = initTag(init) 
+
    fun a(href : String, init : A.() -> Unit) { 
+
      val a = initTag(init) 
+
      a.href = href 
+
    } 
+
  } 
+
 
+
  class B() : BodyTag("b") 
+
  class P() : BodyTag("p") 
+
  class H1() : BodyTag("h1") 
+
  class A() : BodyTag("a") { 
+
    var href : String 
+
      get() = attributes["href"] 
+
      set(value) { attributes["href"] = value } 
+
  } 
+
 
+
  fun html(init : HTML.() -> Unit) : HTML { 
+
    val html = HTML() 
+
    html.init() 
+
    return html 
+
  } 
+
 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/welcome_hello.kt b/confluence/testData/rendering/examples/welcome_hello.kt new file mode 100644 index 00000000000..bfb70255c67 --- /dev/null +++ b/confluence/testData/rendering/examples/welcome_hello.kt @@ -0,0 +1,5 @@ +package hello + +fun main(args : Array) { + println("Hello, world!") +} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/welcome_hello.txt b/confluence/testData/rendering/examples/welcome_hello.txt new file mode 100644 index 00000000000..b195b31b3df --- /dev/null +++ b/confluence/testData/rendering/examples/welcome_hello.txt @@ -0,0 +1,6 @@ +
+
package hello 
+
 
+
fun main(args : Array<String>) { 
+
  println("Hello, world!") 
+
}
\ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/a/a_closed_tag.kt b/confluence/testData/rendering/tagTypes/a/a_closed_tag.kt new file mode 100644 index 00000000000..c98a4f5f197 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/a/a_closed_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/a/a_next_token_tag.kt b/confluence/testData/rendering/tagTypes/a/a_next_token_tag.kt new file mode 100644 index 00000000000..ae45b3ba6db --- /dev/null +++ b/confluence/testData/rendering/tagTypes/a/a_next_token_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/a/a_with_close_tag.kt b/confluence/testData/rendering/tagTypes/a/a_with_close_tag.kt new file mode 100644 index 00000000000..228a8326dcb --- /dev/null +++ b/confluence/testData/rendering/tagTypes/a/a_with_close_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/class/class_closed_tag.kt b/confluence/testData/rendering/tagTypes/class/class_closed_tag.kt new file mode 100644 index 00000000000..fd10ed411be --- /dev/null +++ b/confluence/testData/rendering/tagTypes/class/class_closed_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/class/class_next_token_tag.kt b/confluence/testData/rendering/tagTypes/class/class_next_token_tag.kt new file mode 100644 index 00000000000..09226ddfcda --- /dev/null +++ b/confluence/testData/rendering/tagTypes/class/class_next_token_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/class/class_with_close_tag.kt b/confluence/testData/rendering/tagTypes/class/class_with_close_tag.kt new file mode 100644 index 00000000000..86e5c557073 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/class/class_with_close_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/label/label_closed_tag.kt b/confluence/testData/rendering/tagTypes/label/label_closed_tag.kt new file mode 100644 index 00000000000..d35661b6352 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/label/label_closed_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/label/label_next_token_tag.kt b/confluence/testData/rendering/tagTypes/label/label_next_token_tag.kt new file mode 100644 index 00000000000..78351b67683 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/label/label_next_token_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/label/label_with_close_tag.kt b/confluence/testData/rendering/tagTypes/label/label_with_close_tag.kt new file mode 100644 index 00000000000..b0222263ca1 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/label/label_with_close_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/ref/ref_closed_tag.kt b/confluence/testData/rendering/tagTypes/ref/ref_closed_tag.kt new file mode 100644 index 00000000000..3e6e164d9b9 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/ref/ref_closed_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/ref/ref_next_token_tag.kt b/confluence/testData/rendering/tagTypes/ref/ref_next_token_tag.kt new file mode 100644 index 00000000000..4441c579807 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/ref/ref_next_token_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/ref/ref_with_close_tag.kt b/confluence/testData/rendering/tagTypes/ref/ref_with_close_tag.kt new file mode 100644 index 00000000000..5c55181140d --- /dev/null +++ b/confluence/testData/rendering/tagTypes/ref/ref_with_close_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/style/style_closed_tag.kt b/confluence/testData/rendering/tagTypes/style/style_closed_tag.kt new file mode 100644 index 00000000000..ed45a3c83c6 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/style/style_closed_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/style/style_next_token_tag.kt b/confluence/testData/rendering/tagTypes/style/style_next_token_tag.kt new file mode 100644 index 00000000000..a4908a6fec6 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/style/style_next_token_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/style/style_with_close_tag.kt b/confluence/testData/rendering/tagTypes/style/style_with_close_tag.kt new file mode 100644 index 00000000000..5faa01a98a8 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/style/style_with_close_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/unresolved/unresolved_closed_tag.kt b/confluence/testData/rendering/tagTypes/unresolved/unresolved_closed_tag.kt new file mode 100644 index 00000000000..3eaf212b37e --- /dev/null +++ b/confluence/testData/rendering/tagTypes/unresolved/unresolved_closed_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/unresolved/unresolved_next_token_tag.kt b/confluence/testData/rendering/tagTypes/unresolved/unresolved_next_token_tag.kt new file mode 100644 index 00000000000..a148882adf3 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/unresolved/unresolved_next_token_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/unresolved/unresolved_with_close_tag.kt b/confluence/testData/rendering/tagTypes/unresolved/unresolved_with_close_tag.kt new file mode 100644 index 00000000000..c75d20afdab --- /dev/null +++ b/confluence/testData/rendering/tagTypes/unresolved/unresolved_with_close_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.kt b/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.kt new file mode 100644 index 00000000000..32a9994d9a2 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.txt b/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.txt new file mode 100644 index 00000000000..5d3f39b7ba8 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.txt @@ -0,0 +1,2 @@ +
+
var 
allByDefault : Int?
\ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.kt b/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.kt new file mode 100644 index 00000000000..89c39d6d4ec --- /dev/null +++ b/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.txt b/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.txt new file mode 100644 index 00000000000..5aeb3ef0460 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.txt @@ -0,0 +1,2 @@ +
+
var 
allByDefault
 : Int?
\ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.kt b/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.kt new file mode 100644 index 00000000000..2924effc7e4 --- /dev/null +++ b/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.kt @@ -0,0 +1 @@ +var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.txt b/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.txt new file mode 100644 index 00000000000..4d6df03ae3d --- /dev/null +++ b/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.txt @@ -0,0 +1,2 @@ +
+
var 
allByDefault : Int?
\ No newline at end of file From 4da91ee3d62a02b97aa842a80e5a12601f856f64 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 20 Apr 2012 11:51:47 +0400 Subject: [PATCH 06/16] CompileEnvironment removed What used to be CompileEnvironment, now is split into data (in CompileEnvironmentConfiguration) and utility methods (in CompileEnvironmentUtil). CompilerDependencies should be removed later. All the relevant stuff sits in the JetCoreEnvironment class --- .../jet/buildtools/core/BytecodeCompiler.java | 25 +- .../org/jetbrains/jet/cli/KotlinCompiler.java | 37 +-- .../jet/compiler/CompileEnvironment.java | 243 ------------------ .../CompileEnvironmentConfiguration.java | 56 ++++ .../jet/compiler/CompileEnvironmentUtil.java | 39 ++- .../compiler/KotlinToJVMBytecodeCompiler.java | 172 ++++++++++++- .../jet/codegen/CompileTextTest.java | 14 +- .../org/jetbrains/jet/codegen/StdlibTest.java | 4 +- 8 files changed, 308 insertions(+), 282 deletions(-) delete mode 100644 compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java create mode 100644 compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java diff --git a/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java b/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java index c1395d86f5f..f7d78f49cf0 100644 --- a/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java +++ b/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java @@ -18,9 +18,7 @@ package org.jetbrains.jet.buildtools.core; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.compiler.CompileEnvironment; -import org.jetbrains.jet.compiler.CompileEnvironmentException; -import org.jetbrains.jet.compiler.CompilerPlugin; +import org.jetbrains.jet.compiler.*; import org.jetbrains.jet.compiler.messages.MessageCollector; import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; @@ -42,22 +40,25 @@ public class BytecodeCompiler { /** - * Creates new instance of {@link CompileEnvironment} instance using the arguments specified. + * Creates new instance of {@link org.jetbrains.jet.compiler.CompileEnvironmentConfiguration} instance using the arguments specified. * * @param stdlib path to "kotlin-runtime.jar", only used if not null and not empty * @param classpath compilation classpath, only used if not null and not empty * * @return compile environment instance */ - private CompileEnvironment env( String stdlib, String[] classpath ) { - CompileEnvironment env = new CompileEnvironment(MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR, CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR)); + private CompileEnvironmentConfiguration env( String stdlib, String[] classpath ) { + CompilerDependencies dependencies = CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR); + JetCoreEnvironment environment = new JetCoreEnvironment(CompileEnvironmentUtil.createMockDisposable(), dependencies); + CompileEnvironmentConfiguration env = new CompileEnvironmentConfiguration(environment, dependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR); if (( stdlib != null ) && ( stdlib.trim().length() > 0 )) { - env.setStdlib( stdlib ); + File file = new File(stdlib); + CompileEnvironmentUtil.addToClasspath(env.getEnvironment(), file); } if (( classpath != null ) && ( classpath.length > 0 )) { - env.addToClasspath( classpath ); + CompileEnvironmentUtil.addToClasspath(env.getEnvironment(), classpath); } // lets register any compiler plugins @@ -92,7 +93,8 @@ public class BytecodeCompiler { */ public void sourcesToDir ( @NotNull String src, @NotNull String output, @Nullable String stdlib, @Nullable String[] classpath ) { try { - boolean success = env( stdlib, classpath ).compileBunchOfSources( src, null, output, true /* Last arg is ignored anyway */ ); + boolean success = KotlinToJVMBytecodeCompiler.compileBunchOfSources(env(stdlib, classpath), src, null, output, true + /* Last arg is ignored anyway */); if ( ! success ) { throw new CompileEnvironmentException( errorMessage( src, false )); } @@ -114,7 +116,7 @@ public class BytecodeCompiler { */ public void sourcesToJar ( @NotNull String src, @NotNull String jar, boolean includeRuntime, @Nullable String stdlib, @Nullable String[] classpath ) { try { - boolean success = env( stdlib, classpath ).compileBunchOfSources( src, jar, null, includeRuntime ); + boolean success = KotlinToJVMBytecodeCompiler.compileBunchOfSources(env(stdlib, classpath), src, jar, null, includeRuntime); if ( ! success ) { throw new CompileEnvironmentException( errorMessage( src, false )); } @@ -136,7 +138,8 @@ public class BytecodeCompiler { */ public void moduleToJar ( @NotNull String module, @NotNull String jar, boolean includeRuntime, @Nullable String stdlib, @Nullable String[] classpath ) { try { - boolean success = env( stdlib, classpath ).compileModuleScript( module, jar, null, includeRuntime); + CompileEnvironmentConfiguration env = env(stdlib, classpath); + boolean success = KotlinToJVMBytecodeCompiler.compileModuleScript(env, module, jar, null, includeRuntime); if ( ! success ) { throw new CompileEnvironmentException( errorMessage( module, false )); } diff --git a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java index 8be718f846a..1b058ad0151 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java @@ -20,11 +20,11 @@ import com.google.common.base.Splitter; import com.google.common.collect.Iterables; import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Multimap; +import com.intellij.openapi.Disposable; +import com.intellij.openapi.util.Disposer; import com.sampullara.cli.Args; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.compiler.CompileEnvironment; -import org.jetbrains.jet.compiler.CompileEnvironmentException; -import org.jetbrains.jet.compiler.CompilerPlugin; +import org.jetbrains.jet.compiler.*; import org.jetbrains.jet.compiler.messages.CompilerMessageLocation; import org.jetbrains.jet.compiler.messages.CompilerMessageSeverity; import org.jetbrains.jet.compiler.messages.MessageCollector; @@ -135,23 +135,30 @@ public class KotlinCompiler { runtimeJar = null; } - CompilerDependencies dependencies = new CompilerDependencies(mode, jdkHeadersJar,runtimeJar); + CompilerDependencies dependencies = new CompilerDependencies(mode, jdkHeadersJar, runtimeJar); PrintingMessageCollector messageCollector = new PrintingMessageCollector(errStream, messageRenderer, arguments.verbose); - CompileEnvironment environment = new CompileEnvironment(messageCollector, dependencies); + Disposable rootDisposable = CompileEnvironmentUtil.createMockDisposable(); + + JetCoreEnvironment environment = new JetCoreEnvironment(rootDisposable, dependencies); + CompileEnvironmentConfiguration configuration = new CompileEnvironmentConfiguration(environment, dependencies, messageCollector); try { - configureEnvironment(environment, arguments); + configureEnvironment(configuration, arguments); boolean noErrors; if (arguments.module != null) { - noErrors = environment.compileModuleScript(arguments.module, arguments.jar, arguments.outputDir, arguments.includeRuntime); + noErrors = KotlinToJVMBytecodeCompiler.compileModuleScript(configuration, + arguments.module, arguments.jar, arguments.outputDir, + arguments.includeRuntime); } else { // TODO ideally we'd unify to just having a single field that supports multiple files/dirs if (arguments.getSourceDirs() != null) { - noErrors = environment.compileBunchOfSourceDirectories(arguments.getSourceDirs(), arguments.jar, arguments.outputDir, arguments.includeRuntime); + noErrors = KotlinToJVMBytecodeCompiler.compileBunchOfSourceDirectories(configuration, + arguments.getSourceDirs(), arguments.jar, arguments.outputDir, arguments.includeRuntime); } else { - noErrors = environment.compileBunchOfSources(arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime); + noErrors = KotlinToJVMBytecodeCompiler.compileBunchOfSources(configuration, + arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime); } } return noErrors ? OK : COMPILATION_ERROR; @@ -161,7 +168,7 @@ public class KotlinCompiler { return INTERNAL_ERROR; } finally { - environment.dispose(); + Disposer.dispose(rootDisposable); messageCollector.printToErrStream(); } } @@ -228,20 +235,20 @@ public class KotlinCompiler { * Strategy method to configure the environment, allowing compiler * based tools to customise their own plugins */ - protected void configureEnvironment(CompileEnvironment environment, CompilerArguments arguments) { + protected void configureEnvironment(CompileEnvironmentConfiguration configuration, CompilerArguments arguments) { // install any compiler plugins List plugins = arguments.getCompilerPlugins(); if (plugins != null) { - environment.getEnvironment().getCompilerPlugins().addAll(plugins); + configuration.getEnvironment().getCompilerPlugins().addAll(plugins); } - if (environment.getCompilerDependencies().getRuntimeJar() != null) { - environment.addToClasspath(environment.getCompilerDependencies().getRuntimeJar()); + if (configuration.getCompilerDependencies().getRuntimeJar() != null) { + CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), configuration.getCompilerDependencies().getRuntimeJar()); } if (arguments.classpath != null) { final Iterable classpath = Splitter.on(File.pathSeparatorChar).split(arguments.classpath); - environment.addToClasspath(Iterables.toArray(classpath, String.class)); + CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), Iterables.toArray(classpath, String.class)); } } diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java deleted file mode 100644 index ac22091f949..00000000000 --- a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.compiler; - -import com.intellij.openapi.Disposable; -import com.intellij.openapi.util.Disposer; -import com.intellij.testFramework.LightVirtualFile; -import com.intellij.util.LocalTimeCounter; -import jet.modules.Module; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.codegen.ClassFileFactory; -import org.jetbrains.jet.codegen.GeneratedClassLoader; -import org.jetbrains.jet.codegen.GenerationState; -import org.jetbrains.jet.compiler.messages.MessageCollector; -import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.psi.JetPsiUtil; -import org.jetbrains.jet.lang.resolve.FqName; -import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; -import org.jetbrains.jet.lang.resolve.java.JvmAbi; -import org.jetbrains.jet.plugin.JetLanguage; -import org.jetbrains.jet.plugin.JetMainDetector; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.util.List; - -/** - * The environment for compiling a bunch of source files or - * - * @author yole - */ -public class CompileEnvironment { - private final Disposable rootDisposable; - private JetCoreEnvironment environment; - - private final MessageCollector messageCollector; - - @NotNull - private final CompilerDependencies compilerDependencies; - - /** - * NOTE: It's very important to call dispose for every object of this class or there will be memory leaks. - * @see Disposer - */ - public CompileEnvironment(@NotNull MessageCollector messageCollector, @NotNull CompilerDependencies compilerDependencies) { - this.messageCollector = messageCollector; - this.compilerDependencies = compilerDependencies; - this.rootDisposable = new Disposable() { - @Override - public void dispose() { - } - }; - this.environment = new JetCoreEnvironment(rootDisposable, compilerDependencies); - } - - - public void dispose() { - Disposer.dispose(rootDisposable); - } - - public boolean compileModuleScript(String moduleScriptFile, @Nullable String jarPath, @Nullable String outputDir, boolean jarRuntime) { - List modules = CompileEnvironmentUtil.loadModuleScript(moduleScriptFile, messageCollector); - - if (modules == null) { - throw new CompileEnvironmentException("Module script " + moduleScriptFile + " compilation failed"); - } - - if (modules.isEmpty()) { - throw new CompileEnvironmentException("No modules where defined by " + moduleScriptFile); - } - - final String directory = new File(moduleScriptFile).getParent(); - for (Module moduleBuilder : modules) { - if (compilerDependencies.getRuntimeJar() != null) { - addToClasspath(compilerDependencies.getRuntimeJar()); - } - ClassFileFactory moduleFactory = compileModule(moduleBuilder, directory); - if (moduleFactory == null) { - return false; - } - if (outputDir != null) { - CompileEnvironmentUtil.writeToOutputDirectory(moduleFactory, outputDir); - } - else { - String path = jarPath != null ? jarPath : new File(directory, moduleBuilder.getModuleName() + ".jar").getPath(); - try { - CompileEnvironmentUtil.writeToJar(moduleFactory, new FileOutputStream(path), null, jarRuntime); - } - catch (FileNotFoundException e) { - throw new CompileEnvironmentException("Invalid jar path " + path, e); - } - } - } - return true; - } - - public ClassFileFactory compileModule(Module moduleBuilder, String directory) { - if (moduleBuilder.getSourceFiles().isEmpty()) { - throw new CompileEnvironmentException("No source files where defined"); - } - - for (String sourceFile : moduleBuilder.getSourceFiles()) { - File source = new File(sourceFile); - if (!source.isAbsolute()) { - source = new File(directory, sourceFile); - } - - if (!source.exists()) { - throw new CompileEnvironmentException("'" + source + "' does not exist"); - } - - environment.addSources(source.getPath()); - } - for (String classpathRoot : moduleBuilder.getClasspathRoots()) { - environment.addToClasspath(new File(classpathRoot)); - } - - CompileEnvironmentUtil.ensureRuntime(environment, compilerDependencies); - - return analyze(); - } - - public ClassLoader compileText(String code) { - environment.addSources(new LightVirtualFile("script" + LocalTimeCounter.currentTime() + ".kt", JetLanguage.INSTANCE, code)); - - ClassFileFactory factory = analyze(); - if (factory == null) { - return null; - } - return new GeneratedClassLoader(factory); - } - - public boolean compileBunchOfSources(String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime) { - environment.addSources(sourceFileOrDir); - - return compileBunchOfSources(jar, outputDir, includeRuntime); - } - - public boolean compileBunchOfSourceDirectories(List sources, String jar, String outputDir, boolean includeRuntime) { - for (String source : sources) { - environment.addSources(source); - } - - return compileBunchOfSources(jar, outputDir, includeRuntime); - } - - private boolean compileBunchOfSources(String jar, String outputDir, boolean includeRuntime) { - FqName mainClass = null; - for (JetFile file : environment.getSourceFiles()) { - if (JetMainDetector.hasMain(file.getDeclarations())) { - FqName fqName = JetPsiUtil.getFQName(file); - mainClass = fqName.child(JvmAbi.PACKAGE_CLASS); - break; - } - } - - CompileEnvironmentUtil.ensureRuntime(environment, compilerDependencies); - - ClassFileFactory factory = analyze(); - if (factory == null) { - return false; - } - - if (jar != null) { - try { - CompileEnvironmentUtil.writeToJar(factory, new FileOutputStream(jar), mainClass, includeRuntime); - } catch (FileNotFoundException e) { - throw new CompileEnvironmentException("Invalid jar path " + jar, e); - } - } - else if (outputDir != null) { - CompileEnvironmentUtil.writeToOutputDirectory(factory, outputDir); - } - else { - throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk"); - } - return true; - } - - private ClassFileFactory analyze() { - boolean stubs = compilerDependencies.getCompilerSpecialMode().isStubs(); - GenerationState generationState = - KotlinToJVMBytecodeCompiler - .analyzeAndGenerate(environment, compilerDependencies, messageCollector, stubs); - if (generationState == null) { - return null; - } - return generationState.getFactory(); - } - - /** - * Add path specified to the compilation environment. - * @param paths paths to add - */ - public void addToClasspath(File ... paths) { - for (File path : paths) { - if (!path.exists()) { - throw new CompileEnvironmentException("'" + path + "' does not exist"); - } - environment.addToClasspath(path); - } - } - - /** - * Add path specified to the compilation environment. - * @param paths paths to add - */ - public void addToClasspath(String ... paths) { - for (String path : paths) { - addToClasspath( new File(path)); - } - } - - public void setStdlib(String stdlib) { - File file = new File(stdlib); - addToClasspath(file); - } - - public JetCoreEnvironment getEnvironment() { - return environment; - } - - @NotNull - public CompilerDependencies getCompilerDependencies() { - return compilerDependencies; - } -} diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java new file mode 100644 index 00000000000..2b73bd0e964 --- /dev/null +++ b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java @@ -0,0 +1,56 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.compiler; + +import com.intellij.openapi.util.Disposer; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.compiler.messages.MessageCollector; +import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; + +/** + * @author abreslav + */ +public class CompileEnvironmentConfiguration { + private final JetCoreEnvironment environment; + private final CompilerDependencies compilerDependencies; + private final MessageCollector messageCollector; + + /** + * NOTE: It's very important to call dispose for every object of this class or there will be memory leaks. + * @see Disposer + */ + public CompileEnvironmentConfiguration(@NotNull JetCoreEnvironment environment, + @NotNull CompilerDependencies compilerDependencies, @NotNull MessageCollector messageCollector) { + this.messageCollector = messageCollector; + this.compilerDependencies = compilerDependencies; + this.environment = environment; + } + + public JetCoreEnvironment getEnvironment() { + return environment; + } + + @NotNull + public CompilerDependencies getCompilerDependencies() { + return compilerDependencies; + } + + @NotNull + public MessageCollector getMessageCollector() { + return messageCollector; + } +} diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java index eaf0af30966..97f882b486f 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java @@ -51,9 +51,17 @@ import java.util.jar.*; * @author abreslav */ public class CompileEnvironmentUtil { + public static Disposable createMockDisposable() { + return new Disposable() { + @Override + public void dispose() { + } + }; + } + @Nullable public static File getUnpackedRuntimePath() { - URL url = CompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class"); + URL url = CompileEnvironmentConfiguration.class.getClassLoader().getResource("jet/JetObject.class"); if (url != null && url.getProtocol().equals("file")) { return new File(url.getPath()).getParentFile().getParentFile(); } @@ -62,7 +70,7 @@ public class CompileEnvironmentUtil { @Nullable public static File getRuntimeJarPath() { - URL url = CompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class"); + URL url = CompileEnvironmentConfiguration.class.getClassLoader().getResource("jet/JetObject.class"); if (url != null && url.getProtocol().equals("jar")) { String path = url.getPath(); return new File(path.substring(path.indexOf(":") + 1, path.indexOf("!/"))); @@ -187,7 +195,7 @@ public class CompileEnvironmentUtil { } } else { - loader = new GeneratedClassLoader(factory, CompileEnvironment.class.getClassLoader()); + loader = new GeneratedClassLoader(factory, CompileEnvironmentConfiguration.class.getClassLoader()); } try { Class namespaceClass = loader.loadClass(JvmAbi.PACKAGE_CLASS); @@ -301,4 +309,29 @@ public class CompileEnvironmentUtil { } } } + + /** + * Add path specified to the compilation environment. + * @param environment compilation environment to add to + * @param paths paths to add + */ + public static void addToClasspath(JetCoreEnvironment environment, File ... paths) { + for (File path : paths) { + if (!path.exists()) { + throw new CompileEnvironmentException("'" + path + "' does not exist"); + } + environment.addToClasspath(path); + } + } + + /** + * Add path specified to the compilation environment. + * @param environment compilation environment to add to + * @param paths paths to add + */ + public static void addToClasspath(JetCoreEnvironment environment, String ... paths) { + for (String path : paths) { + addToClasspath(environment, new File(path)); + } + } } diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java b/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java index ecc239820ad..a6055710614 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java @@ -25,12 +25,13 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiErrorElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiRecursiveElementWalkingVisitor; +import com.intellij.testFramework.LightVirtualFile; +import com.intellij.util.LocalTimeCounter; +import jet.modules.Module; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.analyzer.AnalyzeExhaust; -import org.jetbrains.jet.codegen.ClassBuilderFactories; -import org.jetbrains.jet.codegen.CompilationErrorHandler; -import org.jetbrains.jet.codegen.GenerationState; +import org.jetbrains.jet.codegen.*; import org.jetbrains.jet.compiler.messages.CompilerMessageLocation; import org.jetbrains.jet.compiler.messages.CompilerMessageSeverity; import org.jetbrains.jet.compiler.messages.MessageCollector; @@ -41,12 +42,20 @@ import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory; import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils; import org.jetbrains.jet.lang.diagnostics.Severity; import org.jetbrains.jet.lang.psi.JetFile; +import org.jetbrains.jet.lang.psi.JetPsiUtil; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.DescriptorUtils; +import org.jetbrains.jet.lang.resolve.FqName; import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM; import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; +import org.jetbrains.jet.lang.resolve.java.JvmAbi; +import org.jetbrains.jet.plugin.JetLanguage; +import org.jetbrains.jet.plugin.JetMainDetector; import org.jetbrains.jet.utils.Progress; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.util.Collection; import java.util.List; @@ -56,6 +65,163 @@ import java.util.List; */ public class KotlinToJVMBytecodeCompiler { + @Nullable + public static ClassFileFactory compileModule( + CompileEnvironmentConfiguration configuration, + Module moduleBuilder, + String directory + ) { + if (moduleBuilder.getSourceFiles().isEmpty()) { + throw new CompileEnvironmentException("No source files where defined"); + } + + for (String sourceFile : moduleBuilder.getSourceFiles()) { + File source = new File(sourceFile); + if (!source.isAbsolute()) { + source = new File(directory, sourceFile); + } + + if (!source.exists()) { + throw new CompileEnvironmentException("'" + source + "' does not exist"); + } + + configuration.getEnvironment().addSources(source.getPath()); + } + for (String classpathRoot : moduleBuilder.getClasspathRoots()) { + configuration.getEnvironment().addToClasspath(new File(classpathRoot)); + } + + CompileEnvironmentUtil.ensureRuntime(configuration.getEnvironment(), configuration.getCompilerDependencies()); + + GenerationState generationState = analyzeAndGenerate(configuration); + if (generationState == null) { + return null; + } + return generationState.getFactory(); + } + + public static boolean compileModuleScript( + CompileEnvironmentConfiguration configuration, + + @NotNull String moduleScriptFile, + @Nullable String jarPath, + @Nullable String outputDir, + boolean jarRuntime) { + List modules = CompileEnvironmentUtil.loadModuleScript(moduleScriptFile, configuration.getMessageCollector()); + + if (modules == null) { + throw new CompileEnvironmentException("Module script " + moduleScriptFile + " compilation failed"); + } + + if (modules.isEmpty()) { + throw new CompileEnvironmentException("No modules where defined by " + moduleScriptFile); + } + + final String directory = new File(moduleScriptFile).getParent(); + for (Module moduleBuilder : modules) { + // TODO: this should be done only once for the environment + if (configuration.getCompilerDependencies().getRuntimeJar() != null) { + CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), configuration.getCompilerDependencies().getRuntimeJar()); + } + ClassFileFactory moduleFactory = KotlinToJVMBytecodeCompiler.compileModule(configuration, moduleBuilder, directory); + if (moduleFactory == null) { + return false; + } + if (outputDir != null) { + CompileEnvironmentUtil.writeToOutputDirectory(moduleFactory, outputDir); + } + else { + String path = jarPath != null ? jarPath : new File(directory, moduleBuilder.getModuleName() + ".jar").getPath(); + try { + CompileEnvironmentUtil.writeToJar(moduleFactory, new FileOutputStream(path), null, jarRuntime); + } + catch (FileNotFoundException e) { + throw new CompileEnvironmentException("Invalid jar path " + path, e); + } + } + } + return true; + } + + private static boolean compileBunchOfSources( + CompileEnvironmentConfiguration configuration, + + String jar, + String outputDir, + boolean includeRuntime + ) { + FqName mainClass = null; + for (JetFile file : configuration.getEnvironment().getSourceFiles()) { + if (JetMainDetector.hasMain(file.getDeclarations())) { + FqName fqName = JetPsiUtil.getFQName(file); + mainClass = fqName.child(JvmAbi.PACKAGE_CLASS); + break; + } + } + + CompileEnvironmentUtil.ensureRuntime(configuration.getEnvironment(), configuration.getCompilerDependencies()); + + GenerationState generationState = analyzeAndGenerate(configuration); + if (generationState == null) { + return false; + } + + ClassFileFactory factory = generationState.getFactory(); + if (jar != null) { + try { + CompileEnvironmentUtil.writeToJar(factory, new FileOutputStream(jar), mainClass, includeRuntime); + } catch (FileNotFoundException e) { + throw new CompileEnvironmentException("Invalid jar path " + jar, e); + } + } + else if (outputDir != null) { + CompileEnvironmentUtil.writeToOutputDirectory(factory, outputDir); + } + else { + throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk"); + } + return true; + } + + public static boolean compileBunchOfSources( + CompileEnvironmentConfiguration configuration, + + String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime) { + configuration.getEnvironment().addSources(sourceFileOrDir); + + return compileBunchOfSources(configuration, jar, outputDir, includeRuntime); + } + + public static boolean compileBunchOfSourceDirectories( + CompileEnvironmentConfiguration configuration, + + List sources, String jar, String outputDir, boolean includeRuntime) { + for (String source : sources) { + configuration.getEnvironment().addSources(source); + } + + return compileBunchOfSources(configuration, jar, outputDir, includeRuntime); + } + + @Nullable + public static ClassLoader compileText( + CompileEnvironmentConfiguration configuration, + + String code) { + configuration.getEnvironment().addSources(new LightVirtualFile("script" + LocalTimeCounter.currentTime() + ".kt", JetLanguage.INSTANCE, code)); + + GenerationState generationState = analyzeAndGenerate(configuration); + if (generationState == null) { + return null; + } + return new GeneratedClassLoader(generationState.getFactory()); + } + + @Nullable + public static GenerationState analyzeAndGenerate(CompileEnvironmentConfiguration configuration) { + return analyzeAndGenerate(configuration.getEnvironment(), configuration.getCompilerDependencies(), configuration.getMessageCollector(), configuration.getCompilerDependencies().getCompilerSpecialMode().isStubs()); + } + @Nullable public static GenerationState analyzeAndGenerate( JetCoreEnvironment environment, diff --git a/compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java b/compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java index 84d8b82c38c..aacc2ca0d65 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java @@ -17,8 +17,12 @@ package org.jetbrains.jet.codegen; import org.jetbrains.jet.CompileCompilerDependenciesTest; -import org.jetbrains.jet.compiler.CompileEnvironment; +import org.jetbrains.jet.compiler.CompileEnvironmentConfiguration; +import org.jetbrains.jet.compiler.CompileEnvironmentUtil; +import org.jetbrains.jet.compiler.JetCoreEnvironment; +import org.jetbrains.jet.compiler.KotlinToJVMBytecodeCompiler; import org.jetbrains.jet.compiler.messages.MessageCollector; +import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; import java.lang.reflect.InvocationTargetException; @@ -27,9 +31,11 @@ import java.lang.reflect.Method; public class CompileTextTest extends CodegenTestCase { public void testMe() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { String text = "import org.jetbrains.jet.codegen.CompileTextTest; fun x() = CompileTextTest()"; - CompileEnvironment compileEnvironment = new CompileEnvironment(MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR, CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR)); - compileEnvironment.getEnvironment().addToClasspathFromClassLoader(getClass().getClassLoader()); - ClassLoader classLoader = compileEnvironment.compileText(text); + CompilerDependencies dependencies = CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR); + JetCoreEnvironment environment = new JetCoreEnvironment(CompileEnvironmentUtil.createMockDisposable(), dependencies); + CompileEnvironmentConfiguration configuration = new CompileEnvironmentConfiguration(environment, dependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR); + configuration.getEnvironment().addToClasspathFromClassLoader(getClass().getClassLoader()); + ClassLoader classLoader = KotlinToJVMBytecodeCompiler.compileText(configuration, text); Class namespace = classLoader.loadClass("namespace"); Method x = namespace.getDeclaredMethod("x"); Object invoke = x.invoke(null); diff --git a/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java b/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java index 20f6a1892d4..6e18a9aa08c 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java @@ -17,8 +17,8 @@ package org.jetbrains.jet.codegen; import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime; -import org.jetbrains.jet.compiler.CompileEnvironment; import org.jetbrains.jet.lang.psi.JetPsiUtil; +import org.junit.Test; import java.io.File; import java.lang.annotation.*; @@ -28,8 +28,6 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; -import org.junit.Test; - /** * @author alex.tkachman */ From 1b7128c6b62e1521f157f59a5589bbc0ff1a5a75 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 20 Apr 2012 12:14:11 +0400 Subject: [PATCH 07/16] KDoc fixed according to the compiler refactoring --- .../src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt b/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt index 565a7a25a62..5b84e81777c 100644 --- a/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt +++ b/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt @@ -4,7 +4,7 @@ import java.io.File import java.io.PrintStream import org.jetbrains.jet.cli.CompilerArguments import org.jetbrains.jet.cli.KotlinCompiler -import org.jetbrains.jet.compiler.CompileEnvironment +import org.jetbrains.jet.compiler.CompileEnvironmentConfiguration import org.jetbrains.kotlin.doc.highlighter.HtmlCompilerPlugin /** @@ -20,7 +20,7 @@ fun main(args: Array): Unit { */ class KDocCompiler() : KotlinCompiler() { - protected override fun configureEnvironment(environment : CompileEnvironment?, arguments : CompilerArguments?) { + protected override fun configureEnvironment(environment : CompileEnvironmentConfiguration?, arguments : CompilerArguments?) { super.configureEnvironment(environment, arguments) val coreEnvironment = environment?.getEnvironment() if (coreEnvironment != null) { From e14f0e637c4418c4acb53e45d838e6dc0533c20f Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 20 Apr 2012 13:32:48 +0400 Subject: [PATCH 08/16] The confluence plugin has been moved to a separate repository New repository is located at https://github.com/jetbrains/kotlin-confluence-plugin --- confluence/.idea/.name | 1 - confluence/.idea/ant.xml | 15 - confluence/.idea/compiler.xml | 24 - .../.idea/copyright/profiles_settings.xml | 5 - confluence/.idea/encodings.xml | 5 - .../Maven__aopalliance_aopalliance_1_0.xml | 13 - .../.idea/libraries/Maven__asm_asm_1_5_3.xml | 13 - .../libraries/Maven__axis_axis_1_2_1.xml | 13 - .../Maven__axis_axis_jaxrpc_1_2_1_noqname.xml | 13 - .../libraries/Maven__axis_axis_saaj_1_2_1.xml | 13 - .../libraries/Maven__batik_batik_all_1_6.xml | 13 - .../Maven__biz_aQute_bndlib_0_0_255.xml | 13 - .../libraries/Maven__c3p0_c3p0_0_9_1_2.xml | 13 - .../libraries/Maven__cglib_cglib_2_1_3.xml | 13 - ...om_atlassian_applinks_applinks_api_3_3.xml | 13 - ...m_atlassian_applinks_applinks_host_3_3.xml | 13 - ...om_atlassian_applinks_applinks_spi_3_3.xml | 13 - ...tlassian_bandana_atlassian_bandana_3_1.xml | 13 - ...sian_bonnie_atlassian_bonnie_4_0_beta3.xml | 13 - ...tlassian_cache_atlassian_cache_api_0_1.xml | 13 - ...ssian_cache_atlassian_cache_memory_0_1.xml | 13 - ...lassian_config_atlassian_config_0_13_2.xml | 13 - ..._atlassian_confluence_confluence_3_5_2.xml | 13 - ...ian_confluence_confluence_bucket_3_5_2.xml | 13 - ...an_confluence_confluence_upgrade_3_5_2.xml | 13 - ...assian_confluence_plugin_func_test_2_3.xml | 13 - ...om_atlassian_core_atlassian_core_4_5_8.xml | 13 - ...an_embedded_crowd_atlassian_user_1_2_4.xml | 13 - ...assian_embedded_crowd_hibernate2_1_2_4.xml | 13 - ...n__com_atlassian_crowd_crowd_api_2_2_5.xml | 13 - ...__com_atlassian_crowd_crowd_core_2_2_5.xml | 13 - ...com_atlassian_crowd_crowd_events_2_2_5.xml | 13 - ...sian_crowd_crowd_integration_api_2_2_5.xml | 13 - ..._crowd_integration_client_common_2_2_5.xml | 13 - ...wd_crowd_integration_client_rest_2_2_5.xml | 13 - ...crowd_crowd_integration_seraph22_2_2_5.xml | 13 - ...__com_atlassian_crowd_crowd_ldap_2_2_5.xml | 13 - ...an_crowd_crowd_password_encoders_2_2_5.xml | 13 - ...tlassian_crowd_crowd_persistence_2_2_5.xml | 13 - ...com_atlassian_crowd_crowd_remote_2_2_5.xml | 13 - ...lassian_crowd_embedded_crowd_api_2_2_5.xml | 13 - ...assian_crowd_embedded_crowd_core_2_2_5.xml | 13 - ...lassian_crowd_embedded_crowd_spi_2_2_5.xml | 13 - ..._atlassian_event_atlassian_event_2_0_6.xml | 13 - ..._atlassian_extras_atlassian_extras_2_4.xml | 13 - ...an_gzipfilter_atlassian_gzipfilter_1_9.xml | 13 - ..._utilities_atlassian_jdk_utilities_0_4.xml | 13 - ...lassian_johnson_atlassian_johnson_0_10.xml | 13 - ...com_atlassian_mail_atlassian_mail_1_16.xml | 13 - ...lassian_modzdetector_modz_detector_0_8.xml | 13 - ...n_multitenant_multitenant_core_1_0_m14.xml | 13 - ...om_atlassian_paddle_atlassian_paddle_5.xml | 13 - ...n_plugins_atlassian_plugins_core_2_7_5.xml | 13 - ...n_plugins_atlassian_plugins_osgi_2_7_5.xml | 13 - ...ns_atlassian_plugins_osgi_events_2_7_5.xml | 13 - ...lugins_atlassian_plugins_servlet_2_7_5.xml | 13 - ...plugins_atlassian_plugins_spring_2_7_5.xml | 13 - ...ns_atlassian_plugins_webfragment_2_7_5.xml | 13 - ...ns_atlassian_plugins_webresource_2_7_5.xml | 13 - ...an_profiling_atlassian_profiling_1_8_1.xml | 13 - ...assian_renderer_atlassian_renderer_7_0.xml | 13 - ...Maven__com_atlassian_sal_sal_api_2_4_1.xml | 13 - ...Maven__com_atlassian_sal_sal_spi_2_4_1.xml | 13 - ...en__com_atlassian_sal_sal_spring_2_4_1.xml | 13 - ...an_security_atlassian_cookie_tools_2_0.xml | 13 - ...ecurity_atlassian_password_encoder_1_0.xml | 13 - ...n_security_atlassian_secure_random_1_0.xml | 13 - ...apps_atlassian_trusted_apps_core_2_3_1.xml | 13 - ..._trusted_apps_seraph_integration_2_3_1.xml | 13 - ...tlassian_seraph_atlassian_seraph_2_4_0.xml | 13 - ...assian_spring_atlassian_spring_2_0_rc4.xml | 13 - ...ng_atlassian_spring_hibernate2_2_0_rc4.xml | 13 - ...ian_trackback_atlassian_trackback_0_10.xml | 13 - ..._com_atlassian_user_atlassian_user_3_0.xml | 13 - ...rrent_atlassian_util_concurrent_0_0_12.xml | 13 - ...assian_velocity_atlassian_velocity_0_7.xml | 13 - ...tlassian_xwork_atlassian_xwork_10_1_12.xml | 13 - ...assian_xwork_atlassian_xwork_core_1_12.xml | 13 - ...gle_collections_google_collections_1_0.xml | 13 - .../Maven__com_ibm_icu_icu4j_3_8.xml | 13 - ..._com_octo_captcha_jcaptcha_all_1_0_RC6.xml | 13 - .../Maven__com_sun_jai_codec_1_1_3.xml | 13 - .../Maven__com_sun_jai_core_1_1_3.xml | 13 - ...com_thoughtworks_xstream_xstream_1_1_1.xml | 13 - ...mons_beanutils_commons_beanutils_1_6_1.xml | 13 - ...Maven__commons_codec_commons_codec_1_4.xml | 13 - ...ns_collections_commons_collections_3_2.xml | 13 - ..._commons_digester_commons_digester_1_5.xml | 13 - ...ommons_discovery_commons_discovery_0_2.xml | 13 - ...ns_fileupload_commons_fileupload_1_2_1.xml | 13 - ...mons_httpclient_commons_httpclient_3_0.xml | 13 - .../Maven__commons_io_commons_io_1_4.xml | 13 - ...__commons_jrcs_commons_jrcs_diff_0_1_7.xml | 13 - .../Maven__commons_lang_commons_lang_2_4.xml | 13 - ..._commons_logging_commons_logging_1_1_1.xml | 13 - .../Maven__concurrent_concurrent_1_3_4.xml | 13 - .../libraries/Maven__dom4j_dom4j_1_4_full.xml | 13 - .../.idea/libraries/Maven__exml_exml_7_1.xml | 13 - .../libraries/Maven__glue_glue_5_0b2.xml | 13 - ..._hibernate_hibernate_2_1_8_atlassian_9.xml | 13 - ...ven__javax_activation_activation_1_0_2.xml | 13 - .../Maven__javax_mail_mail_1_4_1.xml | 13 - .../Maven__javax_servlet_servlet_api_2_4.xml | 13 - .../Maven__javax_transaction_jta_1_0_1B.xml | 13 - ...Maven__javax_xml_stream_stax_api_1_0_2.xml | 13 - .../.idea/libraries/Maven__jdom_jdom_1_0.xml | 13 - .../libraries/Maven__jfree_jcommon_1_0_0.xml | 13 - .../Maven__jfree_jfreechart_1_0_0.xml | 13 - .../Maven__joda_time_joda_time_1_6.xml | 13 - .../libraries/Maven__junit_junit_4_6.xml | 13 - .../libraries/Maven__log4j_log4j_1_2_15.xml | 13 - .../Maven__mockobjects_alt_jdk1_3_0_07.xml | 13 - ...ts_mockobjects_alt_jdk1_3_j2ee1_3_0_09.xml | 13 - ...ava_dev_stax_utils_stax_utils_20040917.xml | 13 - ...t_java_dev_urlrewrite_urlrewrite_2_6_0.xml | 13 - .../Maven__net_jcip_jcip_annotations_1_0.xml | 13 - .../Maven__net_sf_ehcache_ehcache_1_2_3.xml | 13 - ...net_sf_ldaptemplate_ldaptemplate_1_0_1.xml | 13 - ..._sourceforge_cssparser_cssparser_0_9_5.xml | 13 - ..._net_sourceforge_htmlunit_htmlunit_2_5.xml | 13 - ...rceforge_htmlunit_htmlunit_core_js_2_5.xml | 13 - ...sourceforge_jwebunit_jwebunit_core_2_2.xml | 13 - ..._jwebunit_jwebunit_htmlunit_plugin_2_2.xml | 13 - ...t_sourceforge_nekohtml_nekohtml_1_9_12.xml | 13 - .../.idea/libraries/Maven__odmg_odmg_3_0.xml | 13 - .../Maven__ognl_ognl_2_6_5_atlassian_2.xml | 13 - ..._opensymphony_oscore_2_2_7_atlassian_1.xml | 13 - ...__opensymphony_propertyset_1_3_21Nov03.xml | 13 - ...n__opensymphony_sitemesh_2_3_atlassian.xml | 13 - ...opensymphony_webwork_2_1_5_atlassian_2.xml | 13 - .../Maven__opensymphony_xwork_1_0_3_2.xml | 13 - ...felix_org_apache_felix_framework_3_0_2.xml | 13 - ...g_apache_lucene_lucene_analyzers_2_9_4.xml | 13 - ...n__org_apache_lucene_lucene_core_2_9_4.xml | 13 - ...apache_lucene_lucene_highlighter_2_9_4.xml | 13 - ..._org_apache_lucene_lucene_memory_2_9_4.xml | 13 - ...n__org_apache_lucene_lucene_misc_2_9_4.xml | 13 - ...Maven__org_apache_pdfbox_fontbox_1_2_1.xml | 13 - ...Maven__org_apache_pdfbox_jempbox_1_2_1.xml | 13 - .../Maven__org_apache_pdfbox_pdfbox_1_2_1.xml | 13 - .../Maven__org_apache_poi_poi_3_5_FINAL.xml | 13 - ...rg_apache_poi_poi_scratchpad_3_5_FINAL.xml | 13 - ...he_velocity_velocity_1_6_1_atlassian_2.xml | 13 - ...n__org_apache_ws_commons_XmlSchema_1_1.xml | 13 - ...Maven__org_aspectj_aspectjweaver_1_6_0.xml | 13 - ...en__org_bouncycastle_bcmail_jdk15_1_44.xml | 13 - ...en__org_bouncycastle_bcprov_jdk15_1_44.xml | 13 - ...__org_codehaus_woodstox_wstx_asl_3_2_4.xml | 13 - ...__org_codehaus_xfire_xfire_aegis_1_2_6.xml | 13 - ...n__org_codehaus_xfire_xfire_core_1_2_6.xml | 13 - ...Maven__org_directwebremoting_dwr_2_0_3.xml | 13 - ...Maven__org_hibernate_jtidy_r8_20060801.xml | 13 - ...__org_hsqldb_hsqldb_2_0_1_rc3_20110120.xml | 13 - ...ven__org_quartz_scheduler_quartz_1_8_0.xml | 13 - .../Maven__org_slf4j_jul_to_slf4j_1_5_8.xml | 13 - .../Maven__org_slf4j_slf4j_api_1_5_8.xml | 13 - .../Maven__org_slf4j_slf4j_log4j12_1_5_8.xml | 13 - ...rk_ldap_spring_ldap_core_1_3_0_RELEASE.xml | 13 - ...rk_security_spring_security_core_2_0_4.xml | 13 - ...__org_springframework_spring_aop_2_0_8.xml | 13 - ...org_springframework_spring_beans_2_0_8.xml | 13 - ...g_springframework_spring_context_2_0_8.xml | 13 - ..._org_springframework_spring_core_2_0_8.xml | 13 - ...__org_springframework_spring_dao_2_0_8.xml | 13 - ...pringframework_spring_hibernate2_2_0_8.xml | 13 - ..._org_springframework_spring_jdbc_2_0_8.xml | 13 - ...__org_springframework_spring_jmx_2_0_8.xml | 13 - ...g_springframework_spring_support_2_0_8.xml | 13 - ...__org_springframework_spring_web_2_0_8.xml | 13 - ...wdata_pkgscanner_package_scanner_0_9_5.xml | 13 - .../libraries/Maven__org_w3c_css_sac_1_3.xml | 13 - .../.idea/libraries/Maven__oro_oro_2_0_8.xml | 13 - .../libraries/Maven__oscache_oscache_2_2.xml | 13 - .../Maven__osuser_osuser_atl_user.xml | 13 - ...__radeox_radeox_1_0b2_forked_22Apr2004.xml | 13 - .../libraries/Maven__regexp_regexp_1_3.xml | 13 - .../.idea/libraries/Maven__rome_rome_1_0.xml | 13 - .../libraries/Maven__slide_slide_2_1.xml | 13 - ...velocity_tools_velocity_tools_view_1_1.xml | 13 - .../libraries/Maven__wsdl4j_wsdl4j_1_5_1.xml | 13 - .../libraries/Maven__xalan_xalan_2_7_0.xml | 13 - .../Maven__xerces_xercesImpl_2_9_1.xml | 13 - ...en__xmlrpc_xmlrpc_2_0_xmlrpc61_1_sbfix.xml | 13 - .../Maven__xpp3_xpp3_min_1_1_3_4_O.xml | 13 - confluence/.idea/misc.xml | 74 - confluence/.idea/modules.xml | 9 - confluence/.idea/scopes/scope_settings.xml | 5 - confluence/.idea/uiDesigner.xml | 125 -- confluence/.idea/vcs.xml | 7 - confluence/buildConfluenceLexer.xml | 46 - confluence/confluence.iml | 195 --- confluence/pom.xml | 81 - .../src/main/java/com/intellij/lexer/Foo.java | 23 - .../main/java/com/intellij/psi/TokenType.java | 27 - .../com/intellij/psi/tree/IElementType.java | 23 - .../java/com/intellij/psi/tree/TokenSet.java | 40 - .../com/intellij/util/text/CharArrayUtil.java | 30 - .../org/jetbrains/jet/ConfluenceUtils.java | 47 - .../org/jetbrains/jet/lexer/FlexLexer.java | 23 - .../org/jetbrains/jet/lexer/JetHTMLMacro.java | 45 - .../jetbrains/jet/lexer/JetKeywordToken.java | 49 - .../org/jetbrains/jet/lexer/JetMacro.java | 357 ----- .../org/jetbrains/jet/lexer/JetToken.java | 28 - .../org/jetbrains/jet/lexer/JetTokens.java | 199 --- .../org/jetbrains/jet/lexer/_JetLexer.java | 1346 ----------------- .../jetbrains/jet/tags/StyledDivTagType.java | 31 - .../java/org/jetbrains/jet/tags/TagData.java | 44 - .../java/org/jetbrains/jet/tags/TagType.java | 25 - .../src/main/resources/atlassian-plugin.xml | 23 - confluence/src/main/resources/kotlin.css | 81 - .../src/main/resources/template.velocity | 3 - confluence/src/main/resources/underline.gif | Bin 815 -> 0 bytes .../TestUtils.java | 34 - .../rendering/ConfluenceRenderingTest.java | 71 - .../testData/rendering/elements/class.kt | 7 - .../testData/rendering/elements/class.txt | 8 - .../testData/rendering/elements/variable.kt | 5 - .../testData/rendering/elements/variable.txt | 6 - .../testData/rendering/elements/when.kt | 7 - .../testData/rendering/elements/when.txt | 8 - .../rendering/examples/adress_book.kt | 47 - .../rendering/examples/adress_book.txt | 48 - .../basic_syntax_define_a_function.kt | 4 - .../basic_syntax_define_a_function.txt | 5 - .../basic_syntax_define_a_variable.kt | 4 - .../basic_syntax_define_a_variable.txt | 5 - .../examples/basic_syntax_null_checks.kt | 32 - .../examples/basic_syntax_null_checks.txt | 32 - ...sic_syntax_use_a_conditional_expression.kt | 6 - ...ic_syntax_use_a_conditional_expression.txt | 7 - .../hello_world_a_multi_language_hello.kt | 9 - .../hello_world_a_multi_language_hello.txt | 10 - .../hello_world_an_object_oriented_hello.kt | 9 - .../hello_world_an_object_oriented_hello.txt | 10 - ..._world_reading_a_name_from_command_line.kt | 7 - ...world_reading_a_name_from_command_line.txt | 8 - .../rendering/examples/html_builder.kt | 31 - .../rendering/examples/html_builder.txt | 32 - .../examples/html_builder_with_refs.kt | 114 -- .../examples/html_builder_with_refs.txt | 115 -- .../rendering/examples/welcome_hello.kt | 5 - .../rendering/examples/welcome_hello.txt | 6 - .../rendering/tagTypes/a/a_closed_tag.kt | 1 - .../rendering/tagTypes/a/a_next_token_tag.kt | 1 - .../rendering/tagTypes/a/a_with_close_tag.kt | 1 - .../tagTypes/class/class_closed_tag.kt | 1 - .../tagTypes/class/class_next_token_tag.kt | 1 - .../tagTypes/class/class_with_close_tag.kt | 1 - .../tagTypes/label/label_closed_tag.kt | 1 - .../tagTypes/label/label_next_token_tag.kt | 1 - .../tagTypes/label/label_with_close_tag.kt | 1 - .../rendering/tagTypes/ref/ref_closed_tag.kt | 1 - .../tagTypes/ref/ref_next_token_tag.kt | 1 - .../tagTypes/ref/ref_with_close_tag.kt | 1 - .../tagTypes/style/style_closed_tag.kt | 1 - .../tagTypes/style/style_next_token_tag.kt | 1 - .../tagTypes/style/style_with_close_tag.kt | 1 - .../unresolved/unresolved_closed_tag.kt | 1 - .../unresolved/unresolved_next_token_tag.kt | 1 - .../unresolved/unresolved_with_close_tag.kt | 1 - .../tagTypes/warnings/warning_closed_tag.kt | 1 - .../tagTypes/warnings/warning_closed_tag.txt | 2 - .../warnings/warning_next_token_tag.kt | 1 - .../warnings/warning_next_token_tag.txt | 2 - .../warnings/warning_with_close_tag.kt | 1 - .../warnings/warning_with_close_tag.txt | 2 - 266 files changed, 6082 deletions(-) delete mode 100644 confluence/.idea/.name delete mode 100644 confluence/.idea/ant.xml delete mode 100644 confluence/.idea/compiler.xml delete mode 100644 confluence/.idea/copyright/profiles_settings.xml delete mode 100644 confluence/.idea/encodings.xml delete mode 100644 confluence/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml delete mode 100644 confluence/.idea/libraries/Maven__asm_asm_1_5_3.xml delete mode 100644 confluence/.idea/libraries/Maven__axis_axis_1_2_1.xml delete mode 100644 confluence/.idea/libraries/Maven__axis_axis_jaxrpc_1_2_1_noqname.xml delete mode 100644 confluence/.idea/libraries/Maven__axis_axis_saaj_1_2_1.xml delete mode 100644 confluence/.idea/libraries/Maven__batik_batik_all_1_6.xml delete mode 100644 confluence/.idea/libraries/Maven__biz_aQute_bndlib_0_0_255.xml delete mode 100644 confluence/.idea/libraries/Maven__c3p0_c3p0_0_9_1_2.xml delete mode 100644 confluence/.idea/libraries/Maven__cglib_cglib_2_1_3.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_api_3_3.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_host_3_3.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_spi_3_3.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_bandana_atlassian_bandana_3_1.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_bonnie_atlassian_bonnie_4_0_beta3.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_api_0_1.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_memory_0_1.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_config_atlassian_config_0_13_2.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_3_5_2.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_bucket_3_5_2.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_upgrade_3_5_2.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_confluence_plugin_func_test_2_3.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_core_atlassian_core_4_5_8.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_atlassian_user_1_2_4.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_hibernate2_1_2_4.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_api_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_core_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_events_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_api_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_common_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_rest_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_seraph22_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_ldap_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_password_encoders_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_persistence_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_remote_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_api_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_core_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_spi_2_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_event_atlassian_event_2_0_6.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_extras_atlassian_extras_2_4.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_gzipfilter_atlassian_gzipfilter_1_9.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_jdk_utilities_atlassian_jdk_utilities_0_4.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_johnson_atlassian_johnson_0_10.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_mail_atlassian_mail_1_16.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_modzdetector_modz_detector_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_multitenant_multitenant_core_1_0_m14.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_paddle_atlassian_paddle_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_core_2_7_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_2_7_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_events_2_7_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_servlet_2_7_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_spring_2_7_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webfragment_2_7_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webresource_2_7_5.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_profiling_atlassian_profiling_1_8_1.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_renderer_atlassian_renderer_7_0.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_sal_sal_api_2_4_1.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spi_2_4_1.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spring_2_4_1.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_cookie_tools_2_0.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_password_encoder_1_0.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_secure_random_1_0.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_core_2_3_1.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_seraph_integration_2_3_1.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_seraph_atlassian_seraph_2_4_0.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_2_0_rc4.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_hibernate2_2_0_rc4.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_trackback_atlassian_trackback_0_10.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_user_atlassian_user_3_0.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_util_concurrent_atlassian_util_concurrent_0_0_12.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_velocity_atlassian_velocity_0_7.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_10_1_12.xml delete mode 100644 confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_core_1_12.xml delete mode 100644 confluence/.idea/libraries/Maven__com_google_collections_google_collections_1_0.xml delete mode 100644 confluence/.idea/libraries/Maven__com_ibm_icu_icu4j_3_8.xml delete mode 100644 confluence/.idea/libraries/Maven__com_octo_captcha_jcaptcha_all_1_0_RC6.xml delete mode 100644 confluence/.idea/libraries/Maven__com_sun_jai_codec_1_1_3.xml delete mode 100644 confluence/.idea/libraries/Maven__com_sun_jai_core_1_1_3.xml delete mode 100644 confluence/.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_1_1.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_6_1.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_codec_commons_codec_1_4.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_collections_commons_collections_3_2.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_digester_commons_digester_1_5.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_discovery_commons_discovery_0_2.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_1.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_httpclient_commons_httpclient_3_0.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_io_commons_io_1_4.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_jrcs_commons_jrcs_diff_0_1_7.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_lang_commons_lang_2_4.xml delete mode 100644 confluence/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml delete mode 100644 confluence/.idea/libraries/Maven__concurrent_concurrent_1_3_4.xml delete mode 100644 confluence/.idea/libraries/Maven__dom4j_dom4j_1_4_full.xml delete mode 100644 confluence/.idea/libraries/Maven__exml_exml_7_1.xml delete mode 100644 confluence/.idea/libraries/Maven__glue_glue_5_0b2.xml delete mode 100644 confluence/.idea/libraries/Maven__hibernate_hibernate_2_1_8_atlassian_9.xml delete mode 100644 confluence/.idea/libraries/Maven__javax_activation_activation_1_0_2.xml delete mode 100644 confluence/.idea/libraries/Maven__javax_mail_mail_1_4_1.xml delete mode 100644 confluence/.idea/libraries/Maven__javax_servlet_servlet_api_2_4.xml delete mode 100644 confluence/.idea/libraries/Maven__javax_transaction_jta_1_0_1B.xml delete mode 100644 confluence/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml delete mode 100644 confluence/.idea/libraries/Maven__jdom_jdom_1_0.xml delete mode 100644 confluence/.idea/libraries/Maven__jfree_jcommon_1_0_0.xml delete mode 100644 confluence/.idea/libraries/Maven__jfree_jfreechart_1_0_0.xml delete mode 100644 confluence/.idea/libraries/Maven__joda_time_joda_time_1_6.xml delete mode 100644 confluence/.idea/libraries/Maven__junit_junit_4_6.xml delete mode 100644 confluence/.idea/libraries/Maven__log4j_log4j_1_2_15.xml delete mode 100644 confluence/.idea/libraries/Maven__mockobjects_alt_jdk1_3_0_07.xml delete mode 100644 confluence/.idea/libraries/Maven__mockobjects_mockobjects_alt_jdk1_3_j2ee1_3_0_09.xml delete mode 100644 confluence/.idea/libraries/Maven__net_java_dev_stax_utils_stax_utils_20040917.xml delete mode 100644 confluence/.idea/libraries/Maven__net_java_dev_urlrewrite_urlrewrite_2_6_0.xml delete mode 100644 confluence/.idea/libraries/Maven__net_jcip_jcip_annotations_1_0.xml delete mode 100644 confluence/.idea/libraries/Maven__net_sf_ehcache_ehcache_1_2_3.xml delete mode 100644 confluence/.idea/libraries/Maven__net_sf_ldaptemplate_ldaptemplate_1_0_1.xml delete mode 100644 confluence/.idea/libraries/Maven__net_sourceforge_cssparser_cssparser_0_9_5.xml delete mode 100644 confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_core_js_2_5.xml delete mode 100644 confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_core_2_2.xml delete mode 100644 confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_htmlunit_plugin_2_2.xml delete mode 100644 confluence/.idea/libraries/Maven__net_sourceforge_nekohtml_nekohtml_1_9_12.xml delete mode 100644 confluence/.idea/libraries/Maven__odmg_odmg_3_0.xml delete mode 100644 confluence/.idea/libraries/Maven__ognl_ognl_2_6_5_atlassian_2.xml delete mode 100644 confluence/.idea/libraries/Maven__opensymphony_oscore_2_2_7_atlassian_1.xml delete mode 100644 confluence/.idea/libraries/Maven__opensymphony_propertyset_1_3_21Nov03.xml delete mode 100644 confluence/.idea/libraries/Maven__opensymphony_sitemesh_2_3_atlassian.xml delete mode 100644 confluence/.idea/libraries/Maven__opensymphony_webwork_2_1_5_atlassian_2.xml delete mode 100644 confluence/.idea/libraries/Maven__opensymphony_xwork_1_0_3_2.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_felix_org_apache_felix_framework_3_0_2.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_lucene_lucene_analyzers_2_9_4.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_lucene_lucene_core_2_9_4.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_lucene_lucene_highlighter_2_9_4.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_lucene_lucene_memory_2_9_4.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_lucene_lucene_misc_2_9_4.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_pdfbox_fontbox_1_2_1.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_pdfbox_jempbox_1_2_1.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_pdfbox_pdfbox_1_2_1.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_poi_poi_3_5_FINAL.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_poi_poi_scratchpad_3_5_FINAL.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_velocity_velocity_1_6_1_atlassian_2.xml delete mode 100644 confluence/.idea/libraries/Maven__org_apache_ws_commons_XmlSchema_1_1.xml delete mode 100644 confluence/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_6_0.xml delete mode 100644 confluence/.idea/libraries/Maven__org_bouncycastle_bcmail_jdk15_1_44.xml delete mode 100644 confluence/.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15_1_44.xml delete mode 100644 confluence/.idea/libraries/Maven__org_codehaus_woodstox_wstx_asl_3_2_4.xml delete mode 100644 confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_aegis_1_2_6.xml delete mode 100644 confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_core_1_2_6.xml delete mode 100644 confluence/.idea/libraries/Maven__org_directwebremoting_dwr_2_0_3.xml delete mode 100644 confluence/.idea/libraries/Maven__org_hibernate_jtidy_r8_20060801.xml delete mode 100644 confluence/.idea/libraries/Maven__org_hsqldb_hsqldb_2_0_1_rc3_20110120.xml delete mode 100644 confluence/.idea/libraries/Maven__org_quartz_scheduler_quartz_1_8_0.xml delete mode 100644 confluence/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_5_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_ldap_spring_ldap_core_1_3_0_RELEASE.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_security_spring_security_core_2_0_4.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_aop_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_beans_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_context_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_core_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_dao_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_hibernate2_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_jdbc_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_jmx_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_support_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_springframework_spring_web_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__org_twdata_pkgscanner_package_scanner_0_9_5.xml delete mode 100644 confluence/.idea/libraries/Maven__org_w3c_css_sac_1_3.xml delete mode 100644 confluence/.idea/libraries/Maven__oro_oro_2_0_8.xml delete mode 100644 confluence/.idea/libraries/Maven__oscache_oscache_2_2.xml delete mode 100644 confluence/.idea/libraries/Maven__osuser_osuser_atl_user.xml delete mode 100644 confluence/.idea/libraries/Maven__radeox_radeox_1_0b2_forked_22Apr2004.xml delete mode 100644 confluence/.idea/libraries/Maven__regexp_regexp_1_3.xml delete mode 100644 confluence/.idea/libraries/Maven__rome_rome_1_0.xml delete mode 100644 confluence/.idea/libraries/Maven__slide_slide_2_1.xml delete mode 100644 confluence/.idea/libraries/Maven__velocity_tools_velocity_tools_view_1_1.xml delete mode 100644 confluence/.idea/libraries/Maven__wsdl4j_wsdl4j_1_5_1.xml delete mode 100644 confluence/.idea/libraries/Maven__xalan_xalan_2_7_0.xml delete mode 100644 confluence/.idea/libraries/Maven__xerces_xercesImpl_2_9_1.xml delete mode 100644 confluence/.idea/libraries/Maven__xmlrpc_xmlrpc_2_0_xmlrpc61_1_sbfix.xml delete mode 100644 confluence/.idea/libraries/Maven__xpp3_xpp3_min_1_1_3_4_O.xml delete mode 100644 confluence/.idea/misc.xml delete mode 100644 confluence/.idea/modules.xml delete mode 100644 confluence/.idea/scopes/scope_settings.xml delete mode 100644 confluence/.idea/uiDesigner.xml delete mode 100644 confluence/.idea/vcs.xml delete mode 100644 confluence/buildConfluenceLexer.xml delete mode 100644 confluence/confluence.iml delete mode 100644 confluence/pom.xml delete mode 100644 confluence/src/main/java/com/intellij/lexer/Foo.java delete mode 100644 confluence/src/main/java/com/intellij/psi/TokenType.java delete mode 100644 confluence/src/main/java/com/intellij/psi/tree/IElementType.java delete mode 100644 confluence/src/main/java/com/intellij/psi/tree/TokenSet.java delete mode 100644 confluence/src/main/java/com/intellij/util/text/CharArrayUtil.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/ConfluenceUtils.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/lexer/FlexLexer.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/lexer/JetHTMLMacro.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/lexer/JetKeywordToken.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/lexer/JetToken.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/tags/StyledDivTagType.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/tags/TagData.java delete mode 100644 confluence/src/main/java/org/jetbrains/jet/tags/TagType.java delete mode 100644 confluence/src/main/resources/atlassian-plugin.xml delete mode 100644 confluence/src/main/resources/kotlin.css delete mode 100644 confluence/src/main/resources/template.velocity delete mode 100644 confluence/src/main/resources/underline.gif delete mode 100644 confluence/src/test/java/org.jetbrains.jet.confluence/TestUtils.java delete mode 100644 confluence/src/test/java/org.jetbrains.jet.confluence/rendering/ConfluenceRenderingTest.java delete mode 100644 confluence/testData/rendering/elements/class.kt delete mode 100644 confluence/testData/rendering/elements/class.txt delete mode 100644 confluence/testData/rendering/elements/variable.kt delete mode 100644 confluence/testData/rendering/elements/variable.txt delete mode 100644 confluence/testData/rendering/elements/when.kt delete mode 100644 confluence/testData/rendering/elements/when.txt delete mode 100644 confluence/testData/rendering/examples/adress_book.kt delete mode 100644 confluence/testData/rendering/examples/adress_book.txt delete mode 100644 confluence/testData/rendering/examples/basic_syntax_define_a_function.kt delete mode 100644 confluence/testData/rendering/examples/basic_syntax_define_a_function.txt delete mode 100644 confluence/testData/rendering/examples/basic_syntax_define_a_variable.kt delete mode 100644 confluence/testData/rendering/examples/basic_syntax_define_a_variable.txt delete mode 100644 confluence/testData/rendering/examples/basic_syntax_null_checks.kt delete mode 100644 confluence/testData/rendering/examples/basic_syntax_null_checks.txt delete mode 100644 confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.kt delete mode 100644 confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.txt delete mode 100644 confluence/testData/rendering/examples/hello_world_a_multi_language_hello.kt delete mode 100644 confluence/testData/rendering/examples/hello_world_a_multi_language_hello.txt delete mode 100644 confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.kt delete mode 100644 confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.txt delete mode 100644 confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.kt delete mode 100644 confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.txt delete mode 100644 confluence/testData/rendering/examples/html_builder.kt delete mode 100644 confluence/testData/rendering/examples/html_builder.txt delete mode 100644 confluence/testData/rendering/examples/html_builder_with_refs.kt delete mode 100644 confluence/testData/rendering/examples/html_builder_with_refs.txt delete mode 100644 confluence/testData/rendering/examples/welcome_hello.kt delete mode 100644 confluence/testData/rendering/examples/welcome_hello.txt delete mode 100644 confluence/testData/rendering/tagTypes/a/a_closed_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/a/a_next_token_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/a/a_with_close_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/class/class_closed_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/class/class_next_token_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/class/class_with_close_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/label/label_closed_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/label/label_next_token_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/label/label_with_close_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/ref/ref_closed_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/ref/ref_next_token_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/ref/ref_with_close_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/style/style_closed_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/style/style_next_token_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/style/style_with_close_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/unresolved/unresolved_closed_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/unresolved/unresolved_next_token_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/unresolved/unresolved_with_close_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.txt delete mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.txt delete mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.kt delete mode 100644 confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.txt diff --git a/confluence/.idea/.name b/confluence/.idea/.name deleted file mode 100644 index 641844e16cf..00000000000 --- a/confluence/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -confluence \ No newline at end of file diff --git a/confluence/.idea/ant.xml b/confluence/.idea/ant.xml deleted file mode 100644 index dd6fe2b2026..00000000000 --- a/confluence/.idea/ant.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/confluence/.idea/compiler.xml b/confluence/.idea/compiler.xml deleted file mode 100644 index ef7bf86ef67..00000000000 --- a/confluence/.idea/compiler.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/confluence/.idea/copyright/profiles_settings.xml b/confluence/.idea/copyright/profiles_settings.xml deleted file mode 100644 index 3572571ad83..00000000000 --- a/confluence/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/confluence/.idea/encodings.xml b/confluence/.idea/encodings.xml deleted file mode 100644 index e206d70d859..00000000000 --- a/confluence/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/confluence/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml b/confluence/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml deleted file mode 100644 index 30ff5cb7910..00000000000 --- a/confluence/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__asm_asm_1_5_3.xml b/confluence/.idea/libraries/Maven__asm_asm_1_5_3.xml deleted file mode 100644 index a49e53040e1..00000000000 --- a/confluence/.idea/libraries/Maven__asm_asm_1_5_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__axis_axis_1_2_1.xml b/confluence/.idea/libraries/Maven__axis_axis_1_2_1.xml deleted file mode 100644 index 83151b16083..00000000000 --- a/confluence/.idea/libraries/Maven__axis_axis_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__axis_axis_jaxrpc_1_2_1_noqname.xml b/confluence/.idea/libraries/Maven__axis_axis_jaxrpc_1_2_1_noqname.xml deleted file mode 100644 index d11e10548a9..00000000000 --- a/confluence/.idea/libraries/Maven__axis_axis_jaxrpc_1_2_1_noqname.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__axis_axis_saaj_1_2_1.xml b/confluence/.idea/libraries/Maven__axis_axis_saaj_1_2_1.xml deleted file mode 100644 index 8bc7aecc07f..00000000000 --- a/confluence/.idea/libraries/Maven__axis_axis_saaj_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__batik_batik_all_1_6.xml b/confluence/.idea/libraries/Maven__batik_batik_all_1_6.xml deleted file mode 100644 index f975e07b255..00000000000 --- a/confluence/.idea/libraries/Maven__batik_batik_all_1_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__biz_aQute_bndlib_0_0_255.xml b/confluence/.idea/libraries/Maven__biz_aQute_bndlib_0_0_255.xml deleted file mode 100644 index b633f786b61..00000000000 --- a/confluence/.idea/libraries/Maven__biz_aQute_bndlib_0_0_255.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__c3p0_c3p0_0_9_1_2.xml b/confluence/.idea/libraries/Maven__c3p0_c3p0_0_9_1_2.xml deleted file mode 100644 index fead87ba590..00000000000 --- a/confluence/.idea/libraries/Maven__c3p0_c3p0_0_9_1_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__cglib_cglib_2_1_3.xml b/confluence/.idea/libraries/Maven__cglib_cglib_2_1_3.xml deleted file mode 100644 index 695f88a1984..00000000000 --- a/confluence/.idea/libraries/Maven__cglib_cglib_2_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_api_3_3.xml b/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_api_3_3.xml deleted file mode 100644 index bf37575377f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_api_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_host_3_3.xml b/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_host_3_3.xml deleted file mode 100644 index a3dcc7e2ba4..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_host_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_spi_3_3.xml b/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_spi_3_3.xml deleted file mode 100644 index 810155edf1d..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_spi_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_bandana_atlassian_bandana_3_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_bandana_atlassian_bandana_3_1.xml deleted file mode 100644 index e64fac4223b..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_bandana_atlassian_bandana_3_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_bonnie_atlassian_bonnie_4_0_beta3.xml b/confluence/.idea/libraries/Maven__com_atlassian_bonnie_atlassian_bonnie_4_0_beta3.xml deleted file mode 100644 index 7b1e7381588..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_bonnie_atlassian_bonnie_4_0_beta3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_api_0_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_api_0_1.xml deleted file mode 100644 index 34a2402f5ae..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_api_0_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_memory_0_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_memory_0_1.xml deleted file mode 100644 index 59d6db41a8f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_memory_0_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_config_atlassian_config_0_13_2.xml b/confluence/.idea/libraries/Maven__com_atlassian_config_atlassian_config_0_13_2.xml deleted file mode 100644 index 87f5dcc00c1..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_config_atlassian_config_0_13_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_3_5_2.xml b/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_3_5_2.xml deleted file mode 100644 index f17fbf7c403..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_3_5_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_bucket_3_5_2.xml b/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_bucket_3_5_2.xml deleted file mode 100644 index 091d76bd587..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_bucket_3_5_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_upgrade_3_5_2.xml b/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_upgrade_3_5_2.xml deleted file mode 100644 index 90c0559392f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_upgrade_3_5_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_confluence_plugin_func_test_2_3.xml b/confluence/.idea/libraries/Maven__com_atlassian_confluence_plugin_func_test_2_3.xml deleted file mode 100644 index e82ab109b8c..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_confluence_plugin_func_test_2_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_core_atlassian_core_4_5_8.xml b/confluence/.idea/libraries/Maven__com_atlassian_core_atlassian_core_4_5_8.xml deleted file mode 100644 index cfd18d8d624..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_core_atlassian_core_4_5_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_atlassian_user_1_2_4.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_atlassian_user_1_2_4.xml deleted file mode 100644 index cbdf725123d..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_atlassian_user_1_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_hibernate2_1_2_4.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_hibernate2_1_2_4.xml deleted file mode 100644 index 0cd4a7b64fc..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_hibernate2_1_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_api_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_api_2_2_5.xml deleted file mode 100644 index d8c40317dac..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_api_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_core_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_core_2_2_5.xml deleted file mode 100644 index 4aa5f018902..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_core_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_events_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_events_2_2_5.xml deleted file mode 100644 index 7664ee654d2..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_events_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_api_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_api_2_2_5.xml deleted file mode 100644 index 53ea19b4d17..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_api_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_common_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_common_2_2_5.xml deleted file mode 100644 index 529af400204..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_common_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_rest_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_rest_2_2_5.xml deleted file mode 100644 index f74a6608ca4..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_rest_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_seraph22_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_seraph22_2_2_5.xml deleted file mode 100644 index 360d223f6f0..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_seraph22_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_ldap_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_ldap_2_2_5.xml deleted file mode 100644 index 10c2112b0c4..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_ldap_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_password_encoders_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_password_encoders_2_2_5.xml deleted file mode 100644 index 4258ca8d5d2..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_password_encoders_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_persistence_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_persistence_2_2_5.xml deleted file mode 100644 index cffb9b55852..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_persistence_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_remote_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_remote_2_2_5.xml deleted file mode 100644 index d392762cd1d..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_remote_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_api_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_api_2_2_5.xml deleted file mode 100644 index 66a0205f936..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_api_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_core_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_core_2_2_5.xml deleted file mode 100644 index c41657dc139..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_core_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_spi_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_spi_2_2_5.xml deleted file mode 100644 index 2d1162b1585..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_spi_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_event_atlassian_event_2_0_6.xml b/confluence/.idea/libraries/Maven__com_atlassian_event_atlassian_event_2_0_6.xml deleted file mode 100644 index 39f13dc6687..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_event_atlassian_event_2_0_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_extras_atlassian_extras_2_4.xml b/confluence/.idea/libraries/Maven__com_atlassian_extras_atlassian_extras_2_4.xml deleted file mode 100644 index b153e22cc07..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_extras_atlassian_extras_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_gzipfilter_atlassian_gzipfilter_1_9.xml b/confluence/.idea/libraries/Maven__com_atlassian_gzipfilter_atlassian_gzipfilter_1_9.xml deleted file mode 100644 index 31a3f7bc602..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_gzipfilter_atlassian_gzipfilter_1_9.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_jdk_utilities_atlassian_jdk_utilities_0_4.xml b/confluence/.idea/libraries/Maven__com_atlassian_jdk_utilities_atlassian_jdk_utilities_0_4.xml deleted file mode 100644 index 96ceaa2d0f7..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_jdk_utilities_atlassian_jdk_utilities_0_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_johnson_atlassian_johnson_0_10.xml b/confluence/.idea/libraries/Maven__com_atlassian_johnson_atlassian_johnson_0_10.xml deleted file mode 100644 index 7788d1bb35a..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_johnson_atlassian_johnson_0_10.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_mail_atlassian_mail_1_16.xml b/confluence/.idea/libraries/Maven__com_atlassian_mail_atlassian_mail_1_16.xml deleted file mode 100644 index d9cf6de183d..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_mail_atlassian_mail_1_16.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_modzdetector_modz_detector_0_8.xml b/confluence/.idea/libraries/Maven__com_atlassian_modzdetector_modz_detector_0_8.xml deleted file mode 100644 index 1df9d471489..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_modzdetector_modz_detector_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_multitenant_multitenant_core_1_0_m14.xml b/confluence/.idea/libraries/Maven__com_atlassian_multitenant_multitenant_core_1_0_m14.xml deleted file mode 100644 index 1cd3f72458a..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_multitenant_multitenant_core_1_0_m14.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_paddle_atlassian_paddle_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_paddle_atlassian_paddle_5.xml deleted file mode 100644 index 8245219467b..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_paddle_atlassian_paddle_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_core_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_core_2_7_5.xml deleted file mode 100644 index 1546384ac29..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_core_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_2_7_5.xml deleted file mode 100644 index 9f2804ae12f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_events_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_events_2_7_5.xml deleted file mode 100644 index 41a92f72ce7..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_events_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_servlet_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_servlet_2_7_5.xml deleted file mode 100644 index 18629e0ff64..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_servlet_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_spring_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_spring_2_7_5.xml deleted file mode 100644 index 54bf42682d7..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_spring_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webfragment_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webfragment_2_7_5.xml deleted file mode 100644 index fee47bcd0ca..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webfragment_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webresource_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webresource_2_7_5.xml deleted file mode 100644 index 2ba848a77c9..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webresource_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_profiling_atlassian_profiling_1_8_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_profiling_atlassian_profiling_1_8_1.xml deleted file mode 100644 index b216e4057ec..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_profiling_atlassian_profiling_1_8_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_renderer_atlassian_renderer_7_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_renderer_atlassian_renderer_7_0.xml deleted file mode 100644 index a8ba7383f37..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_renderer_atlassian_renderer_7_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_api_2_4_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_api_2_4_1.xml deleted file mode 100644 index 8d0011156b3..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_api_2_4_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spi_2_4_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spi_2_4_1.xml deleted file mode 100644 index 279daafd63f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spi_2_4_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spring_2_4_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spring_2_4_1.xml deleted file mode 100644 index e3e2ba59db0..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spring_2_4_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_cookie_tools_2_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_cookie_tools_2_0.xml deleted file mode 100644 index 70325f6137b..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_cookie_tools_2_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_password_encoder_1_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_password_encoder_1_0.xml deleted file mode 100644 index aa41220ed4f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_password_encoder_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_secure_random_1_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_secure_random_1_0.xml deleted file mode 100644 index 6d2cc1eae20..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_secure_random_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_core_2_3_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_core_2_3_1.xml deleted file mode 100644 index 1ec036ac7b1..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_core_2_3_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_seraph_integration_2_3_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_seraph_integration_2_3_1.xml deleted file mode 100644 index c91f8761cab..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_seraph_integration_2_3_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_seraph_atlassian_seraph_2_4_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_seraph_atlassian_seraph_2_4_0.xml deleted file mode 100644 index 40a4bab2067..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_seraph_atlassian_seraph_2_4_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_2_0_rc4.xml b/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_2_0_rc4.xml deleted file mode 100644 index 8003ee74811..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_2_0_rc4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_hibernate2_2_0_rc4.xml b/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_hibernate2_2_0_rc4.xml deleted file mode 100644 index 36f4ed56d38..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_hibernate2_2_0_rc4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_trackback_atlassian_trackback_0_10.xml b/confluence/.idea/libraries/Maven__com_atlassian_trackback_atlassian_trackback_0_10.xml deleted file mode 100644 index f352cd0ecb5..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_trackback_atlassian_trackback_0_10.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_user_atlassian_user_3_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_user_atlassian_user_3_0.xml deleted file mode 100644 index 3cb142dc08c..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_user_atlassian_user_3_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_util_concurrent_atlassian_util_concurrent_0_0_12.xml b/confluence/.idea/libraries/Maven__com_atlassian_util_concurrent_atlassian_util_concurrent_0_0_12.xml deleted file mode 100644 index 925d72941f6..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_util_concurrent_atlassian_util_concurrent_0_0_12.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_velocity_atlassian_velocity_0_7.xml b/confluence/.idea/libraries/Maven__com_atlassian_velocity_atlassian_velocity_0_7.xml deleted file mode 100644 index d27f0335686..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_velocity_atlassian_velocity_0_7.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_10_1_12.xml b/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_10_1_12.xml deleted file mode 100644 index c431c7acdb4..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_10_1_12.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_core_1_12.xml b/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_core_1_12.xml deleted file mode 100644 index f219928f738..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_core_1_12.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_google_collections_google_collections_1_0.xml b/confluence/.idea/libraries/Maven__com_google_collections_google_collections_1_0.xml deleted file mode 100644 index 7ed5d20e2d4..00000000000 --- a/confluence/.idea/libraries/Maven__com_google_collections_google_collections_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_ibm_icu_icu4j_3_8.xml b/confluence/.idea/libraries/Maven__com_ibm_icu_icu4j_3_8.xml deleted file mode 100644 index 0114a3f52a8..00000000000 --- a/confluence/.idea/libraries/Maven__com_ibm_icu_icu4j_3_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_octo_captcha_jcaptcha_all_1_0_RC6.xml b/confluence/.idea/libraries/Maven__com_octo_captcha_jcaptcha_all_1_0_RC6.xml deleted file mode 100644 index 3fffc2c735a..00000000000 --- a/confluence/.idea/libraries/Maven__com_octo_captcha_jcaptcha_all_1_0_RC6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_sun_jai_codec_1_1_3.xml b/confluence/.idea/libraries/Maven__com_sun_jai_codec_1_1_3.xml deleted file mode 100644 index 4321ce3251d..00000000000 --- a/confluence/.idea/libraries/Maven__com_sun_jai_codec_1_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_sun_jai_core_1_1_3.xml b/confluence/.idea/libraries/Maven__com_sun_jai_core_1_1_3.xml deleted file mode 100644 index a998f2fe81f..00000000000 --- a/confluence/.idea/libraries/Maven__com_sun_jai_core_1_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_1_1.xml b/confluence/.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_1_1.xml deleted file mode 100644 index 71b652fb682..00000000000 --- a/confluence/.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_6_1.xml b/confluence/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_6_1.xml deleted file mode 100644 index 6eeab12ce6d..00000000000 --- a/confluence/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_6_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_codec_commons_codec_1_4.xml b/confluence/.idea/libraries/Maven__commons_codec_commons_codec_1_4.xml deleted file mode 100644 index 2b149c4de28..00000000000 --- a/confluence/.idea/libraries/Maven__commons_codec_commons_codec_1_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_collections_commons_collections_3_2.xml b/confluence/.idea/libraries/Maven__commons_collections_commons_collections_3_2.xml deleted file mode 100644 index 73b28f310bf..00000000000 --- a/confluence/.idea/libraries/Maven__commons_collections_commons_collections_3_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_digester_commons_digester_1_5.xml b/confluence/.idea/libraries/Maven__commons_digester_commons_digester_1_5.xml deleted file mode 100644 index 4a947b08dc1..00000000000 --- a/confluence/.idea/libraries/Maven__commons_digester_commons_digester_1_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_discovery_commons_discovery_0_2.xml b/confluence/.idea/libraries/Maven__commons_discovery_commons_discovery_0_2.xml deleted file mode 100644 index 5c97345cafe..00000000000 --- a/confluence/.idea/libraries/Maven__commons_discovery_commons_discovery_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_1.xml b/confluence/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_1.xml deleted file mode 100644 index e59b3ef50cb..00000000000 --- a/confluence/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_httpclient_commons_httpclient_3_0.xml b/confluence/.idea/libraries/Maven__commons_httpclient_commons_httpclient_3_0.xml deleted file mode 100644 index cc22b931de6..00000000000 --- a/confluence/.idea/libraries/Maven__commons_httpclient_commons_httpclient_3_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_io_commons_io_1_4.xml b/confluence/.idea/libraries/Maven__commons_io_commons_io_1_4.xml deleted file mode 100644 index 054eda88eed..00000000000 --- a/confluence/.idea/libraries/Maven__commons_io_commons_io_1_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_jrcs_commons_jrcs_diff_0_1_7.xml b/confluence/.idea/libraries/Maven__commons_jrcs_commons_jrcs_diff_0_1_7.xml deleted file mode 100644 index a16dd40f37b..00000000000 --- a/confluence/.idea/libraries/Maven__commons_jrcs_commons_jrcs_diff_0_1_7.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_lang_commons_lang_2_4.xml b/confluence/.idea/libraries/Maven__commons_lang_commons_lang_2_4.xml deleted file mode 100644 index 5e8b8d3352e..00000000000 --- a/confluence/.idea/libraries/Maven__commons_lang_commons_lang_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml b/confluence/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml deleted file mode 100644 index b770f56aa97..00000000000 --- a/confluence/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__concurrent_concurrent_1_3_4.xml b/confluence/.idea/libraries/Maven__concurrent_concurrent_1_3_4.xml deleted file mode 100644 index 4acbd2f600b..00000000000 --- a/confluence/.idea/libraries/Maven__concurrent_concurrent_1_3_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__dom4j_dom4j_1_4_full.xml b/confluence/.idea/libraries/Maven__dom4j_dom4j_1_4_full.xml deleted file mode 100644 index 8fdc45e28b5..00000000000 --- a/confluence/.idea/libraries/Maven__dom4j_dom4j_1_4_full.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__exml_exml_7_1.xml b/confluence/.idea/libraries/Maven__exml_exml_7_1.xml deleted file mode 100644 index ec25f4e832e..00000000000 --- a/confluence/.idea/libraries/Maven__exml_exml_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__glue_glue_5_0b2.xml b/confluence/.idea/libraries/Maven__glue_glue_5_0b2.xml deleted file mode 100644 index ceb3b310327..00000000000 --- a/confluence/.idea/libraries/Maven__glue_glue_5_0b2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__hibernate_hibernate_2_1_8_atlassian_9.xml b/confluence/.idea/libraries/Maven__hibernate_hibernate_2_1_8_atlassian_9.xml deleted file mode 100644 index 86441b1755a..00000000000 --- a/confluence/.idea/libraries/Maven__hibernate_hibernate_2_1_8_atlassian_9.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_activation_activation_1_0_2.xml b/confluence/.idea/libraries/Maven__javax_activation_activation_1_0_2.xml deleted file mode 100644 index f453d9b23f6..00000000000 --- a/confluence/.idea/libraries/Maven__javax_activation_activation_1_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_mail_mail_1_4_1.xml b/confluence/.idea/libraries/Maven__javax_mail_mail_1_4_1.xml deleted file mode 100644 index 2c155f3a1fb..00000000000 --- a/confluence/.idea/libraries/Maven__javax_mail_mail_1_4_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_servlet_servlet_api_2_4.xml b/confluence/.idea/libraries/Maven__javax_servlet_servlet_api_2_4.xml deleted file mode 100644 index eb1ede25488..00000000000 --- a/confluence/.idea/libraries/Maven__javax_servlet_servlet_api_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_transaction_jta_1_0_1B.xml b/confluence/.idea/libraries/Maven__javax_transaction_jta_1_0_1B.xml deleted file mode 100644 index 391fe350a14..00000000000 --- a/confluence/.idea/libraries/Maven__javax_transaction_jta_1_0_1B.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml b/confluence/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml deleted file mode 100644 index 2a4dd7a2e50..00000000000 --- a/confluence/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__jdom_jdom_1_0.xml b/confluence/.idea/libraries/Maven__jdom_jdom_1_0.xml deleted file mode 100644 index 3349d675fba..00000000000 --- a/confluence/.idea/libraries/Maven__jdom_jdom_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__jfree_jcommon_1_0_0.xml b/confluence/.idea/libraries/Maven__jfree_jcommon_1_0_0.xml deleted file mode 100644 index 733dc3fcb8d..00000000000 --- a/confluence/.idea/libraries/Maven__jfree_jcommon_1_0_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__jfree_jfreechart_1_0_0.xml b/confluence/.idea/libraries/Maven__jfree_jfreechart_1_0_0.xml deleted file mode 100644 index 4654abe6fd5..00000000000 --- a/confluence/.idea/libraries/Maven__jfree_jfreechart_1_0_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__joda_time_joda_time_1_6.xml b/confluence/.idea/libraries/Maven__joda_time_joda_time_1_6.xml deleted file mode 100644 index a6fe1789647..00000000000 --- a/confluence/.idea/libraries/Maven__joda_time_joda_time_1_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__junit_junit_4_6.xml b/confluence/.idea/libraries/Maven__junit_junit_4_6.xml deleted file mode 100644 index 07e29e2f84c..00000000000 --- a/confluence/.idea/libraries/Maven__junit_junit_4_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__log4j_log4j_1_2_15.xml b/confluence/.idea/libraries/Maven__log4j_log4j_1_2_15.xml deleted file mode 100644 index c6024af8c41..00000000000 --- a/confluence/.idea/libraries/Maven__log4j_log4j_1_2_15.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__mockobjects_alt_jdk1_3_0_07.xml b/confluence/.idea/libraries/Maven__mockobjects_alt_jdk1_3_0_07.xml deleted file mode 100644 index a56dde5b819..00000000000 --- a/confluence/.idea/libraries/Maven__mockobjects_alt_jdk1_3_0_07.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__mockobjects_mockobjects_alt_jdk1_3_j2ee1_3_0_09.xml b/confluence/.idea/libraries/Maven__mockobjects_mockobjects_alt_jdk1_3_j2ee1_3_0_09.xml deleted file mode 100644 index 2ccb999080b..00000000000 --- a/confluence/.idea/libraries/Maven__mockobjects_mockobjects_alt_jdk1_3_j2ee1_3_0_09.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_java_dev_stax_utils_stax_utils_20040917.xml b/confluence/.idea/libraries/Maven__net_java_dev_stax_utils_stax_utils_20040917.xml deleted file mode 100644 index f0e2ad5477a..00000000000 --- a/confluence/.idea/libraries/Maven__net_java_dev_stax_utils_stax_utils_20040917.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_java_dev_urlrewrite_urlrewrite_2_6_0.xml b/confluence/.idea/libraries/Maven__net_java_dev_urlrewrite_urlrewrite_2_6_0.xml deleted file mode 100644 index 1448e838ad1..00000000000 --- a/confluence/.idea/libraries/Maven__net_java_dev_urlrewrite_urlrewrite_2_6_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_jcip_jcip_annotations_1_0.xml b/confluence/.idea/libraries/Maven__net_jcip_jcip_annotations_1_0.xml deleted file mode 100644 index d29c82f6b50..00000000000 --- a/confluence/.idea/libraries/Maven__net_jcip_jcip_annotations_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sf_ehcache_ehcache_1_2_3.xml b/confluence/.idea/libraries/Maven__net_sf_ehcache_ehcache_1_2_3.xml deleted file mode 100644 index cf5103197c9..00000000000 --- a/confluence/.idea/libraries/Maven__net_sf_ehcache_ehcache_1_2_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sf_ldaptemplate_ldaptemplate_1_0_1.xml b/confluence/.idea/libraries/Maven__net_sf_ldaptemplate_ldaptemplate_1_0_1.xml deleted file mode 100644 index a2c0de98286..00000000000 --- a/confluence/.idea/libraries/Maven__net_sf_ldaptemplate_ldaptemplate_1_0_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_cssparser_cssparser_0_9_5.xml b/confluence/.idea/libraries/Maven__net_sourceforge_cssparser_cssparser_0_9_5.xml deleted file mode 100644 index 8507f2ff7a5..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_cssparser_cssparser_0_9_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_2_5.xml b/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_2_5.xml deleted file mode 100644 index d048fd28e28..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_core_js_2_5.xml b/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_core_js_2_5.xml deleted file mode 100644 index 82aa83f6c78..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_core_js_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_core_2_2.xml b/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_core_2_2.xml deleted file mode 100644 index acecc6cc5e9..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_core_2_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_htmlunit_plugin_2_2.xml b/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_htmlunit_plugin_2_2.xml deleted file mode 100644 index 0e1015a0711..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_htmlunit_plugin_2_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_nekohtml_nekohtml_1_9_12.xml b/confluence/.idea/libraries/Maven__net_sourceforge_nekohtml_nekohtml_1_9_12.xml deleted file mode 100644 index 33a21fc9d4e..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_nekohtml_nekohtml_1_9_12.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__odmg_odmg_3_0.xml b/confluence/.idea/libraries/Maven__odmg_odmg_3_0.xml deleted file mode 100644 index a7d4eb22a47..00000000000 --- a/confluence/.idea/libraries/Maven__odmg_odmg_3_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__ognl_ognl_2_6_5_atlassian_2.xml b/confluence/.idea/libraries/Maven__ognl_ognl_2_6_5_atlassian_2.xml deleted file mode 100644 index 9a80fd09d55..00000000000 --- a/confluence/.idea/libraries/Maven__ognl_ognl_2_6_5_atlassian_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_oscore_2_2_7_atlassian_1.xml b/confluence/.idea/libraries/Maven__opensymphony_oscore_2_2_7_atlassian_1.xml deleted file mode 100644 index c5425dc436c..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_oscore_2_2_7_atlassian_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_propertyset_1_3_21Nov03.xml b/confluence/.idea/libraries/Maven__opensymphony_propertyset_1_3_21Nov03.xml deleted file mode 100644 index 86a7bea7d32..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_propertyset_1_3_21Nov03.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_sitemesh_2_3_atlassian.xml b/confluence/.idea/libraries/Maven__opensymphony_sitemesh_2_3_atlassian.xml deleted file mode 100644 index 7fbff89fba9..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_sitemesh_2_3_atlassian.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_webwork_2_1_5_atlassian_2.xml b/confluence/.idea/libraries/Maven__opensymphony_webwork_2_1_5_atlassian_2.xml deleted file mode 100644 index 0e1be0423d2..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_webwork_2_1_5_atlassian_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_xwork_1_0_3_2.xml b/confluence/.idea/libraries/Maven__opensymphony_xwork_1_0_3_2.xml deleted file mode 100644 index a298796d89c..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_xwork_1_0_3_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_felix_org_apache_felix_framework_3_0_2.xml b/confluence/.idea/libraries/Maven__org_apache_felix_org_apache_felix_framework_3_0_2.xml deleted file mode 100644 index 35187e5a7b1..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_felix_org_apache_felix_framework_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_analyzers_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_analyzers_2_9_4.xml deleted file mode 100644 index 2a5bcd5cf3f..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_analyzers_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_core_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_core_2_9_4.xml deleted file mode 100644 index 363169fa2a7..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_core_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_highlighter_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_highlighter_2_9_4.xml deleted file mode 100644 index 9e0a268aecd..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_highlighter_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_memory_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_memory_2_9_4.xml deleted file mode 100644 index def13b2aacb..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_memory_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_misc_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_misc_2_9_4.xml deleted file mode 100644 index 1cbb369e41f..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_misc_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_pdfbox_fontbox_1_2_1.xml b/confluence/.idea/libraries/Maven__org_apache_pdfbox_fontbox_1_2_1.xml deleted file mode 100644 index d933e74a706..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_pdfbox_fontbox_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_pdfbox_jempbox_1_2_1.xml b/confluence/.idea/libraries/Maven__org_apache_pdfbox_jempbox_1_2_1.xml deleted file mode 100644 index 84402967e7c..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_pdfbox_jempbox_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_pdfbox_pdfbox_1_2_1.xml b/confluence/.idea/libraries/Maven__org_apache_pdfbox_pdfbox_1_2_1.xml deleted file mode 100644 index 52eabfa6d7c..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_pdfbox_pdfbox_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_poi_poi_3_5_FINAL.xml b/confluence/.idea/libraries/Maven__org_apache_poi_poi_3_5_FINAL.xml deleted file mode 100644 index 2d22ab1c178..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_poi_poi_3_5_FINAL.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_poi_poi_scratchpad_3_5_FINAL.xml b/confluence/.idea/libraries/Maven__org_apache_poi_poi_scratchpad_3_5_FINAL.xml deleted file mode 100644 index 947dd72cbd8..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_poi_poi_scratchpad_3_5_FINAL.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_velocity_velocity_1_6_1_atlassian_2.xml b/confluence/.idea/libraries/Maven__org_apache_velocity_velocity_1_6_1_atlassian_2.xml deleted file mode 100644 index 2aa6e213d2c..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_velocity_velocity_1_6_1_atlassian_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_ws_commons_XmlSchema_1_1.xml b/confluence/.idea/libraries/Maven__org_apache_ws_commons_XmlSchema_1_1.xml deleted file mode 100644 index 6b5c280edec..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_ws_commons_XmlSchema_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_6_0.xml b/confluence/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_6_0.xml deleted file mode 100644 index e16d50af933..00000000000 --- a/confluence/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_6_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_bouncycastle_bcmail_jdk15_1_44.xml b/confluence/.idea/libraries/Maven__org_bouncycastle_bcmail_jdk15_1_44.xml deleted file mode 100644 index cb97b14d799..00000000000 --- a/confluence/.idea/libraries/Maven__org_bouncycastle_bcmail_jdk15_1_44.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15_1_44.xml b/confluence/.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15_1_44.xml deleted file mode 100644 index 8f000654d01..00000000000 --- a/confluence/.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15_1_44.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_codehaus_woodstox_wstx_asl_3_2_4.xml b/confluence/.idea/libraries/Maven__org_codehaus_woodstox_wstx_asl_3_2_4.xml deleted file mode 100644 index 1f1ad72371f..00000000000 --- a/confluence/.idea/libraries/Maven__org_codehaus_woodstox_wstx_asl_3_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_aegis_1_2_6.xml b/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_aegis_1_2_6.xml deleted file mode 100644 index 8d9f879fdbe..00000000000 --- a/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_aegis_1_2_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_core_1_2_6.xml b/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_core_1_2_6.xml deleted file mode 100644 index c3ded8bb4e9..00000000000 --- a/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_core_1_2_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_directwebremoting_dwr_2_0_3.xml b/confluence/.idea/libraries/Maven__org_directwebremoting_dwr_2_0_3.xml deleted file mode 100644 index d45d92ae360..00000000000 --- a/confluence/.idea/libraries/Maven__org_directwebremoting_dwr_2_0_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_hibernate_jtidy_r8_20060801.xml b/confluence/.idea/libraries/Maven__org_hibernate_jtidy_r8_20060801.xml deleted file mode 100644 index 028d1c29400..00000000000 --- a/confluence/.idea/libraries/Maven__org_hibernate_jtidy_r8_20060801.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_hsqldb_hsqldb_2_0_1_rc3_20110120.xml b/confluence/.idea/libraries/Maven__org_hsqldb_hsqldb_2_0_1_rc3_20110120.xml deleted file mode 100644 index 95d8490ecc5..00000000000 --- a/confluence/.idea/libraries/Maven__org_hsqldb_hsqldb_2_0_1_rc3_20110120.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_quartz_scheduler_quartz_1_8_0.xml b/confluence/.idea/libraries/Maven__org_quartz_scheduler_quartz_1_8_0.xml deleted file mode 100644 index 6422eb2e1dc..00000000000 --- a/confluence/.idea/libraries/Maven__org_quartz_scheduler_quartz_1_8_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_5_8.xml b/confluence/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_5_8.xml deleted file mode 100644 index 7ca6a1766ba..00000000000 --- a/confluence/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_5_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml b/confluence/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml deleted file mode 100644 index 0ea470ab5b1..00000000000 --- a/confluence/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml b/confluence/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml deleted file mode 100644 index f4725a3b778..00000000000 --- a/confluence/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_ldap_spring_ldap_core_1_3_0_RELEASE.xml b/confluence/.idea/libraries/Maven__org_springframework_ldap_spring_ldap_core_1_3_0_RELEASE.xml deleted file mode 100644 index 65e4636d24e..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_ldap_spring_ldap_core_1_3_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_security_spring_security_core_2_0_4.xml b/confluence/.idea/libraries/Maven__org_springframework_security_spring_security_core_2_0_4.xml deleted file mode 100644 index 45c36e70cdd..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_security_spring_security_core_2_0_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_aop_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_aop_2_0_8.xml deleted file mode 100644 index 89af56e4970..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_aop_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_beans_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_beans_2_0_8.xml deleted file mode 100644 index 18d4c2d1a4d..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_beans_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_context_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_context_2_0_8.xml deleted file mode 100644 index 87d78470b5c..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_context_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_core_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_core_2_0_8.xml deleted file mode 100644 index d5a5a6f81e5..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_core_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_dao_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_dao_2_0_8.xml deleted file mode 100644 index 776aeb1154f..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_dao_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_hibernate2_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_hibernate2_2_0_8.xml deleted file mode 100644 index 57208898cb7..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_hibernate2_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_jdbc_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_jdbc_2_0_8.xml deleted file mode 100644 index 92ca83b798b..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_jdbc_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_jmx_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_jmx_2_0_8.xml deleted file mode 100644 index 0815200a9c3..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_jmx_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_support_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_support_2_0_8.xml deleted file mode 100644 index ffcdcd9e117..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_support_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_web_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_web_2_0_8.xml deleted file mode 100644 index efc445d2e4b..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_web_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_twdata_pkgscanner_package_scanner_0_9_5.xml b/confluence/.idea/libraries/Maven__org_twdata_pkgscanner_package_scanner_0_9_5.xml deleted file mode 100644 index 80467858203..00000000000 --- a/confluence/.idea/libraries/Maven__org_twdata_pkgscanner_package_scanner_0_9_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_w3c_css_sac_1_3.xml b/confluence/.idea/libraries/Maven__org_w3c_css_sac_1_3.xml deleted file mode 100644 index af3d414615d..00000000000 --- a/confluence/.idea/libraries/Maven__org_w3c_css_sac_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__oro_oro_2_0_8.xml b/confluence/.idea/libraries/Maven__oro_oro_2_0_8.xml deleted file mode 100644 index 25203a04f0f..00000000000 --- a/confluence/.idea/libraries/Maven__oro_oro_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__oscache_oscache_2_2.xml b/confluence/.idea/libraries/Maven__oscache_oscache_2_2.xml deleted file mode 100644 index 12991d7e7e4..00000000000 --- a/confluence/.idea/libraries/Maven__oscache_oscache_2_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__osuser_osuser_atl_user.xml b/confluence/.idea/libraries/Maven__osuser_osuser_atl_user.xml deleted file mode 100644 index 23332027435..00000000000 --- a/confluence/.idea/libraries/Maven__osuser_osuser_atl_user.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__radeox_radeox_1_0b2_forked_22Apr2004.xml b/confluence/.idea/libraries/Maven__radeox_radeox_1_0b2_forked_22Apr2004.xml deleted file mode 100644 index 1106eb96510..00000000000 --- a/confluence/.idea/libraries/Maven__radeox_radeox_1_0b2_forked_22Apr2004.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__regexp_regexp_1_3.xml b/confluence/.idea/libraries/Maven__regexp_regexp_1_3.xml deleted file mode 100644 index cdc06b6bc25..00000000000 --- a/confluence/.idea/libraries/Maven__regexp_regexp_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__rome_rome_1_0.xml b/confluence/.idea/libraries/Maven__rome_rome_1_0.xml deleted file mode 100644 index ca0e345b951..00000000000 --- a/confluence/.idea/libraries/Maven__rome_rome_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__slide_slide_2_1.xml b/confluence/.idea/libraries/Maven__slide_slide_2_1.xml deleted file mode 100644 index be3fddd5c9a..00000000000 --- a/confluence/.idea/libraries/Maven__slide_slide_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__velocity_tools_velocity_tools_view_1_1.xml b/confluence/.idea/libraries/Maven__velocity_tools_velocity_tools_view_1_1.xml deleted file mode 100644 index c61c8f94c7b..00000000000 --- a/confluence/.idea/libraries/Maven__velocity_tools_velocity_tools_view_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__wsdl4j_wsdl4j_1_5_1.xml b/confluence/.idea/libraries/Maven__wsdl4j_wsdl4j_1_5_1.xml deleted file mode 100644 index 24358f07910..00000000000 --- a/confluence/.idea/libraries/Maven__wsdl4j_wsdl4j_1_5_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__xalan_xalan_2_7_0.xml b/confluence/.idea/libraries/Maven__xalan_xalan_2_7_0.xml deleted file mode 100644 index dd647b424bd..00000000000 --- a/confluence/.idea/libraries/Maven__xalan_xalan_2_7_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__xerces_xercesImpl_2_9_1.xml b/confluence/.idea/libraries/Maven__xerces_xercesImpl_2_9_1.xml deleted file mode 100644 index 19d39dba853..00000000000 --- a/confluence/.idea/libraries/Maven__xerces_xercesImpl_2_9_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__xmlrpc_xmlrpc_2_0_xmlrpc61_1_sbfix.xml b/confluence/.idea/libraries/Maven__xmlrpc_xmlrpc_2_0_xmlrpc61_1_sbfix.xml deleted file mode 100644 index ad2bb2b85a1..00000000000 --- a/confluence/.idea/libraries/Maven__xmlrpc_xmlrpc_2_0_xmlrpc61_1_sbfix.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__xpp3_xpp3_min_1_1_3_4_O.xml b/confluence/.idea/libraries/Maven__xpp3_xpp3_min_1_1_3_4_O.xml deleted file mode 100644 index 4cc7a5ed4a6..00000000000 --- a/confluence/.idea/libraries/Maven__xpp3_xpp3_min_1_1_3_4_O.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/misc.xml b/confluence/.idea/misc.xml deleted file mode 100644 index aed7c788205..00000000000 --- a/confluence/.idea/misc.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - http://www.w3.org/1999/xhtml - - - - - - - - - - - 1.6 - - - - - - - - - diff --git a/confluence/.idea/modules.xml b/confluence/.idea/modules.xml deleted file mode 100644 index e570ef2b587..00000000000 --- a/confluence/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/confluence/.idea/scopes/scope_settings.xml b/confluence/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b8433..00000000000 --- a/confluence/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/confluence/.idea/uiDesigner.xml b/confluence/.idea/uiDesigner.xml deleted file mode 100644 index 3b000203088..00000000000 --- a/confluence/.idea/uiDesigner.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/confluence/.idea/vcs.xml b/confluence/.idea/vcs.xml deleted file mode 100644 index 21cbaa607b2..00000000000 --- a/confluence/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/confluence/buildConfluenceLexer.xml b/confluence/buildConfluenceLexer.xml deleted file mode 100644 index 3d22623e2ed..00000000000 --- a/confluence/buildConfluenceLexer.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/confluence.iml b/confluence/confluence.iml deleted file mode 100644 index b7031cfb474..00000000000 --- a/confluence/confluence.iml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/confluence/pom.xml b/confluence/pom.xml deleted file mode 100644 index b3712802bcb..00000000000 --- a/confluence/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - 4.0.0 - org.jetbrains.jet - confluence - 1.0 - - - JetBrains - http://www.jetbrains.com/ - - - confluence - Confluence support for Kotlin language. - atlassian-plugin - - - - junit - junit - 4.6 - test - - - com.atlassian.confluence - confluence - ${confluence.version} - provided - - - com.atlassian.confluence.plugin - func-test - 2.3 - test - - - net.sourceforge.jwebunit - jwebunit-htmlunit-plugin - 2.2 - test - - - net.sourceforge.nekohtml - nekohtml - 1.9.12 - test - - - - - - - com.atlassian.maven.plugins - maven-confluence-plugin - 3.3.4 - true - - ${confluence.version} - ${confluence.data.version} - - - - maven-compiler-plugin - - 1.6 - 1.6 - - - - - - - 3.5.2 - 3.5 - - - diff --git a/confluence/src/main/java/com/intellij/lexer/Foo.java b/confluence/src/main/java/com/intellij/lexer/Foo.java deleted file mode 100644 index afacc1e12c5..00000000000 --- a/confluence/src/main/java/com/intellij/lexer/Foo.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.intellij.lexer; - -/** - * @author abreslav - */ -public class Foo { -} diff --git a/confluence/src/main/java/com/intellij/psi/TokenType.java b/confluence/src/main/java/com/intellij/psi/TokenType.java deleted file mode 100644 index a596523ae06..00000000000 --- a/confluence/src/main/java/com/intellij/psi/TokenType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.intellij.psi; - -import com.intellij.psi.tree.IElementType; - -/** - * @author abreslav - */ -public class TokenType { - public static final IElementType WHITE_SPACE = new IElementType(); - public static final IElementType BAD_CHARACTER = new IElementType(); -} diff --git a/confluence/src/main/java/com/intellij/psi/tree/IElementType.java b/confluence/src/main/java/com/intellij/psi/tree/IElementType.java deleted file mode 100644 index 58b6394c1ca..00000000000 --- a/confluence/src/main/java/com/intellij/psi/tree/IElementType.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.intellij.psi.tree; - -/** - * @author abreslav - */ -public class IElementType { -} diff --git a/confluence/src/main/java/com/intellij/psi/tree/TokenSet.java b/confluence/src/main/java/com/intellij/psi/tree/TokenSet.java deleted file mode 100644 index aa29a84d471..00000000000 --- a/confluence/src/main/java/com/intellij/psi/tree/TokenSet.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.intellij.psi.tree; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** - * @author abreslav - */ -public class TokenSet { - public static TokenSet create(IElementType... tokens) { - return new TokenSet(tokens); - } - - private final Set tokens = new HashSet(); - - public TokenSet(IElementType... tokens) { - this.tokens.addAll(Arrays.asList(tokens)); - } - - public Set asSet() { - return tokens; - } -} diff --git a/confluence/src/main/java/com/intellij/util/text/CharArrayUtil.java b/confluence/src/main/java/com/intellij/util/text/CharArrayUtil.java deleted file mode 100644 index 8ca35f60f0a..00000000000 --- a/confluence/src/main/java/com/intellij/util/text/CharArrayUtil.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.intellij.util.text; - -/** - * @author abreslav - */ -public class CharArrayUtil { - public static char[] fromSequenceWithoutCopying(CharSequence buffer) { - char[] result = new char[buffer.length()]; - for (int i = 0; i < result.length; i++) { - result[i] = buffer.charAt(i); - } - return result; - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/ConfluenceUtils.java b/confluence/src/main/java/org/jetbrains/jet/ConfluenceUtils.java deleted file mode 100644 index da0dd0145eb..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/ConfluenceUtils.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.jetbrains.jet; - -/** - * @author Natalia.Ukhorskaya - */ - -public class ConfluenceUtils { - - public static void escapeHTML(StringBuilder builder, CharSequence seq) { - if (seq == null) return; - for (int i = 0; i < seq.length(); i++) { - char c = seq.charAt(i); - switch (c) { - case '<': - builder.append("<"); - break; - case '>': - builder.append(">"); - break; - case '&': - builder.append("&"); - break; - case ' ': - builder.append(" "); - break; - case '"': - builder.append("""); - break; - default: - builder.append(c); - } - } - } - - public static String getErrorInHtml(Throwable e, String info) { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("
Jet highlighter error [").append(e.getClass().getSimpleName()).append("]: "); - ConfluenceUtils.escapeHTML(stringBuilder, e.getMessage()); - stringBuilder.append("
"); - stringBuilder.append("Original text:"); - stringBuilder.append("
");
-        ConfluenceUtils.escapeHTML(stringBuilder, info);
-        stringBuilder.append("
"); - stringBuilder.append("
"); - return stringBuilder.toString(); - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/FlexLexer.java b/confluence/src/main/java/org/jetbrains/jet/lexer/FlexLexer.java deleted file mode 100644 index eb004632a02..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/FlexLexer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lexer; - -/** - * @author abreslav - */ -public interface FlexLexer { -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetHTMLMacro.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetHTMLMacro.java deleted file mode 100644 index ab4f6110494..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetHTMLMacro.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lexer; - -import com.atlassian.renderer.RenderContext; -import com.atlassian.renderer.v2.RenderMode; -import com.atlassian.renderer.v2.macro.BaseMacro; -import com.atlassian.renderer.v2.macro.MacroException; - -import java.util.Map; - -/** - * @author abreslav - */ -public class JetHTMLMacro extends BaseMacro { - - @Override - public boolean hasBody() { - return true; - } - - @Override - public RenderMode getBodyRenderMode() { - return RenderMode.allow(0); - } - - @Override - public String execute(Map map, String code, RenderContext renderContext) throws MacroException { - return code; - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetKeywordToken.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetKeywordToken.java deleted file mode 100644 index f27d78b3351..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetKeywordToken.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * @author max - */ -package org.jetbrains.jet.lexer; - - -public class JetKeywordToken extends JetToken { - - public static JetKeywordToken keyword(String value) { - return new JetKeywordToken(value, false); - } - - public static JetKeywordToken softKeyword(String value) { - return new JetKeywordToken(value, true); - } - - private final String myValue; - private final boolean myIsSoft; - - private JetKeywordToken(String value, boolean isSoft) { - super(value); - myValue = value; - myIsSoft = isSoft; - } - - public String getValue() { - return myValue; - } - - public boolean isSoft() { - return myIsSoft; - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java deleted file mode 100644 index 09bfa123fb2..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lexer; - -import com.atlassian.confluence.renderer.radeox.macros.MacroUtils; -import com.atlassian.confluence.util.velocity.VelocityUtils; -import com.atlassian.renderer.RenderContext; -import com.atlassian.renderer.v2.RenderMode; -import com.atlassian.renderer.v2.macro.BaseMacro; -import com.atlassian.renderer.v2.macro.MacroException; -import com.intellij.psi.TokenType; -import com.intellij.psi.tree.IElementType; -import org.apache.velocity.VelocityContext; -import org.jetbrains.jet.ConfluenceUtils; -import org.jetbrains.jet.tags.StyledDivTagType; -import org.jetbrains.jet.tags.TagData; -import org.jetbrains.jet.tags.TagType; - -import java.io.StringReader; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * @author abreslav - */ -public class JetMacro extends BaseMacro { - - public static final StringReader DUMMY_READER = new StringReader(""); - - private static final TagType[] knownExtraTagTypes = { - new StyledDivTagType("error"), - new StyledDivTagType("warning"), - new StyledDivTagType("unresolved"), - new TagType("ref") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - }, - new TagType("label") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - }, - new TagType("a") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - }, - new TagType("style") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - }, - new TagType("class") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - }, - }; - private static final Map openTags = new HashMap(); - private static final Map nextTokenTags = new HashMap(); - private static final Map closedTags = new HashMap(); - private static final Map closeTags = new HashMap(); - - static { - for (TagType type : knownExtraTagTypes) { - String tagName = type.getTagName(); - openTags.put(type, Pattern.compile("<" + tagName + "\\s*((desc)?=\\\"([^\n\"]*?)\\\")?>", Pattern.MULTILINE)); - closeTags.put(type, Pattern.compile("")); - - nextTokenTags.put(type, Pattern.compile("<" + tagName + "\\s*((desc)?=\\\"([^\n\"]*?)\\\")?:>", Pattern.MULTILINE)); - closedTags.put(type, Pattern.compile("<" + tagName + "\\s*((desc)?=\\\"([^\n\"]*?)\\\")?/>", Pattern.MULTILINE)); - } - } - - private static final Map styleMap = new HashMap(); - - static { - styleMap.put(JetTokens.BLOCK_COMMENT, "jet-comment"); - styleMap.put(JetTokens.DOC_COMMENT, "jet-comment"); - styleMap.put(JetTokens.EOL_COMMENT, "jet-comment"); - styleMap.put(JetTokens.WHITE_SPACE, "whitespace"); - styleMap.put(JetTokens.INTEGER_LITERAL, "number"); - styleMap.put(JetTokens.FLOAT_LITERAL, "number"); - styleMap.put(JetTokens.OPEN_QUOTE, "string"); - styleMap.put(JetTokens.REGULAR_STRING_PART, "string"); - styleMap.put(JetTokens.ESCAPE_SEQUENCE, "escape"); - styleMap.put(JetTokens.LONG_TEMPLATE_ENTRY_START, "escape"); - styleMap.put(JetTokens.LONG_TEMPLATE_ENTRY_END, "escape"); - styleMap.put(JetTokens.SHORT_TEMPLATE_ENTRY_START, "escape"); - styleMap.put(JetTokens.ESCAPE_SEQUENCE, "escape"); - styleMap.put(JetTokens.CLOSING_QUOTE, "string"); - styleMap.put(JetTokens.CHARACTER_LITERAL, "string"); - styleMap.put(JetTokens.LABEL_IDENTIFIER, "label"); - styleMap.put(JetTokens.ATAT, "label"); - styleMap.put(JetTokens.FIELD_IDENTIFIER, "field"); - styleMap.put(TokenType.BAD_CHARACTER, "bad"); - } - - @Override - public boolean hasBody() { - return true; - } - - @Override - public RenderMode getBodyRenderMode() { - return RenderMode.allow(0); - } - - private String addNewLineOpenTag() { - return "
"; - } - - private String addNewLineCloseTag() { - return "
"; - } - - private void convertNewLines(StringBuilder result, String yytext) { - for (int i = 0; i < yytext.length(); i++) { - if (yytext.charAt(i) == '\n') { - result.append(" "); - result.append(addNewLineCloseTag()); - result.append(addNewLineOpenTag()); - } - } - } - - @Override - public String execute(Map map, String code, RenderContext renderContext) throws MacroException { - try { - VelocityContext context = new VelocityContext(MacroUtils.defaultVelocityContext()); - String renderedTemplate = VelocityUtils.getRenderedTemplate("template.velocity", context); - StringBuilder result = new StringBuilder(renderedTemplate); - - generateHtmlFromCode(code, result); - - return result.toString(); - } catch (Throwable e) { - return ConfluenceUtils.getErrorInHtml(e, code); - } - } - - public void generateHtmlFromCode(String code, StringBuilder result) throws java.io.IOException { - try { - List tags = new ArrayList(); - StringBuilder afterPreprocessing = preprocess(code.trim(), tags); - - result.append( - "
" + - "
" + - "
" - ); - - result.append(addNewLineOpenTag()); - - _JetLexer jetLexer = new _JetLexer(DUMMY_READER); - jetLexer.reset(afterPreprocessing, 0, afterPreprocessing.length(), _JetLexer.YYINITIAL); - - Iterator iterator = tags.iterator(); - TagData tag = iterator.hasNext() ? iterator.next() : null; - while (true) { - int tokenEnd = jetLexer.getTokenEnd(); - while (tag != null && tag.getEnd() < tokenEnd) { - result.append("
Skipping a tag in the middle of a token: <").append(tag.getType()).append(">
"); - tag = iterator.hasNext() ? iterator.next() : null; - } - - if (tag != null) { - if (tag.getStart() == tokenEnd) { -// result.append("
"); - tag.getType().appendOpenTag(result, tag); - } - } - if (tag != null) { - if (tag.getEnd() == tokenEnd || (tag.isNextToken() && tag.getStart() < tokenEnd)) { - tag.getType().appendCloseTag(result, tag); - tag = iterator.hasNext() ? iterator.next() : null; - } - } - - IElementType token = jetLexer.advance(); - if (token == null) break; -// CharSequence yytext = jetLexer.yytext(); - String yytext = jetLexer.yytext().toString(); - - if (yytext.contains("\n")) { - convertNewLines(result, yytext); - yytext = yytext.replaceAll("\n", ""); - } - - String style = null; - if (token instanceof JetKeywordToken) { - style = "keyword"; - } - else if (token == JetTokens.IDENTIFIER) { - for (IElementType softKeyword : JetTokens.SOFT_KEYWORDS.asSet()) { - if (((JetKeywordToken) softKeyword).getValue().equals(yytext.toString())) { - style = "softkeyword"; - break; - } - } - style = style == null ? "plain" : style; - } - else if (styleMap.containsKey(token)) { - style = styleMap.get(token); - } - else { - style = "plain"; - } - result.append(""); - ConfluenceUtils.escapeHTML(result, yytext); - result.append(""); - } - - result.append(addNewLineCloseTag()); - result.append("
"); - result.append("
"); - result.append("
"); - } catch (Throwable e) { - result = new StringBuilder(ConfluenceUtils.getErrorInHtml(e, code)); - } - - } - - private StringBuilder preprocess(CharSequence code, Collection tags) { - StringBuilder afterPreprocessing = new StringBuilder(); - int initialLength = afterPreprocessing.length(); - Stack tagStack = new Stack(); - charLoop: - for (int i = 0; i < code.length(); i++) { - char c = code.charAt(i); - if (c == '\r') continue; - - int position = afterPreprocessing.length() - initialLength; - - for (TagType type : knownExtraTagTypes) { - Pattern open = openTags.get(type); - Matcher openMatcher = matchFrom(code, i, open); - if (openMatcher != null) { - tagStack.push(new TagData(type, openMatcher.group(3), position, false)); - i += openMatcher.end() - 1; - continue charLoop; - } - - Pattern close = closeTags.get(type); - Matcher closeMatcher = matchFrom(code, i, close); - if (closeMatcher != null) { - if (tagStack.isEmpty()) { - throw new IllegalArgumentException("Unmatched closing tag: " + closeMatcher.group()); - } - else { - TagData tag = tagStack.pop(); - if (type != tag.getType()) { - throw new IllegalArgumentException("Unmatched closing tag: " + closeMatcher.group()); - } - - tag.setEnd(position); - tags.add(tag); - i += closeMatcher.end() - 1; - continue charLoop; - } - } - - Pattern closed = closedTags.get(type); - Matcher closedMatcher = matchFrom(code, i, closed); - if (closedMatcher != null) { - TagData tag = new TagData(type, closedMatcher.group(3), position, false); - tag.setEnd(position); - tags.add(tag); - i += closedMatcher.end() - 1; - continue charLoop; - } - - Pattern next = nextTokenTags.get(type); - Matcher nextMatcher = matchFrom(code, i, next); - if (nextMatcher != null) { - TagData tag = new TagData(type, nextMatcher.group(3), position, true); - tags.add(tag); - tag.setEnd(code.length()); - i += nextMatcher.end() - 1; - continue charLoop; - } - - } - afterPreprocessing.append(c); - } - return afterPreprocessing; - } - - private Matcher matchFrom(CharSequence code, int start, Pattern pattern) { - CharSequence remainingInput = code.subSequence(start, code.length()); - Matcher matcher = pattern.matcher(remainingInput); - if (matcher.find() && matcher.start() == 0) { - return matcher; - } - return null; - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetToken.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetToken.java deleted file mode 100644 index 2942f6c0d64..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetToken.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * @author max - */ -package org.jetbrains.jet.lexer; - - -import com.intellij.psi.tree.IElementType; - -public class JetToken extends IElementType { - public JetToken(String debugName) { - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java deleted file mode 100644 index 368b102bf55..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * @author max - */ -package org.jetbrains.jet.lexer; - -import com.intellij.psi.TokenType; -import com.intellij.psi.tree.IElementType; -import com.intellij.psi.tree.TokenSet; - -public interface JetTokens { - JetToken EOF = new JetToken("EOF"); - - JetToken BLOCK_COMMENT = new JetToken("BLOCK_COMMENT"); - JetToken DOC_COMMENT = new JetToken("DOC_COMMENT"); - JetToken EOL_COMMENT = new JetToken("EOL_COMMENT"); - - IElementType WHITE_SPACE = TokenType.WHITE_SPACE; - - JetToken INTEGER_LITERAL = new JetToken("INTEGER_LITERAL"); - JetToken FLOAT_LITERAL = new JetToken("FLOAT_CONSTANT"); - JetToken CHARACTER_LITERAL = new JetToken("CHARACTER_LITERAL"); - - JetToken CLOSING_QUOTE = new JetToken("CLOSING_QUOTE"); - JetToken OPEN_QUOTE = new JetToken("OPEN_QUOTE"); - JetToken REGULAR_STRING_PART = new JetToken("REGULAR_STRING_PART"); - JetToken ESCAPE_SEQUENCE = new JetToken("ESCAPE_SEQUENCE"); - JetToken SHORT_TEMPLATE_ENTRY_START = new JetToken("SHORT_TEMPLATE_ENTRY_START"); - JetToken LONG_TEMPLATE_ENTRY_START = new JetToken("LONG_TEMPLATE_ENTRY_START"); - JetToken LONG_TEMPLATE_ENTRY_END = new JetToken("LONG_TEMPLATE_ENTRY_END"); - JetToken DANGLING_NEWLINE = new JetToken("DANGLING_NEWLINE"); - - JetKeywordToken PACKAGE_KEYWORD = JetKeywordToken.keyword("package"); - JetKeywordToken AS_KEYWORD = JetKeywordToken.keyword("as"); - JetKeywordToken TYPE_KEYWORD = JetKeywordToken.keyword("type"); - JetKeywordToken CLASS_KEYWORD = JetKeywordToken.keyword("class"); - JetKeywordToken THIS_KEYWORD = JetKeywordToken.keyword("this"); - JetKeywordToken SUPER_KEYWORD = JetKeywordToken.keyword("super"); - JetKeywordToken VAL_KEYWORD = JetKeywordToken.keyword("val"); - JetKeywordToken VAR_KEYWORD = JetKeywordToken.keyword("var"); - JetKeywordToken FUN_KEYWORD = JetKeywordToken.keyword("fun"); - JetKeywordToken FOR_KEYWORD = JetKeywordToken.keyword("for"); - JetKeywordToken NULL_KEYWORD = JetKeywordToken.keyword("null"); - JetKeywordToken TRUE_KEYWORD = JetKeywordToken.keyword("true"); - JetKeywordToken FALSE_KEYWORD = JetKeywordToken.keyword("false"); - JetKeywordToken IS_KEYWORD = JetKeywordToken.keyword("is"); - JetKeywordToken IN_KEYWORD = JetKeywordToken.keyword("in"); - JetKeywordToken THROW_KEYWORD = JetKeywordToken.keyword("throw"); - JetKeywordToken RETURN_KEYWORD = JetKeywordToken.keyword("return"); - JetKeywordToken BREAK_KEYWORD = JetKeywordToken.keyword("break"); - JetKeywordToken CONTINUE_KEYWORD = JetKeywordToken.keyword("continue"); - JetKeywordToken OBJECT_KEYWORD = JetKeywordToken.keyword("object"); - JetKeywordToken IF_KEYWORD = JetKeywordToken.keyword("if"); - JetKeywordToken TRY_KEYWORD = JetKeywordToken.keyword("try"); - JetKeywordToken ELSE_KEYWORD = JetKeywordToken.keyword("else"); - JetKeywordToken WHILE_KEYWORD = JetKeywordToken.keyword("while"); - JetKeywordToken DO_KEYWORD = JetKeywordToken.keyword("do"); - JetKeywordToken WHEN_KEYWORD = JetKeywordToken.keyword("when"); - JetKeywordToken TRAIT_KEYWORD = JetKeywordToken.keyword("trait"); - // TODO: Discuss "This" keyword - JetKeywordToken CAPITALIZED_THIS_KEYWORD = JetKeywordToken.keyword("This"); - - - JetToken AS_SAFE = JetKeywordToken.keyword("AS_SAFE");//new JetToken("as?"); - - JetToken IDENTIFIER = new JetToken("IDENTIFIER"); - JetToken LABEL_IDENTIFIER = new JetToken("LABEL_IDENTIFIER"); - - JetToken FIELD_IDENTIFIER = new JetToken("FIELD_IDENTIFIER"); - JetToken LBRACKET = new JetToken("LBRACKET"); - JetToken RBRACKET = new JetToken("RBRACKET"); - JetToken LBRACE = new JetToken("LBRACE"); - JetToken RBRACE = new JetToken("RBRACE"); - JetToken LPAR = new JetToken("LPAR"); - JetToken RPAR = new JetToken("RPAR"); - JetToken DOT = new JetToken("DOT"); - JetToken PLUSPLUS = new JetToken("PLUSPLUS"); - JetToken MINUSMINUS = new JetToken("MINUSMINUS"); - JetToken MUL = new JetToken("MUL"); - JetToken PLUS = new JetToken("PLUS"); - JetToken MINUS = new JetToken("MINUS"); - JetToken EXCL = new JetToken("EXCL"); - JetToken DIV = new JetToken("DIV"); - JetToken PERC = new JetToken("PERC"); - JetToken LT = new JetToken("LT"); - JetToken GT = new JetToken("GT"); - JetToken LTEQ = new JetToken("LTEQ"); - JetToken GTEQ = new JetToken("GTEQ"); - JetToken EQEQEQ = new JetToken("EQEQEQ"); - JetToken ARROW = new JetToken("ARROW"); - JetToken DOUBLE_ARROW = new JetToken("DOUBLE_ARROW"); - JetToken EXCLEQEQEQ = new JetToken("EXCLEQEQEQ"); - JetToken EQEQ = new JetToken("EQEQ"); - JetToken EXCLEQ = new JetToken("EXCLEQ"); - JetToken EXCLEXCL = new JetToken("EXCLEXCL"); - JetToken ANDAND = new JetToken("ANDAND"); - JetToken OROR = new JetToken("OROR"); - JetToken SAFE_ACCESS = new JetToken("SAFE_ACCESS"); - JetToken ELVIS = new JetToken("ELVIS"); - // JetToken MAP = new JetToken("MAP"); -// JetToken FILTER = new JetToken("FILTER"); - JetToken QUEST = new JetToken("QUEST"); - JetToken COLON = new JetToken("COLON"); - JetToken SEMICOLON = new JetToken("SEMICOLON"); - JetToken RANGE = new JetToken("RANGE"); - JetToken EQ = new JetToken("EQ"); - JetToken MULTEQ = new JetToken("MULTEQ"); - JetToken DIVEQ = new JetToken("DIVEQ"); - JetToken PERCEQ = new JetToken("PERCEQ"); - JetToken PLUSEQ = new JetToken("PLUSEQ"); - JetToken MINUSEQ = new JetToken("MINUSEQ"); - JetToken NOT_IN = JetKeywordToken.keyword("NOT_IN"); - JetToken NOT_IS = JetKeywordToken.keyword("NOT_IS"); - JetToken HASH = new JetToken("HASH"); - JetToken AT = new JetToken("AT"); - JetToken ATAT = new JetToken("ATAT"); - - JetToken IDE_TEMPLATE_START = new JetToken("IDE_TEMPLATE_START"); - JetToken IDE_TEMPLATE_END = new JetToken("IDE_TEMPLATE_END"); - - TokenSet LABELS = TokenSet.create(AT, ATAT, LABEL_IDENTIFIER); - - JetToken COMMA = new JetToken("COMMA"); - - JetToken EOL_OR_SEMICOLON = new JetToken("EOL_OR_SEMICOLON"); - JetKeywordToken IMPORT_KEYWORD = JetKeywordToken.softKeyword("import"); - JetKeywordToken WHERE_KEYWORD = JetKeywordToken.softKeyword("where"); - JetKeywordToken BY_KEYWORD = JetKeywordToken.softKeyword("by"); - JetKeywordToken GET_KEYWORD = JetKeywordToken.softKeyword("get"); - JetKeywordToken SET_KEYWORD = JetKeywordToken.softKeyword("set"); - JetKeywordToken ABSTRACT_KEYWORD = JetKeywordToken.softKeyword("abstract"); - JetKeywordToken ENUM_KEYWORD = JetKeywordToken.softKeyword("enum"); - JetKeywordToken OPEN_KEYWORD = JetKeywordToken.softKeyword("open"); - JetKeywordToken ANNOTATION_KEYWORD = JetKeywordToken.softKeyword("annotation"); - JetKeywordToken OVERRIDE_KEYWORD = JetKeywordToken.softKeyword("override"); - JetKeywordToken PRIVATE_KEYWORD = JetKeywordToken.softKeyword("private"); - JetKeywordToken PUBLIC_KEYWORD = JetKeywordToken.softKeyword("public"); - JetKeywordToken INTERNAL_KEYWORD = JetKeywordToken.softKeyword("internal"); - JetKeywordToken PROTECTED_KEYWORD = JetKeywordToken.softKeyword("protected"); - JetKeywordToken CATCH_KEYWORD = JetKeywordToken.softKeyword("catch"); - JetKeywordToken OUT_KEYWORD = JetKeywordToken.softKeyword("out"); - JetKeywordToken VARARG_KEYWORD = JetKeywordToken.softKeyword("vararg"); - JetKeywordToken INLINE_KEYWORD = JetKeywordToken.softKeyword("inline"); - JetKeywordToken ERASED_KEYWORD = JetKeywordToken.softKeyword("erased"); - - JetKeywordToken FINALLY_KEYWORD = JetKeywordToken.softKeyword("finally"); - JetKeywordToken FINAL_KEYWORD = JetKeywordToken.softKeyword("final"); - - TokenSet KEYWORDS = TokenSet.create(PACKAGE_KEYWORD, AS_KEYWORD, TYPE_KEYWORD, CLASS_KEYWORD, TRAIT_KEYWORD, - THIS_KEYWORD, SUPER_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, FUN_KEYWORD, FOR_KEYWORD, - NULL_KEYWORD, - TRUE_KEYWORD, FALSE_KEYWORD, IS_KEYWORD, - IN_KEYWORD, THROW_KEYWORD, RETURN_KEYWORD, BREAK_KEYWORD, CONTINUE_KEYWORD, OBJECT_KEYWORD, IF_KEYWORD, - ELSE_KEYWORD, WHILE_KEYWORD, DO_KEYWORD, TRY_KEYWORD, WHEN_KEYWORD, - NOT_IN, NOT_IS, CAPITALIZED_THIS_KEYWORD, AS_SAFE - ); - - TokenSet SOFT_KEYWORDS = TokenSet.create(IMPORT_KEYWORD, WHERE_KEYWORD, BY_KEYWORD, GET_KEYWORD, - SET_KEYWORD, ABSTRACT_KEYWORD, ENUM_KEYWORD, OPEN_KEYWORD, ANNOTATION_KEYWORD, - OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, PROTECTED_KEYWORD, - CATCH_KEYWORD, FINALLY_KEYWORD, OUT_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD, ERASED_KEYWORD - ); - - TokenSet MODIFIER_KEYWORDS = TokenSet.create(ABSTRACT_KEYWORD, ENUM_KEYWORD, - OPEN_KEYWORD, ANNOTATION_KEYWORD, OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, - PROTECTED_KEYWORD, OUT_KEYWORD, IN_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD, ERASED_KEYWORD - ); - TokenSet WHITE_SPACE_OR_COMMENT_BIT_SET = TokenSet.create(WHITE_SPACE, BLOCK_COMMENT, EOL_COMMENT, DOC_COMMENT); - TokenSet WHITESPACES = TokenSet.create(TokenType.WHITE_SPACE); - TokenSet COMMENTS = TokenSet.create(EOL_COMMENT, BLOCK_COMMENT, DOC_COMMENT); - - TokenSet STRINGS = TokenSet.create(CHARACTER_LITERAL, REGULAR_STRING_PART); - TokenSet OPERATIONS = TokenSet.create(AS_KEYWORD, AS_SAFE, IS_KEYWORD, IN_KEYWORD, DOT, PLUSPLUS, MINUSMINUS, EXCLEXCL, MUL, PLUS, - MINUS, EXCL, DIV, PERC, LT, GT, LTEQ, GTEQ, EQEQEQ, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR, - SAFE_ACCESS, ELVIS, -// MAP, FILTER, - COLON, - RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ, - NOT_IN, NOT_IS, -// HASH, - IDENTIFIER, LABEL_IDENTIFIER, ATAT, AT); - - TokenSet AUGMENTED_ASSIGNMENTS = TokenSet.create(PLUSEQ, MINUSEQ, MULTEQ, PERCEQ, DIVEQ); -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java b/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java deleted file mode 100644 index 65cef273047..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java +++ /dev/null @@ -1,1346 +0,0 @@ -/* The following code was generated by JFlex 1.4.3 on 4/19/12 3:09 PM */ - -package org.jetbrains.jet.lexer; - -import java.util.*; -import com.intellij.lexer.*; -import com.intellij.psi.*; -import com.intellij.psi.tree.IElementType; - -import org.jetbrains.jet.lexer.JetTokens; - - -/** - * This class is a scanner generated by - * JFlex 1.4.3 - * on 4/19/12 3:09 PM from the specification file - * C:/Development/kotlin-fork/kotlin/confluence/../compiler/frontend/src/org/jetbrains/jet/lexer/Jet.flex - */ -class _JetLexer implements FlexLexer { - /** initial size of the lookahead buffer */ - private static final int ZZ_BUFFERSIZE = 16384; - - /** lexical states */ - public static final int STRING = 2; - public static final int BLOCK_COMMENT = 8; - public static final int YYINITIAL = 0; - public static final int LONG_TEMPLATE_ENTRY = 12; - public static final int DOC_COMMENT = 10; - public static final int RAW_STRING = 4; - public static final int SHORT_TEMPLATE_ENTRY = 6; - - /** - * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l - * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l - * at the beginning of a line - * l is of the form l = 2*k, k a non negative integer - */ - private static final int ZZ_LEXSTATE[] = { - 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5 - }; - - /** - * Translates characters to character classes - */ - private static final String ZZ_CMAP_PACKED = - "\11\0\1\3\1\7\1\0\1\3\23\0\1\3\1\57\1\24\1\61"+ - "\1\10\1\70\1\66\1\22\1\73\1\74\1\34\1\65\1\77\1\20"+ - "\1\16\1\12\1\13\11\1\1\75\1\76\1\60\1\63\1\62\1\64"+ - "\1\11\1\2\1\15\2\2\1\17\1\2\11\4\1\21\3\4\1\54"+ - "\3\4\1\14\2\4\1\71\1\23\1\72\1\0\1\4\1\6\1\42"+ - "\1\46\1\35\1\56\1\40\1\52\1\44\1\31\1\32\1\47\1\43"+ - "\1\51\1\4\1\37\1\36\1\41\1\4\1\45\1\33\1\30\1\25"+ - "\1\55\1\50\1\14\1\53\1\4\1\26\1\67\1\27\54\0\1\4"+ - "\12\0\1\4\4\0\1\4\5\0\27\4\1\0\37\4\1\0\u013f\4"+ - "\31\0\162\4\4\0\14\4\16\0\5\4\11\0\1\4\213\0\1\4"+ - "\13\0\1\4\1\0\3\4\1\0\1\4\1\0\24\4\1\0\54\4"+ - "\1\0\46\4\1\0\5\4\4\0\202\4\10\0\105\4\1\0\46\4"+ - "\2\0\2\4\6\0\20\4\41\0\46\4\2\0\1\4\7\0\47\4"+ - "\110\0\33\4\5\0\3\4\56\0\32\4\5\0\13\4\25\0\12\5"+ - "\4\0\2\4\1\0\143\4\1\0\1\4\17\0\2\4\7\0\2\4"+ - "\12\5\3\4\2\0\1\4\20\0\1\4\1\0\36\4\35\0\3\4"+ - "\60\0\46\4\13\0\1\4\u0152\0\66\4\3\0\1\4\22\0\1\4"+ - "\7\0\12\4\4\0\12\5\25\0\10\4\2\0\2\4\2\0\26\4"+ - "\1\0\7\4\1\0\1\4\3\0\4\4\3\0\1\4\36\0\2\4"+ - "\1\0\3\4\4\0\12\5\2\4\23\0\6\4\4\0\2\4\2\0"+ - "\26\4\1\0\7\4\1\0\2\4\1\0\2\4\1\0\2\4\37\0"+ - "\4\4\1\0\1\4\7\0\12\5\2\0\3\4\20\0\11\4\1\0"+ - "\3\4\1\0\26\4\1\0\7\4\1\0\2\4\1\0\5\4\3\0"+ - "\1\4\22\0\1\4\17\0\2\4\4\0\12\5\25\0\10\4\2\0"+ - "\2\4\2\0\26\4\1\0\7\4\1\0\2\4\1\0\5\4\3\0"+ - "\1\4\36\0\2\4\1\0\3\4\4\0\12\5\1\0\1\4\21\0"+ - "\1\4\1\0\6\4\3\0\3\4\1\0\4\4\3\0\2\4\1\0"+ - "\1\4\1\0\2\4\3\0\2\4\3\0\3\4\3\0\10\4\1\0"+ - "\3\4\55\0\11\5\25\0\10\4\1\0\3\4\1\0\27\4\1\0"+ - "\12\4\1\0\5\4\46\0\2\4\4\0\12\5\25\0\10\4\1\0"+ - "\3\4\1\0\27\4\1\0\12\4\1\0\5\4\3\0\1\4\40\0"+ - "\1\4\1\0\2\4\4\0\12\5\25\0\10\4\1\0\3\4\1\0"+ - "\27\4\1\0\20\4\46\0\2\4\4\0\12\5\25\0\22\4\3\0"+ - "\30\4\1\0\11\4\1\0\1\4\2\0\7\4\72\0\60\4\1\0"+ - "\2\4\14\0\7\4\11\0\12\5\47\0\2\4\1\0\1\4\2\0"+ - "\2\4\1\0\1\4\2\0\1\4\6\0\4\4\1\0\7\4\1\0"+ - "\3\4\1\0\1\4\1\0\1\4\2\0\2\4\1\0\4\4\1\0"+ - "\2\4\11\0\1\4\2\0\5\4\1\0\1\4\11\0\12\5\2\0"+ - "\2\4\42\0\1\4\37\0\12\5\26\0\10\4\1\0\42\4\35\0"+ - "\4\4\164\0\42\4\1\0\5\4\1\0\2\4\25\0\12\5\6\0"+ - "\6\4\112\0\46\4\12\0\51\4\7\0\132\4\5\0\104\4\5\0"+ - "\122\4\6\0\7\4\1\0\77\4\1\0\1\4\1\0\4\4\2\0"+ - "\7\4\1\0\1\4\1\0\4\4\2\0\47\4\1\0\1\4\1\0"+ - "\4\4\2\0\37\4\1\0\1\4\1\0\4\4\2\0\7\4\1\0"+ - "\1\4\1\0\4\4\2\0\7\4\1\0\7\4\1\0\27\4\1\0"+ - "\37\4\1\0\1\4\1\0\4\4\2\0\7\4\1\0\47\4\1\0"+ - "\23\4\16\0\11\5\56\0\125\4\14\0\u026c\4\2\0\10\4\12\0"+ - "\32\4\5\0\113\4\25\0\15\4\1\0\4\4\16\0\22\4\16\0"+ - "\22\4\16\0\15\4\1\0\3\4\17\0\64\4\43\0\1\4\4\0"+ - "\1\4\3\0\12\5\46\0\12\5\6\0\130\4\10\0\51\4\127\0"+ - "\35\4\51\0\12\5\36\4\2\0\5\4\u038b\0\154\4\224\0\234\4"+ - "\4\0\132\4\6\0\26\4\2\0\6\4\2\0\46\4\2\0\6\4"+ - "\2\0\10\4\1\0\1\4\1\0\1\4\1\0\1\4\1\0\37\4"+ - "\2\0\65\4\1\0\7\4\1\0\1\4\3\0\3\4\1\0\7\4"+ - "\3\0\4\4\2\0\6\4\4\0\15\4\5\0\3\4\1\0\7\4"+ - "\164\0\1\4\15\0\1\4\202\0\1\4\4\0\1\4\2\0\12\4"+ - "\1\0\1\4\3\0\5\4\6\0\1\4\1\0\1\4\1\0\1\4"+ - "\1\0\4\4\1\0\3\4\1\0\7\4\3\0\3\4\5\0\5\4"+ - "\u0ebb\0\2\4\52\0\5\4\5\0\2\4\4\0\126\4\6\0\3\4"+ - "\1\0\132\4\1\0\4\4\5\0\50\4\4\0\136\4\21\0\30\4"+ - "\70\0\20\4\u0200\0\u19b6\4\112\0\u51a6\4\132\0\u048d\4\u0773\0\u2ba4\4"+ - "\u215c\0\u012e\4\2\0\73\4\225\0\7\4\14\0\5\4\5\0\1\4"+ - "\1\0\12\4\1\0\15\4\1\0\5\4\1\0\1\4\1\0\2\4"+ - "\1\0\2\4\1\0\154\4\41\0\u016b\4\22\0\100\4\2\0\66\4"+ - "\50\0\14\4\164\0\5\4\1\0\207\4\23\0\12\5\7\0\32\4"+ - "\6\0\32\4\13\0\131\4\3\0\6\4\2\0\6\4\2\0\6\4"+ - "\2\0\3\4\43\0"; - - /** - * Translates characters to character classes - */ - private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); - - /** - * Translates DFA states to action switch labels. - */ - private static final int [] ZZ_ACTION = zzUnpackAction(); - - private static final String ZZ_ACTION_PACKED_0 = - "\6\0\1\1\1\2\1\3\1\4\2\1\1\5\1\6"+ - "\1\2\1\7\1\10\1\11\1\12\1\13\1\14\3\3"+ - "\1\15\15\3\1\16\1\17\1\20\1\21\1\22\1\23"+ - "\1\24\2\1\1\25\1\26\1\27\1\30\1\31\1\32"+ - "\1\33\1\34\1\35\1\36\1\35\1\0\1\37\2\35"+ - "\1\40\1\0\1\40\3\41\1\42\1\43\1\0\1\44"+ - "\1\0\1\45\1\0\1\46\1\0\1\47\1\50\1\51"+ - "\1\52\1\44\2\2\1\44\1\53\1\54\1\55\1\56"+ - "\2\11\1\0\3\3\1\57\1\60\1\61\1\3\1\62"+ - "\6\3\1\63\10\3\1\64\1\0\1\65\1\0\1\66"+ - "\1\0\1\67\1\70\1\71\1\72\1\73\1\74\1\75"+ - "\1\76\1\77\1\0\1\100\2\101\2\0\1\40\1\102"+ - "\1\103\1\104\1\44\1\3\2\0\1\105\4\0\1\106"+ - "\4\3\1\107\10\3\1\110\4\3\1\111\1\112\2\3"+ - "\1\113\1\114\1\115\1\116\1\117\1\120\1\121\1\122"+ - "\2\0\2\40\1\45\1\46\1\123\1\44\1\0\1\124"+ - "\1\3\1\125\1\3\1\126\4\3\1\127\1\130\4\3"+ - "\1\131\1\3\1\132\1\133\1\77\1\0\1\134\1\135"+ - "\1\136\1\137\1\3\1\140\3\3\1\141\1\142\1\143"+ - "\1\0\1\3\1\144\1\3\1\145\1\3\1\146\1\147"; - - private static int [] zzUnpackAction() { - int [] result = new int[230]; - int offset = 0; - offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAction(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /** - * Translates a state to a row index in the transition table - */ - private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); - - private static final String ZZ_ROWMAP_PACKED_0 = - "\0\0\0\100\0\200\0\300\0\u0100\0\u0140\0\u0180\0\u01c0"+ - "\0\u0200\0\u0240\0\u0280\0\u02c0\0\u0300\0\u0340\0\u0380\0\u03c0"+ - "\0\u0400\0\u0440\0\u0480\0\u0180\0\u0180\0\u04c0\0\u0500\0\u0540"+ - "\0\u0580\0\u05c0\0\u0600\0\u0640\0\u0680\0\u06c0\0\u0700\0\u0740"+ - "\0\u0780\0\u07c0\0\u0800\0\u0840\0\u0880\0\u08c0\0\u0900\0\u0940"+ - "\0\u0180\0\u0980\0\u09c0\0\u0180\0\u0a00\0\u0a40\0\u0a80\0\u0ac0"+ - "\0\u0180\0\u0180\0\u0180\0\u0180\0\u0180\0\u0180\0\u0180\0\u0b00"+ - "\0\u0180\0\u0b40\0\u0b80\0\u0180\0\u0180\0\u0bc0\0\u0c00\0\u0c40"+ - "\0\u0c80\0\u0180\0\u0cc0\0\u0d00\0\u0180\0\u0180\0\u0d40\0\u0d80"+ - "\0\u0dc0\0\u0e00\0\u0e40\0\u0e80\0\u0ec0\0\u0180\0\u0f00\0\u0f40"+ - "\0\u0180\0\u0f80\0\u0fc0\0\u1000\0\u1040\0\u0180\0\u0180\0\u0180"+ - "\0\u0180\0\u0180\0\u1080\0\u10c0\0\u1100\0\u1140\0\u1180\0\u0200"+ - "\0\u0200\0\u0200\0\u11c0\0\u0180\0\u1200\0\u1240\0\u1280\0\u12c0"+ - "\0\u1300\0\u1340\0\u1380\0\u13c0\0\u1400\0\u1440\0\u1480\0\u14c0"+ - "\0\u1500\0\u1540\0\u1580\0\u0200\0\u15c0\0\u1600\0\u1640\0\u0180"+ - "\0\u1680\0\u0180\0\u0180\0\u16c0\0\u0180\0\u0180\0\u0180\0\u0180"+ - "\0\u0180\0\u1700\0\u1740\0\u0180\0\u0180\0\u1780\0\u17c0\0\u1800"+ - "\0\u1840\0\u0180\0\u0180\0\u0180\0\u1880\0\u0180\0\u18c0\0\u1900"+ - "\0\u1940\0\u1980\0\u19c0\0\u1a00\0\u1a40\0\u0180\0\u1a80\0\u1ac0"+ - "\0\u1b00\0\u1b40\0\u0200\0\u1b80\0\u1bc0\0\u1c00\0\u1c40\0\u1c80"+ - "\0\u1cc0\0\u1d00\0\u1d40\0\u0180\0\u1d80\0\u1dc0\0\u1e00\0\u1e40"+ - "\0\u0200\0\u0200\0\u1e80\0\u1ec0\0\u0200\0\u0200\0\u1f00\0\u1f00"+ - "\0\u0180\0\u0180\0\u0180\0\u0180\0\u1f40\0\u1f80\0\u0180\0\u1fc0"+ - "\0\u0180\0\u0180\0\u0180\0\u2000\0\u1880\0\u0200\0\u2040\0\u0200"+ - "\0\u2080\0\u0200\0\u20c0\0\u2100\0\u2140\0\u2180\0\u0200\0\u0200"+ - "\0\u21c0\0\u2200\0\u2240\0\u2280\0\u0200\0\u22c0\0\u0200\0\u0180"+ - "\0\u0180\0\u2300\0\u0c00\0\u0200\0\u0200\0\u0200\0\u2340\0\u0200"+ - "\0\u2380\0\u23c0\0\u2400\0\u0200\0\u0200\0\u0200\0\u2440\0\u2480"+ - "\0\u0200\0\u24c0\0\u0200\0\u2500\0\u0200\0\u0200"; - - private static int [] zzUnpackRowMap() { - int [] result = new int[230]; - int offset = 0; - offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackRowMap(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int high = packed.charAt(i++) << 16; - result[j++] = high | packed.charAt(i++); - } - return j; - } - - /** - * The transition table of the DFA - */ - private static final int [] ZZ_TRANS = zzUnpackTrans(); - - private static final String ZZ_TRANS_PACKED_0 = - "\1\7\1\10\1\11\1\12\1\11\1\7\1\13\1\12"+ - "\1\14\1\15\1\16\1\17\2\11\1\20\1\11\1\21"+ - "\1\11\1\22\1\7\1\23\1\11\1\24\1\25\1\26"+ - "\1\11\1\27\1\30\1\31\1\32\1\33\1\34\1\35"+ - "\1\36\1\37\2\11\1\40\1\41\1\11\1\42\1\11"+ - "\1\43\1\11\1\44\1\45\1\46\1\47\1\50\1\51"+ - "\1\52\1\53\1\54\1\55\1\56\1\57\1\60\1\61"+ - "\1\62\1\63\1\64\1\65\1\66\1\67\7\70\1\71"+ - "\1\72\12\70\1\73\1\74\62\70\1\75\1\72\12\70"+ - "\1\75\1\76\53\70\2\0\1\77\1\0\1\77\1\0"+ - "\1\100\5\0\2\77\1\0\1\77\1\0\1\77\3\0"+ - "\1\77\2\0\1\101\3\77\1\0\22\77\21\0\12\102"+ - "\1\103\21\102\1\104\43\102\1\7\1\10\1\11\1\12"+ - "\1\11\1\7\1\13\1\12\1\14\1\15\1\16\1\17"+ - "\2\11\1\20\1\11\1\21\1\11\1\22\1\7\1\23"+ - "\1\11\1\105\1\106\1\26\1\11\1\27\1\30\1\31"+ - "\1\32\1\33\1\34\1\35\1\36\1\37\2\11\1\40"+ - "\1\41\1\11\1\42\1\11\1\43\1\11\1\44\1\45"+ - "\1\46\1\47\1\50\1\51\1\52\1\53\1\54\1\55"+ - "\1\56\1\57\1\60\1\61\1\62\1\63\1\64\1\65"+ - "\1\66\1\67\101\0\1\10\11\0\1\10\2\0\1\107"+ - "\1\110\20\0\1\110\40\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\4\11\1\0\22\11\24\0\1\12\3\0\1\12\70\0"+ - "\6\111\2\0\70\111\2\0\1\112\1\0\1\112\1\0"+ - "\1\113\5\0\2\112\1\0\1\112\1\0\1\112\3\0"+ - "\1\112\2\0\4\112\1\0\22\112\23\0\1\114\1\0"+ - "\1\114\1\0\1\115\2\0\1\116\2\0\2\114\1\0"+ - "\1\114\1\0\1\114\3\0\1\114\2\0\4\114\1\0"+ - "\22\114\33\0\1\117\21\0\1\120\26\0\1\121\15\0"+ - "\1\122\11\0\1\122\1\123\1\124\1\107\1\110\20\0"+ - "\1\110\5\0\1\124\32\0\1\125\11\0\1\125\2\0"+ - "\1\126\101\0\1\127\41\0\1\130\1\131\14\0\7\22"+ - "\1\0\12\22\1\132\1\133\54\22\24\0\1\134\54\0"+ - "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ - "\1\11\3\0\1\11\2\0\1\11\1\135\2\11\1\0"+ - "\10\11\1\136\5\11\1\137\3\11\22\0\2\11\1\0"+ - "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ - "\1\11\2\0\3\11\1\140\1\0\2\11\1\141\12\11"+ - "\1\142\4\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\143\2\0\4\11"+ - "\1\0\22\11\104\0\1\144\15\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ - "\2\0\4\11\1\0\1\11\1\145\12\11\1\146\5\11"+ - "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ - "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\11\11"+ - "\1\147\10\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\150\2\0\4\11"+ - "\1\0\22\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\4\11"+ - "\1\0\14\11\1\151\5\11\22\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ - "\2\0\4\11\1\0\5\11\1\152\14\11\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\3\11\1\153\1\0\22\11\22\0"+ - "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ - "\1\11\3\0\1\11\2\0\4\11\1\0\3\11\1\154"+ - "\16\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ - "\1\11\1\0\1\11\3\0\1\11\2\0\4\11\1\0"+ - "\10\11\1\155\11\11\22\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\1\11\1\156\2\11\1\0\22\11\22\0\2\11\1\0"+ - "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ - "\1\157\2\0\4\11\1\0\1\11\1\160\3\11\1\161"+ - "\14\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ - "\1\11\1\0\1\11\3\0\1\11\2\0\1\11\1\162"+ - "\2\11\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\4\11\1\0\5\11\1\163\14\11\22\0\2\11\1\0"+ - "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ - "\1\11\2\0\4\11\1\0\1\11\1\164\20\11\53\0"+ - "\1\165\30\0\1\166\75\0\1\167\1\0\1\170\75\0"+ - "\1\171\1\0\1\172\76\0\1\173\1\174\77\0\1\175"+ - "\1\0\1\176\100\0\1\177\100\0\1\200\73\0\1\201"+ - "\14\0\7\70\2\0\12\70\2\0\53\70\2\0\1\202"+ - "\1\0\1\202\1\0\1\203\5\0\2\202\1\0\1\202"+ - "\1\0\1\202\3\0\1\202\1\204\1\0\4\202\1\0"+ - "\22\202\21\0\7\205\1\0\15\205\1\206\52\205\24\0"+ - "\1\207\54\0\2\77\1\0\2\77\5\0\3\77\1\0"+ - "\1\77\1\0\1\77\3\0\1\77\2\0\4\77\1\0"+ - "\22\77\21\0\6\210\2\0\70\210\1\0\2\77\1\0"+ - "\2\77\5\0\3\77\1\0\1\77\1\0\1\77\3\0"+ - "\1\77\2\0\1\77\1\211\2\77\1\0\22\77\55\0"+ - "\1\212\55\0\1\213\66\0\1\125\11\0\1\125\2\0"+ - "\1\214\62\0\1\215\11\0\1\215\4\0\1\215\44\0"+ - "\1\215\12\0\6\111\1\216\1\0\70\111\1\0\2\112"+ - "\1\0\2\112\5\0\3\112\1\0\1\112\1\0\1\112"+ - "\3\0\1\112\2\0\4\112\1\0\22\112\21\0\6\217"+ - "\2\0\70\217\1\0\2\114\1\0\2\114\5\0\3\114"+ - "\1\0\1\114\1\0\1\114\3\0\1\114\2\0\4\114"+ - "\1\0\22\114\21\0\6\220\2\0\70\220\7\117\1\0"+ - "\70\117\34\0\1\221\44\0\1\122\11\0\1\122\2\0"+ - "\1\222\1\110\20\0\1\110\40\0\2\123\10\0\1\123"+ - "\1\0\1\123\1\223\1\123\1\0\1\224\13\0\1\123"+ - "\2\0\1\123\1\224\1\123\3\0\1\123\3\0\1\123"+ - "\3\0\1\123\22\0\1\124\11\0\1\124\2\0\1\225"+ - "\62\0\1\125\11\0\1\125\3\0\1\110\20\0\1\110"+ - "\37\0\7\22\1\0\70\22\24\0\1\226\54\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\2\11\1\227\1\11\1\0\10\11"+ - "\1\230\11\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\231\2\0\4\11"+ - "\1\0\5\11\1\232\10\11\1\233\3\11\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\4\11\1\0\4\11\1\234\15\11"+ - "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ - "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\4\11"+ - "\1\235\15\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\4\11"+ - "\1\0\2\11\1\236\17\11\22\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ - "\2\0\4\11\1\0\5\11\1\237\14\11\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\4\11\1\0\12\11\1\240\7\11"+ - "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ - "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\14\11"+ - "\1\241\5\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\3\11"+ - "\1\242\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\4\11\1\0\1\243\21\11\22\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ - "\2\0\4\11\1\0\22\11\5\0\1\244\14\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\1\245\3\11\1\0\22\11\22\0"+ - "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ - "\1\11\3\0\1\11\2\0\4\11\1\0\3\11\1\246"+ - "\16\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ - "\1\11\1\0\1\11\3\0\1\11\2\0\2\11\1\247"+ - "\1\11\1\0\3\11\1\250\16\11\22\0\2\11\1\0"+ - "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ - "\1\11\2\0\4\11\1\0\2\11\1\251\17\11\22\0"+ - "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ - "\1\11\3\0\1\11\2\0\4\11\1\0\10\11\1\252"+ - "\11\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ - "\1\11\1\0\1\11\3\0\1\11\2\0\4\11\1\0"+ - "\14\11\1\253\5\11\22\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\2\11\1\254\1\11\1\0\22\11\22\0\2\11\1\0"+ - "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ - "\1\11\2\0\4\11\1\0\10\11\1\255\3\11\1\256"+ - "\5\11\54\0\1\257\3\0\1\260\123\0\1\261\74\0"+ - "\1\262\101\0\1\263\100\0\1\264\15\0\2\202\1\0"+ - "\2\202\5\0\3\202\1\0\1\202\1\0\1\202\3\0"+ - "\1\202\2\0\4\202\1\0\22\202\21\0\6\265\2\0"+ - "\70\265\1\0\2\266\10\0\1\266\1\0\1\266\1\0"+ - "\1\266\15\0\1\266\2\0\1\266\1\0\1\266\3\0"+ - "\1\266\3\0\1\266\3\0\1\266\45\0\1\74\53\0"+ - "\6\210\1\267\1\0\70\210\1\0\2\77\1\0\2\77"+ - "\5\0\3\77\1\0\1\77\1\0\1\77\3\0\1\77"+ - "\2\0\2\77\1\270\1\77\1\0\22\77\22\0\1\215"+ - "\11\0\1\215\64\0\6\217\1\271\1\0\70\217\6\220"+ - "\1\272\1\0\70\220\12\0\1\273\66\0\1\125\11\0"+ - "\1\125\65\0\2\274\10\0\1\274\1\0\1\274\1\214"+ - "\1\274\15\0\1\274\2\0\1\274\1\0\1\274\3\0"+ - "\1\274\3\0\1\274\3\0\1\274\22\0\1\215\11\0"+ - "\1\215\4\0\1\275\44\0\1\275\30\0\1\214\62\0"+ - "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ - "\1\11\3\0\1\11\2\0\3\11\1\276\1\0\22\11"+ - "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ - "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\1\11"+ - "\1\277\20\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\4\11"+ - "\1\0\3\11\1\300\16\11\22\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ - "\2\0\2\11\1\301\1\11\1\0\22\11\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\4\11\1\0\3\11\1\302\16\11"+ - "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ - "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\3\11"+ - "\1\303\16\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\1\304"+ - "\3\11\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\3\11\1\305\1\0\22\11\22\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ - "\2\0\4\11\1\0\3\11\1\306\16\11\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\4\11\1\0\14\11\1\307\5\11"+ - "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ - "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\3\11"+ - "\1\310\16\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\4\11"+ - "\1\0\6\11\1\311\13\11\22\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\312"+ - "\2\0\4\11\1\0\22\11\22\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ - "\2\0\4\11\1\0\5\11\1\313\14\11\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\4\11\1\0\14\11\1\314\5\11"+ - "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ - "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\2\11"+ - "\1\315\17\11\22\0\2\11\1\0\2\11\5\0\3\11"+ - "\1\0\1\11\1\0\1\11\3\0\1\11\2\0\3\11"+ - "\1\316\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\3\11\1\317\1\0\22\11\22\0\2\320\1\0\2\320"+ - "\5\0\3\320\1\0\1\320\1\0\1\320\3\0\1\320"+ - "\2\0\4\320\1\0\22\320\21\0\6\265\1\321\1\0"+ - "\70\265\1\0\2\322\10\0\1\322\1\0\1\322\1\0"+ - "\1\322\15\0\1\322\2\0\1\322\1\0\1\322\3\0"+ - "\1\322\3\0\1\322\3\0\1\322\22\0\2\77\1\0"+ - "\2\77\5\0\3\77\1\0\1\77\1\0\1\77\3\0"+ - "\1\77\2\0\3\77\1\323\1\0\22\77\22\0\2\274"+ - "\10\0\1\274\1\0\1\274\1\0\1\274\1\0\1\224"+ - "\13\0\1\274\2\0\1\274\1\224\1\274\3\0\1\274"+ - "\3\0\1\274\3\0\1\274\22\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ - "\2\0\4\11\1\0\13\11\1\324\6\11\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\1\325\3\11\1\0\22\11\22\0"+ - "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ - "\1\11\3\0\1\11\2\0\4\11\1\0\10\11\1\326"+ - "\11\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ - "\1\11\1\0\1\11\3\0\1\11\2\0\2\11\1\327"+ - "\1\11\1\0\22\11\22\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\3\11\1\330\1\0\22\11\22\0\2\11\1\0\2\11"+ - "\5\0\3\11\1\0\1\11\1\0\1\11\3\0\1\11"+ - "\2\0\4\11\1\0\1\331\21\11\22\0\2\11\1\0"+ - "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ - "\1\11\2\0\4\11\1\0\5\11\1\332\14\11\22\0"+ - "\2\11\1\0\2\11\5\0\3\11\1\0\1\11\1\0"+ - "\1\11\3\0\1\11\2\0\4\11\1\0\10\11\1\333"+ - "\11\11\22\0\2\11\1\0\2\11\5\0\3\11\1\0"+ - "\1\11\1\0\1\11\3\0\1\11\2\0\4\11\1\0"+ - "\6\11\1\334\13\11\22\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\4\11\1\0\3\11\1\335\16\11\22\0\2\11\1\0"+ - "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ - "\1\11\2\0\4\11\1\0\3\11\1\336\16\11\22\0"+ - "\2\337\10\0\1\337\1\0\1\337\1\0\1\337\15\0"+ - "\1\337\2\0\1\337\1\0\1\337\3\0\1\337\3\0"+ - "\1\337\3\0\1\337\22\0\2\11\1\0\2\11\5\0"+ - "\3\11\1\0\1\11\1\0\1\11\3\0\1\11\2\0"+ - "\4\11\1\0\2\11\1\340\17\11\22\0\2\11\1\0"+ - "\2\11\5\0\3\11\1\0\1\11\1\0\1\11\3\0"+ - "\1\11\2\0\1\341\3\11\1\0\22\11\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\4\11\1\0\7\11\1\342\12\11"+ - "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ - "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\2\11"+ - "\1\343\17\11\22\0\2\205\10\0\1\205\1\0\1\205"+ - "\1\0\1\205\15\0\1\205\2\0\1\205\1\0\1\205"+ - "\3\0\1\205\3\0\1\205\3\0\1\205\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\344\2\0\4\11\1\0\22\11\22\0\2\11"+ - "\1\0\2\11\5\0\3\11\1\0\1\11\1\0\1\11"+ - "\3\0\1\11\2\0\4\11\1\0\3\11\1\345\16\11"+ - "\22\0\2\11\1\0\2\11\5\0\3\11\1\0\1\11"+ - "\1\0\1\11\3\0\1\11\2\0\4\11\1\0\3\11"+ - "\1\346\16\11\21\0"; - - private static int [] zzUnpackTrans() { - int [] result = new int[9536]; - int offset = 0; - offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackTrans(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - value--; - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /* error codes */ - private static final int ZZ_UNKNOWN_ERROR = 0; - private static final int ZZ_NO_MATCH = 1; - private static final int ZZ_PUSHBACK_2BIG = 2; - private static final char[] EMPTY_BUFFER = new char[0]; - private static final int YYEOF = -1; - private static java.io.Reader zzReader = null; // Fake - - /* error messages for the codes above */ - private static final String ZZ_ERROR_MSG[] = { - "Unkown internal scanner error", - "Error: could not match input", - "Error: pushback value was too large" - }; - - /** - * ZZ_ATTRIBUTE[aState] contains the attributes of state aState - */ - private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); - - private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\6\0\1\11\14\1\2\11\23\1\1\11\2\1\1\11"+ - "\4\1\7\11\1\1\1\11\1\1\1\0\2\11\2\1"+ - "\1\0\1\1\1\11\2\1\2\11\1\0\1\1\1\0"+ - "\1\1\1\0\1\1\1\0\1\11\2\1\1\11\4\1"+ - "\5\11\1\1\1\0\7\1\1\11\20\1\1\0\1\1"+ - "\1\0\1\11\1\0\2\11\1\1\5\11\1\1\1\0"+ - "\2\11\1\1\2\0\1\1\3\11\1\1\1\11\2\0"+ - "\1\1\4\0\1\11\15\1\1\11\14\1\4\11\2\0"+ - "\1\11\1\1\3\11\1\1\1\0\22\1\2\11\1\0"+ - "\14\1\1\0\7\1"; - - private static int [] zzUnpackAttribute() { - int [] result = new int[230]; - int offset = 0; - offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAttribute(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - /** the current state of the DFA */ - private int zzState; - - /** the current lexical state */ - private int zzLexicalState = YYINITIAL; - - /** this buffer contains the current text to be matched and is - the source of the yytext() string */ - private CharSequence zzBuffer = ""; - - /** this buffer may contains the current text array to be matched when it is cheap to acquire it */ - private char[] zzBufferArray; - - /** the textposition at the last accepting state */ - private int zzMarkedPos; - - /** the textposition at the last state to be included in yytext */ - private int zzPushbackPos; - - /** the current text position in the buffer */ - private int zzCurrentPos; - - /** startRead marks the beginning of the yytext() string in the buffer */ - private int zzStartRead; - - /** endRead marks the last character in the buffer, that has been read - from input */ - private int zzEndRead; - - /** - * zzAtBOL == true <=> the scanner is currently at the beginning of a line - */ - private boolean zzAtBOL = true; - - /** zzAtEOF == true <=> the scanner is at the EOF */ - private boolean zzAtEOF; - - /** denotes if the user-EOF-code has already been executed */ - private boolean zzEOFDone; - - /* user code: */ - private static final class State { - final int lBraceCount; - final int state; - - public State(int state, int lBraceCount) { - this.state = state; - this.lBraceCount = lBraceCount; - } - - @Override - public String toString() { - return "yystate = " + state + (lBraceCount == 0 ? "" : "lBraceCount = " + lBraceCount); - } - } - - private final Stack states = new Stack(); - private int lBraceCount; - - private int commentStart; - private int commentDepth; - - private void pushState(int state) { - states.push(new State(yystate(), lBraceCount)); - lBraceCount = 0; - yybegin(state); - } - - private void popState() { - State state = states.pop(); - lBraceCount = state.lBraceCount; - yybegin(state.state); - } - - private IElementType commentStateToTokenType(int state) { - switch (state) { - case BLOCK_COMMENT: - return JetTokens.BLOCK_COMMENT; - case DOC_COMMENT: - return JetTokens.DOC_COMMENT; - default: - throw new IllegalArgumentException("Unexpected state: " + state); - } - } - - - _JetLexer(java.io.Reader in) { - this.zzReader = in; - } - - /** - * Creates a new scanner. - * There is also java.io.Reader version of this constructor. - * - * @param in the java.io.Inputstream to read input from. - */ - _JetLexer(java.io.InputStream in) { - this(new java.io.InputStreamReader(in)); - } - - /** - * Unpacks the compressed character translation table. - * - * @param packed the packed character translation table - * @return the unpacked character translation table - */ - private static char [] zzUnpackCMap(String packed) { - char [] map = new char[0x10000]; - int i = 0; /* index in packed string */ - int j = 0; /* index in unpacked array */ - while (i < 1326) { - int count = packed.charAt(i++); - char value = packed.charAt(i++); - do map[j++] = value; while (--count > 0); - } - return map; - } - - public final int getTokenStart(){ - return zzStartRead; - } - - public final int getTokenEnd(){ - return getTokenStart() + yylength(); - } - - public void reset(CharSequence buffer, int start, int end,int initialState){ - zzBuffer = buffer; - zzBufferArray = com.intellij.util.text.CharArrayUtil.fromSequenceWithoutCopying(buffer); - zzCurrentPos = zzMarkedPos = zzStartRead = start; - zzPushbackPos = 0; - zzAtEOF = false; - zzAtBOL = true; - zzEndRead = end; - yybegin(initialState); - } - - /** - * Refills the input buffer. - * - * @return false, iff there was new input. - * - * @exception java.io.IOException if any I/O-Error occurs - */ - private boolean zzRefill() throws java.io.IOException { - return true; - } - - - /** - * Returns the current lexical state. - */ - public final int yystate() { - return zzLexicalState; - } - - - /** - * Enters a new lexical state - * - * @param newState the new lexical state - */ - public final void yybegin(int newState) { - zzLexicalState = newState; - } - - - /** - * Returns the text matched by the current regular expression. - */ - public final CharSequence yytext() { - return zzBuffer.subSequence(zzStartRead, zzMarkedPos); - } - - - /** - * Returns the character at position pos from the - * matched text. - * - * It is equivalent to yytext().charAt(pos), but faster - * - * @param pos the position of the character to fetch. - * A value from 0 to yylength()-1. - * - * @return the character at position pos - */ - public final char yycharat(int pos) { - return zzBufferArray != null ? zzBufferArray[zzStartRead+pos]:zzBuffer.charAt(zzStartRead+pos); - } - - - /** - * Returns the length of the matched text region. - */ - public final int yylength() { - return zzMarkedPos-zzStartRead; - } - - - /** - * Reports an error that occured while scanning. - * - * In a wellformed scanner (no or only correct usage of - * yypushback(int) and a match-all fallback rule) this method - * will only be called with things that "Can't Possibly Happen". - * If this method is called, something is seriously wrong - * (e.g. a JFlex bug producing a faulty scanner etc.). - * - * Usual syntax/scanner level error handling should be done - * in error fallback rules. - * - * @param errorCode the code of the errormessage to display - */ - private void zzScanError(int errorCode) { - String message; - try { - message = ZZ_ERROR_MSG[errorCode]; - } - catch (ArrayIndexOutOfBoundsException e) { - message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; - } - - throw new Error(message); - } - - - /** - * Pushes the specified amount of characters back into the input stream. - * - * They will be read again by then next call of the scanning method - * - * @param number the number of characters to be read again. - * This number must not be greater than yylength()! - */ - public void yypushback(int number) { - if ( number > yylength() ) - zzScanError(ZZ_PUSHBACK_2BIG); - - zzMarkedPos -= number; - } - - - /** - * Contains user EOF-code, which will be executed exactly once, - * when the end of file is reached - */ - private void zzDoEOF() { - if (!zzEOFDone) { - zzEOFDone = true; - return; - - } - } - - - /** - * Resumes scanning until the next regular expression is matched, - * the end of input is encountered or an I/O-Error occurs. - * - * @return the next token - * @exception java.io.IOException if any I/O-Error occurs - */ - public IElementType advance() throws java.io.IOException { - int zzInput; - int zzAction; - - // cached fields: - int zzCurrentPosL; - int zzMarkedPosL; - int zzEndReadL = zzEndRead; - CharSequence zzBufferL = zzBuffer; - char[] zzBufferArrayL = zzBufferArray; - char [] zzCMapL = ZZ_CMAP; - - int [] zzTransL = ZZ_TRANS; - int [] zzRowMapL = ZZ_ROWMAP; - int [] zzAttrL = ZZ_ATTRIBUTE; - - while (true) { - zzMarkedPosL = zzMarkedPos; - - zzAction = -1; - - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - - zzState = ZZ_LEXSTATE[zzLexicalState]; - - - zzForAction: { - while (true) { - - if (zzCurrentPosL < zzEndReadL) - zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++); - else if (zzAtEOF) { - zzInput = YYEOF; - break zzForAction; - } - else { - // store back cached positions - zzCurrentPos = zzCurrentPosL; - zzMarkedPos = zzMarkedPosL; - boolean eof = zzRefill(); - // get translated positions and possibly new buffer - zzCurrentPosL = zzCurrentPos; - zzMarkedPosL = zzMarkedPos; - zzBufferL = zzBuffer; - zzEndReadL = zzEndRead; - if (eof) { - zzInput = YYEOF; - break zzForAction; - } - else { - zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++); - } - } - int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; - if (zzNext == -1) break zzForAction; - zzState = zzNext; - - int zzAttributes = zzAttrL[zzState]; - if ( (zzAttributes & 1) == 1 ) { - zzAction = zzState; - zzMarkedPosL = zzCurrentPosL; - if ( (zzAttributes & 8) == 8 ) break zzForAction; - } - - } - } - - // store back cached position - zzMarkedPos = zzMarkedPosL; - - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 3: - { return JetTokens.IDENTIFIER; - } - case 104: break; - case 10: - { pushState(STRING); return JetTokens.OPEN_QUOTE; - } - case 105: break; - case 74: - { return JetTokens.FOR_KEYWORD ; - } - case 106: break; - case 101: - { return JetTokens.RETURN_KEYWORD ; - } - case 107: break; - case 87: - { return JetTokens.NULL_KEYWORD ; - } - case 108: break; - case 15: - { return JetTokens.LT ; - } - case 109: break; - case 52: - { return JetTokens.DO_KEYWORD ; - } - case 110: break; - case 20: - { return JetTokens.PLUS ; - } - case 111: break; - case 58: - { return JetTokens.PLUSEQ ; - } - case 112: break; - case 92: - { popState(); return JetTokens.THIS_KEYWORD; - } - case 113: break; - case 28: - { return JetTokens.COMMA ; - } - case 114: break; - case 17: - { return JetTokens.GT ; - } - case 115: break; - case 4: - { return JetTokens.WHITE_SPACE; - } - case 116: break; - case 25: - { return JetTokens.RPAR ; - } - case 117: break; - case 56: - { return JetTokens.DOUBLE_ARROW; - } - case 118: break; - case 85: - { return JetTokens.TRUE_KEYWORD ; - } - case 119: break; - case 80: - { return JetTokens.IDE_TEMPLATE_START ; - } - case 120: break; - case 37: - { return JetTokens.FIELD_IDENTIFIER; - } - case 121: break; - case 60: - { return JetTokens.ANDAND ; - } - case 122: break; - case 64: - { pushState(LONG_TEMPLATE_ENTRY); return JetTokens.LONG_TEMPLATE_ENTRY_START; - } - case 123: break; - case 36: - { return JetTokens.FLOAT_LITERAL; - } - case 124: break; - case 40: - { return JetTokens.EOL_COMMENT; - } - case 125: break; - case 89: - { return JetTokens.WHEN_KEYWORD ; - } - case 126: break; - case 70: - { pushState(RAW_STRING); return JetTokens.OPEN_QUOTE; - } - case 127: break; - case 26: - { return JetTokens.COLON ; - } - case 128: break; - case 54: - { return JetTokens.LTEQ ; - } - case 129: break; - case 45: - { return JetTokens.ARROW ; - } - case 130: break; - case 32: - { popState(); return JetTokens.IDENTIFIER; - } - case 131: break; - case 22: - { return JetTokens.LBRACKET ; - } - case 132: break; - case 68: - { yypushback(2); return JetTokens.INTEGER_LITERAL; - } - case 133: break; - case 9: - { return JetTokens.CHARACTER_LITERAL; - } - case 134: break; - case 75: - { return JetTokens.VAR_KEYWORD ; - } - case 135: break; - case 55: - { return JetTokens.GTEQ ; - } - case 136: break; - case 2: - { return JetTokens.INTEGER_LITERAL; - } - case 137: break; - case 12: - { return JetTokens.RBRACE ; - } - case 138: break; - case 96: - { return JetTokens.CLASS_KEYWORD ; - } - case 139: break; - case 14: - { return JetTokens.EXCL ; - } - case 140: break; - case 71: - { return JetTokens.TRY_KEYWORD ; - } - case 141: break; - case 53: - { return JetTokens.EXCLEQ ; - } - case 142: break; - case 46: - { return JetTokens.MINUSEQ ; - } - case 143: break; - case 102: - { return JetTokens.PACKAGE_KEYWORD ; - } - case 144: break; - case 93: - { return JetTokens.THROW_KEYWORD ; - } - case 145: break; - case 95: - { return JetTokens.SUPER_KEYWORD ; - } - case 146: break; - case 98: - { return JetTokens.WHILE_KEYWORD ; - } - case 147: break; - case 44: - { return JetTokens.MINUSMINUS; - } - case 148: break; - case 103: - { return JetTokens.CONTINUE_KEYWORD ; - } - case 149: break; - case 78: - { return JetTokens.NOT_IN; - } - case 150: break; - case 39: - { return JetTokens.ATAT ; - } - case 151: break; - case 69: - { pushState(DOC_COMMENT); - commentDepth = 0; - commentStart = getTokenStart(); - } - case 152: break; - case 6: - { return JetTokens.DIV ; - } - case 153: break; - case 63: - { pushState(SHORT_TEMPLATE_ENTRY); - yypushback(yylength() - 1); - return JetTokens.SHORT_TEMPLATE_ENTRY_START; - } - case 154: break; - case 81: - { return JetTokens.IDE_TEMPLATE_END ; - } - case 155: break; - case 38: - { return JetTokens.LABEL_IDENTIFIER; - } - case 156: break; - case 29: - { return JetTokens.REGULAR_STRING_PART; - } - case 157: break; - case 19: - { return JetTokens.QUEST ; - } - case 158: break; - case 61: - { return JetTokens.OROR ; - } - case 159: break; - case 21: - { return JetTokens.PERC ; - } - case 160: break; - case 79: - { return JetTokens.EXCLEQEQEQ; - } - case 161: break; - case 62: - { return JetTokens.PERCEQ ; - } - case 162: break; - case 43: - { return JetTokens.RANGE ; - } - case 163: break; - case 1: - { return TokenType.BAD_CHARACTER; - } - case 164: break; - case 77: - { return JetTokens.NOT_IS; - } - case 165: break; - case 13: - { return JetTokens.MUL ; - } - case 166: break; - case 23: - { return JetTokens.RBRACKET ; - } - case 167: break; - case 59: - { return JetTokens.PLUSPLUS ; - } - case 168: break; - case 84: - { return JetTokens.THIS_KEYWORD ; - } - case 169: break; - case 7: - { return JetTokens.DOT ; - } - case 170: break; - case 27: - { return JetTokens.SEMICOLON ; - } - case 171: break; - case 49: - { return JetTokens.IF_KEYWORD ; - } - case 172: break; - case 65: - { return JetTokens.ESCAPE_SEQUENCE; - } - case 173: break; - case 41: - { pushState(BLOCK_COMMENT); - commentDepth = 0; - commentStart = getTokenStart(); - } - case 174: break; - case 31: - { popState(); return JetTokens.CLOSING_QUOTE; - } - case 175: break; - case 18: - { return JetTokens.EQ ; - } - case 176: break; - case 5: - { return JetTokens.AT ; - } - case 177: break; - case 72: - { return JetTokens.AS_SAFE; - } - case 178: break; - case 24: - { return JetTokens.LPAR ; - } - case 179: break; - case 8: - { return JetTokens.MINUS ; - } - case 180: break; - case 67: - { if (commentDepth > 0) { - commentDepth--; - } - else { - int state = yystate(); - popState(); - zzStartRead = commentStart; - return commentStateToTokenType(state); - } - } - case 181: break; - case 99: - { return JetTokens.FALSE_KEYWORD ; - } - case 182: break; - case 86: - { return JetTokens.TYPE_KEYWORD ; - } - case 183: break; - case 66: - { commentDepth++; - } - case 184: break; - case 73: - { return JetTokens.FUN_KEYWORD ; - } - case 185: break; - case 47: - { return JetTokens.IS_KEYWORD ; - } - case 186: break; - case 30: - { popState(); yypushback(1); return JetTokens.DANGLING_NEWLINE; - } - case 187: break; - case 34: - { lBraceCount++; return JetTokens.LBRACE; - } - case 188: break; - case 91: - { yypushback(3); return JetTokens.EXCL; - } - case 189: break; - case 42: - { return JetTokens.DIVEQ ; - } - case 190: break; - case 88: - { return JetTokens.ELSE_KEYWORD ; - } - case 191: break; - case 51: - { return JetTokens.AS_KEYWORD ; - } - case 192: break; - case 48: - { return JetTokens.IN_KEYWORD ; - } - case 193: break; - case 57: - { return JetTokens.EQEQ ; - } - case 194: break; - case 82: - { return JetTokens.EQEQEQ ; - } - case 195: break; - case 76: - { return JetTokens.VAL_KEYWORD ; - } - case 196: break; - case 90: - { return JetTokens.CAPITALIZED_THIS_KEYWORD ; - } - case 197: break; - case 50: - { return JetTokens.MULTEQ ; - } - case 198: break; - case 11: - { return JetTokens.LBRACE ; - } - case 199: break; - case 100: - { return JetTokens.OBJECT_KEYWORD ; - } - case 200: break; - case 97: - { return JetTokens.BREAK_KEYWORD ; - } - case 201: break; - case 83: - { return JetTokens.BLOCK_COMMENT; - } - case 202: break; - case 94: - { return JetTokens.TRAIT_KEYWORD ; - } - case 203: break; - case 33: - { - } - case 204: break; - case 35: - { if (lBraceCount == 0) { - popState(); - return JetTokens.LONG_TEMPLATE_ENTRY_END; - } - lBraceCount--; - return JetTokens.RBRACE; - } - case 205: break; - case 16: - { return JetTokens.HASH ; - } - case 206: break; - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - zzDoEOF(); - switch (zzLexicalState) { - case BLOCK_COMMENT: { - int state = yystate(); - popState(); - zzStartRead = commentStart; - return commentStateToTokenType(state); - } - case 231: break; - case DOC_COMMENT: { - int state = yystate(); - popState(); - zzStartRead = commentStart; - return commentStateToTokenType(state); - } - case 232: break; - default: - return null; - } - } - else { - zzScanError(ZZ_NO_MATCH); - } - } - } - } - - -} diff --git a/confluence/src/main/java/org/jetbrains/jet/tags/StyledDivTagType.java b/confluence/src/main/java/org/jetbrains/jet/tags/StyledDivTagType.java deleted file mode 100644 index a6a4b7bbe25..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/tags/StyledDivTagType.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.jetbrains.jet.tags; - -import org.jetbrains.jet.ConfluenceUtils; - -/** - * @author abreslav - */ - -public class StyledDivTagType extends TagType { - - public StyledDivTagType(String tagName) { - super(tagName); - } - - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - assert tagData.getType() == this; - builder.append("
"); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/tags/TagData.java b/confluence/src/main/java/org/jetbrains/jet/tags/TagData.java deleted file mode 100644 index 0bf112f7986..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/tags/TagData.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.jetbrains.jet.tags; - -/** - * @author abreslav - */ - -public class TagData { - private final TagType type; - private final String message; - private final int start; - private final boolean nextToken; - private int end; - - public TagData(TagType type, String message, int start, boolean nextToken) { - this.type = type; - this.message = message; - this.start = start; - this.nextToken = nextToken; - } - - public TagType getType() { - return type; - } - - public String getMessage() { - return message; - } - - public int getStart() { - return start; - } - - public boolean isNextToken() { - return nextToken; - } - - public int getEnd() { - return end; - } - - public void setEnd(int end) { - this.end = end; - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/tags/TagType.java b/confluence/src/main/java/org/jetbrains/jet/tags/TagType.java deleted file mode 100644 index dcaea651a7b..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/tags/TagType.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.jetbrains.jet.tags; - -/** - * @author abreslav - */ - -public abstract class TagType { - private final String tagName; - - protected TagType(String tagName) { - this.tagName = tagName; - } - - public abstract void appendOpenTag(StringBuilder builder, TagData tagData); - public abstract void appendCloseTag(StringBuilder builder, TagData tagData); - - @Override - public String toString() { - return tagName; - } - - public String getTagName() { - return tagName; - } -} diff --git a/confluence/src/main/resources/atlassian-plugin.xml b/confluence/src/main/resources/atlassian-plugin.xml deleted file mode 100644 index e5253849327..00000000000 --- a/confluence/src/main/resources/atlassian-plugin.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - ${project.description} - ${project.version} - - - - - Highlighting for Kotlin language - - - Highlighting for Kotlin language - - - -      -      - - diff --git a/confluence/src/main/resources/kotlin.css b/confluence/src/main/resources/kotlin.css deleted file mode 100644 index 29449e81d79..00000000000 --- a/confluence/src/main/resources/kotlin.css +++ /dev/null @@ -1,81 +0,0 @@ -.jet { - display: inline; -} - -.code { - padding: 5px !important; -} - -.codeContent { - margin: 5px !important; -} - -.line { - white-space: pre !important; -} - -.jet.keyword { - font-weight: bold; - color: #369; -} - -.jet.softkeyword { - color: #369; -} - -.jet.jet-comment { - color : green; - -} - -.jet.number { - color : blue; -} -.jet.string { - color : #000099; -} -.jet.escape { - font-weight: bold; - color : black; -} -.jet.label { - color : blue; -} -.jet.field { - color : blue; - font-weight: bold; -} -.jet.bad { - background-color : #FF9999; - color:black; -} -.jet.error { - background: url(underline.gif) bottom repeat-x; - display:inline; -} -.jet.warning { - background-color : #f5eabb; - display:inline; -} -.jet.unresolved { - color : red; - display:inline; -} - -.jet.herror { - background-color: #FFAAAA; -} -.jet.hwarning { - background-color: #FFAAAA; - display:inline; -} - -.jet.ref:link { color: black; } -.jet.ref:visited { color: black; } -.jet.ref:hover { color:blue; text-decoration:underline; } -.jet.ref:active { color:blue; text-decoration:underline; } - -.jet.anchor:link { } -.jet.anchor:visited { } -.jet.anchor:hover { color:blue; text-decoration:underline; } -.jet.anchor:active { color:blue; text-decoration:underline; } diff --git a/confluence/src/main/resources/template.velocity b/confluence/src/main/resources/template.velocity deleted file mode 100644 index 8f0d70fe3cb..00000000000 --- a/confluence/src/main/resources/template.velocity +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/confluence/src/main/resources/underline.gif b/confluence/src/main/resources/underline.gif deleted file mode 100644 index b18243e7834c94a021c263453951a6e2843cb6c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 815 zcmXAov5gi`41+E1FF;}mq?Ff#L_@_X1Gwh~h!_PaV|ak{%#lG(ROUT+Mf57m@#nnc z_b;DcA9%tW{yzc&i~xcNA&dl)NFj{^iYTFs2AXK0jRA%jVT=WqSYdsXV8ViZCBc9K zjz9z>6yZojGE$L_LKLGE$7p1X{CKv2Ma2=0u`)Kg)33XN>#cFRjg8# zt5MBrRl5c?tWk|?QOjD@`lMK9S!Lfi!G;>{KnFY2;ZAh2Q=RTY7rWHuZgjI--R?mT zd(`7z^s-mIK4jW#tL=*j9BAMPOmIRIp2Q?4HR&l#aY|F3#x$oj?HSB)Ml+tpEN3A;go8H0}x3uMLY;#-N-oXxcwBudua#y=P4O(-pwQrR` zL#I`zOb$A98gRfn>C~ZhAi3z$N%jQlrdub4v%H5M9mmJ0mtGz9BWlyu`F;BH_;&-( Ycix-$_WmRM;qmtC$M2tyr+4`J7Z?49KL7v# diff --git a/confluence/src/test/java/org.jetbrains.jet.confluence/TestUtils.java b/confluence/src/test/java/org.jetbrains.jet.confluence/TestUtils.java deleted file mode 100644 index fb86e10779c..00000000000 --- a/confluence/src/test/java/org.jetbrains.jet.confluence/TestUtils.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.jetbrains.jet.confluence; - -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; - -/** - * @author Natalia.Ukhorskaya - */ - -public class TestUtils { - - public static String readFile(File file) throws IOException { - FileReader reader = new FileReader(file); - StringBuilder builder = new StringBuilder(); - int c; - while ((c = reader.read()) >= 0) { - builder.append((char) c); - } - reader.close(); - return builder.toString(); - } - - public static void writeFile(File file, String str) throws IOException { - FileWriter writer = new FileWriter(file); - writer.write(str); - writer.close(); - } - - public static String divideResultForLines(String result) { - return result.replaceAll("
", "\n
"); - } -} diff --git a/confluence/src/test/java/org.jetbrains.jet.confluence/rendering/ConfluenceRenderingTest.java b/confluence/src/test/java/org.jetbrains.jet.confluence/rendering/ConfluenceRenderingTest.java deleted file mode 100644 index b0ae2a407a7..00000000000 --- a/confluence/src/test/java/org.jetbrains.jet.confluence/rendering/ConfluenceRenderingTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.jetbrains.jet.confluence.rendering; - -import com.atlassian.renderer.v2.macro.MacroException; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; -import org.jetbrains.jet.confluence.TestUtils; -import org.jetbrains.jet.lexer.JetMacro; - -import java.io.File; -import java.io.IOException; - -/** - * @author Natalia.Ukhorskaya - */ - -public class ConfluenceRenderingTest extends TestCase { - - public static Test suite() { - TestSuite suite = new TestSuite(); - TestSuite ats = new TestSuite(); - suite.addTest(ats); - File parsingSourceDir = new File("./testData/rendering"); - addFilesFromDirToSuite(parsingSourceDir, ats); - return suite; - } - - private static void addFilesFromDirToSuite(File file, TestSuite ats) { - if (file.isDirectory()) { - for (File sourceFile : file.listFiles()) { - addFilesFromDirToSuite(sourceFile, ats); - } - } else { - if (file.getName().endsWith(".kt")) { - ats.addTest(new ConfluenceRenderingTest(file.getName(), file)); - } - } - } - - private final File sourceFile; - - public ConfluenceRenderingTest(String name, File sourceFile) { - super(name); - this.sourceFile = sourceFile; - } - - @Override - protected void runTest() throws Throwable { - checkSourceFile(sourceFile); - } - - private void checkSourceFile(File sourceFile) throws IOException, MacroException { - String source = TestUtils.readFile(sourceFile); - - StringBuilder actualResult = new StringBuilder(); - new JetMacro().generateHtmlFromCode(source, actualResult); - - File expectedResultFile = new File(sourceFile.getAbsolutePath().replace(".kt", ".txt")); - if (!expectedResultFile.exists()) { - expectedResultFile.createNewFile(); - TestUtils.writeFile(expectedResultFile, TestUtils.divideResultForLines(actualResult.toString())); - assertTrue("File with expected result for " + expectedResultFile.getAbsolutePath() + " is absent.", false); - } - - String expectedResult = TestUtils.readFile(expectedResultFile); - - - assertEquals(expectedResult, - TestUtils.divideResultForLines(actualResult.toString())); - } -} diff --git a/confluence/testData/rendering/elements/class.kt b/confluence/testData/rendering/elements/class.kt deleted file mode 100644 index a082c511e08..00000000000 --- a/confluence/testData/rendering/elements/class.kt +++ /dev/null @@ -1,7 +0,0 @@ -class Greeter1() { - -} - -class Greeter2(val name : String) { - -} \ No newline at end of file diff --git a/confluence/testData/rendering/elements/class.txt b/confluence/testData/rendering/elements/class.txt deleted file mode 100644 index a579e219588..00000000000 --- a/confluence/testData/rendering/elements/class.txt +++ /dev/null @@ -1,8 +0,0 @@ -
-
class Greeter1() { 
-
 
-
} 
-
 
-
class Greeter2(val name : String) { 
-
 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/elements/variable.kt b/confluence/testData/rendering/elements/variable.kt deleted file mode 100644 index 7364e4d32c7..00000000000 --- a/confluence/testData/rendering/elements/variable.kt +++ /dev/null @@ -1,5 +0,0 @@ -val a : Int = 1 -val b = 1 -val c : Int -c = 1 -var a : String = "sss" \ No newline at end of file diff --git a/confluence/testData/rendering/elements/variable.txt b/confluence/testData/rendering/elements/variable.txt deleted file mode 100644 index bdfa9adad8b..00000000000 --- a/confluence/testData/rendering/elements/variable.txt +++ /dev/null @@ -1,6 +0,0 @@ -
-
val a : Int = 1 
-
val b = 1 
-
val c : Int 
-
c = 1 
-
var a : String = "sss"
\ No newline at end of file diff --git a/confluence/testData/rendering/elements/when.kt b/confluence/testData/rendering/elements/when.kt deleted file mode 100644 index 6faddf20ae9..00000000000 --- a/confluence/testData/rendering/elements/when.kt +++ /dev/null @@ -1,7 +0,0 @@ -val language = if (args.size == 0) "EN" else args[0] -when (language) { - "EN" -> "Hello!" - "ES" -> "¡Hola!" - "RU" -> "Привет!" - else -> "Sorry, I can't greet you in $language yet" -} \ No newline at end of file diff --git a/confluence/testData/rendering/elements/when.txt b/confluence/testData/rendering/elements/when.txt deleted file mode 100644 index b316772466b..00000000000 --- a/confluence/testData/rendering/elements/when.txt +++ /dev/null @@ -1,8 +0,0 @@ -
-
val language = if (args.size == 0) "EN" else args[0] 
-
when (language) { 
-
 "EN" -> "Hello!" 
-
 "ES" -> "¡Hola!" 
-
 "RU" -> "Привет!" 
-
 else -> "Sorry, I can't greet you in $language yet" 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/adress_book.kt b/confluence/testData/rendering/examples/adress_book.kt deleted file mode 100644 index 9cb0446a0e9..00000000000 --- a/confluence/testData/rendering/examples/adress_book.kt +++ /dev/null @@ -1,47 +0,0 @@ -namespace addressbook - -class Contact( - val name : String, - val emails : List, - val addresses : List, - val phonenums : List -) - -class EmailAddress( - val user : String, - val host : String -) - -class PostalAddress( - val streetAddress : String, - val city : String, - val zip : String, - val state : USState?, - val country : Country -) { - assert {(state == null) xor (country == Countries["US"]) } -} - -class PhoneNumber( - val country : Country, - val areaCode : Int, - val number : Long -) - -object Countries { - fun get(id : CountryID) : Country = countryTable[id] - - private var table : Map? = null - private val countryTable : Map - get() { - if (table == null) { - table = HashMap() - for (line in TextFile("countries.txt").lines(stripWhiteSpace = true)) { - table[line] = Country(line) - } - } - return table - } -} - -class Country(val name : String) \ No newline at end of file diff --git a/confluence/testData/rendering/examples/adress_book.txt b/confluence/testData/rendering/examples/adress_book.txt deleted file mode 100644 index a650d815f59..00000000000 --- a/confluence/testData/rendering/examples/adress_book.txt +++ /dev/null @@ -1,48 +0,0 @@ -
-
namespace addressbook 
-
 
-
class Contact( 
-
  val name : String, 
-
  val emails : List<EmailAddress>, 
-
  val addresses : List<PostalAddress>, 
-
  val phonenums : List<PhoneNumber> 
-
) 
-
 
-
class EmailAddress( 
-
  val user : String, 
-
  val host : String 
-
) 
-
 
-
class PostalAddress( 
-
  val streetAddress : String, 
-
  val city : String, 
-
  val zip : String, 
-
  val state : USState?, 
-
  val country : Country 
-
) { 
-
   assert {(state == null) xor (country == Countries["US"]) } 
-
} 
-
 
-
class PhoneNumber( 
-
  val country : Country, 
-
  val areaCode : Int, 
-
  val number : Long 
-
) 
-
 
-
object Countries { 
-
  fun get(id : CountryID) : Country = countryTable[id] 
-
 
-
  private var table : Map<String, Country>? = null 
-
  private val countryTable : Map<String, Country> 
-
    get() { 
-
      if (table == null) { 
-
        table = HashMap() 
-
        for (line in TextFile("countries.txt").lines(stripWhiteSpace = true)) { 
-
          table[line] = Country(line) 
-
        } 
-
      } 
-
      return table 
-
    } 
-
} 
-
 
-
class Country(val name : String)
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_define_a_function.kt b/confluence/testData/rendering/examples/basic_syntax_define_a_function.kt deleted file mode 100644 index 3c0054a9da7..00000000000 --- a/confluence/testData/rendering/examples/basic_syntax_define_a_function.kt +++ /dev/null @@ -1,4 +0,0 @@ -// Return type mandatory -fun sum(a : Int, b : Int) : Int { - return a + b -} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_define_a_function.txt b/confluence/testData/rendering/examples/basic_syntax_define_a_function.txt deleted file mode 100644 index 5f330cc898d..00000000000 --- a/confluence/testData/rendering/examples/basic_syntax_define_a_function.txt +++ /dev/null @@ -1,5 +0,0 @@ -
-
// Return type mandatory 
-
fun sum(a : Int, b : Int) : Int { 
-
  return a + b 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_define_a_variable.kt b/confluence/testData/rendering/examples/basic_syntax_define_a_variable.kt deleted file mode 100644 index 84edfdb2aed..00000000000 --- a/confluence/testData/rendering/examples/basic_syntax_define_a_variable.kt +++ /dev/null @@ -1,4 +0,0 @@ -val a : Int = 1 -val b = 1 // Type is inferred -val c : Int // Type required when no initializer provided -c = 1 // definite assignment \ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_define_a_variable.txt b/confluence/testData/rendering/examples/basic_syntax_define_a_variable.txt deleted file mode 100644 index 51ee4531913..00000000000 --- a/confluence/testData/rendering/examples/basic_syntax_define_a_variable.txt +++ /dev/null @@ -1,5 +0,0 @@ -
-
val a : Int = 1 
-
val b = 1 // Type is inferred 
-
val c : Int // Type required when no initializer provided 
-
c = 1 // definite assignment
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_null_checks.kt b/confluence/testData/rendering/examples/basic_syntax_null_checks.kt deleted file mode 100644 index b33f0088667..00000000000 --- a/confluence/testData/rendering/examples/basic_syntax_null_checks.kt +++ /dev/null @@ -1,32 +0,0 @@ -package multiplier - -// Return null if str does not hold a number -fun parseInt(str : String) : Int? { - // ... -} - -fun main(args : Array) { - if (args.size < 2) { - print("No number supplied"); - } - val x = parseInt(args[0]) - val y = parseInt(args[1]) - - // We cannot say 'x * y' now because they may hold nulls - - if (x != null && y != null) { - print(x * y) // Now we can - } - - // ... - if (x == null) { - print("Wrong number format in '${args[0]}'") - return - } - if (y == null) { - print("Wrong number format in '${args[1]}'") - return - } - print(x * y) // Now we know that x and y are not nulls -} - diff --git a/confluence/testData/rendering/examples/basic_syntax_null_checks.txt b/confluence/testData/rendering/examples/basic_syntax_null_checks.txt deleted file mode 100644 index d35c9839f0b..00000000000 --- a/confluence/testData/rendering/examples/basic_syntax_null_checks.txt +++ /dev/null @@ -1,32 +0,0 @@ -
-
package multiplier 
-
 
-
// Return null if str does not hold a number 
-
fun parseInt(str : String) : Int? { 
-
  // ... 
-
} 
-
 
-
fun main(args : Array<String>) { 
-
  if (args.size < 2) { 
-
    print("No number supplied"); 
-
  } 
-
  val x = parseInt(args[0]) 
-
  val y = parseInt(args[1]) 
-
 
-
  // We cannot say 'x * y' now because they may hold nulls 
-
 
-
  if (x != null && y != null) { 
-
    print(x * y) // Now we can 
-
  } 
-
 
-
  // ... 
-
    if  (x == null) { 
-
      print("Wrong number format in '${args[0]}'") 
-
      return 
-
    } 
-
    if  (y == null) { 
-
      print("Wrong number format in '${args[1]}'") 
-
      return 
-
    } 
-
    print(x * y) // Now we know that x and y are not nulls 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.kt b/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.kt deleted file mode 100644 index 68c5739a540..00000000000 --- a/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.kt +++ /dev/null @@ -1,6 +0,0 @@ -fun max(a : Int, b : Int) : Int { - if (a > b) - return a - else - return b -} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.txt b/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.txt deleted file mode 100644 index 648c9af2ce2..00000000000 --- a/confluence/testData/rendering/examples/basic_syntax_use_a_conditional_expression.txt +++ /dev/null @@ -1,7 +0,0 @@ -
-
fun max(a : Int, b : Int) : Int { 
-
  if (a > b) 
-
    return a 
-
  else 
-
    return b 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.kt b/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.kt deleted file mode 100644 index 2d44afdbca6..00000000000 --- a/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.kt +++ /dev/null @@ -1,9 +0,0 @@ -fun main(args : Array) { - val language = if (args.size == 0) "EN" else args[0] - println(when (language) { - "EN" -> "Hello!" - "ES" -> "¡Hola!" - "RU" -> "Привет!" - else -> "Sorry, I can't greet you in $language yet" - }) -} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.txt b/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.txt deleted file mode 100644 index 48b9d279c0a..00000000000 --- a/confluence/testData/rendering/examples/hello_world_a_multi_language_hello.txt +++ /dev/null @@ -1,10 +0,0 @@ -
-
fun main(args : Array<String>) { 
-
  val language = if (args.size == 0) "EN" else args[0] 
-
  println(when (language) { 
-
    "EN" -> "Hello!" 
-
    "ES" -> "¡Hola!" 
-
    "RU" -> "Привет!" 
-
    else -> "Sorry, I can't greet you in $language yet" 
-
  }) 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.kt b/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.kt deleted file mode 100644 index 03499b9e807..00000000000 --- a/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.kt +++ /dev/null @@ -1,9 +0,0 @@ -class Greeter(val name : String) { - fun greet() { - println("Hello, ${name}"); - } -} - -fun main(args : Array) { - Greeter(args[0]).greet() -} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.txt b/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.txt deleted file mode 100644 index d85c333e4cd..00000000000 --- a/confluence/testData/rendering/examples/hello_world_an_object_oriented_hello.txt +++ /dev/null @@ -1,10 +0,0 @@ -
-
class Greeter(val name : String) { 
-
  fun greet() { 
-
    println("Hello, ${name}"); 
-
  } 
-
} 
-
 
-
fun main(args : Array<String>) { 
-
  Greeter(args[0]).greet() 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.kt b/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.kt deleted file mode 100644 index c1db6631119..00000000000 --- a/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.kt +++ /dev/null @@ -1,7 +0,0 @@ -fun main(args : Array) { - if (args.size == 0) { - println("Please provide a name as a command-line argument") - return - } - println("Hello, ${args[0]}!") -} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.txt b/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.txt deleted file mode 100644 index 272661aa570..00000000000 --- a/confluence/testData/rendering/examples/hello_world_reading_a_name_from_command_line.txt +++ /dev/null @@ -1,8 +0,0 @@ -
-
fun main(args : Array<String>) { 
-
  if (args.size == 0) { 
-
    println("Please provide a name as a command-line argument") 
-
    return 
-
  } 
-
  println("Hello, ${args[0]}!") 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/html_builder.kt b/confluence/testData/rendering/examples/html_builder.kt deleted file mode 100644 index 00bee9aa529..00000000000 --- a/confluence/testData/rendering/examples/html_builder.kt +++ /dev/null @@ -1,31 +0,0 @@ -import html.* - -fun result(args : Array) = - html { - head { - title {+"XML encoding with Kotlin"} - } - body { - h1 {+"XML encoding with Kotlin"} - p {+"this format can be used as an alternative markup to XML"} - - // an element with attributes and text content - a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} - - // mixed content - p { - +"This is some" - b {+"mixed"} - +"text. For more see the" - a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} - +"project" - } - p {+"some text"} - - // content generated by - p { - for (arg in args) - +arg - } - } - } \ No newline at end of file diff --git a/confluence/testData/rendering/examples/html_builder.txt b/confluence/testData/rendering/examples/html_builder.txt deleted file mode 100644 index a4e0257d8fd..00000000000 --- a/confluence/testData/rendering/examples/html_builder.txt +++ /dev/null @@ -1,32 +0,0 @@ -
-
import html.* 
-
 
-
fun result(args : Array<String>) = 
-
  html { 
-
    head { 
-
      title {+"XML encoding with Kotlin"} 
-
    } 
-
    body { 
-
      h1 {+"XML encoding with Kotlin"} 
-
      p {+"this format can be used as an alternative markup to XML"} 
-
 
-
      // an element with attributes and text content 
-
      a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} 
-
 
-
      // mixed content 
-
      p { 
-
        +"This is some" 
-
        b {+"mixed"} 
-
        +"text. For more see the" 
-
        a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} 
-
        +"project" 
-
      } 
-
      p {+"some text"} 
-
 
-
      // content generated by 
-
      p { 
-
        for (arg in args) 
-
          +arg 
-
      } 
-
    } 
-
  }
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/html_builder_with_refs.kt b/confluence/testData/rendering/examples/html_builder_with_refs.kt deleted file mode 100644 index 70ce56a58d5..00000000000 --- a/confluence/testData/rendering/examples/html_builder_with_refs.kt +++ /dev/null @@ -1,114 +0,0 @@ -import html.* - -fun result(args : Array) = - html { - head { - title {+"XML encoding with Kotlin"} - } - body { - h1 {+"XML encoding with Kotlin"} - p {+"this format can be used as an alternative markup to XML"} - - // an element with attributes and text content - a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} - - // mixed content - p { - +"This is some" - b {+"mixed"} - +"text. For more see the" - a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} - +"project" - } - p {+"some text"} - - // content generated by - p { - for (arg in args) - +arg - } - } - } - -namespace html { - - abstract class Factory { - fun create() : T - } - - abstract class Element - - class TextElement(val text : String) : Element - - abstract class Tag(val name : String) : Element { - val children = ArrayList() - val attributes = HashMap() - - protected fun initTag(init : T.() -> Unit) : T - where class object T : Factory { - val tag = T.create() - tag.init() - children.add(tag) - return tag - } - } - - abstract class TagWithText(name : String) : Tag(name) { - fun String.plus() { - children.add(TextElement(this)) - } - } - - class HTML() : TagWithText("html") { - class object : Factory { - override fun create() = HTML() - } - - fun head(init : Head.() -> Unit) = initTag(init) - - fun body(init : Body.() -> Unit) = initTag(init) - } - - class Head() : TagWithText("head") { - class object : Factory { - override fun create() = Head() - } - - fun title(init : Title.() -> Unit) = initTag(init) - } - - class Title() : TagWithText("title") - - abstract class BodyTag(name : String) : TagWithText(name) { - } - - class Body() : BodyTag("body") { - class object : Factory { - override fun create() = Body() - } - - fun b(init : B.() -> Unit) = initTag(init) - fun p(init : P.() -> Unit) = initTag(init) - fun h1(init : H1.() -> Unit) = initTag(init) - fun a(href : String, init : A.() -> Unit) { - val a = initTag(init) - a.href = href - } - } - - class B() : BodyTag("b") - class P() : BodyTag("p") - class H1() : BodyTag("h1") - class A() : BodyTag("a") { - var href : String - get() = attributes["href"] - set(value) { attributes["href"] = value } - } - - fun html(init : HTML.() -> Unit) : HTML { - val html = HTML() - html.init() - return html - } - -} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/html_builder_with_refs.txt b/confluence/testData/rendering/examples/html_builder_with_refs.txt deleted file mode 100644 index 2e723e94802..00000000000 --- a/confluence/testData/rendering/examples/html_builder_with_refs.txt +++ /dev/null @@ -1,115 +0,0 @@ -
- -
 
-
fun result(args : Array<String>) = 
-
  html { 
-
    head { 
-
      title {+"XML encoding with Kotlin"} 
-
    } 
-
    body { 
-
      h1 {+"XML encoding with Kotlin"} 
-
      p {+"this format can be used as an alternative markup to XML"} 
-
 
-
      // an element with attributes and text content 
-
      a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} 
-
 
-
      // mixed content 
-
      p { 
-
        +"This is some" 
-
        b {+"mixed"} 
-
        +"text. For more see the" 
-
        a(href = "http://jetbrains.com/kotlin") {+"Kotlin"} 
-
        +"project" 
-
      } 
-
      p {+"some text"} 
-
 
-
      // content generated by 
-
      p { 
-
        for (arg in args) 
-
          +arg 
-
      } 
-
    } 
-
  } 
-
 
-
namespace html { 
-
 
-
  abstract class Factory<T> { 
-
    fun create() : T 
-
  } 
-
 
-
  abstract class Element 
-
 
-
  class TextElement(val text : String) : Element 
-
 
-
  abstract class Tag(val name : String) : Element { 
-
    val children = ArrayList<Element>() 
-
    val attributes = HashMap<String, String>() 
-
 
-
    protected fun initTag<T : Element>(init : T.() -> Unit) : T 
-
      where class object T : Factory<T> { 
-
      val tag = T.create() 
-
      tag.init() 
-
      children.add(tag) 
-
      return tag 
-
    } 
-
  } 
-
 
-
  abstract class TagWithText(name : String) : Tag(name) { 
-
    fun String.plus() { 
-
      children.add(TextElement(this)) 
-
    } 
-
  } 
-
 
-
  class HTML() : TagWithText("html") { 
-
    class object : Factory<HTML> { 
-
      override fun create() = HTML() 
-
    } 
-
 
-
    fun head(init : Head.() -> Unit) = initTag(init) 
-
 
-
    fun body(init : Body.() -> Unit) = initTag(init) 
-
  } 
-
 
-
  class Head() : TagWithText("head") { 
-
    class object : Factory<Head> { 
-
      override fun create() = Head() 
-
    } 
-
 
-
    fun title(init : Title.() -> Unit) = initTag(init) 
-
  } 
-
 
-
  class Title() : TagWithText("title") 
-
 
-
  abstract class BodyTag(name : String) : TagWithText(name) { 
-
  } 
-
 
-
  class Body() : BodyTag("body") { 
-
    class object : Factory<Body> { 
-
      override fun create() = Body() 
-
    } 
-
 
-
    fun b(init : B.() -> Unit) = initTag(init) 
-
    fun p(init : P.() -> Unit) = initTag(init) 
-
    fun h1(init : H1.() -> Unit) = initTag(init) 
-
    fun a(href : String, init : A.() -> Unit) { 
-
      val a = initTag(init) 
-
      a.href = href 
-
    } 
-
  } 
-
 
-
  class B() : BodyTag("b") 
-
  class P() : BodyTag("p") 
-
  class H1() : BodyTag("h1") 
-
  class A() : BodyTag("a") { 
-
    var href : String 
-
      get() = attributes["href"] 
-
      set(value) { attributes["href"] = value } 
-
  } 
-
 
-
  fun html(init : HTML.() -> Unit) : HTML { 
-
    val html = HTML() 
-
    html.init() 
-
    return html 
-
  } 
-
 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/examples/welcome_hello.kt b/confluence/testData/rendering/examples/welcome_hello.kt deleted file mode 100644 index bfb70255c67..00000000000 --- a/confluence/testData/rendering/examples/welcome_hello.kt +++ /dev/null @@ -1,5 +0,0 @@ -package hello - -fun main(args : Array) { - println("Hello, world!") -} \ No newline at end of file diff --git a/confluence/testData/rendering/examples/welcome_hello.txt b/confluence/testData/rendering/examples/welcome_hello.txt deleted file mode 100644 index b195b31b3df..00000000000 --- a/confluence/testData/rendering/examples/welcome_hello.txt +++ /dev/null @@ -1,6 +0,0 @@ -
-
package hello 
-
 
-
fun main(args : Array<String>) { 
-
  println("Hello, world!") 
-
}
\ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/a/a_closed_tag.kt b/confluence/testData/rendering/tagTypes/a/a_closed_tag.kt deleted file mode 100644 index c98a4f5f197..00000000000 --- a/confluence/testData/rendering/tagTypes/a/a_closed_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/a/a_next_token_tag.kt b/confluence/testData/rendering/tagTypes/a/a_next_token_tag.kt deleted file mode 100644 index ae45b3ba6db..00000000000 --- a/confluence/testData/rendering/tagTypes/a/a_next_token_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/a/a_with_close_tag.kt b/confluence/testData/rendering/tagTypes/a/a_with_close_tag.kt deleted file mode 100644 index 228a8326dcb..00000000000 --- a/confluence/testData/rendering/tagTypes/a/a_with_close_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/class/class_closed_tag.kt b/confluence/testData/rendering/tagTypes/class/class_closed_tag.kt deleted file mode 100644 index fd10ed411be..00000000000 --- a/confluence/testData/rendering/tagTypes/class/class_closed_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/class/class_next_token_tag.kt b/confluence/testData/rendering/tagTypes/class/class_next_token_tag.kt deleted file mode 100644 index 09226ddfcda..00000000000 --- a/confluence/testData/rendering/tagTypes/class/class_next_token_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/class/class_with_close_tag.kt b/confluence/testData/rendering/tagTypes/class/class_with_close_tag.kt deleted file mode 100644 index 86e5c557073..00000000000 --- a/confluence/testData/rendering/tagTypes/class/class_with_close_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/label/label_closed_tag.kt b/confluence/testData/rendering/tagTypes/label/label_closed_tag.kt deleted file mode 100644 index d35661b6352..00000000000 --- a/confluence/testData/rendering/tagTypes/label/label_closed_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/label/label_next_token_tag.kt b/confluence/testData/rendering/tagTypes/label/label_next_token_tag.kt deleted file mode 100644 index 78351b67683..00000000000 --- a/confluence/testData/rendering/tagTypes/label/label_next_token_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/label/label_with_close_tag.kt b/confluence/testData/rendering/tagTypes/label/label_with_close_tag.kt deleted file mode 100644 index b0222263ca1..00000000000 --- a/confluence/testData/rendering/tagTypes/label/label_with_close_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/ref/ref_closed_tag.kt b/confluence/testData/rendering/tagTypes/ref/ref_closed_tag.kt deleted file mode 100644 index 3e6e164d9b9..00000000000 --- a/confluence/testData/rendering/tagTypes/ref/ref_closed_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/ref/ref_next_token_tag.kt b/confluence/testData/rendering/tagTypes/ref/ref_next_token_tag.kt deleted file mode 100644 index 4441c579807..00000000000 --- a/confluence/testData/rendering/tagTypes/ref/ref_next_token_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/ref/ref_with_close_tag.kt b/confluence/testData/rendering/tagTypes/ref/ref_with_close_tag.kt deleted file mode 100644 index 5c55181140d..00000000000 --- a/confluence/testData/rendering/tagTypes/ref/ref_with_close_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/style/style_closed_tag.kt b/confluence/testData/rendering/tagTypes/style/style_closed_tag.kt deleted file mode 100644 index ed45a3c83c6..00000000000 --- a/confluence/testData/rendering/tagTypes/style/style_closed_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/style/style_next_token_tag.kt b/confluence/testData/rendering/tagTypes/style/style_next_token_tag.kt deleted file mode 100644 index a4908a6fec6..00000000000 --- a/confluence/testData/rendering/tagTypes/style/style_next_token_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/style/style_with_close_tag.kt b/confluence/testData/rendering/tagTypes/style/style_with_close_tag.kt deleted file mode 100644 index 5faa01a98a8..00000000000 --- a/confluence/testData/rendering/tagTypes/style/style_with_close_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/unresolved/unresolved_closed_tag.kt b/confluence/testData/rendering/tagTypes/unresolved/unresolved_closed_tag.kt deleted file mode 100644 index 3eaf212b37e..00000000000 --- a/confluence/testData/rendering/tagTypes/unresolved/unresolved_closed_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/unresolved/unresolved_next_token_tag.kt b/confluence/testData/rendering/tagTypes/unresolved/unresolved_next_token_tag.kt deleted file mode 100644 index a148882adf3..00000000000 --- a/confluence/testData/rendering/tagTypes/unresolved/unresolved_next_token_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/unresolved/unresolved_with_close_tag.kt b/confluence/testData/rendering/tagTypes/unresolved/unresolved_with_close_tag.kt deleted file mode 100644 index c75d20afdab..00000000000 --- a/confluence/testData/rendering/tagTypes/unresolved/unresolved_with_close_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.kt b/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.kt deleted file mode 100644 index 32a9994d9a2..00000000000 --- a/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.txt b/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.txt deleted file mode 100644 index 5d3f39b7ba8..00000000000 --- a/confluence/testData/rendering/tagTypes/warnings/warning_closed_tag.txt +++ /dev/null @@ -1,2 +0,0 @@ -
-
var 
allByDefault : Int?
\ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.kt b/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.kt deleted file mode 100644 index 89c39d6d4ec..00000000000 --- a/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.txt b/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.txt deleted file mode 100644 index 5aeb3ef0460..00000000000 --- a/confluence/testData/rendering/tagTypes/warnings/warning_next_token_tag.txt +++ /dev/null @@ -1,2 +0,0 @@ -
-
var 
allByDefault
 : Int?
\ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.kt b/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.kt deleted file mode 100644 index 2924effc7e4..00000000000 --- a/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.kt +++ /dev/null @@ -1 +0,0 @@ -var allByDefault : Int? \ No newline at end of file diff --git a/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.txt b/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.txt deleted file mode 100644 index 4d6df03ae3d..00000000000 --- a/confluence/testData/rendering/tagTypes/warnings/warning_with_close_tag.txt +++ /dev/null @@ -1,2 +0,0 @@ -
-
var 
allByDefault : Int?
\ No newline at end of file From bd9824b75237ee825f943372846f93a93c331969 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 20 Apr 2012 14:33:12 +0400 Subject: [PATCH 09/16] buildConfluenceLexer script removed from Ant configuration --- .idea/ant.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.idea/ant.xml b/.idea/ant.xml index 24adafcd5c7..ed038767c6b 100644 --- a/.idea/ant.xml +++ b/.idea/ant.xml @@ -10,14 +10,6 @@ - - - - - - - - From e33acbeebf22aca2ee413063eb1cf5d6393440cc Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 20 Apr 2012 14:33:49 +0400 Subject: [PATCH 10/16] Use CompileEnvironmentConfiguretion instead of its components --- .../jet/compiler/CompileEnvironmentUtil.java | 2 +- .../compiler/KotlinToJVMBytecodeCompiler.java | 35 ++++++++----------- .../jetbrains/jet/codegen/TestlibTest.java | 5 ++- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java index 97f882b486f..ca803c0549f 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java @@ -173,7 +173,7 @@ public class CompileEnvironmentUtil { scriptEnvironment.addSources(moduleFile); GenerationState generationState = KotlinToJVMBytecodeCompiler - .analyzeAndGenerate(scriptEnvironment, dependencies, messageCollector, false); + .analyzeAndGenerate(new CompileEnvironmentConfiguration(scriptEnvironment, dependencies, messageCollector), false); if (generationState == null) { return null; } diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java b/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java index a6055710614..7e6af64de21 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java @@ -47,7 +47,6 @@ import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.FqName; import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM; -import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; import org.jetbrains.jet.lang.resolve.java.JvmAbi; import org.jetbrains.jet.plugin.JetLanguage; import org.jetbrains.jet.plugin.JetMainDetector; @@ -219,19 +218,16 @@ public class KotlinToJVMBytecodeCompiler { @Nullable public static GenerationState analyzeAndGenerate(CompileEnvironmentConfiguration configuration) { - return analyzeAndGenerate(configuration.getEnvironment(), configuration.getCompilerDependencies(), configuration.getMessageCollector(), configuration.getCompilerDependencies().getCompilerSpecialMode().isStubs()); + return analyzeAndGenerate(configuration, configuration.getCompilerDependencies().getCompilerSpecialMode().isStubs()); } @Nullable public static GenerationState analyzeAndGenerate( - JetCoreEnvironment environment, - CompilerDependencies dependencies, - - final MessageCollector messageCollector, + CompileEnvironmentConfiguration configuration, boolean stubs ) { - AnalyzeExhaust exhaust = analyze(environment, dependencies, messageCollector, stubs); + AnalyzeExhaust exhaust = analyze(configuration, stubs); if (exhaust == null) { return null; @@ -239,14 +235,13 @@ public class KotlinToJVMBytecodeCompiler { exhaust.throwIfError(); - return generate(environment, dependencies, messageCollector, exhaust, stubs); + return generate(configuration, exhaust, stubs); } @Nullable private static AnalyzeExhaust analyze( - JetCoreEnvironment environment, - CompilerDependencies dependencies, - final MessageCollector messageCollector, + final CompileEnvironmentConfiguration configuration, + boolean stubs) { final Ref hasErrors = new Ref(false); final MessageCollector messageCollectorWrapper = new MessageCollector() { @@ -258,10 +253,12 @@ public class KotlinToJVMBytecodeCompiler { if (CompilerMessageSeverity.ERRORS.contains(severity)) { hasErrors.set(true); } - messageCollector.report(severity, message, location); + configuration.getMessageCollector().report(severity, message, location); } }; + JetCoreEnvironment environment = configuration.getEnvironment(); + // Report syntax errors for (JetFile file : environment.getSourceFiles()) { file.accept(new PsiRecursiveElementWalkingVisitor() { @@ -280,7 +277,7 @@ public class KotlinToJVMBytecodeCompiler { stubs ? Predicates.alwaysFalse() : Predicates.alwaysTrue(); AnalyzeExhaust exhaust = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration( environment.getProject(), environment.getSourceFiles(), filesToAnalyzeCompletely, JetControlFlowDataTraceFactory.EMPTY, - dependencies); + configuration.getCompilerDependencies()); for (Diagnostic diagnostic : exhaust.getBindingContext().getDiagnostics()) { reportDiagnostic(messageCollectorWrapper, diagnostic); @@ -293,26 +290,24 @@ public class KotlinToJVMBytecodeCompiler { @NotNull private static GenerationState generate( - JetCoreEnvironment environment, - CompilerDependencies dependencies, - - final MessageCollector messageCollector, + final CompileEnvironmentConfiguration configuration, AnalyzeExhaust exhaust, boolean stubs) { + JetCoreEnvironment environment = configuration.getEnvironment(); Project project = environment.getProject(); Progress backendProgress = new Progress() { @Override public void log(String message) { - messageCollector.report(CompilerMessageSeverity.LOGGING, message, CompilerMessageLocation.NO_LOCATION); + configuration.getMessageCollector().report(CompilerMessageSeverity.LOGGING, message, CompilerMessageLocation.NO_LOCATION); } }; GenerationState generationState = new GenerationState(project, ClassBuilderFactories.binaries(stubs), backendProgress, - exhaust, environment.getSourceFiles(), dependencies.getCompilerSpecialMode()); + exhaust, environment.getSourceFiles(), configuration.getCompilerDependencies().getCompilerSpecialMode()); generationState.compileCorrectFiles(CompilationErrorHandler.THROW_EXCEPTION); - List plugins = environment.getCompilerPlugins(); + List plugins = configuration.getCompilerPlugins(); if (plugins != null) { CompilerPluginContext context = new CompilerPluginContext(project, exhaust.getBindingContext(), environment.getSourceFiles()); for (CompilerPlugin plugin : plugins) { diff --git a/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java b/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java index fd9e6ce37a3..6ffbe45126b 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java @@ -23,6 +23,7 @@ import junit.framework.TestCase; import junit.framework.TestSuite; import org.jetbrains.jet.CompileCompilerDependenciesTest; import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime; +import org.jetbrains.jet.compiler.CompileEnvironmentConfiguration; import org.jetbrains.jet.compiler.KotlinToJVMBytecodeCompiler; import org.jetbrains.jet.compiler.messages.MessageCollector; import org.jetbrains.jet.lang.descriptors.ClassDescriptor; @@ -37,7 +38,6 @@ import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.parsing.JetParsingTest; import java.io.File; -import java.io.PrintStream; import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.net.URL; @@ -75,7 +75,6 @@ public class TestlibTest extends CodegenTestCase { private TestSuite doBuildSuite() { try { - PrintStream err = System.err; CompilerDependencies compilerDependencies = CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR); File junitJar = new File("libraries/lib/junit-4.9.jar"); @@ -92,7 +91,7 @@ public class TestlibTest extends CodegenTestCase { myEnvironment.addSources(localFileSystem.findFileByPath(JetParsingTest.getTestDataDir() + "/../../libraries/kunit/src")); GenerationState generationState = KotlinToJVMBytecodeCompiler - .analyzeAndGenerate(myEnvironment, compilerDependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR, false); + .analyzeAndGenerate(new CompileEnvironmentConfiguration(myEnvironment, compilerDependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR), false); if (generationState == null) { throw new RuntimeException("There were compilation errors"); From 13764c06c05db1efb24fd300df43899042594963 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 20 Apr 2012 14:58:14 +0400 Subject: [PATCH 11/16] Compiler plugins moved to CompilerEnvironmentConfiguration --- .../jetbrains/jet/buildtools/core/BytecodeCompiler.java | 2 +- .../cli/src/org/jetbrains/jet/cli/KotlinCompiler.java | 2 +- .../jet/compiler/CompileEnvironmentConfiguration.java | 9 +++++++++ .../org/jetbrains/jet/compiler/JetCoreEnvironment.java | 9 --------- .../main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java b/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java index f7d78f49cf0..8617f13f719 100644 --- a/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java +++ b/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java @@ -62,7 +62,7 @@ public class BytecodeCompiler { } // lets register any compiler plugins - env.getEnvironment().getCompilerPlugins().addAll(getCompilerPlugins()); + env.getCompilerPlugins().addAll(getCompilerPlugins()); return env; } diff --git a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java index 1b058ad0151..54a6eef6608 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java @@ -239,7 +239,7 @@ public class KotlinCompiler { // install any compiler plugins List plugins = arguments.getCompilerPlugins(); if (plugins != null) { - configuration.getEnvironment().getCompilerPlugins().addAll(plugins); + configuration.getCompilerPlugins().addAll(plugins); } if (configuration.getCompilerDependencies().getRuntimeJar() != null) { diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java index 2b73bd0e964..cf57bee50b2 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java @@ -16,11 +16,14 @@ package org.jetbrains.jet.compiler; +import com.google.common.collect.Lists; import com.intellij.openapi.util.Disposer; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.compiler.messages.MessageCollector; import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; +import java.util.List; + /** * @author abreslav */ @@ -29,6 +32,8 @@ public class CompileEnvironmentConfiguration { private final CompilerDependencies compilerDependencies; private final MessageCollector messageCollector; + private List compilerPlugins = Lists.newArrayList(); + /** * NOTE: It's very important to call dispose for every object of this class or there will be memory leaks. * @see Disposer @@ -53,4 +58,8 @@ public class CompileEnvironmentConfiguration { public MessageCollector getMessageCollector() { return messageCollector; } + + public List getCompilerPlugins() { + return compilerPlugins; + } } diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/JetCoreEnvironment.java b/compiler/cli/src/org/jetbrains/jet/compiler/JetCoreEnvironment.java index c3f24f3179e..bd8eb357ccf 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/JetCoreEnvironment.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/JetCoreEnvironment.java @@ -46,7 +46,6 @@ import java.util.List; */ public class JetCoreEnvironment extends JavaCoreEnvironment { private final List sourceFiles = new ArrayList(); - private List compilerPlugins = new ArrayList(); public JetCoreEnvironment(Disposable parentDisposable, @NotNull CompilerDependencies compilerDependencies) { super(parentDisposable); @@ -138,14 +137,6 @@ public class JetCoreEnvironment extends JavaCoreEnvironment { return sourceFiles; } - public List getCompilerPlugins() { - return compilerPlugins; - } - - public void setCompilerPlugins(List compilerPlugins) { - this.compilerPlugins = compilerPlugins; - } - public void addToClasspathFromClassLoader(ClassLoader loader) { ClassLoader parent = loader.getParent(); if(parent != null) diff --git a/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt b/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt index 5b84e81777c..a4256f29f55 100644 --- a/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt +++ b/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt @@ -20,16 +20,16 @@ fun main(args: Array): Unit { */ class KDocCompiler() : KotlinCompiler() { - protected override fun configureEnvironment(environment : CompileEnvironmentConfiguration?, arguments : CompilerArguments?) { - super.configureEnvironment(environment, arguments) - val coreEnvironment = environment?.getEnvironment() + protected override fun configureEnvironment(configuration : CompileEnvironmentConfiguration?, arguments : CompilerArguments?) { + super.configureEnvironment(configuration, arguments) + val coreEnvironment = configuration?.getEnvironment() if (coreEnvironment != null) { val kdoc = KDoc() if (arguments is KDocArguments) { kdoc.config = arguments.apply() } - val plugins = coreEnvironment.getCompilerPlugins().orEmpty() + val plugins = configuration?.getCompilerPlugins().orEmpty() /* val sourcePlugin = HtmlCompilerPlugin() plugins.add(sourcePlugin) From 5ec7617c7a3e502febfecc78f59b86c8ee6d1dcc Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Fri, 20 Apr 2012 15:52:27 +0400 Subject: [PATCH 12/16] Call resolution refactoring (logic hasn't changed) - interfaces MemberPrioritizer, ResolutionCandidate introduced - CallTransformationStrategy will be responsible for variable with 'invoke' method as function resolve --- .../resolve/calls/CallResolutionContext.java | 40 +++ .../jet/lang/resolve/calls/CallResolver.java | 291 +++++++++--------- .../calls/CallTransformationStrategy.java | 118 +++++++ .../lang/resolve/calls/MemberPrioritizer.java | 38 +++ ...oritizers.java => MemberPrioritizers.java} | 27 +- .../resolve/calls/ResolutionCandidate.java | 77 +++++ .../lang/resolve/calls/ResolutionTask.java | 21 +- .../resolve/calls/ResolutionTaskHolder.java | 24 +- .../lang/resolve/calls/ResolvedCallImpl.java | 30 +- .../lang/resolve/calls/TaskPrioritizer.java | 79 +++-- .../resolvewindow/ResolveToolwindow.java | 2 +- .../k2js/translate/reference/CallBuilder.java | 3 +- 12 files changed, 506 insertions(+), 244 deletions(-) create mode 100644 compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolutionContext.java create mode 100644 compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformationStrategy.java create mode 100644 compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizer.java rename compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/{TaskPrioritizers.java => MemberPrioritizers.java} (82%) create mode 100644 compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionCandidate.java diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolutionContext.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolutionContext.java new file mode 100644 index 00000000000..03c5013330a --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolutionContext.java @@ -0,0 +1,40 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.resolve.calls; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.psi.Call; +import org.jetbrains.jet.lang.resolve.BindingTrace; + +/** +* @author svtk +*/ +public final class CallResolutionContext extends ResolutionContext { + /*package*/ final ResolvedCallImpl candidateCall; + /*package*/ final TracingStrategy tracing; + + public CallResolutionContext(@NotNull ResolvedCallImpl candidateCall, @NotNull ResolutionTask task, @NotNull BindingTrace trace, @NotNull TracingStrategy tracing, @NotNull Call call) { + super(trace, task.scope, call, task.expectedType, task.dataFlowInfo); + this.candidateCall = candidateCall; + this.tracing = tracing; + } + + public CallResolutionContext(@NotNull ResolvedCallImpl candidateCall, @NotNull ResolutionTask task, @NotNull BindingTrace trace, @NotNull TracingStrategy tracing) { + this(candidateCall, task, trace, tracing, task.call); + } +} diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java index 5b62fdadd2a..990d6298b69 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java @@ -102,16 +102,16 @@ public class CallResolver { if (referencedName == null) { return OverloadResolutionResultsImpl.nameNotFound(); } - TaskPrioritizer task_prioritizer; + List> memberPrioritizers = Lists.newArrayList(); if (nameExpression.getReferencedNameElementType() == JetTokens.FIELD_IDENTIFIER) { referencedName = referencedName.substring(1); - task_prioritizer = TaskPrioritizers.PROPERTY_TASK_PRIORITIZER; + memberPrioritizers.add(MemberPrioritizers.PROPERTY_TASK_PRIORITIZER); } else { - task_prioritizer = TaskPrioritizers.VARIABLE_TASK_PRIORITIZER; + memberPrioritizers.add(MemberPrioritizers.VARIABLE_TASK_PRIORITIZER); } - List> prioritizedTasks = task_prioritizer.computePrioritizedTasks(context, referencedName, nameExpression); - return doResolveCall(context, prioritizedTasks, nameExpression); + List> prioritizedTasks = TaskPrioritizer.computePrioritizedTasks(context, referencedName, nameExpression, memberPrioritizers); + return doResolveCall(context, prioritizedTasks, CallTransformationStrategy.PROPERTY_CALL_TRANSFORMATION_STRATEGY, nameExpression); } @NotNull @@ -119,9 +119,9 @@ public class CallResolver { @NotNull BasicResolutionContext context, @NotNull final JetReferenceExpression functionReference, @NotNull String name) { - List> tasks = TaskPrioritizers.FUNCTION_TASK_PRIORITIZER.computePrioritizedTasks( - context, name, functionReference); - return doResolveCall(context, tasks, functionReference); + List> tasks = TaskPrioritizer.computePrioritizedTasks( + context, name, functionReference, Collections.singletonList(MemberPrioritizers.FUNCTION_TASK_PRIORITIZER)); + return doResolveCall(context, tasks, CallTransformationStrategy.FUNCTION_CALL_TRANSFORMATION_STRATEGY, functionReference); } @NotNull @@ -142,7 +142,7 @@ public class CallResolver { String name = expression.getReferencedName(); if (name == null) return checkArgumentTypesAndFail(context); - prioritizedTasks = TaskPrioritizers.FUNCTION_TASK_PRIORITIZER.computePrioritizedTasks(context, name, functionReference); + prioritizedTasks = TaskPrioritizer.computePrioritizedTasks(context, name, functionReference, Collections.singletonList(MemberPrioritizers.FUNCTION_TASK_PRIORITIZER)); ResolutionTask.DescriptorCheckStrategy abstractConstructorCheck = new ResolutionTask.DescriptorCheckStrategy() { @Override public boolean performAdvancedChecks(D descriptor, BindingTrace trace, TracingStrategy tracing) { @@ -184,7 +184,7 @@ public class CallResolver { context.trace.report(NO_CONSTRUCTOR.on(reportAbsenceOn)); return checkArgumentTypesAndFail(context); } - Collection> candidates = TaskPrioritizer.convertWithImpliedThis(context.scope, Collections.singletonList(NO_RECEIVER), constructors); + Collection> candidates = TaskPrioritizer.convertWithImpliedThis(context.scope, Collections.singletonList(NO_RECEIVER), constructors); prioritizedTasks.add(new ResolutionTask(candidates, functionReference, context)); // !! DataFlowInfo.EMPTY } else { @@ -206,7 +206,7 @@ public class CallResolver { context.trace.report(NO_CONSTRUCTOR.on(reportAbsenceOn)); return checkArgumentTypesAndFail(context); } - List> candidates = ResolvedCallImpl.convertCollection(constructors); + List> candidates = ResolutionCandidate.convertCollection(constructors); prioritizedTasks = Collections.singletonList(new ResolutionTask(candidates, functionReference, context)); // !! DataFlowInfo.EMPTY } else if (calleeExpression != null) { @@ -223,15 +223,15 @@ public class CallResolver { FunctionDescriptorImpl functionDescriptor = new ExpressionAsFunctionDescriptor(context.scope.getContainingDeclaration(), "[for expression " + calleeExpression.getText() + "]"); FunctionDescriptorUtil.initializeFromFunctionType(functionDescriptor, calleeType, NO_RECEIVER); - ResolvedCallImpl resolvedCall = ResolvedCallImpl.create(functionDescriptor); - resolvedCall.setReceiverArgument(context.call.getExplicitReceiver()); + ResolutionCandidate resolutionCandidate = ResolutionCandidate.create(functionDescriptor); + resolutionCandidate.setReceiverArgument(context.call.getExplicitReceiver()); // strictly speaking, this is a hack: // we need to pass a reference, but there's no reference in the PSI, // so we wrap what we have into a fake reference and pass it on (unwrap on the other end) functionReference = new JetFakeReference(calleeExpression); - prioritizedTasks = Collections.singletonList(new ResolutionTask(Collections.singleton(resolvedCall), functionReference, context)); + prioritizedTasks = Collections.singletonList(new ResolutionTask(Collections.singleton(resolutionCandidate), functionReference, context)); } else { // checkTypesWithNoCallee(trace, scope, call); @@ -239,7 +239,7 @@ public class CallResolver { } } - return doResolveCall(context, prioritizedTasks, functionReference); + return doResolveCall(context, prioritizedTasks, CallTransformationStrategy.FUNCTION_CALL_TRANSFORMATION_STRATEGY, functionReference); } private OverloadResolutionResults checkArgumentTypesAndFail(BasicResolutionContext context) { @@ -251,6 +251,7 @@ public class CallResolver { private OverloadResolutionResults doResolveCall( @NotNull final BasicResolutionContext context, @NotNull final List> prioritizedTasks, // high to low priority + @NotNull CallTransformationStrategy callTransformationStrategy, @NotNull final JetReferenceExpression reference) { ResolutionDebugInfo.Data debugInfo = ResolutionDebugInfo.create(); @@ -267,7 +268,7 @@ public class CallResolver { OverloadResolutionResultsImpl resultsForFirstNonemptyCandidateSet = null; for (ResolutionTask task : prioritizedTasks) { TemporaryBindingTrace temporaryTrace = TemporaryBindingTrace.create(context.trace); - OverloadResolutionResultsImpl results = performResolutionGuardedForExtraFunctionLiteralArguments(task.withTrace(temporaryTrace)); + OverloadResolutionResultsImpl results = performResolutionGuardedForExtraFunctionLiteralArguments(task.withTrace(temporaryTrace), callTransformationStrategy); if (results.isSuccess() || results.isAmbiguity()) { temporaryTrace.commit(); @@ -299,8 +300,9 @@ public class CallResolver { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @NotNull - private OverloadResolutionResultsImpl performResolutionGuardedForExtraFunctionLiteralArguments(ResolutionTask task) { - OverloadResolutionResultsImpl results = performResolution(task); + private OverloadResolutionResultsImpl performResolutionGuardedForExtraFunctionLiteralArguments(@NotNull ResolutionTask task, + @NotNull CallTransformationStrategy callTransformationStrategy) { + OverloadResolutionResultsImpl results = performResolution(task, callTransformationStrategy); // If resolution fails, we should check for some of the following situations: // class A { @@ -323,9 +325,9 @@ public class CallResolver { // We have some candidates that failed for some reason // And we have a suspect: the function literal argument // Now, we try to remove this argument and see if it helps - Collection> newCandidates = Lists.newArrayList(); - for (ResolvedCallImpl candidate : task.getCandidates()) { - newCandidates.add(ResolvedCallImpl.create(candidate.getCandidateDescriptor())); + Collection> newCandidates = Lists.newArrayList(); + for (ResolutionCandidate candidate : task.getCandidates()) { + newCandidates.add(ResolutionCandidate.create(candidate.getDescriptor())); } ResolutionTask newContext = new ResolutionTask(newCandidates, task.reference, TemporaryBindingTrace.create(task.trace), task.scope, new DelegatingCall(task.call) { @NotNull @@ -334,7 +336,7 @@ public class CallResolver { return Collections.emptyList(); } }, task.expectedType, task.dataFlowInfo); - OverloadResolutionResultsImpl resultsWithFunctionLiteralsStripped = performResolution(newContext); + OverloadResolutionResultsImpl resultsWithFunctionLiteralsStripped = performResolution(newContext, callTransformationStrategy); if (resultsWithFunctionLiteralsStripped.isSuccess() || resultsWithFunctionLiteralsStripped.isAmbiguity()) { task.tracing.danglingFunctionLiteralArgumentSuspected(task.trace, task.call.getFunctionLiteralArguments()); } @@ -344,101 +346,23 @@ public class CallResolver { } @NotNull - private OverloadResolutionResultsImpl performResolution(ResolutionTask task) { - for (ResolvedCallImpl candidateCall : task.getCandidates()) { - D candidate = candidateCall.getCandidateDescriptor(); + private OverloadResolutionResultsImpl performResolution(@NotNull ResolutionTask task, + @NotNull CallTransformationStrategy callTransformationStrategy) { + + for (ResolutionCandidate resolutionCandidate : task.getCandidates()) { TemporaryBindingTrace temporaryTrace = TemporaryBindingTrace.create(task.trace); - candidateCall.setTrace(temporaryTrace); + CallResolutionContext context = callTransformationStrategy.createCallContext(resolutionCandidate, task, temporaryTrace, task.tracing); + performResolutionForCandidateCall(context, task, temporaryTrace); - CallResolutionContext context = new CallResolutionContext(candidateCall, task, temporaryTrace, task.tracing); - - context.tracing.bindReference(context.trace, candidateCall); - - if (ErrorUtils.isError(candidate)) { - candidateCall.setStatus(SUCCESS); - checkTypesWithNoCallee(context.toBasic()); - continue; + Collection> calls = callTransformationStrategy.transformResultCall(context, this, task); + for (ResolvedCallImpl call : calls) { + task.getResolvedCallMap().put(resolutionCandidate, call); } - - if (!Visibilities.isVisible(candidate, context.scope.getContainingDeclaration())) { - candidateCall.setStatus(OTHER_ERROR); - context.tracing.invisibleMember(context.trace, candidate); - continue; - } - - boolean errorInArgumentMapping = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(context.call, context.tracing, candidateCall); - if (errorInArgumentMapping) { - candidateCall.setStatus(OTHER_ERROR); - checkTypesWithNoCallee(context.toBasic()); - continue; - } - - List jetTypeArguments = context.call.getTypeArguments(); - if (jetTypeArguments.isEmpty()) { - if (!candidate.getTypeParameters().isEmpty()) { - candidateCall.setStatus(inferTypeArguments(context)); - } - else { - candidateCall.setStatus(checkAllValueArguments(context)); - } - } - else { - // Explicit type arguments passed - - List typeArguments = new ArrayList(); - for (JetTypeProjection projection : jetTypeArguments) { - if (projection.getProjectionKind() != JetProjectionKind.NONE) { - context.trace.report(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT.on(projection)); - } - JetTypeReference typeReference = projection.getTypeReference(); - if (typeReference != null) { - typeArguments.add(typeResolver.resolveType(context.scope, typeReference, context.trace, true)); - } - else { - typeArguments.add(ErrorUtils.createErrorType("Star projection in a call")); - } - } - int expectedTypeArgumentCount = candidate.getTypeParameters().size(); - if (expectedTypeArgumentCount == jetTypeArguments.size()) { - - checkGenericBoundsInAFunctionCall(jetTypeArguments, typeArguments, candidate, context.trace); - - Map substitutionContext = FunctionDescriptorUtil.createSubstitutionContext((FunctionDescriptor) candidate, typeArguments); - D substitutedDescriptor = (D) candidate.substitute(TypeSubstitutor.create(substitutionContext)); - - candidateCall.setResultingDescriptor(substitutedDescriptor); - replaceValueParametersWithSubstitutedOnes(candidateCall, substitutedDescriptor); - - List typeParameters = candidateCall.getCandidateDescriptor().getTypeParameters(); - for (int i = 0; i < typeParameters.size(); i++) { - TypeParameterDescriptor typeParameterDescriptor = typeParameters.get(i); - candidateCall.recordTypeArgument(typeParameterDescriptor, typeArguments.get(i)); - } - candidateCall.setStatus(checkAllValueArguments(context)); - } - else { - candidateCall.setStatus(OTHER_ERROR); - context.tracing.wrongNumberOfTypeArguments(context.trace, expectedTypeArgumentCount); - } - } - - task.performAdvancedChecks(candidate, context.trace, context.tracing); - - // 'super' cannot be passed as an argument, for receiver arguments expression typer does not track this - // See TaskPrioritizer for more - JetSuperExpression superExpression = TaskPrioritizer.getReceiverSuper(candidateCall.getReceiverArgument()); - if (superExpression != null) { - context.trace.report(SUPER_IS_NOT_AN_EXPRESSION.on(superExpression, superExpression.getText())); - candidateCall.setStatus(OTHER_ERROR); - } - - recordAutoCastIfNecessary(candidateCall.getReceiverArgument(), candidateCall.getTrace()); - recordAutoCastIfNecessary(candidateCall.getThisObject(), candidateCall.getTrace()); } Set> successfulCandidates = Sets.newLinkedHashSet(); Set> failedCandidates = Sets.newLinkedHashSet(); - for (ResolvedCallImpl candidateCall : task.getCandidates()) { + for (ResolvedCallImpl candidateCall : task.getResolvedCallMap().values()) { ResolutionStatus status = candidateCall.getStatus(); if (status.isSuccess()) { successfulCandidates.add(candidateCall); @@ -456,6 +380,99 @@ public class CallResolver { return results; } + private void performResolutionForCandidateCall(@NotNull CallResolutionContext context, + @NotNull ResolutionTask task, + @NotNull TemporaryBindingTrace temporaryTrace) { + ResolvedCallImpl candidateCall = context.candidateCall; + + candidateCall.setTrace(temporaryTrace); + D candidate = candidateCall.getCandidateDescriptor(); + + context.tracing.bindReference(context.trace, candidateCall); + + if (ErrorUtils.isError(candidate)) { + candidateCall.setStatus(SUCCESS); + checkTypesWithNoCallee(context.toBasic()); + return; + } + + if (!Visibilities.isVisible(candidate, context.scope.getContainingDeclaration())) { + candidateCall.setStatus(OTHER_ERROR); + context.tracing.invisibleMember(context.trace, candidate); + return; + } + + boolean errorInArgumentMapping = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(context.call, context.tracing, candidateCall); + if (errorInArgumentMapping) { + candidateCall.setStatus(OTHER_ERROR); + checkTypesWithNoCallee(context.toBasic()); + return; + } + + List jetTypeArguments = context.call.getTypeArguments(); + if (jetTypeArguments.isEmpty()) { + if (!candidate.getTypeParameters().isEmpty()) { + candidateCall.setStatus(inferTypeArguments(context)); + } + else { + candidateCall.setStatus(checkAllValueArguments(context)); + } + } + else { + // Explicit type arguments passed + + List typeArguments = new ArrayList(); + for (JetTypeProjection projection : jetTypeArguments) { + if (projection.getProjectionKind() != JetProjectionKind.NONE) { + context.trace.report(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT.on(projection)); + } + JetTypeReference typeReference = projection.getTypeReference(); + if (typeReference != null) { + typeArguments.add(typeResolver.resolveType(context.scope, typeReference, context.trace, true)); + } + else { + typeArguments.add(ErrorUtils.createErrorType("Star projection in a call")); + } + } + int expectedTypeArgumentCount = candidate.getTypeParameters().size(); + if (expectedTypeArgumentCount == jetTypeArguments.size()) { + + checkGenericBoundsInAFunctionCall(jetTypeArguments, typeArguments, candidate, context.trace); + + Map + substitutionContext = FunctionDescriptorUtil.createSubstitutionContext((FunctionDescriptor)candidate, typeArguments); + D substitutedDescriptor = (D) candidate.substitute(TypeSubstitutor.create(substitutionContext)); + + candidateCall.setResultingDescriptor(substitutedDescriptor); + replaceValueParametersWithSubstitutedOnes(candidateCall, substitutedDescriptor); + + List typeParameters = candidateCall.getCandidateDescriptor().getTypeParameters(); + for (int i = 0; i < typeParameters.size(); i++) { + TypeParameterDescriptor typeParameterDescriptor = typeParameters.get(i); + candidateCall.recordTypeArgument(typeParameterDescriptor, typeArguments.get(i)); + } + candidateCall.setStatus(checkAllValueArguments(context)); + } + else { + candidateCall.setStatus(OTHER_ERROR); + context.tracing.wrongNumberOfTypeArguments(context.trace, expectedTypeArgumentCount); + } + } + + task.performAdvancedChecks(candidate, context.trace, context.tracing); + + // 'super' cannot be passed as an argument, for receiver arguments expression typer does not track this + // See TaskPrioritizer for more + JetSuperExpression superExpression = TaskPrioritizer.getReceiverSuper(candidateCall.getReceiverArgument()); + if (superExpression != null) { + context.trace.report(SUPER_IS_NOT_AN_EXPRESSION.on(superExpression, superExpression.getText())); + candidateCall.setStatus(OTHER_ERROR); + } + + recordAutoCastIfNecessary(candidateCall.getReceiverArgument(), candidateCall.getTrace()); + recordAutoCastIfNecessary(candidateCall.getThisObject(), candidateCall.getTrace()); + } + private ResolutionStatus inferTypeArguments(CallResolutionContext context) { ResolvedCallImpl candidateCall = context.candidateCall; D candidate = candidateCall.getCandidateDescriptor(); @@ -843,25 +860,26 @@ public class CallResolver { @NotNull public OverloadResolutionResults resolveExactSignature(@NotNull JetScope scope, @NotNull ReceiverDescriptor receiver, @NotNull String name, @NotNull List parameterTypes) { - List> result = findCandidatesByExactSignature(scope, receiver, name, parameterTypes); + List> candidates = findCandidatesByExactSignature(scope, receiver, name, parameterTypes); BindingTraceContext trace = new BindingTraceContext(); TemporaryBindingTrace temporaryBindingTrace = TemporaryBindingTrace.create(trace); - Set> candidates = Sets.newLinkedHashSet(); - for (ResolvedCallImpl call : result) { + Set> calls = Sets.newLinkedHashSet(); + for (ResolutionCandidate candidate : candidates) { + ResolvedCallImpl call = ResolvedCallImpl.create(candidate); call.setTrace(temporaryBindingTrace); - candidates.add(call); + calls.add(call); } - return computeResultAndReportErrors(trace, TracingStrategy.EMPTY, candidates, Collections.>emptySet()); + return computeResultAndReportErrors(trace, TracingStrategy.EMPTY, calls, Collections.>emptySet()); } - private List> findCandidatesByExactSignature(JetScope scope, ReceiverDescriptor receiver, + private List> findCandidatesByExactSignature(JetScope scope, ReceiverDescriptor receiver, String name, List parameterTypes) { - List> result = Lists.newArrayList(); + List> result = Lists.newArrayList(); if (receiver.exists()) { - Collection> extensionFunctionDescriptors = ResolvedCallImpl.convertCollection(scope.getFunctions(name)); - List> nonlocal = Lists.newArrayList(); - List> local = Lists.newArrayList(); + Collection> extensionFunctionDescriptors = ResolutionCandidate.convertCollection(scope.getFunctions(name)); + List> nonlocal = Lists.newArrayList(); + List> local = Lists.newArrayList(); TaskPrioritizer.splitLexicallyLocalDescriptors(extensionFunctionDescriptors, scope.getContainingDeclaration(), local, nonlocal); @@ -869,7 +887,7 @@ public class CallResolver { return result; } - Collection> functionDescriptors = ResolvedCallImpl.convertCollection(receiver.getType().getMemberScope().getFunctions(name)); + Collection> functionDescriptors = ResolutionCandidate.convertCollection(receiver.getType().getMemberScope().getFunctions(name)); if (lookupExactSignature(functionDescriptors, parameterTypes, result)) { return result; @@ -878,16 +896,16 @@ public class CallResolver { return result; } else { - lookupExactSignature(ResolvedCallImpl.convertCollection(scope.getFunctions(name)), parameterTypes, result); + lookupExactSignature(ResolutionCandidate.convertCollection(scope.getFunctions(name)), parameterTypes, result); return result; } } - private static boolean lookupExactSignature(Collection> candidates, List parameterTypes, - List> result) { + private static boolean lookupExactSignature(Collection> candidates, List parameterTypes, + List> result) { boolean found = false; - for (ResolvedCallImpl resolvedCall : candidates) { - FunctionDescriptor functionDescriptor = resolvedCall.getResultingDescriptor(); + for (ResolutionCandidate resolvedCall : candidates) { + FunctionDescriptor functionDescriptor = resolvedCall.getDescriptor(); if (functionDescriptor.getReceiverParameter().exists()) continue; if (!functionDescriptor.getTypeParameters().isEmpty()) continue; if (!checkValueParameters(functionDescriptor, parameterTypes)) continue; @@ -897,17 +915,17 @@ public class CallResolver { return found; } - private boolean findExtensionFunctions(Collection> candidates, ReceiverDescriptor receiver, - List parameterTypes, List> result) { + private boolean findExtensionFunctions(Collection> candidates, ReceiverDescriptor receiver, + List parameterTypes, List> result) { boolean found = false; - for (ResolvedCallImpl resolvedCall : candidates) { - FunctionDescriptor functionDescriptor = resolvedCall.getResultingDescriptor(); + for (ResolutionCandidate candidate : candidates) { + FunctionDescriptor functionDescriptor = candidate.getDescriptor(); ReceiverDescriptor functionReceiver = functionDescriptor.getReceiverParameter(); if (!functionReceiver.exists()) continue; if (!functionDescriptor.getTypeParameters().isEmpty()) continue; if (!typeChecker.isSubtypeOf(receiver.getType(), functionReceiver.getType())) continue; if (!checkValueParameters(functionDescriptor, parameterTypes))continue; - result.add(resolvedCall); + result.add(candidate); found = true; } return found; @@ -923,15 +941,4 @@ public class CallResolver { } return true; } - - private static final class CallResolutionContext extends ResolutionContext { - /*package*/ final ResolvedCallImpl candidateCall; - /*package*/ final TracingStrategy tracing; - - public CallResolutionContext(ResolvedCallImpl candidateCall, ResolutionTask task, BindingTrace trace, TracingStrategy tracing) { - super(trace, task.scope, task.call, task.expectedType, task.dataFlowInfo); - this.candidateCall = candidateCall; - this.tracing = tracing; - } - } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformationStrategy.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformationStrategy.java new file mode 100644 index 00000000000..5fc68364ae5 --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformationStrategy.java @@ -0,0 +1,118 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.resolve.calls; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; +import org.jetbrains.jet.lang.descriptors.VariableDescriptor; +import org.jetbrains.jet.lang.psi.*; +import org.jetbrains.jet.lang.resolve.BindingTrace; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + * @author svtk + */ +public interface CallTransformationStrategy { + + @NotNull + CallResolutionContext createCallContext(@NotNull ResolutionCandidate candidate, + @NotNull ResolutionTask task, + @NotNull BindingTrace trace, + @NotNull TracingStrategy tracing); + + @NotNull + Collection> transformResultCall(@NotNull CallResolutionContext callResolutionContext, + @NotNull CallResolver callResolver, + @NotNull ResolutionTask task); + + CallTransformationStrategy + PROPERTY_CALL_TRANSFORMATION_STRATEGY = new CallTransformationStrategy() { + @NotNull + @Override + public CallResolutionContext createCallContext(@NotNull ResolutionCandidate candidate, + @NotNull ResolutionTask task, @NotNull BindingTrace trace, @NotNull TracingStrategy tracing) { + ResolvedCallImpl candidateCall = ResolvedCallImpl.create(candidate); + return new CallResolutionContext(candidateCall, task, trace, tracing); + } + + @NotNull + @Override + public Collection> transformResultCall(@NotNull CallResolutionContext context, + @NotNull CallResolver callResolver, @NotNull ResolutionTask task) { + return Collections.singleton(context.candidateCall); + } + }; + + CallTransformationStrategy + FUNCTION_CALL_TRANSFORMATION_STRATEGY = new CallTransformationStrategy() { + @NotNull + @Override + public CallResolutionContext createCallContext(@NotNull ResolutionCandidate candidate, + @NotNull ResolutionTask task, + @NotNull BindingTrace trace, + @NotNull TracingStrategy tracing) { + if (candidate.getDescriptor() instanceof FunctionDescriptor) { + return new CallResolutionContext(ResolvedCallImpl.create(candidate), task, trace, tracing); + } + assert candidate.getDescriptor() instanceof VariableDescriptor; + Call propertyCall = new DelegatingCall(task.call) { + @Override + public JetValueArgumentList getValueArgumentList() { + return null; + } + + @NotNull + @Override + public List getFunctionLiteralArguments() { + return Collections.emptyList(); + } + + @NotNull + @Override + public List getTypeArguments() { + return Collections.emptyList(); + } + + @Override + public JetTypeArgumentList getTypeArgumentList() { + return null; + } + }; + return new CallResolutionContext(ResolvedCallImpl.create(candidate), task, trace, tracing, propertyCall); + } + + @NotNull + @Override + public Collection> transformResultCall(@NotNull CallResolutionContext context, + @NotNull CallResolver callResolver, @NotNull ResolutionTask task) { + FunctionDescriptor descriptor = context.candidateCall.getCandidateDescriptor(); + if (descriptor instanceof FunctionDescriptor) { + return Collections.singleton(context.candidateCall); + } + assert descriptor instanceof VariableDescriptor; + BasicResolutionContext basicResolutionContext = + BasicResolutionContext.create(context.trace, context.scope, task.call, context.expectedType, context.dataFlowInfo); + OverloadResolutionResults results = + callResolver.resolveCallWithGivenName(basicResolutionContext, task.reference, "invoke"); + return ((OverloadResolutionResultsImpl)results).getResultingCalls(); + } + }; +} diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizer.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizer.java new file mode 100644 index 00000000000..14dace99c4d --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizer.java @@ -0,0 +1,38 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.resolve.calls; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.resolve.scopes.JetScope; +import org.jetbrains.jet.lang.types.JetType; + +import java.util.Collection; + +/** + * @author svtk + */ +public interface MemberPrioritizer { + @NotNull + Collection getNonExtensionsByName(JetScope scope, String name); + + @NotNull + Collection getMembersByName(@NotNull JetType receiver, String name); + + @NotNull + Collection getExtensionsByName(JetScope scope, String name); +} diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizers.java similarity index 82% rename from compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.java rename to compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizers.java index 48e16fb27c1..a7e793dcb4a 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizers.java @@ -34,14 +34,15 @@ import java.util.*; /** * @author abreslav */ -public class TaskPrioritizers { +public class MemberPrioritizers { - /*package*/ static TaskPrioritizer FUNCTION_TASK_PRIORITIZER = new TaskPrioritizer() { + /*package*/ static MemberPrioritizer FUNCTION_TASK_PRIORITIZER = new MemberPrioritizer() { + @NotNull @Override - protected Collection getNonExtensionsByName(JetScope scope, String name) { + public Collection getNonExtensionsByName(JetScope scope, String name) { Set functions = Sets.newLinkedHashSet(scope.getFunctions(name)); for (Iterator iterator = functions.iterator(); iterator.hasNext(); ) { FunctionDescriptor functionDescriptor = iterator.next(); @@ -57,7 +58,7 @@ public class TaskPrioritizers { @NotNull @Override - protected Collection getMembersByName(@NotNull JetType receiverType, String name) { + public Collection getMembersByName(@NotNull JetType receiverType, String name) { JetScope receiverScope = receiverType.getMemberScope(); Set members = Sets.newHashSet(receiverScope.getFunctions(name)); addConstructors(receiverScope, name, members); @@ -67,7 +68,7 @@ public class TaskPrioritizers { @NotNull @Override - protected Collection getExtensionsByName(JetScope scope, String name) { + public Collection getExtensionsByName(JetScope scope, String name) { Set extensionFunctions = Sets.newHashSet(scope.getFunctions(name)); for (Iterator iterator = extensionFunctions.iterator(); iterator.hasNext(); ) { FunctionDescriptor descriptor = iterator.next(); @@ -104,11 +105,11 @@ public class TaskPrioritizers { } }; - /*package*/ static TaskPrioritizer VARIABLE_TASK_PRIORITIZER = new TaskPrioritizer() { + /*package*/ static MemberPrioritizer VARIABLE_TASK_PRIORITIZER = new MemberPrioritizer() { @NotNull @Override - protected Collection getNonExtensionsByName(JetScope scope, String name) { + public Collection getNonExtensionsByName(JetScope scope, String name) { VariableDescriptor descriptor = scope.getLocalVariable(name); if (descriptor == null) { descriptor = DescriptorUtils.filterNonExtensionProperty(scope.getProperties(name)); @@ -119,13 +120,13 @@ public class TaskPrioritizers { @NotNull @Override - protected Collection getMembersByName(@NotNull JetType receiverType, String name) { + public Collection getMembersByName(@NotNull JetType receiverType, String name) { return receiverType.getMemberScope().getProperties(name); } @NotNull @Override - protected Collection getExtensionsByName(JetScope scope, String name) { + public Collection getExtensionsByName(JetScope scope, String name) { return Collections2.filter(scope.getProperties(name), new Predicate() { @Override public boolean apply(@Nullable VariableDescriptor variableDescriptor) { @@ -135,7 +136,7 @@ public class TaskPrioritizers { } }; - /*package*/ static TaskPrioritizer PROPERTY_TASK_PRIORITIZER = new TaskPrioritizer() { + /*package*/ static MemberPrioritizer PROPERTY_TASK_PRIORITIZER = new MemberPrioritizer() { private Collection filterProperties(Collection variableDescriptors) { ArrayList properties = Lists.newArrayList(); for (VariableDescriptor descriptor : variableDescriptors) { @@ -148,19 +149,19 @@ public class TaskPrioritizers { @NotNull @Override - protected Collection getNonExtensionsByName(JetScope scope, String name) { + public Collection getNonExtensionsByName(JetScope scope, String name) { return filterProperties(VARIABLE_TASK_PRIORITIZER.getNonExtensionsByName(scope, name)); } @NotNull @Override - protected Collection getMembersByName(@NotNull JetType receiver, String name) { + public Collection getMembersByName(@NotNull JetType receiver, String name) { return filterProperties(VARIABLE_TASK_PRIORITIZER.getMembersByName(receiver, name)); } @NotNull @Override - protected Collection getExtensionsByName(JetScope scope, String name) { + public Collection getExtensionsByName(JetScope scope, String name) { return filterProperties(VARIABLE_TASK_PRIORITIZER.getExtensionsByName(scope, name)); } }; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionCandidate.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionCandidate.java new file mode 100644 index 00000000000..829185e3e31 --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionCandidate.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.resolve.calls; + +import com.google.common.collect.Lists; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor; + +import java.util.Collection; +import java.util.List; + +import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor.NO_RECEIVER; + +/** + * @author svtk + */ +public class ResolutionCandidate { + private final D candidateDescriptor; + private ReceiverDescriptor thisObject = NO_RECEIVER; // receiver object of a method + private ReceiverDescriptor receiverArgument = NO_RECEIVER; // receiver of an extension function + + private ResolutionCandidate(@NotNull D descriptor) { + candidateDescriptor = descriptor; + } + + public static ResolutionCandidate create(@NotNull D descriptor) { + return new ResolutionCandidate(descriptor); + } + + public void setThisObject(@NotNull ReceiverDescriptor thisObject) { + this.thisObject = thisObject; + } + + public void setReceiverArgument(@NotNull ReceiverDescriptor receiverArgument) { + this.receiverArgument = receiverArgument; + } + + @NotNull + public D getDescriptor() { + return candidateDescriptor; + } + + @NotNull + public ReceiverDescriptor getThisObject() { + return thisObject; + } + + @NotNull + public ReceiverDescriptor getReceiverArgument() { + return receiverArgument; + } + + @NotNull + public static List> convertCollection(@NotNull Collection descriptors) { + List> result = Lists.newArrayList(); + for (D descriptor : descriptors) { + result.add(create(descriptor)); + } + return result; + } + +} diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java index 32f3873ee83..5e3f7fdbac2 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java @@ -16,6 +16,8 @@ package org.jetbrains.jet.lang.resolve.calls; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; import com.google.common.collect.Sets; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; @@ -39,10 +41,7 @@ import java.util.Collection; import java.util.List; import static org.jetbrains.jet.lang.diagnostics.Errors.*; -import static org.jetbrains.jet.lang.diagnostics.Errors.DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED; -import static org.jetbrains.jet.lang.resolve.BindingContext.AMBIGUOUS_REFERENCE_TARGET; -import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; -import static org.jetbrains.jet.lang.resolve.BindingContext.RESOLVED_CALL; +import static org.jetbrains.jet.lang.resolve.BindingContext.*; /** * Stores candidates for call resolution. @@ -50,26 +49,32 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.RESOLVED_CALL; * @author abreslav */ public class ResolutionTask extends ResolutionContext { - private final Collection> candidates; + private final Collection> candidates; + private final Multimap, ResolvedCallImpl> resolvedCallMap = HashMultimap.create(); /*package*/ final JetReferenceExpression reference; private DescriptorCheckStrategy checkingStrategy; - public ResolutionTask(@NotNull Collection> candidates, @NotNull JetReferenceExpression reference, + public ResolutionTask(@NotNull Collection> candidates, @NotNull JetReferenceExpression reference, BindingTrace trace, JetScope scope, Call call, JetType expectedType, DataFlowInfo dataFlowInfo) { super(trace, scope, call, expectedType, dataFlowInfo); this.candidates = candidates; this.reference = reference; } - public ResolutionTask(@NotNull Collection> candidates, @NotNull JetReferenceExpression reference, @NotNull BasicResolutionContext context) { + public ResolutionTask(@NotNull Collection> candidates, @NotNull JetReferenceExpression reference, @NotNull BasicResolutionContext context) { this(candidates, reference, context.trace, context.scope, context.call, context.expectedType, context.dataFlowInfo); } @NotNull - public Collection> getCandidates() { + public Collection> getCandidates() { return candidates; } + @NotNull + public Multimap, ResolvedCallImpl> getResolvedCallMap() { + return resolvedCallMap; + } + public void setCheckingStrategy(DescriptorCheckStrategy strategy) { checkingStrategy = strategy; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTaskHolder.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTaskHolder.java index 4b27a266b07..4e39c8ccfde 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTaskHolder.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTaskHolder.java @@ -34,35 +34,35 @@ import java.util.List; public class ResolutionTaskHolder { private final JetReferenceExpression reference; private final BasicResolutionContext basicResolutionContext; - private final Predicate> visibleStrategy; + private final Predicate> visibleStrategy; - private final Collection>> localExtensions = Sets.newLinkedHashSet(); - private final Collection>> members = Sets.newLinkedHashSet(); - private final Collection>> nonLocalExtensions = Sets.newLinkedHashSet(); + private final Collection>> localExtensions = Sets.newLinkedHashSet(); + private final Collection>> members = Sets.newLinkedHashSet(); + private final Collection>> nonLocalExtensions = Sets.newLinkedHashSet(); private List> tasks = null; public ResolutionTaskHolder(@NotNull JetReferenceExpression reference, @NotNull BasicResolutionContext basicResolutionContext, - @NotNull Predicate> visibleStrategy) { + @NotNull Predicate> visibleStrategy) { this.reference = reference; this.basicResolutionContext = basicResolutionContext; this.visibleStrategy = visibleStrategy; } - public void addLocalExtensions(@NotNull Collection> candidates) { + public void addLocalExtensions(@NotNull Collection> candidates) { if (!candidates.isEmpty()) { localExtensions.add(candidates); } } - public void addMembers(@NotNull Collection> candidates) { + public void addMembers(@NotNull Collection> candidates) { if (!candidates.isEmpty()) { members.add(candidates); } } - public void addNonLocalExtensions(@NotNull Collection> candidates) { + public void addNonLocalExtensions(@NotNull Collection> candidates) { if (!candidates.isEmpty()) { nonLocalExtensions.add(candidates); } @@ -71,7 +71,7 @@ public class ResolutionTaskHolder { public List> getTasks() { if (tasks == null) { tasks = Lists.newArrayList(); - List>> candidateList = Lists.newArrayList(); + List>> candidateList = Lists.newArrayList(); // If the call is of the form super.foo(), it can actually be only a member // But if there's no appropriate member, we would like to report that super cannot be a receiver for an extension // Thus, put members first @@ -85,9 +85,9 @@ public class ResolutionTaskHolder { } candidateList.addAll(nonLocalExtensions); - for (Predicate> visibilityStrategy : Lists.newArrayList(visibleStrategy, Predicates.not(visibleStrategy))) { - for (Collection> candidates : candidateList) { - Collection> filteredCandidates = Collections2.filter(candidates, visibilityStrategy); + for (Predicate> visibilityStrategy : Lists.newArrayList(visibleStrategy, Predicates.not(visibleStrategy))) { + for (Collection> candidates : candidateList) { + Collection> filteredCandidates = Collections2.filter(candidates, visibilityStrategy); if (!filteredCandidates.isEmpty()) { tasks.add(new ResolutionTask(filteredCandidates, reference, basicResolutionContext)); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java index 771cca8c841..7f7d1b84411 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java @@ -33,7 +33,6 @@ import java.util.List; import java.util.Map; import static org.jetbrains.jet.lang.resolve.calls.ResolutionStatus.UNKNOWN_STATUS; -import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor.NO_RECEIVER; /** * @author abreslav @@ -55,23 +54,14 @@ public class ResolvedCallImpl implements ResolvedC }; @NotNull - public static ResolvedCallImpl create(@NotNull D descriptor) { - return new ResolvedCallImpl(descriptor); - } - - @NotNull - public static List> convertCollection(@NotNull Collection descriptors) { - List> result = Lists.newArrayList(); - for (D descriptor : descriptors) { - result.add(create(descriptor)); - } - return result; + public static ResolvedCallImpl create(@NotNull ResolutionCandidate candidate) { + return new ResolvedCallImpl(candidate.getDescriptor(), candidate.getThisObject(), candidate.getReceiverArgument()); } private final D candidateDescriptor; private D resultingDescriptor; // Probably substituted - private ReceiverDescriptor thisObject = NO_RECEIVER; // receiver object of a method - private ReceiverDescriptor receiverArgument = NO_RECEIVER; // receiver of an extension function + private final ReceiverDescriptor thisObject; // receiver object of a method + private final ReceiverDescriptor receiverArgument; // receiver of an extension function private final Map typeArguments = Maps.newLinkedHashMap(); private final Map autoCasts = Maps.newHashMap(); @@ -80,8 +70,10 @@ public class ResolvedCallImpl implements ResolvedC private TemporaryBindingTrace trace; private ResolutionStatus status = UNKNOWN_STATUS; - private ResolvedCallImpl(@NotNull D candidateDescriptor) { + private ResolvedCallImpl(@NotNull D candidateDescriptor, @NotNull ReceiverDescriptor thisObject, @NotNull ReceiverDescriptor receiverArgument) { this.candidateDescriptor = candidateDescriptor; + this.thisObject = thisObject; + this.receiverArgument = receiverArgument; } @NotNull @@ -140,20 +132,12 @@ public class ResolvedCallImpl implements ResolvedC return receiverArgument; } - public void setReceiverArgument(@NotNull ReceiverDescriptor receiverParameter) { - this.receiverArgument = receiverParameter; - } - @Override @NotNull public ReceiverDescriptor getThisObject() { return thisObject; } - public void setThisObject(@NotNull ReceiverDescriptor thisObject) { - this.thisObject = thisObject; - } - @Override @NotNull public Map getValueArguments() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.java index 5492bb2c921..6a1cd61c00f 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.java @@ -31,7 +31,6 @@ import org.jetbrains.jet.lang.resolve.scopes.receivers.ClassReceiver; import org.jetbrains.jet.lang.resolve.scopes.receivers.ExpressionReceiver; import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor; import org.jetbrains.jet.lang.types.ErrorUtils; -import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.NamespaceType; import org.jetbrains.jet.lang.types.checker.JetTypeChecker; @@ -44,16 +43,16 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor /** * @author abreslav */ -/*package*/ abstract class TaskPrioritizer { +/*package*/ abstract class TaskPrioritizer { public static void splitLexicallyLocalDescriptors( - @NotNull Collection> allDescriptors, + @NotNull Collection> allDescriptors, @NotNull DeclarationDescriptor containerOfTheCurrentLocality, - @NotNull Collection> local, - @NotNull Collection> nonlocal + @NotNull Collection> local, + @NotNull Collection> nonlocal ) { - for (ResolvedCallImpl resolvedCall : allDescriptors) { - if (DescriptorUtils.isLocal(containerOfTheCurrentLocality, resolvedCall.getCandidateDescriptor())) { + for (ResolutionCandidate resolvedCall : allDescriptors) { + if (DescriptorUtils.isLocal(containerOfTheCurrentLocality, resolvedCall.getDescriptor())) { local.add(resolvedCall); } else { @@ -75,8 +74,8 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor } @NotNull - public List> computePrioritizedTasks(@NotNull BasicResolutionContext context, @NotNull String name, - @NotNull JetReferenceExpression functionReference) { + public static List> computePrioritizedTasks(@NotNull BasicResolutionContext context, @NotNull String name, + @NotNull JetReferenceExpression functionReference, @NotNull List> memberPrioritizers) { ReceiverDescriptor explicitReceiver = context.call.getExplicitReceiver(); final JetScope scope; if (explicitReceiver.exists() && explicitReceiver.getType() instanceof NamespaceType) { @@ -87,40 +86,41 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor else { scope = context.scope; } - final Predicate> visibleStrategy = new Predicate>() { + final Predicate> visibleStrategy = new Predicate>() { @Override - public boolean apply(@Nullable ResolvedCallImpl call) { + public boolean apply(@Nullable ResolutionCandidate call) { if (call == null) return false; - D candidateDescriptor = call.getCandidateDescriptor(); + D candidateDescriptor = call.getDescriptor(); if (ErrorUtils.isError(candidateDescriptor)) return true; return Visibilities.isVisible(candidateDescriptor, scope.getContainingDeclaration()); } }; ResolutionTaskHolder result = new ResolutionTaskHolder(functionReference, context, visibleStrategy ); - doComputeTasks(scope, explicitReceiver, name, result, context); + doComputeTasks(scope, explicitReceiver, name, result, context, memberPrioritizers); return result.getTasks(); } - private void doComputeTasks(@NotNull JetScope scope, @NotNull ReceiverDescriptor receiver, + private static void doComputeTasks(@NotNull JetScope scope, @NotNull ReceiverDescriptor receiver, @NotNull String name, @NotNull ResolutionTaskHolder result, - @NotNull BasicResolutionContext context) { + @NotNull BasicResolutionContext context, @NotNull List> memberPrioritizers) { + MemberPrioritizer memberPrioritizer = memberPrioritizers.get(0); AutoCastServiceImpl autoCastService = new AutoCastServiceImpl(context.dataFlowInfo, context.trace.getBindingContext()); List implicitReceivers = Lists.newArrayList(); scope.getImplicitReceiversHierarchy(implicitReceivers); if (receiver.exists()) { List variantsForExplicitReceiver = autoCastService.getVariantsForReceiver(receiver); - Collection> extensionFunctions = convertWithImpliedThis(scope, variantsForExplicitReceiver, getExtensionsByName(scope, name)); - List> nonlocals = Lists.newArrayList(); - List> locals = Lists.newArrayList(); + Collection> extensionFunctions = convertWithImpliedThis(scope, variantsForExplicitReceiver, memberPrioritizer.getExtensionsByName(scope, name)); + List> nonlocals = Lists.newArrayList(); + List> locals = Lists.newArrayList(); //noinspection unchecked,RedundantTypeArguments TaskPrioritizer.splitLexicallyLocalDescriptors(extensionFunctions, scope.getContainingDeclaration(), locals, nonlocals); - Collection> members = Lists.newArrayList(); + Collection> members = Lists.newArrayList(); for (ReceiverDescriptor variant : variantsForExplicitReceiver) { - Collection membersForThisVariant = getMembersByName(variant.getType(), name); + Collection membersForThisVariant = memberPrioritizer.getMembersByName(variant.getType(), name); convertWithReceivers(membersForThisVariant, Collections.singletonList(variant), Collections.singletonList(NO_RECEIVER), members); } @@ -128,7 +128,7 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor result.addMembers(members); for (ReceiverDescriptor implicitReceiver : implicitReceivers) { - Collection memberExtensions = getExtensionsByName(implicitReceiver.getType().getMemberScope(), name); + Collection memberExtensions = memberPrioritizer.getExtensionsByName(implicitReceiver.getType().getMemberScope(), name); List variantsForImplicitReceiver = autoCastService.getVariantsForReceiver(implicitReceiver); result.addNonLocalExtensions(convertWithReceivers(memberExtensions, variantsForImplicitReceiver, variantsForExplicitReceiver)); } @@ -136,10 +136,10 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor result.addNonLocalExtensions(nonlocals); } else { - Collection> functions = convertWithImpliedThis(scope, Collections.singletonList(receiver), getNonExtensionsByName(scope, name)); + Collection> functions = convertWithImpliedThis(scope, Collections.singletonList(receiver), memberPrioritizer.getNonExtensionsByName(scope, name)); - List> nonlocals = Lists.newArrayList(); - List> locals = Lists.newArrayList(); + List> nonlocals = Lists.newArrayList(); + List> locals = Lists.newArrayList(); //noinspection unchecked,RedundantTypeArguments TaskPrioritizer.splitLexicallyLocalDescriptors(functions, scope.getContainingDeclaration(), locals, nonlocals); @@ -147,22 +147,22 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor result.addNonLocalExtensions(nonlocals); for (ReceiverDescriptor implicitReceiver : implicitReceivers) { - doComputeTasks(scope, implicitReceiver, name, result, context); + doComputeTasks(scope, implicitReceiver, name, result, context, memberPrioritizers); } } } - private Collection> convertWithReceivers(Collection descriptors, Iterable thisObjects, Iterable receiverParameters) { - Collection> result = Lists.newArrayList(); + private static Collection> convertWithReceivers(Collection descriptors, Iterable thisObjects, Iterable receiverParameters) { + Collection> result = Lists.newArrayList(); convertWithReceivers(descriptors, thisObjects, receiverParameters, result); return result; } - private void convertWithReceivers(Collection descriptors, Iterable thisObjects, Iterable receiverParameters, Collection> result) { + private static void convertWithReceivers(Collection descriptors, Iterable thisObjects, Iterable receiverParameters, Collection> result) { for (ReceiverDescriptor thisObject : thisObjects) { for (ReceiverDescriptor receiverParameter : receiverParameters) { for (D extension : descriptors) { - ResolvedCallImpl resolvedCall = ResolvedCallImpl.create(extension); + ResolutionCandidate resolvedCall = ResolutionCandidate.create(extension); resolvedCall.setThisObject(thisObject); resolvedCall.setReceiverArgument(receiverParameter); result.add(resolvedCall); @@ -171,11 +171,11 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor } } - public static Collection> convertWithImpliedThis(JetScope scope, Iterable receiverParameters, Collection descriptors) { - Collection> result = Lists.newArrayList(); + public static Collection> convertWithImpliedThis(JetScope scope, Iterable receiverParameters, Collection descriptors) { + Collection> result = Lists.newArrayList(); for (ReceiverDescriptor receiverParameter : receiverParameters) { for (D descriptor : descriptors) { - ResolvedCallImpl resolvedCall = ResolvedCallImpl.create(descriptor); + ResolutionCandidate resolvedCall = ResolutionCandidate.create(descriptor); resolvedCall.setReceiverArgument(receiverParameter); if (setImpliedThis(scope, resolvedCall)) { result.add(resolvedCall); @@ -190,7 +190,7 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor containingDeclaration = containingDeclaration.getContainingDeclaration(); } if (containingDeclaration instanceof ClassDescriptor && ((ClassDescriptor) containingDeclaration).getKind() == ClassKind.OBJECT) { - ResolvedCallImpl resolvedCall = ResolvedCallImpl.create(descriptor); + ResolutionCandidate resolvedCall = ResolutionCandidate.create(descriptor); resolvedCall.setThisObject(new ClassReceiver((ClassDescriptor) containingDeclaration)); result.add(resolvedCall); } @@ -199,8 +199,8 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor return result; } - private static boolean setImpliedThis(@NotNull JetScope scope, ResolvedCallImpl resolvedCall) { - ReceiverDescriptor expectedThisObject = resolvedCall.getCandidateDescriptor().getExpectedThisObject(); + private static boolean setImpliedThis(@NotNull JetScope scope, ResolutionCandidate resolvedCall) { + ReceiverDescriptor expectedThisObject = resolvedCall.getDescriptor().getExpectedThisObject(); if (!expectedThisObject.exists()) return true; List receivers = Lists.newArrayList(); scope.getImplicitReceiversHierarchy(receivers); @@ -213,13 +213,4 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor } return false; } - - @NotNull - protected abstract Collection getNonExtensionsByName(JetScope scope, String name); - - @NotNull - protected abstract Collection getMembersByName(@NotNull JetType receiver, String name); - - @NotNull - protected abstract Collection getExtensionsByName(JetScope scope, String name); } diff --git a/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolwindow.java b/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolwindow.java index 6cf342f93da..d674edd60e0 100644 --- a/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolwindow.java +++ b/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolwindow.java @@ -194,7 +194,7 @@ public class ResolveToolwindow extends JPanel implements Disposable { if (debugInfo != null) { List> resolutionTasks = debugInfo.get(TASKS); for (ResolutionTask resolutionTask : resolutionTasks) { - for (ResolvedCallImpl resolvedCall : resolutionTask.getCandidates()) { + for (ResolvedCallImpl resolvedCall : resolutionTask.getResolvedCallMap().values()) { renderResolutionLogForCall(debugInfo, resolvedCall, result); } } diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java b/js/js.translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java index 0955dc23522..85a09258840 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java @@ -21,6 +21,7 @@ import com.google.dart.compiler.backend.js.ast.JsExpression; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.resolve.calls.ResolutionCandidate; import org.jetbrains.jet.lang.resolve.calls.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.ResolvedCallImpl; import org.jetbrains.k2js.translate.context.TranslationContext; @@ -103,7 +104,7 @@ public final class CallBuilder { private CallTranslator finish() { if (resolvedCall == null) { assert descriptor != null; - resolvedCall = ResolvedCallImpl.create(descriptor); + resolvedCall = ResolvedCallImpl.create(ResolutionCandidate.create(descriptor)); } if (descriptor == null) { descriptor = resolvedCall.getCandidateDescriptor().getOriginal(); From 09f7c012bdec53f1977be3b927905ee1c8f9d091 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Fri, 20 Apr 2012 17:12:51 +0400 Subject: [PATCH 13/16] preserve order of resolved calls --- .../org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java index 5e3f7fdbac2..3f7468a0479 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java @@ -16,7 +16,7 @@ package org.jetbrains.jet.lang.resolve.calls; -import com.google.common.collect.HashMultimap; +import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; import com.intellij.lang.ASTNode; @@ -50,7 +50,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.*; */ public class ResolutionTask extends ResolutionContext { private final Collection> candidates; - private final Multimap, ResolvedCallImpl> resolvedCallMap = HashMultimap.create(); + private final Multimap, ResolvedCallImpl> resolvedCallMap = LinkedHashMultimap.create(); /*package*/ final JetReferenceExpression reference; private DescriptorCheckStrategy checkingStrategy; From da474b961f7696d3a08146b8f6977a1be0d7cb88 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 20 Apr 2012 18:47:36 +0400 Subject: [PATCH 14/16] Detailed status for ValueArgumentsToParameterMapper When a non-vararg parameter gets spread with a '*' in front of it, a "weak error" is returned. A candidate with a weak error in parameter matching is type-checked, but not successful. --- .../lang/resolve/calls/ResolutionStatus.java | 2 +- .../lang/resolve/calls/ResolvedCallImpl.java | 4 +- .../ValueArgumentsToParametersMapper.java | 79 +++++++++++++------ 3 files changed, 60 insertions(+), 25 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.java index 5e53fbb25aa..d1584abad00 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.java @@ -49,7 +49,7 @@ public enum ResolutionStatus { } public ResolutionStatus combine(ResolutionStatus other) { - if (this.isSuccess()) return other; + if (this == UNKNOWN_STATUS || this.isSuccess()) return other; if (!other.isSuccess() && this.getSeverityIndex() < other.getSeverityIndex()) return other; return this; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java index 7f7d1b84411..2bf2516e751 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java @@ -81,8 +81,8 @@ public class ResolvedCallImpl implements ResolvedC return status; } - public void setStatus(@NotNull ResolutionStatus status) { - this.status = status; + public void addStatus(@NotNull ResolutionStatus status) { + this.status = this.status.combine(status); } @NotNull diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.java index b0310bafbef..e88d16dd086 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.java @@ -33,17 +33,49 @@ import java.util.Set; import static org.jetbrains.jet.lang.diagnostics.Errors.*; import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; +import static org.jetbrains.jet.lang.resolve.calls.ValueArgumentsToParametersMapper.Status.ERROR; +import static org.jetbrains.jet.lang.resolve.calls.ValueArgumentsToParametersMapper.Status.OK; +import static org.jetbrains.jet.lang.resolve.calls.ValueArgumentsToParametersMapper.Status.WEAK_ERROR; /** * @author abreslav */ /*package*/ class ValueArgumentsToParametersMapper { - public static boolean mapValueArgumentsToParameters( + + public enum Status { + ERROR(false), + WEAK_ERROR(false), + OK(true); + + private final boolean success; + + private Status(boolean success) { + this.success = success; + } + + public boolean isSuccess() { + return success; + } + + public Status compose(Status other) { + switch (other) { + case ERROR: + return ERROR; + case WEAK_ERROR: + if (this != ERROR) { + return WEAK_ERROR; + } + default: + return this; + } + } + } + + public static Status mapValueArgumentsToParameters( @NotNull Call call, @NotNull TracingStrategy tracing, @NotNull ResolvedCallImpl candidateCall ) { - TemporaryBindingTrace temporaryTrace = candidateCall.getTrace(); Map varargs = Maps.newHashMap(); Set usedParameters = Sets.newHashSet(); @@ -61,7 +93,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; List valueArguments = call.getValueArguments(); - boolean error = false; + Status status = OK; boolean someNamed = false; boolean somePositioned = false; for (int i = 0; i < valueArguments.size(); i++) { @@ -72,47 +104,47 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; ValueParameterDescriptor valueParameterDescriptor = parameterByName.get(nameReference.getReferencedName()); if (valueParameterDescriptor == null) { temporaryTrace.report(NAMED_PARAMETER_NOT_FOUND.on(nameReference)); - error = true; + status = ERROR; } else { if (!usedParameters.add(valueParameterDescriptor)) { temporaryTrace.report(ARGUMENT_PASSED_TWICE.on(nameReference)); } temporaryTrace.record(REFERENCE_TARGET, nameReference, valueParameterDescriptor); - put(candidateCall, valueParameterDescriptor, valueArgument, varargs); + status = status.compose(put(candidateCall, valueParameterDescriptor, valueArgument, varargs)); } if (somePositioned) { temporaryTrace.report(MIXING_NAMED_AND_POSITIONED_ARGUMENTS.on(nameReference)); - error = true; + status = ERROR; } } else { somePositioned = true; if (someNamed) { temporaryTrace.report(MIXING_NAMED_AND_POSITIONED_ARGUMENTS.on(valueArgument.asElement())); - error = true; + status = ERROR; } else { int parameterCount = valueParameters.size(); if (i < parameterCount) { ValueParameterDescriptor valueParameterDescriptor = valueParameters.get(i); usedParameters.add(valueParameterDescriptor); - put(candidateCall, valueParameterDescriptor, valueArgument, varargs); + status = status.compose(put(candidateCall, valueParameterDescriptor, valueArgument, varargs)); } else if (!valueParameters.isEmpty()) { ValueParameterDescriptor valueParameterDescriptor = valueParameters.get(valueParameters.size() - 1); if (valueParameterDescriptor.getVarargElementType() != null) { - put(candidateCall, valueParameterDescriptor, valueArgument, varargs); + status = status.compose(put(candidateCall, valueParameterDescriptor, valueArgument, varargs)); usedParameters.add(valueParameterDescriptor); } else { temporaryTrace.report(TOO_MANY_ARGUMENTS.on(valueArgument.asElement(), candidate)); - error = true; + status = ERROR; } } else { temporaryTrace.report(TOO_MANY_ARGUMENTS.on(valueArgument.asElement(), candidate)); - error = true; + status = ERROR; } } } @@ -124,7 +156,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; if (valueParameters.isEmpty()) { temporaryTrace.report(TOO_MANY_ARGUMENTS.on(possiblyLabeledFunctionLiteral, candidate)); - error = true; + status = ERROR; } else { JetFunctionLiteralExpression functionLiteral; @@ -139,15 +171,15 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; ValueParameterDescriptor valueParameterDescriptor = valueParameters.get(valueParameters.size() - 1); if (valueParameterDescriptor.getVarargElementType() != null) { temporaryTrace.report(VARARG_OUTSIDE_PARENTHESES.on(possiblyLabeledFunctionLiteral)); - error = true; + status = ERROR; } else { if (!usedParameters.add(valueParameterDescriptor)) { temporaryTrace.report(TOO_MANY_ARGUMENTS.on(possiblyLabeledFunctionLiteral, candidate)); - error = true; + status = ERROR; } else { - put(candidateCall, valueParameterDescriptor, CallMaker.makeValueArgument(functionLiteral), varargs); + status = status.compose(put(candidateCall, valueParameterDescriptor, CallMaker.makeValueArgument(functionLiteral), varargs)); } } } @@ -155,7 +187,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; for (int i = 1; i < functionLiteralArguments.size(); i++) { JetExpression argument = functionLiteralArguments.get(i); temporaryTrace.report(MANY_FUNCTION_LITERAL_ARGUMENTS.on(argument)); - error = true; + status = ERROR; } } @@ -171,7 +203,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; else { // tracing.reportWrongValueArguments(temporaryTrace, "No value passed for parameter " + valueParameter.getName()); tracing.noValueForParameter(temporaryTrace, valueParameter); - error = true; + status = ERROR; } } } @@ -180,21 +212,22 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; ReceiverDescriptor receiverArgument = candidateCall.getReceiverArgument(); if (receiverParameter.exists() &&!receiverArgument.exists()) { tracing.missingReceiver(temporaryTrace, receiverParameter); - error = true; + status = ERROR; } if (!receiverParameter.exists() && receiverArgument.exists()) { tracing.noReceiverAllowed(temporaryTrace); - error = true; + status = ERROR; } if (candidateCall.getThisObject().exists() != candidateCall.getResultingDescriptor().getExpectedThisObject().exists()) { assert false : "Shouldn't happen because of TaskPrioritizer: " + candidateCall.getCandidateDescriptor(); } - return error; + return status; } - private static void put(ResolvedCallImpl candidateCall, ValueParameterDescriptor valueParameterDescriptor, ValueArgument valueArgument, Map varargs) { + private static Status put(ResolvedCallImpl candidateCall, ValueParameterDescriptor valueParameterDescriptor, ValueArgument valueArgument, Map varargs) { + Status error = OK; if (valueParameterDescriptor.getVarargElementType() != null) { VarargValueArgument vararg = varargs.get(valueParameterDescriptor); if (vararg == null) { @@ -207,11 +240,13 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; else { LeafPsiElement spread = valueArgument.getSpreadElement(); if (spread != null) { - candidateCall.getTrace().report(NON_VARARG_SPREAD.on(spread)); + candidateCall.getTrace().report(NON_VARARG_SPREAD.on(spread)); + error = WEAK_ERROR; } ResolvedValueArgument argument = new ExpressionValueArgument(valueArgument); candidateCall.recordValueArgument(valueParameterDescriptor, argument); } + return error; } /** From 45a0873afa3c3ee64d2387a979b0af00008007b6 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 20 Apr 2012 19:08:29 +0400 Subject: [PATCH 15/16] KT-1835 cannot call a Java API which has a method from(String) and from(String...) The problem was in the "more specific" relation, that didn't pay enough attention to varargs. The correct behavior is in the spirit of JLS 15.12.2 (as of Java 5): * a fixed-arity function always wins over a variable-arity functions * if two vararg functions are compared, their parameters are checked for subtyping. In the latter case, the candidates may have different number of formal parameters, so we compare the matching parts and then check the rest against the vararg parameter. #KT-1835 Fixed --- .../calls/OverloadingConflictResolver.java | 91 ++++++++++++++----- .../MoreSpecificVarargsOfEqualLength.jet | 9 ++ .../varargs/MostSepcificVarargsWithJava.jet | 19 ++++ .../diagnostics/tests/varargs/kt1835.jet | 12 +++ .../MoreSpecificVarargsOfEqualLength.jet | 9 ++ 5 files changed, 119 insertions(+), 21 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/varargs/MoreSpecificVarargsOfEqualLength.jet create mode 100644 compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.jet create mode 100644 compiler/testData/diagnostics/tests/varargs/kt1835.jet create mode 100644 compiler/testData/resolve/varargs/MoreSpecificVarargsOfEqualLength.jet diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.java index 44c37c97435..1edce3205fa 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.java @@ -25,10 +25,10 @@ import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.OverridingUtil; import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor; -import org.jetbrains.jet.lang.types.checker.JetTypeChecker; -import org.jetbrains.jet.lang.types.lang.JetStandardLibrary; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.TypeUtils; +import org.jetbrains.jet.lang.types.checker.JetTypeChecker; +import org.jetbrains.jet.lang.types.lang.JetStandardLibrary; import java.util.List; import java.util.Set; @@ -95,29 +95,73 @@ public class OverloadingConflictResolver { int fSize = fParams.size(); int gSize = gParams.size(); - if (fSize > gSize) return false; - for (int i = 0; i < gSize; i++) { - ValueParameterDescriptor gParam = gParams.get(i); - JetType gParamType = gParam.getType(); - if (i >= fSize) { - // f() has fewer parameters than g() - // The point is: g() may have a last vararg that doesn't get any arguments - // In this case f() is more specific, because one can explicitly pass - // an empty array to g() and make it preferred - if (i != gSize - 1 || gParam.getVarargElementType() == null) { + boolean fIsVararg = isVariableArity(fParams); + boolean gIsVararg = isVariableArity(gParams); + + if (!fIsVararg && gIsVararg) return true; + if (fIsVararg && !gIsVararg) return false; + + if (!fIsVararg && !gIsVararg) { + if (fSize != gSize) return false; + + for (int i = 0; i < fSize; i++) { + ValueParameterDescriptor fParam = fParams.get(i); + ValueParameterDescriptor gParam = gParams.get(i); + + JetType fParamType = fParam.getType(); + JetType gParamType = gParam.getType(); + + if (!typeMoreSpecific(fParamType, gParamType)) { return false; } - return true; - } - - JetType fParamType = fParams.get(i).getType(); - - if (!typeMoreSpecific(fParamType, gParamType)) { - return false; } } - + + if (fIsVararg && gIsVararg) { + // Check matching parameters + int minSize = Math.min(fSize, gSize); + for (int i = 0; i < minSize - 1; i++) { + ValueParameterDescriptor fParam = fParams.get(i); + ValueParameterDescriptor gParam = gParams.get(i); + + JetType fParamType = fParam.getType(); + JetType gParamType = gParam.getType(); + + if (!typeMoreSpecific(fParamType, gParamType)) { + return false; + } + } + + // Check the non-matching parameters of one function against the vararg parameter of the other funciton + // Example: + // f(a : A, vararg vf : T) + // g(vararg vg : T) + // here we check that typeof(a) < typeof(vg) and elementTypeOf(vf) < elementTypeOf(vg) + if (fSize < gSize) { + ValueParameterDescriptor fParam = fParams.get(fSize - 1); + JetType fParamType = fParam.getVarargElementType(); + assert fParamType != null : "fIsVararg guarantees this"; + for (int i = fSize - 1; i < gSize; i++) { + ValueParameterDescriptor gParam = gParams.get(i); + if (!typeMoreSpecific(fParamType, gParam.getType())) { + return false; + } + } + } + else { + ValueParameterDescriptor gParam = gParams.get(gSize - 1); + JetType gParamType = gParam.getVarargElementType(); + assert gParamType != null : "gIsVararg guarantees this"; + for (int i = gSize - 1; i < fSize; i++) { + ValueParameterDescriptor fParam = fParams.get(i); + if (!typeMoreSpecific(fParam.getType(), gParamType)) { + return false; + } + } + } + } + if (discriminateGenericDescriptors && isGeneric(f)) { if (!isGeneric(g)) { return false; @@ -130,7 +174,12 @@ public class OverloadingConflictResolver { return true; } - + + private boolean isVariableArity(List fParams) { + int fSize = fParams.size(); + return fSize > 0 && fParams.get(fSize - 1).getVarargElementType() != null; + } + private boolean isGeneric(CallableDescriptor f) { return !f.getOriginal().getTypeParameters().isEmpty(); } diff --git a/compiler/testData/diagnostics/tests/varargs/MoreSpecificVarargsOfEqualLength.jet b/compiler/testData/diagnostics/tests/varargs/MoreSpecificVarargsOfEqualLength.jet new file mode 100644 index 00000000000..ef8688c4899 --- /dev/null +++ b/compiler/testData/diagnostics/tests/varargs/MoreSpecificVarargsOfEqualLength.jet @@ -0,0 +1,9 @@ +fun main(d : D) { + d.from("") + d.from(1) +} + +class D { + fun from(vararg a : Any){} + fun from(vararg a : String){} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.jet b/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.jet new file mode 100644 index 00000000000..dcc1d93ae4b --- /dev/null +++ b/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.jet @@ -0,0 +1,19 @@ +// FILE: kotlin.kt +fun main(j : C, s : Array) { + j.from() + j.from("") + j.from("", "") + j.from("", "", "") + + j.from("", *s) // This should not be an ambiguity, see KT-1842 + j.from(*s) +} + +// FILE: C.java +public class C { + void from() {} + void from(String s) {} + void from(String s, String s1) {} + void from(String... s) {} + void from(String s1, String... s) {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/kt1835.jet b/compiler/testData/diagnostics/tests/varargs/kt1835.jet new file mode 100644 index 00000000000..05c178d3994 --- /dev/null +++ b/compiler/testData/diagnostics/tests/varargs/kt1835.jet @@ -0,0 +1,12 @@ +// FILE: JavaClass.java +public class JavaClass { + void from(String s) {} + void from(String... s) {} +} + +// FILE: kotlin.kt +fun main(args : Array) { + JavaClass().from() + JavaClass().from("") + JavaClass().from("", "") +} \ No newline at end of file diff --git a/compiler/testData/resolve/varargs/MoreSpecificVarargsOfEqualLength.jet b/compiler/testData/resolve/varargs/MoreSpecificVarargsOfEqualLength.jet new file mode 100644 index 00000000000..d255c714f37 --- /dev/null +++ b/compiler/testData/resolve/varargs/MoreSpecificVarargsOfEqualLength.jet @@ -0,0 +1,9 @@ +fun main(d : D) { + d.`str`from("") + d.`any`from(1) +} + +class D { + ~any~fun from(vararg a : Any){} + ~str~fun from(vararg a : String){} +} \ No newline at end of file From a31edfc3bdb10cd04e4d7831ecc826193f5c1da4 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 20 Apr 2012 19:08:29 +0400 Subject: [PATCH 16/16] KT-1835 cannot call a Java API which has a method from(String) and from(String...) The problem was in the "more specific" relation, that didn't pay enough attention to varargs. The correct behavior is in the spirit of JLS 15.12.2 (as of Java 5): * a fixed-arity function always wins over a variable-arity functions * if two vararg functions are compared, their parameters are checked for subtyping. In the latter case, the candidates may have different number of formal parameters, so we compare the matching parts and then check the rest against the vararg parameter. #KT-1835 Fixed --- .../jet/lang/resolve/calls/CallResolver.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java index 990d6298b69..219f06d9156 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java @@ -391,31 +391,35 @@ public class CallResolver { context.tracing.bindReference(context.trace, candidateCall); if (ErrorUtils.isError(candidate)) { - candidateCall.setStatus(SUCCESS); + candidateCall.addStatus(SUCCESS); checkTypesWithNoCallee(context.toBasic()); return; } if (!Visibilities.isVisible(candidate, context.scope.getContainingDeclaration())) { - candidateCall.setStatus(OTHER_ERROR); + candidateCall.addStatus(OTHER_ERROR); context.tracing.invisibleMember(context.trace, candidate); return; } - boolean errorInArgumentMapping = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(context.call, context.tracing, candidateCall); - if (errorInArgumentMapping) { - candidateCall.setStatus(OTHER_ERROR); - checkTypesWithNoCallee(context.toBasic()); - return; + ValueArgumentsToParametersMapper.Status + argumentMappingStatus = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(context.call, context.tracing, + candidateCall); + if (!argumentMappingStatus.isSuccess()) { + candidateCall.addStatus(OTHER_ERROR); + if (argumentMappingStatus == ValueArgumentsToParametersMapper.Status.ERROR) { + checkTypesWithNoCallee(context.toBasic()); + return; + } } List jetTypeArguments = context.call.getTypeArguments(); if (jetTypeArguments.isEmpty()) { if (!candidate.getTypeParameters().isEmpty()) { - candidateCall.setStatus(inferTypeArguments(context)); + candidateCall.addStatus(inferTypeArguments(context)); } else { - candidateCall.setStatus(checkAllValueArguments(context)); + candidateCall.addStatus(checkAllValueArguments(context)); } } else { @@ -451,10 +455,10 @@ public class CallResolver { TypeParameterDescriptor typeParameterDescriptor = typeParameters.get(i); candidateCall.recordTypeArgument(typeParameterDescriptor, typeArguments.get(i)); } - candidateCall.setStatus(checkAllValueArguments(context)); + candidateCall.addStatus(checkAllValueArguments(context)); } else { - candidateCall.setStatus(OTHER_ERROR); + candidateCall.addStatus(OTHER_ERROR); context.tracing.wrongNumberOfTypeArguments(context.trace, expectedTypeArgumentCount); } } @@ -466,7 +470,7 @@ public class CallResolver { JetSuperExpression superExpression = TaskPrioritizer.getReceiverSuper(candidateCall.getReceiverArgument()); if (superExpression != null) { context.trace.report(SUPER_IS_NOT_AN_EXPRESSION.on(superExpression, superExpression.getText())); - candidateCall.setStatus(OTHER_ERROR); + candidateCall.addStatus(OTHER_ERROR); } recordAutoCastIfNecessary(candidateCall.getReceiverArgument(), candidateCall.getTrace());