From cc61f8942f0e44ddf73c3f04de43991e1d507740 Mon Sep 17 00:00:00 2001 From: "Natalia.Ukhorskaya" Date: Thu, 19 Apr 2012 14:46:52 +0400 Subject: [PATCH 1/4] 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 2/4] 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 8074629b7762fd685ab249aea3c1fe9f4895b76e Mon Sep 17 00:00:00 2001 From: "Natalia.Ukhorskaya" Date: Thu, 19 Apr 2012 20:09:47 +0400 Subject: [PATCH 3/4] 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 4/4] 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