diff --git a/.gitignore b/.gitignore index ed5a562ee7..8cc6fd45dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,46 +1,52 @@ -obj/ -libs/ -lib/ -util/libmoai - -Thumbs.db -.DS_Store -/vs2010/ipch -/vs2010/bin -/vs2008/bin - -/ide/bin -/ide/obj - -/src/config - -/build/ -xcuserdata/ -DerivedData/ -*.pbxuser -*.perspectivev3 - -# Artifacts when building with CMake -flascc/build -/src/moai/moai -tmp - -# Produced by test runner -test/xml-results -.idea -cmake/projects/ - -# Build and release products -cmake/build/ -release/ - -bin/api-reference-parser/vendor -docs/api-reference -/moai-sdk/ -/bin/env-local.bat -/util/moai -/**/java/build/ -/**/java/*.iml -env.sh -sample-browser/ -util/build-sample-browser/temprom/ +/bin/ +/build/ +/lib/ + +libs/ +obj/ +util/libmoai + +Thumbs.db +.DS_Store +/vs2010/ipch +/vs2010/bin +/vs2008/bin + +/ide/bin +/ide/obj + +/src/config + +/build/ +xcuserdata/ +DerivedData/ +*.pbxuser +*.perspectivev3 + +# Artifacts when building with CMake +flascc/build +/src/moai/moai +tmp + +# Produced by test runner +test/xml-results +.idea +cmake/projects/ + +# Build and release products +cmake/build/ +release/ + +bin/api-reference-parser/vendor +docs/api-reference +/moai-sdk/ +/bin/env-local.bat +/bin/win32/ +/bin/x64/ +/util/moai +/**/java/build/ +/**/java/*.iml +env.sh +sample-browser/ +util/build-sample-browser/temprom/ +moai-osx-static.xcscmblueprint diff --git a/.gitmodules b/.gitmodules index e29ae683c2..9b48de7663 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "3rdparty/civetweb"] path = 3rdparty/civetweb url = https://github.com/civetweb/civetweb.git +[submodule "3rdparty/kissfft"] + path = 3rdparty/kissfft + url = https://github.com/itdaniher/kissfft.git diff --git a/3rdparty-android/deltadna-v3.3.6/lib/dd_android_sdk.jar b/3rdparty-android/deltadna-v3.3.6/lib/dd_android_sdk.jar new file mode 100755 index 0000000000..bd79869b55 Binary files /dev/null and b/3rdparty-android/deltadna-v3.3.6/lib/dd_android_sdk.jar differ diff --git a/util/build-sample-browser/player/vendor/ace/mode-text.js b/3rdparty-android/deltadna-v3.3.6/manifest_declarations.xml similarity index 100% rename from util/build-sample-browser/player/vendor/ace/mode-text.js rename to 3rdparty-android/deltadna-v3.3.6/manifest_declarations.xml diff --git a/3rdparty-android/deltadna-v3.3.6/manifest_permissions.xml b/3rdparty-android/deltadna-v3.3.6/manifest_permissions.xml new file mode 100644 index 0000000000..f582356d7e --- /dev/null +++ b/3rdparty-android/deltadna-v3.3.6/manifest_permissions.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/3rdparty/LICENSE b/3rdparty/LICENSE index 13ab22b189..99cb2a61aa 100644 --- a/3rdparty/LICENSE +++ b/3rdparty/LICENSE @@ -7,6 +7,7 @@ glew 1.5.6 ISO8601DateFormatter.m, .h jansson 2.1 jpeg-8c +kissfft libogg 1.2.2 libvorbis 1.3.2 libpng 1.4.0 @@ -400,6 +401,37 @@ We are required to state that CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated." +---------------------------------------------------------------- +kissfft +---------------------------------------------------------------- +Copyright (c) 2003-2010 Mark Borgerding + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +* Neither the author nor the names of any contributors may be used to endorse +or promote products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------- libogg 1.2.2 ---------------------------------------------------------------- diff --git a/3rdparty/c-ares-1.7.5/ares_init.c b/3rdparty/c-ares-1.7.5/ares_init.c index 080a9d821f..5ddf7669fc 100644 --- a/3rdparty/c-ares-1.7.5/ares_init.c +++ b/3rdparty/c-ares-1.7.5/ares_init.c @@ -962,11 +962,16 @@ DhcpNameServer status = ARES_EOF; #elif defined(ANDROID) - char value[PROP_VALUE_MAX]=""; - __system_property_get("net.dns1", value); - status = config_nameserver(&servers, &nservers, value); - if (status == ARES_SUCCESS) + #if defined(__arm64__) || defined(__LP64__) + status = ARES_EOF; + #else + char value[PROP_VALUE_MAX]=""; + __system_property_get("net.dns1", value); + status = config_nameserver(&servers, &nservers, value); + if (status == ARES_SUCCESS) + status = ARES_EOF; + #endif #else { char *p; diff --git a/3rdparty/c-ares-1.7.5/include-android/ares_build.h b/3rdparty/c-ares-1.7.5/include-android/ares_build.h index 9c17bb9f0e..fac8d44398 100644 --- a/3rdparty/c-ares-1.7.5/include-android/ares_build.h +++ b/3rdparty/c-ares-1.7.5/include-android/ares_build.h @@ -95,10 +95,10 @@ #ifdef CARES_PULL_SYS_SOCKET_H # include #endif - /* The size of `long', as computed by sizeof. */ -#define CARES_SIZEOF_LONG 4 +#define CARES_SIZEOF_LONG sizeof(long) + /* Integral data type used for ares_socklen_t. */ #define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t diff --git a/3rdparty/civetweb b/3rdparty/civetweb index 3716b3faaa..a21519cccd 160000 --- a/3rdparty/civetweb +++ b/3rdparty/civetweb @@ -1 +1 @@ -Subproject commit 3716b3faaa96aa53a3658073d31f9cd795eb6060 +Subproject commit a21519cccde58d467982c9c18d291f4b34adbfd0 diff --git a/3rdparty/contrib/edtaa3func.c b/3rdparty/contrib/edtaa3func.c deleted file mode 100755 index f906f602a3..0000000000 --- a/3rdparty/contrib/edtaa3func.c +++ /dev/null @@ -1,577 +0,0 @@ -/* - * Copyright 2009 Stefan Gustavson (stefan.gustavson@gmail.com) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY STEFAN GUSTAVSON ''AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL STEFAN GUSTAVSON OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are - * those of the authors and should not be interpreted as representing official - * policies, either expressed or implied, of Stefan Gustavson. - * - * - * edtaa3() - * - * Sweep-and-update Euclidean distance transform of an - * image. Positive pixels are treated as object pixels, - * zero or negative pixels are treated as background. - * An attempt is made to treat antialiased edges correctly. - * The input image must have pixels in the range [0,1], - * and the antialiased image should be a box-filter - * sampling of the ideal, crisp edge. - * If the antialias region is more than 1 pixel wide, - * the result from this transform will be inaccurate. - * - * By Stefan Gustavson (stefan.gustavson@gmail.com). - * - * Originally written in 1994, based on a verbal - * description of the SSED8 algorithm published in the - * PhD dissertation of Ingemar Ragnemalm. This is his - * algorithm, I only implemented it in C. - * - * Updated in 2004 to treat border pixels correctly, - * and cleaned up the code to improve readability. - * - * Updated in 2009 to handle anti-aliased edges. - * - * Updated in 2011 to avoid a corner case infinite loop. - * - */ -#include -#include "edtaa3func.h" - -/* - * Compute the local gradient at edge pixels using convolution filters. - * The gradient is computed only at edge pixels. At other places in the - * image, it is never used, and it's mostly zero anyway. - */ -void computegradient(double *img, int w, int h, double *gx, double *gy) -{ - int i,j,k; - double glength; -#define SQRT2 1.4142136 - for(i = 1; i < h-1; i++) { // Avoid edges where the kernels would spill over - for(j = 1; j < w-1; j++) { - k = i*w + j; - if((img[k]>0.0) && (img[k]<1.0)) { // Compute gradient for edge pixels only - gx[k] = -img[k-w-1] - SQRT2*img[k-1] - img[k+w-1] + img[k-w+1] + SQRT2*img[k+1] + img[k+w+1]; - gy[k] = -img[k-w-1] - SQRT2*img[k-w] - img[k+w-1] + img[k-w+1] + SQRT2*img[k+w] + img[k+w+1]; - glength = gx[k]*gx[k] + gy[k]*gy[k]; - if(glength > 0.0) { // Avoid division by zero - glength = sqrt(glength); - gx[k]=gx[k]/glength; - gy[k]=gy[k]/glength; - } - } - } - } - // TODO: Compute reasonable values for gx, gy also around the image edges. - // (These are zero now, which reduces the accuracy for a 1-pixel wide region - // around the image edge.) 2x2 kernels would be suitable for this. -} - -/* - * A somewhat tricky function to approximate the distance to an edge in a - * certain pixel, with consideration to either the local gradient (gx,gy) - * or the direction to the pixel (dx,dy) and the pixel greyscale value a. - * The latter alternative, using (dx,dy), is the metric used by edtaa2(). - * Using a local estimate of the edge gradient (gx,gy) yields much better - * accuracy at and near edges, and reduces the error even at distant pixels - * provided that the gradient direction is accurately estimated. - */ -double edgedf(double gx, double gy, double a) -{ - double df, glength, temp, a1; - - if ((gx == 0) || (gy == 0)) { // Either A) gu or gv are zero, or B) both - df = 0.5-a; // Linear approximation is A) correct or B) a fair guess - } else { - glength = sqrt(gx*gx + gy*gy); - if(glength>0) { - gx = gx/glength; - gy = gy/glength; - } - /* Everything is symmetric wrt sign and transposition, - * so move to first octant (gx>=0, gy>=0, gx>=gy) to - * avoid handling all possible edge directions. - */ - gx = fabs(gx); - gy = fabs(gy); - if(gx 1.0) a = 1.0; - if(a < 0.0) a = 0.0; // Clip grayscale values outside the range [0,1] - if(a == 0.0) return 1000000.0; // Not an object pixel, return "very far" ("don't know yet") - - dx = (double)xi; - dy = (double)yi; - di = sqrt(dx*dx + dy*dy); // Length of integer vector, like a traditional EDT - if(di==0) { // Use local gradient only at edges - // Estimate based on local gradient only - df = edgedf(gx, gy, a); - } else { - // Estimate gradient based on direction to edge (accurate for large di) - df = edgedf(dx, dy, a); - } - return di + df; // Same metric as edtaa2, except at edges (where di=0) -} - -// Shorthand macro: add ubiquitous parameters dist, gx, gy, img and w and call distaa3() -#define DISTAA(c,xc,yc,xi,yi) (distaa3(img, gx, gy, w, c, xc, yc, xi, yi)) - -void edtaa3(double *img, double *gx, double *gy, int w, int h, short *distx, short *disty, double *dist) -{ - int x, y, i, c; - int offset_u, offset_ur, offset_r, offset_rd, - offset_d, offset_dl, offset_l, offset_lu; - double olddist, newdist; - int cdistx, cdisty, newdistx, newdisty; - int changed; - double epsilon = 1e-3; - - /* Initialize index offsets for the current image width */ - offset_u = -w; - offset_ur = -w+1; - offset_r = 1; - offset_rd = w+1; - offset_d = w; - offset_dl = w-1; - offset_l = -1; - offset_lu = -w-1; - - /* Initialize the distance images */ - for(i=0; i 0) // If non-zero distance or not set yet - { - c = i + offset_u; // Index of candidate for testing - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx; - newdisty = cdisty+1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - olddist=newdist; - changed = 1; - } - - c = i+offset_ur; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx-1; - newdisty = cdisty+1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - changed = 1; - } - } - i++; - - /* Middle pixels have all neighbors */ - for(x=1; x 0) // If not already zero distance - { - c = i+offset_l; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx+1; - newdisty = cdisty; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - olddist=newdist; - changed = 1; - } - - c = i+offset_lu; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx+1; - newdisty = cdisty+1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - olddist=newdist; - changed = 1; - } - - c = i+offset_u; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx; - newdisty = cdisty+1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - changed = 1; - } - } - - /* Move index to second rightmost pixel of current row. */ - /* Rightmost pixel is skipped, it has no right neighbor. */ - i = y*w + w-2; - - /* scan left, propagate distance from right */ - for(x=w-2; x>=0; x--, i--) - { - olddist = dist[i]; - if(olddist <= 0) continue; // Already zero distance - - c = i+offset_r; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx-1; - newdisty = cdisty; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - changed = 1; - } - } - } - - /* Scan rows in reverse order, except last row */ - for(y=h-2; y>=0; y--) - { - /* move index to rightmost pixel of current row */ - i = y*w + w-1; - - /* Scan left, propagate distances from below & right */ - - /* Rightmost pixel is special, has no right neighbors */ - olddist = dist[i]; - if(olddist > 0) // If not already zero distance - { - c = i+offset_d; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx; - newdisty = cdisty-1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - olddist=newdist; - changed = 1; - } - - c = i+offset_dl; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx+1; - newdisty = cdisty-1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - changed = 1; - } - } - i--; - - /* Middle pixels have all neighbors */ - for(x=w-2; x>0; x--, i--) - { - olddist = dist[i]; - if(olddist <= 0) continue; // Already zero distance - - c = i+offset_r; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx-1; - newdisty = cdisty; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - olddist=newdist; - changed = 1; - } - - c = i+offset_rd; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx-1; - newdisty = cdisty-1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - olddist=newdist; - changed = 1; - } - - c = i+offset_d; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx; - newdisty = cdisty-1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - olddist=newdist; - changed = 1; - } - - c = i+offset_dl; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx+1; - newdisty = cdisty-1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - changed = 1; - } - } - /* Leftmost pixel is special, has no left neighbors */ - olddist = dist[i]; - if(olddist > 0) // If not already zero distance - { - c = i+offset_r; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx-1; - newdisty = cdisty; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - olddist=newdist; - changed = 1; - } - - c = i+offset_rd; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx-1; - newdisty = cdisty-1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - olddist=newdist; - changed = 1; - } - - c = i+offset_d; - cdistx = distx[c]; - cdisty = disty[c]; - newdistx = cdistx; - newdisty = cdisty-1; - newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); - if(newdist < olddist-epsilon) - { - distx[i]=newdistx; - disty[i]=newdisty; - dist[i]=newdist; - changed = 1; - } - } - - /* Move index to second leftmost pixel of current row. */ - /* Leftmost pixel is skipped, it has no left neighbor. */ - i = y*w + 1; - for(x=1; x +#include "moai_edtaa3func.h" + +/* + * Compute the local gradient at edge pixels using convolution filters. + * The gradient is computed only at edge pixels. At other places in the + * image, it is never used, and it's mostly zero anyway. + */ +void moai_computegradient(double *img, int w, int h, double *gx, double *gy) +{ + int i,j,k; + double glength; +#define SQRT2 1.4142136 + for(i = 1; i < h-1; i++) { // Avoid edges where the kernels would spill over + for(j = 1; j < w-1; j++) { + k = i*w + j; + if((img[k]>0.0) && (img[k]<1.0)) { // Compute gradient for edge pixels only + gx[k] = -img[k-w-1] - SQRT2*img[k-1] - img[k+w-1] + img[k-w+1] + SQRT2*img[k+1] + img[k+w+1]; + gy[k] = -img[k-w-1] - SQRT2*img[k-w] - img[k+w-1] + img[k-w+1] + SQRT2*img[k+w] + img[k+w+1]; + glength = gx[k]*gx[k] + gy[k]*gy[k]; + if(glength > 0.0) { // Avoid division by zero + glength = sqrt(glength); + gx[k]=gx[k]/glength; + gy[k]=gy[k]/glength; + } + } + } + } + // TODO: Compute reasonable values for gx, gy also around the image edges. + // (These are zero now, which reduces the accuracy for a 1-pixel wide region + // around the image edge.) 2x2 kernels would be suitable for this. +} + +/* + * A somewhat tricky function to approximate the distance to an edge in a + * certain pixel, with consideration to either the local gradient (gx,gy) + * or the direction to the pixel (dx,dy) and the pixel greyscale value a. + * The latter alternative, using (dx,dy), is the metric used by edtaa2(). + * Using a local estimate of the edge gradient (gx,gy) yields much better + * accuracy at and near edges, and reduces the error even at distant pixels + * provided that the gradient direction is accurately estimated. + */ +double edgedf(double gx, double gy, double a) +{ + double df, glength, temp, a1; + + if ((gx == 0) || (gy == 0)) { // Either A) gu or gv are zero, or B) both + df = 0.5-a; // Linear approximation is A) correct or B) a fair guess + } else { + glength = sqrt(gx*gx + gy*gy); + if(glength>0) { + gx = gx/glength; + gy = gy/glength; + } + /* Everything is symmetric wrt sign and transposition, + * so move to first octant (gx>=0, gy>=0, gx>=gy) to + * avoid handling all possible edge directions. + */ + gx = fabs(gx); + gy = fabs(gy); + if(gx 1.0) a = 1.0; + if(a < 0.0) a = 0.0; // Clip grayscale values outside the range [0,1] + if(a == 0.0) return 1000000.0; // Not an object pixel, return "very far" ("don't know yet") + + dx = (double)xi; + dy = (double)yi; + di = sqrt(dx*dx + dy*dy); // Length of integer vector, like a traditional EDT + if(di==0) { // Use local gradient only at edges + // Estimate based on local gradient only + df = edgedf(gx, gy, a); + } else { + // Estimate gradient based on direction to edge (accurate for large di) + df = edgedf(dx, dy, a); + } + return di + df; // Same metric as edtaa2, except at edges (where di=0) +} + +// Shorthand macro: add ubiquitous parameters dist, gx, gy, img and w and call distaa3() +//#define DISTAA(c,xc,yc,xi,yi) (moai_distaa3(img, gx, gy, w, c, xc, yc, xi, yi)) + +void moai_edtaa3(double *img, double *gx, double *gy, int w, int h, short *distx, short *disty, double *dist) +{ + int x, y, i, c; + int offset_u, offset_ur, offset_r, offset_rd, + offset_d, offset_dl, offset_l, offset_lu; + double olddist, newdist; + int cdistx, cdisty, newdistx, newdisty; + int changed; + double epsilon = 1e-3; + + /* Initialize index offsets for the current image width */ + offset_u = -w; + offset_ur = -w+1; + offset_r = 1; + offset_rd = w+1; + offset_d = w; + offset_dl = w-1; + offset_l = -1; + offset_lu = -w-1; + + /* Initialize the distance images */ + for(i=0; i 0) // If non-zero distance or not set yet + { + c = i + offset_u; // Index of candidate for testing + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx; + newdisty = cdisty+1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + olddist=newdist; + changed = 1; + } + + c = i+offset_ur; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx-1; + newdisty = cdisty+1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + changed = 1; + } + } + i++; + + /* Middle pixels have all neighbors */ + for(x=1; x 0) // If not already zero distance + { + c = i+offset_l; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx+1; + newdisty = cdisty; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + olddist=newdist; + changed = 1; + } + + c = i+offset_lu; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx+1; + newdisty = cdisty+1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + olddist=newdist; + changed = 1; + } + + c = i+offset_u; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx; + newdisty = cdisty+1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + changed = 1; + } + } + + /* Move index to second rightmost pixel of current row. */ + /* Rightmost pixel is skipped, it has no right neighbor. */ + i = y*w + w-2; + + /* scan left, propagate distance from right */ + for(x=w-2; x>=0; x--, i--) + { + olddist = dist[i]; + if(olddist <= 0) continue; // Already zero distance + + c = i+offset_r; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx-1; + newdisty = cdisty; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + changed = 1; + } + } + } + + /* Scan rows in reverse order, except last row */ + for(y=h-2; y>=0; y--) + { + /* move index to rightmost pixel of current row */ + i = y*w + w-1; + + /* Scan left, propagate distances from below & right */ + + /* Rightmost pixel is special, has no right neighbors */ + olddist = dist[i]; + if(olddist > 0) // If not already zero distance + { + c = i+offset_d; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx; + newdisty = cdisty-1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + olddist=newdist; + changed = 1; + } + + c = i+offset_dl; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx+1; + newdisty = cdisty-1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + changed = 1; + } + } + i--; + + /* Middle pixels have all neighbors */ + for(x=w-2; x>0; x--, i--) + { + olddist = dist[i]; + if(olddist <= 0) continue; // Already zero distance + + c = i+offset_r; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx-1; + newdisty = cdisty; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + olddist=newdist; + changed = 1; + } + + c = i+offset_rd; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx-1; + newdisty = cdisty-1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + olddist=newdist; + changed = 1; + } + + c = i+offset_d; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx; + newdisty = cdisty-1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + olddist=newdist; + changed = 1; + } + + c = i+offset_dl; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx+1; + newdisty = cdisty-1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + changed = 1; + } + } + /* Leftmost pixel is special, has no left neighbors */ + olddist = dist[i]; + if(olddist > 0) // If not already zero distance + { + c = i+offset_r; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx-1; + newdisty = cdisty; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + olddist=newdist; + changed = 1; + } + + c = i+offset_rd; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx-1; + newdisty = cdisty-1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + olddist=newdist; + changed = 1; + } + + c = i+offset_d; + cdistx = distx[c]; + cdisty = disty[c]; + newdistx = cdistx; + newdisty = cdisty-1; + newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty); + if(newdist < olddist-epsilon) + { + distx[i]=newdistx; + disty[i]=newdisty; + dist[i]=newdist; + changed = 1; + } + } + + /* Move index to second leftmost pixel of current row. */ + /* Leftmost pixel is skipped, it has no left neighbor. */ + i = y*w + 1; + for(x=1; x #endif +#if defined(__arm64__) || defined(__LP64__) + +/* The size of `long', as computed by sizeof. */ +#define CURL_SIZEOF_LONG 8 + +/* Integral data type used for curl_socklen_t. */ +#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t + +/* The size of `curl_socklen_t', as computed by sizeof. */ +#define CURL_SIZEOF_CURL_SOCKLEN_T 4 + +/* Data type definition of curl_socklen_t. */ +typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; + +/* Signed integral data type used for curl_off_t. */ +#define CURL_TYPEOF_CURL_OFF_T long + +/* Data type definition of curl_off_t. */ +typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; + +/* curl_off_t formatting string directive without "%" conversion specifier. */ +#define CURL_FORMAT_CURL_OFF_T "ld" + +/* unsigned curl_off_t formatting string without "%" conversion specifier. */ +#define CURL_FORMAT_CURL_OFF_TU "lu" + +/* curl_off_t formatting string directive with "%" conversion specifier. */ +#define CURL_FORMAT_OFF_T "%ld" + +/* The size of `curl_off_t', as computed by sizeof. */ +#define CURL_SIZEOF_CURL_OFF_T 8 + +/* curl_off_t constant suffix. */ +#define CURL_SUFFIX_CURL_OFF_T L + +/* unsigned curl_off_t constant suffix. */ +#define CURL_SUFFIX_CURL_OFF_TU UL + +#else + /* The size of `long', as computed by sizeof. */ #define CURL_SIZEOF_LONG 4 @@ -188,5 +228,6 @@ typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; /* unsigned curl_off_t constant suffix. */ #define CURL_SUFFIX_CURL_OFF_TU ULL +#endif /* __arm64__ */ #endif /* __CURL_CURLBUILD_H */ diff --git a/3rdparty/harfbuzz-1.0.6/COPYING b/3rdparty/harfbuzz-1.0.6/COPYING new file mode 100644 index 0000000000..9d1056f40b --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/COPYING @@ -0,0 +1,36 @@ +HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +For parts of HarfBuzz that are licensed under different licenses see individual +files names COPYING in subdirectories where applicable. + +Copyright © 2010,2011,2012 Google, Inc. +Copyright © 2012 Mozilla Foundation +Copyright © 2011 Codethink Limited +Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) +Copyright © 2009 Keith Stribley +Copyright © 2009 Martin Hosken and SIL International +Copyright © 2007 Chris Wilson +Copyright © 2006 Behdad Esfahbod +Copyright © 2005 David Turner +Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. +Copyright © 1998-2004 David Turner and Werner Lemberg + +For full copyright notices consult the individual files in the package. + + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. diff --git a/3rdparty/harfbuzz-1.0.6/hb-atomic-private.hh b/3rdparty/harfbuzz-1.0.6/hb-atomic-private.hh new file mode 100644 index 0000000000..8179571ad2 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-atomic-private.hh @@ -0,0 +1,164 @@ +/* + * Copyright © 2007 Chris Wilson + * Copyright © 2009,2010 Red Hat, Inc. + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Contributor(s): + * Chris Wilson + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_ATOMIC_PRIVATE_HH +#define HB_ATOMIC_PRIVATE_HH + +#include "hb-private.hh" + + +/* atomic_int */ + +/* We need external help for these */ + +#if defined(hb_atomic_int_impl_add) \ + && defined(hb_atomic_ptr_impl_get) \ + && defined(hb_atomic_ptr_impl_cmpexch) + +/* Defined externally, i.e. in config.h; must have typedef'ed hb_atomic_int_impl_t as well. */ + + +#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__)) + +#include + +/* MinGW has a convoluted history of supporting MemoryBarrier + * properly. As such, define a function to wrap the whole + * thing. */ +static inline void _HBMemoryBarrier (void) { +#if !defined(MemoryBarrier) + long dummy = 0; + InterlockedExchange (&dummy, 1); +#else + MemoryBarrier (); +#endif +} + +typedef LONG hb_atomic_int_impl_t; +#define HB_ATOMIC_INT_IMPL_INIT(V) (V) +#define hb_atomic_int_impl_add(AI, V) InterlockedExchangeAdd (&(AI), (V)) + +#define hb_atomic_ptr_impl_get(P) (_HBMemoryBarrier (), (void *) *(P)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((void **) (P), (void *) (N), (void *) (O)) == (void *) (O)) + + +#elif !defined(HB_NO_MT) && defined(__APPLE__) + +#include +#ifdef __MAC_OS_X_MIN_REQUIRED +#include +#elif defined(__IPHONE_OS_MIN_REQUIRED) +#include +#endif + + +typedef int32_t hb_atomic_int_impl_t; +#define HB_ATOMIC_INT_IMPL_INIT(V) (V) +#define hb_atomic_int_impl_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V)) + +#define hb_atomic_ptr_impl_get(P) (OSMemoryBarrier (), (void *) *(P)) +#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_VERSION_MIN_REQUIRED >= 20100) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P)) +#else +#if __ppc64__ || __x86_64__ || __aarch64__ +#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P)) +#else +#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap32Barrier ((int32_t) (O), (int32_t) (N), (int32_t*) (P)) +#endif +#endif + + +#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES) + +typedef int hb_atomic_int_impl_t; +#define HB_ATOMIC_INT_IMPL_INIT(V) (V) +#define hb_atomic_int_impl_add(AI, V) __sync_fetch_and_add (&(AI), (V)) + +#define hb_atomic_ptr_impl_get(P) (void *) (__sync_synchronize (), *(P)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) __sync_bool_compare_and_swap ((P), (O), (N)) + + +#elif !defined(HB_NO_MT) && defined(HAVE_SOLARIS_ATOMIC_OPS) + +#include +#include + +typedef unsigned int hb_atomic_int_impl_t; +#define HB_ATOMIC_INT_IMPL_INIT(V) (V) +#define hb_atomic_int_impl_add(AI, V) ( ({__machine_rw_barrier ();}), atomic_add_int_nv (&(AI), (V)) - (V)) + +#define hb_atomic_ptr_impl_get(P) ( ({__machine_rw_barrier ();}), (void *) *(P)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) ( ({__machine_rw_barrier ();}), atomic_cas_ptr ((void **) (P), (void *) (O), (void *) (N)) == (void *) (O) ? true : false) + + +#elif !defined(HB_NO_MT) + +#define HB_ATOMIC_INT_NIL 1 /* Warn that fallback implementation is in use. */ + +typedef volatile int hb_atomic_int_impl_t; +#define HB_ATOMIC_INT_IMPL_INIT(V) (V) +#define hb_atomic_int_impl_add(AI, V) (((AI) += (V)) - (V)) + +#define hb_atomic_ptr_impl_get(P) ((void *) *(P)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) (* (void * volatile *) (P) == (void *) (O) ? (* (void * volatile *) (P) = (void *) (N), true) : false) + + +#else /* HB_NO_MT */ + +typedef int hb_atomic_int_impl_t; +#define HB_ATOMIC_INT_IMPL_INIT(V) (V) +#define hb_atomic_int_impl_add(AI, V) (((AI) += (V)) - (V)) + +#define hb_atomic_ptr_impl_get(P) ((void *) *(P)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) (* (void **) (P) == (void *) (O) ? (* (void **) (P) = (void *) (N), true) : false) + + +#endif + + +#define HB_ATOMIC_INT_INIT(V) {HB_ATOMIC_INT_IMPL_INIT(V)} + +struct hb_atomic_int_t +{ + hb_atomic_int_impl_t v; + + inline void set_unsafe (int v_) { v = v_; } + inline int get_unsafe (void) const { return v; } + inline int inc (void) { return hb_atomic_int_impl_add (const_cast (v), 1); } + inline int dec (void) { return hb_atomic_int_impl_add (const_cast (v), -1); } +}; + + +#define hb_atomic_ptr_get(P) hb_atomic_ptr_impl_get(P) +#define hb_atomic_ptr_cmpexch(P,O,N) hb_atomic_ptr_impl_cmpexch((P),(O),(N)) + + +#endif /* HB_ATOMIC_PRIVATE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-blob.cc b/3rdparty/harfbuzz-1.0.6/hb-blob.cc new file mode 100644 index 0000000000..a6870dc06e --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-blob.cc @@ -0,0 +1,479 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + */ + +/* http://www.oracle.com/technetwork/articles/servers-storage-dev/standardheaderfiles-453865.html */ +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199309L +#endif + +#include "hb-private.hh" + +#include "hb-object-private.hh" + +#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_UNISTD_H +#include +#endif /* HAVE_UNISTD_H */ +#include +#endif /* HAVE_SYS_MMAN_H */ + +#include +#include + + + +#ifndef HB_DEBUG_BLOB +#define HB_DEBUG_BLOB (HB_DEBUG+0) +#endif + + +struct hb_blob_t { + hb_object_header_t header; + ASSERT_POD (); + + bool immutable; + + const char *data; + unsigned int length; + hb_memory_mode_t mode; + + void *user_data; + hb_destroy_func_t destroy; +}; + + +static bool _try_writable (hb_blob_t *blob); + +static void +_hb_blob_destroy_user_data (hb_blob_t *blob) +{ + if (blob->destroy) { + blob->destroy (blob->user_data); + blob->user_data = NULL; + blob->destroy = NULL; + } +} + +/** + * hb_blob_create: (skip) + * @data: Pointer to blob data. + * @length: Length of @data in bytes. + * @mode: Memory mode for @data. + * @user_data: Data parameter to pass to @destroy. + * @destroy: Callback to call when @data is not needed anymore. + * + * Creates a new "blob" object wrapping @data. The @mode parameter is used + * to negotiate ownership and lifecycle of @data. + * + * Return value: New blob, or the empty blob if something failed or if @length is + * zero. Destroy with hb_blob_destroy(). + * + * Since: 0.9.2 + **/ +hb_blob_t * +hb_blob_create (const char *data, + unsigned int length, + hb_memory_mode_t mode, + void *user_data, + hb_destroy_func_t destroy) +{ + hb_blob_t *blob; + + if (!length || + length >= 1u << 31 || + data + length < data /* overflows */ || + !(blob = hb_object_create ())) { + if (destroy) + destroy (user_data); + return hb_blob_get_empty (); + } + + blob->data = data; + blob->length = length; + blob->mode = mode; + + blob->user_data = user_data; + blob->destroy = destroy; + + if (blob->mode == HB_MEMORY_MODE_DUPLICATE) { + blob->mode = HB_MEMORY_MODE_READONLY; + if (!_try_writable (blob)) { + hb_blob_destroy (blob); + return hb_blob_get_empty (); + } + } + + return blob; +} + +/** + * hb_blob_create_sub_blob: + * @parent: Parent blob. + * @offset: Start offset of sub-blob within @parent, in bytes. + * @length: Length of sub-blob. + * + * Returns a blob that represents a range of bytes in @parent. The new + * blob is always created with %HB_MEMORY_MODE_READONLY, meaning that it + * will never modify data in the parent blob. The parent data is not + * expected to be modified, and will result in undefined behavior if it + * is. + * + * Makes @parent immutable. + * + * Return value: New blob, or the empty blob if something failed or if + * @length is zero or @offset is beyond the end of @parent's data. Destroy + * with hb_blob_destroy(). + * + * Since: 0.9.2 + **/ +hb_blob_t * +hb_blob_create_sub_blob (hb_blob_t *parent, + unsigned int offset, + unsigned int length) +{ + hb_blob_t *blob; + + if (!length || offset >= parent->length) + return hb_blob_get_empty (); + + hb_blob_make_immutable (parent); + + blob = hb_blob_create (parent->data + offset, + MIN (length, parent->length - offset), + HB_MEMORY_MODE_READONLY, + hb_blob_reference (parent), + (hb_destroy_func_t) hb_blob_destroy); + + return blob; +} + +/** + * hb_blob_get_empty: + * + * Returns the singleton empty blob. + * + * See TODO:link object types for more information. + * + * Return value: (transfer full): the empty blob. + * + * Since: 0.9.2 + **/ +hb_blob_t * +hb_blob_get_empty (void) +{ + static const hb_blob_t _hb_blob_nil = { + HB_OBJECT_HEADER_STATIC, + + true, /* immutable */ + + NULL, /* data */ + 0, /* length */ + HB_MEMORY_MODE_READONLY, /* mode */ + + NULL, /* user_data */ + NULL /* destroy */ + }; + + return const_cast (&_hb_blob_nil); +} + +/** + * hb_blob_reference: (skip) + * @blob: a blob. + * + * Increases the reference count on @blob. + * + * See TODO:link object types for more information. + * + * Return value: @blob. + * + * Since: 0.9.2 + **/ +hb_blob_t * +hb_blob_reference (hb_blob_t *blob) +{ + return hb_object_reference (blob); +} + +/** + * hb_blob_destroy: (skip) + * @blob: a blob. + * + * Descreases the reference count on @blob, and if it reaches zero, destroys + * @blob, freeing all memory, possibly calling the destroy-callback the blob + * was created for if it has not been called already. + * + * See TODO:link object types for more information. + * + * Since: 0.9.2 + **/ +void +hb_blob_destroy (hb_blob_t *blob) +{ + if (!hb_object_destroy (blob)) return; + + _hb_blob_destroy_user_data (blob); + + free (blob); +} + +/** + * hb_blob_set_user_data: (skip) + * @blob: a blob. + * @key: key for data to set. + * @data: data to set. + * @destroy: callback to call when @data is not needed anymore. + * @replace: whether to replace an existing data with the same key. + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_blob_set_user_data (hb_blob_t *blob, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (blob, key, data, destroy, replace); +} + +/** + * hb_blob_get_user_data: (skip) + * @blob: a blob. + * @key: key for data to get. + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +void * +hb_blob_get_user_data (hb_blob_t *blob, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (blob, key); +} + + +/** + * hb_blob_make_immutable: + * @blob: a blob. + * + * + * + * Since: 0.9.2 + **/ +void +hb_blob_make_immutable (hb_blob_t *blob) +{ + if (hb_object_is_inert (blob)) + return; + + blob->immutable = true; +} + +/** + * hb_blob_is_immutable: + * @blob: a blob. + * + * + * + * Return value: TODO + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_blob_is_immutable (hb_blob_t *blob) +{ + return blob->immutable; +} + + +/** + * hb_blob_get_length: + * @blob: a blob. + * + * + * + * Return value: the length of blob data in bytes. + * + * Since: 0.9.2 + **/ +unsigned int +hb_blob_get_length (hb_blob_t *blob) +{ + return blob->length; +} + +/** + * hb_blob_get_data: + * @blob: a blob. + * @length: (out): + * + * + * + * Returns: (transfer none) (array length=length): + * + * Since: 0.9.2 + **/ +const char * +hb_blob_get_data (hb_blob_t *blob, unsigned int *length) +{ + if (length) + *length = blob->length; + + return blob->data; +} + +/** + * hb_blob_get_data_writable: + * @blob: a blob. + * @length: (out): output length of the writable data. + * + * Tries to make blob data writable (possibly copying it) and + * return pointer to data. + * + * Fails if blob has been made immutable, or if memory allocation + * fails. + * + * Returns: (transfer none) (array length=length): Writable blob data, + * or %NULL if failed. + * + * Since: 0.9.2 + **/ +char * +hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length) +{ + if (!_try_writable (blob)) { + if (length) + *length = 0; + + return NULL; + } + + if (length) + *length = blob->length; + + return const_cast (blob->data); +} + + +static hb_bool_t +_try_make_writable_inplace_unix (hb_blob_t *blob) +{ +#if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MPROTECT) + uintptr_t pagesize = -1, mask, length; + const char *addr; + +#if defined(HAVE_SYSCONF) && defined(_SC_PAGE_SIZE) + pagesize = (uintptr_t) sysconf (_SC_PAGE_SIZE); +#elif defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) + pagesize = (uintptr_t) sysconf (_SC_PAGESIZE); +#elif defined(HAVE_GETPAGESIZE) + pagesize = (uintptr_t) getpagesize (); +#endif + + if ((uintptr_t) -1L == pagesize) { + DEBUG_MSG_FUNC (BLOB, blob, "failed to get pagesize: %s", strerror (errno)); + return false; + } + DEBUG_MSG_FUNC (BLOB, blob, "pagesize is %lu", (unsigned long) pagesize); + + mask = ~(pagesize-1); + addr = (const char *) (((uintptr_t) blob->data) & mask); + length = (const char *) (((uintptr_t) blob->data + blob->length + pagesize-1) & mask) - addr; + DEBUG_MSG_FUNC (BLOB, blob, + "calling mprotect on [%p..%p] (%lu bytes)", + addr, addr+length, (unsigned long) length); + if (-1 == mprotect ((void *) addr, length, PROT_READ | PROT_WRITE)) { + DEBUG_MSG_FUNC (BLOB, blob, "mprotect failed: %s", strerror (errno)); + return false; + } + + blob->mode = HB_MEMORY_MODE_WRITABLE; + + DEBUG_MSG_FUNC (BLOB, blob, + "successfully made [%p..%p] (%lu bytes) writable\n", + addr, addr+length, (unsigned long) length); + return true; +#else + return false; +#endif +} + +static bool +_try_writable_inplace (hb_blob_t *blob) +{ + DEBUG_MSG_FUNC (BLOB, blob, "making writable inplace\n"); + + if (_try_make_writable_inplace_unix (blob)) + return true; + + DEBUG_MSG_FUNC (BLOB, blob, "making writable -> FAILED\n"); + + /* Failed to make writable inplace, mark that */ + blob->mode = HB_MEMORY_MODE_READONLY; + return false; +} + +static bool +_try_writable (hb_blob_t *blob) +{ + if (blob->immutable) + return false; + + if (blob->mode == HB_MEMORY_MODE_WRITABLE) + return true; + + if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE && _try_writable_inplace (blob)) + return true; + + if (blob->mode == HB_MEMORY_MODE_WRITABLE) + return true; + + + DEBUG_MSG_FUNC (BLOB, blob, "current data is -> %p\n", blob->data); + + char *new_data; + + new_data = (char *) malloc (blob->length); + if (unlikely (!new_data)) + return false; + + DEBUG_MSG_FUNC (BLOB, blob, "dupped successfully -> %p\n", blob->data); + + memcpy (new_data, blob->data, blob->length); + _hb_blob_destroy_user_data (blob); + blob->mode = HB_MEMORY_MODE_WRITABLE; + blob->data = new_data; + blob->user_data = new_data; + blob->destroy = free; + + return true; +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-blob.h b/3rdparty/harfbuzz-1.0.6/hb-blob.h new file mode 100644 index 0000000000..b2419abfd2 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-blob.h @@ -0,0 +1,126 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + */ + +#ifndef HB_H_IN +#error "Include instead." +#endif + +#ifndef HB_BLOB_H +#define HB_BLOB_H + +#include "hb-common.h" + +HB_BEGIN_DECLS + + +/* + * Note re various memory-modes: + * + * - In no case shall the HarfBuzz client modify memory + * that is passed to HarfBuzz in a blob. If there is + * any such possibility, MODE_DUPLICATE should be used + * such that HarfBuzz makes a copy immediately, + * + * - Use MODE_READONLY otherse, unless you really really + * really know what you are doing, + * + * - MODE_WRITABLE is appropriate if you really made a + * copy of data solely for the purpose of passing to + * HarfBuzz and doing that just once (no reuse!), + * + * - If the font is mmap()ed, it's ok to use + * READONLY_MAY_MAKE_WRITABLE, however, using that mode + * correctly is very tricky. Use MODE_READONLY instead. + */ +typedef enum { + HB_MEMORY_MODE_DUPLICATE, + HB_MEMORY_MODE_READONLY, + HB_MEMORY_MODE_WRITABLE, + HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE +} hb_memory_mode_t; + +typedef struct hb_blob_t hb_blob_t; + +hb_blob_t * +hb_blob_create (const char *data, + unsigned int length, + hb_memory_mode_t mode, + void *user_data, + hb_destroy_func_t destroy); + +/* Always creates with MEMORY_MODE_READONLY. + * Even if the parent blob is writable, we don't + * want the user of the sub-blob to be able to + * modify the parent data as that data may be + * shared among multiple sub-blobs. + */ +hb_blob_t * +hb_blob_create_sub_blob (hb_blob_t *parent, + unsigned int offset, + unsigned int length); + +hb_blob_t * +hb_blob_get_empty (void); + +hb_blob_t * +hb_blob_reference (hb_blob_t *blob); + +void +hb_blob_destroy (hb_blob_t *blob); + +hb_bool_t +hb_blob_set_user_data (hb_blob_t *blob, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace); + + +void * +hb_blob_get_user_data (hb_blob_t *blob, + hb_user_data_key_t *key); + + +void +hb_blob_make_immutable (hb_blob_t *blob); + +hb_bool_t +hb_blob_is_immutable (hb_blob_t *blob); + + +unsigned int +hb_blob_get_length (hb_blob_t *blob); + +const char * +hb_blob_get_data (hb_blob_t *blob, unsigned int *length); + +char * +hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length); + + +HB_END_DECLS + +#endif /* HB_BLOB_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-buffer-deserialize-json.hh b/3rdparty/harfbuzz-1.0.6/hb-buffer-deserialize-json.hh new file mode 100644 index 0000000000..3f626bda40 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-buffer-deserialize-json.hh @@ -0,0 +1,643 @@ + +#line 1 "hb-buffer-deserialize-json.rl" +/* + * Copyright © 2013 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_BUFFER_DESERIALIZE_JSON_HH +#define HB_BUFFER_DESERIALIZE_JSON_HH + +#include "hb-private.hh" + + +#line 36 "hb-buffer-deserialize-json.hh" +static const unsigned char _deserialize_json_trans_keys[] = { + 0u, 0u, 9u, 123u, 9u, 34u, 97u, 103u, 120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u, + 48u, 57u, 9u, 125u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, + 9u, 125u, 9u, 125u, 108u, 108u, 34u, 34u, 9u, 58u, 9u, 57u, 9u, 125u, 9u, 125u, + 120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u, + 9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u, + 65u, 122u, 34u, 122u, 9u, 125u, 9u, 125u, 9u, 93u, 9u, 123u, 0u, 0u, 0 +}; + +static const char _deserialize_json_key_spans[] = { + 0, 115, 26, 7, 2, 1, 50, 49, + 10, 117, 117, 117, 1, 50, 49, 10, + 117, 117, 1, 1, 50, 49, 117, 117, + 2, 1, 50, 49, 10, 117, 117, 1, + 50, 49, 10, 117, 117, 1, 50, 49, + 58, 89, 117, 117, 85, 115, 0 +}; + +static const short _deserialize_json_index_offsets[] = { + 0, 0, 116, 143, 151, 154, 156, 207, + 257, 268, 386, 504, 622, 624, 675, 725, + 736, 854, 972, 974, 976, 1027, 1077, 1195, + 1313, 1316, 1318, 1369, 1419, 1430, 1548, 1666, + 1668, 1719, 1769, 1780, 1898, 2016, 2018, 2069, + 2119, 2178, 2268, 2386, 2504, 2590, 2706 +}; + +static const char _deserialize_json_indicies[] = { + 0, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 1, 3, 3, 3, + 3, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 4, 1, + 5, 1, 6, 7, 1, 1, 8, 1, + 9, 10, 1, 11, 1, 11, 11, 11, + 11, 11, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 11, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 12, 1, + 12, 12, 12, 12, 12, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 12, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 13, 1, 1, 14, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 1, 16, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 1, 18, 18, 18, + 18, 18, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 18, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 19, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 20, 1, 21, 21, 21, 21, 21, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 21, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 22, + 1, 18, 18, 18, 18, 18, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 18, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 19, 1, 1, 1, + 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 20, 1, 23, + 1, 23, 23, 23, 23, 23, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 23, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 24, 1, 24, 24, 24, 24, + 24, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 24, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 25, 1, 1, 26, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 1, 28, 29, + 29, 29, 29, 29, 29, 29, 29, 29, + 1, 30, 30, 30, 30, 30, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 30, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 31, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 32, 1, 30, + 30, 30, 30, 30, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 30, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 31, 1, 1, 1, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 32, 1, 33, 1, 34, + 1, 34, 34, 34, 34, 34, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 34, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 35, 1, 35, 35, 35, 35, + 35, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 35, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 36, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 1, 38, 38, + 38, 38, 38, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 38, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 39, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 40, 1, 38, 38, 38, 38, + 38, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 38, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 39, + 1, 1, 1, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 40, 1, 42, 43, 1, 44, 1, 44, + 44, 44, 44, 44, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 44, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 45, 1, 45, 45, 45, 45, 45, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 45, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 46, 1, + 1, 47, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 1, 49, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 1, 51, + 51, 51, 51, 51, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 51, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 52, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 53, 1, 51, 51, 51, + 51, 51, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 51, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 52, 1, 1, 1, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 53, 1, 54, 1, 54, 54, 54, + 54, 54, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 54, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 55, 1, + 55, 55, 55, 55, 55, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 55, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 56, 1, 1, 57, + 58, 58, 58, 58, 58, 58, 58, 58, + 58, 1, 59, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 1, 61, 61, 61, + 61, 61, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 61, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 62, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 63, 1, 61, 61, 61, 61, 61, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 61, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 62, 1, + 1, 1, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 63, + 1, 64, 1, 64, 64, 64, 64, 64, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 64, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 65, 1, 65, 65, + 65, 65, 65, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 65, 1, 66, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 67, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 1, + 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 1, 1, 1, 1, 1, 1, + 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 1, 70, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 71, 71, + 1, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 1, 1, 1, 1, 1, + 1, 1, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 1, 1, 1, 1, + 71, 1, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 1, 72, 72, 72, + 72, 72, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 72, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 73, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 74, 1, 72, 72, 72, 72, 72, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 72, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 73, 1, + 1, 1, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 74, + 1, 76, 76, 76, 76, 76, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 76, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 77, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 78, 1, 0, + 0, 0, 0, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 0 +}; + +static const char _deserialize_json_trans_targs[] = { + 1, 0, 2, 2, 3, 4, 18, 24, + 37, 5, 12, 6, 7, 8, 9, 11, + 9, 11, 10, 2, 44, 10, 44, 13, + 14, 15, 16, 17, 16, 17, 10, 2, + 44, 19, 20, 21, 22, 23, 10, 2, + 44, 23, 25, 31, 26, 27, 28, 29, + 30, 29, 30, 10, 2, 44, 32, 33, + 34, 35, 36, 35, 36, 10, 2, 44, + 38, 39, 40, 42, 43, 41, 10, 41, + 10, 2, 44, 43, 44, 45, 46 +}; + +static const char _deserialize_json_trans_actions[] = { + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 2, 2, + 0, 0, 3, 3, 4, 0, 5, 0, + 0, 2, 2, 2, 0, 0, 6, 6, + 7, 0, 0, 0, 2, 2, 8, 8, + 9, 0, 0, 0, 0, 0, 2, 2, + 2, 0, 0, 10, 10, 11, 0, 0, + 2, 2, 2, 0, 0, 12, 12, 13, + 0, 0, 0, 2, 2, 2, 14, 0, + 15, 15, 16, 0, 0, 0, 0 +}; + +static const int deserialize_json_start = 1; +static const int deserialize_json_first_final = 44; +static const int deserialize_json_error = 0; + +static const int deserialize_json_en_main = 1; + + +#line 97 "hb-buffer-deserialize-json.rl" + + +static hb_bool_t +_hb_buffer_deserialize_glyphs_json (hb_buffer_t *buffer, + const char *buf, + unsigned int buf_len, + const char **end_ptr, + hb_font_t *font) +{ + const char *p = buf, *pe = buf + buf_len; + + /* Ensure we have positions. */ + (void) hb_buffer_get_glyph_positions (buffer, NULL); + + while (p < pe && ISSPACE (*p)) + p++; + if (p < pe && *p == (buffer->len ? ',' : '[')) + { + *end_ptr = ++p; + } + + const char *tok = NULL; + int cs; + hb_glyph_info_t info = {0}; + hb_glyph_position_t pos = {0}; + +#line 466 "hb-buffer-deserialize-json.hh" + { + cs = deserialize_json_start; + } + +#line 471 "hb-buffer-deserialize-json.hh" + { + int _slen; + int _trans; + const unsigned char *_keys; + const char *_inds; + if ( p == pe ) + goto _test_eof; + if ( cs == 0 ) + goto _out; +_resume: + _keys = _deserialize_json_trans_keys + (cs<<1); + _inds = _deserialize_json_indicies + _deserialize_json_index_offsets[cs]; + + _slen = _deserialize_json_key_spans[cs]; + _trans = _inds[ _slen > 0 && _keys[0] <=(*p) && + (*p) <= _keys[1] ? + (*p) - _keys[0] : _slen ]; + + cs = _deserialize_json_trans_targs[_trans]; + + if ( _deserialize_json_trans_actions[_trans] == 0 ) + goto _again; + + switch ( _deserialize_json_trans_actions[_trans] ) { + case 1: +#line 38 "hb-buffer-deserialize-json.rl" + { + memset (&info, 0, sizeof (info)); + memset (&pos , 0, sizeof (pos )); +} + break; + case 5: +#line 43 "hb-buffer-deserialize-json.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 2: +#line 51 "hb-buffer-deserialize-json.rl" + { + tok = p; +} + break; + case 14: +#line 55 "hb-buffer-deserialize-json.rl" + { + if (!hb_font_glyph_from_string (font, + tok, p - tok, + &info.codepoint)) + return false; +} + break; + case 15: +#line 62 "hb-buffer-deserialize-json.rl" + { if (!parse_uint (tok, p, &info.codepoint)) return false; } + break; + case 8: +#line 63 "hb-buffer-deserialize-json.rl" + { if (!parse_uint (tok, p, &info.cluster )) return false; } + break; + case 10: +#line 64 "hb-buffer-deserialize-json.rl" + { if (!parse_int (tok, p, &pos.x_offset )) return false; } + break; + case 12: +#line 65 "hb-buffer-deserialize-json.rl" + { if (!parse_int (tok, p, &pos.y_offset )) return false; } + break; + case 3: +#line 66 "hb-buffer-deserialize-json.rl" + { if (!parse_int (tok, p, &pos.x_advance)) return false; } + break; + case 6: +#line 67 "hb-buffer-deserialize-json.rl" + { if (!parse_int (tok, p, &pos.y_advance)) return false; } + break; + case 16: +#line 62 "hb-buffer-deserialize-json.rl" + { if (!parse_uint (tok, p, &info.codepoint)) return false; } +#line 43 "hb-buffer-deserialize-json.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 9: +#line 63 "hb-buffer-deserialize-json.rl" + { if (!parse_uint (tok, p, &info.cluster )) return false; } +#line 43 "hb-buffer-deserialize-json.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 11: +#line 64 "hb-buffer-deserialize-json.rl" + { if (!parse_int (tok, p, &pos.x_offset )) return false; } +#line 43 "hb-buffer-deserialize-json.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 13: +#line 65 "hb-buffer-deserialize-json.rl" + { if (!parse_int (tok, p, &pos.y_offset )) return false; } +#line 43 "hb-buffer-deserialize-json.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 4: +#line 66 "hb-buffer-deserialize-json.rl" + { if (!parse_int (tok, p, &pos.x_advance)) return false; } +#line 43 "hb-buffer-deserialize-json.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 7: +#line 67 "hb-buffer-deserialize-json.rl" + { if (!parse_int (tok, p, &pos.y_advance)) return false; } +#line 43 "hb-buffer-deserialize-json.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; +#line 624 "hb-buffer-deserialize-json.hh" + } + +_again: + if ( cs == 0 ) + goto _out; + if ( ++p != pe ) + goto _resume; + _test_eof: {} + _out: {} + } + +#line 125 "hb-buffer-deserialize-json.rl" + + + *end_ptr = p; + + return p == pe && *(p-1) != ']'; +} + +#endif /* HB_BUFFER_DESERIALIZE_JSON_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-buffer-deserialize-text.hh b/3rdparty/harfbuzz-1.0.6/hb-buffer-deserialize-text.hh new file mode 100644 index 0000000000..d2d8daae7e --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-buffer-deserialize-text.hh @@ -0,0 +1,571 @@ + +#line 1 "hb-buffer-deserialize-text.rl" +/* + * Copyright © 2013 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_BUFFER_DESERIALIZE_TEXT_HH +#define HB_BUFFER_DESERIALIZE_TEXT_HH + +#include "hb-private.hh" + + +#line 36 "hb-buffer-deserialize-text.hh" +static const unsigned char _deserialize_text_trans_keys[] = { + 0u, 0u, 9u, 122u, 45u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 48u, 57u, 45u, 57u, + 48u, 57u, 44u, 44u, 45u, 57u, 48u, 57u, 44u, 57u, 9u, 124u, 9u, 124u, 0u, 0u, + 9u, 122u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, + 9u, 124u, 9u, 124u, 9u, 124u, 0 +}; + +static const char _deserialize_text_key_spans[] = { + 0, 114, 13, 10, 13, 10, 10, 13, + 10, 1, 13, 10, 14, 116, 116, 0, + 114, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 116 +}; + +static const short _deserialize_text_index_offsets[] = { + 0, 0, 115, 129, 140, 154, 165, 176, + 190, 201, 203, 217, 228, 243, 360, 477, + 478, 593, 710, 827, 944, 1061, 1178, 1295, + 1412, 1529, 1646 +}; + +static const char _deserialize_text_indicies[] = { + 0, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 5, 1, 1, 6, + 7, 7, 7, 7, 7, 7, 7, 7, + 7, 1, 8, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 1, 10, 1, 1, + 11, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 1, 13, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 1, 15, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 1, 17, 1, 1, 18, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 1, 20, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 1, 22, 1, 23, 1, 1, 24, + 25, 25, 25, 25, 25, 25, 25, 25, + 25, 1, 26, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 1, 22, 1, 1, + 1, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 1, 28, 28, 28, 28, + 28, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 28, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 29, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 30, 1, 1, 31, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 32, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 33, + 1, 34, 34, 34, 34, 34, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 34, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 35, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 36, 1, 1, 0, + 0, 0, 0, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 1, 1, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 28, 28, 28, 28, 28, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 28, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 29, 1, 1, 1, + 1, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 1, 1, 1, 30, 1, + 1, 31, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 32, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 33, 1, 38, + 38, 38, 38, 38, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 38, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 39, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 40, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 41, 1, 42, 42, 42, 42, + 42, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 42, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 43, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 44, + 1, 42, 42, 42, 42, 42, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 42, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 43, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 44, 1, 38, 38, + 38, 38, 38, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 38, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 39, 1, 1, 1, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 40, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 41, 1, 45, 45, 45, 45, 45, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 45, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 46, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 47, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 48, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 49, 1, + 50, 50, 50, 50, 50, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 50, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 51, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 52, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 53, 1, 50, 50, 50, + 50, 50, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 50, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 51, + 1, 1, 1, 1, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 52, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 53, 1, 45, 45, 45, 45, 45, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 45, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 46, 1, 1, 1, + 1, 54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 1, 1, 1, 1, 1, + 1, 47, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 48, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 49, 1, 28, + 28, 28, 28, 28, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 28, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 29, 1, 55, 55, 1, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, + 1, 1, 1, 30, 1, 1, 31, 55, + 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, + 55, 1, 1, 32, 1, 55, 1, 55, + 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, + 55, 1, 33, 1, 0 +}; + +static const char _deserialize_text_trans_targs[] = { + 1, 0, 13, 17, 26, 3, 18, 21, + 18, 21, 5, 19, 20, 19, 20, 22, + 25, 8, 9, 12, 9, 12, 10, 11, + 23, 24, 23, 24, 14, 2, 6, 7, + 15, 16, 14, 15, 16, 17, 14, 4, + 15, 16, 14, 15, 16, 14, 2, 7, + 15, 16, 14, 2, 15, 16, 25, 26 +}; + +static const char _deserialize_text_trans_actions[] = { + 0, 0, 1, 1, 1, 2, 2, 2, + 0, 0, 2, 2, 2, 0, 0, 2, + 2, 2, 2, 2, 0, 0, 3, 2, + 2, 2, 0, 0, 4, 5, 5, 5, + 4, 4, 0, 0, 0, 0, 6, 7, + 6, 6, 8, 8, 8, 9, 10, 10, + 9, 9, 11, 12, 11, 11, 0, 0 +}; + +static const char _deserialize_text_eof_actions[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 0, 0, + 0, 4, 6, 8, 8, 6, 9, 11, + 11, 9, 4 +}; + +static const int deserialize_text_start = 1; +static const int deserialize_text_first_final = 13; +static const int deserialize_text_error = 0; + +static const int deserialize_text_en_main = 1; + + +#line 91 "hb-buffer-deserialize-text.rl" + + +static hb_bool_t +_hb_buffer_deserialize_glyphs_text (hb_buffer_t *buffer, + const char *buf, + unsigned int buf_len, + const char **end_ptr, + hb_font_t *font) +{ + const char *p = buf, *pe = buf + buf_len; + + /* Ensure we have positions. */ + (void) hb_buffer_get_glyph_positions (buffer, NULL); + + while (p < pe && ISSPACE (*p)) + p++; + if (p < pe && *p == (buffer->len ? '|' : '[')) + { + *end_ptr = ++p; + } + + const char *eof = pe, *tok = NULL; + int cs; + hb_glyph_info_t info = {0}; + hb_glyph_position_t pos = {0}; + +#line 343 "hb-buffer-deserialize-text.hh" + { + cs = deserialize_text_start; + } + +#line 348 "hb-buffer-deserialize-text.hh" + { + int _slen; + int _trans; + const unsigned char *_keys; + const char *_inds; + if ( p == pe ) + goto _test_eof; + if ( cs == 0 ) + goto _out; +_resume: + _keys = _deserialize_text_trans_keys + (cs<<1); + _inds = _deserialize_text_indicies + _deserialize_text_index_offsets[cs]; + + _slen = _deserialize_text_key_spans[cs]; + _trans = _inds[ _slen > 0 && _keys[0] <=(*p) && + (*p) <= _keys[1] ? + (*p) - _keys[0] : _slen ]; + + cs = _deserialize_text_trans_targs[_trans]; + + if ( _deserialize_text_trans_actions[_trans] == 0 ) + goto _again; + + switch ( _deserialize_text_trans_actions[_trans] ) { + case 2: +#line 51 "hb-buffer-deserialize-text.rl" + { + tok = p; +} + break; + case 5: +#line 55 "hb-buffer-deserialize-text.rl" + { + if (!hb_font_glyph_from_string (font, + tok, p - tok, + &info.codepoint)) + return false; +} + break; + case 10: +#line 62 "hb-buffer-deserialize-text.rl" + { if (!parse_uint (tok, p, &info.cluster )) return false; } + break; + case 3: +#line 63 "hb-buffer-deserialize-text.rl" + { if (!parse_int (tok, p, &pos.x_offset )) return false; } + break; + case 12: +#line 64 "hb-buffer-deserialize-text.rl" + { if (!parse_int (tok, p, &pos.y_offset )) return false; } + break; + case 7: +#line 65 "hb-buffer-deserialize-text.rl" + { if (!parse_int (tok, p, &pos.x_advance)) return false; } + break; + case 1: +#line 38 "hb-buffer-deserialize-text.rl" + { + memset (&info, 0, sizeof (info)); + memset (&pos , 0, sizeof (pos )); +} +#line 51 "hb-buffer-deserialize-text.rl" + { + tok = p; +} + break; + case 4: +#line 55 "hb-buffer-deserialize-text.rl" + { + if (!hb_font_glyph_from_string (font, + tok, p - tok, + &info.codepoint)) + return false; +} +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 9: +#line 62 "hb-buffer-deserialize-text.rl" + { if (!parse_uint (tok, p, &info.cluster )) return false; } +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 11: +#line 64 "hb-buffer-deserialize-text.rl" + { if (!parse_int (tok, p, &pos.y_offset )) return false; } +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 6: +#line 65 "hb-buffer-deserialize-text.rl" + { if (!parse_int (tok, p, &pos.x_advance)) return false; } +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 8: +#line 66 "hb-buffer-deserialize-text.rl" + { if (!parse_int (tok, p, &pos.y_advance)) return false; } +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; +#line 480 "hb-buffer-deserialize-text.hh" + } + +_again: + if ( cs == 0 ) + goto _out; + if ( ++p != pe ) + goto _resume; + _test_eof: {} + if ( p == eof ) + { + switch ( _deserialize_text_eof_actions[cs] ) { + case 4: +#line 55 "hb-buffer-deserialize-text.rl" + { + if (!hb_font_glyph_from_string (font, + tok, p - tok, + &info.codepoint)) + return false; +} +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 9: +#line 62 "hb-buffer-deserialize-text.rl" + { if (!parse_uint (tok, p, &info.cluster )) return false; } +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 11: +#line 64 "hb-buffer-deserialize-text.rl" + { if (!parse_int (tok, p, &pos.y_offset )) return false; } +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 6: +#line 65 "hb-buffer-deserialize-text.rl" + { if (!parse_int (tok, p, &pos.x_advance)) return false; } +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; + case 8: +#line 66 "hb-buffer-deserialize-text.rl" + { if (!parse_int (tok, p, &pos.y_advance)) return false; } +#line 43 "hb-buffer-deserialize-text.rl" + { + buffer->add_info (info); + if (buffer->in_error) + return false; + buffer->pos[buffer->len - 1] = pos; + *end_ptr = p; +} + break; +#line 557 "hb-buffer-deserialize-text.hh" + } + } + + _out: {} + } + +#line 119 "hb-buffer-deserialize-text.rl" + + + *end_ptr = p; + + return p == pe && *(p-1) != ']'; +} + +#endif /* HB_BUFFER_DESERIALIZE_TEXT_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-buffer-private.hh b/3rdparty/harfbuzz-1.0.6/hb-buffer-private.hh new file mode 100644 index 0000000000..7fed7386b0 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-buffer-private.hh @@ -0,0 +1,220 @@ +/* + * Copyright © 1998-2004 David Turner and Werner Lemberg + * Copyright © 2004,2007,2009,2010 Red Hat, Inc. + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Owen Taylor, Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_BUFFER_PRIVATE_HH +#define HB_BUFFER_PRIVATE_HH + +#include "hb-private.hh" +#include "hb-object-private.hh" +#include "hb-unicode-private.hh" + + +ASSERT_STATIC (sizeof (hb_glyph_info_t) == 20); +ASSERT_STATIC (sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t)); + + +/* + * hb_buffer_t + */ + +struct hb_buffer_t { + hb_object_header_t header; + ASSERT_POD (); + + /* Information about how the text in the buffer should be treated */ + hb_unicode_funcs_t *unicode; /* Unicode functions */ + hb_buffer_flags_t flags; /* BOT / EOT / etc. */ + hb_buffer_cluster_level_t cluster_level; + hb_codepoint_t replacement; /* U+FFFD or something else. */ + + /* Buffer contents */ + hb_buffer_content_type_t content_type; + hb_segment_properties_t props; /* Script, language, direction */ + + bool in_error; /* Allocation failed */ + bool have_output; /* Whether we have an output buffer going on */ + bool have_positions; /* Whether we have positions */ + + unsigned int idx; /* Cursor into ->info and ->pos arrays */ + unsigned int len; /* Length of ->info and ->pos arrays */ + unsigned int out_len; /* Length of ->out array if have_output */ + + unsigned int allocated; /* Length of allocated arrays */ + hb_glyph_info_t *info; + hb_glyph_info_t *out_info; + hb_glyph_position_t *pos; + + inline hb_glyph_info_t &cur (unsigned int i = 0) { return info[idx + i]; } + inline hb_glyph_info_t cur (unsigned int i = 0) const { return info[idx + i]; } + + inline hb_glyph_position_t &cur_pos (unsigned int i = 0) { return pos[idx + i]; } + inline hb_glyph_position_t cur_pos (unsigned int i = 0) const { return pos[idx + i]; } + + inline hb_glyph_info_t &prev (void) { return out_info[out_len - 1]; } + inline hb_glyph_info_t prev (void) const { return info[out_len - 1]; } + + inline bool has_separate_output (void) const { return info != out_info; } + + unsigned int serial; + + /* These reflect current allocations of the bytes in glyph_info_t's var1 and var2. */ + uint8_t allocated_var_bytes[8]; + const char *allocated_var_owner[8]; + + /* Text before / after the main buffer contents. + * Always in Unicode, and ordered outward. + * Index 0 is for "pre-context", 1 for "post-context". */ + static const unsigned int CONTEXT_LENGTH = 5; + hb_codepoint_t context[2][CONTEXT_LENGTH]; + unsigned int context_len[2]; + + + /* Methods */ + + HB_INTERNAL void reset (void); + HB_INTERNAL void clear (void); + + inline unsigned int backtrack_len (void) const + { return have_output? out_len : idx; } + inline unsigned int lookahead_len (void) const + { return len - idx; } + inline unsigned int next_serial (void) { return serial++; } + + HB_INTERNAL void allocate_var (unsigned int byte_i, unsigned int count, const char *owner); + HB_INTERNAL void deallocate_var (unsigned int byte_i, unsigned int count, const char *owner); + HB_INTERNAL void assert_var (unsigned int byte_i, unsigned int count, const char *owner); + HB_INTERNAL void deallocate_var_all (void); + + HB_INTERNAL void add (hb_codepoint_t codepoint, + unsigned int cluster); + HB_INTERNAL void add_info (const hb_glyph_info_t &glyph_info); + + HB_INTERNAL void reverse_range (unsigned int start, unsigned int end); + HB_INTERNAL void reverse (void); + HB_INTERNAL void reverse_clusters (void); + HB_INTERNAL void guess_segment_properties (void); + + HB_INTERNAL void swap_buffers (void); + HB_INTERNAL void remove_output (void); + HB_INTERNAL void clear_output (void); + HB_INTERNAL void clear_positions (void); + + HB_INTERNAL void replace_glyphs (unsigned int num_in, + unsigned int num_out, + const hb_codepoint_t *glyph_data); + + HB_INTERNAL void replace_glyph (hb_codepoint_t glyph_index); + /* Makes a copy of the glyph at idx to output and replace glyph_index */ + HB_INTERNAL void output_glyph (hb_codepoint_t glyph_index); + HB_INTERNAL void output_info (const hb_glyph_info_t &glyph_info); + /* Copies glyph at idx to output but doesn't advance idx */ + HB_INTERNAL void copy_glyph (void); + HB_INTERNAL bool move_to (unsigned int i); /* i is output-buffer index. */ + /* Copies glyph at idx to output and advance idx. + * If there's no output, just advance idx. */ + inline void + next_glyph (void) + { + if (have_output) + { + if (unlikely (out_info != info || out_len != idx)) { + if (unlikely (!make_room_for (1, 1))) return; + out_info[out_len] = info[idx]; + } + out_len++; + } + + idx++; + } + + /* Advance idx without copying to output. */ + inline void skip_glyph (void) { idx++; } + + inline void reset_masks (hb_mask_t mask) + { + for (unsigned int j = 0; j < len; j++) + info[j].mask = mask; + } + inline void add_masks (hb_mask_t mask) + { + for (unsigned int j = 0; j < len; j++) + info[j].mask |= mask; + } + HB_INTERNAL void set_masks (hb_mask_t value, + hb_mask_t mask, + unsigned int cluster_start, + unsigned int cluster_end); + + HB_INTERNAL void merge_clusters (unsigned int start, + unsigned int end) + { + if (end - start < 2) + return; + merge_clusters_impl (start, end); + } + HB_INTERNAL void merge_clusters_impl (unsigned int start, + unsigned int end); + HB_INTERNAL void merge_out_clusters (unsigned int start, + unsigned int end); + /* Merge clusters for deleting current glyph, and skip it. */ + HB_INTERNAL void delete_glyph (void); + + /* Internal methods */ + HB_INTERNAL bool enlarge (unsigned int size); + + inline bool ensure (unsigned int size) + { return likely (!size || size < allocated) ? true : enlarge (size); } + + inline bool ensure_inplace (unsigned int size) + { return likely (!size || size < allocated); } + + HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out); + HB_INTERNAL bool shift_forward (unsigned int count); + + typedef long scratch_buffer_t; + HB_INTERNAL scratch_buffer_t *get_scratch_buffer (unsigned int *size); + + inline void clear_context (unsigned int side) { context_len[side] = 0; } + + HB_INTERNAL void sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *)); +}; + + +#define HB_BUFFER_XALLOCATE_VAR(b, func, var, owner) \ + b->func (offsetof (hb_glyph_info_t, var) - offsetof(hb_glyph_info_t, var1), \ + sizeof (b->info[0].var), owner) +#define HB_BUFFER_ALLOCATE_VAR(b, var) \ + HB_BUFFER_XALLOCATE_VAR (b, allocate_var, var (), #var) +#define HB_BUFFER_DEALLOCATE_VAR(b, var) \ + HB_BUFFER_XALLOCATE_VAR (b, deallocate_var, var (), #var) +#define HB_BUFFER_ASSERT_VAR(b, var) \ + HB_BUFFER_XALLOCATE_VAR (b, assert_var, var (), #var) + + +#endif /* HB_BUFFER_PRIVATE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-buffer-serialize.cc b/3rdparty/harfbuzz-1.0.6/hb-buffer-serialize.cc new file mode 100644 index 0000000000..7839cbc3f0 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-buffer-serialize.cc @@ -0,0 +1,418 @@ +/* + * Copyright © 2012,2013 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-buffer-private.hh" + + +static const char *serialize_formats[] = { + "text", + "json", + NULL +}; + +/** + * hb_buffer_serialize_list_formats: + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +const char ** +hb_buffer_serialize_list_formats (void) +{ + return serialize_formats; +} + +/** + * hb_buffer_serialize_format_from_string: + * @str: + * @len: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_buffer_serialize_format_t +hb_buffer_serialize_format_from_string (const char *str, int len) +{ + /* Upper-case it. */ + return (hb_buffer_serialize_format_t) (hb_tag_from_string (str, len) & ~0x20202020u); +} + +/** + * hb_buffer_serialize_format_to_string: + * @format: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +const char * +hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format) +{ + switch (format) + { + case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return serialize_formats[0]; + case HB_BUFFER_SERIALIZE_FORMAT_JSON: return serialize_formats[1]; + default: + case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return NULL; + } +} + +static unsigned int +_hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer, + unsigned int start, + unsigned int end, + char *buf, + unsigned int buf_size, + unsigned int *buf_consumed, + hb_font_t *font, + hb_buffer_serialize_flags_t flags) +{ + hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL); + hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ? + NULL : hb_buffer_get_glyph_positions (buffer, NULL); + + *buf_consumed = 0; + for (unsigned int i = start; i < end; i++) + { + char b[1024]; + char *p = b; + + /* In the following code, we know b is large enough that no overflow can happen. */ + +#define APPEND(s) HB_STMT_START { strcpy (p, s); p += strlen (s); } HB_STMT_END + + if (i) + *p++ = ','; + + *p++ = '{'; + + APPEND ("\"g\":"); + if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES)) + { + char g[128]; + hb_font_glyph_to_string (font, info[i].codepoint, g, sizeof (g)); + *p++ = '"'; + for (char *q = g; *q; q++) { + if (*q == '"') + *p++ = '\\'; + *p++ = *q; + } + *p++ = '"'; + } + else + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint)); + + if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) { + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"cl\":%u", info[i].cluster)); + } + + if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS)) + { + p += snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"dx\":%d,\"dy\":%d", + pos[i].x_offset, pos[i].y_offset); + p += snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"ax\":%d,\"ay\":%d", + pos[i].x_advance, pos[i].y_advance); + } + + if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS) + { + hb_glyph_extents_t extents; + hb_font_get_glyph_extents(font, info[i].codepoint, &extents); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"xb\":%d,\"yb\":%d", + extents.x_bearing, extents.y_bearing)); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"w\":%d,\"h\":%d", + extents.width, extents.height)); + } + + *p++ = '}'; + + unsigned int l = p - b; + if (buf_size > l) + { + memcpy (buf, b, l); + buf += l; + buf_size -= l; + *buf_consumed += l; + *buf = '\0'; + } else + return i - start; + } + + return end - start; +} + +static unsigned int +_hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer, + unsigned int start, + unsigned int end, + char *buf, + unsigned int buf_size, + unsigned int *buf_consumed, + hb_font_t *font, + hb_buffer_serialize_flags_t flags) +{ + hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL); + hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ? + NULL : hb_buffer_get_glyph_positions (buffer, NULL); + + *buf_consumed = 0; + for (unsigned int i = start; i < end; i++) + { + char b[1024]; + char *p = b; + + /* In the following code, we know b is large enough that no overflow can happen. */ + + if (i) + *p++ = '|'; + + if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES)) + { + hb_font_glyph_to_string (font, info[i].codepoint, p, 128); + p += strlen (p); + } + else + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint)); + + if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) { + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "=%u", info[i].cluster)); + } + + if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS)) + { + if (pos[i].x_offset || pos[i].y_offset) + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "@%d,%d", pos[i].x_offset, pos[i].y_offset)); + + *p++ = '+'; + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%d", pos[i].x_advance)); + if (pos[i].y_advance) + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance)); + } + + if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS) + { + hb_glyph_extents_t extents; + hb_font_get_glyph_extents(font, info[i].codepoint, &extents); + p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "<%d,%d,%d,%d>", extents.x_bearing, extents.y_bearing, extents.width, extents.height)); + } + + unsigned int l = p - b; + if (buf_size > l) + { + memcpy (buf, b, l); + buf += l; + buf_size -= l; + *buf_consumed += l; + *buf = '\0'; + } else + return i - start; + } + + return end - start; +} + +/* Returns number of items, starting at start, that were serialized. */ +/** + * hb_buffer_serialize_glyphs: + * @buffer: a buffer. + * @start: + * @end: + * @buf: (array length=buf_size): + * @buf_size: + * @buf_consumed: (out): + * @font: + * @format: + * @flags: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +unsigned int +hb_buffer_serialize_glyphs (hb_buffer_t *buffer, + unsigned int start, + unsigned int end, + char *buf, + unsigned int buf_size, + unsigned int *buf_consumed, /* May be NULL */ + hb_font_t *font, /* May be NULL */ + hb_buffer_serialize_format_t format, + hb_buffer_serialize_flags_t flags) +{ + assert (start <= end && end <= buffer->len); + + unsigned int sconsumed; + if (!buf_consumed) + buf_consumed = &sconsumed; + *buf_consumed = 0; + + assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) || + buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS); + + if (unlikely (start == end)) + return 0; + + if (!font) + font = hb_font_get_empty (); + + switch (format) + { + case HB_BUFFER_SERIALIZE_FORMAT_TEXT: + return _hb_buffer_serialize_glyphs_text (buffer, start, end, + buf, buf_size, buf_consumed, + font, flags); + + case HB_BUFFER_SERIALIZE_FORMAT_JSON: + return _hb_buffer_serialize_glyphs_json (buffer, start, end, + buf, buf_size, buf_consumed, + font, flags); + + default: + case HB_BUFFER_SERIALIZE_FORMAT_INVALID: + return 0; + + } +} + + +static hb_bool_t +parse_uint (const char *pp, const char *end, uint32_t *pv) +{ + char buf[32]; + unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - pp)); + strncpy (buf, pp, len); + buf[len] = '\0'; + + char *p = buf; + char *pend = p; + uint32_t v; + + errno = 0; + v = strtol (p, &pend, 10); + if (errno || p == pend || pend - p != end - pp) + return false; + + *pv = v; + return true; +} + +static hb_bool_t +parse_int (const char *pp, const char *end, int32_t *pv) +{ + char buf[32]; + unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - pp)); + strncpy (buf, pp, len); + buf[len] = '\0'; + + char *p = buf; + char *pend = p; + int32_t v; + + errno = 0; + v = strtol (p, &pend, 10); + if (errno || p == pend || pend - p != end - pp) + return false; + + *pv = v; + return true; +} + +#include "hb-buffer-deserialize-json.hh" +#include "hb-buffer-deserialize-text.hh" + +/** + * hb_buffer_deserialize_glyphs: + * @buffer: a buffer. + * @buf: (array length=buf_len): + * @buf_len: + * @end_ptr: (out): + * @font: + * @format: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_buffer_deserialize_glyphs (hb_buffer_t *buffer, + const char *buf, + int buf_len, /* -1 means nul-terminated */ + const char **end_ptr, /* May be NULL */ + hb_font_t *font, /* May be NULL */ + hb_buffer_serialize_format_t format) +{ + const char *end; + if (!end_ptr) + end_ptr = &end; + *end_ptr = buf; + + assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) || + buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS); + + if (buf_len == -1) + buf_len = strlen (buf); + + if (!buf_len) + { + *end_ptr = buf; + return false; + } + + hb_buffer_set_content_type (buffer, HB_BUFFER_CONTENT_TYPE_GLYPHS); + + if (!font) + font = hb_font_get_empty (); + + switch (format) + { + case HB_BUFFER_SERIALIZE_FORMAT_TEXT: + return _hb_buffer_deserialize_glyphs_text (buffer, + buf, buf_len, end_ptr, + font); + + case HB_BUFFER_SERIALIZE_FORMAT_JSON: + return _hb_buffer_deserialize_glyphs_json (buffer, + buf, buf_len, end_ptr, + font); + + default: + case HB_BUFFER_SERIALIZE_FORMAT_INVALID: + return false; + + } +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-buffer.cc b/3rdparty/harfbuzz-1.0.6/hb-buffer.cc new file mode 100644 index 0000000000..50710dd23e --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-buffer.cc @@ -0,0 +1,1701 @@ +/* + * Copyright © 1998-2004 David Turner and Werner Lemberg + * Copyright © 2004,2007,2009,2010 Red Hat, Inc. + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Owen Taylor, Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-buffer-private.hh" +#include "hb-utf-private.hh" + + +#ifndef HB_DEBUG_BUFFER +#define HB_DEBUG_BUFFER (HB_DEBUG+0) +#endif + + +/** + * Since: 0.9.7 + **/ +hb_bool_t +hb_segment_properties_equal (const hb_segment_properties_t *a, + const hb_segment_properties_t *b) +{ + return a->direction == b->direction && + a->script == b->script && + a->language == b->language && + a->reserved1 == b->reserved1 && + a->reserved2 == b->reserved2; + +} + +/** + * Since: 0.9.7 + **/ +unsigned int +hb_segment_properties_hash (const hb_segment_properties_t *p) +{ + return (unsigned int) p->direction ^ + (unsigned int) p->script ^ + (intptr_t) (p->language); +} + + + +/* Here is how the buffer works internally: + * + * There are two info pointers: info and out_info. They always have + * the same allocated size, but different lengths. + * + * As an optimization, both info and out_info may point to the + * same piece of memory, which is owned by info. This remains the + * case as long as out_len doesn't exceed i at any time. + * In that case, swap_buffers() is no-op and the glyph operations operate + * mostly in-place. + * + * As soon as out_info gets longer than info, out_info is moved over + * to an alternate buffer (which we reuse the pos buffer for!), and its + * current contents (out_len entries) are copied to the new place. + * This should all remain transparent to the user. swap_buffers() then + * switches info and out_info. + */ + + + +/* Internal API */ + +bool +hb_buffer_t::enlarge (unsigned int size) +{ + if (unlikely (in_error)) + return false; + + unsigned int new_allocated = allocated; + hb_glyph_position_t *new_pos = NULL; + hb_glyph_info_t *new_info = NULL; + bool separate_out = out_info != info; + + if (unlikely (_hb_unsigned_int_mul_overflows (size, sizeof (info[0])))) + goto done; + + while (size >= new_allocated) + new_allocated += (new_allocated >> 1) + 32; + + ASSERT_STATIC (sizeof (info[0]) == sizeof (pos[0])); + if (unlikely (_hb_unsigned_int_mul_overflows (new_allocated, sizeof (info[0])))) + goto done; + + new_pos = (hb_glyph_position_t *) realloc (pos, new_allocated * sizeof (pos[0])); + new_info = (hb_glyph_info_t *) realloc (info, new_allocated * sizeof (info[0])); + +done: + if (unlikely (!new_pos || !new_info)) + in_error = true; + + if (likely (new_pos)) + pos = new_pos; + + if (likely (new_info)) + info = new_info; + + out_info = separate_out ? (hb_glyph_info_t *) pos : info; + if (likely (!in_error)) + allocated = new_allocated; + + return likely (!in_error); +} + +bool +hb_buffer_t::make_room_for (unsigned int num_in, + unsigned int num_out) +{ + if (unlikely (!ensure (out_len + num_out))) return false; + + if (out_info == info && + out_len + num_out > idx + num_in) + { + assert (have_output); + + out_info = (hb_glyph_info_t *) pos; + memcpy (out_info, info, out_len * sizeof (out_info[0])); + } + + return true; +} + +bool +hb_buffer_t::shift_forward (unsigned int count) +{ + assert (have_output); + if (unlikely (!ensure (len + count))) return false; + + memmove (info + idx + count, info + idx, (len - idx) * sizeof (info[0])); + len += count; + idx += count; + + return true; +} + +hb_buffer_t::scratch_buffer_t * +hb_buffer_t::get_scratch_buffer (unsigned int *size) +{ + have_output = false; + have_positions = false; + + out_len = 0; + out_info = info; + + assert ((uintptr_t) pos % sizeof (scratch_buffer_t) == 0); + *size = allocated * sizeof (pos[0]) / sizeof (scratch_buffer_t); + return (scratch_buffer_t *) (void *) pos; +} + + + +/* HarfBuzz-Internal API */ + +void +hb_buffer_t::reset (void) +{ + if (unlikely (hb_object_is_inert (this))) + return; + + hb_unicode_funcs_destroy (unicode); + unicode = hb_unicode_funcs_get_default (); + flags = HB_BUFFER_FLAG_DEFAULT; + replacement = HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT; + + clear (); +} + +void +hb_buffer_t::clear (void) +{ + if (unlikely (hb_object_is_inert (this))) + return; + + hb_segment_properties_t default_props = HB_SEGMENT_PROPERTIES_DEFAULT; + props = default_props; + + content_type = HB_BUFFER_CONTENT_TYPE_INVALID; + in_error = false; + have_output = false; + have_positions = false; + + idx = 0; + len = 0; + out_len = 0; + out_info = info; + + serial = 0; + memset (allocated_var_bytes, 0, sizeof allocated_var_bytes); + memset (allocated_var_owner, 0, sizeof allocated_var_owner); + + memset (context, 0, sizeof context); + memset (context_len, 0, sizeof context_len); +} + +void +hb_buffer_t::add (hb_codepoint_t codepoint, + unsigned int cluster) +{ + hb_glyph_info_t *glyph; + + if (unlikely (!ensure (len + 1))) return; + + glyph = &info[len]; + + memset (glyph, 0, sizeof (*glyph)); + glyph->codepoint = codepoint; + glyph->mask = 1; + glyph->cluster = cluster; + + len++; +} + +void +hb_buffer_t::add_info (const hb_glyph_info_t &glyph_info) +{ + if (unlikely (!ensure (len + 1))) return; + + info[len] = glyph_info; + + len++; +} + + +void +hb_buffer_t::remove_output (void) +{ + if (unlikely (hb_object_is_inert (this))) + return; + + have_output = false; + have_positions = false; + + out_len = 0; + out_info = info; +} + +void +hb_buffer_t::clear_output (void) +{ + if (unlikely (hb_object_is_inert (this))) + return; + + have_output = true; + have_positions = false; + + out_len = 0; + out_info = info; +} + +void +hb_buffer_t::clear_positions (void) +{ + if (unlikely (hb_object_is_inert (this))) + return; + + have_output = false; + have_positions = true; + + out_len = 0; + out_info = info; + + memset (pos, 0, sizeof (pos[0]) * len); +} + +void +hb_buffer_t::swap_buffers (void) +{ + if (unlikely (in_error)) return; + + assert (have_output); + have_output = false; + + if (out_info != info) + { + hb_glyph_info_t *tmp_string; + tmp_string = info; + info = out_info; + out_info = tmp_string; + pos = (hb_glyph_position_t *) out_info; + } + + unsigned int tmp; + tmp = len; + len = out_len; + out_len = tmp; + + idx = 0; +} + + +void +hb_buffer_t::replace_glyphs (unsigned int num_in, + unsigned int num_out, + const uint32_t *glyph_data) +{ + if (unlikely (!make_room_for (num_in, num_out))) return; + + merge_clusters (idx, idx + num_in); + + hb_glyph_info_t orig_info = info[idx]; + hb_glyph_info_t *pinfo = &out_info[out_len]; + for (unsigned int i = 0; i < num_out; i++) + { + *pinfo = orig_info; + pinfo->codepoint = glyph_data[i]; + pinfo++; + } + + idx += num_in; + out_len += num_out; +} + +void +hb_buffer_t::output_glyph (hb_codepoint_t glyph_index) +{ + if (unlikely (!make_room_for (0, 1))) return; + + out_info[out_len] = info[idx]; + out_info[out_len].codepoint = glyph_index; + + out_len++; +} + +void +hb_buffer_t::output_info (const hb_glyph_info_t &glyph_info) +{ + if (unlikely (!make_room_for (0, 1))) return; + + out_info[out_len] = glyph_info; + + out_len++; +} + +void +hb_buffer_t::copy_glyph (void) +{ + if (unlikely (!make_room_for (0, 1))) return; + + out_info[out_len] = info[idx]; + + out_len++; +} + +bool +hb_buffer_t::move_to (unsigned int i) +{ + if (!have_output) + { + assert (i <= len); + idx = i; + return true; + } + + assert (i <= out_len + (len - idx)); + + if (out_len < i) + { + unsigned int count = i - out_len; + if (unlikely (!make_room_for (count, count))) return false; + + memmove (out_info + out_len, info + idx, count * sizeof (out_info[0])); + idx += count; + out_len += count; + } + else if (out_len > i) + { + /* Tricky part: rewinding... */ + unsigned int count = out_len - i; + + if (unlikely (idx < count && !shift_forward (count + 32))) return false; + + assert (idx >= count); + + idx -= count; + out_len -= count; + memmove (info + idx, out_info + out_len, count * sizeof (out_info[0])); + } + + return true; +} + +void +hb_buffer_t::replace_glyph (hb_codepoint_t glyph_index) +{ + if (unlikely (out_info != info || out_len != idx)) { + if (unlikely (!make_room_for (1, 1))) return; + out_info[out_len] = info[idx]; + } + out_info[out_len].codepoint = glyph_index; + + idx++; + out_len++; +} + + +void +hb_buffer_t::set_masks (hb_mask_t value, + hb_mask_t mask, + unsigned int cluster_start, + unsigned int cluster_end) +{ + hb_mask_t not_mask = ~mask; + value &= mask; + + if (!mask) + return; + + if (cluster_start == 0 && cluster_end == (unsigned int)-1) { + unsigned int count = len; + for (unsigned int i = 0; i < count; i++) + info[i].mask = (info[i].mask & not_mask) | value; + return; + } + + unsigned int count = len; + for (unsigned int i = 0; i < count; i++) + if (cluster_start <= info[i].cluster && info[i].cluster < cluster_end) + info[i].mask = (info[i].mask & not_mask) | value; +} + +void +hb_buffer_t::reverse_range (unsigned int start, + unsigned int end) +{ + unsigned int i, j; + + if (end - start < 2) + return; + + for (i = start, j = end - 1; i < j; i++, j--) { + hb_glyph_info_t t; + + t = info[i]; + info[i] = info[j]; + info[j] = t; + } + + if (have_positions) { + for (i = start, j = end - 1; i < j; i++, j--) { + hb_glyph_position_t t; + + t = pos[i]; + pos[i] = pos[j]; + pos[j] = t; + } + } +} + +void +hb_buffer_t::reverse (void) +{ + if (unlikely (!len)) + return; + + reverse_range (0, len); +} + +void +hb_buffer_t::reverse_clusters (void) +{ + unsigned int i, start, count, last_cluster; + + if (unlikely (!len)) + return; + + reverse (); + + count = len; + start = 0; + last_cluster = info[0].cluster; + for (i = 1; i < count; i++) { + if (last_cluster != info[i].cluster) { + reverse_range (start, i); + start = i; + last_cluster = info[i].cluster; + } + } + reverse_range (start, i); +} + +void +hb_buffer_t::merge_clusters_impl (unsigned int start, + unsigned int end) +{ + if (cluster_level == HB_BUFFER_CLUSTER_LEVEL_CHARACTERS) + return; + + unsigned int cluster = info[start].cluster; + + for (unsigned int i = start + 1; i < end; i++) + cluster = MIN (cluster, info[i].cluster); + + /* Extend end */ + while (end < len && info[end - 1].cluster == info[end].cluster) + end++; + + /* Extend start */ + while (idx < start && info[start - 1].cluster == info[start].cluster) + start--; + + /* If we hit the start of buffer, continue in out-buffer. */ + if (idx == start) + for (unsigned int i = out_len; i && out_info[i - 1].cluster == info[start].cluster; i--) + out_info[i - 1].cluster = cluster; + + for (unsigned int i = start; i < end; i++) + info[i].cluster = cluster; +} +void +hb_buffer_t::merge_out_clusters (unsigned int start, + unsigned int end) +{ + if (cluster_level == HB_BUFFER_CLUSTER_LEVEL_CHARACTERS) + return; + + if (unlikely (end - start < 2)) + return; + + unsigned int cluster = out_info[start].cluster; + + for (unsigned int i = start + 1; i < end; i++) + cluster = MIN (cluster, out_info[i].cluster); + + /* Extend start */ + while (start && out_info[start - 1].cluster == out_info[start].cluster) + start--; + + /* Extend end */ + while (end < out_len && out_info[end - 1].cluster == out_info[end].cluster) + end++; + + /* If we hit the end of out-buffer, continue in buffer. */ + if (end == out_len) + for (unsigned int i = idx; i < len && info[i].cluster == out_info[end - 1].cluster; i++) + info[i].cluster = cluster; + + for (unsigned int i = start; i < end; i++) + out_info[i].cluster = cluster; +} +void +hb_buffer_t::delete_glyph () +{ + unsigned int cluster = info[idx].cluster; + if (idx + 1 < len && cluster == info[idx + 1].cluster) + { + /* Cluster survives; do nothing. */ + goto done; + } + + if (out_len) + { + /* Merge cluster backward. */ + if (cluster < out_info[out_len - 1].cluster) + { + unsigned int old_cluster = out_info[out_len - 1].cluster; + for (unsigned i = out_len; i && out_info[i - 1].cluster == old_cluster; i--) + out_info[i - 1].cluster = cluster; + } + goto done; + } + + if (idx + 1 < len) + { + /* Merge cluster forward. */ + merge_clusters (idx, idx + 2); + goto done; + } + +done: + skip_glyph (); +} + +void +hb_buffer_t::guess_segment_properties (void) +{ + assert (content_type == HB_BUFFER_CONTENT_TYPE_UNICODE || + (!len && content_type == HB_BUFFER_CONTENT_TYPE_INVALID)); + + /* If script is set to INVALID, guess from buffer contents */ + if (props.script == HB_SCRIPT_INVALID) { + for (unsigned int i = 0; i < len; i++) { + hb_script_t script = unicode->script (info[i].codepoint); + if (likely (script != HB_SCRIPT_COMMON && + script != HB_SCRIPT_INHERITED && + script != HB_SCRIPT_UNKNOWN)) { + props.script = script; + break; + } + } + } + + /* If direction is set to INVALID, guess from script */ + if (props.direction == HB_DIRECTION_INVALID) { + props.direction = hb_script_get_horizontal_direction (props.script); + } + + /* If language is not set, use default language from locale */ + if (props.language == HB_LANGUAGE_INVALID) { + /* TODO get_default_for_script? using $LANGUAGE */ + props.language = hb_language_get_default (); + } +} + + +static inline void +dump_var_allocation (const hb_buffer_t *buffer) +{ + char buf[80]; + for (unsigned int i = 0; i < 8; i++) + buf[i] = '0' + buffer->allocated_var_bytes[7 - i]; + buf[8] = '\0'; + DEBUG_MSG (BUFFER, buffer, + "Current var allocation: %s", + buf); +} + +void hb_buffer_t::allocate_var (unsigned int byte_i, unsigned int count, const char *owner) +{ + assert (byte_i < 8 && byte_i + count <= 8); + + if (DEBUG_ENABLED (BUFFER)) + dump_var_allocation (this); + DEBUG_MSG (BUFFER, this, + "Allocating var bytes %d..%d for %s", + byte_i, byte_i + count - 1, owner); + + for (unsigned int i = byte_i; i < byte_i + count; i++) { + assert (!allocated_var_bytes[i]); + allocated_var_bytes[i]++; + allocated_var_owner[i] = owner; + } +} + +void hb_buffer_t::deallocate_var (unsigned int byte_i, unsigned int count, const char *owner) +{ + if (DEBUG_ENABLED (BUFFER)) + dump_var_allocation (this); + + DEBUG_MSG (BUFFER, this, + "Deallocating var bytes %d..%d for %s", + byte_i, byte_i + count - 1, owner); + + assert (byte_i < 8 && byte_i + count <= 8); + for (unsigned int i = byte_i; i < byte_i + count; i++) { + assert (allocated_var_bytes[i]); + assert (0 == strcmp (allocated_var_owner[i], owner)); + allocated_var_bytes[i]--; + } +} + +void hb_buffer_t::assert_var (unsigned int byte_i, unsigned int count, const char *owner) +{ + if (DEBUG_ENABLED (BUFFER)) + dump_var_allocation (this); + + DEBUG_MSG (BUFFER, this, + "Asserting var bytes %d..%d for %s", + byte_i, byte_i + count - 1, owner); + + assert (byte_i < 8 && byte_i + count <= 8); + for (unsigned int i = byte_i; i < byte_i + count; i++) { + assert (allocated_var_bytes[i]); + assert (0 == strcmp (allocated_var_owner[i], owner)); + } +} + +void hb_buffer_t::deallocate_var_all (void) +{ + memset (allocated_var_bytes, 0, sizeof (allocated_var_bytes)); + memset (allocated_var_owner, 0, sizeof (allocated_var_owner)); +} + +/* Public API */ + +/** + * hb_buffer_create: (Xconstructor) + * + * + * + * Return value: (transfer full) + * + * Since: 0.9.2 + **/ +hb_buffer_t * +hb_buffer_create (void) +{ + hb_buffer_t *buffer; + + if (!(buffer = hb_object_create ())) + return hb_buffer_get_empty (); + + buffer->reset (); + + return buffer; +} + +/** + * hb_buffer_get_empty: + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_buffer_t * +hb_buffer_get_empty (void) +{ + static const hb_buffer_t _hb_buffer_nil = { + HB_OBJECT_HEADER_STATIC, + + const_cast (&_hb_unicode_funcs_nil), + HB_BUFFER_FLAG_DEFAULT, + HB_BUFFER_CLUSTER_LEVEL_DEFAULT, + HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT, + + HB_BUFFER_CONTENT_TYPE_INVALID, + HB_SEGMENT_PROPERTIES_DEFAULT, + true, /* in_error */ + true, /* have_output */ + true /* have_positions */ + + /* Zero is good enough for everything else. */ + }; + + return const_cast (&_hb_buffer_nil); +} + +/** + * hb_buffer_reference: (skip) + * @buffer: a buffer. + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_buffer_t * +hb_buffer_reference (hb_buffer_t *buffer) +{ + return hb_object_reference (buffer); +} + +/** + * hb_buffer_destroy: (skip) + * @buffer: a buffer. + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_destroy (hb_buffer_t *buffer) +{ + if (!hb_object_destroy (buffer)) return; + + hb_unicode_funcs_destroy (buffer->unicode); + + free (buffer->info); + free (buffer->pos); + + free (buffer); +} + +/** + * hb_buffer_set_user_data: (skip) + * @buffer: a buffer. + * @key: + * @data: + * @destroy: + * @replace: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_buffer_set_user_data (hb_buffer_t *buffer, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (buffer, key, data, destroy, replace); +} + +/** + * hb_buffer_get_user_data: (skip) + * @buffer: a buffer. + * @key: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +void * +hb_buffer_get_user_data (hb_buffer_t *buffer, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (buffer, key); +} + + +/** + * hb_buffer_set_content_type: + * @buffer: a buffer. + * @content_type: + * + * + * + * Since: 0.9.5 + **/ +void +hb_buffer_set_content_type (hb_buffer_t *buffer, + hb_buffer_content_type_t content_type) +{ + buffer->content_type = content_type; +} + +/** + * hb_buffer_get_content_type: + * @buffer: a buffer. + * + * + * + * Return value: + * + * Since: 0.9.5 + **/ +hb_buffer_content_type_t +hb_buffer_get_content_type (hb_buffer_t *buffer) +{ + return buffer->content_type; +} + + +/** + * hb_buffer_set_unicode_funcs: + * @buffer: a buffer. + * @unicode_funcs: + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_set_unicode_funcs (hb_buffer_t *buffer, + hb_unicode_funcs_t *unicode_funcs) +{ + if (unlikely (hb_object_is_inert (buffer))) + return; + + if (!unicode_funcs) + unicode_funcs = hb_unicode_funcs_get_default (); + + + hb_unicode_funcs_reference (unicode_funcs); + hb_unicode_funcs_destroy (buffer->unicode); + buffer->unicode = unicode_funcs; +} + +/** + * hb_buffer_get_unicode_funcs: + * @buffer: a buffer. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_unicode_funcs_t * +hb_buffer_get_unicode_funcs (hb_buffer_t *buffer) +{ + return buffer->unicode; +} + +/** + * hb_buffer_set_direction: + * @buffer: a buffer. + * @direction: + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_set_direction (hb_buffer_t *buffer, + hb_direction_t direction) + +{ + if (unlikely (hb_object_is_inert (buffer))) + return; + + buffer->props.direction = direction; +} + +/** + * hb_buffer_get_direction: + * @buffer: a buffer. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_direction_t +hb_buffer_get_direction (hb_buffer_t *buffer) +{ + return buffer->props.direction; +} + +/** + * hb_buffer_set_script: + * @buffer: a buffer. + * @script: + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_set_script (hb_buffer_t *buffer, + hb_script_t script) +{ + if (unlikely (hb_object_is_inert (buffer))) + return; + + buffer->props.script = script; +} + +/** + * hb_buffer_get_script: + * @buffer: a buffer. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_script_t +hb_buffer_get_script (hb_buffer_t *buffer) +{ + return buffer->props.script; +} + +/** + * hb_buffer_set_language: + * @buffer: a buffer. + * @language: + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_set_language (hb_buffer_t *buffer, + hb_language_t language) +{ + if (unlikely (hb_object_is_inert (buffer))) + return; + + buffer->props.language = language; +} + +/** + * hb_buffer_get_language: + * @buffer: a buffer. + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +hb_language_t +hb_buffer_get_language (hb_buffer_t *buffer) +{ + return buffer->props.language; +} + +/** + * hb_buffer_set_segment_properties: + * @buffer: a buffer. + * @props: + * + * + * + * Since: 0.9.7 + **/ +void +hb_buffer_set_segment_properties (hb_buffer_t *buffer, + const hb_segment_properties_t *props) +{ + if (unlikely (hb_object_is_inert (buffer))) + return; + + buffer->props = *props; +} + +/** + * hb_buffer_get_segment_properties: + * @buffer: a buffer. + * @props: (out): + * + * + * + * Since: 0.9.7 + **/ +void +hb_buffer_get_segment_properties (hb_buffer_t *buffer, + hb_segment_properties_t *props) +{ + *props = buffer->props; +} + + +/** + * hb_buffer_set_flags: + * @buffer: a buffer. + * @flags: + * + * + * + * Since: 0.9.7 + **/ +void +hb_buffer_set_flags (hb_buffer_t *buffer, + hb_buffer_flags_t flags) +{ + if (unlikely (hb_object_is_inert (buffer))) + return; + + buffer->flags = flags; +} + +/** + * hb_buffer_get_flags: + * @buffer: a buffer. + * + * + * + * Return value: + * + * Since: 0.9.7 + **/ +hb_buffer_flags_t +hb_buffer_get_flags (hb_buffer_t *buffer) +{ + return buffer->flags; +} + +/** + * hb_buffer_set_cluster_level: + * @buffer: a buffer. + * @cluster_level: + * + * + * + * Since: 0.9.42 + **/ +void +hb_buffer_set_cluster_level (hb_buffer_t *buffer, + hb_buffer_cluster_level_t cluster_level) +{ + if (unlikely (hb_object_is_inert (buffer))) + return; + + buffer->cluster_level = cluster_level; +} + +/** + * hb_buffer_get_cluster_level: + * @buffer: a buffer. + * + * + * + * Return value: + * + * Since: 0.9.42 + **/ +hb_buffer_cluster_level_t +hb_buffer_get_cluster_level (hb_buffer_t *buffer) +{ + return buffer->cluster_level; +} + + +/** + * hb_buffer_set_replacement_codepoint: + * @buffer: a buffer. + * @replacement: + * + * + * + * Since: 0.9.31 + **/ +void +hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer, + hb_codepoint_t replacement) +{ + if (unlikely (hb_object_is_inert (buffer))) + return; + + buffer->replacement = replacement; +} + +/** + * hb_buffer_get_replacement_codepoint: + * @buffer: a buffer. + * + * + * + * Return value: + * + * Since: 0.9.31 + **/ +hb_codepoint_t +hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer) +{ + return buffer->replacement; +} + + +/** + * hb_buffer_reset: + * @buffer: a buffer. + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_reset (hb_buffer_t *buffer) +{ + buffer->reset (); +} + +/** + * hb_buffer_clear_contents: + * @buffer: a buffer. + * + * + * + * Since: 0.9.11 + **/ +void +hb_buffer_clear_contents (hb_buffer_t *buffer) +{ + buffer->clear (); +} + +/** + * hb_buffer_pre_allocate: + * @buffer: a buffer. + * @size: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_buffer_pre_allocate (hb_buffer_t *buffer, unsigned int size) +{ + return buffer->ensure (size); +} + +/** + * hb_buffer_allocation_successful: + * @buffer: a buffer. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_buffer_allocation_successful (hb_buffer_t *buffer) +{ + return !buffer->in_error; +} + +/** + * hb_buffer_add: + * @buffer: a buffer. + * @codepoint: + * @cluster: + * + * + * + * Since: 0.9.7 + **/ +void +hb_buffer_add (hb_buffer_t *buffer, + hb_codepoint_t codepoint, + unsigned int cluster) +{ + buffer->add (codepoint, cluster); + buffer->clear_context (1); +} + +/** + * hb_buffer_set_length: + * @buffer: a buffer. + * @length: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_buffer_set_length (hb_buffer_t *buffer, + unsigned int length) +{ + if (unlikely (hb_object_is_inert (buffer))) + return length == 0; + + if (!buffer->ensure (length)) + return false; + + /* Wipe the new space */ + if (length > buffer->len) { + memset (buffer->info + buffer->len, 0, sizeof (buffer->info[0]) * (length - buffer->len)); + if (buffer->have_positions) + memset (buffer->pos + buffer->len, 0, sizeof (buffer->pos[0]) * (length - buffer->len)); + } + + buffer->len = length; + + if (!length) + { + buffer->content_type = HB_BUFFER_CONTENT_TYPE_INVALID; + buffer->clear_context (0); + } + buffer->clear_context (1); + + return true; +} + +/** + * hb_buffer_get_length: + * @buffer: a buffer. + * + * Returns the number of items in the buffer. + * + * Return value: buffer length. + * + * Since: 0.9.2 + **/ +unsigned int +hb_buffer_get_length (hb_buffer_t *buffer) +{ + return buffer->len; +} + +/** + * hb_buffer_get_glyph_infos: + * @buffer: a buffer. + * @length: (out): output array length. + * + * Returns buffer glyph information array. Returned pointer + * is valid as long as buffer contents are not modified. + * + * Return value: (transfer none) (array length=length): buffer glyph information array. + * + * Since: 0.9.2 + **/ +hb_glyph_info_t * +hb_buffer_get_glyph_infos (hb_buffer_t *buffer, + unsigned int *length) +{ + if (length) + *length = buffer->len; + + return (hb_glyph_info_t *) buffer->info; +} + +/** + * hb_buffer_get_glyph_positions: + * @buffer: a buffer. + * @length: (out): output length. + * + * Returns buffer glyph position array. Returned pointer + * is valid as long as buffer contents are not modified. + * + * Return value: (transfer none) (array length=length): buffer glyph position array. + * + * Since: 0.9.2 + **/ +hb_glyph_position_t * +hb_buffer_get_glyph_positions (hb_buffer_t *buffer, + unsigned int *length) +{ + if (!buffer->have_positions) + buffer->clear_positions (); + + if (length) + *length = buffer->len; + + return (hb_glyph_position_t *) buffer->pos; +} + +/** + * hb_buffer_reverse: + * @buffer: a buffer. + * + * Reverses buffer contents. + * + * Since: 0.9.2 + **/ +void +hb_buffer_reverse (hb_buffer_t *buffer) +{ + buffer->reverse (); +} + +/** + * hb_buffer_reverse_range: + * @buffer: a buffer. + * @start: start index. + * @end: end index. + * + * Reverses buffer contents between start to end. + * + * Since: 0.9.41 + **/ +void +hb_buffer_reverse_range (hb_buffer_t *buffer, + unsigned int start, unsigned int end) +{ + buffer->reverse_range (start, end); +} + +/** + * hb_buffer_reverse_clusters: + * @buffer: a buffer. + * + * Reverses buffer clusters. That is, the buffer contents are + * reversed, then each cluster (consecutive items having the + * same cluster number) are reversed again. + * + * Since: 0.9.2 + **/ +void +hb_buffer_reverse_clusters (hb_buffer_t *buffer) +{ + buffer->reverse_clusters (); +} + +/** + * hb_buffer_guess_segment_properties: + * @buffer: a buffer. + * + * Sets unset buffer segment properties based on buffer Unicode + * contents. If buffer is not empty, it must have content type + * %HB_BUFFER_CONTENT_TYPE_UNICODE. + * + * If buffer script is not set (ie. is %HB_SCRIPT_INVALID), it + * will be set to the Unicode script of the first character in + * the buffer that has a script other than %HB_SCRIPT_COMMON, + * %HB_SCRIPT_INHERITED, and %HB_SCRIPT_UNKNOWN. + * + * Next, if buffer direction is not set (ie. is %HB_DIRECTION_INVALID), + * it will be set to the natural horizontal direction of the + * buffer script as returned by hb_script_get_horizontal_direction(). + * + * Finally, if buffer language is not set (ie. is %HB_LANGUAGE_INVALID), + * it will be set to the process's default language as returned by + * hb_language_get_default(). This may change in the future by + * taking buffer script into consideration when choosing a language. + * + * Since: 0.9.7 + **/ +void +hb_buffer_guess_segment_properties (hb_buffer_t *buffer) +{ + buffer->guess_segment_properties (); +} + +template +static inline void +hb_buffer_add_utf (hb_buffer_t *buffer, + const typename utf_t::codepoint_t *text, + int text_length, + unsigned int item_offset, + int item_length) +{ + typedef typename utf_t::codepoint_t T; + const hb_codepoint_t replacement = buffer->replacement; + + assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE || + (!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID)); + + if (unlikely (hb_object_is_inert (buffer))) + return; + + if (text_length == -1) + text_length = utf_t::strlen (text); + + if (item_length == -1) + item_length = text_length - item_offset; + + buffer->ensure (buffer->len + item_length * sizeof (T) / 4); + + /* If buffer is empty and pre-context provided, install it. + * This check is written this way, to make sure people can + * provide pre-context in one add_utf() call, then provide + * text in a follow-up call. See: + * + * https://bugzilla.mozilla.org/show_bug.cgi?id=801410#c13 + */ + if (!buffer->len && item_offset > 0) + { + /* Add pre-context */ + buffer->clear_context (0); + const T *prev = text + item_offset; + const T *start = text; + while (start < prev && buffer->context_len[0] < buffer->CONTEXT_LENGTH) + { + hb_codepoint_t u; + prev = utf_t::prev (prev, start, &u, replacement); + buffer->context[0][buffer->context_len[0]++] = u; + } + } + + const T *next = text + item_offset; + const T *end = next + item_length; + while (next < end) + { + hb_codepoint_t u; + const T *old_next = next; + next = utf_t::next (next, end, &u, replacement); + buffer->add (u, old_next - (const T *) text); + } + + /* Add post-context */ + buffer->clear_context (1); + end = text + text_length; + while (next < end && buffer->context_len[1] < buffer->CONTEXT_LENGTH) + { + hb_codepoint_t u; + next = utf_t::next (next, end, &u, replacement); + buffer->context[1][buffer->context_len[1]++] = u; + } + + buffer->content_type = HB_BUFFER_CONTENT_TYPE_UNICODE; +} + +/** + * hb_buffer_add_utf8: + * @buffer: a buffer. + * @text: (array length=text_length) (element-type uint8_t): + * @text_length: + * @item_offset: + * @item_length: + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_add_utf8 (hb_buffer_t *buffer, + const char *text, + int text_length, + unsigned int item_offset, + int item_length) +{ + hb_buffer_add_utf (buffer, (const uint8_t *) text, text_length, item_offset, item_length); +} + +/** + * hb_buffer_add_utf16: + * @buffer: a buffer. + * @text: (array length=text_length): + * @text_length: + * @item_offset: + * @item_length: + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_add_utf16 (hb_buffer_t *buffer, + const uint16_t *text, + int text_length, + unsigned int item_offset, + int item_length) +{ + hb_buffer_add_utf (buffer, text, text_length, item_offset, item_length); +} + +/** + * hb_buffer_add_utf32: + * @buffer: a buffer. + * @text: (array length=text_length): + * @text_length: + * @item_offset: + * @item_length: + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_add_utf32 (hb_buffer_t *buffer, + const uint32_t *text, + int text_length, + unsigned int item_offset, + int item_length) +{ + hb_buffer_add_utf > (buffer, text, text_length, item_offset, item_length); +} + +/** + * hb_buffer_add_latin1: + * @buffer: a buffer. + * @text: (array length=text_length) (element-type uint8_t): + * @text_length: + * @item_offset: + * @item_length: + * + * + * + * Since: 0.9.39 + **/ +void +hb_buffer_add_latin1 (hb_buffer_t *buffer, + const uint8_t *text, + int text_length, + unsigned int item_offset, + int item_length) +{ + hb_buffer_add_utf (buffer, text, text_length, item_offset, item_length); +} + +/** + * hb_buffer_add_codepoints: + * @buffer: a buffer. + * @text: (array length=text_length): + * @text_length: + * @item_offset: + * @item_length: + * + * + * + * Since: 0.9.31 + **/ +void +hb_buffer_add_codepoints (hb_buffer_t *buffer, + const hb_codepoint_t *text, + int text_length, + unsigned int item_offset, + int item_length) +{ + hb_buffer_add_utf > (buffer, text, text_length, item_offset, item_length); +} + + +static int +compare_info_codepoint (const hb_glyph_info_t *pa, + const hb_glyph_info_t *pb) +{ + return (int) pb->codepoint - (int) pa->codepoint; +} + +static inline void +normalize_glyphs_cluster (hb_buffer_t *buffer, + unsigned int start, + unsigned int end, + bool backward) +{ + hb_glyph_position_t *pos = buffer->pos; + + /* Total cluster advance */ + hb_position_t total_x_advance = 0, total_y_advance = 0; + for (unsigned int i = start; i < end; i++) + { + total_x_advance += pos[i].x_advance; + total_y_advance += pos[i].y_advance; + } + + hb_position_t x_advance = 0, y_advance = 0; + for (unsigned int i = start; i < end; i++) + { + pos[i].x_offset += x_advance; + pos[i].y_offset += y_advance; + + x_advance += pos[i].x_advance; + y_advance += pos[i].y_advance; + + pos[i].x_advance = 0; + pos[i].y_advance = 0; + } + + if (backward) + { + /* Transfer all cluster advance to the last glyph. */ + pos[end - 1].x_advance = total_x_advance; + pos[end - 1].y_advance = total_y_advance; + + hb_stable_sort (buffer->info + start, end - start - 1, compare_info_codepoint, buffer->pos + start); + } else { + /* Transfer all cluster advance to the first glyph. */ + pos[start].x_advance += total_x_advance; + pos[start].y_advance += total_y_advance; + for (unsigned int i = start + 1; i < end; i++) { + pos[i].x_offset -= total_x_advance; + pos[i].y_offset -= total_y_advance; + } + hb_stable_sort (buffer->info + start + 1, end - start - 1, compare_info_codepoint, buffer->pos + start + 1); + } +} + +/** + * hb_buffer_normalize_glyphs: + * @buffer: a buffer. + * + * + * + * Since: 0.9.2 + **/ +void +hb_buffer_normalize_glyphs (hb_buffer_t *buffer) +{ + assert (buffer->have_positions); + assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS); + + bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction); + + unsigned int count = buffer->len; + if (unlikely (!count)) return; + hb_glyph_info_t *info = buffer->info; + + unsigned int start = 0; + unsigned int end; + for (end = start + 1; end < count; end++) + if (info[start].cluster != info[end].cluster) { + normalize_glyphs_cluster (buffer, start, end, backward); + start = end; + } + normalize_glyphs_cluster (buffer, start, end, backward); +} + +void +hb_buffer_t::sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *)) +{ + assert (!have_positions); + for (unsigned int i = start + 1; i < end; i++) + { + unsigned int j = i; + while (j > start && compar (&info[j - 1], &info[i]) > 0) + j--; + if (i == j) + continue; + /* Move item i to occupy place for item j, shift what's in between. */ + merge_clusters (j, i + 1); + { + hb_glyph_info_t t = info[i]; + memmove (&info[j + 1], &info[j], (i - j) * sizeof (hb_glyph_info_t)); + info[j] = t; + } + } +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-buffer.h b/3rdparty/harfbuzz-1.0.6/hb-buffer.h new file mode 100644 index 0000000000..bb89dc3de7 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-buffer.h @@ -0,0 +1,378 @@ +/* + * Copyright © 1998-2004 David Turner and Werner Lemberg + * Copyright © 2004,2007,2009 Red Hat, Inc. + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Owen Taylor, Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_H_IN +#error "Include instead." +#endif + +#ifndef HB_BUFFER_H +#define HB_BUFFER_H + +#include "hb-common.h" +#include "hb-unicode.h" +#include "hb-font.h" + +HB_BEGIN_DECLS + + +typedef struct hb_glyph_info_t { + hb_codepoint_t codepoint; + hb_mask_t mask; + uint32_t cluster; + + /*< private >*/ + hb_var_int_t var1; + hb_var_int_t var2; +} hb_glyph_info_t; + +typedef struct hb_glyph_position_t { + hb_position_t x_advance; + hb_position_t y_advance; + hb_position_t x_offset; + hb_position_t y_offset; + + /*< private >*/ + hb_var_int_t var; +} hb_glyph_position_t; + + +typedef struct hb_segment_properties_t { + hb_direction_t direction; + hb_script_t script; + hb_language_t language; + /*< private >*/ + void *reserved1; + void *reserved2; +} hb_segment_properties_t; + +#define HB_SEGMENT_PROPERTIES_DEFAULT {HB_DIRECTION_INVALID, \ + HB_SCRIPT_INVALID, \ + HB_LANGUAGE_INVALID, \ + NULL, \ + NULL} + +hb_bool_t +hb_segment_properties_equal (const hb_segment_properties_t *a, + const hb_segment_properties_t *b); + +unsigned int +hb_segment_properties_hash (const hb_segment_properties_t *p); + + + +/* + * hb_buffer_t + */ + +typedef struct hb_buffer_t hb_buffer_t; + +hb_buffer_t * +hb_buffer_create (void); + +hb_buffer_t * +hb_buffer_get_empty (void); + +hb_buffer_t * +hb_buffer_reference (hb_buffer_t *buffer); + +void +hb_buffer_destroy (hb_buffer_t *buffer); + +hb_bool_t +hb_buffer_set_user_data (hb_buffer_t *buffer, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace); + +void * +hb_buffer_get_user_data (hb_buffer_t *buffer, + hb_user_data_key_t *key); + + +typedef enum { + HB_BUFFER_CONTENT_TYPE_INVALID = 0, + HB_BUFFER_CONTENT_TYPE_UNICODE, + HB_BUFFER_CONTENT_TYPE_GLYPHS +} hb_buffer_content_type_t; + +void +hb_buffer_set_content_type (hb_buffer_t *buffer, + hb_buffer_content_type_t content_type); + +hb_buffer_content_type_t +hb_buffer_get_content_type (hb_buffer_t *buffer); + + +void +hb_buffer_set_unicode_funcs (hb_buffer_t *buffer, + hb_unicode_funcs_t *unicode_funcs); + +hb_unicode_funcs_t * +hb_buffer_get_unicode_funcs (hb_buffer_t *buffer); + +void +hb_buffer_set_direction (hb_buffer_t *buffer, + hb_direction_t direction); + +hb_direction_t +hb_buffer_get_direction (hb_buffer_t *buffer); + +void +hb_buffer_set_script (hb_buffer_t *buffer, + hb_script_t script); + +hb_script_t +hb_buffer_get_script (hb_buffer_t *buffer); + +void +hb_buffer_set_language (hb_buffer_t *buffer, + hb_language_t language); + + +hb_language_t +hb_buffer_get_language (hb_buffer_t *buffer); + +void +hb_buffer_set_segment_properties (hb_buffer_t *buffer, + const hb_segment_properties_t *props); + +void +hb_buffer_get_segment_properties (hb_buffer_t *buffer, + hb_segment_properties_t *props); + +void +hb_buffer_guess_segment_properties (hb_buffer_t *buffer); + + +/* + * Since: 0.9.20 + */ +typedef enum { /*< flags >*/ + HB_BUFFER_FLAG_DEFAULT = 0x00000000u, + HB_BUFFER_FLAG_BOT = 0x00000001u, /* Beginning-of-text */ + HB_BUFFER_FLAG_EOT = 0x00000002u, /* End-of-text */ + HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES = 0x00000004u +} hb_buffer_flags_t; + +void +hb_buffer_set_flags (hb_buffer_t *buffer, + hb_buffer_flags_t flags); + +hb_buffer_flags_t +hb_buffer_get_flags (hb_buffer_t *buffer); + +/* + * Since: 0.9.42 + */ +typedef enum { + HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES = 0, + HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS = 1, + HB_BUFFER_CLUSTER_LEVEL_CHARACTERS = 2, + HB_BUFFER_CLUSTER_LEVEL_DEFAULT = HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES +} hb_buffer_cluster_level_t; + +void +hb_buffer_set_cluster_level (hb_buffer_t *buffer, + hb_buffer_cluster_level_t cluster_level); + +hb_buffer_cluster_level_t +hb_buffer_get_cluster_level (hb_buffer_t *buffer); + +#define HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT 0xFFFDu + +/* Sets codepoint used to replace invalid UTF-8/16/32 entries. + * Default is 0xFFFDu. */ +void +hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer, + hb_codepoint_t replacement); + +hb_codepoint_t +hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer); + + +/* Resets the buffer. Afterwards it's as if it was just created, + * except that it has a larger buffer allocated perhaps... */ +void +hb_buffer_reset (hb_buffer_t *buffer); + +/* Like reset, but does NOT clear unicode_funcs and replacement_codepoint. */ +void +hb_buffer_clear_contents (hb_buffer_t *buffer); + +/* Returns false if allocation failed */ +hb_bool_t +hb_buffer_pre_allocate (hb_buffer_t *buffer, + unsigned int size); + + +/* Returns false if allocation has failed before */ +hb_bool_t +hb_buffer_allocation_successful (hb_buffer_t *buffer); + +void +hb_buffer_reverse (hb_buffer_t *buffer); + +void +hb_buffer_reverse_range (hb_buffer_t *buffer, + unsigned int start, unsigned int end); + +void +hb_buffer_reverse_clusters (hb_buffer_t *buffer); + + +/* Filling the buffer in */ + +void +hb_buffer_add (hb_buffer_t *buffer, + hb_codepoint_t codepoint, + unsigned int cluster); + +void +hb_buffer_add_utf8 (hb_buffer_t *buffer, + const char *text, + int text_length, + unsigned int item_offset, + int item_length); + +void +hb_buffer_add_utf16 (hb_buffer_t *buffer, + const uint16_t *text, + int text_length, + unsigned int item_offset, + int item_length); + +void +hb_buffer_add_utf32 (hb_buffer_t *buffer, + const uint32_t *text, + int text_length, + unsigned int item_offset, + int item_length); + +/* Allows only access to first 256 Unicode codepoints. */ +void +hb_buffer_add_latin1 (hb_buffer_t *buffer, + const uint8_t *text, + int text_length, + unsigned int item_offset, + int item_length); + +/* Like add_utf32 but does NOT check for invalid Unicode codepoints. */ +void +hb_buffer_add_codepoints (hb_buffer_t *buffer, + const hb_codepoint_t *text, + int text_length, + unsigned int item_offset, + int item_length); + + +/* Clears any new items added at the end */ +hb_bool_t +hb_buffer_set_length (hb_buffer_t *buffer, + unsigned int length); + +/* Return value valid as long as buffer not modified */ +unsigned int +hb_buffer_get_length (hb_buffer_t *buffer); + +/* Getting glyphs out of the buffer */ + +/* Return value valid as long as buffer not modified */ +hb_glyph_info_t * +hb_buffer_get_glyph_infos (hb_buffer_t *buffer, + unsigned int *length); + +/* Return value valid as long as buffer not modified */ +hb_glyph_position_t * +hb_buffer_get_glyph_positions (hb_buffer_t *buffer, + unsigned int *length); + + +/* Reorders a glyph buffer to have canonical in-cluster glyph order / position. + * The resulting clusters should behave identical to pre-reordering clusters. + * NOTE: This has nothing to do with Unicode normalization. */ +void +hb_buffer_normalize_glyphs (hb_buffer_t *buffer); + + +/* + * Serialize + */ + +/* + * Since: 0.9.20 + */ +typedef enum { /*< flags >*/ + HB_BUFFER_SERIALIZE_FLAG_DEFAULT = 0x00000000u, + HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS = 0x00000001u, + HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS = 0x00000002u, + HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES = 0x00000004u, + HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS = 0x00000008u +} hb_buffer_serialize_flags_t; + +typedef enum { + HB_BUFFER_SERIALIZE_FORMAT_TEXT = HB_TAG('T','E','X','T'), + HB_BUFFER_SERIALIZE_FORMAT_JSON = HB_TAG('J','S','O','N'), + HB_BUFFER_SERIALIZE_FORMAT_INVALID = HB_TAG_NONE +} hb_buffer_serialize_format_t; + +/* len=-1 means str is NUL-terminated. */ +hb_buffer_serialize_format_t +hb_buffer_serialize_format_from_string (const char *str, int len); + +const char * +hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format); + +const char ** +hb_buffer_serialize_list_formats (void); + +/* Returns number of items, starting at start, that were serialized. */ +unsigned int +hb_buffer_serialize_glyphs (hb_buffer_t *buffer, + unsigned int start, + unsigned int end, + char *buf, + unsigned int buf_size, + unsigned int *buf_consumed, /* May be NULL */ + hb_font_t *font, /* May be NULL */ + hb_buffer_serialize_format_t format, + hb_buffer_serialize_flags_t flags); + +hb_bool_t +hb_buffer_deserialize_glyphs (hb_buffer_t *buffer, + const char *buf, + int buf_len, /* -1 means nul-terminated */ + const char **end_ptr, /* May be NULL */ + hb_font_t *font, /* May be NULL */ + hb_buffer_serialize_format_t format); + + +HB_END_DECLS + +#endif /* HB_BUFFER_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-cache-private.hh b/3rdparty/harfbuzz-1.0.6/hb-cache-private.hh new file mode 100644 index 0000000000..19b70b7e39 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-cache-private.hh @@ -0,0 +1,74 @@ +/* + * Copyright © 2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_CACHE_PRIVATE_HH +#define HB_CACHE_PRIVATE_HH + +#include "hb-private.hh" + + +/* Implements a lock-free cache for int->int functions. */ + +template +struct hb_cache_t +{ + ASSERT_STATIC (key_bits >= cache_bits); + ASSERT_STATIC (key_bits + value_bits - cache_bits < 8 * sizeof (unsigned int)); + + inline void clear (void) + { + memset (values, 255, sizeof (values)); + } + + inline bool get (unsigned int key, unsigned int *value) + { + unsigned int k = key & ((1<> value_bits) != (key >> cache_bits)) + return false; + *value = v & ((1<> key_bits) || (value >> value_bits))) + return false; /* Overflows */ + unsigned int k = key & ((1<>cache_bits)< hb_cmap_cache_t; +typedef hb_cache_t<16, 24, 8> hb_advance_cache_t; + + +#endif /* HB_CACHE_PRIVATE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-common.cc b/3rdparty/harfbuzz-1.0.6/hb-common.cc new file mode 100644 index 0000000000..e67059d10b --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-common.cc @@ -0,0 +1,593 @@ +/* + * Copyright © 2009,2010 Red Hat, Inc. + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-private.hh" + +#include "hb-mutex-private.hh" +#include "hb-object-private.hh" + +#include + + +/* hb_options_t */ + +hb_options_union_t _hb_options; + +void +_hb_options_init (void) +{ + hb_options_union_t u; + u.i = 0; + u.opts.initialized = 1; + + char *c = getenv ("HB_OPTIONS"); + u.opts.uniscribe_bug_compatible = c && strstr (c, "uniscribe-bug-compatible"); + + /* This is idempotent and threadsafe. */ + _hb_options = u; +} + + +/* hb_tag_t */ + +/** + * hb_tag_from_string: + * @str: (array length=len) (element-type uint8_t): + * @len: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_tag_t +hb_tag_from_string (const char *str, int len) +{ + char tag[4]; + unsigned int i; + + if (!str || !len || !*str) + return HB_TAG_NONE; + + if (len < 0 || len > 4) + len = 4; + for (i = 0; i < (unsigned) len && str[i]; i++) + tag[i] = str[i]; + for (; i < 4; i++) + tag[i] = ' '; + + return HB_TAG_CHAR4 (tag); +} + +/** + * hb_tag_to_string: + * @tag: + * @buf: (array fixed-size=4): + * + * + * + * Since: 0.9.5 + **/ +void +hb_tag_to_string (hb_tag_t tag, char *buf) +{ + buf[0] = (char) (uint8_t) (tag >> 24); + buf[1] = (char) (uint8_t) (tag >> 16); + buf[2] = (char) (uint8_t) (tag >> 8); + buf[3] = (char) (uint8_t) (tag >> 0); +} + + +/* hb_direction_t */ + +const char direction_strings[][4] = { + "ltr", + "rtl", + "ttb", + "btt" +}; + +/** + * hb_direction_from_string: + * @str: (array length=len) (element-type uint8_t): + * @len: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_direction_t +hb_direction_from_string (const char *str, int len) +{ + if (unlikely (!str || !len || !*str)) + return HB_DIRECTION_INVALID; + + /* Lets match loosely: just match the first letter, such that + * all of "ltr", "left-to-right", etc work! + */ + char c = TOLOWER (str[0]); + for (unsigned int i = 0; i < ARRAY_LENGTH (direction_strings); i++) + if (c == direction_strings[i][0]) + return (hb_direction_t) (HB_DIRECTION_LTR + i); + + return HB_DIRECTION_INVALID; +} + +/** + * hb_direction_to_string: + * @direction: + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +const char * +hb_direction_to_string (hb_direction_t direction) +{ + if (likely ((unsigned int) (direction - HB_DIRECTION_LTR) + < ARRAY_LENGTH (direction_strings))) + return direction_strings[direction - HB_DIRECTION_LTR]; + + return "invalid"; +} + + +/* hb_language_t */ + +struct hb_language_impl_t { + const char s[1]; +}; + +static const char canon_map[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', 0, 0, + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 0, 0, 0, 0, 0, 0, + '-', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, '-', + 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, 0 +}; + +static bool +lang_equal (hb_language_t v1, + const void *v2) +{ + const unsigned char *p1 = (const unsigned char *) v1; + const unsigned char *p2 = (const unsigned char *) v2; + + while (*p1 && *p1 == canon_map[*p2]) + p1++, p2++; + + return *p1 == canon_map[*p2]; +} + +#if 0 +static unsigned int +lang_hash (const void *key) +{ + const unsigned char *p = key; + unsigned int h = 0; + while (canon_map[*p]) + { + h = (h << 5) - h + canon_map[*p]; + p++; + } + + return h; +} +#endif + + +struct hb_language_item_t { + + struct hb_language_item_t *next; + hb_language_t lang; + + inline bool operator == (const char *s) const { + return lang_equal (lang, s); + } + + inline hb_language_item_t & operator = (const char *s) { + lang = (hb_language_t) strdup (s); + for (unsigned char *p = (unsigned char *) lang; *p; p++) + *p = canon_map[*p]; + + return *this; + } + + void finish (void) { free ((void *) lang); } +}; + + +/* Thread-safe lock-free language list */ + +static hb_language_item_t *langs; + +#ifdef HB_USE_ATEXIT +static +void free_langs (void) +{ + while (langs) { + hb_language_item_t *next = langs->next; + langs->finish (); + free (langs); + langs = next; + } +} +#endif + +static hb_language_item_t * +lang_find_or_insert (const char *key) +{ +retry: + hb_language_item_t *first_lang = (hb_language_item_t *) hb_atomic_ptr_get (&langs); + + for (hb_language_item_t *lang = first_lang; lang; lang = lang->next) + if (*lang == key) + return lang; + + /* Not found; allocate one. */ + hb_language_item_t *lang = (hb_language_item_t *) calloc (1, sizeof (hb_language_item_t)); + if (unlikely (!lang)) + return NULL; + lang->next = first_lang; + *lang = key; + + if (!hb_atomic_ptr_cmpexch (&langs, first_lang, lang)) { + lang->finish (); + free (lang); + goto retry; + } + +#ifdef HB_USE_ATEXIT + if (!first_lang) + atexit (free_langs); /* First person registers atexit() callback. */ +#endif + + return lang; +} + + +/** + * hb_language_from_string: + * @str: (array length=len) (element-type uint8_t): + * @len: + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +hb_language_t +hb_language_from_string (const char *str, int len) +{ + if (!str || !len || !*str) + return HB_LANGUAGE_INVALID; + + hb_language_item_t *item = NULL; + if (len >= 0) + { + /* NUL-terminate it. */ + char strbuf[64]; + len = MIN (len, (int) sizeof (strbuf) - 1); + memcpy (strbuf, str, len); + strbuf[len] = '\0'; + item = lang_find_or_insert (strbuf); + } + else + item = lang_find_or_insert (str); + + return likely (item) ? item->lang : HB_LANGUAGE_INVALID; +} + +/** + * hb_language_to_string: + * @language: + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +const char * +hb_language_to_string (hb_language_t language) +{ + /* This is actually NULL-safe! */ + return language->s; +} + +/** + * hb_language_get_default: + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +hb_language_t +hb_language_get_default (void) +{ + static hb_language_t default_language = HB_LANGUAGE_INVALID; + + hb_language_t language = (hb_language_t) hb_atomic_ptr_get (&default_language); + if (unlikely (language == HB_LANGUAGE_INVALID)) { + language = hb_language_from_string (setlocale (LC_CTYPE, NULL), -1); + (void) hb_atomic_ptr_cmpexch (&default_language, HB_LANGUAGE_INVALID, language); + } + + return default_language; +} + + +/* hb_script_t */ + +/** + * hb_script_from_iso15924_tag: + * @tag: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_script_t +hb_script_from_iso15924_tag (hb_tag_t tag) +{ + if (unlikely (tag == HB_TAG_NONE)) + return HB_SCRIPT_INVALID; + + /* Be lenient, adjust case (one capital letter followed by three small letters) */ + tag = (tag & 0xDFDFDFDFu) | 0x00202020u; + + switch (tag) { + + /* These graduated from the 'Q' private-area codes, but + * the old code is still aliased by Unicode, and the Qaai + * one in use by ICU. */ + case HB_TAG('Q','a','a','i'): return HB_SCRIPT_INHERITED; + case HB_TAG('Q','a','a','c'): return HB_SCRIPT_COPTIC; + + /* Script variants from http://unicode.org/iso15924/ */ + case HB_TAG('C','y','r','s'): return HB_SCRIPT_CYRILLIC; + case HB_TAG('L','a','t','f'): return HB_SCRIPT_LATIN; + case HB_TAG('L','a','t','g'): return HB_SCRIPT_LATIN; + case HB_TAG('S','y','r','e'): return HB_SCRIPT_SYRIAC; + case HB_TAG('S','y','r','j'): return HB_SCRIPT_SYRIAC; + case HB_TAG('S','y','r','n'): return HB_SCRIPT_SYRIAC; + } + + /* If it looks right, just use the tag as a script */ + if (((uint32_t) tag & 0xE0E0E0E0u) == 0x40606060u) + return (hb_script_t) tag; + + /* Otherwise, return unknown */ + return HB_SCRIPT_UNKNOWN; +} + +/** + * hb_script_from_string: + * @s: (array length=len) (element-type uint8_t): + * @len: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_script_t +hb_script_from_string (const char *s, int len) +{ + return hb_script_from_iso15924_tag (hb_tag_from_string (s, len)); +} + +/** + * hb_script_to_iso15924_tag: + * @script: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_tag_t +hb_script_to_iso15924_tag (hb_script_t script) +{ + return (hb_tag_t) script; +} + +/** + * hb_script_get_horizontal_direction: + * @script: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_direction_t +hb_script_get_horizontal_direction (hb_script_t script) +{ + /* http://goo.gl/x9ilM */ + switch ((hb_tag_t) script) + { + /* Unicode-1.1 additions */ + case HB_SCRIPT_ARABIC: + case HB_SCRIPT_HEBREW: + + /* Unicode-3.0 additions */ + case HB_SCRIPT_SYRIAC: + case HB_SCRIPT_THAANA: + + /* Unicode-4.0 additions */ + case HB_SCRIPT_CYPRIOT: + + /* Unicode-4.1 additions */ + case HB_SCRIPT_KHAROSHTHI: + + /* Unicode-5.0 additions */ + case HB_SCRIPT_PHOENICIAN: + case HB_SCRIPT_NKO: + + /* Unicode-5.1 additions */ + case HB_SCRIPT_LYDIAN: + + /* Unicode-5.2 additions */ + case HB_SCRIPT_AVESTAN: + case HB_SCRIPT_IMPERIAL_ARAMAIC: + case HB_SCRIPT_INSCRIPTIONAL_PAHLAVI: + case HB_SCRIPT_INSCRIPTIONAL_PARTHIAN: + case HB_SCRIPT_OLD_SOUTH_ARABIAN: + case HB_SCRIPT_OLD_TURKIC: + case HB_SCRIPT_SAMARITAN: + + /* Unicode-6.0 additions */ + case HB_SCRIPT_MANDAIC: + + /* Unicode-6.1 additions */ + case HB_SCRIPT_MEROITIC_CURSIVE: + case HB_SCRIPT_MEROITIC_HIEROGLYPHS: + + /* Unicode-7.0 additions */ + case HB_SCRIPT_MANICHAEAN: + case HB_SCRIPT_MENDE_KIKAKUI: + case HB_SCRIPT_NABATAEAN: + case HB_SCRIPT_OLD_NORTH_ARABIAN: + case HB_SCRIPT_PALMYRENE: + case HB_SCRIPT_PSALTER_PAHLAVI: + + /* Unicode-8.0 additions */ + case HB_SCRIPT_OLD_HUNGARIAN: + + return HB_DIRECTION_RTL; + } + + return HB_DIRECTION_LTR; +} + + +/* hb_user_data_array_t */ + +bool +hb_user_data_array_t::set (hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + if (!key) + return false; + + if (replace) { + if (!data && !destroy) { + items.remove (key, lock); + return true; + } + } + hb_user_data_item_t item = {key, data, destroy}; + bool ret = !!items.replace_or_insert (item, lock, replace); + + return ret; +} + +void * +hb_user_data_array_t::get (hb_user_data_key_t *key) +{ + hb_user_data_item_t item = {NULL }; + + return items.find (key, &item, lock) ? item.data : NULL; +} + + +/* hb_version */ + +/** + * hb_version: + * @major: (out): Library major version component. + * @minor: (out): Library minor version component. + * @micro: (out): Library micro version component. + * + * Returns library version as three integer components. + * + * Since: 0.9.2 + **/ +void +hb_version (unsigned int *major, + unsigned int *minor, + unsigned int *micro) +{ + *major = HB_VERSION_MAJOR; + *minor = HB_VERSION_MINOR; + *micro = HB_VERSION_MICRO; +} + +/** + * hb_version_string: + * + * Returns library version as a string with three components. + * + * Return value: library version string. + * + * Since: 0.9.2 + **/ +const char * +hb_version_string (void) +{ + return HB_VERSION_STRING; +} + +/** + * hb_version_atleast: + * @major: + * @minor: + * @micro: + * + * + * + * Return value: + * + * Since: 0.9.30 + **/ +hb_bool_t +hb_version_atleast (unsigned int major, + unsigned int minor, + unsigned int micro) +{ + return HB_VERSION_ATLEAST (major, minor, micro); +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-common.h b/3rdparty/harfbuzz-1.0.6/hb-common.h new file mode 100644 index 0000000000..c291dbbe94 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-common.h @@ -0,0 +1,354 @@ +/* + * Copyright © 2007,2008,2009 Red Hat, Inc. + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_H_IN +#error "Include instead." +#endif + +#ifndef HB_COMMON_H +#define HB_COMMON_H + +#ifndef HB_BEGIN_DECLS +# ifdef __cplusplus +# define HB_BEGIN_DECLS extern "C" { +# define HB_END_DECLS } +# else /* !__cplusplus */ +# define HB_BEGIN_DECLS +# define HB_END_DECLS +# endif /* !__cplusplus */ +#endif + +#if !defined (HB_DONT_DEFINE_STDINT) + +#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \ + defined (_sgi) || defined (__sun) || defined (sun) || \ + defined (__digital__) || defined (__HP_cc) +# include +#elif defined (_AIX) +# include +/* VS 2010 (_MSC_VER 1600) has stdint.h */ +#elif defined (_MSC_VER) && _MSC_VER < 1600 +typedef __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +# include +#endif + +#endif + +HB_BEGIN_DECLS + + +typedef int hb_bool_t; + +typedef uint32_t hb_codepoint_t; +typedef int32_t hb_position_t; +typedef uint32_t hb_mask_t; + +typedef union _hb_var_int_t { + uint32_t u32; + int32_t i32; + uint16_t u16[2]; + int16_t i16[2]; + uint8_t u8[4]; + int8_t i8[4]; +} hb_var_int_t; + + +/* hb_tag_t */ + +typedef uint32_t hb_tag_t; + +#define HB_TAG(c1,c2,c3,c4) ((hb_tag_t)((((uint8_t)(c1))<<24)|(((uint8_t)(c2))<<16)|(((uint8_t)(c3))<<8)|((uint8_t)(c4)))) +#define HB_UNTAG(tag) ((uint8_t)((tag)>>24)), ((uint8_t)((tag)>>16)), ((uint8_t)((tag)>>8)), ((uint8_t)(tag)) + +#define HB_TAG_NONE HB_TAG(0,0,0,0) +#define HB_TAG_MAX HB_TAG(0xff,0xff,0xff,0xff) +#define HB_TAG_MAX_SIGNED HB_TAG(0x7f,0xff,0xff,0xff) + +/* len=-1 means str is NUL-terminated. */ +hb_tag_t +hb_tag_from_string (const char *str, int len); + +/* buf should have 4 bytes. */ +void +hb_tag_to_string (hb_tag_t tag, char *buf); + + +/* hb_direction_t */ + +typedef enum { + HB_DIRECTION_INVALID = 0, + HB_DIRECTION_LTR = 4, + HB_DIRECTION_RTL, + HB_DIRECTION_TTB, + HB_DIRECTION_BTT +} hb_direction_t; + +/* len=-1 means str is NUL-terminated */ +hb_direction_t +hb_direction_from_string (const char *str, int len); + +const char * +hb_direction_to_string (hb_direction_t direction); + +#define HB_DIRECTION_IS_VALID(dir) ((((unsigned int) (dir)) & ~3U) == 4) +/* Direction must be valid for the following */ +#define HB_DIRECTION_IS_HORIZONTAL(dir) ((((unsigned int) (dir)) & ~1U) == 4) +#define HB_DIRECTION_IS_VERTICAL(dir) ((((unsigned int) (dir)) & ~1U) == 6) +#define HB_DIRECTION_IS_FORWARD(dir) ((((unsigned int) (dir)) & ~2U) == 4) +#define HB_DIRECTION_IS_BACKWARD(dir) ((((unsigned int) (dir)) & ~2U) == 5) +#define HB_DIRECTION_REVERSE(dir) ((hb_direction_t) (((unsigned int) (dir)) ^ 1)) + + +/* hb_language_t */ + +typedef const struct hb_language_impl_t *hb_language_t; + +/* len=-1 means str is NUL-terminated */ +hb_language_t +hb_language_from_string (const char *str, int len); + +const char * +hb_language_to_string (hb_language_t language); + +#define HB_LANGUAGE_INVALID ((hb_language_t) NULL) + +hb_language_t +hb_language_get_default (void); + + +/* hb_script_t */ + +/* http://unicode.org/iso15924/ */ +/* http://goo.gl/x9ilM */ +/* Unicode Character Database property: Script (sc) */ +typedef enum +{ + /*1.1*/ HB_SCRIPT_COMMON = HB_TAG ('Z','y','y','y'), + /*1.1*/ HB_SCRIPT_INHERITED = HB_TAG ('Z','i','n','h'), + /*5.0*/ HB_SCRIPT_UNKNOWN = HB_TAG ('Z','z','z','z'), + + /*1.1*/ HB_SCRIPT_ARABIC = HB_TAG ('A','r','a','b'), + /*1.1*/ HB_SCRIPT_ARMENIAN = HB_TAG ('A','r','m','n'), + /*1.1*/ HB_SCRIPT_BENGALI = HB_TAG ('B','e','n','g'), + /*1.1*/ HB_SCRIPT_CYRILLIC = HB_TAG ('C','y','r','l'), + /*1.1*/ HB_SCRIPT_DEVANAGARI = HB_TAG ('D','e','v','a'), + /*1.1*/ HB_SCRIPT_GEORGIAN = HB_TAG ('G','e','o','r'), + /*1.1*/ HB_SCRIPT_GREEK = HB_TAG ('G','r','e','k'), + /*1.1*/ HB_SCRIPT_GUJARATI = HB_TAG ('G','u','j','r'), + /*1.1*/ HB_SCRIPT_GURMUKHI = HB_TAG ('G','u','r','u'), + /*1.1*/ HB_SCRIPT_HANGUL = HB_TAG ('H','a','n','g'), + /*1.1*/ HB_SCRIPT_HAN = HB_TAG ('H','a','n','i'), + /*1.1*/ HB_SCRIPT_HEBREW = HB_TAG ('H','e','b','r'), + /*1.1*/ HB_SCRIPT_HIRAGANA = HB_TAG ('H','i','r','a'), + /*1.1*/ HB_SCRIPT_KANNADA = HB_TAG ('K','n','d','a'), + /*1.1*/ HB_SCRIPT_KATAKANA = HB_TAG ('K','a','n','a'), + /*1.1*/ HB_SCRIPT_LAO = HB_TAG ('L','a','o','o'), + /*1.1*/ HB_SCRIPT_LATIN = HB_TAG ('L','a','t','n'), + /*1.1*/ HB_SCRIPT_MALAYALAM = HB_TAG ('M','l','y','m'), + /*1.1*/ HB_SCRIPT_ORIYA = HB_TAG ('O','r','y','a'), + /*1.1*/ HB_SCRIPT_TAMIL = HB_TAG ('T','a','m','l'), + /*1.1*/ HB_SCRIPT_TELUGU = HB_TAG ('T','e','l','u'), + /*1.1*/ HB_SCRIPT_THAI = HB_TAG ('T','h','a','i'), + + /*2.0*/ HB_SCRIPT_TIBETAN = HB_TAG ('T','i','b','t'), + + /*3.0*/ HB_SCRIPT_BOPOMOFO = HB_TAG ('B','o','p','o'), + /*3.0*/ HB_SCRIPT_BRAILLE = HB_TAG ('B','r','a','i'), + /*3.0*/ HB_SCRIPT_CANADIAN_SYLLABICS = HB_TAG ('C','a','n','s'), + /*3.0*/ HB_SCRIPT_CHEROKEE = HB_TAG ('C','h','e','r'), + /*3.0*/ HB_SCRIPT_ETHIOPIC = HB_TAG ('E','t','h','i'), + /*3.0*/ HB_SCRIPT_KHMER = HB_TAG ('K','h','m','r'), + /*3.0*/ HB_SCRIPT_MONGOLIAN = HB_TAG ('M','o','n','g'), + /*3.0*/ HB_SCRIPT_MYANMAR = HB_TAG ('M','y','m','r'), + /*3.0*/ HB_SCRIPT_OGHAM = HB_TAG ('O','g','a','m'), + /*3.0*/ HB_SCRIPT_RUNIC = HB_TAG ('R','u','n','r'), + /*3.0*/ HB_SCRIPT_SINHALA = HB_TAG ('S','i','n','h'), + /*3.0*/ HB_SCRIPT_SYRIAC = HB_TAG ('S','y','r','c'), + /*3.0*/ HB_SCRIPT_THAANA = HB_TAG ('T','h','a','a'), + /*3.0*/ HB_SCRIPT_YI = HB_TAG ('Y','i','i','i'), + + /*3.1*/ HB_SCRIPT_DESERET = HB_TAG ('D','s','r','t'), + /*3.1*/ HB_SCRIPT_GOTHIC = HB_TAG ('G','o','t','h'), + /*3.1*/ HB_SCRIPT_OLD_ITALIC = HB_TAG ('I','t','a','l'), + + /*3.2*/ HB_SCRIPT_BUHID = HB_TAG ('B','u','h','d'), + /*3.2*/ HB_SCRIPT_HANUNOO = HB_TAG ('H','a','n','o'), + /*3.2*/ HB_SCRIPT_TAGALOG = HB_TAG ('T','g','l','g'), + /*3.2*/ HB_SCRIPT_TAGBANWA = HB_TAG ('T','a','g','b'), + + /*4.0*/ HB_SCRIPT_CYPRIOT = HB_TAG ('C','p','r','t'), + /*4.0*/ HB_SCRIPT_LIMBU = HB_TAG ('L','i','m','b'), + /*4.0*/ HB_SCRIPT_LINEAR_B = HB_TAG ('L','i','n','b'), + /*4.0*/ HB_SCRIPT_OSMANYA = HB_TAG ('O','s','m','a'), + /*4.0*/ HB_SCRIPT_SHAVIAN = HB_TAG ('S','h','a','w'), + /*4.0*/ HB_SCRIPT_TAI_LE = HB_TAG ('T','a','l','e'), + /*4.0*/ HB_SCRIPT_UGARITIC = HB_TAG ('U','g','a','r'), + + /*4.1*/ HB_SCRIPT_BUGINESE = HB_TAG ('B','u','g','i'), + /*4.1*/ HB_SCRIPT_COPTIC = HB_TAG ('C','o','p','t'), + /*4.1*/ HB_SCRIPT_GLAGOLITIC = HB_TAG ('G','l','a','g'), + /*4.1*/ HB_SCRIPT_KHAROSHTHI = HB_TAG ('K','h','a','r'), + /*4.1*/ HB_SCRIPT_NEW_TAI_LUE = HB_TAG ('T','a','l','u'), + /*4.1*/ HB_SCRIPT_OLD_PERSIAN = HB_TAG ('X','p','e','o'), + /*4.1*/ HB_SCRIPT_SYLOTI_NAGRI = HB_TAG ('S','y','l','o'), + /*4.1*/ HB_SCRIPT_TIFINAGH = HB_TAG ('T','f','n','g'), + + /*5.0*/ HB_SCRIPT_BALINESE = HB_TAG ('B','a','l','i'), + /*5.0*/ HB_SCRIPT_CUNEIFORM = HB_TAG ('X','s','u','x'), + /*5.0*/ HB_SCRIPT_NKO = HB_TAG ('N','k','o','o'), + /*5.0*/ HB_SCRIPT_PHAGS_PA = HB_TAG ('P','h','a','g'), + /*5.0*/ HB_SCRIPT_PHOENICIAN = HB_TAG ('P','h','n','x'), + + /*5.1*/ HB_SCRIPT_CARIAN = HB_TAG ('C','a','r','i'), + /*5.1*/ HB_SCRIPT_CHAM = HB_TAG ('C','h','a','m'), + /*5.1*/ HB_SCRIPT_KAYAH_LI = HB_TAG ('K','a','l','i'), + /*5.1*/ HB_SCRIPT_LEPCHA = HB_TAG ('L','e','p','c'), + /*5.1*/ HB_SCRIPT_LYCIAN = HB_TAG ('L','y','c','i'), + /*5.1*/ HB_SCRIPT_LYDIAN = HB_TAG ('L','y','d','i'), + /*5.1*/ HB_SCRIPT_OL_CHIKI = HB_TAG ('O','l','c','k'), + /*5.1*/ HB_SCRIPT_REJANG = HB_TAG ('R','j','n','g'), + /*5.1*/ HB_SCRIPT_SAURASHTRA = HB_TAG ('S','a','u','r'), + /*5.1*/ HB_SCRIPT_SUNDANESE = HB_TAG ('S','u','n','d'), + /*5.1*/ HB_SCRIPT_VAI = HB_TAG ('V','a','i','i'), + + /*5.2*/ HB_SCRIPT_AVESTAN = HB_TAG ('A','v','s','t'), + /*5.2*/ HB_SCRIPT_BAMUM = HB_TAG ('B','a','m','u'), + /*5.2*/ HB_SCRIPT_EGYPTIAN_HIEROGLYPHS = HB_TAG ('E','g','y','p'), + /*5.2*/ HB_SCRIPT_IMPERIAL_ARAMAIC = HB_TAG ('A','r','m','i'), + /*5.2*/ HB_SCRIPT_INSCRIPTIONAL_PAHLAVI = HB_TAG ('P','h','l','i'), + /*5.2*/ HB_SCRIPT_INSCRIPTIONAL_PARTHIAN = HB_TAG ('P','r','t','i'), + /*5.2*/ HB_SCRIPT_JAVANESE = HB_TAG ('J','a','v','a'), + /*5.2*/ HB_SCRIPT_KAITHI = HB_TAG ('K','t','h','i'), + /*5.2*/ HB_SCRIPT_LISU = HB_TAG ('L','i','s','u'), + /*5.2*/ HB_SCRIPT_MEETEI_MAYEK = HB_TAG ('M','t','e','i'), + /*5.2*/ HB_SCRIPT_OLD_SOUTH_ARABIAN = HB_TAG ('S','a','r','b'), + /*5.2*/ HB_SCRIPT_OLD_TURKIC = HB_TAG ('O','r','k','h'), + /*5.2*/ HB_SCRIPT_SAMARITAN = HB_TAG ('S','a','m','r'), + /*5.2*/ HB_SCRIPT_TAI_THAM = HB_TAG ('L','a','n','a'), + /*5.2*/ HB_SCRIPT_TAI_VIET = HB_TAG ('T','a','v','t'), + + /*6.0*/ HB_SCRIPT_BATAK = HB_TAG ('B','a','t','k'), + /*6.0*/ HB_SCRIPT_BRAHMI = HB_TAG ('B','r','a','h'), + /*6.0*/ HB_SCRIPT_MANDAIC = HB_TAG ('M','a','n','d'), + + /*6.1*/ HB_SCRIPT_CHAKMA = HB_TAG ('C','a','k','m'), + /*6.1*/ HB_SCRIPT_MEROITIC_CURSIVE = HB_TAG ('M','e','r','c'), + /*6.1*/ HB_SCRIPT_MEROITIC_HIEROGLYPHS = HB_TAG ('M','e','r','o'), + /*6.1*/ HB_SCRIPT_MIAO = HB_TAG ('P','l','r','d'), + /*6.1*/ HB_SCRIPT_SHARADA = HB_TAG ('S','h','r','d'), + /*6.1*/ HB_SCRIPT_SORA_SOMPENG = HB_TAG ('S','o','r','a'), + /*6.1*/ HB_SCRIPT_TAKRI = HB_TAG ('T','a','k','r'), + + /* + * Since: 0.9.30 + */ + /*7.0*/ HB_SCRIPT_BASSA_VAH = HB_TAG ('B','a','s','s'), + /*7.0*/ HB_SCRIPT_CAUCASIAN_ALBANIAN = HB_TAG ('A','g','h','b'), + /*7.0*/ HB_SCRIPT_DUPLOYAN = HB_TAG ('D','u','p','l'), + /*7.0*/ HB_SCRIPT_ELBASAN = HB_TAG ('E','l','b','a'), + /*7.0*/ HB_SCRIPT_GRANTHA = HB_TAG ('G','r','a','n'), + /*7.0*/ HB_SCRIPT_KHOJKI = HB_TAG ('K','h','o','j'), + /*7.0*/ HB_SCRIPT_KHUDAWADI = HB_TAG ('S','i','n','d'), + /*7.0*/ HB_SCRIPT_LINEAR_A = HB_TAG ('L','i','n','a'), + /*7.0*/ HB_SCRIPT_MAHAJANI = HB_TAG ('M','a','h','j'), + /*7.0*/ HB_SCRIPT_MANICHAEAN = HB_TAG ('M','a','n','i'), + /*7.0*/ HB_SCRIPT_MENDE_KIKAKUI = HB_TAG ('M','e','n','d'), + /*7.0*/ HB_SCRIPT_MODI = HB_TAG ('M','o','d','i'), + /*7.0*/ HB_SCRIPT_MRO = HB_TAG ('M','r','o','o'), + /*7.0*/ HB_SCRIPT_NABATAEAN = HB_TAG ('N','b','a','t'), + /*7.0*/ HB_SCRIPT_OLD_NORTH_ARABIAN = HB_TAG ('N','a','r','b'), + /*7.0*/ HB_SCRIPT_OLD_PERMIC = HB_TAG ('P','e','r','m'), + /*7.0*/ HB_SCRIPT_PAHAWH_HMONG = HB_TAG ('H','m','n','g'), + /*7.0*/ HB_SCRIPT_PALMYRENE = HB_TAG ('P','a','l','m'), + /*7.0*/ HB_SCRIPT_PAU_CIN_HAU = HB_TAG ('P','a','u','c'), + /*7.0*/ HB_SCRIPT_PSALTER_PAHLAVI = HB_TAG ('P','h','l','p'), + /*7.0*/ HB_SCRIPT_SIDDHAM = HB_TAG ('S','i','d','d'), + /*7.0*/ HB_SCRIPT_TIRHUTA = HB_TAG ('T','i','r','h'), + /*7.0*/ HB_SCRIPT_WARANG_CITI = HB_TAG ('W','a','r','a'), + + /*8.0*/ HB_SCRIPT_AHOM = HB_TAG ('A','h','o','m'), + /*8.0*/ HB_SCRIPT_ANATOLIAN_HIEROGLYPHS = HB_TAG ('H','l','u','w'), + /*8.0*/ HB_SCRIPT_HATRAN = HB_TAG ('H','a','t','r'), + /*8.0*/ HB_SCRIPT_MULTANI = HB_TAG ('M','u','l','t'), + /*8.0*/ HB_SCRIPT_OLD_HUNGARIAN = HB_TAG ('H','u','n','g'), + /*8.0*/ HB_SCRIPT_SIGNWRITING = HB_TAG ('S','g','n','w'), + + /* No script set. */ + HB_SCRIPT_INVALID = HB_TAG_NONE, + + /* Dummy values to ensure any hb_tag_t value can be passed/stored as hb_script_t + * without risking undefined behavior. Include both a signed and unsigned max, + * since technically enums are int, and indeed, hb_script_t ends up being signed. + * See this thread for technicalities: + * + * http://lists.freedesktop.org/archives/harfbuzz/2014-March/004150.html + */ + _HB_SCRIPT_MAX_VALUE = HB_TAG_MAX, /*< skip >*/ + _HB_SCRIPT_MAX_VALUE_SIGNED = HB_TAG_MAX_SIGNED /*< skip >*/ + +} hb_script_t; + + +/* Script functions */ + +hb_script_t +hb_script_from_iso15924_tag (hb_tag_t tag); + +/* sugar for tag_from_string() then script_from_iso15924_tag */ +/* len=-1 means s is NUL-terminated */ +hb_script_t +hb_script_from_string (const char *s, int len); + +hb_tag_t +hb_script_to_iso15924_tag (hb_script_t script); + +hb_direction_t +hb_script_get_horizontal_direction (hb_script_t script); + + +/* User data */ + +typedef struct hb_user_data_key_t { + /*< private >*/ + char unused; +} hb_user_data_key_t; + +typedef void (*hb_destroy_func_t) (void *user_data); + + +HB_END_DECLS + +#endif /* HB_COMMON_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-coretext.cc b/3rdparty/harfbuzz-1.0.6/hb-coretext.cc new file mode 100644 index 0000000000..13ba5d94ef --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-coretext.cc @@ -0,0 +1,1219 @@ +/* + * Copyright © 2012,2013 Mozilla Foundation. + * Copyright © 2012,2013 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Mozilla Author(s): Jonathan Kew + * Google Author(s): Behdad Esfahbod + */ + +#define HB_SHAPER coretext +#define hb_coretext_shaper_face_data_t CGFont +#include "hb-shaper-impl-private.hh" + +#include "hb-coretext.h" + + +#ifndef HB_DEBUG_CORETEXT +#define HB_DEBUG_CORETEXT (HB_DEBUG+0) +#endif + + +static void +release_table_data (void *user_data) +{ + CFDataRef cf_data = reinterpret_cast (user_data); + CFRelease(cf_data); +} + +static hb_blob_t * +reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) +{ + CGFontRef cg_font = reinterpret_cast (user_data); + CFDataRef cf_data = CGFontCopyTableForTag (cg_font, tag); + if (unlikely (!cf_data)) + return NULL; + + const char *data = reinterpret_cast (CFDataGetBytePtr (cf_data)); + const size_t length = CFDataGetLength (cf_data); + if (!data || !length) + return NULL; + + return hb_blob_create (data, length, HB_MEMORY_MODE_READONLY, + reinterpret_cast (const_cast<__CFData *> (cf_data)), + release_table_data); +} + +hb_face_t * +hb_coretext_face_create (CGFontRef cg_font) +{ + return hb_face_create_for_tables (reference_table, CGFontRetain (cg_font), (hb_destroy_func_t) CGFontRelease); +} + + +HB_SHAPER_DATA_ENSURE_DECLARE(coretext, face) +HB_SHAPER_DATA_ENSURE_DECLARE(coretext, font) + + +/* + * shaper face data + */ + +static void +release_data (void *info, const void *data, size_t size) +{ + assert (hb_blob_get_length ((hb_blob_t *) info) == size && + hb_blob_get_data ((hb_blob_t *) info, NULL) == data); + + hb_blob_destroy ((hb_blob_t *) info); +} + +hb_coretext_shaper_face_data_t * +_hb_coretext_shaper_face_data_create (hb_face_t *face) +{ + hb_coretext_shaper_face_data_t *data = NULL; + + if (face->destroy == (hb_destroy_func_t) CGFontRelease) + { + data = CGFontRetain ((CGFontRef) face->user_data); + } + else + { + hb_blob_t *blob = hb_face_reference_blob (face); + unsigned int blob_length; + const char *blob_data = hb_blob_get_data (blob, &blob_length); + if (unlikely (!blob_length)) + DEBUG_MSG (CORETEXT, face, "Face has empty blob"); + + CGDataProviderRef provider = CGDataProviderCreateWithData (blob, blob_data, blob_length, &release_data); + if (likely (provider)) + { + data = CGFontCreateWithDataProvider (provider); + CGDataProviderRelease (provider); + } + } + + if (unlikely (!data)) { + DEBUG_MSG (CORETEXT, face, "Face CGFontCreateWithDataProvider() failed"); + } + + return data; +} + +void +_hb_coretext_shaper_face_data_destroy (hb_coretext_shaper_face_data_t *data) +{ + CFRelease (data); +} + +/* + * Since: 0.9.10 + */ +CGFontRef +hb_coretext_face_get_cg_font (hb_face_t *face) +{ + if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return NULL; + hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face); + return face_data; +} + + +/* + * shaper font data + */ + +struct hb_coretext_shaper_font_data_t { + CTFontRef ct_font; + CGFloat x_mult, y_mult; /* From CT space to HB space. */ +}; + +hb_coretext_shaper_font_data_t * +_hb_coretext_shaper_font_data_create (hb_font_t *font) +{ + if (unlikely (!hb_coretext_shaper_face_data_ensure (font->face))) return NULL; + + hb_coretext_shaper_font_data_t *data = (hb_coretext_shaper_font_data_t *) calloc (1, sizeof (hb_coretext_shaper_font_data_t)); + if (unlikely (!data)) + return NULL; + + hb_face_t *face = font->face; + hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face); + + /* Choose a CoreText font size and calculate multipliers to convert to HarfBuzz space. */ + /* TODO: use upem instead of 36? */ + CGFloat font_size = 36.; /* Default... */ + /* No idea if the following is even a good idea. */ + if (font->y_ppem) + font_size = font->y_ppem; + + if (font_size < 0) + font_size = -font_size; + data->x_mult = (CGFloat) font->x_scale / font_size; + data->y_mult = (CGFloat) font->y_scale / font_size; + data->ct_font = CTFontCreateWithGraphicsFont (face_data, font_size, NULL, NULL); + if (unlikely (!data->ct_font)) { + DEBUG_MSG (CORETEXT, font, "Font CTFontCreateWithGraphicsFont() failed"); + free (data); + return NULL; + } + + return data; +} + +void +_hb_coretext_shaper_font_data_destroy (hb_coretext_shaper_font_data_t *data) +{ + CFRelease (data->ct_font); + free (data); +} + + +/* + * shaper shape_plan data + */ + +struct hb_coretext_shaper_shape_plan_data_t {}; + +hb_coretext_shaper_shape_plan_data_t * +_hb_coretext_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan HB_UNUSED, + const hb_feature_t *user_features HB_UNUSED, + unsigned int num_user_features HB_UNUSED) +{ + return (hb_coretext_shaper_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED; +} + +void +_hb_coretext_shaper_shape_plan_data_destroy (hb_coretext_shaper_shape_plan_data_t *data HB_UNUSED) +{ +} + +CTFontRef +hb_coretext_font_get_ct_font (hb_font_t *font) +{ + if (unlikely (!hb_coretext_shaper_font_data_ensure (font))) return NULL; + hb_coretext_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font); + return font_data->ct_font; +} + + +/* + * shaper + */ + +struct feature_record_t { + unsigned int feature; + unsigned int setting; +}; + +struct active_feature_t { + feature_record_t rec; + unsigned int order; + + static int cmp (const active_feature_t *a, const active_feature_t *b) { + return a->rec.feature < b->rec.feature ? -1 : a->rec.feature > b->rec.feature ? 1 : + a->order < b->order ? -1 : a->order > b->order ? 1 : + a->rec.setting < b->rec.setting ? -1 : a->rec.setting > b->rec.setting ? 1 : + 0; + } + bool operator== (const active_feature_t *f) { + return cmp (this, f) == 0; + } +}; + +struct feature_event_t { + unsigned int index; + bool start; + active_feature_t feature; + + static int cmp (const feature_event_t *a, const feature_event_t *b) { + return a->index < b->index ? -1 : a->index > b->index ? 1 : + a->start < b->start ? -1 : a->start > b->start ? 1 : + active_feature_t::cmp (&a->feature, &b->feature); + } +}; + +struct range_record_t { + CTFontRef font; + unsigned int index_first; /* == start */ + unsigned int index_last; /* == end - 1 */ +}; + + +/* The following enum members are added in OS X 10.8. */ +#define kAltHalfWidthTextSelector 6 +#define kAltProportionalTextSelector 5 +#define kAlternateHorizKanaOffSelector 1 +#define kAlternateHorizKanaOnSelector 0 +#define kAlternateKanaType 34 +#define kAlternateVertKanaOffSelector 3 +#define kAlternateVertKanaOnSelector 2 +#define kCaseSensitiveLayoutOffSelector 1 +#define kCaseSensitiveLayoutOnSelector 0 +#define kCaseSensitiveLayoutType 33 +#define kCaseSensitiveSpacingOffSelector 3 +#define kCaseSensitiveSpacingOnSelector 2 +#define kContextualAlternatesOffSelector 1 +#define kContextualAlternatesOnSelector 0 +#define kContextualAlternatesType 36 +#define kContextualLigaturesOffSelector 19 +#define kContextualLigaturesOnSelector 18 +#define kContextualSwashAlternatesOffSelector 5 +#define kContextualSwashAlternatesOnSelector 4 +#define kDefaultLowerCaseSelector 0 +#define kDefaultUpperCaseSelector 0 +#define kHistoricalLigaturesOffSelector 21 +#define kHistoricalLigaturesOnSelector 20 +#define kHojoCharactersSelector 12 +#define kJIS2004CharactersSelector 11 +#define kLowerCasePetiteCapsSelector 2 +#define kLowerCaseSmallCapsSelector 1 +#define kLowerCaseType 37 +#define kMathematicalGreekOffSelector 11 +#define kMathematicalGreekOnSelector 10 +#define kNLCCharactersSelector 13 +#define kQuarterWidthTextSelector 4 +#define kScientificInferiorsSelector 4 +#define kStylisticAltEightOffSelector 17 +#define kStylisticAltEightOnSelector 16 +#define kStylisticAltEighteenOffSelector 37 +#define kStylisticAltEighteenOnSelector 36 +#define kStylisticAltElevenOffSelector 23 +#define kStylisticAltElevenOnSelector 22 +#define kStylisticAltFifteenOffSelector 31 +#define kStylisticAltFifteenOnSelector 30 +#define kStylisticAltFiveOffSelector 11 +#define kStylisticAltFiveOnSelector 10 +#define kStylisticAltFourOffSelector 9 +#define kStylisticAltFourOnSelector 8 +#define kStylisticAltFourteenOffSelector 29 +#define kStylisticAltFourteenOnSelector 28 +#define kStylisticAltNineOffSelector 19 +#define kStylisticAltNineOnSelector 18 +#define kStylisticAltNineteenOffSelector 39 +#define kStylisticAltNineteenOnSelector 38 +#define kStylisticAltOneOffSelector 3 +#define kStylisticAltOneOnSelector 2 +#define kStylisticAltSevenOffSelector 15 +#define kStylisticAltSevenOnSelector 14 +#define kStylisticAltSeventeenOffSelector 35 +#define kStylisticAltSeventeenOnSelector 34 +#define kStylisticAltSixOffSelector 13 +#define kStylisticAltSixOnSelector 12 +#define kStylisticAltSixteenOffSelector 33 +#define kStylisticAltSixteenOnSelector 32 +#define kStylisticAltTenOffSelector 21 +#define kStylisticAltTenOnSelector 20 +#define kStylisticAltThirteenOffSelector 27 +#define kStylisticAltThirteenOnSelector 26 +#define kStylisticAltThreeOffSelector 7 +#define kStylisticAltThreeOnSelector 6 +#define kStylisticAltTwelveOffSelector 25 +#define kStylisticAltTwelveOnSelector 24 +#define kStylisticAltTwentyOffSelector 41 +#define kStylisticAltTwentyOnSelector 40 +#define kStylisticAltTwoOffSelector 5 +#define kStylisticAltTwoOnSelector 4 +#define kStylisticAlternativesType 35 +#define kSwashAlternatesOffSelector 3 +#define kSwashAlternatesOnSelector 2 +#define kThirdWidthTextSelector 3 +#define kTraditionalNamesCharactersSelector 14 +#define kUpperCasePetiteCapsSelector 2 +#define kUpperCaseSmallCapsSelector 1 +#define kUpperCaseType 38 + +/* Table data courtesy of Apple. */ +static const struct feature_mapping_t { + FourCharCode otFeatureTag; + uint16_t aatFeatureType; + uint16_t selectorToEnable; + uint16_t selectorToDisable; +} feature_mappings[] = { + { 'c2pc', kUpperCaseType, kUpperCasePetiteCapsSelector, kDefaultUpperCaseSelector }, + { 'c2sc', kUpperCaseType, kUpperCaseSmallCapsSelector, kDefaultUpperCaseSelector }, + { 'calt', kContextualAlternatesType, kContextualAlternatesOnSelector, kContextualAlternatesOffSelector }, + { 'case', kCaseSensitiveLayoutType, kCaseSensitiveLayoutOnSelector, kCaseSensitiveLayoutOffSelector }, + { 'clig', kLigaturesType, kContextualLigaturesOnSelector, kContextualLigaturesOffSelector }, + { 'cpsp', kCaseSensitiveLayoutType, kCaseSensitiveSpacingOnSelector, kCaseSensitiveSpacingOffSelector }, + { 'cswh', kContextualAlternatesType, kContextualSwashAlternatesOnSelector, kContextualSwashAlternatesOffSelector }, + { 'dlig', kLigaturesType, kRareLigaturesOnSelector, kRareLigaturesOffSelector }, + { 'expt', kCharacterShapeType, kExpertCharactersSelector, 16 }, + { 'frac', kFractionsType, kDiagonalFractionsSelector, kNoFractionsSelector }, + { 'fwid', kTextSpacingType, kMonospacedTextSelector, 7 }, + { 'halt', kTextSpacingType, kAltHalfWidthTextSelector, 7 }, + { 'hist', kLigaturesType, kHistoricalLigaturesOnSelector, kHistoricalLigaturesOffSelector }, + { 'hkna', kAlternateKanaType, kAlternateHorizKanaOnSelector, kAlternateHorizKanaOffSelector, }, + { 'hlig', kLigaturesType, kHistoricalLigaturesOnSelector, kHistoricalLigaturesOffSelector }, + { 'hngl', kTransliterationType, kHanjaToHangulSelector, kNoTransliterationSelector }, + { 'hojo', kCharacterShapeType, kHojoCharactersSelector, 16 }, + { 'hwid', kTextSpacingType, kHalfWidthTextSelector, 7 }, + { 'ital', kItalicCJKRomanType, kCJKItalicRomanOnSelector, kCJKItalicRomanOffSelector }, + { 'jp04', kCharacterShapeType, kJIS2004CharactersSelector, 16 }, + { 'jp78', kCharacterShapeType, kJIS1978CharactersSelector, 16 }, + { 'jp83', kCharacterShapeType, kJIS1983CharactersSelector, 16 }, + { 'jp90', kCharacterShapeType, kJIS1990CharactersSelector, 16 }, + { 'liga', kLigaturesType, kCommonLigaturesOnSelector, kCommonLigaturesOffSelector }, + { 'lnum', kNumberCaseType, kUpperCaseNumbersSelector, 2 }, + { 'mgrk', kMathematicalExtrasType, kMathematicalGreekOnSelector, kMathematicalGreekOffSelector }, + { 'nlck', kCharacterShapeType, kNLCCharactersSelector, 16 }, + { 'onum', kNumberCaseType, kLowerCaseNumbersSelector, 2 }, + { 'ordn', kVerticalPositionType, kOrdinalsSelector, kNormalPositionSelector }, + { 'palt', kTextSpacingType, kAltProportionalTextSelector, 7 }, + { 'pcap', kLowerCaseType, kLowerCasePetiteCapsSelector, kDefaultLowerCaseSelector }, + { 'pkna', kTextSpacingType, kProportionalTextSelector, 7 }, + { 'pnum', kNumberSpacingType, kProportionalNumbersSelector, 4 }, + { 'pwid', kTextSpacingType, kProportionalTextSelector, 7 }, + { 'qwid', kTextSpacingType, kQuarterWidthTextSelector, 7 }, + { 'ruby', kRubyKanaType, kRubyKanaOnSelector, kRubyKanaOffSelector }, + { 'sinf', kVerticalPositionType, kScientificInferiorsSelector, kNormalPositionSelector }, + { 'smcp', kLowerCaseType, kLowerCaseSmallCapsSelector, kDefaultLowerCaseSelector }, + { 'smpl', kCharacterShapeType, kSimplifiedCharactersSelector, 16 }, + { 'ss01', kStylisticAlternativesType, kStylisticAltOneOnSelector, kStylisticAltOneOffSelector }, + { 'ss02', kStylisticAlternativesType, kStylisticAltTwoOnSelector, kStylisticAltTwoOffSelector }, + { 'ss03', kStylisticAlternativesType, kStylisticAltThreeOnSelector, kStylisticAltThreeOffSelector }, + { 'ss04', kStylisticAlternativesType, kStylisticAltFourOnSelector, kStylisticAltFourOffSelector }, + { 'ss05', kStylisticAlternativesType, kStylisticAltFiveOnSelector, kStylisticAltFiveOffSelector }, + { 'ss06', kStylisticAlternativesType, kStylisticAltSixOnSelector, kStylisticAltSixOffSelector }, + { 'ss07', kStylisticAlternativesType, kStylisticAltSevenOnSelector, kStylisticAltSevenOffSelector }, + { 'ss08', kStylisticAlternativesType, kStylisticAltEightOnSelector, kStylisticAltEightOffSelector }, + { 'ss09', kStylisticAlternativesType, kStylisticAltNineOnSelector, kStylisticAltNineOffSelector }, + { 'ss10', kStylisticAlternativesType, kStylisticAltTenOnSelector, kStylisticAltTenOffSelector }, + { 'ss11', kStylisticAlternativesType, kStylisticAltElevenOnSelector, kStylisticAltElevenOffSelector }, + { 'ss12', kStylisticAlternativesType, kStylisticAltTwelveOnSelector, kStylisticAltTwelveOffSelector }, + { 'ss13', kStylisticAlternativesType, kStylisticAltThirteenOnSelector, kStylisticAltThirteenOffSelector }, + { 'ss14', kStylisticAlternativesType, kStylisticAltFourteenOnSelector, kStylisticAltFourteenOffSelector }, + { 'ss15', kStylisticAlternativesType, kStylisticAltFifteenOnSelector, kStylisticAltFifteenOffSelector }, + { 'ss16', kStylisticAlternativesType, kStylisticAltSixteenOnSelector, kStylisticAltSixteenOffSelector }, + { 'ss17', kStylisticAlternativesType, kStylisticAltSeventeenOnSelector, kStylisticAltSeventeenOffSelector }, + { 'ss18', kStylisticAlternativesType, kStylisticAltEighteenOnSelector, kStylisticAltEighteenOffSelector }, + { 'ss19', kStylisticAlternativesType, kStylisticAltNineteenOnSelector, kStylisticAltNineteenOffSelector }, + { 'ss20', kStylisticAlternativesType, kStylisticAltTwentyOnSelector, kStylisticAltTwentyOffSelector }, + { 'subs', kVerticalPositionType, kInferiorsSelector, kNormalPositionSelector }, + { 'sups', kVerticalPositionType, kSuperiorsSelector, kNormalPositionSelector }, + { 'swsh', kContextualAlternatesType, kSwashAlternatesOnSelector, kSwashAlternatesOffSelector }, + { 'titl', kStyleOptionsType, kTitlingCapsSelector, kNoStyleOptionsSelector }, + { 'tnam', kCharacterShapeType, kTraditionalNamesCharactersSelector, 16 }, + { 'tnum', kNumberSpacingType, kMonospacedNumbersSelector, 4 }, + { 'trad', kCharacterShapeType, kTraditionalCharactersSelector, 16 }, + { 'twid', kTextSpacingType, kThirdWidthTextSelector, 7 }, + { 'unic', kLetterCaseType, 14, 15 }, + { 'valt', kTextSpacingType, kAltProportionalTextSelector, 7 }, + { 'vert', kVerticalSubstitutionType, kSubstituteVerticalFormsOnSelector, kSubstituteVerticalFormsOffSelector }, + { 'vhal', kTextSpacingType, kAltHalfWidthTextSelector, 7 }, + { 'vkna', kAlternateKanaType, kAlternateVertKanaOnSelector, kAlternateVertKanaOffSelector }, + { 'vpal', kTextSpacingType, kAltProportionalTextSelector, 7 }, + { 'vrt2', kVerticalSubstitutionType, kSubstituteVerticalFormsOnSelector, kSubstituteVerticalFormsOffSelector }, + { 'zero', kTypographicExtrasType, kSlashedZeroOnSelector, kSlashedZeroOffSelector }, +}; + +static int +_hb_feature_mapping_cmp (const void *key_, const void *entry_) +{ + unsigned int key = * (unsigned int *) key_; + const feature_mapping_t * entry = (const feature_mapping_t *) entry_; + return key < entry->otFeatureTag ? -1 : + key > entry->otFeatureTag ? 1 : + 0; +} + +hb_bool_t +_hb_coretext_shape (hb_shape_plan_t *shape_plan, + hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features) +{ + hb_face_t *face = font->face; + hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face); + hb_coretext_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font); + + /* Attach marks to their bases, to match the 'ot' shaper. + * Adapted from hb-ot-shape:hb_form_clusters(). + * Note that this only makes us be closer to the 'ot' shaper, + * but by no means the same. For example, if there's + * B1 M1 B2 M2, and B1-B2 form a ligature, M2's cluster will + * continue pointing to B2 even though B2 was merged into B1's + * cluster... */ + { + hb_unicode_funcs_t *unicode = buffer->unicode; + unsigned int count = buffer->len; + hb_glyph_info_t *info = buffer->info; + for (unsigned int i = 1; i < count; i++) + if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (unicode->general_category (info[i].codepoint))) + buffer->merge_clusters (i - 1, i + 1); + } + + hb_auto_array_t feature_records; + hb_auto_array_t range_records; + + /* + * Set up features. + * (copied + modified from code from hb-uniscribe.cc) + */ + if (num_features) + { + /* Sort features by start/end events. */ + hb_auto_array_t feature_events; + for (unsigned int i = 0; i < num_features; i++) + { + const feature_mapping_t * mapping = (const feature_mapping_t *) bsearch (&features[i].tag, + feature_mappings, + ARRAY_LENGTH (feature_mappings), + sizeof (feature_mappings[0]), + _hb_feature_mapping_cmp); + if (!mapping) + continue; + + active_feature_t feature; + feature.rec.feature = mapping->aatFeatureType; + feature.rec.setting = features[i].value ? mapping->selectorToEnable : mapping->selectorToDisable; + feature.order = i; + + feature_event_t *event; + + event = feature_events.push (); + if (unlikely (!event)) + goto fail_features; + event->index = features[i].start; + event->start = true; + event->feature = feature; + + event = feature_events.push (); + if (unlikely (!event)) + goto fail_features; + event->index = features[i].end; + event->start = false; + event->feature = feature; + } + feature_events.qsort (); + /* Add a strategic final event. */ + { + active_feature_t feature; + feature.rec.feature = HB_TAG_NONE; + feature.rec.setting = 0; + feature.order = num_features + 1; + + feature_event_t *event = feature_events.push (); + if (unlikely (!event)) + goto fail_features; + event->index = 0; /* This value does magic. */ + event->start = false; + event->feature = feature; + } + + /* Scan events and save features for each range. */ + hb_auto_array_t active_features; + unsigned int last_index = 0; + for (unsigned int i = 0; i < feature_events.len; i++) + { + feature_event_t *event = &feature_events[i]; + + if (event->index != last_index) + { + /* Save a snapshot of active features and the range. */ + range_record_t *range = range_records.push (); + if (unlikely (!range)) + goto fail_features; + + if (active_features.len) + { + CFMutableArrayRef features_array = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); + + /* TODO sort and resolve conflicting features? */ + /* active_features.qsort (); */ + for (unsigned int j = 0; j < active_features.len; j++) + { + CFStringRef keys[2] = { + kCTFontFeatureTypeIdentifierKey, + kCTFontFeatureSelectorIdentifierKey + }; + CFNumberRef values[2] = { + CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &active_features[j].rec.feature), + CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &active_features[j].rec.setting) + }; + CFDictionaryRef dict = CFDictionaryCreate (kCFAllocatorDefault, + (const void **) keys, + (const void **) values, + 2, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + CFRelease (values[0]); + CFRelease (values[1]); + + CFArrayAppendValue (features_array, dict); + CFRelease (dict); + + } + + CFDictionaryRef attributes = CFDictionaryCreate (kCFAllocatorDefault, + (const void **) &kCTFontFeatureSettingsAttribute, + (const void **) &features_array, + 1, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + CFRelease (features_array); + + CTFontDescriptorRef font_desc = CTFontDescriptorCreateWithAttributes (attributes); + CFRelease (attributes); + + range->font = CTFontCreateCopyWithAttributes (font_data->ct_font, 0.0, NULL, font_desc); + CFRelease (font_desc); + } + else + { + range->font = NULL; + } + + range->index_first = last_index; + range->index_last = event->index - 1; + + last_index = event->index; + } + + if (event->start) { + active_feature_t *feature = active_features.push (); + if (unlikely (!feature)) + goto fail_features; + *feature = event->feature; + } else { + active_feature_t *feature = active_features.find (&event->feature); + if (feature) + active_features.remove (feature - active_features.array); + } + } + + if (!range_records.len) /* No active feature found. */ + goto fail_features; + } + else + { + fail_features: + num_features = 0; + } + + unsigned int scratch_size; + hb_buffer_t::scratch_buffer_t *scratch = buffer->get_scratch_buffer (&scratch_size); + +#define ALLOCATE_ARRAY(Type, name, len, on_no_room) \ + Type *name = (Type *) scratch; \ + { \ + unsigned int _consumed = DIV_CEIL ((len) * sizeof (Type), sizeof (*scratch)); \ + if (unlikely (_consumed > scratch_size)) \ + { \ + on_no_room; \ + assert (0); \ + } \ + scratch += _consumed; \ + scratch_size -= _consumed; \ + } + + ALLOCATE_ARRAY (UniChar, pchars, buffer->len * 2, /*nothing*/); + unsigned int chars_len = 0; + for (unsigned int i = 0; i < buffer->len; i++) { + hb_codepoint_t c = buffer->info[i].codepoint; + if (likely (c <= 0xFFFFu)) + pchars[chars_len++] = c; + else if (unlikely (c > 0x10FFFFu)) + pchars[chars_len++] = 0xFFFDu; + else { + pchars[chars_len++] = 0xD800u + ((c - 0x10000u) >> 10); + pchars[chars_len++] = 0xDC00u + ((c - 0x10000u) & ((1 << 10) - 1)); + } + } + + ALLOCATE_ARRAY (unsigned int, log_clusters, chars_len, /*nothing*/); + chars_len = 0; + for (unsigned int i = 0; i < buffer->len; i++) + { + hb_codepoint_t c = buffer->info[i].codepoint; + unsigned int cluster = buffer->info[i].cluster; + log_clusters[chars_len++] = cluster; + if (hb_in_range (c, 0x10000u, 0x10FFFFu)) + log_clusters[chars_len++] = cluster; /* Surrogates. */ + } + +#define FAIL(...) \ + HB_STMT_START { \ + DEBUG_MSG (CORETEXT, NULL, __VA_ARGS__); \ + ret = false; \ + goto fail; \ + } HB_STMT_END; + + bool ret = true; + CFStringRef string_ref = NULL; + CTLineRef line = NULL; + + if (0) + { +resize_and_retry: + DEBUG_MSG (CORETEXT, buffer, "Buffer resize"); + /* string_ref uses the scratch-buffer for backing store, and line references + * string_ref (via attr_string). We must release those before resizing buffer. */ + assert (string_ref); + assert (line); + CFRelease (string_ref); + CFRelease (line); + string_ref = NULL; + line = NULL; + + /* Get previous start-of-scratch-area, that we use later for readjusting + * our existing scratch arrays. */ + unsigned int old_scratch_used; + hb_buffer_t::scratch_buffer_t *old_scratch; + old_scratch = buffer->get_scratch_buffer (&old_scratch_used); + old_scratch_used = scratch - old_scratch; + + if (unlikely (!buffer->ensure (buffer->allocated * 2))) + FAIL ("Buffer resize failed"); + + /* Adjust scratch, pchars, and log_cluster arrays. This is ugly, but really the + * cleanest way to do without completely restructuring the rest of this shaper. */ + scratch = buffer->get_scratch_buffer (&scratch_size); + pchars = reinterpret_cast (((char *) scratch + ((char *) pchars - (char *) old_scratch))); + log_clusters = reinterpret_cast (((char *) scratch + ((char *) log_clusters - (char *) old_scratch))); + scratch += old_scratch_used; + scratch_size -= old_scratch_used; + } +retry: + { + string_ref = CFStringCreateWithCharactersNoCopy (NULL, + pchars, chars_len, + kCFAllocatorNull); + if (unlikely (!string_ref)) + FAIL ("CFStringCreateWithCharactersNoCopy failed"); + + /* Create an attributed string, populate it, and create a line from it, then release attributed string. */ + { + CFMutableAttributedStringRef attr_string = CFAttributedStringCreateMutable (kCFAllocatorDefault, + chars_len); + if (unlikely (!attr_string)) + FAIL ("CFAttributedStringCreateMutable failed"); + CFAttributedStringReplaceString (attr_string, CFRangeMake (0, 0), string_ref); + if (HB_DIRECTION_IS_VERTICAL (buffer->props.direction)) + { + CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len), + kCTVerticalFormsAttributeName, kCFBooleanTrue); + } + + if (buffer->props.language) + { +/* What's the iOS equivalent of this check? + * The symbols was introduced in iOS 7.0. + * At any rate, our fallback is safe and works fine. */ +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 +# define kCTLanguageAttributeName CFSTR ("NSLanguage") +#endif + CFStringRef lang = CFStringCreateWithCStringNoCopy (kCFAllocatorDefault, + hb_language_to_string (buffer->props.language), + kCFStringEncodingUTF8, + kCFAllocatorNull); + if (unlikely (!lang)) + FAIL ("CFStringCreateWithCStringNoCopy failed"); + CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len), + kCTLanguageAttributeName, lang); + CFRelease (lang); + } + CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len), + kCTFontAttributeName, font_data->ct_font); + + if (num_features) + { + unsigned int start = 0; + range_record_t *last_range = &range_records[0]; + for (unsigned int k = 0; k < chars_len; k++) + { + range_record_t *range = last_range; + while (log_clusters[k] < range->index_first) + range--; + while (log_clusters[k] > range->index_last) + range++; + if (range != last_range) + { + if (last_range->font) + CFAttributedStringSetAttribute (attr_string, CFRangeMake (start, k - start), + kCTFontAttributeName, last_range->font); + + start = k; + } + + last_range = range; + } + if (start != chars_len && last_range->font) + CFAttributedStringSetAttribute (attr_string, CFRangeMake (start, chars_len - start), + kCTFontAttributeName, last_range->font); + } + + int level = HB_DIRECTION_IS_FORWARD (buffer->props.direction) ? 0 : 1; + CFNumberRef level_number = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &level); + CFDictionaryRef options = CFDictionaryCreate (kCFAllocatorDefault, + (const void **) &kCTTypesetterOptionForcedEmbeddingLevel, + (const void **) &level_number, + 1, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + if (unlikely (!options)) + FAIL ("CFDictionaryCreate failed"); + + CTTypesetterRef typesetter = CTTypesetterCreateWithAttributedStringAndOptions (attr_string, options); + CFRelease (options); + CFRelease (attr_string); + if (unlikely (!typesetter)) + FAIL ("CTTypesetterCreateWithAttributedStringAndOptions failed"); + + line = CTTypesetterCreateLine (typesetter, CFRangeMake(0, 0)); + CFRelease (typesetter); + if (unlikely (!line)) + FAIL ("CTTypesetterCreateLine failed"); + } + + CFArrayRef glyph_runs = CTLineGetGlyphRuns (line); + unsigned int num_runs = CFArrayGetCount (glyph_runs); + DEBUG_MSG (CORETEXT, NULL, "Num runs: %d", num_runs); + + buffer->len = 0; + uint32_t status_and = ~0, status_or = 0; + double advances_so_far = 0; + /* For right-to-left runs, CoreText returns the glyphs positioned such that + * any trailing whitespace is to the left of (0,0). Adjust coordinate system + * to fix for that. Test with any RTL string with trailing spaces. + * https://code.google.com/p/chromium/issues/detail?id=469028 + */ + if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction)) + { + advances_so_far -= CTLineGetTrailingWhitespaceWidth (line); + if (HB_DIRECTION_IS_VERTICAL (buffer->props.direction)) + advances_so_far = -advances_so_far; + } + + const CFRange range_all = CFRangeMake (0, 0); + + for (unsigned int i = 0; i < num_runs; i++) + { + CTRunRef run = static_cast(CFArrayGetValueAtIndex (glyph_runs, i)); + CTRunStatus run_status = CTRunGetStatus (run); + status_or |= run_status; + status_and &= run_status; + DEBUG_MSG (CORETEXT, run, "CTRunStatus: %x", run_status); + double run_advance = CTRunGetTypographicBounds (run, range_all, NULL, NULL, NULL); + if (HB_DIRECTION_IS_VERTICAL (buffer->props.direction)) + run_advance = -run_advance; + DEBUG_MSG (CORETEXT, run, "Run advance: %g", run_advance); + + /* CoreText does automatic font fallback (AKA "cascading") for characters + * not supported by the requested font, and provides no way to turn it off, + * so we must detect if the returned run uses a font other than the requested + * one and fill in the buffer with .notdef glyphs instead of random glyph + * indices from a different font. + */ + CFDictionaryRef attributes = CTRunGetAttributes (run); + CTFontRef run_ct_font = static_cast(CFDictionaryGetValue (attributes, kCTFontAttributeName)); + if (!CFEqual (run_ct_font, font_data->ct_font)) + { + /* The run doesn't use our main font instance. We have to figure out + * whether font fallback happened, or this is just CoreText giving us + * another CTFont using the same underlying CGFont. CoreText seems + * to do that in a variety of situations, one of which being vertical + * text, but also perhaps for caching reasons. + * + * First, see if it uses any of our subfonts created to set font features... + * + * Next, compare the CGFont to the one we used to create our fonts. + * Even this doesn't work all the time. + * + * Finally, we compare PS names, which I don't think are unique... + * + * Looks like if we really want to be sure here we have to modify the + * font to change the name table, similar to what we do in the uniscribe + * backend. + * + * However, even that wouldn't work if we were passed in the CGFont to + * begin with. + * + * Webkit uses a slightly different approach: it installs LastResort + * as fallback chain, and then checks PS name of used font against + * LastResort. That one is safe for any font except for LastResort, + * as opposed to ours, which can fail if we are using any uninstalled + * font that has the same name as an installed font. + * + * See: http://github.com/behdad/harfbuzz/pull/36 + */ + bool matched = false; + for (unsigned int i = 0; i < range_records.len; i++) + if (range_records[i].font && CFEqual (run_ct_font, range_records[i].font)) + { + matched = true; + break; + } + if (!matched) + { + CGFontRef run_cg_font = CTFontCopyGraphicsFont (run_ct_font, 0); + if (run_cg_font) + { + matched = CFEqual (run_cg_font, face_data); + CFRelease (run_cg_font); + } + } + if (!matched) + { + CFStringRef font_ps_name = CTFontCopyName (font_data->ct_font, kCTFontPostScriptNameKey); + CFStringRef run_ps_name = CTFontCopyName (run_ct_font, kCTFontPostScriptNameKey); + CFComparisonResult result = CFStringCompare (run_ps_name, font_ps_name, 0); + CFRelease (run_ps_name); + CFRelease (font_ps_name); + if (result == kCFCompareEqualTo) + matched = true; + } + if (!matched) + { + CFRange range = CTRunGetStringRange (run); + DEBUG_MSG (CORETEXT, run, "Run used fallback font: %ld..%ld", + range.location, range.location + range.length); + if (!buffer->ensure_inplace (buffer->len + range.length)) + goto resize_and_retry; + hb_glyph_info_t *info = buffer->info + buffer->len; + + hb_codepoint_t notdef = 0; + hb_direction_t dir = buffer->props.direction; + hb_position_t x_advance, y_advance, x_offset, y_offset; + hb_font_get_glyph_advance_for_direction (font, notdef, dir, &x_advance, &y_advance); + hb_font_get_glyph_origin_for_direction (font, notdef, dir, &x_offset, &y_offset); + hb_position_t advance = x_advance + y_advance; + x_offset = -x_offset; + y_offset = -y_offset; + + unsigned int old_len = buffer->len; + for (CFIndex j = range.location; j < range.location + range.length; j++) + { + UniChar ch = CFStringGetCharacterAtIndex (string_ref, j); + if (hb_in_range (ch, 0xDC00u, 0xDFFFu) && range.location < j) + { + ch = CFStringGetCharacterAtIndex (string_ref, j - 1); + if (hb_in_range (ch, 0xD800u, 0xDBFFu)) + /* This is the second of a surrogate pair. Don't need .notdef + * for this one. */ + continue; + } + if (buffer->unicode->is_default_ignorable (ch)) + continue; + + info->codepoint = notdef; + info->cluster = log_clusters[j]; + + info->mask = advance; + info->var1.i32 = x_offset; + info->var2.i32 = y_offset; + + info++; + buffer->len++; + } + if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction)) + buffer->reverse_range (old_len, buffer->len); + advances_so_far += run_advance; + continue; + } + } + + unsigned int num_glyphs = CTRunGetGlyphCount (run); + if (num_glyphs == 0) + continue; + + if (!buffer->ensure_inplace (buffer->len + num_glyphs)) + goto resize_and_retry; + + hb_glyph_info_t *run_info = buffer->info + buffer->len; + + /* Testing used to indicate that CTRunGetGlyphsPtr, etc (almost?) always + * succeed, and so copying data to our own buffer will be rare. Reports + * have it that this changed in OS X 10.10 Yosemite, and NULL is returned + * frequently. At any rate, we can test that codepath by setting USE_PTR + * to false. */ + +#define USE_PTR true + +#define SCRATCH_SAVE() \ + unsigned int scratch_size_saved = scratch_size; \ + hb_buffer_t::scratch_buffer_t *scratch_saved = scratch + +#define SCRATCH_RESTORE() \ + scratch_size = scratch_size_saved; \ + scratch = scratch_saved; + + { /* Setup glyphs */ + SCRATCH_SAVE(); + const CGGlyph* glyphs = USE_PTR ? CTRunGetGlyphsPtr (run) : NULL; + if (!glyphs) { + ALLOCATE_ARRAY (CGGlyph, glyph_buf, num_glyphs, goto resize_and_retry); + CTRunGetGlyphs (run, range_all, glyph_buf); + glyphs = glyph_buf; + } + const CFIndex* string_indices = USE_PTR ? CTRunGetStringIndicesPtr (run) : NULL; + if (!string_indices) { + ALLOCATE_ARRAY (CFIndex, index_buf, num_glyphs, goto resize_and_retry); + CTRunGetStringIndices (run, range_all, index_buf); + string_indices = index_buf; + } + hb_glyph_info_t *info = run_info; + for (unsigned int j = 0; j < num_glyphs; j++) + { + info->codepoint = glyphs[j]; + info->cluster = log_clusters[string_indices[j]]; + info++; + } + SCRATCH_RESTORE(); + } + { + /* Setup positions. + * Note that CoreText does not return advances for glyphs. As such, + * for all but last glyph, we use the delta position to next glyph as + * advance (in the advance direction only), and for last glyph we set + * whatever is needed to make the whole run's advance add up. */ + SCRATCH_SAVE(); + const CGPoint* positions = USE_PTR ? CTRunGetPositionsPtr (run) : NULL; + if (!positions) { + ALLOCATE_ARRAY (CGPoint, position_buf, num_glyphs, goto resize_and_retry); + CTRunGetPositions (run, range_all, position_buf); + positions = position_buf; + } + hb_glyph_info_t *info = run_info; + CGFloat x_mult = font_data->x_mult, y_mult = font_data->y_mult; + if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction)) + { + hb_position_t x_offset = (positions[0].x - advances_so_far) * x_mult; + for (unsigned int j = 0; j < num_glyphs; j++) + { + double advance; + if (likely (j + 1 < num_glyphs)) + advance = positions[j + 1].x - positions[j].x; + else /* last glyph */ + advance = run_advance - (positions[j].x - positions[0].x); + info->mask = advance * x_mult; + info->var1.i32 = x_offset; + info->var2.i32 = positions[j].y * y_mult; + info++; + } + } + else + { + hb_position_t y_offset = (positions[0].y - advances_so_far) * y_mult; + for (unsigned int j = 0; j < num_glyphs; j++) + { + double advance; + if (likely (j + 1 < num_glyphs)) + advance = positions[j + 1].y - positions[j].y; + else /* last glyph */ + advance = run_advance - (positions[j].y - positions[0].y); + info->mask = advance * y_mult; + info->var1.i32 = positions[j].x * x_mult; + info->var2.i32 = y_offset; + info++; + } + } + SCRATCH_RESTORE(); + advances_so_far += run_advance; + } +#undef SCRATCH_RESTORE +#undef SCRATCH_SAVE +#undef USE_PTR +#undef ALLOCATE_ARRAY + + buffer->len += num_glyphs; + } + + /* Mac OS 10.6 doesn't have kCTTypesetterOptionForcedEmbeddingLevel, + * or if it does, it doesn't resepct it. So we get runs with wrong + * directions. As such, disable the assert... It wouldn't crash, but + * cursoring will be off... + * + * http://crbug.com/419769 + */ + if (0) + { + /* Make sure all runs had the expected direction. */ + bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction); + assert (bool (status_and & kCTRunStatusRightToLeft) == backward); + assert (bool (status_or & kCTRunStatusRightToLeft) == backward); + } + + buffer->clear_positions (); + + unsigned int count = buffer->len; + hb_glyph_info_t *info = buffer->info; + hb_glyph_position_t *pos = buffer->pos; + if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction)) + for (unsigned int i = 0; i < count; i++) + { + pos->x_advance = info->mask; + pos->x_offset = info->var1.i32; + pos->y_offset = info->var2.i32; + info++, pos++; + } + else + for (unsigned int i = 0; i < count; i++) + { + pos->y_advance = info->mask; + pos->x_offset = info->var1.i32; + pos->y_offset = info->var2.i32; + info++, pos++; + } + + /* Fix up clusters so that we never return out-of-order indices; + * if core text has reordered glyphs, we'll merge them to the + * beginning of the reordered cluster. CoreText is nice enough + * to tell us whenever it has produced nonmonotonic results... + * Note that we assume the input clusters were nonmonotonic to + * begin with. + * + * This does *not* mean we'll form the same clusters as Uniscribe + * or the native OT backend, only that the cluster indices will be + * monotonic in the output buffer. */ + if (count > 1 && (status_or & kCTRunStatusNonMonotonic)) + { + hb_glyph_info_t *info = buffer->info; + if (HB_DIRECTION_IS_FORWARD (buffer->props.direction)) + { + unsigned int cluster = info[count - 1].cluster; + for (unsigned int i = count - 1; i > 0; i--) + { + cluster = MIN (cluster, info[i - 1].cluster); + info[i - 1].cluster = cluster; + } + } + else + { + unsigned int cluster = info[0].cluster; + for (unsigned int i = 1; i < count; i++) + { + cluster = MIN (cluster, info[i].cluster); + info[i].cluster = cluster; + } + } + } + } + +#undef FAIL + +fail: + if (string_ref) + CFRelease (string_ref); + if (line) + CFRelease (line); + + for (unsigned int i = 0; i < range_records.len; i++) + if (range_records[i].font) + CFRelease (range_records[i].font); + + return ret; +} + + +/* + * AAT shaper + */ + +HB_SHAPER_DATA_ENSURE_DECLARE(coretext_aat, face) +HB_SHAPER_DATA_ENSURE_DECLARE(coretext_aat, font) + + +/* + * shaper face data + */ + +struct hb_coretext_aat_shaper_face_data_t {}; + +hb_coretext_aat_shaper_face_data_t * +_hb_coretext_aat_shaper_face_data_create (hb_face_t *face) +{ + hb_blob_t *mort_blob = face->reference_table (HB_CORETEXT_TAG_MORT); + /* Umm, we just reference the table to check whether it exists. + * Maybe add better API for this? */ + if (!hb_blob_get_length (mort_blob)) + { + hb_blob_destroy (mort_blob); + mort_blob = face->reference_table (HB_CORETEXT_TAG_MORX); + if (!hb_blob_get_length (mort_blob)) + { + hb_blob_destroy (mort_blob); + return NULL; + } + } + hb_blob_destroy (mort_blob); + + return hb_coretext_shaper_face_data_ensure (face) ? (hb_coretext_aat_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL; +} + +void +_hb_coretext_aat_shaper_face_data_destroy (hb_coretext_aat_shaper_face_data_t *data HB_UNUSED) +{ +} + + +/* + * shaper font data + */ + +struct hb_coretext_aat_shaper_font_data_t {}; + +hb_coretext_aat_shaper_font_data_t * +_hb_coretext_aat_shaper_font_data_create (hb_font_t *font) +{ + return hb_coretext_shaper_font_data_ensure (font) ? (hb_coretext_aat_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL; +} + +void +_hb_coretext_aat_shaper_font_data_destroy (hb_coretext_aat_shaper_font_data_t *data HB_UNUSED) +{ +} + + +/* + * shaper shape_plan data + */ + +struct hb_coretext_aat_shaper_shape_plan_data_t {}; + +hb_coretext_aat_shaper_shape_plan_data_t * +_hb_coretext_aat_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan HB_UNUSED, + const hb_feature_t *user_features HB_UNUSED, + unsigned int num_user_features HB_UNUSED) +{ + return (hb_coretext_aat_shaper_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED; +} + +void +_hb_coretext_aat_shaper_shape_plan_data_destroy (hb_coretext_aat_shaper_shape_plan_data_t *data HB_UNUSED) +{ +} + + +/* + * shaper + */ + +hb_bool_t +_hb_coretext_aat_shape (hb_shape_plan_t *shape_plan, + hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features) +{ + return _hb_coretext_shape (shape_plan, font, buffer, features, num_features); +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-coretext.h b/3rdparty/harfbuzz-1.0.6/hb-coretext.h new file mode 100644 index 0000000000..25267bc978 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-coretext.h @@ -0,0 +1,60 @@ +/* + * Copyright © 2012 Mozilla Foundation. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Mozilla Author(s): Jonathan Kew + */ + +#ifndef HB_CORETEXT_H +#define HB_CORETEXT_H + +#include "hb.h" + +#include +#if TARGET_OS_IPHONE +# include +# include +#else +# include +#endif + +HB_BEGIN_DECLS + + +#define HB_CORETEXT_TAG_MORT HB_TAG('m','o','r','t') +#define HB_CORETEXT_TAG_MORX HB_TAG('m','o','r','x') + + +hb_face_t * +hb_coretext_face_create (CGFontRef cg_font); + + +CGFontRef +hb_coretext_face_get_cg_font (hb_face_t *face); + +CTFontRef +hb_coretext_font_get_ct_font (hb_font_t *font); + + +HB_END_DECLS + +#endif /* HB_CORETEXT_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-deprecated.h b/3rdparty/harfbuzz-1.0.6/hb-deprecated.h new file mode 100644 index 0000000000..30ae4b1caf --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-deprecated.h @@ -0,0 +1,51 @@ +/* + * Copyright © 2013 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_H_IN +#error "Include instead." +#endif + +#ifndef HB_DEPRECATED_H +#define HB_DEPRECATED_H + +#include "hb-common.h" +#include "hb-unicode.h" +#include "hb-font.h" + +HB_BEGIN_DECLS + +#ifndef HB_DISABLE_DEPRECATED + +#define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS + +#define HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_DEFAULT +#define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT HB_BUFFER_SERIALIZE_FLAG_DEFAULT + +#endif + +HB_END_DECLS + +#endif /* HB_DEPRECATED_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-face-private.hh b/3rdparty/harfbuzz-1.0.6/hb-face-private.hh new file mode 100644 index 0000000000..c4266fff4f --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-face-private.hh @@ -0,0 +1,107 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_FACE_PRIVATE_HH +#define HB_FACE_PRIVATE_HH + +#include "hb-private.hh" + +#include "hb-object-private.hh" +#include "hb-shaper-private.hh" +#include "hb-shape-plan-private.hh" + + +/* + * hb_face_t + */ + +struct hb_face_t { + hb_object_header_t header; + ASSERT_POD (); + + hb_bool_t immutable; + + hb_reference_table_func_t reference_table_func; + void *user_data; + hb_destroy_func_t destroy; + + unsigned int index; + mutable unsigned int upem; + mutable unsigned int num_glyphs; + + struct hb_shaper_data_t shaper_data; + + struct plan_node_t { + hb_shape_plan_t *shape_plan; + plan_node_t *next; + } *shape_plans; + + + inline hb_blob_t *reference_table (hb_tag_t tag) const + { + hb_blob_t *blob; + + if (unlikely (!reference_table_func)) + return hb_blob_get_empty (); + + blob = reference_table_func (/*XXX*/const_cast (this), tag, user_data); + if (unlikely (!blob)) + return hb_blob_get_empty (); + + return blob; + } + + inline HB_PURE_FUNC unsigned int get_upem (void) const + { + if (unlikely (!upem)) + load_upem (); + return upem; + } + + inline unsigned int get_num_glyphs (void) const + { + if (unlikely (num_glyphs == (unsigned int) -1)) + load_num_glyphs (); + return num_glyphs; + } + + private: + HB_INTERNAL void load_upem (void) const; + HB_INTERNAL void load_num_glyphs (void) const; +}; + +extern HB_INTERNAL const hb_face_t _hb_face_nil; + +#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS +#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, face); +#include "hb-shaper-list.hh" +#undef HB_SHAPER_IMPLEMENT +#undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS + + +#endif /* HB_FACE_PRIVATE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-face.cc b/3rdparty/harfbuzz-1.0.6/hb-face.cc new file mode 100644 index 0000000000..9effc41c88 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-face.cc @@ -0,0 +1,481 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-private.hh" + +#include "hb-ot-layout-private.hh" + +#include "hb-font-private.hh" +#include "hb-open-file-private.hh" +#include "hb-ot-head-table.hh" +#include "hb-ot-maxp-table.hh" + +#include "hb-cache-private.hh" + +#include + + +/* + * hb_face_t + */ + +const hb_face_t _hb_face_nil = { + HB_OBJECT_HEADER_STATIC, + + true, /* immutable */ + + NULL, /* reference_table_func */ + NULL, /* user_data */ + NULL, /* destroy */ + + 0, /* index */ + 1000, /* upem */ + 0, /* num_glyphs */ + + { +#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID, +#include "hb-shaper-list.hh" +#undef HB_SHAPER_IMPLEMENT + }, + + NULL, /* shape_plans */ +}; + + +/** + * hb_face_create_for_tables: + * @reference_table_func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Return value: (transfer full) + * + * Since: 0.9.2 + **/ +hb_face_t * +hb_face_create_for_tables (hb_reference_table_func_t reference_table_func, + void *user_data, + hb_destroy_func_t destroy) +{ + hb_face_t *face; + + if (!reference_table_func || !(face = hb_object_create ())) { + if (destroy) + destroy (user_data); + return hb_face_get_empty (); + } + + face->reference_table_func = reference_table_func; + face->user_data = user_data; + face->destroy = destroy; + + face->upem = 0; + face->num_glyphs = (unsigned int) -1; + + return face; +} + + +typedef struct hb_face_for_data_closure_t { + hb_blob_t *blob; + unsigned int index; +} hb_face_for_data_closure_t; + +static hb_face_for_data_closure_t * +_hb_face_for_data_closure_create (hb_blob_t *blob, unsigned int index) +{ + hb_face_for_data_closure_t *closure; + + closure = (hb_face_for_data_closure_t *) calloc (1, sizeof (hb_face_for_data_closure_t)); + if (unlikely (!closure)) + return NULL; + + closure->blob = blob; + closure->index = index; + + return closure; +} + +static void +_hb_face_for_data_closure_destroy (hb_face_for_data_closure_t *closure) +{ + hb_blob_destroy (closure->blob); + free (closure); +} + +static hb_blob_t * +_hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) +{ + hb_face_for_data_closure_t *data = (hb_face_for_data_closure_t *) user_data; + + if (tag == HB_TAG_NONE) + return hb_blob_reference (data->blob); + + const OT::OpenTypeFontFile &ot_file = *OT::Sanitizer::lock_instance (data->blob); + const OT::OpenTypeFontFace &ot_face = ot_file.get_face (data->index); + + const OT::OpenTypeTable &table = ot_face.get_table_by_tag (tag); + + hb_blob_t *blob = hb_blob_create_sub_blob (data->blob, table.offset, table.length); + + return blob; +} + +/** + * hb_face_create: (Xconstructor) + * @blob: + * @index: + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_face_t * +hb_face_create (hb_blob_t *blob, + unsigned int index) +{ + hb_face_t *face; + + if (unlikely (!blob)) + blob = hb_blob_get_empty (); + + hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (OT::Sanitizer::sanitize (hb_blob_reference (blob)), index); + + if (unlikely (!closure)) + return hb_face_get_empty (); + + face = hb_face_create_for_tables (_hb_face_for_data_reference_table, + closure, + (hb_destroy_func_t) _hb_face_for_data_closure_destroy); + + hb_face_set_index (face, index); + + return face; +} + +/** + * hb_face_get_empty: + * + * + * + * Return value: (transfer full) + * + * Since: 0.9.2 + **/ +hb_face_t * +hb_face_get_empty (void) +{ + return const_cast (&_hb_face_nil); +} + + +/** + * hb_face_reference: (skip) + * @face: a face. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_face_t * +hb_face_reference (hb_face_t *face) +{ + return hb_object_reference (face); +} + +/** + * hb_face_destroy: (skip) + * @face: a face. + * + * + * + * Since: 0.9.2 + **/ +void +hb_face_destroy (hb_face_t *face) +{ + if (!hb_object_destroy (face)) return; + + for (hb_face_t::plan_node_t *node = face->shape_plans; node; ) + { + hb_face_t::plan_node_t *next = node->next; + hb_shape_plan_destroy (node->shape_plan); + free (node); + node = next; + } + +#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_DESTROY(shaper, face); +#include "hb-shaper-list.hh" +#undef HB_SHAPER_IMPLEMENT + + if (face->destroy) + face->destroy (face->user_data); + + free (face); +} + +/** + * hb_face_set_user_data: (skip) + * @face: a face. + * @key: + * @data: + * @destroy: + * @replace: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_face_set_user_data (hb_face_t *face, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (face, key, data, destroy, replace); +} + +/** + * hb_face_get_user_data: (skip) + * @face: a face. + * @key: + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +void * +hb_face_get_user_data (hb_face_t *face, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (face, key); +} + +/** + * hb_face_make_immutable: + * @face: a face. + * + * + * + * Since: 0.9.2 + **/ +void +hb_face_make_immutable (hb_face_t *face) +{ + if (unlikely (hb_object_is_inert (face))) + return; + + face->immutable = true; +} + +/** + * hb_face_is_immutable: + * @face: a face. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_face_is_immutable (hb_face_t *face) +{ + return face->immutable; +} + + +/** + * hb_face_reference_table: + * @face: a face. + * @tag: + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_blob_t * +hb_face_reference_table (hb_face_t *face, + hb_tag_t tag) +{ + return face->reference_table (tag); +} + +/** + * hb_face_reference_blob: + * @face: a face. + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_blob_t * +hb_face_reference_blob (hb_face_t *face) +{ + return face->reference_table (HB_TAG_NONE); +} + +/** + * hb_face_set_index: + * @face: a face. + * @index: + * + * + * + * Since: 0.9.2 + **/ +void +hb_face_set_index (hb_face_t *face, + unsigned int index) +{ + if (face->immutable) + return; + + face->index = index; +} + +/** + * hb_face_get_index: + * @face: a face. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +unsigned int +hb_face_get_index (hb_face_t *face) +{ + return face->index; +} + +/** + * hb_face_set_upem: + * @face: a face. + * @upem: + * + * + * + * Since: 0.9.2 + **/ +void +hb_face_set_upem (hb_face_t *face, + unsigned int upem) +{ + if (face->immutable) + return; + + face->upem = upem; +} + +/** + * hb_face_get_upem: + * @face: a face. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +unsigned int +hb_face_get_upem (hb_face_t *face) +{ + return face->get_upem (); +} + +void +hb_face_t::load_upem (void) const +{ + hb_blob_t *head_blob = OT::Sanitizer::sanitize (reference_table (HB_OT_TAG_head)); + const OT::head *head_table = OT::Sanitizer::lock_instance (head_blob); + upem = head_table->get_upem (); + hb_blob_destroy (head_blob); +} + +/** + * hb_face_set_glyph_count: + * @face: a face. + * @glyph_count: + * + * + * + * Since: 0.9.7 + **/ +void +hb_face_set_glyph_count (hb_face_t *face, + unsigned int glyph_count) +{ + if (face->immutable) + return; + + face->num_glyphs = glyph_count; +} + +/** + * hb_face_get_glyph_count: + * @face: a face. + * + * + * + * Return value: + * + * Since: 0.9.7 + **/ +unsigned int +hb_face_get_glyph_count (hb_face_t *face) +{ + return face->get_num_glyphs (); +} + +void +hb_face_t::load_num_glyphs (void) const +{ + hb_blob_t *maxp_blob = OT::Sanitizer::sanitize (reference_table (HB_OT_TAG_maxp)); + const OT::maxp *maxp_table = OT::Sanitizer::lock_instance (maxp_blob); + num_glyphs = maxp_table->get_num_glyphs (); + hb_blob_destroy (maxp_blob); +} + + diff --git a/3rdparty/harfbuzz-1.0.6/hb-face.h b/3rdparty/harfbuzz-1.0.6/hb-face.h new file mode 100644 index 0000000000..f682c468de --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-face.h @@ -0,0 +1,117 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + */ + +#ifndef HB_H_IN +#error "Include instead." +#endif + +#ifndef HB_FACE_H +#define HB_FACE_H + +#include "hb-common.h" +#include "hb-blob.h" + +HB_BEGIN_DECLS + + +/* + * hb_face_t + */ + +typedef struct hb_face_t hb_face_t; + +hb_face_t * +hb_face_create (hb_blob_t *blob, + unsigned int index); + +typedef hb_blob_t * (*hb_reference_table_func_t) (hb_face_t *face, hb_tag_t tag, void *user_data); + +/* calls destroy() when not needing user_data anymore */ +hb_face_t * +hb_face_create_for_tables (hb_reference_table_func_t reference_table_func, + void *user_data, + hb_destroy_func_t destroy); + +hb_face_t * +hb_face_get_empty (void); + +hb_face_t * +hb_face_reference (hb_face_t *face); + +void +hb_face_destroy (hb_face_t *face); + +hb_bool_t +hb_face_set_user_data (hb_face_t *face, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace); + + +void * +hb_face_get_user_data (hb_face_t *face, + hb_user_data_key_t *key); + +void +hb_face_make_immutable (hb_face_t *face); + +hb_bool_t +hb_face_is_immutable (hb_face_t *face); + + +hb_blob_t * +hb_face_reference_table (hb_face_t *face, + hb_tag_t tag); + +hb_blob_t * +hb_face_reference_blob (hb_face_t *face); + +void +hb_face_set_index (hb_face_t *face, + unsigned int index); + +unsigned int +hb_face_get_index (hb_face_t *face); + +void +hb_face_set_upem (hb_face_t *face, + unsigned int upem); + +unsigned int +hb_face_get_upem (hb_face_t *face); + +void +hb_face_set_glyph_count (hb_face_t *face, + unsigned int glyph_count); + +unsigned int +hb_face_get_glyph_count (hb_face_t *face); + + +HB_END_DECLS + +#endif /* HB_FACE_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-fallback-shape.cc b/3rdparty/harfbuzz-1.0.6/hb-fallback-shape.cc new file mode 100644 index 0000000000..9d061a9e84 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-fallback-shape.cc @@ -0,0 +1,141 @@ +/* + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#define HB_SHAPER fallback +#include "hb-shaper-impl-private.hh" + + +/* + * shaper face data + */ + +struct hb_fallback_shaper_face_data_t {}; + +hb_fallback_shaper_face_data_t * +_hb_fallback_shaper_face_data_create (hb_face_t *face HB_UNUSED) +{ + return (hb_fallback_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED; +} + +void +_hb_fallback_shaper_face_data_destroy (hb_fallback_shaper_face_data_t *data HB_UNUSED) +{ +} + + +/* + * shaper font data + */ + +struct hb_fallback_shaper_font_data_t {}; + +hb_fallback_shaper_font_data_t * +_hb_fallback_shaper_font_data_create (hb_font_t *font HB_UNUSED) +{ + return (hb_fallback_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED; +} + +void +_hb_fallback_shaper_font_data_destroy (hb_fallback_shaper_font_data_t *data HB_UNUSED) +{ +} + + +/* + * shaper shape_plan data + */ + +struct hb_fallback_shaper_shape_plan_data_t {}; + +hb_fallback_shaper_shape_plan_data_t * +_hb_fallback_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan HB_UNUSED, + const hb_feature_t *user_features HB_UNUSED, + unsigned int num_user_features HB_UNUSED) +{ + return (hb_fallback_shaper_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED; +} + +void +_hb_fallback_shaper_shape_plan_data_destroy (hb_fallback_shaper_shape_plan_data_t *data HB_UNUSED) +{ +} + + +/* + * shaper + */ + +hb_bool_t +_hb_fallback_shape (hb_shape_plan_t *shape_plan HB_UNUSED, + hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features HB_UNUSED, + unsigned int num_features HB_UNUSED) +{ + /* TODO + * + * - Apply fallback kern. + * - Handle Variation Selectors? + * - Apply normalization? + * + * This will make the fallback shaper into a dumb "TrueType" + * shaper which many people unfortunately still request. + */ + + hb_codepoint_t space; + bool has_space = font->get_glyph (' ', 0, &space); + + buffer->clear_positions (); + + hb_direction_t direction = buffer->props.direction; + hb_unicode_funcs_t *unicode = buffer->unicode; + unsigned int count = buffer->len; + hb_glyph_info_t *info = buffer->info; + hb_glyph_position_t *pos = buffer->pos; + for (unsigned int i = 0; i < count; i++) + { + if (has_space && unicode->is_default_ignorable (info[i].codepoint)) { + info[i].codepoint = space; + pos[i].x_advance = 0; + pos[i].y_advance = 0; + continue; + } + font->get_glyph (info[i].codepoint, 0, &info[i].codepoint); + font->get_glyph_advance_for_direction (info[i].codepoint, + direction, + &pos[i].x_advance, + &pos[i].y_advance); + font->subtract_glyph_origin_for_direction (info[i].codepoint, + direction, + &pos[i].x_offset, + &pos[i].y_offset); + } + + if (HB_DIRECTION_IS_BACKWARD (direction)) + hb_buffer_reverse (buffer); + + return true; +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-font-private.hh b/3rdparty/harfbuzz-1.0.6/hb-font-private.hh new file mode 100644 index 0000000000..c05499d4c2 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-font-private.hh @@ -0,0 +1,415 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_FONT_PRIVATE_HH +#define HB_FONT_PRIVATE_HH + +#include "hb-private.hh" + +#include "hb-object-private.hh" +#include "hb-face-private.hh" +#include "hb-shaper-private.hh" + + + +/* + * hb_font_funcs_t + */ + +#define HB_FONT_FUNCS_IMPLEMENT_CALLBACKS \ + HB_FONT_FUNC_IMPLEMENT (glyph) \ + HB_FONT_FUNC_IMPLEMENT (glyph_h_advance) \ + HB_FONT_FUNC_IMPLEMENT (glyph_v_advance) \ + HB_FONT_FUNC_IMPLEMENT (glyph_h_origin) \ + HB_FONT_FUNC_IMPLEMENT (glyph_v_origin) \ + HB_FONT_FUNC_IMPLEMENT (glyph_h_kerning) \ + HB_FONT_FUNC_IMPLEMENT (glyph_v_kerning) \ + HB_FONT_FUNC_IMPLEMENT (glyph_extents) \ + HB_FONT_FUNC_IMPLEMENT (glyph_contour_point) \ + HB_FONT_FUNC_IMPLEMENT (glyph_name) \ + HB_FONT_FUNC_IMPLEMENT (glyph_from_name) \ + /* ^--- Add new callbacks here */ + +struct hb_font_funcs_t { + hb_object_header_t header; + ASSERT_POD (); + + hb_bool_t immutable; + + /* Don't access these directly. Call hb_font_get_*() instead. */ + + struct { +#define HB_FONT_FUNC_IMPLEMENT(name) hb_font_get_##name##_func_t name; + HB_FONT_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_FONT_FUNC_IMPLEMENT + } get; + + struct { +#define HB_FONT_FUNC_IMPLEMENT(name) void *name; + HB_FONT_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_FONT_FUNC_IMPLEMENT + } user_data; + + struct { +#define HB_FONT_FUNC_IMPLEMENT(name) hb_destroy_func_t name; + HB_FONT_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_FONT_FUNC_IMPLEMENT + } destroy; +}; + + + +/* + * hb_font_t + */ + +struct hb_font_t { + hb_object_header_t header; + ASSERT_POD (); + + hb_bool_t immutable; + + hb_font_t *parent; + hb_face_t *face; + + int x_scale; + int y_scale; + + unsigned int x_ppem; + unsigned int y_ppem; + + hb_font_funcs_t *klass; + void *user_data; + hb_destroy_func_t destroy; + + struct hb_shaper_data_t shaper_data; + + + /* Convert from font-space to user-space */ + inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, this->x_scale); } + inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, this->y_scale); } + + /* Convert from parent-font user-space to our user-space */ + inline hb_position_t parent_scale_x_distance (hb_position_t v) { + if (unlikely (parent && parent->x_scale != x_scale)) + return (hb_position_t) (v * (int64_t) this->x_scale / this->parent->x_scale); + return v; + } + inline hb_position_t parent_scale_y_distance (hb_position_t v) { + if (unlikely (parent && parent->y_scale != y_scale)) + return (hb_position_t) (v * (int64_t) this->y_scale / this->parent->y_scale); + return v; + } + inline hb_position_t parent_scale_x_position (hb_position_t v) { + return parent_scale_x_distance (v); + } + inline hb_position_t parent_scale_y_position (hb_position_t v) { + return parent_scale_y_distance (v); + } + + inline void parent_scale_distance (hb_position_t *x, hb_position_t *y) { + *x = parent_scale_x_distance (*x); + *y = parent_scale_y_distance (*y); + } + inline void parent_scale_position (hb_position_t *x, hb_position_t *y) { + *x = parent_scale_x_position (*x); + *y = parent_scale_y_position (*y); + } + + + /* Public getters */ + + inline hb_bool_t has_glyph (hb_codepoint_t unicode) + { + hb_codepoint_t glyph; + return get_glyph (unicode, 0, &glyph); + } + + inline hb_bool_t get_glyph (hb_codepoint_t unicode, hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) + { + *glyph = 0; + return klass->get.glyph (this, user_data, + unicode, variation_selector, glyph, + klass->user_data.glyph); + } + + inline hb_position_t get_glyph_h_advance (hb_codepoint_t glyph) + { + return klass->get.glyph_h_advance (this, user_data, + glyph, + klass->user_data.glyph_h_advance); + } + + inline hb_position_t get_glyph_v_advance (hb_codepoint_t glyph) + { + return klass->get.glyph_v_advance (this, user_data, + glyph, + klass->user_data.glyph_v_advance); + } + + inline hb_bool_t get_glyph_h_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) + { + *x = *y = 0; + return klass->get.glyph_h_origin (this, user_data, + glyph, x, y, + klass->user_data.glyph_h_origin); + } + + inline hb_bool_t get_glyph_v_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) + { + *x = *y = 0; + return klass->get.glyph_v_origin (this, user_data, + glyph, x, y, + klass->user_data.glyph_v_origin); + } + + inline hb_position_t get_glyph_h_kerning (hb_codepoint_t left_glyph, hb_codepoint_t right_glyph) + { + return klass->get.glyph_h_kerning (this, user_data, + left_glyph, right_glyph, + klass->user_data.glyph_h_kerning); + } + + inline hb_position_t get_glyph_v_kerning (hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph) + { + return klass->get.glyph_v_kerning (this, user_data, + top_glyph, bottom_glyph, + klass->user_data.glyph_v_kerning); + } + + inline hb_bool_t get_glyph_extents (hb_codepoint_t glyph, + hb_glyph_extents_t *extents) + { + memset (extents, 0, sizeof (*extents)); + return klass->get.glyph_extents (this, user_data, + glyph, + extents, + klass->user_data.glyph_extents); + } + + inline hb_bool_t get_glyph_contour_point (hb_codepoint_t glyph, unsigned int point_index, + hb_position_t *x, hb_position_t *y) + { + *x = *y = 0; + return klass->get.glyph_contour_point (this, user_data, + glyph, point_index, + x, y, + klass->user_data.glyph_contour_point); + } + + inline hb_bool_t get_glyph_name (hb_codepoint_t glyph, + char *name, unsigned int size) + { + if (size) *name = '\0'; + return klass->get.glyph_name (this, user_data, + glyph, + name, size, + klass->user_data.glyph_name); + } + + inline hb_bool_t get_glyph_from_name (const char *name, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph) + { + *glyph = 0; + if (len == -1) len = strlen (name); + return klass->get.glyph_from_name (this, user_data, + name, len, + glyph, + klass->user_data.glyph_from_name); + } + + + /* A bit higher-level, and with fallback */ + + inline void get_glyph_advance_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) + { + if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) { + *x = get_glyph_h_advance (glyph); + *y = 0; + } else { + *x = 0; + *y = get_glyph_v_advance (glyph); + } + } + + /* Internal only */ + inline void guess_v_origin_minus_h_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) + { + *x = get_glyph_h_advance (glyph) / 2; + + /* TODO use font_metrics.ascent */ + *y = y_scale; + } + + inline void get_glyph_origin_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) + { + if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) + { + if (!get_glyph_h_origin (glyph, x, y) && + get_glyph_v_origin (glyph, x, y)) + { + hb_position_t dx, dy; + guess_v_origin_minus_h_origin (glyph, &dx, &dy); + *x -= dx; *y -= dy; + } + } + else + { + if (!get_glyph_v_origin (glyph, x, y) && + get_glyph_h_origin (glyph, x, y)) + { + hb_position_t dx, dy; + guess_v_origin_minus_h_origin (glyph, &dx, &dy); + *x += dx; *y += dy; + } + } + } + + inline void add_glyph_origin_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) + { + hb_position_t origin_x, origin_y; + + get_glyph_origin_for_direction (glyph, direction, &origin_x, &origin_y); + + *x += origin_x; + *y += origin_y; + } + + inline void subtract_glyph_origin_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) + { + hb_position_t origin_x, origin_y; + + get_glyph_origin_for_direction (glyph, direction, &origin_x, &origin_y); + + *x -= origin_x; + *y -= origin_y; + } + + inline void get_glyph_kerning_for_direction (hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) + { + if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) { + *x = get_glyph_h_kerning (first_glyph, second_glyph); + *y = 0; + } else { + *x = 0; + *y = get_glyph_v_kerning (first_glyph, second_glyph); + } + } + + inline hb_bool_t get_glyph_extents_for_origin (hb_codepoint_t glyph, + hb_direction_t direction, + hb_glyph_extents_t *extents) + { + hb_bool_t ret = get_glyph_extents (glyph, extents); + + if (ret) + subtract_glyph_origin_for_direction (glyph, direction, &extents->x_bearing, &extents->y_bearing); + + return ret; + } + + inline hb_bool_t get_glyph_contour_point_for_origin (hb_codepoint_t glyph, unsigned int point_index, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) + { + hb_bool_t ret = get_glyph_contour_point (glyph, point_index, x, y); + + if (ret) + subtract_glyph_origin_for_direction (glyph, direction, x, y); + + return ret; + } + + /* Generates gidDDD if glyph has no name. */ + inline void + glyph_to_string (hb_codepoint_t glyph, + char *s, unsigned int size) + { + if (get_glyph_name (glyph, s, size)) return; + + if (size && snprintf (s, size, "gid%u", glyph) < 0) + *s = '\0'; + } + + /* Parses gidDDD and uniUUUU strings automatically. */ + inline hb_bool_t + glyph_from_string (const char *s, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph) + { + if (get_glyph_from_name (s, len, glyph)) return true; + + if (len == -1) len = strlen (s); + + /* Straight glyph index. */ + if (hb_codepoint_parse (s, len, 10, glyph)) + return true; + + if (len > 3) + { + /* gidDDD syntax for glyph indices. */ + if (0 == strncmp (s, "gid", 3) && + hb_codepoint_parse (s + 3, len - 3, 10, glyph)) + return true; + + /* uniUUUU and other Unicode character indices. */ + hb_codepoint_t unichar; + if (0 == strncmp (s, "uni", 3) && + hb_codepoint_parse (s + 3, len - 3, 16, &unichar) && + get_glyph (unichar, 0, glyph)) + return true; + } + + return false; + } + + private: + inline hb_position_t em_scale (int16_t v, int scale) { return (hb_position_t) (v * (int64_t) scale / face->get_upem ()); } +}; + +#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS +#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, font); +#include "hb-shaper-list.hh" +#undef HB_SHAPER_IMPLEMENT +#undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS + + +#endif /* HB_FONT_PRIVATE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-font.cc b/3rdparty/harfbuzz-1.0.6/hb-font.cc new file mode 100644 index 0000000000..6a69cae313 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-font.cc @@ -0,0 +1,1266 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-private.hh" + +#include "hb-ot-layout-private.hh" + +#include "hb-font-private.hh" +#include "hb-open-file-private.hh" +#include "hb-ot-head-table.hh" +#include "hb-ot-maxp-table.hh" + +#include "hb-cache-private.hh" + +#include + + +/* + * hb_font_funcs_t + */ + +static hb_bool_t +hb_font_get_glyph_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t unicode, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph, + void *user_data HB_UNUSED) +{ + if (font->parent) + return font->parent->get_glyph (unicode, variation_selector, glyph); + + *glyph = 0; + return false; +} + +static hb_position_t +hb_font_get_glyph_h_advance_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t glyph, + void *user_data HB_UNUSED) +{ + if (font->parent) + return font->parent_scale_x_distance (font->parent->get_glyph_h_advance (glyph)); + + return font->x_scale; +} + +static hb_position_t +hb_font_get_glyph_v_advance_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t glyph, + void *user_data HB_UNUSED) +{ + if (font->parent) + return font->parent_scale_y_distance (font->parent->get_glyph_v_advance (glyph)); + + return font->y_scale; +} + +static hb_bool_t +hb_font_get_glyph_h_origin_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t glyph, + hb_position_t *x, + hb_position_t *y, + void *user_data HB_UNUSED) +{ + if (font->parent) { + hb_bool_t ret = font->parent->get_glyph_h_origin (glyph, x, y); + if (ret) + font->parent_scale_position (x, y); + return ret; + } + + *x = *y = 0; + return false; +} + +static hb_bool_t +hb_font_get_glyph_v_origin_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t glyph, + hb_position_t *x, + hb_position_t *y, + void *user_data HB_UNUSED) +{ + if (font->parent) { + hb_bool_t ret = font->parent->get_glyph_v_origin (glyph, x, y); + if (ret) + font->parent_scale_position (x, y); + return ret; + } + + *x = *y = 0; + return false; +} + +static hb_position_t +hb_font_get_glyph_h_kerning_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t left_glyph, + hb_codepoint_t right_glyph, + void *user_data HB_UNUSED) +{ + if (font->parent) + return font->parent_scale_x_distance (font->parent->get_glyph_h_kerning (left_glyph, right_glyph)); + + return 0; +} + +static hb_position_t +hb_font_get_glyph_v_kerning_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t top_glyph, + hb_codepoint_t bottom_glyph, + void *user_data HB_UNUSED) +{ + if (font->parent) + return font->parent_scale_y_distance (font->parent->get_glyph_v_kerning (top_glyph, bottom_glyph)); + + return 0; +} + +static hb_bool_t +hb_font_get_glyph_extents_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents, + void *user_data HB_UNUSED) +{ + if (font->parent) { + hb_bool_t ret = font->parent->get_glyph_extents (glyph, extents); + if (ret) { + font->parent_scale_position (&extents->x_bearing, &extents->y_bearing); + font->parent_scale_distance (&extents->width, &extents->height); + } + return ret; + } + + memset (extents, 0, sizeof (*extents)); + return false; +} + +static hb_bool_t +hb_font_get_glyph_contour_point_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t glyph, + unsigned int point_index, + hb_position_t *x, + hb_position_t *y, + void *user_data HB_UNUSED) +{ + if (font->parent) { + hb_bool_t ret = font->parent->get_glyph_contour_point (glyph, point_index, x, y); + if (ret) + font->parent_scale_position (x, y); + return ret; + } + + *x = *y = 0; + return false; +} + +static hb_bool_t +hb_font_get_glyph_name_nil (hb_font_t *font, + void *font_data HB_UNUSED, + hb_codepoint_t glyph, + char *name, unsigned int size, + void *user_data HB_UNUSED) +{ + if (font->parent) + return font->parent->get_glyph_name (glyph, name, size); + + if (size) *name = '\0'; + return false; +} + +static hb_bool_t +hb_font_get_glyph_from_name_nil (hb_font_t *font, + void *font_data HB_UNUSED, + const char *name, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph, + void *user_data HB_UNUSED) +{ + if (font->parent) + return font->parent->get_glyph_from_name (name, len, glyph); + + *glyph = 0; + return false; +} + + +static const hb_font_funcs_t _hb_font_funcs_nil = { + HB_OBJECT_HEADER_STATIC, + + true, /* immutable */ + + { +#define HB_FONT_FUNC_IMPLEMENT(name) hb_font_get_##name##_nil, + HB_FONT_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_FONT_FUNC_IMPLEMENT + } +}; + + +/** + * hb_font_funcs_create: (Xconstructor) + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_font_funcs_t * +hb_font_funcs_create (void) +{ + hb_font_funcs_t *ffuncs; + + if (!(ffuncs = hb_object_create ())) + return hb_font_funcs_get_empty (); + + ffuncs->get = _hb_font_funcs_nil.get; + + return ffuncs; +} + +/** + * hb_font_funcs_get_empty: + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_font_funcs_t * +hb_font_funcs_get_empty (void) +{ + return const_cast (&_hb_font_funcs_nil); +} + +/** + * hb_font_funcs_reference: (skip) + * @ffuncs: font functions. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_font_funcs_t * +hb_font_funcs_reference (hb_font_funcs_t *ffuncs) +{ + return hb_object_reference (ffuncs); +} + +/** + * hb_font_funcs_destroy: (skip) + * @ffuncs: font functions. + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_destroy (hb_font_funcs_t *ffuncs) +{ + if (!hb_object_destroy (ffuncs)) return; + +#define HB_FONT_FUNC_IMPLEMENT(name) if (ffuncs->destroy.name) \ + ffuncs->destroy.name (ffuncs->user_data.name); + HB_FONT_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_FONT_FUNC_IMPLEMENT + + free (ffuncs); +} + +/** + * hb_font_funcs_set_user_data: (skip) + * @ffuncs: font functions. + * @key: + * @data: + * @destroy: + * @replace: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (ffuncs, key, data, destroy, replace); +} + +/** + * hb_font_funcs_get_user_data: (skip) + * @ffuncs: font functions. + * @key: + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +void * +hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (ffuncs, key); +} + + +/** + * hb_font_funcs_make_immutable: + * @ffuncs: font functions. + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs) +{ + if (unlikely (hb_object_is_inert (ffuncs))) + return; + + ffuncs->immutable = true; +} + +/** + * hb_font_funcs_is_immutable: + * @ffuncs: font functions. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs) +{ + return ffuncs->immutable; +} + + +#define HB_FONT_FUNC_IMPLEMENT(name) \ + \ +void \ +hb_font_funcs_set_##name##_func (hb_font_funcs_t *ffuncs, \ + hb_font_get_##name##_func_t func, \ + void *user_data, \ + hb_destroy_func_t destroy) \ +{ \ + if (ffuncs->immutable) { \ + if (destroy) \ + destroy (user_data); \ + return; \ + } \ + \ + if (ffuncs->destroy.name) \ + ffuncs->destroy.name (ffuncs->user_data.name); \ + \ + if (func) { \ + ffuncs->get.name = func; \ + ffuncs->user_data.name = user_data; \ + ffuncs->destroy.name = destroy; \ + } else { \ + ffuncs->get.name = hb_font_get_##name##_nil; \ + ffuncs->user_data.name = NULL; \ + ffuncs->destroy.name = NULL; \ + } \ +} + +HB_FONT_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_FONT_FUNC_IMPLEMENT + + +/* Public getters */ + +/** + * hb_font_get_glyph: + * @font: a font. + * @unicode: + * @variation_selector: + * @glyph: (out): + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_get_glyph (hb_font_t *font, + hb_codepoint_t unicode, hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) +{ + return font->get_glyph (unicode, variation_selector, glyph); +} + +/** + * hb_font_get_glyph_h_advance: + * @font: a font. + * @glyph: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_position_t +hb_font_get_glyph_h_advance (hb_font_t *font, + hb_codepoint_t glyph) +{ + return font->get_glyph_h_advance (glyph); +} + +/** + * hb_font_get_glyph_v_advance: + * @font: a font. + * @glyph: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_position_t +hb_font_get_glyph_v_advance (hb_font_t *font, + hb_codepoint_t glyph) +{ + return font->get_glyph_v_advance (glyph); +} + +/** + * hb_font_get_glyph_h_origin: + * @font: a font. + * @glyph: + * @x: (out): + * @y: (out): + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_get_glyph_h_origin (hb_font_t *font, + hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) +{ + return font->get_glyph_h_origin (glyph, x, y); +} + +/** + * hb_font_get_glyph_v_origin: + * @font: a font. + * @glyph: + * @x: (out): + * @y: (out): + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_get_glyph_v_origin (hb_font_t *font, + hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) +{ + return font->get_glyph_v_origin (glyph, x, y); +} + +/** + * hb_font_get_glyph_h_kerning: + * @font: a font. + * @left_glyph: + * @right_glyph: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_position_t +hb_font_get_glyph_h_kerning (hb_font_t *font, + hb_codepoint_t left_glyph, hb_codepoint_t right_glyph) +{ + return font->get_glyph_h_kerning (left_glyph, right_glyph); +} + +/** + * hb_font_get_glyph_v_kerning: + * @font: a font. + * @top_glyph: + * @bottom_glyph: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_position_t +hb_font_get_glyph_v_kerning (hb_font_t *font, + hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph) +{ + return font->get_glyph_v_kerning (top_glyph, bottom_glyph); +} + +/** + * hb_font_get_glyph_extents: + * @font: a font. + * @glyph: + * @extents: (out): + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_get_glyph_extents (hb_font_t *font, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents) +{ + return font->get_glyph_extents (glyph, extents); +} + +/** + * hb_font_get_glyph_contour_point: + * @font: a font. + * @glyph: + * @point_index: + * @x: (out): + * @y: (out): + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_get_glyph_contour_point (hb_font_t *font, + hb_codepoint_t glyph, unsigned int point_index, + hb_position_t *x, hb_position_t *y) +{ + return font->get_glyph_contour_point (glyph, point_index, x, y); +} + +/** + * hb_font_get_glyph_name: + * @font: a font. + * @glyph: + * @name: (array length=size): + * @size: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_get_glyph_name (hb_font_t *font, + hb_codepoint_t glyph, + char *name, unsigned int size) +{ + return font->get_glyph_name (glyph, name, size); +} + +/** + * hb_font_get_glyph_from_name: + * @font: a font. + * @name: (array length=len): + * @len: + * @glyph: (out): + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_get_glyph_from_name (hb_font_t *font, + const char *name, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph) +{ + return font->get_glyph_from_name (name, len, glyph); +} + + +/* A bit higher-level, and with fallback */ + +/** + * hb_font_get_glyph_advance_for_direction: + * @font: a font. + * @glyph: + * @direction: + * @x: (out): + * @y: (out): + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_get_glyph_advance_for_direction (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) +{ + return font->get_glyph_advance_for_direction (glyph, direction, x, y); +} + +/** + * hb_font_get_glyph_origin_for_direction: + * @font: a font. + * @glyph: + * @direction: + * @x: (out): + * @y: (out): + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_get_glyph_origin_for_direction (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) +{ + return font->get_glyph_origin_for_direction (glyph, direction, x, y); +} + +/** + * hb_font_add_glyph_origin_for_direction: + * @font: a font. + * @glyph: + * @direction: + * @x: (out): + * @y: (out): + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_add_glyph_origin_for_direction (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) +{ + return font->add_glyph_origin_for_direction (glyph, direction, x, y); +} + +/** + * hb_font_subtract_glyph_origin_for_direction: + * @font: a font. + * @glyph: + * @direction: + * @x: (out): + * @y: (out): + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_subtract_glyph_origin_for_direction (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) +{ + return font->subtract_glyph_origin_for_direction (glyph, direction, x, y); +} + +/** + * hb_font_get_glyph_kerning_for_direction: + * @font: a font. + * @first_glyph: + * @second_glyph: + * @direction: + * @x: (out): + * @y: (out): + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_get_glyph_kerning_for_direction (hb_font_t *font, + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) +{ + return font->get_glyph_kerning_for_direction (first_glyph, second_glyph, direction, x, y); +} + +/** + * hb_font_get_glyph_extents_for_origin: + * @font: a font. + * @glyph: + * @direction: + * @extents: (out): + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_get_glyph_extents_for_origin (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_glyph_extents_t *extents) +{ + return font->get_glyph_extents_for_origin (glyph, direction, extents); +} + +/** + * hb_font_get_glyph_contour_point_for_origin: + * @font: a font. + * @glyph: + * @point_index: + * @direction: + * @x: (out): + * @y: (out): + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_get_glyph_contour_point_for_origin (hb_font_t *font, + hb_codepoint_t glyph, unsigned int point_index, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) +{ + return font->get_glyph_contour_point_for_origin (glyph, point_index, direction, x, y); +} + +/* Generates gidDDD if glyph has no name. */ +/** + * hb_font_glyph_to_string: + * @font: a font. + * @glyph: + * @s: (array length=size): + * @size: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_glyph_to_string (hb_font_t *font, + hb_codepoint_t glyph, + char *s, unsigned int size) +{ + font->glyph_to_string (glyph, s, size); +} + +/* Parses gidDDD and uniUUUU strings automatically. */ +/** + * hb_font_glyph_from_string: + * @font: a font. + * @s: (array length=len) (element-type uint8_t): + * @len: + * @glyph: (out): + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_glyph_from_string (hb_font_t *font, + const char *s, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph) +{ + return font->glyph_from_string (s, len, glyph); +} + + +/* + * hb_font_t + */ + +/** + * hb_font_create: (Xconstructor) + * @face: a face. + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_font_t * +hb_font_create (hb_face_t *face) +{ + hb_font_t *font; + + if (unlikely (!face)) + face = hb_face_get_empty (); + if (!(font = hb_object_create ())) + return hb_font_get_empty (); + + hb_face_make_immutable (face); + font->face = hb_face_reference (face); + font->klass = hb_font_funcs_get_empty (); + + font->x_scale = font->y_scale = hb_face_get_upem (face); + + return font; +} + +/** + * hb_font_create_sub_font: + * @parent: parent font. + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_font_t * +hb_font_create_sub_font (hb_font_t *parent) +{ + if (unlikely (!parent)) + parent = hb_font_get_empty (); + + hb_font_t *font = hb_font_create (parent->face); + + if (unlikely (hb_object_is_inert (font))) + return font; + + font->parent = hb_font_reference (parent); + + font->x_scale = parent->x_scale; + font->y_scale = parent->y_scale; + font->x_ppem = parent->x_ppem; + font->y_ppem = parent->y_ppem; + + return font; +} + +/** + * hb_font_get_empty: + * + * + * + * Return value: (transfer full) + * + * Since: 0.9.2 + **/ +hb_font_t * +hb_font_get_empty (void) +{ + static const hb_font_t _hb_font_nil = { + HB_OBJECT_HEADER_STATIC, + + true, /* immutable */ + + NULL, /* parent */ + const_cast (&_hb_face_nil), + + 0, /* x_scale */ + 0, /* y_scale */ + + 0, /* x_ppem */ + 0, /* y_ppem */ + + const_cast (&_hb_font_funcs_nil), /* klass */ + NULL, /* user_data */ + NULL, /* destroy */ + + { +#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID, +#include "hb-shaper-list.hh" +#undef HB_SHAPER_IMPLEMENT + } + }; + + return const_cast (&_hb_font_nil); +} + +/** + * hb_font_reference: (skip) + * @font: a font. + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_font_t * +hb_font_reference (hb_font_t *font) +{ + return hb_object_reference (font); +} + +/** + * hb_font_destroy: (skip) + * @font: a font. + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_destroy (hb_font_t *font) +{ + if (!hb_object_destroy (font)) return; + +#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_DESTROY(shaper, font); +#include "hb-shaper-list.hh" +#undef HB_SHAPER_IMPLEMENT + + if (font->destroy) + font->destroy (font->user_data); + + hb_font_destroy (font->parent); + hb_face_destroy (font->face); + hb_font_funcs_destroy (font->klass); + + free (font); +} + +/** + * hb_font_set_user_data: (skip) + * @font: a font. + * @key: + * @data: + * @destroy: + * @replace: + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_set_user_data (hb_font_t *font, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (font, key, data, destroy, replace); +} + +/** + * hb_font_get_user_data: (skip) + * @font: a font. + * @key: + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +void * +hb_font_get_user_data (hb_font_t *font, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (font, key); +} + +/** + * hb_font_make_immutable: + * @font: a font. + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_make_immutable (hb_font_t *font) +{ + if (unlikely (hb_object_is_inert (font))) + return; + + if (font->parent) + hb_font_make_immutable (font->parent); + + font->immutable = true; +} + +/** + * hb_font_is_immutable: + * @font: a font. + * + * + * + * Return value: + * + * Since: 0.9.2 + **/ +hb_bool_t +hb_font_is_immutable (hb_font_t *font) +{ + return font->immutable; +} + +/** + * hb_font_set_parent: + * @font: a font. + * @parent: new parent. + * + * Sets parent font of @font. + * + * Since: 1.0.5 + **/ +void +hb_font_set_parent (hb_font_t *font, + hb_font_t *parent) +{ + if (font->immutable) + return; + + if (!parent) + parent = hb_font_get_empty (); + + hb_font_t *old = font->parent; + + font->parent = hb_font_reference (parent); + + hb_font_destroy (old); +} + +/** + * hb_font_get_parent: + * @font: a font. + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +hb_font_t * +hb_font_get_parent (hb_font_t *font) +{ + return font->parent; +} + +/** + * hb_font_get_face: + * @font: a font. + * + * + * + * Return value: (transfer none): + * + * Since: 0.9.2 + **/ +hb_face_t * +hb_font_get_face (hb_font_t *font) +{ + return font->face; +} + + +/** + * hb_font_set_funcs: + * @font: a font. + * @klass: (closure font_data) (destroy destroy) (scope notified): + * @font_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_set_funcs (hb_font_t *font, + hb_font_funcs_t *klass, + void *font_data, + hb_destroy_func_t destroy) +{ + if (font->immutable) { + if (destroy) + destroy (font_data); + return; + } + + if (font->destroy) + font->destroy (font->user_data); + + if (!klass) + klass = hb_font_funcs_get_empty (); + + hb_font_funcs_reference (klass); + hb_font_funcs_destroy (font->klass); + font->klass = klass; + font->user_data = font_data; + font->destroy = destroy; +} + +/** + * hb_font_set_funcs_data: + * @font: a font. + * @font_data: (destroy destroy) (scope notified): + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_set_funcs_data (hb_font_t *font, + void *font_data, + hb_destroy_func_t destroy) +{ + /* Destroy user_data? */ + if (font->immutable) { + if (destroy) + destroy (font_data); + return; + } + + if (font->destroy) + font->destroy (font->user_data); + + font->user_data = font_data; + font->destroy = destroy; +} + + +/** + * hb_font_set_scale: + * @font: a font. + * @x_scale: + * @y_scale: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_set_scale (hb_font_t *font, + int x_scale, + int y_scale) +{ + if (font->immutable) + return; + + font->x_scale = x_scale; + font->y_scale = y_scale; +} + +/** + * hb_font_get_scale: + * @font: a font. + * @x_scale: (out): + * @y_scale: (out): + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_get_scale (hb_font_t *font, + int *x_scale, + int *y_scale) +{ + if (x_scale) *x_scale = font->x_scale; + if (y_scale) *y_scale = font->y_scale; +} + +/** + * hb_font_set_ppem: + * @font: a font. + * @x_ppem: + * @y_ppem: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_set_ppem (hb_font_t *font, + unsigned int x_ppem, + unsigned int y_ppem) +{ + if (font->immutable) + return; + + font->x_ppem = x_ppem; + font->y_ppem = y_ppem; +} + +/** + * hb_font_get_ppem: + * @font: a font. + * @x_ppem: (out): + * @y_ppem: (out): + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_get_ppem (hb_font_t *font, + unsigned int *x_ppem, + unsigned int *y_ppem) +{ + if (x_ppem) *x_ppem = font->x_ppem; + if (y_ppem) *y_ppem = font->y_ppem; +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-font.h b/3rdparty/harfbuzz-1.0.6/hb-font.h new file mode 100644 index 0000000000..fb4a0eab5a --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-font.h @@ -0,0 +1,512 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + */ + +#ifndef HB_H_IN +#error "Include instead." +#endif + +#ifndef HB_FONT_H +#define HB_FONT_H + +#include "hb-common.h" +#include "hb-face.h" + +HB_BEGIN_DECLS + + +typedef struct hb_font_t hb_font_t; + + +/* + * hb_font_funcs_t + */ + +typedef struct hb_font_funcs_t hb_font_funcs_t; + +hb_font_funcs_t * +hb_font_funcs_create (void); + +hb_font_funcs_t * +hb_font_funcs_get_empty (void); + +hb_font_funcs_t * +hb_font_funcs_reference (hb_font_funcs_t *ffuncs); + +void +hb_font_funcs_destroy (hb_font_funcs_t *ffuncs); + +hb_bool_t +hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace); + + +void * +hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs, + hb_user_data_key_t *key); + + +void +hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs); + +hb_bool_t +hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs); + + +/* glyph extents */ + +/* Note that height is negative in coordinate systems that grow up. */ +typedef struct hb_glyph_extents_t +{ + hb_position_t x_bearing; /* left side of glyph from origin. */ + hb_position_t y_bearing; /* top side of glyph from origin. */ + hb_position_t width; /* distance from left to right side. */ + hb_position_t height; /* distance from top to bottom side. */ +} hb_glyph_extents_t; + + +/* func types */ + +typedef hb_bool_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data, + hb_codepoint_t unicode, hb_codepoint_t variation_selector, + hb_codepoint_t *glyph, + void *user_data); + + +typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, + void *user_data); +typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_h_advance_func_t; +typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t; + +typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y, + void *user_data); +typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t; +typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t; + +typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data, + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + void *user_data); +typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t; +typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t; + + +typedef hb_bool_t (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents, + void *user_data); +typedef hb_bool_t (*hb_font_get_glyph_contour_point_func_t) (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, unsigned int point_index, + hb_position_t *x, hb_position_t *y, + void *user_data); + + +typedef hb_bool_t (*hb_font_get_glyph_name_func_t) (hb_font_t *font, void *font_data, + hb_codepoint_t glyph, + char *name, unsigned int size, + void *user_data); +typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *font_data, + const char *name, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph, + void *user_data); + + +/* func setters */ + +/** + * hb_font_funcs_set_glyph_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_h_advance_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_h_advance_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_v_advance_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_v_advance_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_h_origin_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_h_origin_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_v_origin_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_v_origin_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_h_kerning_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_h_kerning_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_v_kerning_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_v_kerning_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_extents_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_extents_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_contour_point_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_contour_point_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_name_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_name_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_from_name_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +void +hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_from_name_func_t func, + void *user_data, hb_destroy_func_t destroy); + + +/* func dispatch */ + +hb_bool_t +hb_font_get_glyph (hb_font_t *font, + hb_codepoint_t unicode, hb_codepoint_t variation_selector, + hb_codepoint_t *glyph); + +hb_position_t +hb_font_get_glyph_h_advance (hb_font_t *font, + hb_codepoint_t glyph); +hb_position_t +hb_font_get_glyph_v_advance (hb_font_t *font, + hb_codepoint_t glyph); + +hb_bool_t +hb_font_get_glyph_h_origin (hb_font_t *font, + hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y); +hb_bool_t +hb_font_get_glyph_v_origin (hb_font_t *font, + hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y); + +hb_position_t +hb_font_get_glyph_h_kerning (hb_font_t *font, + hb_codepoint_t left_glyph, hb_codepoint_t right_glyph); +hb_position_t +hb_font_get_glyph_v_kerning (hb_font_t *font, + hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph); + +hb_bool_t +hb_font_get_glyph_extents (hb_font_t *font, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents); + +hb_bool_t +hb_font_get_glyph_contour_point (hb_font_t *font, + hb_codepoint_t glyph, unsigned int point_index, + hb_position_t *x, hb_position_t *y); + +hb_bool_t +hb_font_get_glyph_name (hb_font_t *font, + hb_codepoint_t glyph, + char *name, unsigned int size); +hb_bool_t +hb_font_get_glyph_from_name (hb_font_t *font, + const char *name, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph); + + +/* high-level funcs, with fallback */ + +void +hb_font_get_glyph_advance_for_direction (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y); +void +hb_font_get_glyph_origin_for_direction (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y); +void +hb_font_add_glyph_origin_for_direction (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y); +void +hb_font_subtract_glyph_origin_for_direction (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y); + +void +hb_font_get_glyph_kerning_for_direction (hb_font_t *font, + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y); + +hb_bool_t +hb_font_get_glyph_extents_for_origin (hb_font_t *font, + hb_codepoint_t glyph, + hb_direction_t direction, + hb_glyph_extents_t *extents); + +hb_bool_t +hb_font_get_glyph_contour_point_for_origin (hb_font_t *font, + hb_codepoint_t glyph, unsigned int point_index, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y); + +/* Generates gidDDD if glyph has no name. */ +void +hb_font_glyph_to_string (hb_font_t *font, + hb_codepoint_t glyph, + char *s, unsigned int size); +/* Parses gidDDD and uniUUUU strings automatically. */ +hb_bool_t +hb_font_glyph_from_string (hb_font_t *font, + const char *s, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph); + + +/* + * hb_font_t + */ + +/* Fonts are very light-weight objects */ + +hb_font_t * +hb_font_create (hb_face_t *face); + +hb_font_t * +hb_font_create_sub_font (hb_font_t *parent); + +hb_font_t * +hb_font_get_empty (void); + +hb_font_t * +hb_font_reference (hb_font_t *font); + +void +hb_font_destroy (hb_font_t *font); + +hb_bool_t +hb_font_set_user_data (hb_font_t *font, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace); + + +void * +hb_font_get_user_data (hb_font_t *font, + hb_user_data_key_t *key); + +void +hb_font_make_immutable (hb_font_t *font); + +hb_bool_t +hb_font_is_immutable (hb_font_t *font); + +void +hb_font_set_parent (hb_font_t *font, + hb_font_t *parent); + +hb_font_t * +hb_font_get_parent (hb_font_t *font); + +hb_face_t * +hb_font_get_face (hb_font_t *font); + + +void +hb_font_set_funcs (hb_font_t *font, + hb_font_funcs_t *klass, + void *font_data, + hb_destroy_func_t destroy); + +/* Be *very* careful with this function! */ +void +hb_font_set_funcs_data (hb_font_t *font, + void *font_data, + hb_destroy_func_t destroy); + + +void +hb_font_set_scale (hb_font_t *font, + int x_scale, + int y_scale); + +void +hb_font_get_scale (hb_font_t *font, + int *x_scale, + int *y_scale); + +/* + * A zero value means "no hinting in that direction" + */ +void +hb_font_set_ppem (hb_font_t *font, + unsigned int x_ppem, + unsigned int y_ppem); + +void +hb_font_get_ppem (hb_font_t *font, + unsigned int *x_ppem, + unsigned int *y_ppem); + + +HB_END_DECLS + +#endif /* HB_FONT_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-ft.cc b/3rdparty/harfbuzz-1.0.6/hb-ft.cc new file mode 100644 index 0000000000..2b11882961 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ft.cc @@ -0,0 +1,650 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2009 Keith Stribley + * Copyright © 2015 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-private.hh" + +#include "hb-ft.h" + +#include "hb-font-private.hh" + +#include FT_ADVANCES_H +#include FT_TRUETYPE_TABLES_H + + + +#ifndef HB_DEBUG_FT +#define HB_DEBUG_FT (HB_DEBUG+0) +#endif + + +/* TODO: + * + * In general, this file does a fine job of what it's supposed to do. + * There are, however, things that need more work: + * + * - I remember seeing FT_Get_Advance() without the NO_HINTING flag to be buggy. + * Have not investigated. + * + * - FreeType works in 26.6 mode. Clients can decide to use that mode, and everything + * would work fine. However, we also abuse this API for performing in font-space, + * but don't pass the correct flags to FreeType. We just abuse the no-hinting mode + * for that, such that no rounding etc happens. As such, we don't set ppem, and + * pass NO_HINTING as load_flags. Would be much better to use NO_SCALE, and scale + * ourselves, like we do in uniscribe, etc. + * + * - We don't handle / allow for emboldening / obliqueing. + * + * - In the future, we should add constructors to create fonts in font space? + * + * - FT_Load_Glyph() is exteremely costly. Do something about it? + */ + + +struct hb_ft_font_t +{ + FT_Face ft_face; + int load_flags; + bool unref; /* Whether to destroy ft_face when done. */ +}; + +static hb_ft_font_t * +_hb_ft_font_create (FT_Face ft_face, bool unref) +{ + hb_ft_font_t *ft_font = (hb_ft_font_t *) calloc (1, sizeof (hb_ft_font_t)); + + if (unlikely (!ft_font)) + return NULL; + + ft_font->ft_face = ft_face; + ft_font->unref = unref; + + ft_font->load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING; + + return ft_font; +} + +static void +_hb_ft_font_destroy (hb_ft_font_t *ft_font) +{ + if (ft_font->unref) + FT_Done_Face (ft_font->ft_face); + + free (ft_font); +} + +/** + * hb_ft_font_set_load_flags: + * @font: + * @load_flags: + * + * + * + * Since: 1.0.5 + **/ +void +hb_ft_font_set_load_flags (hb_font_t *font, int load_flags) +{ + if (font->immutable) + return; + + if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy) + return; + + hb_ft_font_t *ft_font = (hb_ft_font_t *) font->user_data; + + ft_font->load_flags = load_flags; +} + +/** + * hb_ft_font_get_load_flags: + * @font: + * + * + * + * Return value: + * Since: 1.0.5 + **/ +int +hb_ft_font_get_load_flags (hb_font_t *font) +{ + if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy) + return 0; + + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data; + + return ft_font->load_flags; +} + +FT_Face +hb_ft_font_get_face (hb_font_t *font) +{ + if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy) + return NULL; + + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data; + + return ft_font->ft_face; +} + + + +static hb_bool_t +hb_ft_get_glyph (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t unicode, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph, + void *user_data HB_UNUSED) + +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + unsigned int g; + + if (likely (!variation_selector)) + g = FT_Get_Char_Index (ft_font->ft_face, unicode); + else + g = FT_Face_GetCharVariantIndex (ft_font->ft_face, unicode, variation_selector); + + if (unlikely (!g)) + return false; + + *glyph = g; + return true; +} + +static hb_position_t +hb_ft_get_glyph_h_advance (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + FT_Fixed v; + + if (unlikely (FT_Get_Advance (ft_font->ft_face, glyph, ft_font->load_flags, &v))) + return 0; + + if (font->x_scale < 0) + v = -v; + + return (v + (1<<9)) >> 10; +} + +static hb_position_t +hb_ft_get_glyph_v_advance (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + FT_Fixed v; + + if (unlikely (FT_Get_Advance (ft_font->ft_face, glyph, ft_font->load_flags | FT_LOAD_VERTICAL_LAYOUT, &v))) + return 0; + + if (font->y_scale < 0) + v = -v; + + /* Note: FreeType's vertical metrics grows downward while other FreeType coordinates + * have a Y growing upward. Hence the extra negation. */ + return (-v + (1<<9)) >> 10; +} + +static hb_bool_t +hb_ft_get_glyph_h_origin (hb_font_t *font HB_UNUSED, + void *font_data HB_UNUSED, + hb_codepoint_t glyph HB_UNUSED, + hb_position_t *x HB_UNUSED, + hb_position_t *y HB_UNUSED, + void *user_data HB_UNUSED) +{ + /* We always work in the horizontal coordinates. */ + return true; +} + +static hb_bool_t +hb_ft_get_glyph_v_origin (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + hb_position_t *x, + hb_position_t *y, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + FT_Face ft_face = ft_font->ft_face; + + if (unlikely (FT_Load_Glyph (ft_face, glyph, ft_font->load_flags))) + return false; + + /* Note: FreeType's vertical metrics grows downward while other FreeType coordinates + * have a Y growing upward. Hence the extra negation. */ + *x = ft_face->glyph->metrics.horiBearingX - ft_face->glyph->metrics.vertBearingX; + *y = ft_face->glyph->metrics.horiBearingY - (-ft_face->glyph->metrics.vertBearingY); + + if (font->x_scale < 0) + *x = -*x; + if (font->y_scale < 0) + *y = -*y; + + return true; +} + +static hb_position_t +hb_ft_get_glyph_h_kerning (hb_font_t *font, + void *font_data, + hb_codepoint_t left_glyph, + hb_codepoint_t right_glyph, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + FT_Vector kerningv; + + FT_Kerning_Mode mode = font->x_ppem ? FT_KERNING_DEFAULT : FT_KERNING_UNFITTED; + if (FT_Get_Kerning (ft_font->ft_face, left_glyph, right_glyph, mode, &kerningv)) + return 0; + + return kerningv.x; +} + +static hb_position_t +hb_ft_get_glyph_v_kerning (hb_font_t *font HB_UNUSED, + void *font_data HB_UNUSED, + hb_codepoint_t top_glyph HB_UNUSED, + hb_codepoint_t bottom_glyph HB_UNUSED, + void *user_data HB_UNUSED) +{ + /* FreeType API doesn't support vertical kerning */ + return 0; +} + +static hb_bool_t +hb_ft_get_glyph_extents (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + FT_Face ft_face = ft_font->ft_face; + + if (unlikely (FT_Load_Glyph (ft_face, glyph, ft_font->load_flags))) + return false; + + extents->x_bearing = ft_face->glyph->metrics.horiBearingX; + extents->y_bearing = ft_face->glyph->metrics.horiBearingY; + extents->width = ft_face->glyph->metrics.width; + extents->height = -ft_face->glyph->metrics.height; + return true; +} + +static hb_bool_t +hb_ft_get_glyph_contour_point (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + unsigned int point_index, + hb_position_t *x, + hb_position_t *y, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + FT_Face ft_face = ft_font->ft_face; + + if (unlikely (FT_Load_Glyph (ft_face, glyph, ft_font->load_flags))) + return false; + + if (unlikely (ft_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE)) + return false; + + if (unlikely (point_index >= (unsigned int) ft_face->glyph->outline.n_points)) + return false; + + *x = ft_face->glyph->outline.points[point_index].x; + *y = ft_face->glyph->outline.points[point_index].y; + + return true; +} + +static hb_bool_t +hb_ft_get_glyph_name (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + char *name, unsigned int size, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + + hb_bool_t ret = !FT_Get_Glyph_Name (ft_font->ft_face, glyph, name, size); + if (ret && (size && !*name)) + ret = false; + + return ret; +} + +static hb_bool_t +hb_ft_get_glyph_from_name (hb_font_t *font HB_UNUSED, + void *font_data, + const char *name, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + FT_Face ft_face = ft_font->ft_face; + + if (len < 0) + *glyph = FT_Get_Name_Index (ft_face, (FT_String *) name); + else { + /* Make a nul-terminated version. */ + char buf[128]; + len = MIN (len, (int) sizeof (buf) - 1); + strncpy (buf, name, len); + buf[len] = '\0'; + *glyph = FT_Get_Name_Index (ft_face, buf); + } + + if (*glyph == 0) + { + /* Check whether the given name was actually the name of glyph 0. */ + char buf[128]; + if (!FT_Get_Glyph_Name(ft_face, 0, buf, sizeof (buf)) && + len < 0 ? !strcmp (buf, name) : !strncmp (buf, name, len)) + return true; + } + + return *glyph != 0; +} + + +static void +_hb_ft_font_set_funcs (hb_font_t *font, FT_Face ft_face, bool unref) +{ + static const hb_font_funcs_t ft_ffuncs = { + HB_OBJECT_HEADER_STATIC, + + true, /* immutable */ + + { +#define HB_FONT_FUNC_IMPLEMENT(name) hb_ft_get_##name, + HB_FONT_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_FONT_FUNC_IMPLEMENT + } + }; + + hb_font_set_funcs (font, + const_cast (&ft_ffuncs), + _hb_ft_font_create (ft_face, unref), + (hb_destroy_func_t) _hb_ft_font_destroy); +} + + +static hb_blob_t * +reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) +{ + FT_Face ft_face = (FT_Face) user_data; + FT_Byte *buffer; + FT_ULong length = 0; + FT_Error error; + + /* Note: FreeType like HarfBuzz uses the NONE tag for fetching the entire blob */ + + error = FT_Load_Sfnt_Table (ft_face, tag, 0, NULL, &length); + if (error) + return NULL; + + buffer = (FT_Byte *) malloc (length); + if (buffer == NULL) + return NULL; + + error = FT_Load_Sfnt_Table (ft_face, tag, 0, buffer, &length); + if (error) + return NULL; + + return hb_blob_create ((const char *) buffer, length, + HB_MEMORY_MODE_WRITABLE, + buffer, free); +} + +/** + * hb_ft_face_create: + * @ft_face: (destroy destroy) (scope notified): + * @destroy: + * + * + * + * Return value: (transfer full): + * Since: 0.9.2 + **/ +hb_face_t * +hb_ft_face_create (FT_Face ft_face, + hb_destroy_func_t destroy) +{ + hb_face_t *face; + + if (ft_face->stream->read == NULL) { + hb_blob_t *blob; + + blob = hb_blob_create ((const char *) ft_face->stream->base, + (unsigned int) ft_face->stream->size, + HB_MEMORY_MODE_READONLY, + ft_face, destroy); + face = hb_face_create (blob, ft_face->face_index); + hb_blob_destroy (blob); + } else { + face = hb_face_create_for_tables (reference_table, ft_face, destroy); + } + + hb_face_set_index (face, ft_face->face_index); + hb_face_set_upem (face, ft_face->units_per_EM); + + return face; +} + +/** + * hb_ft_face_create_referenced: + * @ft_face: + * + * + * + * Return value: (transfer full): + * Since: 0.9.38 + **/ +hb_face_t * +hb_ft_face_create_referenced (FT_Face ft_face) +{ + FT_Reference_Face (ft_face); + return hb_ft_face_create (ft_face, (hb_destroy_func_t) FT_Done_Face); +} + +static void +hb_ft_face_finalize (FT_Face ft_face) +{ + hb_face_destroy ((hb_face_t *) ft_face->generic.data); +} + +/** + * hb_ft_face_create_cached: + * @ft_face: + * + * + * + * Return value: (transfer full): + * Since: 0.9.2 + **/ +hb_face_t * +hb_ft_face_create_cached (FT_Face ft_face) +{ + if (unlikely (!ft_face->generic.data || ft_face->generic.finalizer != (FT_Generic_Finalizer) hb_ft_face_finalize)) + { + if (ft_face->generic.finalizer) + ft_face->generic.finalizer (ft_face); + + ft_face->generic.data = hb_ft_face_create (ft_face, NULL); + ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize; + } + + return hb_face_reference ((hb_face_t *) ft_face->generic.data); +} + + +/** + * hb_ft_font_create: + * @ft_face: (destroy destroy) (scope notified): + * @destroy: + * + * + * + * Return value: (transfer full): + * Since: 0.9.2 + **/ +hb_font_t * +hb_ft_font_create (FT_Face ft_face, + hb_destroy_func_t destroy) +{ + hb_font_t *font; + hb_face_t *face; + + face = hb_ft_face_create (ft_face, destroy); + font = hb_font_create (face); + hb_face_destroy (face); + _hb_ft_font_set_funcs (font, ft_face, false); + hb_font_set_scale (font, + (int) (((uint64_t) ft_face->size->metrics.x_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16), + (int) (((uint64_t) ft_face->size->metrics.y_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16)); +#if 0 /* hb-ft works in no-hinting model */ + hb_font_set_ppem (font, + ft_face->size->metrics.x_ppem, + ft_face->size->metrics.y_ppem); +#endif + + return font; +} + +/** + * hb_ft_font_create_referenced: + * @ft_face: + * + * + * + * Return value: (transfer full): + * Since: 0.9.38 + **/ +hb_font_t * +hb_ft_font_create_referenced (FT_Face ft_face) +{ + FT_Reference_Face (ft_face); + return hb_ft_font_create (ft_face, (hb_destroy_func_t) FT_Done_Face); +} + + +/* Thread-safe, lock-free, FT_Library */ + +static FT_Library ft_library; + +#ifdef HB_USE_ATEXIT +static +void free_ft_library (void) +{ + FT_Done_FreeType (ft_library); +} +#endif + +static FT_Library +get_ft_library (void) +{ +retry: + FT_Library library = (FT_Library) hb_atomic_ptr_get (&ft_library); + + if (unlikely (!library)) + { + /* Not found; allocate one. */ + if (FT_Init_FreeType (&library)) + return NULL; + + if (!hb_atomic_ptr_cmpexch (&ft_library, NULL, library)) { + FT_Done_FreeType (library); + goto retry; + } + +#ifdef HB_USE_ATEXIT + atexit (free_ft_library); /* First person registers atexit() callback. */ +#endif + } + + return library; +} + +static void +_release_blob (FT_Face ft_face) +{ + hb_blob_destroy ((hb_blob_t *) ft_face->generic.data); +} + +void +hb_ft_font_set_funcs (hb_font_t *font) +{ + hb_blob_t *blob = hb_face_reference_blob (font->face); + unsigned int blob_length; + const char *blob_data = hb_blob_get_data (blob, &blob_length); + if (unlikely (!blob_length)) + DEBUG_MSG (FT, font, "Font face has empty blob"); + + FT_Face ft_face = NULL; + FT_Error err = FT_New_Memory_Face (get_ft_library (), + (const FT_Byte *) blob_data, + blob_length, + hb_face_get_index (font->face), + &ft_face); + + if (unlikely (err)) { + hb_blob_destroy (blob); + DEBUG_MSG (FT, font, "Font face FT_New_Memory_Face() failed"); + return; + } + + FT_Select_Charmap (ft_face, FT_ENCODING_UNICODE); + + FT_Set_Char_Size (ft_face, + abs (font->x_scale), abs (font->y_scale), + 0, 0); +#if 0 + font->x_ppem * 72 * 64 / font->x_scale, + font->y_ppem * 72 * 64 / font->y_scale); +#endif + if (font->x_scale < 0 || font->y_scale < 0) + { + FT_Matrix matrix = { font->x_scale < 0 ? -1 : +1, 0, + 0, font->y_scale < 0 ? -1 : +1}; + FT_Set_Transform (ft_face, &matrix, NULL); + } + + ft_face->generic.data = blob; + ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob; + + _hb_ft_font_set_funcs (font, ft_face, true); + hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING); +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-ft.h b/3rdparty/harfbuzz-1.0.6/hb-ft.h new file mode 100644 index 0000000000..4bbc826580 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ft.h @@ -0,0 +1,126 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2015 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_FT_H +#define HB_FT_H + +#include "hb.h" + +#include +#include FT_FREETYPE_H + +HB_BEGIN_DECLS + +/* + * Note: FreeType is not thread-safe. + * Hence, these functions are not either. + */ + +/* + * hb-face from ft-face. + */ + +/* This one creates a new hb-face for given ft-face. + * When the returned hb-face is destroyed, the destroy + * callback is called (if not NULL), with the ft-face passed + * to it. + * + * The client is responsible to make sure that ft-face is + * destroyed after hb-face is destroyed. + * + * Most often you don't want this function. You should use either + * hb_ft_face_create_cached(), or hb_ft_face_create_referenced(). + * In particular, if you are going to pass NULL as destroy, you + * probably should use (the more recent) hb_ft_face_create_referenced() + * instead. + */ +hb_face_t * +hb_ft_face_create (FT_Face ft_face, + hb_destroy_func_t destroy); + +/* This version is like hb_ft_face_create(), except that it caches + * the hb-face using the generic pointer of the ft-face. This means + * that subsequent calls to this function with the same ft-face will + * return the same hb-face (correctly referenced). + * + * Client is still responsible for making sure that ft-face is destroyed + * after hb-face is. + */ +hb_face_t * +hb_ft_face_create_cached (FT_Face ft_face); + +/* This version is like hb_ft_face_create(), except that it calls + * FT_Reference_Face() on ft-face, as such keeping ft-face alive + * as long as the hb-face is. + * + * This is the most convenient version to use. Use it unless you have + * very good reasons not to. + */ +hb_face_t * +hb_ft_face_create_referenced (FT_Face ft_face); + + +/* + * hb-font from ft-face. + */ + +/* + * Note: + * + * Set face size on ft-face before creating hb-font from it. + * Otherwise hb-ft would NOT pick up the font size correctly. + */ + +/* See notes on hb_ft_face_create(). Same issues re lifecycle-management + * apply here. Use hb_ft_font_create_referenced() if you can. */ +hb_font_t * +hb_ft_font_create (FT_Face ft_face, + hb_destroy_func_t destroy); + +/* See notes on hb_ft_face_create_referenced() re lifecycle-management + * issues. */ +hb_font_t * +hb_ft_font_create_referenced (FT_Face ft_face); + +FT_Face +hb_ft_font_get_face (hb_font_t *font); + +void +hb_ft_font_set_load_flags (hb_font_t *font, int load_flags); + +int +hb_ft_font_get_load_flags (hb_font_t *font); + +/* Makes an hb_font_t use FreeType internally to implement font functions. */ +void +hb_ft_font_set_funcs (hb_font_t *font); + + +HB_END_DECLS + +#endif /* HB_FT_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-glib.cc b/3rdparty/harfbuzz-1.0.6/hb-glib.cc new file mode 100644 index 0000000000..7dbd83d296 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-glib.cc @@ -0,0 +1,398 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-private.hh" + +#include "hb-glib.h" + +#include "hb-unicode-private.hh" + + +#if !GLIB_CHECK_VERSION(2,29,14) +static const hb_script_t +glib_script_to_script[] = +{ + HB_SCRIPT_COMMON, + HB_SCRIPT_INHERITED, + HB_SCRIPT_ARABIC, + HB_SCRIPT_ARMENIAN, + HB_SCRIPT_BENGALI, + HB_SCRIPT_BOPOMOFO, + HB_SCRIPT_CHEROKEE, + HB_SCRIPT_COPTIC, + HB_SCRIPT_CYRILLIC, + HB_SCRIPT_DESERET, + HB_SCRIPT_DEVANAGARI, + HB_SCRIPT_ETHIOPIC, + HB_SCRIPT_GEORGIAN, + HB_SCRIPT_GOTHIC, + HB_SCRIPT_GREEK, + HB_SCRIPT_GUJARATI, + HB_SCRIPT_GURMUKHI, + HB_SCRIPT_HAN, + HB_SCRIPT_HANGUL, + HB_SCRIPT_HEBREW, + HB_SCRIPT_HIRAGANA, + HB_SCRIPT_KANNADA, + HB_SCRIPT_KATAKANA, + HB_SCRIPT_KHMER, + HB_SCRIPT_LAO, + HB_SCRIPT_LATIN, + HB_SCRIPT_MALAYALAM, + HB_SCRIPT_MONGOLIAN, + HB_SCRIPT_MYANMAR, + HB_SCRIPT_OGHAM, + HB_SCRIPT_OLD_ITALIC, + HB_SCRIPT_ORIYA, + HB_SCRIPT_RUNIC, + HB_SCRIPT_SINHALA, + HB_SCRIPT_SYRIAC, + HB_SCRIPT_TAMIL, + HB_SCRIPT_TELUGU, + HB_SCRIPT_THAANA, + HB_SCRIPT_THAI, + HB_SCRIPT_TIBETAN, + HB_SCRIPT_CANADIAN_SYLLABICS, + HB_SCRIPT_YI, + HB_SCRIPT_TAGALOG, + HB_SCRIPT_HANUNOO, + HB_SCRIPT_BUHID, + HB_SCRIPT_TAGBANWA, + + /* Unicode-4.0 additions */ + HB_SCRIPT_BRAILLE, + HB_SCRIPT_CYPRIOT, + HB_SCRIPT_LIMBU, + HB_SCRIPT_OSMANYA, + HB_SCRIPT_SHAVIAN, + HB_SCRIPT_LINEAR_B, + HB_SCRIPT_TAI_LE, + HB_SCRIPT_UGARITIC, + + /* Unicode-4.1 additions */ + HB_SCRIPT_NEW_TAI_LUE, + HB_SCRIPT_BUGINESE, + HB_SCRIPT_GLAGOLITIC, + HB_SCRIPT_TIFINAGH, + HB_SCRIPT_SYLOTI_NAGRI, + HB_SCRIPT_OLD_PERSIAN, + HB_SCRIPT_KHAROSHTHI, + + /* Unicode-5.0 additions */ + HB_SCRIPT_UNKNOWN, + HB_SCRIPT_BALINESE, + HB_SCRIPT_CUNEIFORM, + HB_SCRIPT_PHOENICIAN, + HB_SCRIPT_PHAGS_PA, + HB_SCRIPT_NKO, + + /* Unicode-5.1 additions */ + HB_SCRIPT_KAYAH_LI, + HB_SCRIPT_LEPCHA, + HB_SCRIPT_REJANG, + HB_SCRIPT_SUNDANESE, + HB_SCRIPT_SAURASHTRA, + HB_SCRIPT_CHAM, + HB_SCRIPT_OL_CHIKI, + HB_SCRIPT_VAI, + HB_SCRIPT_CARIAN, + HB_SCRIPT_LYCIAN, + HB_SCRIPT_LYDIAN, + + /* Unicode-5.2 additions */ + HB_SCRIPT_AVESTAN, + HB_SCRIPT_BAMUM, + HB_SCRIPT_EGYPTIAN_HIEROGLYPHS, + HB_SCRIPT_IMPERIAL_ARAMAIC, + HB_SCRIPT_INSCRIPTIONAL_PAHLAVI, + HB_SCRIPT_INSCRIPTIONAL_PARTHIAN, + HB_SCRIPT_JAVANESE, + HB_SCRIPT_KAITHI, + HB_SCRIPT_TAI_THAM, + HB_SCRIPT_LISU, + HB_SCRIPT_MEETEI_MAYEK, + HB_SCRIPT_OLD_SOUTH_ARABIAN, + HB_SCRIPT_OLD_TURKIC, + HB_SCRIPT_SAMARITAN, + HB_SCRIPT_TAI_VIET, + + /* Unicode-6.0 additions */ + HB_SCRIPT_BATAK, + HB_SCRIPT_BRAHMI, + HB_SCRIPT_MANDAIC, + + /* Unicode-6.1 additions */ + HB_SCRIPT_CHAKMA, + HB_SCRIPT_MEROITIC_CURSIVE, + HB_SCRIPT_MEROITIC_HIEROGLYPHS, + HB_SCRIPT_MIAO, + HB_SCRIPT_SHARADA, + HB_SCRIPT_SORA_SOMPENG, + HB_SCRIPT_TAKRI +}; +#endif + +hb_script_t +hb_glib_script_to_script (GUnicodeScript script) +{ +#if GLIB_CHECK_VERSION(2,29,14) + return (hb_script_t) g_unicode_script_to_iso15924 (script); +#else + if (likely ((unsigned int) script < ARRAY_LENGTH (glib_script_to_script))) + return glib_script_to_script[script]; + + if (unlikely (script == G_UNICODE_SCRIPT_INVALID_CODE)) + return HB_SCRIPT_INVALID; + + return HB_SCRIPT_UNKNOWN; +#endif +} + +GUnicodeScript +hb_glib_script_from_script (hb_script_t script) +{ +#if GLIB_CHECK_VERSION(2,29,14) + return g_unicode_script_from_iso15924 (script); +#else + unsigned int count = ARRAY_LENGTH (glib_script_to_script); + for (unsigned int i = 0; i < count; i++) + if (glib_script_to_script[i] == script) + return (GUnicodeScript) i; + + if (unlikely (script == HB_SCRIPT_INVALID)) + return G_UNICODE_SCRIPT_INVALID_CODE; + + return G_UNICODE_SCRIPT_UNKNOWN; +#endif +} + + +static hb_unicode_combining_class_t +hb_glib_unicode_combining_class (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) + +{ + return (hb_unicode_combining_class_t) g_unichar_combining_class (unicode); +} + +static unsigned int +hb_glib_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) +{ + return g_unichar_iswide (unicode) ? 2 : 1; +} + +static hb_unicode_general_category_t +hb_glib_unicode_general_category (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) + +{ + /* hb_unicode_general_category_t and GUnicodeType are identical */ + return (hb_unicode_general_category_t) g_unichar_type (unicode); +} + +static hb_codepoint_t +hb_glib_unicode_mirroring (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) +{ + g_unichar_get_mirror_char (unicode, &unicode); + return unicode; +} + +static hb_script_t +hb_glib_unicode_script (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) +{ + return hb_glib_script_to_script (g_unichar_get_script (unicode)); +} + +static hb_bool_t +hb_glib_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t a, + hb_codepoint_t b, + hb_codepoint_t *ab, + void *user_data HB_UNUSED) +{ +#if GLIB_CHECK_VERSION(2,29,12) + return g_unichar_compose (a, b, ab); +#endif + + /* We don't ifdef-out the fallback code such that compiler always + * sees it and makes sure it's compilable. */ + + gchar utf8[12]; + gchar *normalized; + int len; + hb_bool_t ret; + + len = g_unichar_to_utf8 (a, utf8); + len += g_unichar_to_utf8 (b, utf8 + len); + normalized = g_utf8_normalize (utf8, len, G_NORMALIZE_NFC); + len = g_utf8_strlen (normalized, -1); + if (unlikely (!len)) + return false; + + if (len == 1) { + *ab = g_utf8_get_char (normalized); + ret = true; + } else { + ret = false; + } + + g_free (normalized); + return ret; +} + +static hb_bool_t +hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t ab, + hb_codepoint_t *a, + hb_codepoint_t *b, + void *user_data HB_UNUSED) +{ +#if GLIB_CHECK_VERSION(2,29,12) + return g_unichar_decompose (ab, a, b); +#endif + + /* We don't ifdef-out the fallback code such that compiler always + * sees it and makes sure it's compilable. */ + + gchar utf8[6]; + gchar *normalized; + int len; + hb_bool_t ret; + + len = g_unichar_to_utf8 (ab, utf8); + normalized = g_utf8_normalize (utf8, len, G_NORMALIZE_NFD); + len = g_utf8_strlen (normalized, -1); + if (unlikely (!len)) + return false; + + if (len == 1) { + *a = g_utf8_get_char (normalized); + *b = 0; + ret = *a != ab; + } else if (len == 2) { + *a = g_utf8_get_char (normalized); + *b = g_utf8_get_char (g_utf8_next_char (normalized)); + /* Here's the ugly part: if ab decomposes to a single character and + * that character decomposes again, we have to detect that and undo + * the second part :-(. */ + gchar *recomposed = g_utf8_normalize (normalized, -1, G_NORMALIZE_NFC); + hb_codepoint_t c = g_utf8_get_char (recomposed); + if (c != ab && c != *a) { + *a = c; + *b = 0; + } + g_free (recomposed); + ret = true; + } else { + /* If decomposed to more than two characters, take the last one, + * and recompose the rest to get the first component. */ + gchar *end = g_utf8_offset_to_pointer (normalized, len - 1); + gchar *recomposed; + *b = g_utf8_get_char (end); + recomposed = g_utf8_normalize (normalized, end - normalized, G_NORMALIZE_NFC); + /* We expect that recomposed has exactly one character now. */ + *a = g_utf8_get_char (recomposed); + g_free (recomposed); + ret = true; + } + + g_free (normalized); + return ret; +} + +static unsigned int +hb_glib_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t u, + hb_codepoint_t *decomposed, + void *user_data HB_UNUSED) +{ +#if GLIB_CHECK_VERSION(2,29,12) + return g_unichar_fully_decompose (u, true, decomposed, HB_UNICODE_MAX_DECOMPOSITION_LEN); +#endif + + /* If the user doesn't have GLib >= 2.29.12 we have to perform + * a round trip to UTF-8 and the associated memory management dance. */ + gchar utf8[6]; + gchar *utf8_decomposed, *c; + gsize utf8_len, utf8_decomposed_len, i; + + /* Convert @u to UTF-8 and normalise it in NFKD mode. This performs the compatibility decomposition. */ + utf8_len = g_unichar_to_utf8 (u, utf8); + utf8_decomposed = g_utf8_normalize (utf8, utf8_len, G_NORMALIZE_NFKD); + utf8_decomposed_len = g_utf8_strlen (utf8_decomposed, -1); + + assert (utf8_decomposed_len <= HB_UNICODE_MAX_DECOMPOSITION_LEN); + + for (i = 0, c = utf8_decomposed; i < utf8_decomposed_len; i++, c = g_utf8_next_char (c)) + *decomposed++ = g_utf8_get_char (c); + + g_free (utf8_decomposed); + + return utf8_decomposed_len; +} + +hb_unicode_funcs_t * +hb_glib_get_unicode_funcs (void) +{ + static const hb_unicode_funcs_t _hb_glib_unicode_funcs = { + HB_OBJECT_HEADER_STATIC, + + NULL, /* parent */ + true, /* immutable */ + { +#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_glib_unicode_##name, + HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_UNICODE_FUNC_IMPLEMENT + } + }; + + return const_cast (&_hb_glib_unicode_funcs); +} + +/** + * Since: 0.9.38 + **/ +hb_blob_t * +hb_glib_blob_create (GBytes *gbytes) +{ + gsize size = 0; + gconstpointer data = g_bytes_get_data (gbytes, &size); + return hb_blob_create ((const char *) data, + size, + HB_MEMORY_MODE_READONLY, + g_bytes_ref (gbytes), + (hb_destroy_func_t) g_bytes_unref); +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-glib.h b/3rdparty/harfbuzz-1.0.6/hb-glib.h new file mode 100644 index 0000000000..1a8f42ea52 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-glib.h @@ -0,0 +1,55 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_GLIB_H +#define HB_GLIB_H + +#include "hb.h" + +#include + +HB_BEGIN_DECLS + + +hb_script_t +hb_glib_script_to_script (GUnicodeScript script); + +GUnicodeScript +hb_glib_script_from_script (hb_script_t script); + + +hb_unicode_funcs_t * +hb_glib_get_unicode_funcs (void); + +hb_blob_t * +hb_glib_blob_create (GBytes *gbytes); + + +HB_END_DECLS + +#endif /* HB_GLIB_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-gobject-structs.cc b/3rdparty/harfbuzz-1.0.6/hb-gobject-structs.cc new file mode 100644 index 0000000000..6bd63368b6 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-gobject-structs.cc @@ -0,0 +1,80 @@ +/* + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-private.hh" + +/* g++ didn't like older gtype.h gcc-only code path. */ +#include +#if !GLIB_CHECK_VERSION(2,29,16) +#undef __GNUC__ +#undef __GNUC_MINOR__ +#define __GNUC__ 2 +#define __GNUC_MINOR__ 6 +#endif + +#include "hb-gobject.h" + +#define HB_DEFINE_BOXED_TYPE(name,copy_func,free_func) \ +GType \ +hb_gobject_##name##_get_type (void) \ +{ \ + static gsize type_id = 0; \ + if (g_once_init_enter (&type_id)) { \ + GType id = g_boxed_type_register_static (g_intern_static_string ("hb_" #name "_t"), \ + (GBoxedCopyFunc) copy_func, \ + (GBoxedFreeFunc) free_func); \ + g_once_init_leave (&type_id, id); \ + } \ + return type_id; \ +} + +#define HB_DEFINE_OBJECT_TYPE(name) \ + HB_DEFINE_BOXED_TYPE (name, hb_##name##_reference, hb_##name##_destroy); + +#define HB_DEFINE_VALUE_TYPE(name) \ + static hb_##name##_t *_hb_##name##_reference (const hb_##name##_t *l) \ + { \ + hb_##name##_t *c = (hb_##name##_t *) calloc (1, sizeof (hb_##name##_t)); \ + if (unlikely (!c)) return NULL; \ + *c = *l; \ + return c; \ + } \ + static void _hb_##name##_destroy (hb_##name##_t *l) { free (l); } \ + HB_DEFINE_BOXED_TYPE (name, _hb_##name##_reference, _hb_##name##_destroy); + +HB_DEFINE_OBJECT_TYPE (buffer) +HB_DEFINE_OBJECT_TYPE (blob) +HB_DEFINE_OBJECT_TYPE (face) +HB_DEFINE_OBJECT_TYPE (font) +HB_DEFINE_OBJECT_TYPE (font_funcs) +HB_DEFINE_OBJECT_TYPE (set) +HB_DEFINE_OBJECT_TYPE (shape_plan) +HB_DEFINE_OBJECT_TYPE (unicode_funcs) +HB_DEFINE_VALUE_TYPE (feature) +HB_DEFINE_VALUE_TYPE (glyph_info) +HB_DEFINE_VALUE_TYPE (glyph_position) +HB_DEFINE_VALUE_TYPE (segment_properties) +HB_DEFINE_VALUE_TYPE (user_data_key) diff --git a/3rdparty/harfbuzz-1.0.6/hb-gobject-structs.h b/3rdparty/harfbuzz-1.0.6/hb-gobject-structs.h new file mode 100644 index 0000000000..0a0387dce3 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-gobject-structs.h @@ -0,0 +1,105 @@ +/* + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_GOBJECT_H_IN +#error "Include instead." +#endif + +#ifndef HB_GOBJECT_STRUCTS_H +#define HB_GOBJECT_STRUCTS_H + +#include "hb.h" + +#include + +HB_BEGIN_DECLS + + +/* Object types */ + +/** + * Since: 0.9.2 + **/ +GType hb_gobject_blob_get_type (void); +#define HB_GOBJECT_TYPE_BLOB (hb_gobject_blob_get_type ()) + +/** + * Since: 0.9.2 + **/ +GType hb_gobject_buffer_get_type (void); +#define HB_GOBJECT_TYPE_BUFFER (hb_gobject_buffer_get_type ()) + +/** + * Since: 0.9.2 + **/ +GType hb_gobject_face_get_type (void); +#define HB_GOBJECT_TYPE_FACE (hb_gobject_face_get_type ()) + +/** + * Since: 0.9.2 + **/ +GType hb_gobject_font_get_type (void); +#define HB_GOBJECT_TYPE_FONT (hb_gobject_font_get_type ()) + +/** + * Since: 0.9.2 + **/ +GType hb_gobject_font_funcs_get_type (void); +#define HB_GOBJECT_TYPE_FONT_FUNCS (hb_gobject_font_funcs_get_type ()) + +GType hb_gobject_set_get_type (void); +#define HB_GOBJECT_TYPE_SET (hb_gobject_set_get_type ()) + +GType hb_gobject_shape_plan_get_type (void); +#define HB_GOBJECT_TYPE_SHAPE_PLAN (hb_gobject_shape_plan_get_type ()) + +/** + * Since: 0.9.2 + **/ +GType hb_gobject_unicode_funcs_get_type (void); +#define HB_GOBJECT_TYPE_UNICODE_FUNCS (hb_gobject_unicode_funcs_get_type ()) + +/* Value types */ + +GType hb_gobject_feature_get_type (void); +#define HB_GOBJECT_TYPE_FEATURE (hb_gobject_feature_get_type ()) + +GType hb_gobject_glyph_info_get_type (void); +#define HB_GOBJECT_TYPE_GLYPH_INFO (hb_gobject_glyph_info_get_type ()) + +GType hb_gobject_glyph_position_get_type (void); +#define HB_GOBJECT_TYPE_GLYPH_POSITION (hb_gobject_glyph_position_get_type ()) + +GType hb_gobject_segment_properties_get_type (void); +#define HB_GOBJECT_TYPE_SEGMENT_PROPERTIES (hb_gobject_segment_properties_get_type ()) + +GType hb_gobject_user_data_key_get_type (void); +#define HB_GOBJECT_TYPE_USER_DATA_KEY (hb_gobject_user_data_key_get_type ()) + + +HB_END_DECLS + +#endif /* HB_GOBJECT_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-gobject.h b/3rdparty/harfbuzz-1.0.6/hb-gobject.h new file mode 100644 index 0000000000..ea1bd25df8 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-gobject.h @@ -0,0 +1,40 @@ +/* + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_GOBJECT_H +#define HB_GOBJECT_H +#define HB_GOBJECT_H_IN + +#include "hb.h" + +#include "hb-gobject-enums.h" +#include "hb-gobject-structs.h" + +HB_BEGIN_DECLS +HB_END_DECLS + +#undef HB_GOBJECT_H_IN +#endif /* HB_GOBJECT_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-graphite2.cc b/3rdparty/harfbuzz-1.0.6/hb-graphite2.cc new file mode 100644 index 0000000000..cd694c1406 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-graphite2.cc @@ -0,0 +1,409 @@ +/* + * Copyright © 2011 Martin Hosken + * Copyright © 2011 SIL International + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#define HB_SHAPER graphite2 +#define hb_graphite2_shaper_font_data_t gr_font +#include "hb-shaper-impl-private.hh" + +#include "hb-graphite2.h" + +#include + + +HB_SHAPER_DATA_ENSURE_DECLARE(graphite2, face) +HB_SHAPER_DATA_ENSURE_DECLARE(graphite2, font) + + +/* + * shaper face data + */ + +typedef struct hb_graphite2_tablelist_t { + struct hb_graphite2_tablelist_t *next; + hb_blob_t *blob; + unsigned int tag; +} hb_graphite2_tablelist_t; + +struct hb_graphite2_shaper_face_data_t { + hb_face_t *face; + gr_face *grface; + hb_graphite2_tablelist_t *tlist; +}; + +static const void *hb_graphite2_get_table (const void *data, unsigned int tag, size_t *len) +{ + hb_graphite2_shaper_face_data_t *face_data = (hb_graphite2_shaper_face_data_t *) data; + hb_graphite2_tablelist_t *tlist = face_data->tlist; + + hb_blob_t *blob = NULL; + + for (hb_graphite2_tablelist_t *p = tlist; p; p = p->next) + if (p->tag == tag) { + blob = p->blob; + break; + } + + if (unlikely (!blob)) + { + blob = face_data->face->reference_table (tag); + + hb_graphite2_tablelist_t *p = (hb_graphite2_tablelist_t *) calloc (1, sizeof (hb_graphite2_tablelist_t)); + if (unlikely (!p)) { + hb_blob_destroy (blob); + return NULL; + } + p->blob = blob; + p->tag = tag; + + /* TODO Not thread-safe, but fairly harmless. + * We can do the double-chcked pointer cmpexch thing here. */ + p->next = face_data->tlist; + face_data->tlist = p; + } + + unsigned int tlen; + const char *d = hb_blob_get_data (blob, &tlen); + *len = tlen; + return d; +} + +hb_graphite2_shaper_face_data_t * +_hb_graphite2_shaper_face_data_create (hb_face_t *face) +{ + hb_blob_t *silf_blob = face->reference_table (HB_GRAPHITE2_TAG_SILF); + /* Umm, we just reference the table to check whether it exists. + * Maybe add better API for this? */ + if (!hb_blob_get_length (silf_blob)) + { + hb_blob_destroy (silf_blob); + return NULL; + } + hb_blob_destroy (silf_blob); + + hb_graphite2_shaper_face_data_t *data = (hb_graphite2_shaper_face_data_t *) calloc (1, sizeof (hb_graphite2_shaper_face_data_t)); + if (unlikely (!data)) + return NULL; + + data->face = face; + data->grface = gr_make_face (data, &hb_graphite2_get_table, gr_face_preloadAll); + + if (unlikely (!data->grface)) { + free (data); + return NULL; + } + + return data; +} + +void +_hb_graphite2_shaper_face_data_destroy (hb_graphite2_shaper_face_data_t *data) +{ + hb_graphite2_tablelist_t *tlist = data->tlist; + + while (tlist) + { + hb_graphite2_tablelist_t *old = tlist; + hb_blob_destroy (tlist->blob); + tlist = tlist->next; + free (old); + } + + gr_face_destroy (data->grface); + + free (data); +} + +/* + * Since: 0.9.10 + */ +gr_face * +hb_graphite2_face_get_gr_face (hb_face_t *face) +{ + if (unlikely (!hb_graphite2_shaper_face_data_ensure (face))) return NULL; + return HB_SHAPER_DATA_GET (face)->grface; +} + + +/* + * shaper font data + */ + +static float hb_graphite2_get_advance (const void *hb_font, unsigned short gid) +{ + return ((hb_font_t *) hb_font)->get_glyph_h_advance (gid); +} + +hb_graphite2_shaper_font_data_t * +_hb_graphite2_shaper_font_data_create (hb_font_t *font) +{ + if (unlikely (!hb_graphite2_shaper_face_data_ensure (font->face))) return NULL; + + hb_face_t *face = font->face; + hb_graphite2_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face); + + return gr_make_font_with_advance_fn (font->x_scale, font, &hb_graphite2_get_advance, face_data->grface); +} + +void +_hb_graphite2_shaper_font_data_destroy (hb_graphite2_shaper_font_data_t *data) +{ + gr_font_destroy (data); +} + +/* + * Since: 0.9.10 + */ +gr_font * +hb_graphite2_font_get_gr_font (hb_font_t *font) +{ + if (unlikely (!hb_graphite2_shaper_font_data_ensure (font))) return NULL; + return HB_SHAPER_DATA_GET (font); +} + + +/* + * shaper shape_plan data + */ + +struct hb_graphite2_shaper_shape_plan_data_t {}; + +hb_graphite2_shaper_shape_plan_data_t * +_hb_graphite2_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan HB_UNUSED, + const hb_feature_t *user_features HB_UNUSED, + unsigned int num_user_features HB_UNUSED) +{ + return (hb_graphite2_shaper_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED; +} + +void +_hb_graphite2_shaper_shape_plan_data_destroy (hb_graphite2_shaper_shape_plan_data_t *data HB_UNUSED) +{ +} + + +/* + * shaper + */ + +struct hb_graphite2_cluster_t { + unsigned int base_char; + unsigned int num_chars; + unsigned int base_glyph; + unsigned int num_glyphs; + unsigned int cluster; +}; + +hb_bool_t +_hb_graphite2_shape (hb_shape_plan_t *shape_plan, + hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features) +{ + hb_face_t *face = font->face; + gr_face *grface = HB_SHAPER_DATA_GET (face)->grface; + gr_font *grfont = HB_SHAPER_DATA_GET (font); + + const char *lang = hb_language_to_string (hb_buffer_get_language (buffer)); + const char *lang_end = lang ? strchr (lang, '-') : NULL; + int lang_len = lang_end ? lang_end - lang : -1; + gr_feature_val *feats = gr_face_featureval_for_lang (grface, lang ? hb_tag_from_string (lang, lang_len) : 0); + + for (unsigned int i = 0; i < num_features; i++) + { + const gr_feature_ref *fref = gr_face_find_fref (grface, features[i].tag); + if (fref) + gr_fref_set_feature_value (fref, features[i].value, feats); + } + + gr_segment *seg = NULL; + const gr_slot *is; + unsigned int ci = 0, ic = 0; + float curradvx = 0., curradvy = 0.; + + unsigned int scratch_size; + hb_buffer_t::scratch_buffer_t *scratch = buffer->get_scratch_buffer (&scratch_size); + + uint32_t *chars = (uint32_t *) scratch; + + for (unsigned int i = 0; i < buffer->len; ++i) + chars[i] = buffer->info[i].codepoint; + + /* TODO ensure_native_direction. */ + + hb_tag_t script_tag[2]; + hb_ot_tags_from_script (hb_buffer_get_script (buffer), &script_tag[0], &script_tag[1]); + + seg = gr_make_seg (grfont, grface, + script_tag[1] == HB_TAG_NONE ? script_tag[0] : script_tag[1], + feats, + gr_utf32, chars, buffer->len, + 2 | (hb_buffer_get_direction (buffer) == HB_DIRECTION_RTL ? 1 : 0)); + + if (unlikely (!seg)) { + if (feats) gr_featureval_destroy (feats); + return false; + } + + unsigned int glyph_count = gr_seg_n_slots (seg); + if (unlikely (!glyph_count)) { + if (feats) gr_featureval_destroy (feats); + gr_seg_destroy (seg); + buffer->len = 0; + return true; + } + + buffer->ensure (glyph_count); + scratch = buffer->get_scratch_buffer (&scratch_size); + while ((DIV_CEIL (sizeof (hb_graphite2_cluster_t) * buffer->len, sizeof (*scratch)) + + DIV_CEIL (sizeof (hb_codepoint_t) * glyph_count, sizeof (*scratch))) > scratch_size) + { + if (unlikely (!buffer->ensure (buffer->allocated * 2))) + { + if (feats) gr_featureval_destroy (feats); + gr_seg_destroy (seg); + return false; + } + scratch = buffer->get_scratch_buffer (&scratch_size); + } + +#define ALLOCATE_ARRAY(Type, name, len) \ + Type *name = (Type *) scratch; \ + { \ + unsigned int _consumed = DIV_CEIL ((len) * sizeof (Type), sizeof (*scratch)); \ + assert (_consumed <= scratch_size); \ + scratch += _consumed; \ + scratch_size -= _consumed; \ + } + + ALLOCATE_ARRAY (hb_graphite2_cluster_t, clusters, buffer->len); + ALLOCATE_ARRAY (hb_codepoint_t, gids, glyph_count); + +#undef ALLOCATE_ARRAY + + memset (clusters, 0, sizeof (clusters[0]) * buffer->len); + + hb_codepoint_t *pg = gids; + clusters[0].cluster = buffer->info[0].cluster; + for (is = gr_seg_first_slot (seg), ic = 0; is; is = gr_slot_next_in_segment (is), ic++) + { + unsigned int before = gr_slot_before (is); + unsigned int after = gr_slot_after (is); + *pg = gr_slot_gid (is); + pg++; + while (clusters[ci].base_char > before && ci) + { + clusters[ci-1].num_chars += clusters[ci].num_chars; + clusters[ci-1].num_glyphs += clusters[ci].num_glyphs; + ci--; + } + + if (gr_slot_can_insert_before (is) && clusters[ci].num_chars && before >= clusters[ci].base_char + clusters[ci].num_chars) + { + hb_graphite2_cluster_t *c = clusters + ci + 1; + c->base_char = clusters[ci].base_char + clusters[ci].num_chars; + c->cluster = buffer->info[c->base_char].cluster; + c->num_chars = before - c->base_char; + c->base_glyph = ic; + c->num_glyphs = 0; + ci++; + } + clusters[ci].num_glyphs++; + + if (clusters[ci].base_char + clusters[ci].num_chars < after + 1) + clusters[ci].num_chars = after + 1 - clusters[ci].base_char; + } + ci++; + + for (unsigned int i = 0; i < ci; ++i) + { + for (unsigned int j = 0; j < clusters[i].num_glyphs; ++j) + { + hb_glyph_info_t *info = &buffer->info[clusters[i].base_glyph + j]; + info->codepoint = gids[clusters[i].base_glyph + j]; + info->cluster = clusters[i].cluster; + } + } + buffer->len = glyph_count; + + /* Positioning. */ + if (!HB_DIRECTION_IS_BACKWARD(buffer->props.direction)) + { + hb_glyph_position_t *pPos; + for (pPos = hb_buffer_get_glyph_positions (buffer, NULL), is = gr_seg_first_slot (seg); + is; pPos++, is = gr_slot_next_in_segment (is)) + { + pPos->x_offset = gr_slot_origin_X (is) - curradvx; + pPos->y_offset = gr_slot_origin_Y (is) - curradvy; + pPos->x_advance = gr_slot_advance_X (is, grface, grfont); + pPos->y_advance = gr_slot_advance_Y (is, grface, grfont); + curradvx += pPos->x_advance; + curradvy += pPos->y_advance; + } + pPos[-1].x_advance += gr_seg_advance_X(seg) - curradvx; + } + else + { + hb_glyph_position_t *pPos = hb_buffer_get_glyph_positions (buffer, NULL) + buffer->len - 1; + const hb_glyph_info_t *info = buffer->info + buffer->len - 1; + const hb_glyph_info_t *tinfo; + const gr_slot *tis; + int currclus = -1; + float clusx = 0., clusy = 0.; + for (is = gr_seg_last_slot (seg); is; pPos--, info--, is = gr_slot_prev_in_segment (is)) + { + if (info->cluster != currclus) + { + curradvx += clusx; + curradvy += clusy; + currclus = info->cluster; + clusx = 0.; + clusy = 0.; + for (tis = is, tinfo = info; tis && tinfo->cluster == currclus; tis = gr_slot_prev_in_segment (tis), tinfo--) + { + clusx += gr_slot_advance_X (tis, grface, grfont); + clusy += gr_slot_advance_Y (tis, grface, grfont); + } + curradvx += clusx; + curradvy += clusy; + } + pPos->x_advance = gr_slot_advance_X (is, grface, grfont); + pPos->y_advance = gr_slot_advance_Y (is, grface, grfont); + curradvx -= pPos->x_advance; + curradvy -= pPos->y_advance; + pPos->x_offset = gr_slot_origin_X (is) - curradvx; + pPos->y_offset = gr_slot_origin_Y (is) - curradvy; + } + hb_buffer_reverse_clusters (buffer); + } + + if (feats) gr_featureval_destroy (feats); + gr_seg_destroy (seg); + + return true; +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-graphite2.h b/3rdparty/harfbuzz-1.0.6/hb-graphite2.h new file mode 100644 index 0000000000..3eae54acbd --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-graphite2.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011 Martin Hosken + * Copyright (C) 2011 SIL International + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_GRAPHITE2_H +#define HB_GRAPHITE2_H + +#include "hb.h" + +#include + +HB_BEGIN_DECLS + + +#define HB_GRAPHITE2_TAG_SILF HB_TAG('S','i','l','f') + + +gr_face * +hb_graphite2_face_get_gr_face (hb_face_t *face); + +gr_font * +hb_graphite2_font_get_gr_font (hb_font_t *font); + + +HB_END_DECLS + +#endif /* HB_GRAPHITE2_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-icu.cc b/3rdparty/harfbuzz-1.0.6/hb-icu.cc new file mode 100644 index 0000000000..24cec9d726 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-icu.cc @@ -0,0 +1,370 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2009 Keith Stribley + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-private.hh" + +#include "hb-icu.h" + +#include "hb-unicode-private.hh" + +#include +#include +#include +#include + + +hb_script_t +hb_icu_script_to_script (UScriptCode script) +{ + if (unlikely (script == USCRIPT_INVALID_CODE)) + return HB_SCRIPT_INVALID; + + return hb_script_from_string (uscript_getShortName (script), -1); +} + +UScriptCode +hb_icu_script_from_script (hb_script_t script) +{ + if (unlikely (script == HB_SCRIPT_INVALID)) + return USCRIPT_INVALID_CODE; + + for (unsigned int i = 0; i < USCRIPT_CODE_LIMIT; i++) + if (unlikely (hb_icu_script_to_script ((UScriptCode) i) == script)) + return (UScriptCode) i; + + return USCRIPT_UNKNOWN; +} + + +static hb_unicode_combining_class_t +hb_icu_unicode_combining_class (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) + +{ + return (hb_unicode_combining_class_t) u_getCombiningClass (unicode); +} + +static unsigned int +hb_icu_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) +{ + switch (u_getIntPropertyValue(unicode, UCHAR_EAST_ASIAN_WIDTH)) + { + case U_EA_WIDE: + case U_EA_FULLWIDTH: + return 2; + case U_EA_NEUTRAL: + case U_EA_AMBIGUOUS: + case U_EA_HALFWIDTH: + case U_EA_NARROW: + return 1; + } + return 1; +} + +static hb_unicode_general_category_t +hb_icu_unicode_general_category (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) +{ + switch (u_getIntPropertyValue(unicode, UCHAR_GENERAL_CATEGORY)) + { + case U_UNASSIGNED: return HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED; + + case U_UPPERCASE_LETTER: return HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER; + case U_LOWERCASE_LETTER: return HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER; + case U_TITLECASE_LETTER: return HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER; + case U_MODIFIER_LETTER: return HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER; + case U_OTHER_LETTER: return HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER; + + case U_NON_SPACING_MARK: return HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK; + case U_ENCLOSING_MARK: return HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK; + case U_COMBINING_SPACING_MARK: return HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK; + + case U_DECIMAL_DIGIT_NUMBER: return HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER; + case U_LETTER_NUMBER: return HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER; + case U_OTHER_NUMBER: return HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER; + + case U_SPACE_SEPARATOR: return HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR; + case U_LINE_SEPARATOR: return HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR; + case U_PARAGRAPH_SEPARATOR: return HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR; + + case U_CONTROL_CHAR: return HB_UNICODE_GENERAL_CATEGORY_CONTROL; + case U_FORMAT_CHAR: return HB_UNICODE_GENERAL_CATEGORY_FORMAT; + case U_PRIVATE_USE_CHAR: return HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE; + case U_SURROGATE: return HB_UNICODE_GENERAL_CATEGORY_SURROGATE; + + + case U_DASH_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION; + case U_START_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION; + case U_END_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION; + case U_CONNECTOR_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION; + case U_OTHER_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION; + + case U_MATH_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL; + case U_CURRENCY_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL; + case U_MODIFIER_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL; + case U_OTHER_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL; + + case U_INITIAL_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION; + case U_FINAL_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION; + } + + return HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED; +} + +static hb_codepoint_t +hb_icu_unicode_mirroring (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) +{ + return u_charMirror(unicode); +} + +static hb_script_t +hb_icu_unicode_script (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t unicode, + void *user_data HB_UNUSED) +{ + UErrorCode status = U_ZERO_ERROR; + UScriptCode scriptCode = uscript_getScript(unicode, &status); + + if (unlikely (U_FAILURE (status))) + return HB_SCRIPT_UNKNOWN; + + return hb_icu_script_to_script (scriptCode); +} + +#if U_ICU_VERSION_MAJOR_NUM >= 49 +static const UNormalizer2 *normalizer; +#endif + +static hb_bool_t +hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t a, + hb_codepoint_t b, + hb_codepoint_t *ab, + void *user_data HB_UNUSED) +{ +#if U_ICU_VERSION_MAJOR_NUM >= 49 + { + UChar32 ret = unorm2_composePair (normalizer, a, b); + if (ret < 0) return false; + *ab = ret; + return true; + } +#endif + + /* We don't ifdef-out the fallback code such that compiler always + * sees it and makes sure it's compilable. */ + + UChar utf16[4], normalized[5]; + unsigned int len; + hb_bool_t ret, err; + UErrorCode icu_err; + + len = 0; + err = false; + U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), a, err); + if (err) return false; + U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), b, err); + if (err) return false; + + icu_err = U_ZERO_ERROR; + len = unorm_normalize (utf16, len, UNORM_NFC, 0, normalized, ARRAY_LENGTH (normalized), &icu_err); + if (U_FAILURE (icu_err)) + return false; + if (u_countChar32 (normalized, len) == 1) { + U16_GET_UNSAFE (normalized, 0, *ab); + ret = true; + } else { + ret = false; + } + + return ret; +} + +static hb_bool_t +hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t ab, + hb_codepoint_t *a, + hb_codepoint_t *b, + void *user_data HB_UNUSED) +{ +#if U_ICU_VERSION_MAJOR_NUM >= 49 + { + UChar decomposed[4]; + int len; + UErrorCode icu_err = U_ZERO_ERROR; + len = unorm2_getRawDecomposition (normalizer, ab, decomposed, + ARRAY_LENGTH (decomposed), &icu_err); + if (U_FAILURE (icu_err) || len < 0) return false; + + len = u_countChar32 (decomposed, len); + if (len == 1) { + U16_GET_UNSAFE (decomposed, 0, *a); + *b = 0; + return *a != ab; + } else if (len == 2) { + len =0; + U16_NEXT_UNSAFE (decomposed, len, *a); + U16_NEXT_UNSAFE (decomposed, len, *b); + } + return true; + } +#endif + + /* We don't ifdef-out the fallback code such that compiler always + * sees it and makes sure it's compilable. */ + + UChar utf16[2], normalized[2 * HB_UNICODE_MAX_DECOMPOSITION_LEN + 1]; + unsigned int len; + hb_bool_t ret, err; + UErrorCode icu_err; + + /* This function is a monster! Maybe it wasn't a good idea adding a + * pairwise decompose API... */ + /* Watchout for the dragons. Err, watchout for macros changing len. */ + + len = 0; + err = false; + U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), ab, err); + if (err) return false; + + icu_err = U_ZERO_ERROR; + len = unorm_normalize (utf16, len, UNORM_NFD, 0, normalized, ARRAY_LENGTH (normalized), &icu_err); + if (U_FAILURE (icu_err)) + return false; + + len = u_countChar32 (normalized, len); + + if (len == 1) { + U16_GET_UNSAFE (normalized, 0, *a); + *b = 0; + ret = *a != ab; + } else if (len == 2) { + len =0; + U16_NEXT_UNSAFE (normalized, len, *a); + U16_NEXT_UNSAFE (normalized, len, *b); + + /* Here's the ugly part: if ab decomposes to a single character and + * that character decomposes again, we have to detect that and undo + * the second part :-(. */ + UChar recomposed[20]; + icu_err = U_ZERO_ERROR; + unorm_normalize (normalized, len, UNORM_NFC, 0, recomposed, ARRAY_LENGTH (recomposed), &icu_err); + if (U_FAILURE (icu_err)) + return false; + hb_codepoint_t c; + U16_GET_UNSAFE (recomposed, 0, c); + if (c != *a && c != ab) { + *a = c; + *b = 0; + } + ret = true; + } else { + /* If decomposed to more than two characters, take the last one, + * and recompose the rest to get the first component. */ + U16_PREV_UNSAFE (normalized, len, *b); /* Changes len in-place. */ + UChar recomposed[18 * 2]; + icu_err = U_ZERO_ERROR; + len = unorm_normalize (normalized, len, UNORM_NFC, 0, recomposed, ARRAY_LENGTH (recomposed), &icu_err); + if (U_FAILURE (icu_err)) + return false; + /* We expect that recomposed has exactly one character now. */ + if (unlikely (u_countChar32 (recomposed, len) != 1)) + return false; + U16_GET_UNSAFE (recomposed, 0, *a); + ret = true; + } + + return ret; +} + +static unsigned int +hb_icu_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs HB_UNUSED, + hb_codepoint_t u, + hb_codepoint_t *decomposed, + void *user_data HB_UNUSED) +{ + UChar utf16[2], normalized[2 * HB_UNICODE_MAX_DECOMPOSITION_LEN + 1]; + unsigned int len; + int32_t utf32_len; + hb_bool_t err; + UErrorCode icu_err; + + /* Copy @u into a UTF-16 array to be passed to ICU. */ + len = 0; + err = false; + U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), u, err); + if (err) + return 0; + + /* Normalise the codepoint using NFKD mode. */ + icu_err = U_ZERO_ERROR; + len = unorm_normalize (utf16, len, UNORM_NFKD, 0, normalized, ARRAY_LENGTH (normalized), &icu_err); + if (icu_err) + return 0; + + /* Convert the decomposed form from UTF-16 to UTF-32. */ + icu_err = U_ZERO_ERROR; + u_strToUTF32 ((UChar32*) decomposed, HB_UNICODE_MAX_DECOMPOSITION_LEN, &utf32_len, normalized, len, &icu_err); + if (icu_err) + return 0; + + return utf32_len; +} + + +hb_unicode_funcs_t * +hb_icu_get_unicode_funcs (void) +{ + static const hb_unicode_funcs_t _hb_icu_unicode_funcs = { + HB_OBJECT_HEADER_STATIC, + + NULL, /* parent */ + true, /* immutable */ + { +#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_icu_unicode_##name, + HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_UNICODE_FUNC_IMPLEMENT + } + }; + +#if U_ICU_VERSION_MAJOR_NUM >= 49 + if (!hb_atomic_ptr_get (&normalizer)) { + UErrorCode icu_err = U_ZERO_ERROR; + /* We ignore failure in getNFCInstace(). */ + (void) hb_atomic_ptr_cmpexch (&normalizer, NULL, unorm2_getNFCInstance (&icu_err)); + } +#endif + return const_cast (&_hb_icu_unicode_funcs); +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-icu.h b/3rdparty/harfbuzz-1.0.6/hb-icu.h new file mode 100644 index 0000000000..f2f35f0f2c --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-icu.h @@ -0,0 +1,52 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2011 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_ICU_H +#define HB_ICU_H + +#include "hb.h" + +#include + +HB_BEGIN_DECLS + + +hb_script_t +hb_icu_script_to_script (UScriptCode script); + +UScriptCode +hb_icu_script_from_script (hb_script_t script); + + +hb_unicode_funcs_t * +hb_icu_get_unicode_funcs (void); + + +HB_END_DECLS + +#endif /* HB_ICU_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-mutex-private.hh b/3rdparty/harfbuzz-1.0.6/hb-mutex-private.hh new file mode 100644 index 0000000000..ed2703571c --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-mutex-private.hh @@ -0,0 +1,141 @@ +/* + * Copyright © 2007 Chris Wilson + * Copyright © 2009,2010 Red Hat, Inc. + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Contributor(s): + * Chris Wilson + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_MUTEX_PRIVATE_HH +#define HB_MUTEX_PRIVATE_HH + +#include "hb-private.hh" + + +/* mutex */ + +/* We need external help for these */ + +#if defined(HB_MUTEX_IMPL_INIT) \ + && defined(hb_mutex_impl_init) \ + && defined(hb_mutex_impl_lock) \ + && defined(hb_mutex_impl_unlock) \ + && defined(hb_mutex_impl_finish) + +/* Defined externally, i.e. in config.h; must have typedef'ed hb_mutex_impl_t as well. */ + + +#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__)) + +#include +typedef CRITICAL_SECTION hb_mutex_impl_t; +#define HB_MUTEX_IMPL_INIT {0} +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) +#define hb_mutex_impl_init(M) InitializeCriticalSectionEx (M, 0, 0) +#else +#define hb_mutex_impl_init(M) InitializeCriticalSection (M) +#endif +#define hb_mutex_impl_lock(M) EnterCriticalSection (M) +#define hb_mutex_impl_unlock(M) LeaveCriticalSection (M) +#define hb_mutex_impl_finish(M) DeleteCriticalSection (M) + + +#elif !defined(HB_NO_MT) && (defined(HAVE_PTHREAD) || defined(__APPLE__)) + +#include +typedef pthread_mutex_t hb_mutex_impl_t; +#define HB_MUTEX_IMPL_INIT PTHREAD_MUTEX_INITIALIZER +#define hb_mutex_impl_init(M) pthread_mutex_init (M, NULL) +#define hb_mutex_impl_lock(M) pthread_mutex_lock (M) +#define hb_mutex_impl_unlock(M) pthread_mutex_unlock (M) +#define hb_mutex_impl_finish(M) pthread_mutex_destroy (M) + + +#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES) + +#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD) +# include +# define HB_SCHED_YIELD() sched_yield () +#else +# define HB_SCHED_YIELD() HB_STMT_START {} HB_STMT_END +#endif + +/* This actually is not a totally awful implementation. */ +typedef volatile int hb_mutex_impl_t; +#define HB_MUTEX_IMPL_INIT 0 +#define hb_mutex_impl_init(M) *(M) = 0 +#define hb_mutex_impl_lock(M) HB_STMT_START { while (__sync_lock_test_and_set((M), 1)) HB_SCHED_YIELD (); } HB_STMT_END +#define hb_mutex_impl_unlock(M) __sync_lock_release (M) +#define hb_mutex_impl_finish(M) HB_STMT_START {} HB_STMT_END + + +#elif !defined(HB_NO_MT) + +#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD) +# include +# define HB_SCHED_YIELD() sched_yield () +#else +# define HB_SCHED_YIELD() HB_STMT_START {} HB_STMT_END +#endif + +#define HB_MUTEX_INT_NIL 1 /* Warn that fallback implementation is in use. */ +typedef volatile int hb_mutex_impl_t; +#define HB_MUTEX_IMPL_INIT 0 +#define hb_mutex_impl_init(M) *(M) = 0 +#define hb_mutex_impl_lock(M) HB_STMT_START { while (*(M)) HB_SCHED_YIELD (); (*(M))++; } HB_STMT_END +#define hb_mutex_impl_unlock(M) (*(M))--; +#define hb_mutex_impl_finish(M) HB_STMT_START {} HB_STMT_END + + +#else /* HB_NO_MT */ + +typedef int hb_mutex_impl_t; +#define HB_MUTEX_IMPL_INIT 0 +#define hb_mutex_impl_init(M) HB_STMT_START {} HB_STMT_END +#define hb_mutex_impl_lock(M) HB_STMT_START {} HB_STMT_END +#define hb_mutex_impl_unlock(M) HB_STMT_START {} HB_STMT_END +#define hb_mutex_impl_finish(M) HB_STMT_START {} HB_STMT_END + + +#endif + + +#define HB_MUTEX_INIT {HB_MUTEX_IMPL_INIT} + +struct hb_mutex_t +{ + /* TODO Add tracing. */ + + hb_mutex_impl_t m; + + inline void init (void) { hb_mutex_impl_init (&m); } + inline void lock (void) { hb_mutex_impl_lock (&m); } + inline void unlock (void) { hb_mutex_impl_unlock (&m); } + inline void finish (void) { hb_mutex_impl_finish (&m); } +}; + + +#endif /* HB_MUTEX_PRIVATE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-object-private.hh b/3rdparty/harfbuzz-1.0.6/hb-object-private.hh new file mode 100644 index 0000000000..6b73ff92d0 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-object-private.hh @@ -0,0 +1,202 @@ +/* + * Copyright © 2007 Chris Wilson + * Copyright © 2009,2010 Red Hat, Inc. + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Contributor(s): + * Chris Wilson + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OBJECT_PRIVATE_HH +#define HB_OBJECT_PRIVATE_HH + +#include "hb-private.hh" + +#include "hb-atomic-private.hh" +#include "hb-mutex-private.hh" + + +/* Debug */ + +#ifndef HB_DEBUG_OBJECT +#define HB_DEBUG_OBJECT (HB_DEBUG+0) +#endif + + +/* reference_count */ + +#define HB_REFERENCE_COUNT_INERT_VALUE -1 +#define HB_REFERENCE_COUNT_POISON_VALUE -0x0000DEAD +#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT(HB_REFERENCE_COUNT_INERT_VALUE)} + +struct hb_reference_count_t +{ + hb_atomic_int_t ref_count; + + inline void init (int v) { ref_count.set_unsafe (v); } + inline int get_unsafe (void) const { return ref_count.get_unsafe (); } + inline int inc (void) { return ref_count.inc (); } + inline int dec (void) { return ref_count.dec (); } + inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_POISON_VALUE); } + + inline bool is_inert (void) const { return ref_count.get_unsafe () == HB_REFERENCE_COUNT_INERT_VALUE; } + inline bool is_valid (void) const { return ref_count.get_unsafe () > 0; } +}; + + +/* user_data */ + +#define HB_USER_DATA_ARRAY_INIT {HB_MUTEX_INIT, HB_LOCKABLE_SET_INIT} +struct hb_user_data_array_t +{ + struct hb_user_data_item_t { + hb_user_data_key_t *key; + void *data; + hb_destroy_func_t destroy; + + inline bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; } + inline bool operator == (hb_user_data_item_t &other) const { return key == other.key; } + + void finish (void) { if (destroy) destroy (data); } + }; + + hb_mutex_t lock; + hb_lockable_set_t items; + + inline void init (void) { lock.init (); items.init (); } + + HB_INTERNAL bool set (hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace); + + HB_INTERNAL void *get (hb_user_data_key_t *key); + + inline void finish (void) { items.finish (lock); lock.finish (); } +}; + + +/* object_header */ + +struct hb_object_header_t +{ + hb_reference_count_t ref_count; + hb_user_data_array_t user_data; + +#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INIT, HB_USER_DATA_ARRAY_INIT} + + private: + ASSERT_POD (); +}; + + +/* object */ + +template +static inline void hb_object_trace (const Type *obj, const char *function) +{ + DEBUG_MSG (OBJECT, (void *) obj, + "%s refcount=%d", + function, + obj ? obj->header.ref_count.get_unsafe () : 0); +} + +template +static inline Type *hb_object_create (void) +{ + Type *obj = (Type *) calloc (1, sizeof (Type)); + + if (unlikely (!obj)) + return obj; + + hb_object_init (obj); + hb_object_trace (obj, HB_FUNC); + return obj; +} +template +static inline void hb_object_init (Type *obj) +{ + obj->header.ref_count.init (1); + obj->header.user_data.init (); +} +template +static inline bool hb_object_is_inert (const Type *obj) +{ + return unlikely (obj->header.ref_count.is_inert ()); +} +template +static inline bool hb_object_is_valid (const Type *obj) +{ + return likely (obj->header.ref_count.is_valid ()); +} +template +static inline Type *hb_object_reference (Type *obj) +{ + hb_object_trace (obj, HB_FUNC); + if (unlikely (!obj || hb_object_is_inert (obj))) + return obj; + assert (hb_object_is_valid (obj)); + obj->header.ref_count.inc (); + return obj; +} +template +static inline bool hb_object_destroy (Type *obj) +{ + hb_object_trace (obj, HB_FUNC); + if (unlikely (!obj || hb_object_is_inert (obj))) + return false; + assert (hb_object_is_valid (obj)); + if (obj->header.ref_count.dec () != 1) + return false; + + obj->header.ref_count.finish (); /* Do this before user_data */ + obj->header.user_data.finish (); + return true; +} +template +static inline bool hb_object_set_user_data (Type *obj, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + if (unlikely (!obj || hb_object_is_inert (obj))) + return false; + assert (hb_object_is_valid (obj)); + return obj->header.user_data.set (key, data, destroy, replace); +} + +template +static inline void *hb_object_get_user_data (Type *obj, + hb_user_data_key_t *key) +{ + if (unlikely (!obj || hb_object_is_inert (obj))) + return NULL; + assert (hb_object_is_valid (obj)); + return obj->header.user_data.get (key); +} + + +#endif /* HB_OBJECT_PRIVATE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-open-file-private.hh b/3rdparty/harfbuzz-1.0.6/hb-open-file-private.hh new file mode 100644 index 0000000000..152230a0e5 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-open-file-private.hh @@ -0,0 +1,268 @@ +/* + * Copyright © 2007,2008,2009 Red Hat, Inc. + * Copyright © 2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OPEN_FILE_PRIVATE_HH +#define HB_OPEN_FILE_PRIVATE_HH + +#include "hb-open-type-private.hh" + + +namespace OT { + + +/* + * + * The OpenType Font File + * + */ + + +/* + * Organization of an OpenType Font + */ + +struct OpenTypeFontFile; +struct OffsetTable; +struct TTCHeader; + + +typedef struct TableRecord +{ + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + Tag tag; /* 4-byte identifier. */ + CheckSum checkSum; /* CheckSum for this table. */ + ULONG offset; /* Offset from beginning of TrueType font + * file. */ + ULONG length; /* Length of this table. */ + public: + DEFINE_SIZE_STATIC (16); +} OpenTypeTable; + +typedef struct OffsetTable +{ + friend struct OpenTypeFontFile; + + inline unsigned int get_table_count (void) const + { return numTables; } + inline const TableRecord& get_table (unsigned int i) const + { + if (unlikely (i >= numTables)) return Null(TableRecord); + return tables[i]; + } + inline bool find_table_index (hb_tag_t tag, unsigned int *table_index) const + { + Tag t; + t.set (tag); + unsigned int count = numTables; + for (unsigned int i = 0; i < count; i++) + { + if (t == tables[i].tag) + { + if (table_index) *table_index = i; + return true; + } + } + if (table_index) *table_index = Index::NOT_FOUND_INDEX; + return false; + } + inline const TableRecord& get_table_by_tag (hb_tag_t tag) const + { + unsigned int table_index; + find_table_index (tag, &table_index); + return get_table (table_index); + } + + public: + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables)); + } + + protected: + Tag sfnt_version; /* '\0\001\0\00' if TrueType / 'OTTO' if CFF */ + USHORT numTables; /* Number of tables. */ + USHORT searchRangeZ; /* (Maximum power of 2 <= numTables) x 16 */ + USHORT entrySelectorZ; /* Log2(maximum power of 2 <= numTables). */ + USHORT rangeShiftZ; /* NumTables x 16-searchRange. */ + TableRecord tables[VAR]; /* TableRecord entries. numTables items */ + public: + DEFINE_SIZE_ARRAY (12, tables); +} OpenTypeFontFace; + + +/* + * TrueType Collections + */ + +struct TTCHeaderVersion1 +{ + friend struct TTCHeader; + + inline unsigned int get_face_count (void) const { return table.len; } + inline const OpenTypeFontFace& get_face (unsigned int i) const { return this+table[i]; } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (table.sanitize (c, this)); + } + + protected: + Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */ + FixedVersion version; /* Version of the TTC Header (1.0), + * 0x00010000u */ + ArrayOf, ULONG> + table; /* Array of offsets to the OffsetTable for each font + * from the beginning of the file */ + public: + DEFINE_SIZE_ARRAY (12, table); +}; + +struct TTCHeader +{ + friend struct OpenTypeFontFile; + + private: + + inline unsigned int get_face_count (void) const + { + switch (u.header.version.major) { + case 2: /* version 2 is compatible with version 1 */ + case 1: return u.version1.get_face_count (); + default:return 0; + } + } + inline const OpenTypeFontFace& get_face (unsigned int i) const + { + switch (u.header.version.major) { + case 2: /* version 2 is compatible with version 1 */ + case 1: return u.version1.get_face (i); + default:return Null(OpenTypeFontFace); + } + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!u.header.version.sanitize (c))) return_trace (false); + switch (u.header.version.major) { + case 2: /* version 2 is compatible with version 1 */ + case 1: return_trace (u.version1.sanitize (c)); + default:return_trace (true); + } + } + + protected: + union { + struct { + Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */ + FixedVersion version; /* Version of the TTC Header (1.0 or 2.0), + * 0x00010000u or 0x00020000u */ + } header; + TTCHeaderVersion1 version1; + } u; +}; + + +/* + * OpenType Font File + */ + +struct OpenTypeFontFile +{ + static const hb_tag_t tableTag = HB_TAG ('_','_','_','_'); /* Sanitizer needs this. */ + + static const hb_tag_t CFFTag = HB_TAG ('O','T','T','O'); /* OpenType with Postscript outlines */ + static const hb_tag_t TrueTypeTag = HB_TAG ( 0 , 1 , 0 , 0 ); /* OpenType with TrueType outlines */ + static const hb_tag_t TTCTag = HB_TAG ('t','t','c','f'); /* TrueType Collection */ + static const hb_tag_t TrueTag = HB_TAG ('t','r','u','e'); /* Obsolete Apple TrueType */ + static const hb_tag_t Typ1Tag = HB_TAG ('t','y','p','1'); /* Obsolete Apple Type1 font in SFNT container */ + + inline hb_tag_t get_tag (void) const { return u.tag; } + + inline unsigned int get_face_count (void) const + { + switch (u.tag) { + case CFFTag: /* All the non-collection tags */ + case TrueTag: + case Typ1Tag: + case TrueTypeTag: return 1; + case TTCTag: return u.ttcHeader.get_face_count (); + default: return 0; + } + } + inline const OpenTypeFontFace& get_face (unsigned int i) const + { + switch (u.tag) { + /* Note: for non-collection SFNT data we ignore index. This is because + * Apple dfont container is a container of SFNT's. So each SFNT is a + * non-TTC, but the index is more than zero. */ + case CFFTag: /* All the non-collection tags */ + case TrueTag: + case Typ1Tag: + case TrueTypeTag: return u.fontFace; + case TTCTag: return u.ttcHeader.get_face (i); + default: return Null(OpenTypeFontFace); + } + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!u.tag.sanitize (c))) return_trace (false); + switch (u.tag) { + case CFFTag: /* All the non-collection tags */ + case TrueTag: + case Typ1Tag: + case TrueTypeTag: return_trace (u.fontFace.sanitize (c)); + case TTCTag: return_trace (u.ttcHeader.sanitize (c)); + default: return_trace (true); + } + } + + protected: + union { + Tag tag; /* 4-byte identifier. */ + OpenTypeFontFace fontFace; + TTCHeader ttcHeader; + } u; + public: + DEFINE_SIZE_UNION (4, tag); +}; + + +} /* namespace OT */ + + +#endif /* HB_OPEN_FILE_PRIVATE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-open-type-private.hh b/3rdparty/harfbuzz-1.0.6/hb-open-type-private.hh new file mode 100644 index 0000000000..f053502ded --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-open-type-private.hh @@ -0,0 +1,1046 @@ +/* + * Copyright © 2007,2008,2009,2010 Red Hat, Inc. + * Copyright © 2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OPEN_TYPE_PRIVATE_HH +#define HB_OPEN_TYPE_PRIVATE_HH + +#include "hb-private.hh" + + +namespace OT { + + + +/* + * Casts + */ + +/* Cast to struct T, reference to reference */ +template +static inline const Type& CastR(const TObject &X) +{ return reinterpret_cast (X); } +template +static inline Type& CastR(TObject &X) +{ return reinterpret_cast (X); } + +/* Cast to struct T, pointer to pointer */ +template +static inline const Type* CastP(const TObject *X) +{ return reinterpret_cast (X); } +template +static inline Type* CastP(TObject *X) +{ return reinterpret_cast (X); } + +/* StructAtOffset(P,Ofs) returns the struct T& that is placed at memory + * location pointed to by P plus Ofs bytes. */ +template +static inline const Type& StructAtOffset(const void *P, unsigned int offset) +{ return * reinterpret_cast ((const char *) P + offset); } +template +static inline Type& StructAtOffset(void *P, unsigned int offset) +{ return * reinterpret_cast ((char *) P + offset); } + +/* StructAfter(X) returns the struct T& that is placed after X. + * Works with X of variable size also. X must implement get_size() */ +template +static inline const Type& StructAfter(const TObject &X) +{ return StructAtOffset(&X, X.get_size()); } +template +static inline Type& StructAfter(TObject &X) +{ return StructAtOffset(&X, X.get_size()); } + + + +/* + * Size checking + */ + +/* Check _assertion in a method environment */ +#define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \ + inline void _instance_assertion_on_line_##_line (void) const \ + { \ + ASSERT_STATIC (_assertion); \ + ASSERT_INSTANCE_POD (*this); /* Make sure it's POD. */ \ + } +# define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion) +# define DEFINE_INSTANCE_ASSERTION(_assertion) _DEFINE_INSTANCE_ASSERTION0 (__LINE__, _assertion) + +/* Check that _code compiles in a method environment */ +#define _DEFINE_COMPILES_ASSERTION1(_line, _code) \ + inline void _compiles_assertion_on_line_##_line (void) const \ + { _code; } +# define _DEFINE_COMPILES_ASSERTION0(_line, _code) _DEFINE_COMPILES_ASSERTION1 (_line, _code) +# define DEFINE_COMPILES_ASSERTION(_code) _DEFINE_COMPILES_ASSERTION0 (__LINE__, _code) + + +#define DEFINE_SIZE_STATIC(size) \ + DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size)); \ + static const unsigned int static_size = (size); \ + static const unsigned int min_size = (size) + +/* Size signifying variable-sized array */ +#define VAR 1 + +#define DEFINE_SIZE_UNION(size, _member) \ + DEFINE_INSTANCE_ASSERTION (this->u._member.static_size == (size)); \ + static const unsigned int min_size = (size) + +#define DEFINE_SIZE_MIN(size) \ + DEFINE_INSTANCE_ASSERTION (sizeof (*this) >= (size)); \ + static const unsigned int min_size = (size) + +#define DEFINE_SIZE_ARRAY(size, array) \ + DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size) + sizeof (array[0])); \ + DEFINE_COMPILES_ASSERTION ((void) array[0].static_size) \ + static const unsigned int min_size = (size) + +#define DEFINE_SIZE_ARRAY2(size, array1, array2) \ + DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size) + sizeof (this->array1[0]) + sizeof (this->array2[0])); \ + DEFINE_COMPILES_ASSERTION ((void) array1[0].static_size; (void) array2[0].static_size) \ + static const unsigned int min_size = (size) + + + +/* + * Null objects + */ + +/* Global nul-content Null pool. Enlarge as necessary. */ +/* TODO This really should be a extern HB_INTERNAL and defined somewhere... */ +static const void *_NullPool[(256+8) / sizeof (void *)]; + +/* Generic nul-content Null objects. */ +template +static inline const Type& Null (void) { + ASSERT_STATIC (sizeof (Type) <= sizeof (_NullPool)); + return *CastP (_NullPool); +} + +/* Specializaiton for arbitrary-content arbitrary-sized Null objects. */ +#define DEFINE_NULL_DATA(Type, data) \ +static const char _Null##Type[sizeof (Type) + 1] = data; /* +1 is for nul-termination in data */ \ +template <> \ +/*static*/ inline const Type& Null (void) { \ + return *CastP (_Null##Type); \ +} /* The following line really exists such that we end in a place needing semicolon */ \ +ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type)) + +/* Accessor macro. */ +#define Null(Type) Null() + + +/* + * Dispatch + */ + +template +struct hb_dispatch_context_t +{ + static const unsigned int max_debug_depth = MaxDebugDepth; + typedef Return return_t; + template + inline bool may_dispatch (const T *obj, const F *format) { return true; } + static return_t no_dispatch_return_value (void) { return Context::default_return_value (); } +}; + + +/* + * Sanitize + */ + +#ifndef HB_DEBUG_SANITIZE +#define HB_DEBUG_SANITIZE (HB_DEBUG+0) +#endif + + +#define TRACE_SANITIZE(this) \ + hb_auto_trace_t trace \ + (&c->debug_depth, c->get_name (), this, HB_FUNC, \ + ""); + +/* This limits sanitizing time on really broken fonts. */ +#ifndef HB_SANITIZE_MAX_EDITS +#define HB_SANITIZE_MAX_EDITS 100 +#endif + +struct hb_sanitize_context_t : + hb_dispatch_context_t +{ + inline hb_sanitize_context_t (void) : + debug_depth (0), + start (NULL), end (NULL), + writable (false), edit_count (0), + blob (NULL) {} + + inline const char *get_name (void) { return "SANITIZE"; } + template + inline bool may_dispatch (const T *obj, const F *format) + { return format->sanitize (this); } + template + inline return_t dispatch (const T &obj) { return obj.sanitize (this); } + static return_t default_return_value (void) { return true; } + static return_t no_dispatch_return_value (void) { return false; } + bool stop_sublookup_iteration (const return_t r) const { return !r; } + + inline void init (hb_blob_t *b) + { + this->blob = hb_blob_reference (b); + this->writable = false; + } + + inline void start_processing (void) + { + this->start = hb_blob_get_data (this->blob, NULL); + this->end = this->start + hb_blob_get_length (this->blob); + assert (this->start <= this->end); /* Must not overflow. */ + this->edit_count = 0; + this->debug_depth = 0; + + DEBUG_MSG_LEVEL (SANITIZE, start, 0, +1, + "start [%p..%p] (%lu bytes)", + this->start, this->end, + (unsigned long) (this->end - this->start)); + } + + inline void end_processing (void) + { + DEBUG_MSG_LEVEL (SANITIZE, this->start, 0, -1, + "end [%p..%p] %u edit requests", + this->start, this->end, this->edit_count); + + hb_blob_destroy (this->blob); + this->blob = NULL; + this->start = this->end = NULL; + } + + inline bool check_range (const void *base, unsigned int len) const + { + const char *p = (const char *) base; + bool ok = this->start <= p && p <= this->end && (unsigned int) (this->end - p) >= len; + + DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0, + "check_range [%p..%p] (%d bytes) in [%p..%p] -> %s", + p, p + len, len, + this->start, this->end, + ok ? "OK" : "OUT-OF-RANGE"); + + return likely (ok); + } + + inline bool check_array (const void *base, unsigned int record_size, unsigned int len) const + { + const char *p = (const char *) base; + bool overflows = _hb_unsigned_int_mul_overflows (len, record_size); + unsigned int array_size = record_size * len; + bool ok = !overflows && this->check_range (base, array_size); + + DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0, + "check_array [%p..%p] (%d*%d=%d bytes) in [%p..%p] -> %s", + p, p + (record_size * len), record_size, len, (unsigned int) array_size, + this->start, this->end, + overflows ? "OVERFLOWS" : ok ? "OK" : "OUT-OF-RANGE"); + + return likely (ok); + } + + template + inline bool check_struct (const Type *obj) const + { + return likely (this->check_range (obj, obj->min_size)); + } + + inline bool may_edit (const void *base HB_UNUSED, unsigned int len HB_UNUSED) + { + if (this->edit_count >= HB_SANITIZE_MAX_EDITS) + return false; + + const char *p = (const char *) base; + this->edit_count++; + + DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0, + "may_edit(%u) [%p..%p] (%d bytes) in [%p..%p] -> %s", + this->edit_count, + p, p + len, len, + this->start, this->end, + this->writable ? "GRANTED" : "DENIED"); + + return this->writable; + } + + template + inline bool try_set (const Type *obj, const ValueType &v) { + if (this->may_edit (obj, obj->static_size)) { + const_cast (obj)->set (v); + return true; + } + return false; + } + + mutable unsigned int debug_depth; + const char *start, *end; + bool writable; + unsigned int edit_count; + hb_blob_t *blob; +}; + + + +/* Template to sanitize an object. */ +template +struct Sanitizer +{ + static hb_blob_t *sanitize (hb_blob_t *blob) { + hb_sanitize_context_t c[1]; + bool sane; + + /* TODO is_sane() stuff */ + + c->init (blob); + + retry: + DEBUG_MSG_FUNC (SANITIZE, c->start, "start"); + + c->start_processing (); + + if (unlikely (!c->start)) { + c->end_processing (); + return blob; + } + + Type *t = CastP (const_cast (c->start)); + + sane = t->sanitize (c); + if (sane) { + if (c->edit_count) { + DEBUG_MSG_FUNC (SANITIZE, c->start, "passed first round with %d edits; going for second round", c->edit_count); + + /* sanitize again to ensure no toe-stepping */ + c->edit_count = 0; + sane = t->sanitize (c); + if (c->edit_count) { + DEBUG_MSG_FUNC (SANITIZE, c->start, "requested %d edits in second round; FAILLING", c->edit_count); + sane = false; + } + } + } else { + unsigned int edit_count = c->edit_count; + if (edit_count && !c->writable) { + c->start = hb_blob_get_data_writable (blob, NULL); + c->end = c->start + hb_blob_get_length (blob); + + if (c->start) { + c->writable = true; + /* ok, we made it writable by relocating. try again */ + DEBUG_MSG_FUNC (SANITIZE, c->start, "retry"); + goto retry; + } + } + } + + c->end_processing (); + + DEBUG_MSG_FUNC (SANITIZE, c->start, sane ? "PASSED" : "FAILED"); + if (sane) + return blob; + else { + hb_blob_destroy (blob); + return hb_blob_get_empty (); + } + } + + static const Type* lock_instance (hb_blob_t *blob) { + hb_blob_make_immutable (blob); + const char *base = hb_blob_get_data (blob, NULL); + return unlikely (!base) ? &Null(Type) : CastP (base); + } +}; + + + +/* + * Serialize + */ + +#ifndef HB_DEBUG_SERIALIZE +#define HB_DEBUG_SERIALIZE (HB_DEBUG+0) +#endif + + +#define TRACE_SERIALIZE(this) \ + hb_auto_trace_t trace \ + (&c->debug_depth, "SERIALIZE", c, HB_FUNC, \ + ""); + + +struct hb_serialize_context_t +{ + inline hb_serialize_context_t (void *start_, unsigned int size) + { + this->start = (char *) start_; + this->end = this->start + size; + + this->ran_out_of_room = false; + this->head = this->start; + this->debug_depth = 0; + } + + template + inline Type *start_serialize (void) + { + DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, +1, + "start [%p..%p] (%lu bytes)", + this->start, this->end, + (unsigned long) (this->end - this->start)); + + return start_embed (); + } + + inline void end_serialize (void) + { + DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, -1, + "end [%p..%p] serialized %d bytes; %s", + this->start, this->end, + (int) (this->head - this->start), + this->ran_out_of_room ? "RAN OUT OF ROOM" : "did not ran out of room"); + + } + + template + inline Type *copy (void) + { + assert (!this->ran_out_of_room); + unsigned int len = this->head - this->start; + void *p = malloc (len); + if (p) + memcpy (p, this->start, len); + return reinterpret_cast (p); + } + + template + inline Type *allocate_size (unsigned int size) + { + if (unlikely (this->ran_out_of_room || this->end - this->head < ptrdiff_t (size))) { + this->ran_out_of_room = true; + return NULL; + } + memset (this->head, 0, size); + char *ret = this->head; + this->head += size; + return reinterpret_cast (ret); + } + + template + inline Type *allocate_min (void) + { + return this->allocate_size (Type::min_size); + } + + template + inline Type *start_embed (void) + { + Type *ret = reinterpret_cast (this->head); + return ret; + } + + template + inline Type *embed (const Type &obj) + { + unsigned int size = obj.get_size (); + Type *ret = this->allocate_size (size); + if (unlikely (!ret)) return NULL; + memcpy (ret, obj, size); + return ret; + } + + template + inline Type *extend_min (Type &obj) + { + unsigned int size = obj.min_size; + assert (this->start <= (char *) &obj && (char *) &obj <= this->head && (char *) &obj + size >= this->head); + if (unlikely (!this->allocate_size (((char *) &obj) + size - this->head))) return NULL; + return reinterpret_cast (&obj); + } + + template + inline Type *extend (Type &obj) + { + unsigned int size = obj.get_size (); + assert (this->start < (char *) &obj && (char *) &obj <= this->head && (char *) &obj + size >= this->head); + if (unlikely (!this->allocate_size (((char *) &obj) + size - this->head))) return NULL; + return reinterpret_cast (&obj); + } + + inline void truncate (void *new_head) + { + assert (this->start < new_head && new_head <= this->head); + this->head = (char *) new_head; + } + + unsigned int debug_depth; + char *start, *end, *head; + bool ran_out_of_room; +}; + +template +struct Supplier +{ + inline Supplier (const Type *array, unsigned int len_) + { + head = array; + len = len_; + } + inline const Type operator [] (unsigned int i) const + { + if (unlikely (i >= len)) return Type (); + return head[i]; + } + + inline void advance (unsigned int count) + { + if (unlikely (count > len)) + count = len; + len -= count; + head += count; + } + + private: + inline Supplier (const Supplier &); /* Disallow copy */ + inline Supplier& operator= (const Supplier &); /* Disallow copy */ + + unsigned int len; + const Type *head; +}; + + + + +/* + * + * The OpenType Font File: Data Types + */ + + +/* "The following data types are used in the OpenType font file. + * All OpenType fonts use Motorola-style byte ordering (Big Endian):" */ + +/* + * Int types + */ + + +template struct BEInt; + +template +struct BEInt +{ + public: + inline void set (Type V) + { + v = V; + } + inline operator Type (void) const + { + return v; + } + private: uint8_t v; +}; +template +struct BEInt +{ + public: + inline void set (Type V) + { + v[0] = (V >> 8) & 0xFF; + v[1] = (V ) & 0xFF; + } + inline operator Type (void) const + { + return (v[0] << 8) + + (v[1] ); + } + private: uint8_t v[2]; +}; +template +struct BEInt +{ + public: + inline void set (Type V) + { + v[0] = (V >> 16) & 0xFF; + v[1] = (V >> 8) & 0xFF; + v[2] = (V ) & 0xFF; + } + inline operator Type (void) const + { + return (v[0] << 16) + + (v[1] << 8) + + (v[2] ); + } + private: uint8_t v[3]; +}; +template +struct BEInt +{ + public: + inline void set (Type V) + { + v[0] = (V >> 24) & 0xFF; + v[1] = (V >> 16) & 0xFF; + v[2] = (V >> 8) & 0xFF; + v[3] = (V ) & 0xFF; + } + inline operator Type (void) const + { + return (v[0] << 24) + + (v[1] << 16) + + (v[2] << 8) + + (v[3] ); + } + private: uint8_t v[4]; +}; + +/* Integer types in big-endian order and no alignment requirement */ +template +struct IntType +{ + inline void set (Type i) { v.set (i); } + inline operator Type(void) const { return v; } + inline bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } + inline bool operator != (const IntType &o) const { return !(*this == o); } + static inline int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } + inline int cmp (Type a) const + { + Type b = v; + if (sizeof (Type) < sizeof (int)) + return (int) a - (int) b; + else + return a < b ? -1 : a == b ? 0 : +1; + } + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this))); + } + protected: + BEInt v; + public: + DEFINE_SIZE_STATIC (Size); +}; + +typedef IntType BYTE; /* 8-bit unsigned integer. */ +typedef IntType USHORT; /* 16-bit unsigned integer. */ +typedef IntType SHORT; /* 16-bit signed integer. */ +typedef IntType ULONG; /* 32-bit unsigned integer. */ +typedef IntType LONG; /* 32-bit signed integer. */ +typedef IntType UINT24; /* 24-bit unsigned integer. */ + +/* 16-bit signed integer (SHORT) that describes a quantity in FUnits. */ +typedef SHORT FWORD; + +/* 16-bit unsigned integer (USHORT) that describes a quantity in FUnits. */ +typedef USHORT UFWORD; + +/* Date represented in number of seconds since 12:00 midnight, January 1, + * 1904. The value is represented as a signed 64-bit integer. */ +struct LONGDATETIME +{ + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this))); + } + protected: + LONG major; + ULONG minor; + public: + DEFINE_SIZE_STATIC (8); +}; + +/* Array of four uint8s (length = 32 bits) used to identify a script, language + * system, feature, or baseline */ +struct Tag : ULONG +{ + /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ + inline operator const char* (void) const { return reinterpret_cast (&this->v); } + inline operator char* (void) { return reinterpret_cast (&this->v); } + public: + DEFINE_SIZE_STATIC (4); +}; +DEFINE_NULL_DATA (Tag, " "); + +/* Glyph index number, same as uint16 (length = 16 bits) */ +struct GlyphID : USHORT { + static inline int cmp (const GlyphID *a, const GlyphID *b) { return b->USHORT::cmp (*a); } + inline int cmp (hb_codepoint_t a) const { return (int) a - (int) *this; } +}; + +/* Script/language-system/feature index */ +struct Index : USHORT { + static const unsigned int NOT_FOUND_INDEX = 0xFFFFu; +}; +DEFINE_NULL_DATA (Index, "\xff\xff"); + +/* Offset, Null offset = 0 */ +template +struct Offset : Type +{ + inline bool is_null (void) const { return 0 == *this; } + public: + DEFINE_SIZE_STATIC (sizeof(Type)); +}; + + +/* CheckSum */ +struct CheckSum : ULONG +{ + /* This is reference implementation from the spec. */ + static inline uint32_t CalcTableChecksum (const ULONG *Table, uint32_t Length) + { + uint32_t Sum = 0L; + const ULONG *EndPtr = Table+((Length+3) & ~3) / ULONG::static_size; + + while (Table < EndPtr) + Sum += *Table++; + return Sum; + } + + /* Note: data should be 4byte aligned and have 4byte padding at the end. */ + inline void set_for_data (const void *data, unsigned int length) + { set (CalcTableChecksum ((const ULONG *) data, length)); } + + public: + DEFINE_SIZE_STATIC (4); +}; + + +/* + * Version Numbers + */ + +struct FixedVersion +{ + inline uint32_t to_int (void) const { return (major << 16) + minor; } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + USHORT major; + USHORT minor; + public: + DEFINE_SIZE_STATIC (4); +}; + + + +/* + * Template subclasses of Offset that do the dereferencing. + * Use: (base+offset) + */ + +template +struct OffsetTo : Offset +{ + inline const Type& operator () (const void *base) const + { + unsigned int offset = *this; + if (unlikely (!offset)) return Null(Type); + return StructAtOffset (base, offset); + } + + inline Type& serialize (hb_serialize_context_t *c, const void *base) + { + Type *t = c->start_embed (); + this->set ((char *) t - (char *) base); /* TODO(serialize) Overflow? */ + return *t; + } + + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) return_trace (false); + unsigned int offset = *this; + if (unlikely (!offset)) return_trace (true); + const Type &obj = StructAtOffset (base, offset); + return_trace (likely (obj.sanitize (c)) || neuter (c)); + } + template + inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) return_trace (false); + unsigned int offset = *this; + if (unlikely (!offset)) return_trace (true); + const Type &obj = StructAtOffset (base, offset); + return_trace (likely (obj.sanitize (c, user_data)) || neuter (c)); + } + + /* Set the offset to Null */ + inline bool neuter (hb_sanitize_context_t *c) const { + return c->try_set (this, 0); + } + DEFINE_SIZE_STATIC (sizeof(OffsetType)); +}; +template +static inline const Type& operator + (const Base &base, const OffsetTo &offset) { return offset (base); } +template +static inline Type& operator + (Base &base, OffsetTo &offset) { return offset (base); } + + +/* + * Array Types + */ + +/* An array with a number of elements. */ +template +struct ArrayOf +{ + const Type *sub_array (unsigned int start_offset, unsigned int *pcount /* IN/OUT */) const + { + unsigned int count = len; + if (unlikely (start_offset > count)) + count = 0; + else + count -= start_offset; + count = MIN (count, *pcount); + *pcount = count; + return array + start_offset; + } + + inline const Type& operator [] (unsigned int i) const + { + if (unlikely (i >= len)) return Null(Type); + return array[i]; + } + inline Type& operator [] (unsigned int i) + { + return array[i]; + } + inline unsigned int get_size (void) const + { return len.static_size + len * Type::static_size; } + + inline bool serialize (hb_serialize_context_t *c, + unsigned int items_len) + { + TRACE_SERIALIZE (this); + if (unlikely (!c->extend_min (*this))) return_trace (false); + len.set (items_len); /* TODO(serialize) Overflow? */ + if (unlikely (!c->extend (*this))) return_trace (false); + return_trace (true); + } + + inline bool serialize (hb_serialize_context_t *c, + Supplier &items, + unsigned int items_len) + { + TRACE_SERIALIZE (this); + if (unlikely (!serialize (c, items_len))) return_trace (false); + for (unsigned int i = 0; i < items_len; i++) + array[i] = items[i]; + items.advance (items_len); + return_trace (true); + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c))) return_trace (false); + + /* Note: for structs that do not reference other structs, + * we do not need to call their sanitize() as we already did + * a bound check on the aggregate array size. We just include + * a small unreachable expression to make sure the structs + * pointed to do have a simple sanitize(), ie. they do not + * reference other structs via offsets. + */ + (void) (false && array[0].sanitize (c)); + + return_trace (true); + } + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c))) return_trace (false); + unsigned int count = len; + for (unsigned int i = 0; i < count; i++) + if (unlikely (!array[i].sanitize (c, base))) + return_trace (false); + return_trace (true); + } + template + inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c))) return_trace (false); + unsigned int count = len; + for (unsigned int i = 0; i < count; i++) + if (unlikely (!array[i].sanitize (c, base, user_data))) + return_trace (false); + return_trace (true); + } + + template + inline int lsearch (const SearchType &x) const + { + unsigned int count = len; + for (unsigned int i = 0; i < count; i++) + if (!this->array[i].cmp (x)) + return i; + return -1; + } + + private: + inline bool sanitize_shallow (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && c->check_array (array, Type::static_size, len)); + } + + public: + LenType len; + Type array[VAR]; + public: + DEFINE_SIZE_ARRAY (sizeof (LenType), array); +}; + +/* Array of Offset's */ +template +struct OffsetArrayOf : ArrayOf > {}; + +/* Array of offsets relative to the beginning of the array itself. */ +template +struct OffsetListOf : OffsetArrayOf +{ + inline const Type& operator [] (unsigned int i) const + { + if (unlikely (i >= this->len)) return Null(Type); + return this+this->array[i]; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (OffsetArrayOf::sanitize (c, this)); + } + template + inline bool sanitize (hb_sanitize_context_t *c, T user_data) const + { + TRACE_SANITIZE (this); + return_trace (OffsetArrayOf::sanitize (c, this, user_data)); + } +}; + + +/* An array starting at second element. */ +template +struct HeadlessArrayOf +{ + inline const Type& operator [] (unsigned int i) const + { + if (unlikely (i >= len || !i)) return Null(Type); + return array[i-1]; + } + inline unsigned int get_size (void) const + { return len.static_size + (len ? len - 1 : 0) * Type::static_size; } + + inline bool serialize (hb_serialize_context_t *c, + Supplier &items, + unsigned int items_len) + { + TRACE_SERIALIZE (this); + if (unlikely (!c->extend_min (*this))) return_trace (false); + len.set (items_len); /* TODO(serialize) Overflow? */ + if (unlikely (!items_len)) return_trace (true); + if (unlikely (!c->extend (*this))) return_trace (false); + for (unsigned int i = 0; i < items_len - 1; i++) + array[i] = items[i]; + items.advance (items_len - 1); + return_trace (true); + } + + inline bool sanitize_shallow (hb_sanitize_context_t *c) const + { + return c->check_struct (this) + && c->check_array (this, Type::static_size, len); + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c))) return_trace (false); + + /* Note: for structs that do not reference other structs, + * we do not need to call their sanitize() as we already did + * a bound check on the aggregate array size. We just include + * a small unreachable expression to make sure the structs + * pointed to do have a simple sanitize(), ie. they do not + * reference other structs via offsets. + */ + (void) (false && array[0].sanitize (c)); + + return_trace (true); + } + + LenType len; + Type array[VAR]; + public: + DEFINE_SIZE_ARRAY (sizeof (LenType), array); +}; + + +/* An array with sorted elements. Supports binary searching. */ +template +struct SortedArrayOf : ArrayOf +{ + template + inline int bsearch (const SearchType &x) const + { + /* Hand-coded bsearch here since this is in the hot inner loop. */ + int min = 0, max = (int) this->len - 1; + while (min <= max) + { + int mid = (min + max) / 2; + int c = this->array[mid].cmp (x); + if (c < 0) + max = mid - 1; + else if (c > 0) + min = mid + 1; + else + return mid; + } + return -1; + } +}; + + +} /* namespace OT */ + + +#endif /* HB_OPEN_TYPE_PRIVATE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-ot-cmap-table.hh b/3rdparty/harfbuzz-1.0.6/hb-ot-cmap-table.hh new file mode 100644 index 0000000000..c9161f0ef4 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ot-cmap-table.hh @@ -0,0 +1,528 @@ +/* + * Copyright © 2014 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_CMAP_TABLE_HH +#define HB_OT_CMAP_TABLE_HH + +#include "hb-open-type-private.hh" + + +namespace OT { + + +/* + * cmap -- Character To Glyph Index Mapping Table + */ + +#define HB_OT_TAG_cmap HB_TAG('c','m','a','p') + + +struct CmapSubtableFormat0 +{ + inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + { + hb_codepoint_t gid = codepoint < 256 ? glyphIdArray[codepoint] : 0; + if (!gid) + return false; + *glyph = gid; + return true; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + protected: + USHORT format; /* Format number is set to 0. */ + USHORT lengthZ; /* Byte length of this subtable. */ + USHORT languageZ; /* Ignore. */ + BYTE glyphIdArray[256];/* An array that maps character + * code to glyph index values. */ + public: + DEFINE_SIZE_STATIC (6 + 256); +}; + +struct CmapSubtableFormat4 +{ + inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + { + unsigned int segCount; + const USHORT *endCount; + const USHORT *startCount; + const USHORT *idDelta; + const USHORT *idRangeOffset; + const USHORT *glyphIdArray; + unsigned int glyphIdArrayLength; + + segCount = this->segCountX2 / 2; + endCount = this->values; + startCount = endCount + segCount + 1; + idDelta = startCount + segCount; + idRangeOffset = idDelta + segCount; + glyphIdArray = idRangeOffset + segCount; + glyphIdArrayLength = (this->length - 16 - 8 * segCount) / 2; + + /* Custom two-array bsearch. */ + int min = 0, max = (int) segCount - 1; + unsigned int i; + while (min <= max) + { + int mid = (min + max) / 2; + if (codepoint < startCount[mid]) + max = mid - 1; + else if (codepoint > endCount[mid]) + min = mid + 1; + else + { + i = mid; + goto found; + } + } + return false; + + found: + hb_codepoint_t gid; + unsigned int rangeOffset = idRangeOffset[i]; + if (rangeOffset == 0) + gid = codepoint + idDelta[i]; + else + { + /* Somebody has been smoking... */ + unsigned int index = rangeOffset / 2 + (codepoint - startCount[i]) + i - segCount; + if (unlikely (index >= glyphIdArrayLength)) + return false; + gid = glyphIdArray[index]; + if (unlikely (!gid)) + return false; + gid += idDelta[i]; + } + + *glyph = gid & 0xFFFFu; + return true; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) + return_trace (false); + + if (unlikely (!c->check_range (this, length))) + { + /* Some broken fonts have too long of a "length" value. + * If that is the case, just change the value to truncate + * the subtable at the end of the blob. */ + uint16_t new_length = (uint16_t) MIN ((uintptr_t) 65535, + (uintptr_t) (c->end - + (char *) this)); + if (!c->try_set (&length, new_length)) + return_trace (false); + } + + return_trace (16 + 4 * (unsigned int) segCountX2 <= length); + } + + protected: + USHORT format; /* Format number is set to 4. */ + USHORT length; /* This is the length in bytes of the + * subtable. */ + USHORT languageZ; /* Ignore. */ + USHORT segCountX2; /* 2 x segCount. */ + USHORT searchRangeZ; /* 2 * (2**floor(log2(segCount))) */ + USHORT entrySelectorZ; /* log2(searchRange/2) */ + USHORT rangeShiftZ; /* 2 x segCount - searchRange */ + + USHORT values[VAR]; +#if 0 + USHORT endCount[segCount]; /* End characterCode for each segment, + * last=0xFFFFu. */ + USHORT reservedPad; /* Set to 0. */ + USHORT startCount[segCount]; /* Start character code for each segment. */ + SHORT idDelta[segCount]; /* Delta for all character codes in segment. */ + USHORT idRangeOffset[segCount];/* Offsets into glyphIdArray or 0 */ + USHORT glyphIdArray[VAR]; /* Glyph index array (arbitrary length) */ +#endif + + public: + DEFINE_SIZE_ARRAY (14, values); +}; + +struct CmapSubtableLongGroup +{ + friend struct CmapSubtableFormat12; + friend struct CmapSubtableFormat13; + + int cmp (hb_codepoint_t codepoint) const + { + if (codepoint < startCharCode) return -1; + if (codepoint > endCharCode) return +1; + return 0; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + private: + ULONG startCharCode; /* First character code in this group. */ + ULONG endCharCode; /* Last character code in this group. */ + ULONG glyphID; /* Glyph index; interpretation depends on + * subtable format. */ + public: + DEFINE_SIZE_STATIC (12); +}; + +template +struct CmapSubtableTrimmed +{ + inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + { + /* Rely on our implicit array bound-checking. */ + hb_codepoint_t gid = glyphIdArray[codepoint - startCharCode]; + if (!gid) + return false; + *glyph = gid; + return true; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && glyphIdArray.sanitize (c)); + } + + protected: + UINT formatReserved; /* Subtable format and (maybe) padding. */ + UINT lengthZ; /* Byte length of this subtable. */ + UINT languageZ; /* Ignore. */ + UINT startCharCode; /* First character code covered. */ + ArrayOf + glyphIdArray; /* Array of glyph index values for character + * codes in the range. */ + public: + DEFINE_SIZE_ARRAY (5 * sizeof (UINT), glyphIdArray); +}; + +struct CmapSubtableFormat6 : CmapSubtableTrimmed {}; +struct CmapSubtableFormat10 : CmapSubtableTrimmed {}; + +template +struct CmapSubtableLongSegmented +{ + inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + { + int i = groups.bsearch (codepoint); + if (i == -1) + return false; + *glyph = T::group_get_glyph (groups[i], codepoint); + return true; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && groups.sanitize (c)); + } + + protected: + USHORT format; /* Subtable format; set to 12. */ + USHORT reservedZ; /* Reserved; set to 0. */ + ULONG lengthZ; /* Byte length of this subtable. */ + ULONG languageZ; /* Ignore. */ + SortedArrayOf + groups; /* Groupings. */ + public: + DEFINE_SIZE_ARRAY (16, groups); +}; + +struct CmapSubtableFormat12 : CmapSubtableLongSegmented +{ + static inline hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, + hb_codepoint_t u) + { return group.glyphID + (u - group.startCharCode); } +}; + +struct CmapSubtableFormat13 : CmapSubtableLongSegmented +{ + static inline hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, + hb_codepoint_t u HB_UNUSED) + { return group.glyphID; } +}; + +typedef enum +{ + GLYPH_VARIANT_NOT_FOUND = 0, + GLYPH_VARIANT_FOUND = 1, + GLYPH_VARIANT_USE_DEFAULT = 2 +} glyph_variant_t; + +struct UnicodeValueRange +{ + inline int cmp (const hb_codepoint_t &codepoint) const + { + if (codepoint < startUnicodeValue) return -1; + if (codepoint > startUnicodeValue + additionalCount) return +1; + return 0; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + UINT24 startUnicodeValue; /* First value in this range. */ + BYTE additionalCount; /* Number of additional values in this + * range. */ + public: + DEFINE_SIZE_STATIC (4); +}; + +typedef SortedArrayOf DefaultUVS; + +struct UVSMapping +{ + inline int cmp (const hb_codepoint_t &codepoint) const + { + return unicodeValue.cmp (codepoint); + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + UINT24 unicodeValue; /* Base Unicode value of the UVS */ + GlyphID glyphID; /* Glyph ID of the UVS */ + public: + DEFINE_SIZE_STATIC (5); +}; + +typedef SortedArrayOf NonDefaultUVS; + +struct VariationSelectorRecord +{ + inline glyph_variant_t get_glyph (hb_codepoint_t codepoint, + hb_codepoint_t *glyph, + const void *base) const + { + int i; + const DefaultUVS &defaults = base+defaultUVS; + i = defaults.bsearch (codepoint); + if (i != -1) + return GLYPH_VARIANT_USE_DEFAULT; + const NonDefaultUVS &nonDefaults = base+nonDefaultUVS; + i = nonDefaults.bsearch (codepoint); + if (i != -1) + { + *glyph = nonDefaults[i].glyphID; + return GLYPH_VARIANT_FOUND; + } + return GLYPH_VARIANT_NOT_FOUND; + } + + inline int cmp (const hb_codepoint_t &variation_selector) const + { + return varSelector.cmp (variation_selector); + } + + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + defaultUVS.sanitize (c, base) && + nonDefaultUVS.sanitize (c, base)); + } + + UINT24 varSelector; /* Variation selector. */ + OffsetTo + defaultUVS; /* Offset to Default UVS Table. May be 0. */ + OffsetTo + nonDefaultUVS; /* Offset to Non-Default UVS Table. May be 0. */ + public: + DEFINE_SIZE_STATIC (11); +}; + +struct CmapSubtableFormat14 +{ + inline glyph_variant_t get_glyph_variant (hb_codepoint_t codepoint, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) const + { + return record[record.bsearch(variation_selector)].get_glyph (codepoint, glyph, this); + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + record.sanitize (c, this)); + } + + protected: + USHORT format; /* Format number is set to 0. */ + ULONG lengthZ; /* Byte length of this subtable. */ + SortedArrayOf + record; /* Variation selector records; sorted + * in increasing order of `varSelector'. */ + public: + DEFINE_SIZE_ARRAY (10, record); +}; + +struct CmapSubtable +{ + /* Note: We intentionally do NOT implement subtable formats 2 and 8. */ + + inline bool get_glyph (hb_codepoint_t codepoint, + hb_codepoint_t *glyph) const + { + switch (u.format) { + case 0: return u.format0 .get_glyph(codepoint, glyph); + case 4: return u.format4 .get_glyph(codepoint, glyph); + case 6: return u.format6 .get_glyph(codepoint, glyph); + case 10: return u.format10.get_glyph(codepoint, glyph); + case 12: return u.format12.get_glyph(codepoint, glyph); + case 13: return u.format13.get_glyph(codepoint, glyph); + case 14: + default: return false; + } + } + + inline glyph_variant_t get_glyph_variant (hb_codepoint_t codepoint, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) const + { + switch (u.format) { + case 14: return u.format14.get_glyph_variant(codepoint, variation_selector, glyph); + default: return GLYPH_VARIANT_NOT_FOUND; + } + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (!u.format.sanitize (c)) return_trace (false); + switch (u.format) { + case 0: return_trace (u.format0 .sanitize (c)); + case 4: return_trace (u.format4 .sanitize (c)); + case 6: return_trace (u.format6 .sanitize (c)); + case 10: return_trace (u.format10.sanitize (c)); + case 12: return_trace (u.format12.sanitize (c)); + case 13: return_trace (u.format13.sanitize (c)); + case 14: return_trace (u.format14.sanitize (c)); + default:return_trace (true); + } + } + + protected: + union { + USHORT format; /* Format identifier */ + CmapSubtableFormat0 format0; + CmapSubtableFormat4 format4; + CmapSubtableFormat6 format6; + CmapSubtableFormat10 format10; + CmapSubtableFormat12 format12; + CmapSubtableFormat13 format13; + CmapSubtableFormat14 format14; + } u; + public: + DEFINE_SIZE_UNION (2, format); +}; + + +struct EncodingRecord +{ + inline int cmp (const EncodingRecord &other) const + { + int ret; + ret = platformID.cmp (other.platformID); + if (ret) return ret; + ret = encodingID.cmp (other.encodingID); + if (ret) return ret; + return 0; + } + + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + subtable.sanitize (c, base)); + } + + USHORT platformID; /* Platform ID. */ + USHORT encodingID; /* Platform-specific encoding ID. */ + OffsetTo + subtable; /* Byte offset from beginning of table to the subtable for this encoding. */ + public: + DEFINE_SIZE_STATIC (8); +}; + +struct cmap +{ + static const hb_tag_t tableTag = HB_OT_TAG_cmap; + + inline const CmapSubtable *find_subtable (unsigned int platform_id, + unsigned int encoding_id) const + { + EncodingRecord key; + key.platformID.set (platform_id); + key.encodingID.set (encoding_id); + + /* Note: We can use bsearch, but since it has no performance + * implications, we use lsearch and as such accept fonts with + * unsorted subtable list. */ + int result = encodingRecord./*bsearch*/lsearch (key); + if (result == -1 || !encodingRecord[result].subtable) + return NULL; + + return &(this+encodingRecord[result].subtable); + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + likely (version == 0) && + encodingRecord.sanitize (c, this)); + } + + USHORT version; /* Table version number (0). */ + SortedArrayOf + encodingRecord; /* Encoding tables. */ + public: + DEFINE_SIZE_ARRAY (4, encodingRecord); +}; + + +} /* namespace OT */ + + +#endif /* HB_OT_CMAP_TABLE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-ot-font.cc b/3rdparty/harfbuzz-1.0.6/hb-ot-font.cc new file mode 100644 index 0000000000..69d2503abb --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ot-font.cc @@ -0,0 +1,434 @@ +/* + * Copyright © 2011,2014 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod, Roozbeh Pournader + */ + +#include "hb-private.hh" + +#include "hb-ot.h" + +#include "hb-font-private.hh" + +#include "hb-ot-cmap-table.hh" +#include "hb-ot-glyf-table.hh" +#include "hb-ot-head-table.hh" +#include "hb-ot-hhea-table.hh" +#include "hb-ot-hmtx-table.hh" + + +struct hb_ot_face_metrics_accelerator_t +{ + unsigned int num_metrics; + unsigned int num_advances; + unsigned int default_advance; + const OT::_mtx *table; + hb_blob_t *blob; + + inline void init (hb_face_t *face, + hb_tag_t _hea_tag, hb_tag_t _mtx_tag, + unsigned int default_advance_) + { + this->default_advance = default_advance_; + this->num_metrics = face->get_num_glyphs (); + + hb_blob_t *_hea_blob = OT::Sanitizer::sanitize (face->reference_table (_hea_tag)); + const OT::_hea *_hea = OT::Sanitizer::lock_instance (_hea_blob); + this->num_advances = _hea->numberOfLongMetrics; + hb_blob_destroy (_hea_blob); + + this->blob = OT::Sanitizer::sanitize (face->reference_table (_mtx_tag)); + if (unlikely (!this->num_advances || + 2 * (this->num_advances + this->num_metrics) > hb_blob_get_length (this->blob))) + { + this->num_metrics = this->num_advances = 0; + hb_blob_destroy (this->blob); + this->blob = hb_blob_get_empty (); + } + this->table = OT::Sanitizer::lock_instance (this->blob); + } + + inline void fini (void) + { + hb_blob_destroy (this->blob); + } + + inline unsigned int get_advance (hb_codepoint_t glyph) const + { + if (unlikely (glyph >= this->num_metrics)) + { + /* If this->num_metrics is zero, it means we don't have the metrics table + * for this direction: return default advance. Otherwise, it means that the + * glyph index is out of bound: return zero. */ + if (this->num_metrics) + return 0; + else + return this->default_advance; + } + + if (glyph >= this->num_advances) + glyph = this->num_advances - 1; + + return this->table->longMetric[glyph].advance; + } +}; + +struct hb_ot_face_glyf_accelerator_t +{ + bool short_offset; + unsigned int num_glyphs; + const OT::loca *loca; + const OT::glyf *glyf; + hb_blob_t *loca_blob; + hb_blob_t *glyf_blob; + unsigned int glyf_len; + + inline void init (hb_face_t *face) + { + hb_blob_t *head_blob = OT::Sanitizer::sanitize (face->reference_table (HB_OT_TAG_head)); + const OT::head *head = OT::Sanitizer::lock_instance (head_blob); + if ((unsigned int) head->indexToLocFormat > 1 || head->glyphDataFormat != 0) + { + /* Unknown format. Leave num_glyphs=0, that takes care of disabling us. */ + hb_blob_destroy (head_blob); + return; + } + this->short_offset = 0 == head->indexToLocFormat; + hb_blob_destroy (head_blob); + + this->loca_blob = OT::Sanitizer::sanitize (face->reference_table (HB_OT_TAG_loca)); + this->loca = OT::Sanitizer::lock_instance (this->loca_blob); + this->glyf_blob = OT::Sanitizer::sanitize (face->reference_table (HB_OT_TAG_glyf)); + this->glyf = OT::Sanitizer::lock_instance (this->glyf_blob); + + this->num_glyphs = MAX (1u, hb_blob_get_length (this->loca_blob) / (this->short_offset ? 2 : 4)) - 1; + this->glyf_len = hb_blob_get_length (this->glyf_blob); + } + + inline void fini (void) + { + hb_blob_destroy (this->loca_blob); + hb_blob_destroy (this->glyf_blob); + } + + inline bool get_extents (hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const + { + if (unlikely (glyph >= this->num_glyphs)) + return false; + + unsigned int start_offset, end_offset; + if (this->short_offset) + { + start_offset = 2 * this->loca->u.shortsZ[glyph]; + end_offset = 2 * this->loca->u.shortsZ[glyph + 1]; + } + else + { + start_offset = this->loca->u.longsZ[glyph]; + end_offset = this->loca->u.longsZ[glyph + 1]; + } + + if (start_offset > end_offset || end_offset > this->glyf_len) + return false; + + if (end_offset - start_offset < OT::glyfGlyphHeader::static_size) + return true; /* Empty glyph; zero extents. */ + + const OT::glyfGlyphHeader &glyph_header = OT::StructAtOffset (this->glyf, start_offset); + + extents->x_bearing = MIN (glyph_header.xMin, glyph_header.xMax); + extents->y_bearing = MAX (glyph_header.yMin, glyph_header.yMax); + extents->width = MAX (glyph_header.xMin, glyph_header.xMax) - extents->x_bearing; + extents->height = MIN (glyph_header.yMin, glyph_header.yMax) - extents->y_bearing; + + return true; + } +}; + +struct hb_ot_face_cmap_accelerator_t +{ + const OT::CmapSubtable *table; + const OT::CmapSubtable *uvs_table; + hb_blob_t *blob; + + inline void init (hb_face_t *face) + { + this->blob = OT::Sanitizer::sanitize (face->reference_table (HB_OT_TAG_cmap)); + const OT::cmap *cmap = OT::Sanitizer::lock_instance (this->blob); + const OT::CmapSubtable *subtable = NULL; + const OT::CmapSubtable *subtable_uvs = NULL; + + /* 32-bit subtables. */ + if (!subtable) subtable = cmap->find_subtable (3, 10); + if (!subtable) subtable = cmap->find_subtable (0, 6); + if (!subtable) subtable = cmap->find_subtable (0, 4); + /* 16-bit subtables. */ + if (!subtable) subtable = cmap->find_subtable (3, 1); + if (!subtable) subtable = cmap->find_subtable (0, 3); + if (!subtable) subtable = cmap->find_subtable (0, 2); + if (!subtable) subtable = cmap->find_subtable (0, 1); + if (!subtable) subtable = cmap->find_subtable (0, 0); + if (!subtable) subtable = cmap->find_subtable (3, 0); + /* Meh. */ + if (!subtable) subtable = &OT::Null(OT::CmapSubtable); + + /* UVS subtable. */ + if (!subtable_uvs) subtable_uvs = cmap->find_subtable (0, 5); + /* Meh. */ + if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtable); + + this->table = subtable; + this->uvs_table = subtable_uvs; + } + + inline void fini (void) + { + hb_blob_destroy (this->blob); + } + + inline bool get_glyph (hb_codepoint_t unicode, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) const + { + if (unlikely (variation_selector)) + { + switch (this->uvs_table->get_glyph_variant (unicode, + variation_selector, + glyph)) + { + case OT::GLYPH_VARIANT_NOT_FOUND: return false; + case OT::GLYPH_VARIANT_FOUND: return true; + case OT::GLYPH_VARIANT_USE_DEFAULT: break; + } + } + + return this->table->get_glyph (unicode, glyph); + } +}; + + +struct hb_ot_font_t +{ + hb_ot_face_cmap_accelerator_t cmap; + hb_ot_face_metrics_accelerator_t h_metrics; + hb_ot_face_metrics_accelerator_t v_metrics; + hb_ot_face_glyf_accelerator_t glyf; +}; + + +static hb_ot_font_t * +_hb_ot_font_create (hb_face_t *face) +{ + hb_ot_font_t *ot_font = (hb_ot_font_t *) calloc (1, sizeof (hb_ot_font_t)); + + if (unlikely (!ot_font)) + return NULL; + + unsigned int upem = face->get_upem (); + + ot_font->cmap.init (face); + ot_font->h_metrics.init (face, HB_OT_TAG_hhea, HB_OT_TAG_hmtx, upem>>1); + ot_font->v_metrics.init (face, HB_OT_TAG_vhea, HB_OT_TAG_vmtx, upem); /* TODO Can we do this lazily? */ + ot_font->glyf.init (face); + + return ot_font; +} + +static void +_hb_ot_font_destroy (hb_ot_font_t *ot_font) +{ + ot_font->cmap.fini (); + ot_font->h_metrics.fini (); + ot_font->v_metrics.fini (); + ot_font->glyf.fini (); + + free (ot_font); +} + + +static hb_bool_t +hb_ot_get_glyph (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t unicode, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph, + void *user_data HB_UNUSED) + +{ + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + return ot_font->cmap.get_glyph (unicode, variation_selector, glyph); +} + +static hb_position_t +hb_ot_get_glyph_h_advance (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + void *user_data HB_UNUSED) +{ + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + return font->em_scale_x (ot_font->h_metrics.get_advance (glyph)); +} + +static hb_position_t +hb_ot_get_glyph_v_advance (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + void *user_data HB_UNUSED) +{ + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + return font->em_scale_y (-(int) ot_font->v_metrics.get_advance (glyph)); +} + +static hb_bool_t +hb_ot_get_glyph_h_origin (hb_font_t *font HB_UNUSED, + void *font_data HB_UNUSED, + hb_codepoint_t glyph HB_UNUSED, + hb_position_t *x HB_UNUSED, + hb_position_t *y HB_UNUSED, + void *user_data HB_UNUSED) +{ + /* We always work in the horizontal coordinates. */ + return true; +} + +static hb_bool_t +hb_ot_get_glyph_v_origin (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + hb_position_t *x, + hb_position_t *y, + void *user_data HB_UNUSED) +{ + /* TODO */ + return false; +} + +static hb_position_t +hb_ot_get_glyph_h_kerning (hb_font_t *font, + void *font_data, + hb_codepoint_t left_glyph, + hb_codepoint_t right_glyph, + void *user_data HB_UNUSED) +{ + /* TODO */ + return 0; +} + +static hb_position_t +hb_ot_get_glyph_v_kerning (hb_font_t *font HB_UNUSED, + void *font_data HB_UNUSED, + hb_codepoint_t top_glyph HB_UNUSED, + hb_codepoint_t bottom_glyph HB_UNUSED, + void *user_data HB_UNUSED) +{ + /* OpenType doesn't have vertical-kerning other than GPOS. */ + return 0; +} + +static hb_bool_t +hb_ot_get_glyph_extents (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents, + void *user_data HB_UNUSED) +{ + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + bool ret = ot_font->glyf.get_extents (glyph, extents); + extents->x_bearing = font->em_scale_x (extents->x_bearing); + extents->y_bearing = font->em_scale_y (extents->y_bearing); + extents->width = font->em_scale_x (extents->width); + extents->height = font->em_scale_y (extents->height); + return ret; +} + +static hb_bool_t +hb_ot_get_glyph_contour_point (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + unsigned int point_index, + hb_position_t *x, + hb_position_t *y, + void *user_data HB_UNUSED) +{ + /* TODO */ + return false; +} + +static hb_bool_t +hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + char *name, unsigned int size, + void *user_data HB_UNUSED) +{ + /* TODO */ + return false; +} + +static hb_bool_t +hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED, + void *font_data, + const char *name, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph, + void *user_data HB_UNUSED) +{ + /* TODO */ + return false; +} + + +static hb_font_funcs_t * +_hb_ot_get_font_funcs (void) +{ + static const hb_font_funcs_t ot_ffuncs = { + HB_OBJECT_HEADER_STATIC, + + true, /* immutable */ + + { +#define HB_FONT_FUNC_IMPLEMENT(name) hb_ot_get_##name, + HB_FONT_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_FONT_FUNC_IMPLEMENT + } + }; + + return const_cast (&ot_ffuncs); +} + + +/** + * Since: 0.9.28 + **/ +void +hb_ot_font_set_funcs (hb_font_t *font) +{ + hb_ot_font_t *ot_font = _hb_ot_font_create (font->face); + if (unlikely (!ot_font)) + return; + + hb_font_set_funcs (font, + _hb_ot_get_font_funcs (), + ot_font, + (hb_destroy_func_t) _hb_ot_font_destroy); +} diff --git a/3rdparty/harfbuzz-1.0.6/hb-ot-font.h b/3rdparty/harfbuzz-1.0.6/hb-ot-font.h new file mode 100644 index 0000000000..b9947a16bc --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ot-font.h @@ -0,0 +1,45 @@ +/* + * Copyright © 2014 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod, Roozbeh Pournader + */ + +#ifndef HB_OT_H_IN +#error "Include instead." +#endif + +#ifndef HB_OT_FONT_H +#define HB_OT_FONT_H + +#include "hb.h" + +HB_BEGIN_DECLS + + +void +hb_ot_font_set_funcs (hb_font_t *font); + + +HB_END_DECLS + +#endif /* HB_OT_FONT_H */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-ot-glyf-table.hh b/3rdparty/harfbuzz-1.0.6/hb-ot-glyf-table.hh new file mode 100644 index 0000000000..9e5af6d10d --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ot-glyf-table.hh @@ -0,0 +1,104 @@ +/* + * Copyright © 2015 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_GLYF_TABLE_HH +#define HB_OT_GLYF_TABLE_HH + +#include "hb-open-type-private.hh" + + +namespace OT { + + +/* + * loca -- Index to Location + */ + +#define HB_OT_TAG_loca HB_TAG('l','o','c','a') + + +struct loca +{ + static const hb_tag_t tableTag = HB_OT_TAG_loca; + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (true); + } + + public: + union { + USHORT shortsZ[VAR]; /* Location offset divided by 2. */ + ULONG longsZ[VAR]; /* Location offset. */ + } u; + DEFINE_SIZE_ARRAY (0, u.longsZ); +}; + + +/* + * glyf -- TrueType Glyph Data + */ + +#define HB_OT_TAG_glyf HB_TAG('g','l','y','f') + + +struct glyf +{ + static const hb_tag_t tableTag = HB_OT_TAG_glyf; + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + /* We don't check for anything specific here. The users of the + * struct do all the hard work... */ + return_trace (true); + } + + public: + BYTE dataX[VAR]; /* Glyphs data. */ + + DEFINE_SIZE_ARRAY (0, dataX); +}; + +struct glyfGlyphHeader +{ + SHORT numberOfContours; /* If the number of contours is + * greater than or equal to zero, + * this is a simple glyph; if negative, + * this is a composite glyph. */ + SHORT xMin; /* Minimum x for coordinate data. */ + SHORT yMin; /* Minimum y for coordinate data. */ + SHORT xMax; /* Maximum x for coordinate data. */ + SHORT yMax; /* Maximum y for coordinate data. */ + + DEFINE_SIZE_STATIC (10); +}; + +} /* namespace OT */ + + +#endif /* HB_OT_GLYF_TABLE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-ot-head-table.hh b/3rdparty/harfbuzz-1.0.6/hb-ot-head-table.hh new file mode 100644 index 0000000000..fc351cfb48 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ot-head-table.hh @@ -0,0 +1,152 @@ +/* + * Copyright © 2010 Red Hat, Inc. + * Copyright © 2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_HEAD_TABLE_HH +#define HB_OT_HEAD_TABLE_HH + +#include "hb-open-type-private.hh" + + +namespace OT { + + +/* + * head -- Font Header + */ + +#define HB_OT_TAG_head HB_TAG('h','e','a','d') + +struct head +{ + static const hb_tag_t tableTag = HB_OT_TAG_head; + + inline unsigned int get_upem (void) const + { + unsigned int upem = unitsPerEm; + /* If no valid head table found, assume 1000, which matches typical Type1 usage. */ + return 16 <= upem && upem <= 16384 ? upem : 1000; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && likely (version.major == 1)); + } + + protected: + FixedVersion version; /* Version of the head table--currently + * 0x00010000u for version 1.0. */ + FixedVersion fontRevision; /* Set by font manufacturer. */ + ULONG checkSumAdjustment; /* To compute: set it to 0, sum the + * entire font as ULONG, then store + * 0xB1B0AFBAu - sum. */ + ULONG magicNumber; /* Set to 0x5F0F3CF5u. */ + USHORT flags; /* Bit 0: Baseline for font at y=0; + * Bit 1: Left sidebearing point at x=0; + * Bit 2: Instructions may depend on point size; + * Bit 3: Force ppem to integer values for all + * internal scaler math; may use fractional + * ppem sizes if this bit is clear; + * Bit 4: Instructions may alter advance width + * (the advance widths might not scale linearly); + + * Bits 5-10: These should be set according to + * Apple's specification. However, they are not + * implemented in OpenType. + * Bit 5: This bit should be set in fonts that are + * intended to e laid out vertically, and in + * which the glyphs have been drawn such that an + * x-coordinate of 0 corresponds to the desired + * vertical baseline. + * Bit 6: This bit must be set to zero. + * Bit 7: This bit should be set if the font + * requires layout for correct linguistic + * rendering (e.g. Arabic fonts). + * Bit 8: This bit should be set for a GX font + * which has one or more metamorphosis effects + * designated as happening by default. + * Bit 9: This bit should be set if the font + * contains any strong right-to-left glyphs. + * Bit 10: This bit should be set if the font + * contains Indic-style rearrangement effects. + + * Bit 11: Font data is 'lossless,' as a result + * of having been compressed and decompressed + * with the Agfa MicroType Express engine. + * Bit 12: Font converted (produce compatible metrics) + * Bit 13: Font optimized for ClearType™. + * Note, fonts that rely on embedded bitmaps (EBDT) + * for rendering should not be considered optimized + * for ClearType, and therefore should keep this bit + * cleared. + * Bit 14: Last Resort font. If set, indicates that + * the glyphs encoded in the cmap subtables are simply + * generic symbolic representations of code point + * ranges and don’t truly represent support for those + * code points. If unset, indicates that the glyphs + * encoded in the cmap subtables represent proper + * support for those code points. + * Bit 15: Reserved, set to 0. */ + USHORT unitsPerEm; /* Valid range is from 16 to 16384. This value + * should be a power of 2 for fonts that have + * TrueType outlines. */ + LONGDATETIME created; /* Number of seconds since 12:00 midnight, + January 1, 1904. 64-bit integer */ + LONGDATETIME modified; /* Number of seconds since 12:00 midnight, + January 1, 1904. 64-bit integer */ + SHORT xMin; /* For all glyph bounding boxes. */ + SHORT yMin; /* For all glyph bounding boxes. */ + SHORT xMax; /* For all glyph bounding boxes. */ + SHORT yMax; /* For all glyph bounding boxes. */ + USHORT macStyle; /* Bit 0: Bold (if set to 1); + * Bit 1: Italic (if set to 1) + * Bit 2: Underline (if set to 1) + * Bit 3: Outline (if set to 1) + * Bit 4: Shadow (if set to 1) + * Bit 5: Condensed (if set to 1) + * Bit 6: Extended (if set to 1) + * Bits 7-15: Reserved (set to 0). */ + USHORT lowestRecPPEM; /* Smallest readable size in pixels. */ + SHORT fontDirectionHint; /* Deprecated (Set to 2). + * 0: Fully mixed directional glyphs; + * 1: Only strongly left to right; + * 2: Like 1 but also contains neutrals; + * -1: Only strongly right to left; + * -2: Like -1 but also contains neutrals. */ + public: + SHORT indexToLocFormat; /* 0 for short offsets, 1 for long. */ + SHORT glyphDataFormat; /* 0 for current format. */ + + DEFINE_SIZE_STATIC (54); +}; + + +} /* namespace OT */ + + +#endif /* HB_OT_HEAD_TABLE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-ot-hhea-table.hh b/3rdparty/harfbuzz-1.0.6/hb-ot-hhea-table.hh new file mode 100644 index 0000000000..24114534a7 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ot-hhea-table.hh @@ -0,0 +1,103 @@ +/* + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_HHEA_TABLE_HH +#define HB_OT_HHEA_TABLE_HH + +#include "hb-open-type-private.hh" + + +namespace OT { + + +/* + * hhea -- The Horizontal Header Table + * vhea -- The Vertical Header Table + */ + +#define HB_OT_TAG_hhea HB_TAG('h','h','e','a') +#define HB_OT_TAG_vhea HB_TAG('v','h','e','a') + + +struct _hea +{ + static const hb_tag_t tableTag = HB_TAG('_','h','e','a'); + + static const hb_tag_t hheaTag = HB_OT_TAG_hhea; + static const hb_tag_t vheaTag = HB_OT_TAG_vhea; + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && likely (version.major == 1)); + } + + public: + FixedVersion version; /* 0x00010000u for version 1.0. */ + FWORD ascender; /* Typographic ascent. */ + FWORD descender; /* Typographic descent. */ + FWORD lineGap; /* Typographic line gap. */ + UFWORD advanceMax; /* Maximum advance width/height value in + * metrics table. */ + FWORD minLeadingBearing; /* Minimum left/top sidebearing value in + * metrics table. */ + FWORD minTrailingBearing; /* Minimum right/bottom sidebearing value; + * calculated as Min(aw - lsb - + * (xMax - xMin)) for horizontal. */ + FWORD maxExtent; /* horizontal: Max(lsb + (xMax - xMin)), + * vertical: minLeadingBearing+(yMax-yMin). */ + SHORT caretSlopeRise; /* Used to calculate the slope of the + * cursor (rise/run); 1 for vertical caret, + * 0 for horizontal.*/ + SHORT caretSlopeRun; /* 0 for vertical caret, 1 for horizontal. */ + SHORT caretOffset; /* The amount by which a slanted + * highlight on a glyph needs + * to be shifted to produce the + * best appearance. Set to 0 for + * non-slanted fonts. */ + SHORT reserved1; /* Set to 0. */ + SHORT reserved2; /* Set to 0. */ + SHORT reserved3; /* Set to 0. */ + SHORT reserved4; /* Set to 0. */ + SHORT metricDataFormat; /* 0 for current format. */ + USHORT numberOfLongMetrics; /* Number of LongMetric entries in metric + * table. */ + public: + DEFINE_SIZE_STATIC (36); +}; + +struct hhea : _hea { + static const hb_tag_t tableTag = HB_OT_TAG_hhea; +}; +struct vhea : _hea { + static const hb_tag_t tableTag = HB_OT_TAG_vhea; +}; + + +} /* namespace OT */ + + +#endif /* HB_OT_HHEA_TABLE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-ot-hmtx-table.hh b/3rdparty/harfbuzz-1.0.6/hb-ot-hmtx-table.hh new file mode 100644 index 0000000000..49056e6769 --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ot-hmtx-table.hh @@ -0,0 +1,104 @@ +/* + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_HMTX_TABLE_HH +#define HB_OT_HMTX_TABLE_HH + +#include "hb-open-type-private.hh" + + +namespace OT { + + +/* + * hmtx -- The Horizontal Metrics Table + * vmtx -- The Vertical Metrics Table + */ + +#define HB_OT_TAG_hmtx HB_TAG('h','m','t','x') +#define HB_OT_TAG_vmtx HB_TAG('v','m','t','x') + + +struct LongMetric +{ + USHORT advance; /* Advance width/height. */ + SHORT lsb; /* Leading (left/top) side bearing. */ + public: + DEFINE_SIZE_STATIC (4); +}; + +struct _mtx +{ + static const hb_tag_t tableTag = HB_TAG('_','m','t','x'); + + static const hb_tag_t hmtxTag = HB_OT_TAG_hmtx; + static const hb_tag_t vmtxTag = HB_OT_TAG_vmtx; + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + /* We don't check for anything specific here. The users of the + * struct do all the hard work... */ + return_trace (true); + } + + public: + LongMetric longMetric[VAR]; /* Paired advance width and leading + * bearing values for each glyph. The + * value numOfHMetrics comes from + * the 'hhea' table. If the font is + * monospaced, only one entry need + * be in the array, but that entry is + * required. The last entry applies to + * all subsequent glyphs. */ + SHORT leadingBearingX[VAR]; /* Here the advance is assumed + * to be the same as the advance + * for the last entry above. The + * number of entries in this array is + * derived from numGlyphs (from 'maxp' + * table) minus numberOfLongMetrics. + * This generally is used with a run + * of monospaced glyphs (e.g., Kanji + * fonts or Courier fonts). Only one + * run is allowed and it must be at + * the end. This allows a monospaced + * font to vary the side bearing + * values for each glyph. */ + public: + DEFINE_SIZE_ARRAY2 (0, longMetric, leadingBearingX); +}; + +struct hmtx : _mtx { + static const hb_tag_t tableTag = HB_OT_TAG_hmtx; +}; +struct vmtx : _mtx { + static const hb_tag_t tableTag = HB_OT_TAG_vmtx; +}; + +} /* namespace OT */ + + +#endif /* HB_OT_HMTX_TABLE_HH */ diff --git a/3rdparty/harfbuzz-1.0.6/hb-ot-layout-common-private.hh b/3rdparty/harfbuzz-1.0.6/hb-ot-layout-common-private.hh new file mode 100644 index 0000000000..ea61f5c1bd --- /dev/null +++ b/3rdparty/harfbuzz-1.0.6/hb-ot-layout-common-private.hh @@ -0,0 +1,1224 @@ +/* + * Copyright © 2007,2008,2009 Red Hat, Inc. + * Copyright © 2010,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_LAYOUT_COMMON_PRIVATE_HH +#define HB_OT_LAYOUT_COMMON_PRIVATE_HH + +#include "hb-ot-layout-private.hh" +#include "hb-open-type-private.hh" +#include "hb-set-private.hh" + + +namespace OT { + + +#define TRACE_DISPATCH(this, format) \ + hb_auto_trace_t trace \ + (&c->debug_depth, c->get_name (), this, HB_FUNC, \ + "format %d", (int) format); + + +#define NOT_COVERED ((unsigned int) -1) +#define MAX_NESTING_LEVEL 6 +#define MAX_CONTEXT_LENGTH 64 + + + +/* + * + * OpenType Layout Common Table Formats + * + */ + + +/* + * Script, ScriptList, LangSys, Feature, FeatureList, Lookup, LookupList + */ + +template +struct Record +{ + inline int cmp (hb_tag_t a) const { + return tag.cmp (a); + } + + struct sanitize_closure_t { + hb_tag_t tag; + const void *list_base; + }; + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + const sanitize_closure_t closure = {tag, base}; + return_trace (c->check_struct (this) && offset.sanitize (c, base, &closure)); + } + + Tag tag; /* 4-byte Tag identifier */ + OffsetTo + offset; /* Offset from beginning of object holding + * the Record */ + public: + DEFINE_SIZE_STATIC (6); +}; + +template +struct RecordArrayOf : SortedArrayOf > { + inline const Tag& get_tag (unsigned int i) const + { + /* We cheat slightly and don't define separate Null objects + * for Record types. Instead, we return the correct Null(Tag) + * here. */ + if (unlikely (i >= this->len)) return Null(Tag); + return (*this)[i].tag; + } + inline unsigned int get_tags (unsigned int start_offset, + unsigned int *record_count /* IN/OUT */, + hb_tag_t *record_tags /* OUT */) const + { + if (record_count) { + const Record *arr = this->sub_array (start_offset, record_count); + unsigned int count = *record_count; + for (unsigned int i = 0; i < count; i++) + record_tags[i] = arr[i].tag; + } + return this->len; + } + inline bool find_index (hb_tag_t tag, unsigned int *index) const + { + /* If we want to allow non-sorted data, we can lsearch(). */ + int i = this->/*lsearch*/bsearch (tag); + if (i != -1) { + if (index) *index = i; + return true; + } else { + if (index) *index = Index::NOT_FOUND_INDEX; + return false; + } + } +}; + +template +struct RecordListOf : RecordArrayOf +{ + inline const Type& operator [] (unsigned int i) const + { return this+RecordArrayOf::operator [](i).offset; } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (RecordArrayOf::sanitize (c, this)); + } +}; + + +struct RangeRecord +{ + inline int cmp (hb_codepoint_t g) const { + return g < start ? -1 : g <= end ? 0 : +1 ; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + inline bool intersects (const hb_set_t *glyphs) const { + return glyphs->intersects (start, end); + } + + template + inline void add_coverage (set_t *glyphs) const { + glyphs->add_range (start, end); + } + + GlyphID start; /* First GlyphID in the range */ + GlyphID end; /* Last GlyphID in the range */ + USHORT value; /* Value */ + public: + DEFINE_SIZE_STATIC (6); +}; +DEFINE_NULL_DATA (RangeRecord, "\000\001"); + + +struct IndexArray : ArrayOf +{ + inline unsigned int get_indexes (unsigned int start_offset, + unsigned int *_count /* IN/OUT */, + unsigned int *_indexes /* OUT */) const + { + if (_count) { + const USHORT *arr = this->sub_array (start_offset, _count); + unsigned int count = *_count; + for (unsigned int i = 0; i < count; i++) + _indexes[i] = arr[i]; + } + return this->len; + } +}; + + +struct Script; +struct LangSys; +struct Feature; + + +struct LangSys +{ + inline unsigned int get_feature_count (void) const + { return featureIndex.len; } + inline hb_tag_t get_feature_index (unsigned int i) const + { return featureIndex[i]; } + inline unsigned int get_feature_indexes (unsigned int start_offset, + unsigned int *feature_count /* IN/OUT */, + unsigned int *feature_indexes /* OUT */) const + { return featureIndex.get_indexes (start_offset, feature_count, feature_indexes); } + + inline bool has_required_feature (void) const { return reqFeatureIndex != 0xFFFFu; } + inline unsigned int get_required_feature_index (void) const + { + if (reqFeatureIndex == 0xFFFFu) + return Index::NOT_FOUND_INDEX; + return reqFeatureIndex;; + } + + inline bool sanitize (hb_sanitize_context_t *c, + const Record::sanitize_closure_t * = NULL) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && featureIndex.sanitize (c)); + } + + Offset<> lookupOrderZ; /* = Null (reserved for an offset to a + * reordering table) */ + USHORT reqFeatureIndex;/* Index of a feature required for this + * language system--if no required features + * = 0xFFFFu */ + IndexArray featureIndex; /* Array of indices into the FeatureList */ + public: + DEFINE_SIZE_ARRAY (6, featureIndex); +}; +DEFINE_NULL_DATA (LangSys, "\0\0\xFF\xFF"); + + +struct Script +{ + inline unsigned int get_lang_sys_count (void) const + { return langSys.len; } + inline const Tag& get_lang_sys_tag (unsigned int i) const + { return langSys.get_tag (i); } + inline unsigned int get_lang_sys_tags (unsigned int start_offset, + unsigned int *lang_sys_count /* IN/OUT */, + hb_tag_t *lang_sys_tags /* OUT */) const + { return langSys.get_tags (start_offset, lang_sys_count, lang_sys_tags); } + inline const LangSys& get_lang_sys (unsigned int i) const + { + if (i == Index::NOT_FOUND_INDEX) return get_default_lang_sys (); + return this+langSys[i].offset; + } + inline bool find_lang_sys_index (hb_tag_t tag, unsigned int *index) const + { return langSys.find_index (tag, index); } + + inline bool has_default_lang_sys (void) const { return defaultLangSys != 0; } + inline const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; } + + inline bool sanitize (hb_sanitize_context_t *c, + const Record + + +

SDL NACL Test

+

Status: NO-STATUS

+ +
+ + diff --git a/3rdparty/sdl2-2.0.4/test/nacl/manifest.json b/3rdparty/sdl2-2.0.4/test/nacl/manifest.json new file mode 100644 index 0000000000..df6772b4c4 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/nacl/manifest.json @@ -0,0 +1,22 @@ +{ + "name": "SDL testgles2", + "version": "33.0.1750.117", + "minimum_chrome_version": "33.0.1750.117", + "manifest_version": 2, + "description": "testgles2", + "offline_enabled": true, + "icons": { + "128": "icon128.png" + }, + "app": { + "background": { + "scripts": ["background.js"] + } + }, + "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMN716Qyu0l2EHNFqIJVqVysFcTR6urqhaGGqW4UK7slBaURz9+Sb1b4Ot5P1uQNE5c+CTU5Vu61wpqmSqMMxqHLWdPPMh8uRlyctsb2cxWwG6XoGSvpX29NsQVUFXd4v2tkJm3G9t+V0X8TYskrvWQmnyOW8OEIDvrBhUEfFxWQIDAQAB", + "oauth2": { + "client_id": "903965034255.apps.googleusercontent.com", + "scopes": ["https://www.googleapis.com/auth/drive"] + }, + "permissions": [] +} diff --git a/3rdparty/sdl2-2.0.0/test/picture.xbm b/3rdparty/sdl2-2.0.4/test/picture.xbm similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/picture.xbm rename to 3rdparty/sdl2-2.0.4/test/picture.xbm diff --git a/3rdparty/sdl2-2.0.0/test/relative_mode.markdown b/3rdparty/sdl2-2.0.4/test/relative_mode.markdown similarity index 90% rename from 3rdparty/sdl2-2.0.0/test/relative_mode.markdown rename to 3rdparty/sdl2-2.0.4/test/relative_mode.markdown index 9ae88aa1c0..5b2ed61850 100644 --- a/3rdparty/sdl2-2.0.0/test/relative_mode.markdown +++ b/3rdparty/sdl2-2.0.4/test/relative_mode.markdown @@ -37,9 +37,11 @@ Code int main(int argc, char *argv[]) { + SDL_Window *win; + SDL_Init(SDL_INIT_VIDEO); - SDL_Window *win = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, 0); + win = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, 0); SDL_SetRelativeMouseMode(SDL_TRUE); while (1) diff --git a/3rdparty/sdl2-2.0.0/test/sample.bmp b/3rdparty/sdl2-2.0.4/test/sample.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/sample.bmp rename to 3rdparty/sdl2-2.0.4/test/sample.bmp diff --git a/3rdparty/sdl2-2.0.0/test/sample.wav b/3rdparty/sdl2-2.0.4/test/sample.wav similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/sample.wav rename to 3rdparty/sdl2-2.0.4/test/sample.wav diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p01_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p01_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p01_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p01_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p01_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p01_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p01_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p01_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p01_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p01_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p01_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p01_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p02_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p02_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p02_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p02_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p02_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p02_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p02_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p02_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p02_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p02_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p02_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p02_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p03_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p03_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p03_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p03_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p03_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p03_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p03_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p03_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p04_shape1.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p04_shape1.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p04_shape1.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p04_shape1.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p04_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p04_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p04_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p04_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p04_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p04_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p04_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p04_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p04_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p04_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p04_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p04_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p05_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p05_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p05_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p05_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p06_shape1alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p06_shape1alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p06_shape1alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p06_shape1alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p06_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p06_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p06_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p06_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p06_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p06_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p06_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p06_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p06_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p06_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p06_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p06_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p07_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p07_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p07_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p07_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p07_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p07_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p07_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p07_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p07_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p07_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p07_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p07_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p08_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p08_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p08_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p08_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p08_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p08_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p08_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p08_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p08_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p08_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p08_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p08_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p09_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p09_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p09_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p09_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p09_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p09_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p09_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p09_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p09_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p09_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p09_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p09_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p10_shape1.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p10_shape1.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p10_shape1.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p10_shape1.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p10_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p10_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p10_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p10_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p10_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p10_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p10_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p10_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p10_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p10_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p10_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p10_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p11_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p11_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p11_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p11_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p11_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p11_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p11_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p11_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p11_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p11_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p11_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p11_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p12_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p12_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p12_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p12_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p12_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p12_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p12_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p12_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p13_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p13_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p13_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p13_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p13_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p13_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p13_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p13_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p13_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p13_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p13_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p13_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p14_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p14_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p14_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p14_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p14_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p14_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p14_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p14_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p15_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p15_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p15_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p15_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p15_shape32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p15_shape32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p15_shape32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p15_shape32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p15_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p15_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p15_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p15_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p16_shape1.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p16_shape1.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p16_shape1.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p16_shape1.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p16_shape24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p16_shape24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p16_shape24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p16_shape24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/p16_shape8.bmp b/3rdparty/sdl2-2.0.4/test/shapes/p16_shape8.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/p16_shape8.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/p16_shape8.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/trollface_24.bmp b/3rdparty/sdl2-2.0.4/test/shapes/trollface_24.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/trollface_24.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/trollface_24.bmp diff --git a/3rdparty/sdl2-2.0.0/test/shapes/trollface_32alpha.bmp b/3rdparty/sdl2-2.0.4/test/shapes/trollface_32alpha.bmp similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/shapes/trollface_32alpha.bmp rename to 3rdparty/sdl2-2.0.4/test/shapes/trollface_32alpha.bmp diff --git a/3rdparty/sdl2-2.0.0/test/testatomic.c b/3rdparty/sdl2-2.0.4/test/testatomic.c similarity index 82% rename from 3rdparty/sdl2-2.0.0/test/testatomic.c rename to 3rdparty/sdl2-2.0.4/test/testatomic.c index be60a611be..41cc9ab1b3 100644 --- a/3rdparty/sdl2-2.0.0/test/testatomic.c +++ b/3rdparty/sdl2-2.0.4/test/testatomic.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -12,9 +12,6 @@ #include #include "SDL.h" -#include "SDL_atomic.h" -#include "SDL_assert.h" -#include "SDL_cpuinfo.h" /* Absolutely basic tests just to see if we get the expected value @@ -45,39 +42,39 @@ void RunBasicTest() SDL_atomic_t v; SDL_bool tfret = SDL_FALSE; - printf("\nspin lock---------------------------------------\n\n"); + SDL_Log("\nspin lock---------------------------------------\n\n"); SDL_AtomicLock(&lock); - printf("AtomicLock lock=%d\n", lock); + SDL_Log("AtomicLock lock=%d\n", lock); SDL_AtomicUnlock(&lock); - printf("AtomicUnlock lock=%d\n", lock); + SDL_Log("AtomicUnlock lock=%d\n", lock); - printf("\natomic -----------------------------------------\n\n"); + SDL_Log("\natomic -----------------------------------------\n\n"); SDL_AtomicSet(&v, 0); - tfret = SDL_AtomicSet(&v, 10) == 0; - printf("AtomicSet(10) tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); - tfret = SDL_AtomicAdd(&v, 10) == 10; - printf("AtomicAdd(10) tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); + tfret = SDL_AtomicSet(&v, 10) == 0 ? SDL_TRUE : SDL_FALSE; + SDL_Log("AtomicSet(10) tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); + tfret = SDL_AtomicAdd(&v, 10) == 10 ? SDL_TRUE : SDL_FALSE; + SDL_Log("AtomicAdd(10) tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); SDL_AtomicSet(&v, 0); SDL_AtomicIncRef(&v); - tfret = (SDL_AtomicGet(&v) == 1); - printf("AtomicIncRef() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); + tfret = (SDL_AtomicGet(&v) == 1) ? SDL_TRUE : SDL_FALSE; + SDL_Log("AtomicIncRef() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); SDL_AtomicIncRef(&v); - tfret = (SDL_AtomicGet(&v) == 2); - printf("AtomicIncRef() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); - tfret = (SDL_AtomicDecRef(&v) == SDL_FALSE); - printf("AtomicDecRef() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); - tfret = (SDL_AtomicDecRef(&v) == SDL_TRUE); - printf("AtomicDecRef() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); + tfret = (SDL_AtomicGet(&v) == 2) ? SDL_TRUE : SDL_FALSE; + SDL_Log("AtomicIncRef() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); + tfret = (SDL_AtomicDecRef(&v) == SDL_FALSE) ? SDL_TRUE : SDL_FALSE; + SDL_Log("AtomicDecRef() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); + tfret = (SDL_AtomicDecRef(&v) == SDL_TRUE) ? SDL_TRUE : SDL_FALSE; + SDL_Log("AtomicDecRef() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); SDL_AtomicSet(&v, 10); - tfret = (SDL_AtomicCAS(&v, 0, 20) == SDL_FALSE); - printf("AtomicCAS() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); + tfret = (SDL_AtomicCAS(&v, 0, 20) == SDL_FALSE) ? SDL_TRUE : SDL_FALSE; + SDL_Log("AtomicCAS() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); value = SDL_AtomicGet(&v); - tfret = (SDL_AtomicCAS(&v, value, 20) == SDL_TRUE); - printf("AtomicCAS() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); + tfret = (SDL_AtomicCAS(&v, value, 20) == SDL_TRUE) ? SDL_TRUE : SDL_FALSE; + SDL_Log("AtomicCAS() tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); } /**************************************************************************/ @@ -120,7 +117,7 @@ static int adder(void* junk) { unsigned long N=NInter; - printf("Thread subtracting %d %lu times\n",CountInc,N); + SDL_Log("Thread subtracting %d %lu times\n",CountInc,N); while (N--) { SDL_AtomicAdd(&good, -CountInc); bad-=CountInc; @@ -152,7 +149,7 @@ void runAdder(void) end = SDL_GetTicks(); - printf("Finished in %f sec\n", (end - start) / 1000.f); + SDL_Log("Finished in %f sec\n", (end - start) / 1000.f); } static @@ -161,28 +158,28 @@ void RunEpicTest() int b; atomicValue v; - printf("\nepic test---------------------------------------\n\n"); + SDL_Log("\nepic test---------------------------------------\n\n"); - printf("Size asserted to be >= 32-bit\n"); + SDL_Log("Size asserted to be >= 32-bit\n"); SDL_assert(sizeof(atomicValue)>=4); - printf("Check static initializer\n"); + SDL_Log("Check static initializer\n"); v=SDL_AtomicGet(&good); SDL_assert(v==42); SDL_assert(bad==42); - printf("Test negative values\n"); + SDL_Log("Test negative values\n"); SDL_AtomicSet(&good, -5); v=SDL_AtomicGet(&good); SDL_assert(v==-5); - printf("Verify maximum value\n"); + SDL_Log("Verify maximum value\n"); SDL_AtomicSet(&good, CountTo); v=SDL_AtomicGet(&good); SDL_assert(v==CountTo); - printf("Test compare and exchange\n"); + SDL_Log("Test compare and exchange\n"); b=SDL_AtomicCAS(&good, 500, 43); SDL_assert(!b); /* no swap since CountTo!=500 */ @@ -194,7 +191,7 @@ void RunEpicTest() v=SDL_AtomicGet(&good); SDL_assert(v==44); - printf("Test Add\n"); + SDL_Log("Test Add\n"); v=SDL_AtomicAdd(&good, 1); SDL_assert(v==44); @@ -206,7 +203,7 @@ void RunEpicTest() v=SDL_AtomicGet(&good); SDL_assert(v==55); - printf("Test Add (Negative values)\n"); + SDL_Log("Test Add (Negative values)\n"); v=SDL_AtomicAdd(&good, -20); SDL_assert(v==55); @@ -223,7 +220,7 @@ void RunEpicTest() v=SDL_AtomicGet(&good); SDL_assert(v==15); - printf("Reset before count down test\n"); + SDL_Log("Reset before count down test\n"); SDL_AtomicSet(&good, CountTo); v=SDL_AtomicGet(&good); SDL_assert(v==CountTo); @@ -231,11 +228,11 @@ void RunEpicTest() bad=CountTo; SDL_assert(bad==CountTo); - printf("Counting down from %d, Expect %d remaining\n",CountTo,Expect); + SDL_Log("Counting down from %d, Expect %d remaining\n",CountTo,Expect); runAdder(); v=SDL_AtomicGet(&good); - printf("Atomic %d Non-Atomic %d\n",v,bad); + SDL_Log("Atomic %d Non-Atomic %d\n",v,bad); SDL_assert(v==Expect); SDL_assert(bad!=Expect); } @@ -306,6 +303,7 @@ static void InitEventQueue(SDL_EventQueue *queue) #ifdef TEST_SPINLOCK_FIFO queue->lock = 0; SDL_AtomicSet(&queue->rwcount, 0); + SDL_AtomicSet(&queue->watcher, 0); #endif queue->active = SDL_TRUE; } @@ -429,7 +427,7 @@ static SDL_bool EnqueueEvent_Mutex(SDL_EventQueue *queue, const SDL_Event *event } else if (delta < 0) { /* We ran into an old queue entry, which means it still needs to be dequeued */ } else { - printf("ERROR: mutex failed!\n"); + SDL_Log("ERROR: mutex failed!\n"); } SDL_UnlockMutex(queue->mutex); @@ -462,7 +460,7 @@ static SDL_bool DequeueEvent_Mutex(SDL_EventQueue *queue, SDL_Event *event) } else if (delta < 0) { /* We ran into an old queue entry, which means we've hit empty */ } else { - printf("ERROR: mutex failed!\n"); + SDL_Log("ERROR: mutex failed!\n"); } SDL_UnlockMutex(queue->mutex); @@ -598,9 +596,11 @@ static void RunFIFOTest(SDL_bool lock_free) Uint32 start, end; int i, j; int grand_total; + char textBuffer[1024]; + int len; - printf("\nFIFO test---------------------------------------\n\n"); - printf("Mode: %s\n", lock_free ? "LockFree" : "Mutex"); + SDL_Log("\nFIFO test---------------------------------------\n\n"); + SDL_Log("Mode: %s\n", lock_free ? "LockFree" : "Mutex"); readersDone = SDL_CreateSemaphore(0); writersDone = SDL_CreateSemaphore(0); @@ -622,7 +622,7 @@ static void RunFIFOTest(SDL_bool lock_free) #endif /* Start the readers first */ - printf("Starting %d readers\n", NUM_READERS); + SDL_Log("Starting %d readers\n", NUM_READERS); SDL_zero(readerData); SDL_AtomicSet(&readersRunning, NUM_READERS); for (i = 0; i < NUM_READERS; ++i) { @@ -634,7 +634,7 @@ static void RunFIFOTest(SDL_bool lock_free) } /* Start up the writers */ - printf("Starting %d writers\n", NUM_WRITERS); + SDL_Log("Starting %d writers\n", NUM_WRITERS); SDL_zero(writerData); SDL_AtomicSet(&writersRunning, NUM_WRITERS); for (i = 0; i < NUM_WRITERS; ++i) { @@ -668,16 +668,16 @@ static void RunFIFOTest(SDL_bool lock_free) SDL_DestroyMutex(queue.mutex); } - printf("Finished in %f sec\n", (end - start) / 1000.f); + SDL_Log("Finished in %f sec\n", (end - start) / 1000.f); - printf("\n"); + SDL_Log("\n"); for (i = 0; i < NUM_WRITERS; ++i) { - printf("Writer %d wrote %d events, had %d waits\n", i, EVENTS_PER_WRITER, writerData[i].waits); + SDL_Log("Writer %d wrote %d events, had %d waits\n", i, EVENTS_PER_WRITER, writerData[i].waits); } - printf("Writers wrote %d total events\n", NUM_WRITERS*EVENTS_PER_WRITER); + SDL_Log("Writers wrote %d total events\n", NUM_WRITERS*EVENTS_PER_WRITER); /* Print a breakdown of which readers read messages from which writer */ - printf("\n"); + SDL_Log("\n"); grand_total = 0; for (i = 0; i < NUM_READERS; ++i) { int total = 0; @@ -685,17 +685,21 @@ static void RunFIFOTest(SDL_bool lock_free) total += readerData[i].counters[j]; } grand_total += total; - printf("Reader %d read %d events, had %d waits\n", i, total, readerData[i].waits); - printf(" { "); + SDL_Log("Reader %d read %d events, had %d waits\n", i, total, readerData[i].waits); + SDL_snprintf(textBuffer, sizeof(textBuffer), " { "); for (j = 0; j < NUM_WRITERS; ++j) { if (j > 0) { - printf(", "); + len = SDL_strlen(textBuffer); + SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, ", "); } - printf("%d", readerData[i].counters[j]); + len = SDL_strlen(textBuffer); + SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, "%d", readerData[i].counters[j]); } - printf(" }\n"); + len = SDL_strlen(textBuffer); + SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, " }\n"); + SDL_Log("%s", textBuffer); } - printf("Readers read %d total events\n", grand_total); + SDL_Log("Readers read %d total events\n", grand_total); } /* End FIFO test */ @@ -704,6 +708,9 @@ static void RunFIFOTest(SDL_bool lock_free) int main(int argc, char *argv[]) { + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + RunBasicTest(); RunEpicTest(); /* This test is really slow, so don't run it by default */ diff --git a/3rdparty/sdl2-2.0.4/test/testaudiohotplug.c b/3rdparty/sdl2-2.0.4/test/testaudiohotplug.c new file mode 100644 index 0000000000..e13868ec2e --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testaudiohotplug.c @@ -0,0 +1,183 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Program to test hotplugging of audio devices */ + +#include "SDL_config.h" + +#include +#include + +#if HAVE_SIGNAL_H +#include +#endif + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "SDL.h" + +static SDL_AudioSpec spec; +static Uint8 *sound = NULL; /* Pointer to wave data */ +static Uint32 soundlen = 0; /* Length of wave data */ + +static int posindex = 0; +static Uint32 positions[64]; + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDL_Quit(); + exit(rc); +} + +void SDLCALL +fillerup(void *_pos, Uint8 * stream, int len) +{ + Uint32 pos = *((Uint32 *) _pos); + Uint8 *waveptr; + int waveleft; + + /* Set up the pointers */ + waveptr = sound + pos; + waveleft = soundlen - pos; + + /* Go! */ + while (waveleft <= len) { + SDL_memcpy(stream, waveptr, waveleft); + stream += waveleft; + len -= waveleft; + waveptr = sound; + waveleft = soundlen; + pos = 0; + } + SDL_memcpy(stream, waveptr, len); + pos += len; + *((Uint32 *) _pos) = pos; +} + +static int done = 0; +void +poked(int sig) +{ + done = 1; +} + +static void +iteration() +{ + SDL_Event e; + SDL_AudioDeviceID dev; + while (SDL_PollEvent(&e)) { + if (e.type == SDL_QUIT) { + done = 1; + } else if (e.type == SDL_AUDIODEVICEADDED) { + const char *name = SDL_GetAudioDeviceName(e.adevice.which, 0); + SDL_Log("New %s audio device: %s\n", e.adevice.iscapture ? "capture" : "output", name); + if (!e.adevice.iscapture) { + positions[posindex] = 0; + spec.userdata = &positions[posindex++]; + spec.callback = fillerup; + dev = SDL_OpenAudioDevice(name, 0, &spec, NULL, 0); + if (!dev) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open '%s': %s\n", name, SDL_GetError()); + } else { + SDL_Log("Opened '%s' as %u\n", name, (unsigned int) dev); + SDL_PauseAudioDevice(dev, 0); + } + } + } else if (e.type == SDL_AUDIODEVICEREMOVED) { + dev = (SDL_AudioDeviceID) e.adevice.which; + SDL_Log("%s device %u removed.\n", e.adevice.iscapture ? "capture" : "output", (unsigned int) dev); + SDL_CloseAudioDevice(dev); + } + } +} + +#ifdef __EMSCRIPTEN__ +void +loop() +{ + if(done) + emscripten_cancel_main_loop(); + else + iteration(); +} +#endif + +int +main(int argc, char *argv[]) +{ + int i; + char filename[4096]; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return (1); + } + + /* Some targets (Mac CoreAudio) need an event queue for audio hotplug, so make and immediately hide a window. */ + SDL_MinimizeWindow(SDL_CreateWindow("testaudiohotplug", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0)); + + if (argc > 1) { + SDL_strlcpy(filename, argv[1], sizeof(filename)); + } else { + SDL_strlcpy(filename, "sample.wav", sizeof(filename)); + } + /* Load the wave file into memory */ + if (SDL_LoadWAV(filename, &spec, &sound, &soundlen) == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", filename, SDL_GetError()); + quit(1); + } + +#if HAVE_SIGNAL_H + /* Set the signals */ +#ifdef SIGHUP + signal(SIGHUP, poked); +#endif + signal(SIGINT, poked); +#ifdef SIGQUIT + signal(SIGQUIT, poked); +#endif + signal(SIGTERM, poked); +#endif /* HAVE_SIGNAL_H */ + + /* Show the list of available drivers */ + SDL_Log("Available audio drivers:"); + for (i = 0; i < SDL_GetNumAudioDrivers(); ++i) { + SDL_Log("%i: %s", i, SDL_GetAudioDriver(i)); + } + + SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver()); + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + SDL_Delay(100); + iteration(); + } +#endif + + /* Clean up on signal */ + SDL_FreeWAV(sound); + SDL_Quit(); + return (0); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/3rdparty/sdl2-2.0.4/test/testaudioinfo.c b/3rdparty/sdl2-2.0.4/test/testaudioinfo.c new file mode 100644 index 0000000000..53bf0f5e2f --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testaudioinfo.c @@ -0,0 +1,70 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +#include +#include "SDL.h" + +static void +print_devices(int iscapture) +{ + const char *typestr = ((iscapture) ? "capture" : "output"); + int n = SDL_GetNumAudioDevices(iscapture); + + SDL_Log("%s devices:\n", typestr); + + if (n == -1) + SDL_Log(" Driver can't detect specific %s devices.\n\n", typestr); + else if (n == 0) + SDL_Log(" No %s devices found.\n\n", typestr); + else { + int i; + for (i = 0; i < n; i++) { + SDL_Log(" %s\n", SDL_GetAudioDeviceName(i, iscapture)); + } + SDL_Log("\n"); + } +} + +int +main(int argc, char **argv) +{ + int n; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(SDL_INIT_AUDIO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return (1); + } + + /* Print available audio drivers */ + n = SDL_GetNumAudioDrivers(); + if (n == 0) { + SDL_Log("No built-in audio drivers\n\n"); + } else { + int i; + SDL_Log("Built-in audio drivers:\n"); + for (i = 0; i < n; ++i) { + SDL_Log(" %s\n", SDL_GetAudioDriver(i)); + } + SDL_Log("\n"); + } + + SDL_Log("Using audio driver: %s\n\n", SDL_GetCurrentAudioDriver()); + + print_devices(0); + print_devices(1); + + SDL_Quit(); + return 0; +} diff --git a/3rdparty/sdl2-2.0.0/test/testautomation.c b/3rdparty/sdl2-2.0.4/test/testautomation.c similarity index 89% rename from 3rdparty/sdl2-2.0.0/test/testautomation.c rename to 3rdparty/sdl2-2.0.4/test/testautomation.c index 5eea7ec6f4..eea74b3b86 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -62,7 +62,7 @@ main(int argc, char *argv[]) } else if (SDL_strcasecmp(argv[i], "--execKey") == 0) { if (argv[i + 1]) { - SDL_sscanf(argv[i + 1], "%llu", (long long unsigned int *)&userExecKey); + SDL_sscanf(argv[i + 1], "%"SDL_PRIu64, (long long unsigned int *)&userExecKey); consumed = 2; } } @@ -80,8 +80,7 @@ main(int argc, char *argv[]) } } if (consumed < 0) { - fprintf(stderr, - "Usage: %s %s [--iterations #] [--execKey #] [--seed string] [--filter suite_name|test_name]\n", + SDL_Log("Usage: %s %s [--iterations #] [--execKey #] [--seed string] [--filter suite_name|test_name]\n", argv[0], SDLTest_CommonUsage(state)); quit(1); } @@ -114,12 +113,8 @@ main(int argc, char *argv[]) } /* Clean up */ - if (userRunSeed != NULL) { - SDL_free(userRunSeed); - } - if (filter != NULL) { - SDL_free(filter); - } + SDL_free(userRunSeed); + SDL_free(filter); /* Shutdown everything */ quit(result); diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_audio.c b/3rdparty/sdl2-2.0.4/test/testautomation_audio.c similarity index 77% rename from 3rdparty/sdl2-2.0.0/test/testautomation_audio.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_audio.c index 90b08acbdc..bef838dde0 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_audio.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_audio.c @@ -3,6 +3,9 @@ * New/updated tests: aschiffler at ferzkopp dot net */ +/* quiet windows compiler warnings */ +#define _CRT_SECURE_NO_WARNINGS + #include #include @@ -25,11 +28,29 @@ _audioSetUp(void *arg) } } +void +_audioTearDown(void *arg) +{ + /* Remove a possibly created file from SDL disk writer audio driver; ignore errors */ + remove("sdlaudio.raw"); + + SDLTest_AssertPass("Cleanup of test files completed"); +} + + +/* Global counter for callback invocation */ +int _audio_testCallbackCounter; + +/* Global accumulator for total callback length */ +int _audio_testCallbackLength; + /* Test callback function */ void _audio_testCallback(void *userdata, Uint8 *stream, int len) { - /* TODO: add tracking if callback was called */ + /* track that callback was called */ + _audio_testCallbackCounter++; + _audio_testCallbackLength += len; } @@ -38,8 +59,8 @@ void _audio_testCallback(void *userdata, Uint8 *stream, int len) /** * \brief Stop and restart audio subsystem * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_QuitSubSystem - * \sa http://wiki.libsdl.org/moin.cgi/SDL_InitSubSystem + * \sa https://wiki.libsdl.org/SDL_QuitSubSystem + * \sa https://wiki.libsdl.org/SDL_InitSubSystem */ int audio_quitInitAudioSubSystem() { @@ -56,8 +77,8 @@ int audio_quitInitAudioSubSystem() /** * \brief Start and stop audio directly * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_InitAudio - * \sa http://wiki.libsdl.org/moin.cgi/SDL_QuitAudio + * \sa https://wiki.libsdl.org/SDL_InitAudio + * \sa https://wiki.libsdl.org/SDL_QuitAudio */ int audio_initQuitAudio() { @@ -71,13 +92,13 @@ int audio_initQuitAudio() /* Loop over all available audio drivers */ iMax = SDL_GetNumAudioDrivers(); - SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers"); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); for (i = 0; i < iMax; i++) { audioDriver = SDL_GetAudioDriver(i); SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL"); - SDLTest_AssertCheck(SDL_strlen(audioDriver) > 0, "Audio driver name is not empty; got: %s", audioDriver); + SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* Call Init */ result = SDL_AudioInit(audioDriver); @@ -110,15 +131,104 @@ int audio_initQuitAudio() /** * \brief Start, open, close and stop audio * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_InitAudio - * \sa http://wiki.libsdl.org/moin.cgi/SDL_OpenAudio - * \sa http://wiki.libsdl.org/moin.cgi/SDL_CloseAudio - * \sa http://wiki.libsdl.org/moin.cgi/SDL_QuitAudio + * \sa https://wiki.libsdl.org/SDL_InitAudio + * \sa https://wiki.libsdl.org/SDL_OpenAudio + * \sa https://wiki.libsdl.org/SDL_CloseAudio + * \sa https://wiki.libsdl.org/SDL_QuitAudio */ int audio_initOpenCloseQuitAudio() +{ + int result, expectedResult; + int i, iMax, j, k; + const char* audioDriver; + SDL_AudioSpec desired; + + /* Stop SDL audio subsystem */ + SDL_QuitSubSystem( SDL_INIT_AUDIO ); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + + /* Loop over all available audio drivers */ + iMax = SDL_GetNumAudioDrivers(); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); + SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); + for (i = 0; i < iMax; i++) { + audioDriver = SDL_GetAudioDriver(i); + SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); + SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL"); + SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); + + /* Change specs */ + for (j = 0; j < 2; j++) { + + /* Call Init */ + result = SDL_AudioInit(audioDriver); + SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); + SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); + + /* Set spec */ + SDL_memset(&desired, 0, sizeof(desired)); + switch (j) { + case 0: + /* Set standard desired spec */ + desired.freq = 22050; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 4096; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + + case 1: + /* Set custom desired spec */ + desired.freq = 48000; + desired.format = AUDIO_F32SYS; + desired.channels = 2; + desired.samples = 2048; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + break; + } + + /* Call Open (maybe multiple times) */ + for (k=0; k <= j; k++) { + result = SDL_OpenAudio(&desired, NULL); + SDLTest_AssertPass("Call to SDL_OpenAudio(desired_spec_%d, NULL), call %d", j, k+1); + expectedResult = (k==0) ? 0 : -1; + SDLTest_AssertCheck(result == expectedResult, "Verify return value; expected: %d, got: %d", expectedResult, result); + } + + /* Call Close (maybe multiple times) */ + for (k=0; k <= j; k++) { + SDL_CloseAudio(); + SDLTest_AssertPass("Call to SDL_CloseAudio(), call %d", k+1); + } + + /* Call Quit (maybe multiple times) */ + for (k=0; k <= j; k++) { + SDL_AudioQuit(); + SDLTest_AssertPass("Call to SDL_AudioQuit(), call %d", k+1); + } + + } /* spec loop */ + } /* driver loop */ + + /* Restart audio again */ + _audioSetUp(NULL); + + return TEST_COMPLETED; +} + +/** + * \brief Pause and unpause audio + * + * \sa https://wiki.libsdl.org/SDL_PauseAudio + */ +int audio_pauseUnpauseAudio() { int result; - int i, iMax, j; + int i, iMax, j, k, l; + int totalDelay; + int pause_on; + int originalCounter; const char* audioDriver; SDL_AudioSpec desired; @@ -128,13 +238,13 @@ int audio_initOpenCloseQuitAudio() /* Loop over all available audio drivers */ iMax = SDL_GetNumAudioDrivers(); - SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers"); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); for (i = 0; i < iMax; i++) { audioDriver = SDL_GetAudioDriver(i); SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL"); - SDLTest_AssertCheck(SDL_strlen(audioDriver) > 0, "Audio driver name is not empty; got: %s", audioDriver); + SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* Change specs */ for (j = 0; j < 2; j++) { @@ -172,9 +282,47 @@ int audio_initOpenCloseQuitAudio() SDLTest_AssertPass("Call to SDL_OpenAudio(desired_spec_%d, NULL)", j); SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0 got: %d", result); + /* Start and stop audio multiple times */ + for (l=0; l<3; l++) { + SDLTest_Log("Pause/Unpause iteration: %d", l+1); + + /* Reset callback counters */ + _audio_testCallbackCounter = 0; + _audio_testCallbackLength = 0; + + /* Un-pause audio to start playing (maybe multiple times) */ + pause_on = 0; + for (k=0; k <= j; k++) { + SDL_PauseAudio(pause_on); + SDLTest_AssertPass("Call to SDL_PauseAudio(%d), call %d", pause_on, k+1); + } + + /* Wait for callback */ + totalDelay = 0; + do { + SDL_Delay(10); + totalDelay += 10; + } + while (_audio_testCallbackCounter == 0 && totalDelay < 1000); + SDLTest_AssertCheck(_audio_testCallbackCounter > 0, "Verify callback counter; expected: >0 got: %d", _audio_testCallbackCounter); + SDLTest_AssertCheck(_audio_testCallbackLength > 0, "Verify callback length; expected: >0 got: %d", _audio_testCallbackLength); + + /* Pause audio to stop playing (maybe multiple times) */ + for (k=0; k <= j; k++) { + pause_on = (k==0) ? 1 : SDLTest_RandomIntegerInRange(99, 9999); + SDL_PauseAudio(pause_on); + SDLTest_AssertPass("Call to SDL_PauseAudio(%d), call %d", pause_on, k+1); + } + + /* Ensure callback is not called again */ + originalCounter = _audio_testCallbackCounter; + SDL_Delay(totalDelay + 10); + SDLTest_AssertCheck(originalCounter == _audio_testCallbackCounter, "Verify callback counter; expected: %d, got: %d", originalCounter, _audio_testCallbackCounter); + } + /* Call Close */ - SDL_CloseAudio(); - SDLTest_AssertPass("Call to SDL_CloseAudio()"); + SDL_CloseAudio(); + SDLTest_AssertPass("Call to SDL_CloseAudio()"); /* Call Quit */ SDL_AudioQuit(); @@ -183,8 +331,8 @@ int audio_initOpenCloseQuitAudio() } /* spec loop */ } /* driver loop */ - /* Restart audio again */ - _audioSetUp(NULL); + /* Restart audio again */ + _audioSetUp(NULL); return TEST_COMPLETED; } @@ -192,8 +340,8 @@ int audio_initOpenCloseQuitAudio() /** * \brief Enumerate and name available audio devices (output and capture). * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetNumAudioDevices - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioDeviceName + * \sa https://wiki.libsdl.org/SDL_GetNumAudioDevices + * \sa https://wiki.libsdl.org/SDL_GetAudioDeviceName */ int audio_enumerateAndNameAudioDevices() { @@ -226,14 +374,14 @@ int audio_enumerateAndNameAudioDevices() SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); SDLTest_AssertCheck(name != NULL, "Verify result from SDL_GetAudioDeviceName(%i, %i) is not NULL", i, t); if (name != NULL) { - SDLTest_AssertCheck(SDL_strlen(name)>0, "verify result from SDL_GetAudioDeviceName(%i, %i) is not empty, got: '%s'", i, t, name); + SDLTest_AssertCheck(name[0] != '\0', "verify result from SDL_GetAudioDeviceName(%i, %i) is not empty, got: '%s'", i, t, name); if (t==1) { /* Also try non-zero type */ tt = t + SDLTest_RandomIntegerInRange(1,10); nameAgain = SDL_GetAudioDeviceName(i, tt); SDLTest_AssertCheck(nameAgain != NULL, "Verify result from SDL_GetAudioDeviceName(%i, %i) is not NULL", i, tt); if (nameAgain != NULL) { - SDLTest_AssertCheck(SDL_strlen(nameAgain)>0, "Verify result from SDL_GetAudioDeviceName(%i, %i) is not empty, got: '%s'", i, tt, nameAgain); + SDLTest_AssertCheck(nameAgain[0] != '\0', "Verify result from SDL_GetAudioDeviceName(%i, %i) is not empty, got: '%s'", i, tt, nameAgain); SDLTest_AssertCheck(SDL_strcmp(name, nameAgain)==0, "Verify SDL_GetAudioDeviceName(%i, %i) and SDL_GetAudioDeviceName(%i %i) return the same string", i, t, i, tt); @@ -250,8 +398,8 @@ int audio_enumerateAndNameAudioDevices() /** * \brief Negative tests around enumeration and naming of audio devices. * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetNumAudioDevices - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioDeviceName + * \sa https://wiki.libsdl.org/SDL_GetNumAudioDevices + * \sa https://wiki.libsdl.org/SDL_GetAudioDeviceName */ int audio_enumerateAndNameAudioDevicesNegativeTests() { @@ -297,8 +445,8 @@ int audio_enumerateAndNameAudioDevicesNegativeTests() /** * \brief Checks available audio driver names. * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetNumAudioDrivers - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioDriver + * \sa https://wiki.libsdl.org/SDL_GetNumAudioDrivers + * \sa https://wiki.libsdl.org/SDL_GetAudioDriver */ int audio_printAudioDrivers() { @@ -318,7 +466,7 @@ int audio_printAudioDrivers() SDLTest_AssertPass("Call to SDL_GetAudioDriver(%i)", i); SDLTest_AssertCheck(name != NULL, "Verify returned name is not NULL"); if (name != NULL) { - SDLTest_AssertCheck(SDL_strlen(name)>0, "Verify returned name is not empty, got: '%s'", name); + SDLTest_AssertCheck(name[0] != '\0', "Verify returned name is not empty, got: '%s'", name); } } } @@ -330,7 +478,7 @@ int audio_printAudioDrivers() /** * \brief Checks current audio driver name with initialized audio. * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetCurrentAudioDriver + * \sa https://wiki.libsdl.org/SDL_GetCurrentAudioDriver */ int audio_printCurrentAudioDriver() { @@ -339,7 +487,7 @@ int audio_printCurrentAudioDriver() SDLTest_AssertPass("Call to SDL_GetCurrentAudioDriver()"); SDLTest_AssertCheck(name != NULL, "Verify returned name is not NULL"); if (name != NULL) { - SDLTest_AssertCheck(SDL_strlen(name)>0, "Verify returned name is not empty, got: '%s'", name); + SDLTest_AssertCheck(name[0] != '\0', "Verify returned name is not empty, got: '%s'", name); } return TEST_COMPLETED; @@ -362,7 +510,7 @@ int _audioFrequencies[] = { 11025, 22050, 44100, 48000 }; /** * \brief Builds various audio conversion structures * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_BuildAudioCVT + * \sa https://wiki.libsdl.org/SDL_BuildAudioCVT */ int audio_buildAudioCVT() { @@ -412,7 +560,7 @@ int audio_buildAudioCVT() i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); SDLTest_AssertCheck(result == 0 || result == 1, "Verify result value; expected: 0 or 1, got: %i", result); if (result<0) { - SDLTest_LogError(SDL_GetError()); + SDLTest_LogError("%s", SDL_GetError()); } else { SDLTest_AssertCheck(cvt.len_mult > 0, "Verify that cvt.len_mult value; expected: >0, got: %i", cvt.len_mult); } @@ -426,7 +574,7 @@ int audio_buildAudioCVT() /** * \brief Checkes calls with invalid input to SDL_BuildAudioCVT * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_BuildAudioCVT + * \sa https://wiki.libsdl.org/SDL_BuildAudioCVT */ int audio_buildAudioCVTNegative() { @@ -502,14 +650,14 @@ int audio_buildAudioCVTNegative() SDL_strlcat(message, " spec2.freq", 256); spec2.freq = 0; } - SDLTest_Log(message); + SDLTest_Log("%s", message); result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, spec2.format, spec2.channels, spec2.freq); SDLTest_AssertPass("Call to SDL_BuildAudioCVT(spec1 ==> spec2)"); SDLTest_AssertCheck(result == -1, "Verify result value; expected: -1, got: %i", result); error = SDL_GetError(); SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL && SDL_strlen(error)>0, "Validate that error message was not NULL or empty"); + SDLTest_AssertCheck(error != NULL && error[0] != '\0', "Validate that error message was not NULL or empty"); } SDL_ClearError(); @@ -521,7 +669,7 @@ int audio_buildAudioCVTNegative() /** * \brief Checks current audio status. * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioStatus + * \sa https://wiki.libsdl.org/SDL_GetAudioStatus */ int audio_getAudioStatus() { @@ -542,7 +690,7 @@ int audio_getAudioStatus() /** * \brief Opens, checks current audio status, and closes a device. * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioStatus + * \sa https://wiki.libsdl.org/SDL_GetAudioStatus */ int audio_openCloseAndGetAudioStatus() { @@ -600,8 +748,8 @@ int audio_openCloseAndGetAudioStatus() /** * \brief Locks and unlocks open audio device. * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_LockAudioDevice - * \sa http://wiki.libsdl.org/moin.cgi/SDL_UnlockAudioDevice + * \sa https://wiki.libsdl.org/SDL_LockAudioDevice + * \sa https://wiki.libsdl.org/SDL_UnlockAudioDevice */ int audio_lockUnlockOpenAudioDevice() { @@ -643,7 +791,7 @@ int audio_lockUnlockOpenAudioDevice() SDL_Delay(10); SDLTest_Log("Simulate callback processing - delay"); - /* Unlock again*/ + /* Unlock again */ SDL_UnlockAudioDevice(id); SDLTest_AssertPass("SDL_UnlockAudioDevice(%i)", id); @@ -663,8 +811,8 @@ int audio_lockUnlockOpenAudioDevice() /** * \brief Convert audio using various conversion structures * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_BuildAudioCVT - * \sa http://wiki.libsdl.org/moin.cgi/SDL_ConvertAudio + * \sa https://wiki.libsdl.org/SDL_BuildAudioCVT + * \sa https://wiki.libsdl.org/SDL_ConvertAudio */ int audio_convertAudio() { @@ -688,7 +836,7 @@ int audio_convertAudio() if (c & 4) { SDL_strlcat(message, " Frequencies", 128); } - SDLTest_Log(message); + SDLTest_Log("%s", message); /* All source conversions with random conversion targets */ for (i = 0; i < _numAudioFormats; i++) { for (j = 0; j < _numAudioChannels; j++) { @@ -725,7 +873,7 @@ int audio_convertAudio() i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result); if (result != 1) { - SDLTest_LogError(SDL_GetError()); + SDLTest_LogError("%s", SDL_GetError()); } else { SDLTest_AssertCheck(cvt.len_mult > 0, "Verify that cvt.len_mult value; expected: >0, got: %i", cvt.len_mult); if (cvt.len_mult < 1) return TEST_ABORTED; @@ -747,11 +895,9 @@ int audio_convertAudio() SDLTest_AssertCheck(cvt.len_ratio > 0.0, "Verify conversion length ratio; expected: >0; got: %f", cvt.len_ratio); /* Free converted buffer */ - if (cvt.buf != NULL) { SDL_free(cvt.buf); cvt.buf = NULL; - } - } + } } } } @@ -764,7 +910,7 @@ int audio_convertAudio() /** * \brief Opens, checks current connected status, and closes a device. * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_AudioDeviceConnected + * \sa https://wiki.libsdl.org/SDL_AudioDeviceConnected */ int audio_openCloseAudioDeviceConnected() { @@ -867,23 +1013,20 @@ static const SDLTest_TestCaseReference audioTest11 = static const SDLTest_TestCaseReference audioTest12 = { (SDLTest_TestCaseFp)audio_quitInitAudioSubSystem, "audio_quitInitAudioSubSystem", "Quit and re-init audio subsystem.", TEST_ENABLED }; -/* TODO: enable when bugs 1343 and 1396 are fixed. */ -/* For debugging, test case can be run manually using --filter audio_initQuitAudio */ - static const SDLTest_TestCaseReference audioTest13 = - { (SDLTest_TestCaseFp)audio_initQuitAudio, "audio_initQuitAudio", "Init and quit audio drivers directly.", TEST_DISABLED }; - -/* TODO: enable when bugs 1343 and 1396 are fixed. */ -/* For debugging, test case can be run manually using --filter audio_initOpenCloseQuitAudio */ + { (SDLTest_TestCaseFp)audio_initQuitAudio, "audio_initQuitAudio", "Init and quit audio drivers directly.", TEST_ENABLED }; static const SDLTest_TestCaseReference audioTest14 = - { (SDLTest_TestCaseFp)audio_initOpenCloseQuitAudio, "audio_initOpenCloseQuitAudio", "Cycle through init, open, close and quit with various audio specs.", TEST_DISABLED }; + { (SDLTest_TestCaseFp)audio_initOpenCloseQuitAudio, "audio_initOpenCloseQuitAudio", "Cycle through init, open, close and quit with various audio specs.", TEST_ENABLED }; + +static const SDLTest_TestCaseReference audioTest15 = + { (SDLTest_TestCaseFp)audio_pauseUnpauseAudio, "audio_pauseUnpauseAudio", "Pause and Unpause audio for various audio specs while testing callback.", TEST_ENABLED }; /* Sequence of Audio test cases */ static const SDLTest_TestCaseReference *audioTests[] = { &audioTest1, &audioTest2, &audioTest3, &audioTest4, &audioTest5, &audioTest6, &audioTest7, &audioTest8, &audioTest9, &audioTest10, &audioTest11, - &audioTest12, &audioTest13, &audioTest14, NULL + &audioTest12, &audioTest13, &audioTest14, &audioTest15, NULL }; /* Audio test suite (global) */ @@ -891,5 +1034,5 @@ SDLTest_TestSuiteReference audioTestSuite = { "Audio", _audioSetUp, audioTests, - NULL + _audioTearDown }; diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_clipboard.c b/3rdparty/sdl2-2.0.4/test/testautomation_clipboard.c similarity index 95% rename from 3rdparty/sdl2-2.0.0/test/testautomation_clipboard.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_clipboard.c index 92aec7d03c..f943ffee79 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_clipboard.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_clipboard.c @@ -41,7 +41,7 @@ clipboard_testGetClipboardText(void *arg) charResult = SDL_GetClipboardText(); SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); - if (charResult) SDL_free(charResult); + SDL_free(charResult); return TEST_COMPLETED; } @@ -69,8 +69,8 @@ clipboard_testSetClipboardText(void *arg) textRef, text); /* Cleanup */ - if (textRef) SDL_free(textRef); - if (text) SDL_free(text); + SDL_free(textRef); + SDL_free(text); return TEST_COMPLETED; } @@ -103,6 +103,7 @@ clipboard_testClipboardTextFunctions(void *arg) intResult); charResult = SDL_GetClipboardText(); SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); + SDL_free(charResult); boolResult = SDL_HasClipboardText(); SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); SDLTest_AssertCheck( @@ -118,7 +119,7 @@ clipboard_testClipboardTextFunctions(void *arg) charResult != NULL, "Verify SDL_GetClipboardText did not return NULL"); SDLTest_AssertCheck( - SDL_strlen(charResult) == 0, + charResult[0] == '\0', "Verify SDL_GetClipboardText returned string with length 0, got length %i", SDL_strlen(charResult)); intResult = SDL_SetClipboardText((const char *)text); @@ -137,6 +138,7 @@ clipboard_testClipboardTextFunctions(void *arg) boolResult == SDL_TRUE, "Verify SDL_HasClipboardText returned SDL_TRUE, got %s", (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); + SDL_free(charResult); charResult = SDL_GetClipboardText(); SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); SDLTest_AssertCheck( @@ -145,9 +147,9 @@ clipboard_testClipboardTextFunctions(void *arg) textRef, charResult); /* Cleanup */ - if (textRef) SDL_free(textRef); - if (text) SDL_free(text); - if (charResult) SDL_free(charResult); + SDL_free(textRef); + SDL_free(text); + SDL_free(charResult); return TEST_COMPLETED; } diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_events.c b/3rdparty/sdl2-2.0.4/test/testautomation_events.c similarity index 94% rename from 3rdparty/sdl2-2.0.0/test/testautomation_events.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_events.c index 638607e761..f9eb5bb9e8 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_events.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_events.c @@ -58,7 +58,7 @@ events_pushPumpAndPollUserevent(void *arg) event1.user.data1 = (void *)&_userdataValue1; event1.user.data2 = (void *)&_userdataValue2; - /* Push a user event onto the queue and force queue update*/ + /* Push a user event onto the queue and force queue update */ SDL_PushEvent(&event1); SDLTest_AssertPass("Call to SDL_PushEvent()"); SDL_PumpEvents(); @@ -101,7 +101,7 @@ events_addDelEventWatch(void *arg) SDL_AddEventWatch(_events_sampleNullEventFilter, NULL); SDLTest_AssertPass("Call to SDL_AddEventWatch()"); - /* Push a user event onto the queue and force queue update*/ + /* Push a user event onto the queue and force queue update */ SDL_PushEvent(&event); SDLTest_AssertPass("Call to SDL_PushEvent()"); SDL_PumpEvents(); @@ -112,7 +112,7 @@ events_addDelEventWatch(void *arg) SDL_DelEventWatch(_events_sampleNullEventFilter, NULL); SDLTest_AssertPass("Call to SDL_DelEventWatch()"); - /* Push a user event onto the queue and force queue update*/ + /* Push a user event onto the queue and force queue update */ _eventFilterCalled = 0; SDL_PushEvent(&event); SDLTest_AssertPass("Call to SDL_PushEvent()"); @@ -152,7 +152,7 @@ events_addDelEventWatchWithUserdata(void *arg) SDL_AddEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue); SDLTest_AssertPass("Call to SDL_AddEventWatch()"); - /* Push a user event onto the queue and force queue update*/ + /* Push a user event onto the queue and force queue update */ SDL_PushEvent(&event); SDLTest_AssertPass("Call to SDL_PushEvent()"); SDL_PumpEvents(); @@ -163,7 +163,7 @@ events_addDelEventWatchWithUserdata(void *arg) SDL_DelEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue); SDLTest_AssertPass("Call to SDL_DelEventWatch()"); - /* Push a user event onto the queue and force queue update*/ + /* Push a user event onto the queue and force queue update */ _eventFilterCalled = 0; SDL_PushEvent(&event); SDLTest_AssertPass("Call to SDL_PushEvent()"); diff --git a/3rdparty/sdl2-2.0.4/test/testautomation_hints.c b/3rdparty/sdl2-2.0.4/test/testautomation_hints.c new file mode 100644 index 0000000000..a6beb88d76 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testautomation_hints.c @@ -0,0 +1,168 @@ +/** + * Hints test suite + */ + +#include + +#include "SDL.h" +#include "SDL_test.h" + + +const int _numHintsEnum = 25; +char* _HintsEnum[] = + { + SDL_HINT_ACCELEROMETER_AS_JOYSTICK, + SDL_HINT_FRAMEBUFFER_ACCELERATION, + SDL_HINT_GAMECONTROLLERCONFIG, + SDL_HINT_GRAB_KEYBOARD, + SDL_HINT_IDLE_TIMER_DISABLED, + SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, + SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, + SDL_HINT_MOUSE_RELATIVE_MODE_WARP, + SDL_HINT_ORIENTATIONS, + SDL_HINT_RENDER_DIRECT3D_THREADSAFE, + SDL_HINT_RENDER_DRIVER, + SDL_HINT_RENDER_OPENGL_SHADERS, + SDL_HINT_RENDER_SCALE_QUALITY, + SDL_HINT_RENDER_VSYNC, + SDL_HINT_TIMER_RESOLUTION, + SDL_HINT_VIDEO_ALLOW_SCREENSAVER, + SDL_HINT_VIDEO_HIGHDPI_DISABLED, + SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES, + SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, + SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT, + SDL_HINT_VIDEO_WIN_D3DCOMPILER, + SDL_HINT_VIDEO_X11_XINERAMA, + SDL_HINT_VIDEO_X11_XRANDR, + SDL_HINT_VIDEO_X11_XVIDMODE, + SDL_HINT_XINPUT_ENABLED, + }; +char* _HintsVerbose[] = + { + "SDL_HINT_ACCELEROMETER_AS_JOYSTICK", + "SDL_HINT_FRAMEBUFFER_ACCELERATION", + "SDL_HINT_GAMECONTROLLERCONFIG", + "SDL_HINT_GRAB_KEYBOARD", + "SDL_HINT_IDLE_TIMER_DISABLED", + "SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS", + "SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK", + "SDL_HINT_MOUSE_RELATIVE_MODE_WARP", + "SDL_HINT_ORIENTATIONS", + "SDL_HINT_RENDER_DIRECT3D_THREADSAFE", + "SDL_HINT_RENDER_DRIVER", + "SDL_HINT_RENDER_OPENGL_SHADERS", + "SDL_HINT_RENDER_SCALE_QUALITY", + "SDL_HINT_RENDER_VSYNC", + "SDL_HINT_TIMER_RESOLUTION", + "SDL_HINT_VIDEO_ALLOW_SCREENSAVER", + "SDL_HINT_VIDEO_HIGHDPI_DISABLED", + "SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES", + "SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS", + "SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT", + "SDL_HINT_VIDEO_WIN_D3DCOMPILER", + "SDL_HINT_VIDEO_X11_XINERAMA", + "SDL_HINT_VIDEO_X11_XRANDR", + "SDL_HINT_VIDEO_X11_XVIDMODE", + "SDL_HINT_XINPUT_ENABLED" + }; + + +/* Test case functions */ + +/** + * @brief Call to SDL_GetHint + */ +int +hints_getHint(void *arg) +{ + char *result1; + char *result2; + int i; + + for (i=0; i<_numHintsEnum; i++) { + result1 = (char *)SDL_GetHint((char*)_HintsEnum[i]); + SDLTest_AssertPass("Call to SDL_GetHint(%s) - using define definition", (char*)_HintsEnum[i]); + result2 = (char *)SDL_GetHint((char *)_HintsVerbose[i]); + SDLTest_AssertPass("Call to SDL_GetHint(%s) - using string definition", (char*)_HintsVerbose[i]); + SDLTest_AssertCheck( + (result1 == NULL && result2 == NULL) || (SDL_strcmp(result1, result2) == 0), + "Verify returned values are equal; got: result1='%s' result2='%s", + (result1 == NULL) ? "null" : result1, + (result2 == NULL) ? "null" : result2); + } + + return TEST_COMPLETED; +} + +/** + * @brief Call to SDL_SetHint + */ +int +hints_setHint(void *arg) +{ + char *originalValue; + char *value; + char *testValue; + SDL_bool result; + int i, j; + + /* Create random values to set */ + value = SDLTest_RandomAsciiStringOfSize(10); + + for (i=0; i<_numHintsEnum; i++) { + /* Capture current value */ + originalValue = (char *)SDL_GetHint((char*)_HintsEnum[i]); + SDLTest_AssertPass("Call to SDL_GetHint(%s)", (char*)_HintsEnum[i]); + + /* Set value (twice) */ + for (j=1; j<=2; j++) { + result = SDL_SetHint((char*)_HintsEnum[i], value); + SDLTest_AssertPass("Call to SDL_SetHint(%s, %s) (iteration %i)", (char*)_HintsEnum[i], value, j); + SDLTest_AssertCheck( + result == SDL_TRUE || result == SDL_FALSE, + "Verify valid result was returned, got: %i", + (int)result); + testValue = (char *)SDL_GetHint((char*)_HintsEnum[i]); + SDLTest_AssertPass("Call to SDL_GetHint(%s) - using string definition", (char*)_HintsVerbose[i]); + SDLTest_AssertCheck( + (SDL_strcmp(value, testValue) == 0), + "Verify returned value equals set value; got: testValue='%s' value='%s", + (testValue == NULL) ? "null" : testValue, + value); + } + + /* Reset original value */ + result = SDL_SetHint((char*)_HintsEnum[i], originalValue); + SDLTest_AssertPass("Call to SDL_SetHint(%s, originalValue)", (char*)_HintsEnum[i]); + SDLTest_AssertCheck( + result == SDL_TRUE || result == SDL_FALSE, + "Verify valid result was returned, got: %i", + (int)result); + } + + SDL_free(value); + + return TEST_COMPLETED; +} + +/* ================= Test References ================== */ + +/* Hints test cases */ +static const SDLTest_TestCaseReference hintsTest1 = + { (SDLTest_TestCaseFp)hints_getHint, "hints_getHint", "Call to SDL_GetHint", TEST_ENABLED }; + +static const SDLTest_TestCaseReference hintsTest2 = + { (SDLTest_TestCaseFp)hints_setHint, "hints_setHint", "Call to SDL_SetHint", TEST_ENABLED }; + +/* Sequence of Hints test cases */ +static const SDLTest_TestCaseReference *hintsTests[] = { + &hintsTest1, &hintsTest2, NULL +}; + +/* Hints test suite (global) */ +SDLTest_TestSuiteReference hintsTestSuite = { + "Hints", + NULL, + hintsTests, + NULL +}; diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_keyboard.c b/3rdparty/sdl2-2.0.4/test/testautomation_keyboard.c similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/testautomation_keyboard.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_keyboard.c diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_main.c b/3rdparty/sdl2-2.0.4/test/testautomation_main.c similarity index 91% rename from 3rdparty/sdl2-2.0.0/test/testautomation_main.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_main.c index f695903c27..ef8f19e9e7 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_main.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_main.c @@ -1,7 +1,7 @@ /** * Automated SDL subsystems management test. * - * Written by Jrgen Tjern "jorgenpt" + * Written by J�rgen Tjern� "jorgenpt" * * Released under Public Domain. */ @@ -10,7 +10,7 @@ #include "SDL_test.h" -/*! +/* ! * \brief Tests SDL_Init() and SDL_Quit() of Joystick and Haptic subsystems * \sa * http://wiki.libsdl.org/moin.cgi/SDL_Init @@ -38,7 +38,7 @@ static int main_testInitQuitJoystickHaptic (void *arg) #endif } -/*! +/* ! * \brief Tests SDL_InitSubSystem() and SDL_QuitSubSystem() * \sa * http://wiki.libsdl.org/moin.cgi/SDL_Init @@ -79,16 +79,16 @@ static int main_testImpliedJoystickInit (void *arg) #else int initialized_system; - // First initialize the controller + /* First initialize the controller */ SDLTest_AssertCheck( (SDL_WasInit(joy_and_controller) & joy_and_controller) == 0, "SDL_WasInit() before init should be false for joystick & controller" ); SDLTest_AssertCheck( SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == 0, "SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER)" ); - // Then make sure this implicitly initialized the joystick subsystem + /* Then make sure this implicitly initialized the joystick subsystem */ initialized_system = SDL_WasInit(joy_and_controller); SDLTest_AssertCheck( (initialized_system & joy_and_controller) == joy_and_controller, "SDL_WasInit() should be true for joystick & controller (%x)", initialized_system ); - // Then quit the controller, and make sure that implicitly also quits the - // joystick subsystem + /* Then quit the controller, and make sure that implicitly also quits the */ + /* joystick subsystem */ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); initialized_system = SDL_WasInit(joy_and_controller); SDLTest_AssertCheck( (initialized_system & joy_and_controller) == 0, "SDL_WasInit() should be false for joystick & controller (%x)", initialized_system ); @@ -104,17 +104,17 @@ static int main_testImpliedJoystickQuit (void *arg) #else int initialized_system; - // First initialize the controller and the joystick (explicitly) + /* First initialize the controller and the joystick (explicitly) */ SDLTest_AssertCheck( (SDL_WasInit(joy_and_controller) & joy_and_controller) == 0, "SDL_WasInit() before init should be false for joystick & controller" ); SDLTest_AssertCheck( SDL_InitSubSystem(SDL_INIT_JOYSTICK) == 0, "SDL_InitSubSystem(SDL_INIT_JOYSTICK)" ); SDLTest_AssertCheck( SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == 0, "SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER)" ); - // Then make sure they're both initialized properly + /* Then make sure they're both initialized properly */ initialized_system = SDL_WasInit(joy_and_controller); SDLTest_AssertCheck( (initialized_system & joy_and_controller) == joy_and_controller, "SDL_WasInit() should be true for joystick & controller (%x)", initialized_system ); - // Then quit the controller, and make sure that it does NOT quit the - // explicitly initialized joystick subsystem. + /* Then quit the controller, and make sure that it does NOT quit the */ + /* explicitly initialized joystick subsystem. */ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); initialized_system = SDL_WasInit(joy_and_controller); SDLTest_AssertCheck( (initialized_system & joy_and_controller) == SDL_INIT_JOYSTICK, "SDL_WasInit() should be false for joystick & controller (%x)", initialized_system ); diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_mouse.c b/3rdparty/sdl2-2.0.4/test/testautomation_mouse.c similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/testautomation_mouse.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_mouse.c diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_pixels.c b/3rdparty/sdl2-2.0.4/test/testautomation_pixels.c similarity index 96% rename from 3rdparty/sdl2-2.0.0/test/testautomation_pixels.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_pixels.c index 48f9838c86..7b88caaa9d 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_pixels.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_pixels.c @@ -79,14 +79,16 @@ char* _RGBPixelFormatsVerbose[] = }; /* Definition of all Non-RGB formats used to test pixel conversions */ -const int _numNonRGBPixelFormats = 5; +const int _numNonRGBPixelFormats = 7; Uint32 _nonRGBPixelFormats[] = { SDL_PIXELFORMAT_YV12, SDL_PIXELFORMAT_IYUV, SDL_PIXELFORMAT_YUY2, SDL_PIXELFORMAT_UYVY, - SDL_PIXELFORMAT_YVYU + SDL_PIXELFORMAT_YVYU, + SDL_PIXELFORMAT_NV12, + SDL_PIXELFORMAT_NV21 }; char* _nonRGBPixelFormatsVerbose[] = { @@ -94,7 +96,9 @@ char* _nonRGBPixelFormatsVerbose[] = "SDL_PIXELFORMAT_IYUV", "SDL_PIXELFORMAT_YUY2", "SDL_PIXELFORMAT_UYVY", - "SDL_PIXELFORMAT_YVYU" + "SDL_PIXELFORMAT_YVYU", + "SDL_PIXELFORMAT_NV12", + "SDL_PIXELFORMAT_NV21" }; /* Definition of some invalid formats for negative tests */ @@ -242,7 +246,7 @@ pixels_getPixelFormatName(void *arg) SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); if (result != NULL) { - SDLTest_AssertCheck(SDL_strlen(result) > 0, "Verify result is non-empty"); + SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty"); SDLTest_AssertCheck(SDL_strcmp(result, unknownFormat) == 0, "Verify result text; expected: %s, got %s", unknownFormat, result); } @@ -257,7 +261,7 @@ pixels_getPixelFormatName(void *arg) SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); if (result != NULL) { - SDLTest_AssertCheck(SDL_strlen(result) > 0, "Verify result is non-empty"); + SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty"); SDLTest_AssertCheck(SDL_strcmp(result, _RGBPixelFormatsVerbose[i]) == 0, "Verify result text; expected: %s, got %s", _RGBPixelFormatsVerbose[i], result); } @@ -273,7 +277,7 @@ pixels_getPixelFormatName(void *arg) SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); if (result != NULL) { - SDLTest_AssertCheck(SDL_strlen(result) > 0, "Verify result is non-empty"); + SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty"); SDLTest_AssertCheck(SDL_strcmp(result, _nonRGBPixelFormatsVerbose[i]) == 0, "Verify result text; expected: %s, got %s", _nonRGBPixelFormatsVerbose[i], result); } @@ -290,14 +294,14 @@ pixels_getPixelFormatName(void *arg) SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%u)", format); SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); if (result != NULL) { - SDLTest_AssertCheck(SDL_strlen(result) > 0, + SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty; got: %s", result); SDLTest_AssertCheck(SDL_strcmp(result, _invalidPixelFormatsVerbose[i]) == 0, "Validate name is UNKNOWN, expected: '%s', got: '%s'", _invalidPixelFormatsVerbose[i], result); } error = SDL_GetError(); SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL && SDL_strlen(error) == 0, "Validate that error message is empty"); + SDLTest_AssertCheck(error == NULL || error[0] == '\0', "Validate that error message is empty"); } return TEST_COMPLETED; @@ -411,7 +415,7 @@ pixels_calcGammaRamp(void *arg) int changed; Uint16 magic = 0xbeef; - /* Allocate temp ramp array and fill with some value*/ + /* Allocate temp ramp array and fill with some value */ ramp = (Uint16 *)SDL_malloc(256 * sizeof(Uint16)); SDLTest_AssertCheck(ramp != NULL, "Validate temp ramp array could be allocated"); if (ramp == NULL) return TEST_ABORTED; diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_platform.c b/3rdparty/sdl2-2.0.4/test/testautomation_platform.c similarity index 88% rename from 3rdparty/sdl2-2.0.0/test/testautomation_platform.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_platform.c index 5ed2abad11..5211a4a70c 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_platform.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_platform.c @@ -34,16 +34,16 @@ int platform_testTypes(void *arg) int ret; ret = _compareSizeOfType( sizeof(Uint8), 1 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint8) = %lu, expected 1", sizeof(Uint8) ); + SDLTest_AssertCheck( ret == 0, "sizeof(Uint8) = %lu, expected 1", (unsigned long)sizeof(Uint8) ); ret = _compareSizeOfType( sizeof(Uint16), 2 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint16) = %lu, expected 2", sizeof(Uint16) ); + SDLTest_AssertCheck( ret == 0, "sizeof(Uint16) = %lu, expected 2", (unsigned long)sizeof(Uint16) ); ret = _compareSizeOfType( sizeof(Uint32), 4 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint32) = %lu, expected 4", sizeof(Uint32) ); + SDLTest_AssertCheck( ret == 0, "sizeof(Uint32) = %lu, expected 4", (unsigned long)sizeof(Uint32) ); ret = _compareSizeOfType( sizeof(Uint64), 8 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint64) = %lu, expected 8", sizeof(Uint64) ); + SDLTest_AssertCheck( ret == 0, "sizeof(Uint64) = %lu, expected 8", (unsigned long)sizeof(Uint64) ); return TEST_COMPLETED; } @@ -92,17 +92,13 @@ int platform_testEndianessAndSwap(void *arg) /* Test 64 swap. */ SDLTest_AssertCheck( SDL_Swap64(value64) == swapped64, -#ifdef _MSC_VER - "SDL_Swap64(): 64 bit swapped: 0x%I64X => 0x%I64X", -#else - "SDL_Swap64(): 64 bit swapped: 0x%llX => 0x%llX", -#endif + "SDL_Swap64(): 64 bit swapped: 0x%"SDL_PRIX64" => 0x%"SDL_PRIX64, value64, SDL_Swap64(value64) ); return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_GetXYZ() functions * \sa * http://wiki.libsdl.org/moin.cgi/SDL_GetPlatform @@ -151,7 +147,7 @@ int platform_testGetFunctions (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_HasXYZ() functions * \sa * http://wiki.libsdl.org/moin.cgi/SDL_Has3DNow @@ -163,12 +159,13 @@ int platform_testGetFunctions (void *arg) * http://wiki.libsdl.org/moin.cgi/SDL_HasSSE3 * http://wiki.libsdl.org/moin.cgi/SDL_HasSSE41 * http://wiki.libsdl.org/moin.cgi/SDL_HasSSE42 + * http://wiki.libsdl.org/moin.cgi/SDL_HasAVX */ int platform_testHasFunctions (void *arg) { int ret; - // TODO: independently determine and compare values as well + /* TODO: independently determine and compare values as well */ ret = SDL_HasRDTSC(); SDLTest_AssertPass("SDL_HasRDTSC()"); @@ -197,10 +194,13 @@ int platform_testHasFunctions (void *arg) ret = SDL_HasSSE42(); SDLTest_AssertPass("SDL_HasSSE42()"); + ret = SDL_HasAVX(); + SDLTest_AssertPass("SDL_HasAVX()"); + return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_GetVersion * \sa * http://wiki.libsdl.org/moin.cgi/SDL_GetVersion @@ -225,7 +225,7 @@ int platform_testGetVersion(void *arg) } -/*! +/* ! * \brief Tests SDL_VERSION macro */ int platform_testSDLVersion(void *arg) @@ -248,7 +248,7 @@ int platform_testSDLVersion(void *arg) } -/*! +/* ! * \brief Tests default SDL_Init */ int platform_testDefaultInit(void *arg) @@ -270,7 +270,7 @@ int platform_testDefaultInit(void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_Get/Set/ClearError * \sa * http://wiki.libsdl.org/moin.cgi/SDL_GetError @@ -279,6 +279,7 @@ int platform_testDefaultInit(void *arg) */ int platform_testGetSetClearError(void *arg) { + int result; const char *testError = "Testing"; char *lastError; int len; @@ -297,8 +298,9 @@ int platform_testGetSetClearError(void *arg) "SDL_GetError(): no message expected, len: %i", len); } - SDL_SetError("%s", testError); + result = SDL_SetError("%s", testError); SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); lastError = (char *)SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, "SDL_GetError() != NULL"); @@ -315,26 +317,28 @@ int platform_testGetSetClearError(void *arg) lastError); } - // Clean up + /* Clean up */ SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_SetError with empty input * \sa * http://wiki.libsdl.org/moin.cgi/SDL_SetError */ int platform_testSetErrorEmptyInput(void *arg) { + int result; const char *testError = ""; char *lastError; int len; - SDL_SetError("%s", testError); + result = SDL_SetError("%s", testError); SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); lastError = (char *)SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, "SDL_GetError() != NULL"); @@ -351,32 +355,34 @@ int platform_testSetErrorEmptyInput(void *arg) lastError); } - // Clean up + /* Clean up */ SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_SetError with invalid input * \sa * http://wiki.libsdl.org/moin.cgi/SDL_SetError */ int platform_testSetErrorInvalidInput(void *arg) { - const char *testError = NULL; + int result; + const char *invalidError = NULL; const char *probeError = "Testing"; char *lastError; int len; - // Reset + /* Reset */ SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - // Check for no-op - SDL_SetError(testError); + /* Check for no-op */ + result = SDL_SetError(invalidError); SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); lastError = (char *)SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, "SDL_GetError() != NULL"); @@ -385,20 +391,37 @@ int platform_testSetErrorInvalidInput(void *arg) len = SDL_strlen(lastError); SDLTest_AssertCheck(len == 0, "SDL_GetError(): expected message len 0, was len: %i", - 0, len); - SDLTest_AssertCheck(SDL_strcmp(lastError, "") == 0, - "SDL_GetError(): expected message '', was message: '%s'", - lastError); } - // Set - SDL_SetError(probeError); - SDLTest_AssertPass("SDL_SetError()"); + /* Set */ + result = SDL_SetError(probeError); + SDLTest_AssertPass("SDL_SetError('%s')", probeError); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); + + /* Check for no-op */ + result = SDL_SetError(invalidError); + SDLTest_AssertPass("SDL_SetError(NULL)"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); + lastError = (char *)SDL_GetError(); + SDLTest_AssertCheck(lastError != NULL, + "SDL_GetError() != NULL"); + if (lastError != NULL) + { + len = SDL_strlen(lastError); + SDLTest_AssertCheck(len == 0, + "SDL_GetError(): expected message len 0, was len: %i", + len); + } - // Check for no-op - SDL_SetError(testError); + /* Reset */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* Set and check */ + result = SDL_SetError(probeError); SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); lastError = (char *)SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, "SDL_GetError() != NULL"); @@ -414,15 +437,15 @@ int platform_testSetErrorInvalidInput(void *arg) probeError, lastError); } - - // Clean up + + /* Clean up */ SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_GetPowerInfo * \sa * http://wiki.libsdl.org/moin.cgi/SDL_GetPowerInfo @@ -472,7 +495,7 @@ int platform_testGetPowerInfo(void *arg) pct); } - // Partial return value variations + /* Partial return value variations */ stateAgain = SDL_GetPowerInfo(&secsAgain, NULL); SDLTest_AssertCheck( state==stateAgain, diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_rect.c b/3rdparty/sdl2-2.0.4/test/testautomation_rect.c similarity index 97% rename from 3rdparty/sdl2-2.0.0/test/testautomation_rect.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_rect.c index 77a7347e6a..abf19f593d 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_rect.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_rect.c @@ -12,7 +12,7 @@ /* Helper functions */ -/*! +/* ! * \brief Private helper to check SDL_IntersectRectAndLine results */ void _validateIntersectRectAndLineResults( @@ -39,7 +39,7 @@ void _validateIntersectRectAndLineResults( /* Test case functions */ -/*! +/* ! * \brief Tests SDL_IntersectRectAndLine() clipping cases * * \sa @@ -110,7 +110,7 @@ rect_testIntersectRectAndLine (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_IntersectRectAndLine() non-clipping case line inside * * \sa @@ -177,7 +177,7 @@ rect_testIntersectRectAndLineInside (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_IntersectRectAndLine() non-clipping cases outside * * \sa @@ -232,7 +232,7 @@ rect_testIntersectRectAndLineOutside (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_IntersectRectAndLine() with empty rectangle * * \sa @@ -267,7 +267,7 @@ rect_testIntersectRectAndLineEmpty (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Negative tests against SDL_IntersectRectAndLine() with invalid parameters * * \sa @@ -302,7 +302,7 @@ rect_testIntersectRectAndLineParam (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Private helper to check SDL_HasIntersection results */ void _validateHasIntersectionResults( @@ -325,7 +325,7 @@ void _validateHasIntersectionResults( refRectB->x, refRectB->y, refRectB->w, refRectB->h); } -/*! +/* ! * \brief Private helper to check SDL_IntersectRect results */ void _validateIntersectRectResults( @@ -344,7 +344,7 @@ void _validateIntersectRectResults( } } -/*! +/* ! * \brief Private helper to check SDL_UnionRect results */ void _validateUnionRectResults( @@ -367,7 +367,7 @@ void _validateUnionRectResults( expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h); } -/*! +/* ! * \brief Private helper to check SDL_RectEmpty results */ void _validateRectEmptyResults( @@ -385,7 +385,7 @@ void _validateRectEmptyResults( refRect->x, refRect->y, refRect->w, refRect->h); } -/*! +/* ! * \brief Private helper to check SDL_RectEquals results */ void _validateRectEqualsResults( @@ -408,7 +408,7 @@ void _validateRectEqualsResults( refRectB->x, refRectB->y, refRectB->w, refRectB->h); } -/*! +/* ! * \brief Tests SDL_IntersectRect() with B fully inside A * * \sa @@ -423,7 +423,7 @@ int rect_testIntersectRectInside (void *arg) SDL_Rect result; SDL_bool intersection; - // rectB fully contained in rectA + /* rectB fully contained in rectA */ refRectB.x = 0; refRectB.y = 0; refRectB.w = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); @@ -436,7 +436,7 @@ int rect_testIntersectRectInside (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_IntersectRect() with B fully outside A * * \sa @@ -451,7 +451,7 @@ int rect_testIntersectRectOutside (void *arg) SDL_Rect result; SDL_bool intersection; - // rectB fully outside of rectA + /* rectB fully outside of rectA */ refRectB.x = refRectA.x + refRectA.w + SDLTest_RandomIntegerInRange(1, 10); refRectB.y = refRectA.y + refRectA.h + SDLTest_RandomIntegerInRange(1, 10); refRectB.w = refRectA.w; @@ -464,7 +464,7 @@ int rect_testIntersectRectOutside (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_IntersectRect() with B partially intersecting A * * \sa @@ -480,7 +480,7 @@ int rect_testIntersectRectPartial (void *arg) SDL_Rect expectedResult; SDL_bool intersection; - // rectB partially contained in rectA + /* rectB partially contained in rectA */ refRectB.x = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); refRectB.y = SDLTest_RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1); refRectB.w = refRectA.w; @@ -494,7 +494,7 @@ int rect_testIntersectRectPartial (void *arg) intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - // rectB right edge + /* rectB right edge */ refRectB.x = rectA.w - 1; refRectB.y = rectA.y; refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1); @@ -508,7 +508,7 @@ int rect_testIntersectRectPartial (void *arg) intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - // rectB left edge + /* rectB left edge */ refRectB.x = 1 - rectA.w; refRectB.y = rectA.y; refRectB.w = refRectA.w; @@ -522,7 +522,7 @@ int rect_testIntersectRectPartial (void *arg) intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - // rectB bottom edge + /* rectB bottom edge */ refRectB.x = rectA.x; refRectB.y = rectA.h - 1; refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1); @@ -536,7 +536,7 @@ int rect_testIntersectRectPartial (void *arg) intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - // rectB top edge + /* rectB top edge */ refRectB.x = rectA.x; refRectB.y = 1 - rectA.h; refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1); @@ -553,7 +553,7 @@ int rect_testIntersectRectPartial (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_IntersectRect() with 1x1 pixel sized rectangles * * \sa @@ -569,7 +569,7 @@ int rect_testIntersectRectPoint (void *arg) SDL_bool intersection; int offsetX, offsetY; - // intersecting pixels + /* intersecting pixels */ refRectA.x = SDLTest_RandomIntegerInRange(1, 100); refRectA.y = SDLTest_RandomIntegerInRange(1, 100); refRectB.x = refRectA.x; @@ -579,7 +579,7 @@ int rect_testIntersectRectPoint (void *arg) intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectA); - // non-intersecting pixels cases + /* non-intersecting pixels cases */ for (offsetX = -1; offsetX <= 1; offsetX++) { for (offsetY = -1; offsetY <= 1; offsetY++) { if (offsetX != 0 || offsetY != 0) { @@ -600,7 +600,7 @@ int rect_testIntersectRectPoint (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_IntersectRect() with empty rectangles * * \sa @@ -616,7 +616,7 @@ int rect_testIntersectRectEmpty (void *arg) SDL_bool intersection; SDL_bool empty; - // Rect A empty + /* Rect A empty */ result.w = SDLTest_RandomIntegerInRange(1, 100); result.h = SDLTest_RandomIntegerInRange(1, 100); refRectA.x = SDLTest_RandomIntegerInRange(1, 100); @@ -633,7 +633,7 @@ int rect_testIntersectRectEmpty (void *arg) empty = (SDL_bool)SDL_RectEmpty(&result); SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); - // Rect B empty + /* Rect B empty */ result.w = SDLTest_RandomIntegerInRange(1, 100); result.h = SDLTest_RandomIntegerInRange(1, 100); refRectA.x = SDLTest_RandomIntegerInRange(1, 100); @@ -650,7 +650,7 @@ int rect_testIntersectRectEmpty (void *arg) empty = (SDL_bool)SDL_RectEmpty(&result); SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); - // Rect A and B empty + /* Rect A and B empty */ result.w = SDLTest_RandomIntegerInRange(1, 100); result.h = SDLTest_RandomIntegerInRange(1, 100); refRectA.x = SDLTest_RandomIntegerInRange(1, 100); @@ -672,7 +672,7 @@ int rect_testIntersectRectEmpty (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Negative tests against SDL_IntersectRect() with invalid parameters * * \sa @@ -685,7 +685,7 @@ int rect_testIntersectRectParam(void *arg) SDL_Rect result; SDL_bool intersection; - // invalid parameter combinations + /* invalid parameter combinations */ intersection = SDL_IntersectRect((SDL_Rect *)NULL, &rectB, &result); SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); intersection = SDL_IntersectRect(&rectA, (SDL_Rect *)NULL, &result); @@ -702,7 +702,7 @@ int rect_testIntersectRectParam(void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_HasIntersection() with B fully inside A * * \sa @@ -716,7 +716,7 @@ int rect_testHasIntersectionInside (void *arg) SDL_Rect rectB; SDL_bool intersection; - // rectB fully contained in rectA + /* rectB fully contained in rectA */ refRectB.x = 0; refRectB.y = 0; refRectB.w = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); @@ -729,7 +729,7 @@ int rect_testHasIntersectionInside (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_HasIntersection() with B fully outside A * * \sa @@ -743,7 +743,7 @@ int rect_testHasIntersectionOutside (void *arg) SDL_Rect rectB; SDL_bool intersection; - // rectB fully outside of rectA + /* rectB fully outside of rectA */ refRectB.x = refRectA.x + refRectA.w + SDLTest_RandomIntegerInRange(1, 10); refRectB.y = refRectA.y + refRectA.h + SDLTest_RandomIntegerInRange(1, 10); refRectB.w = refRectA.w; @@ -756,7 +756,7 @@ int rect_testHasIntersectionOutside (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_HasIntersection() with B partially intersecting A * * \sa @@ -770,7 +770,7 @@ int rect_testHasIntersectionPartial (void *arg) SDL_Rect rectB; SDL_bool intersection; - // rectB partially contained in rectA + /* rectB partially contained in rectA */ refRectB.x = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); refRectB.y = SDLTest_RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1); refRectB.w = refRectA.w; @@ -780,7 +780,7 @@ int rect_testHasIntersectionPartial (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - // rectB right edge + /* rectB right edge */ refRectB.x = rectA.w - 1; refRectB.y = rectA.y; refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1); @@ -790,7 +790,7 @@ int rect_testHasIntersectionPartial (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - // rectB left edge + /* rectB left edge */ refRectB.x = 1 - rectA.w; refRectB.y = rectA.y; refRectB.w = refRectA.w; @@ -800,7 +800,7 @@ int rect_testHasIntersectionPartial (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - // rectB bottom edge + /* rectB bottom edge */ refRectB.x = rectA.x; refRectB.y = rectA.h - 1; refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1); @@ -810,7 +810,7 @@ int rect_testHasIntersectionPartial (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - // rectB top edge + /* rectB top edge */ refRectB.x = rectA.x; refRectB.y = 1 - rectA.h; refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1); @@ -823,7 +823,7 @@ int rect_testHasIntersectionPartial (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_HasIntersection() with 1x1 pixel sized rectangles * * \sa @@ -838,7 +838,7 @@ int rect_testHasIntersectionPoint (void *arg) SDL_bool intersection; int offsetX, offsetY; - // intersecting pixels + /* intersecting pixels */ refRectA.x = SDLTest_RandomIntegerInRange(1, 100); refRectA.y = SDLTest_RandomIntegerInRange(1, 100); refRectB.x = refRectA.x; @@ -848,7 +848,7 @@ int rect_testHasIntersectionPoint (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - // non-intersecting pixels cases + /* non-intersecting pixels cases */ for (offsetX = -1; offsetX <= 1; offsetX++) { for (offsetY = -1; offsetY <= 1; offsetY++) { if (offsetX != 0 || offsetY != 0) { @@ -869,7 +869,7 @@ int rect_testHasIntersectionPoint (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Tests SDL_HasIntersection() with empty rectangles * * \sa @@ -883,7 +883,7 @@ int rect_testHasIntersectionEmpty (void *arg) SDL_Rect rectB; SDL_bool intersection; - // Rect A empty + /* Rect A empty */ refRectA.x = SDLTest_RandomIntegerInRange(1, 100); refRectA.y = SDLTest_RandomIntegerInRange(1, 100); refRectA.w = SDLTest_RandomIntegerInRange(1, 100); @@ -896,7 +896,7 @@ int rect_testHasIntersectionEmpty (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); - // Rect B empty + /* Rect B empty */ refRectA.x = SDLTest_RandomIntegerInRange(1, 100); refRectA.y = SDLTest_RandomIntegerInRange(1, 100); refRectA.w = SDLTest_RandomIntegerInRange(1, 100); @@ -909,7 +909,7 @@ int rect_testHasIntersectionEmpty (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); - // Rect A and B empty + /* Rect A and B empty */ refRectA.x = SDLTest_RandomIntegerInRange(1, 100); refRectA.y = SDLTest_RandomIntegerInRange(1, 100); refRectA.w = SDLTest_RandomIntegerInRange(1, 100); @@ -927,7 +927,7 @@ int rect_testHasIntersectionEmpty (void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Negative tests against SDL_HasIntersection() with invalid parameters * * \sa @@ -939,7 +939,7 @@ int rect_testHasIntersectionParam(void *arg) SDL_Rect rectB; SDL_bool intersection; - // invalid parameter combinations + /* invalid parameter combinations */ intersection = SDL_HasIntersection((SDL_Rect *)NULL, &rectB); SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); intersection = SDL_HasIntersection(&rectA, (SDL_Rect *)NULL); @@ -950,7 +950,7 @@ int rect_testHasIntersectionParam(void *arg) return TEST_COMPLETED; } -/*! +/* ! * \brief Test SDL_EnclosePoints() without clipping * * \sa @@ -969,7 +969,7 @@ int rect_testEnclosePoints(void *arg) int minx = 0, maxx = 0, miny = 0, maxy = 0; int i; - // Create input data, tracking result + /* Create input data, tracking result */ for (i=0; itype == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type); @@ -352,11 +352,11 @@ rwops_testFileWrite(void) SDLTest_AssertPass("Call to SDL_RWFromFile(..,\"w+\") succeeded"); SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFile in write mode does not return NULL"); - // Bail out if NULL + /* Bail out if NULL */ if (rw == NULL) return TEST_ABORTED; /* Check type */ -#if defined(ANDROID) +#if defined(__ANDROID__) SDLTest_AssertCheck( rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type); @@ -560,7 +560,7 @@ rwops_testCompareRWFromMemWithRWFromFile(void) /* Compare */ SDLTest_AssertCheck(rv_mem == rv_file, "Verify returned read blocks matches for mem and file reads; got: rv_mem=%d rv_file=%d", rv_mem, rv_file); - SDLTest_AssertCheck(sv_mem == sv_file, "Verify SEEK_END position matches for mem and file seeks; got: sv_mem=%llu sv_file=%llu", sv_mem, sv_file); + SDLTest_AssertCheck(sv_mem == sv_file, "Verify SEEK_END position matches for mem and file seeks; got: sv_mem=%"SDL_PRIu64" sv_file=%"SDL_PRIu64, sv_mem, sv_file); SDLTest_AssertCheck(buffer_mem[slen] == 0, "Verify mem buffer termination; expected: 0, got: %d", buffer_mem[slen]); SDLTest_AssertCheck(buffer_file[slen] == 0, "Verify file buffer termination; expected: 0, got: %d", buffer_file[slen]); SDLTest_AssertCheck( @@ -642,53 +642,53 @@ rwops_testFileWriteReadEndian(void) SDLTest_AssertPass("Call to SDL_RWFromFile(..,\"w+\")"); SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFile in write mode does not return NULL"); - // Bail out if NULL + /* Bail out if NULL */ if (rw == NULL) return TEST_ABORTED; /* Write test data */ objectsWritten = SDL_WriteBE16(rw, BE16value); - SDLTest_AssertPass("Call to SDL_WriteBE16"); + SDLTest_AssertPass("Call to SDL_WriteBE16()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteBE32(rw, BE32value); - SDLTest_AssertPass("Call to SDL_WriteBE32"); + SDLTest_AssertPass("Call to SDL_WriteBE32()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteBE64(rw, BE64value); - SDLTest_AssertPass("Call to SDL_WriteBE64"); + SDLTest_AssertPass("Call to SDL_WriteBE64()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteLE16(rw, LE16value); - SDLTest_AssertPass("Call to SDL_WriteLE16"); + SDLTest_AssertPass("Call to SDL_WriteLE16()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteLE32(rw, LE32value); - SDLTest_AssertPass("Call to SDL_WriteLE32"); + SDLTest_AssertPass("Call to SDL_WriteLE32()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteLE64(rw, LE64value); - SDLTest_AssertPass("Call to SDL_WriteLE64"); + SDLTest_AssertPass("Call to SDL_WriteLE64()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); /* Test seek to start */ result = SDL_RWseek( rw, 0, RW_SEEK_SET ); SDLTest_AssertPass("Call to SDL_RWseek succeeded"); - SDLTest_AssertCheck(result == 0, "Verify result from position 0 with SDL_RWseek, expected 0, got %i", result); + SDLTest_AssertCheck(result == 0, "Verify result from position 0 with SDL_RWseek, expected 0, got %"SDL_PRIs64, result); /* Read test data */ BE16test = SDL_ReadBE16(rw); - SDLTest_AssertPass("Call to SDL_ReadBE16"); + SDLTest_AssertPass("Call to SDL_ReadBE16()"); SDLTest_AssertCheck(BE16test == BE16value, "Validate return value from SDL_ReadBE16, expected: %hu, got: %hu", BE16value, BE16test); BE32test = SDL_ReadBE32(rw); - SDLTest_AssertPass("Call to SDL_ReadBE32"); + SDLTest_AssertPass("Call to SDL_ReadBE32()"); SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %u, got: %u", BE32value, BE32test); BE64test = SDL_ReadBE64(rw); - SDLTest_AssertPass("Call to SDL_ReadBE64"); - SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %llu, got: %llu", BE64value, BE64test); + SDLTest_AssertPass("Call to SDL_ReadBE64()"); + SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, BE64value, BE64test); LE16test = SDL_ReadLE16(rw); - SDLTest_AssertPass("Call to SDL_ReadLE16"); + SDLTest_AssertPass("Call to SDL_ReadLE16()"); SDLTest_AssertCheck(LE16test == LE16value, "Validate return value from SDL_ReadLE16, expected: %hu, got: %hu", LE16value, LE16test); LE32test = SDL_ReadLE32(rw); - SDLTest_AssertPass("Call to SDL_ReadLE32"); + SDLTest_AssertPass("Call to SDL_ReadLE32()"); SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %u, got: %u", LE32value, LE32test); LE64test = SDL_ReadLE64(rw); - SDLTest_AssertPass("Call to SDL_ReadLE64"); - SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %llu, got: %llu", LE64value, LE64test); + SDLTest_AssertPass("Call to SDL_ReadLE64()"); + SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, LE64value, LE64test); /* Close handle */ cresult = SDL_RWclose(rw); diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_sdltest.c b/3rdparty/sdl2-2.0.4/test/testautomation_sdltest.c similarity index 87% rename from 3rdparty/sdl2-2.0.0/test/testautomation_sdltest.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_sdltest.c index e0d921b49c..ec1da8a50e 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_sdltest.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_sdltest.c @@ -21,6 +21,39 @@ /* Test case functions */ +/* Forward declarations for internal harness functions */ +extern char *SDLTest_GenerateRunSeed(const int length); + +/** + * @brief Calls to SDLTest_GenerateRunSeed() + */ +int +sdltest_generateRunSeed(void *arg) +{ + char* result; + int i, l; + + for (i = 1; i <= 10; i += 3) { + result = SDLTest_GenerateRunSeed((const int)i); + SDLTest_AssertPass("Call to SDLTest_GenerateRunSeed()"); + SDLTest_AssertCheck(result != NULL, "Verify returned value is not NULL"); + if (result != NULL) { + l = SDL_strlen(result); + SDLTest_AssertCheck(l == i, "Verify length of returned value is %d, got: %d", i, l); + SDL_free(result); + } + } + + /* Negative cases */ + for (i = -2; i <= 0; i++) { + result = SDLTest_GenerateRunSeed((const int)i); + SDLTest_AssertPass("Call to SDLTest_GenerateRunSeed()"); + SDLTest_AssertCheck(result == NULL, "Verify returned value is not NULL"); + } + + return TEST_COMPLETED; +} + /** * @brief Calls to SDLTest_GetFuzzerInvocationCount() */ @@ -60,35 +93,35 @@ sdltest_randomNumber(void *arg) result = (Sint64)SDLTest_RandomUint8(); umax = (1 << 8) - 1; SDLTest_AssertPass("Call to SDLTest_RandomUint8"); - SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result); + SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result); result = (Sint64)SDLTest_RandomSint8(); min = 0 - (1 << 7); max = (1 << 7) - 1; SDLTest_AssertPass("Call to SDLTest_RandomSint8"); - SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result); + SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result); result = (Sint64)SDLTest_RandomUint16(); umax = (1 << 16) - 1; SDLTest_AssertPass("Call to SDLTest_RandomUint16"); - SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result); + SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result); result = (Sint64)SDLTest_RandomSint16(); min = 0 - (1 << 15); max = (1 << 15) - 1; SDLTest_AssertPass("Call to SDLTest_RandomSint16"); - SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result); + SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result); result = (Sint64)SDLTest_RandomUint32(); umax = ((Uint64)1 << 32) - 1; SDLTest_AssertPass("Call to SDLTest_RandomUint32"); - SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result); + SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result); result = (Sint64)SDLTest_RandomSint32(); min = 0 - ((Sint64)1 << 31); max = ((Sint64)1 << 31) - 1; SDLTest_AssertPass("Call to SDLTest_RandomSint32"); - SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result); + SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result); uresult = SDLTest_RandomUint64(); SDLTest_AssertPass("Call to SDLTest_RandomUint64"); @@ -133,83 +166,83 @@ sdltest_randomBoundaryNumberUint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 0xff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 255, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomUintXBoundaryValue(0, 0xfe, SDL_FALSE) returns 0xff (no error) */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 254, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0xff, - "Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %lld", uresult); + "Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomUintXBoundaryValue(0, 0xff, SDL_FALSE) returns 0 (sets error) */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 255, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -243,83 +276,83 @@ sdltest_randomBoundaryNumberUint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 0xffff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomUintXBoundaryValue(0, 0xfffe, SDL_FALSE) returns 0xffff (no error) */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xfffe, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0xffff, - "Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %lld", uresult); + "Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomUintXBoundaryValue(0, 0xffff, SDL_FALSE) returns 0 (sets error) */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xffff, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -353,83 +386,83 @@ sdltest_randomBoundaryNumberUint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 0xffffffff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomUintXBoundaryValue(0, 0xfffffffe, SDL_FALSE) returns 0xffffffff (no error) */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xfffffffe, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0xffffffff, - "Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %lld", uresult); + "Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomUintXBoundaryValue(0, 0xffffffff, SDL_FALSE) returns 0 (sets error) */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xffffffff, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -463,83 +496,83 @@ sdltest_randomBoundaryNumberUint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 0xffffffffffffffff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, (Uint64)0xffffffffffffffffULL, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomUintXBoundaryValue(0, 0xfffffffffffffffe, SDL_FALSE) returns 0xffffffffffffffff (no error) */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, (Uint64)0xfffffffffffffffeULL, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == (Uint64)0xffffffffffffffffULL, - "Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %lld", uresult); + "Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomUintXBoundaryValue(0, 0xffffffffffffffff, SDL_FALSE) returns 0 (sets error) */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, (Uint64)0xffffffffffffffffULL, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -573,83 +606,83 @@ sdltest_randomBoundaryNumberSint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(SCHAR_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == SCHAR_MIN, - "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %lld", SCHAR_MIN, sresult); + "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, SDL_FALSE) returns SCHAR_MAX (no error) */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX -1, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == SCHAR_MAX, - "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %lld", SCHAR_MAX, sresult); + "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MAX, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (sets error) */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == SCHAR_MIN, - "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %lld", SCHAR_MIN, sresult); + "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -683,83 +716,83 @@ sdltest_randomBoundaryNumberSint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(SHRT_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE) returns SHRT_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == SHRT_MIN, - "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %lld", SHRT_MIN, sresult); + "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE) returns SHRT_MAX (no error) */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == SHRT_MAX, - "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %lld", SHRT_MAX, sresult); + "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MAX, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE) returns 0 (sets error) */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == SHRT_MIN, - "Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %lld", SHRT_MIN, sresult); + "Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -800,83 +833,83 @@ sdltest_randomBoundaryNumberSint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(LONG_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE) returns LONG_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == long_min, - "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", long_min, sresult); + "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX - 1, SDL_FALSE) returns LONG_MAX (no error) */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max - 1, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == long_max, - "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %lld", long_max, sresult); + "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_max, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX, SDL_FALSE) returns 0 (sets error) */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == long_min, - "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", long_min, sresult); + "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -910,83 +943,83 @@ sdltest_randomBoundaryNumberSint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(LLONG_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE) returns LLONG_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == LLONG_MIN, - "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %lld, got: %lld", LLONG_MIN, sresult); + "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX - 1, SDL_FALSE) returns LLONG_MAX (no error) */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN, LLONG_MAX - 1, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == LLONG_MAX, - "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %lld, got: %lld", LLONG_MAX, sresult); + "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MAX, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX, SDL_FALSE) returns 0 (sets error) */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN, LLONG_MAX, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == LLONG_MIN, - "Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %lld, got: %lld", LLONG_MIN, sresult); + "Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -1043,7 +1076,7 @@ sdltest_randomIntegerInRange(void *arg) max = 0; result = SDLTest_RandomIntegerInRange(min, max); SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(0,0)"); - SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %d", min, max, result); + SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %d", result); /* Swapped min-max */ min = (Sint32)SDLTest_RandomSint16(); @@ -1263,11 +1296,14 @@ static const SDLTest_TestCaseReference sdltestTest13 = static const SDLTest_TestCaseReference sdltestTest14 = { (SDLTest_TestCaseFp)sdltest_randomAsciiStringOfSize, "sdltest_randomAsciiStringOfSize", "Calls to fixed size ASCII string generator", TEST_ENABLED }; +static const SDLTest_TestCaseReference sdltestTest15 = + { (SDLTest_TestCaseFp)sdltest_generateRunSeed, "sdltest_generateRunSeed", "Checks internal harness function SDLTest_GenerateRunSeed", TEST_ENABLED }; + /* Sequence of SDL_test test cases */ static const SDLTest_TestCaseReference *sdltestTests[] = { &sdltestTest1, &sdltestTest2, &sdltestTest3, &sdltestTest4, &sdltestTest5, &sdltestTest6, &sdltestTest7, &sdltestTest8, &sdltestTest9, &sdltestTest10, &sdltestTest11, &sdltestTest12, - &sdltestTest13, &sdltestTest14, NULL + &sdltestTest13, &sdltestTest14, &sdltestTest15, NULL }; /* SDL_test test suite (global) */ diff --git a/3rdparty/sdl2-2.0.4/test/testautomation_stdlib.c b/3rdparty/sdl2-2.0.4/test/testautomation_stdlib.c new file mode 100644 index 0000000000..89245fdcb6 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testautomation_stdlib.c @@ -0,0 +1,279 @@ +/** + * Standard C library routine test suite + */ + +#include + +#include "SDL.h" +#include "SDL_test.h" + + +/* Test case functions */ + +/** + * @brief Call to SDL_strlcpy + */ +#undef SDL_strlcpy +int +stdlib_strlcpy(void *arg) +{ + size_t result; + char text[1024]; + const char *expected; + + result = SDL_strlcpy(text, "foo", sizeof(text)); + expected = "foo"; + SDLTest_AssertPass("Call to SDL_strlcpy(\"foo\")"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_strlcpy(text, "foo", 2); + expected = "f"; + SDLTest_AssertPass("Call to SDL_strlcpy(\"foo\") with buffer size 2"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == 3, "Check result value, expected: 3, got: %d", result); + + return TEST_COMPLETED; +} + +/** + * @brief Call to SDL_snprintf + */ +#undef SDL_snprintf +int +stdlib_snprintf(void *arg) +{ + int result; + char text[1024]; + const char *expected; + + result = SDL_snprintf(text, sizeof(text), "%s", "foo"); + expected = "foo"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%s\", \"foo\")"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, 2, "%s", "foo"); + expected = "f"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%s\", \"foo\") with buffer size 2"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == 3, "Check result value, expected: 3, got: %d", result); + + result = SDL_snprintf(NULL, 0, "%s", "foo"); + SDLTest_AssertCheck(result == 3, "Check result value, expected: 3, got: %d", result); + + result = SDL_snprintf(text, sizeof(text), "%f", 1.0); + expected = "1.000000"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%f\", 1.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%.f", 1.0); + expected = "1"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%.f\", 1.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%#.f", 1.0); + expected = "1."; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%#.f\", 1.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%f", 1.0 + 1.0 / 3.0); + expected = "1.333333"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%+f", 1.0 + 1.0 / 3.0); + expected = "+1.333333"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%+f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%.2f", 1.0 + 1.0 / 3.0); + expected = "1.33"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%.2f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%6.2f", 1.0 + 1.0 / 3.0); + expected = " 1.33"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%6.2f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%06.2f", 1.0 + 1.0 / 3.0); + expected = "001.33"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%06.2f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, 5, "%06.2f", 1.0 + 1.0 / 3.0); + expected = "001."; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%06.2f\", 1.0 + 1.0 / 3.0) with buffer size 5"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text); + SDLTest_AssertCheck(result == 6, "Check result value, expected: 6, got: %d", result); + + return TEST_COMPLETED; +} + +/** + * @brief Call to SDL_getenv and SDL_setenv + */ +int +stdlib_getsetenv(void *arg) +{ + const int nameLen = 16; + char name[17]; + int counter; + int result; + char * value1; + char * value2; + char * expected; + int overwrite; + char * text; + + /* Create a random name. This tests SDL_getenv, since we need to */ + /* make sure the variable is not set yet (it shouldn't). */ + do { + for(counter = 0; counter < nameLen; counter++) { + name[counter] = (char)SDLTest_RandomIntegerInRange(65, 90); + } + name[nameLen] = '\0'; + + text = SDL_getenv(name); + SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + if (text != NULL) { + SDLTest_Log("Expected: NULL, Got: '%s' (%i)", text, SDL_strlen(text)); + } + } while (text != NULL); + + /* Create random values to set */ + value1 = SDLTest_RandomAsciiStringOfSize(10); + value2 = SDLTest_RandomAsciiStringOfSize(10); + + /* Set value 1 without overwrite */ + overwrite = 0; + expected = value1; + result = SDL_setenv(name, value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite); + SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); + + /* Check value */ + text = SDL_getenv(name); + SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); + if (text != NULL) { + SDLTest_AssertCheck( + SDL_strcmp(text, expected) == 0, + "Verify returned text, expected: %s, got: %s", + expected, + text); + } + + /* Set value 2 with overwrite */ + overwrite = 1; + expected = value2; + result = SDL_setenv(name, value2, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value2, overwrite); + SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); + + /* Check value */ + text = SDL_getenv(name); + SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); + if (text != NULL) { + SDLTest_AssertCheck( + SDL_strcmp(text, expected) == 0, + "Verify returned text, expected: %s, got: %s", + expected, + text); + } + + /* Set value 1 without overwrite */ + overwrite = 0; + expected = value2; + result = SDL_setenv(name, value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite); + SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); + + /* Check value */ + text = SDL_getenv(name); + SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); + if (text != NULL) { + SDLTest_AssertCheck( + SDL_strcmp(text, expected) == 0, + "Verify returned text, expected: %s, got: %s", + expected, + text); + } + + /* Set value 1 without overwrite */ + overwrite = 1; + expected = value1; + result = SDL_setenv(name, value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite); + SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); + + /* Check value */ + text = SDL_getenv(name); + SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); + if (text != NULL) { + SDLTest_AssertCheck( + SDL_strcmp(text, expected) == 0, + "Verify returned text, expected: %s, got: %s", + expected, + text); + } + + /* Negative cases */ + for (overwrite=0; overwrite <= 1; overwrite++) { + result = SDL_setenv(NULL, value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv(NULL,'%s', %i)", value1, overwrite); + SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); + result = SDL_setenv("", value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('','%s', %i)", value1, overwrite); + SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); + result = SDL_setenv("=", value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('=','%s', %i)", value1, overwrite); + SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); + result = SDL_setenv(name, NULL, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s', NULL, %i)", name, overwrite); + SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); + } + + /* Clean up */ + SDL_free(value1); + SDL_free(value2); + + return TEST_COMPLETED; +} + +/* ================= Test References ================== */ + +/* Standard C routine test cases */ +static const SDLTest_TestCaseReference stdlibTest1 = + { (SDLTest_TestCaseFp)stdlib_strlcpy, "stdlib_strlcpy", "Call to SDL_strlcpy", TEST_ENABLED }; + +static const SDLTest_TestCaseReference stdlibTest2 = + { (SDLTest_TestCaseFp)stdlib_snprintf, "stdlib_snprintf", "Call to SDL_snprintf", TEST_ENABLED }; + +static const SDLTest_TestCaseReference stdlibTest3 = + { (SDLTest_TestCaseFp)stdlib_getsetenv, "stdlib_getsetenv", "Call to SDL_getenv and SDL_setenv", TEST_ENABLED }; + +/* Sequence of Standard C routine test cases */ +static const SDLTest_TestCaseReference *stdlibTests[] = { + &stdlibTest1, &stdlibTest2, &stdlibTest3, NULL +}; + +/* Timer test suite (global) */ +SDLTest_TestSuiteReference stdlibTestSuite = { + "Stdlib", + NULL, + stdlibTests, + NULL +}; diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_suites.h b/3rdparty/sdl2-2.0.4/test/testautomation_suites.h similarity index 92% rename from 3rdparty/sdl2-2.0.0/test/testautomation_suites.h rename to 3rdparty/sdl2-2.0.4/test/testautomation_suites.h index 695681b13b..b5f921e3da 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_suites.h +++ b/3rdparty/sdl2-2.0.4/test/testautomation_suites.h @@ -8,7 +8,7 @@ #include "SDL_test.h" -// Test collections +/* Test collections */ extern SDLTest_TestSuiteReference audioTestSuite; extern SDLTest_TestSuiteReference clipboardTestSuite; extern SDLTest_TestSuiteReference eventsTestSuite; @@ -26,8 +26,9 @@ extern SDLTest_TestSuiteReference surfaceTestSuite; extern SDLTest_TestSuiteReference syswmTestSuite; extern SDLTest_TestSuiteReference timerTestSuite; extern SDLTest_TestSuiteReference videoTestSuite; +extern SDLTest_TestSuiteReference hintsTestSuite; -// All test suites +/* All test suites */ SDLTest_TestSuiteReference *testSuites[] = { &audioTestSuite, &clipboardTestSuite, @@ -46,6 +47,7 @@ SDLTest_TestSuiteReference *testSuites[] = { &syswmTestSuite, &timerTestSuite, &videoTestSuite, + &hintsTestSuite, NULL }; diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_surface.c b/3rdparty/sdl2-2.0.4/test/testautomation_surface.c similarity index 93% rename from 3rdparty/sdl2-2.0.0/test/testautomation_surface.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_surface.c index 3f6c56c9af..ca41d4a0cd 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_surface.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_surface.c @@ -8,11 +8,18 @@ #define _CRT_NONSTDC_NO_DEPRECATE #include +#ifndef _MSC_VER +#include +#endif #include #include "SDL.h" #include "SDL_test.h" +#ifdef __MACOSX__ +#include /* For unlink() */ +#endif + /* ================= Test Case Implementation ================== */ /* Shared test surface */ @@ -63,14 +70,10 @@ _surfaceSetUp(void *arg) void _surfaceTearDown(void *arg) { - if (referenceSurface != NULL) { - SDL_FreeSurface(referenceSurface); - referenceSurface = NULL; - } - if (testSurface != NULL) { - SDL_FreeSurface(testSurface); - testSurface = NULL; - } + SDL_FreeSurface(referenceSurface); + referenceSurface = NULL; + SDL_FreeSurface(testSurface); + testSurface = NULL; } /** @@ -193,10 +196,8 @@ void _testBlitBlendMode(int mode) SDLTest_AssertCheck(checkFailCount4 == 0, "Validate results from calls to SDL_SetSurfaceBlendMode, expected: 0, got: %i", checkFailCount4); /* Clean up */ - if (face != NULL) { - SDL_FreeSurface(face); - face = NULL; - } + SDL_FreeSurface(face); + face = NULL; } /* Helper to check that a file exists */ @@ -250,19 +251,15 @@ surface_testSaveLoadBitmap(void *arg) unlink(sampleFilename); /* Clean up */ - if (face != NULL) { SDL_FreeSurface(face); face = NULL; - } - if (rface != NULL) { SDL_FreeSurface(rface); rface = NULL; - } return TEST_COMPLETED; } -/*! +/* ! * Tests surface conversion. */ int @@ -294,20 +291,16 @@ surface_testSurfaceConversion(void *arg) SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ - if (face != NULL) { - SDL_FreeSurface( face ); - face = NULL; - } - if (rface != NULL) { - SDL_FreeSurface( rface ); - rface = NULL; - } + SDL_FreeSurface(face); + face = NULL; + SDL_FreeSurface(rface); + rface = NULL; return TEST_COMPLETED; } -/*! +/* ! * Tests surface conversion across all pixel formats. */ int @@ -360,8 +353,6 @@ surface_testCompleteSurfaceConversion(void *arg) for ( i = 0; i < SDL_arraysize(pixel_formats); ++i ) { for ( j = 0; j < SDL_arraysize(pixel_formats); ++j ) { - /*printf("Converting %s -> %s\n", SDL_GetPixelFormatName(pixel_formats[i]), SDL_GetPixelFormatName(pixel_formats[j]));*/ - fmt1 = SDL_AllocFormat(pixel_formats[i]); SDL_assert(fmt1 != NULL); cvt1 = SDL_ConvertSurface(face, fmt1, 0); @@ -429,9 +420,7 @@ surface_testBlit(void *arg) SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); - } + SDL_FreeSurface(compareSurface); return TEST_COMPLETED; } @@ -454,9 +443,7 @@ surface_testBlitColorMod(void *arg) SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); - } + SDL_FreeSurface(compareSurface); return TEST_COMPLETED; } @@ -479,9 +466,7 @@ surface_testBlitAlphaMod(void *arg) SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); - } + SDL_FreeSurface(compareSurface); return TEST_COMPLETED; } @@ -505,9 +490,7 @@ surface_testBlitBlendNone(void *arg) SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); - } + SDL_FreeSurface(compareSurface); return TEST_COMPLETED; } @@ -530,9 +513,7 @@ surface_testBlitBlendBlend(void *arg) SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); - } + SDL_FreeSurface(compareSurface); return TEST_COMPLETED; } @@ -555,9 +536,7 @@ surface_testBlitBlendAdd(void *arg) SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); - } + SDL_FreeSurface(compareSurface); return TEST_COMPLETED; } @@ -580,9 +559,7 @@ surface_testBlitBlendMod(void *arg) SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); - } + SDL_FreeSurface(compareSurface); return TEST_COMPLETED; } @@ -605,9 +582,7 @@ surface_testBlitBlendLoop(void *arg) { SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface(compareSurface); - } + SDL_FreeSurface(compareSurface); return TEST_COMPLETED; @@ -642,7 +617,7 @@ static const SDLTest_TestCaseReference surfaceTest8 = /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest9 = - { (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blittin routines with verious blending modes", TEST_DISABLED}; + { (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blitting routines with various blending modes", TEST_DISABLED}; /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest10 = diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_syswm.c b/3rdparty/sdl2-2.0.4/test/testautomation_syswm.c similarity index 96% rename from 3rdparty/sdl2-2.0.0/test/testautomation_syswm.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_syswm.c index 3e368f63ea..d9fd982b37 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_syswm.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_syswm.c @@ -32,7 +32,7 @@ syswm_getWindowWMInfo(void *arg) /* Make call */ result = SDL_GetWindowWMInfo(window, &info); - SDLTest_AssertPass("Call to SDL_GetWindowWMInfo"); + SDLTest_AssertPass("Call to SDL_GetWindowWMInfo()"); SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information"); SDL_DestroyWindow(window); diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_timer.c b/3rdparty/sdl2-2.0.4/test/testautomation_timer.c similarity index 98% rename from 3rdparty/sdl2-2.0.0/test/testautomation_timer.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_timer.c index ddf6a5f299..6d73856ee2 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_timer.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_timer.c @@ -42,7 +42,7 @@ timer_getPerformanceCounter(void *arg) result = SDL_GetPerformanceCounter(); SDLTest_AssertPass("Call to SDL_GetPerformanceCounter()"); - SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %lu", result); + SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %"SDL_PRIu64, result); return TEST_COMPLETED; } @@ -57,7 +57,7 @@ timer_getPerformanceFrequency(void *arg) result = SDL_GetPerformanceFrequency(); SDLTest_AssertPass("Call to SDL_GetPerformanceFrequency()"); - SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %lu", result); + SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %"SDL_PRIu64, result); return TEST_COMPLETED; } diff --git a/3rdparty/sdl2-2.0.0/test/testautomation_video.c b/3rdparty/sdl2-2.0.4/test/testautomation_video.c similarity index 98% rename from 3rdparty/sdl2-2.0.0/test/testautomation_video.c rename to 3rdparty/sdl2-2.0.4/test/testautomation_video.c index 46061090e6..7b86cfba90 100644 --- a/3rdparty/sdl2-2.0.0/test/testautomation_video.c +++ b/3rdparty/sdl2-2.0.4/test/testautomation_video.c @@ -51,7 +51,7 @@ void _destroyVideoSuiteTestWindow(SDL_Window *window) if (window != NULL) { SDL_DestroyWindow(window); window = NULL; - SDLTest_AssertPass("Call to SDL_DestroyWindow"); + SDLTest_AssertPass("Call to SDL_DestroyWindow()"); } } @@ -342,7 +342,7 @@ video_getWindowFlags(void *arg) window = _createVideoSuiteTestWindow(title); if (window != NULL) { actualFlags = SDL_GetWindowFlags(window); - SDLTest_AssertPass("Call to SDL_GetWindowFlags"); + SDLTest_AssertPass("Call to SDL_GetWindowFlags()"); SDLTest_AssertCheck((flags & actualFlags) == flags, "Verify returned value has flags %d set, got: %d", flags, actualFlags); } @@ -364,7 +364,7 @@ video_getNumDisplayModes(void *arg) /* Get number of displays */ displayNum = SDL_GetNumVideoDisplays(); - SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays"); + SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()"); /* Make call for each display */ for (i=0; i= 0.0 && result <= 1.0, "Validate range of result value; expected: [0.0, 1.0], got: %f", result); } @@ -541,7 +541,6 @@ video_getWindowBrightnessNegative(void *arg) { const char *invalidWindowError = "Invalid window"; char *lastError; - const char* title = "video_getWindowBrightnessNegative Test Window"; float result; /* Call against invalid window */ @@ -583,7 +582,7 @@ video_getWindowDisplayMode(void *arg) window = _createVideoSuiteTestWindow(title); if (window != NULL) { result = SDL_GetWindowDisplayMode(window, &mode); - SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode"); + SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode()"); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0, got: %d", result); SDLTest_AssertCheck(mode.w > 0, "Validate mode.w content; expected: >0, got: %d", mode.w); SDLTest_AssertCheck(mode.h > 0, "Validate mode.h content; expected: >0, got: %d", mode.h); @@ -728,7 +727,6 @@ video_getWindowGammaRamp(void *arg) int video_getWindowGammaRampNegative(void *arg) { - const char* title = "video_getWindowGammaRampNegative Test Window"; Uint16 red[256]; Uint16 green[256]; Uint16 blue[256]; @@ -740,7 +738,7 @@ video_getWindowGammaRampNegative(void *arg) /* Call against invalid window */ result = SDL_GetWindowGammaRamp(NULL, red, green, blue); SDLTest_AssertPass("Call to SDL_GetWindowGammaRamp(window=NULL,r,g,b)"); - SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %f", result); + SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %i", result); _checkInvalidWindowError(); return TEST_COMPLETED; @@ -876,7 +874,7 @@ video_getWindowId(void *arg) /* Clean up */ _destroyVideoSuiteTestWindow(window); - /* Get window from ID for closed window*/ + /* Get window from ID for closed window */ result = SDL_GetWindowFromID(id); SDLTest_AssertPass("Call to SDL_GetWindowID(%d/closed_window)", id); SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); @@ -1524,10 +1522,10 @@ video_getSetWindowData(void *arg) const char *referenceName2 = "TestName2"; const char *name2 = "TestName2"; int datasize; - char *referenceUserdata; - char *userdata; - char *referenceUserdata2; - char *userdata2; + char *referenceUserdata = NULL; + char *userdata = NULL; + char *referenceUserdata2 = NULL; + char *userdata2 = NULL; char *result; int iteration; @@ -1619,7 +1617,7 @@ video_getSetWindowData(void *arg) /* Set data with NULL to clear */ result = (char *)SDL_SetWindowData(window, name, NULL); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name, userdata); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); @@ -1627,7 +1625,7 @@ video_getSetWindowData(void *arg) /* Set data with NULL to clear again */ result = (char *)SDL_SetWindowData(window, name, NULL); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name, userdata); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); @@ -1714,10 +1712,10 @@ video_getSetWindowData(void *arg) _destroyVideoSuiteTestWindow(window); cleanup: - if (referenceUserdata != NULL) SDL_free(referenceUserdata); - if (referenceUserdata2 != NULL) SDL_free(referenceUserdata2); - if (userdata != NULL) SDL_free(userdata); - if (userdata2 != NULL) SDL_free(userdata2); + SDL_free(referenceUserdata); + SDL_free(referenceUserdata2); + SDL_free(userdata); + SDL_free(userdata2); return returnValue; } diff --git a/3rdparty/sdl2-2.0.4/test/testdisplayinfo.c b/3rdparty/sdl2-2.0.4/test/testdisplayinfo.c new file mode 100644 index 0000000000..c228eb6b2d --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testdisplayinfo.c @@ -0,0 +1,89 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Program to test querying of display info */ + +#include "SDL.h" + +#include +#include + +static void +print_mode(const char *prefix, const SDL_DisplayMode *mode) +{ + if (!mode) + return; + + SDL_Log("%s: fmt=%s w=%d h=%d refresh=%d\n", + prefix, SDL_GetPixelFormatName(mode->format), + mode->w, mode->h, mode->refresh_rate); +} + +int +main(int argc, char *argv[]) +{ + SDL_DisplayMode mode; + int num_displays, dpy; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 1; + } + + SDL_Log("Using video target '%s'.\n", SDL_GetCurrentVideoDriver()); + num_displays = SDL_GetNumVideoDisplays(); + + SDL_Log("See %d displays.\n", num_displays); + + for (dpy = 0; dpy < num_displays; dpy++) { + const int num_modes = SDL_GetNumDisplayModes(dpy); + SDL_Rect rect = { 0, 0, 0, 0 }; + int m; + + SDL_GetDisplayBounds(dpy, &rect); + SDL_Log("%d: \"%s\" (%dx%d, (%d, %d)), %d modes.\n", dpy, SDL_GetDisplayName(dpy), rect.w, rect.h, rect.x, rect.y, num_modes); + + if (SDL_GetCurrentDisplayMode(dpy, &mode) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, " CURRENT: failed to query (%s)\n", SDL_GetError()); + } else { + print_mode("CURRENT", &mode); + } + + if (SDL_GetDesktopDisplayMode(dpy, &mode) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, " DESKTOP: failed to query (%s)\n", SDL_GetError()); + } else { + print_mode("DESKTOP", &mode); + } + + for (m = 0; m < num_modes; m++) { + if (SDL_GetDisplayMode(dpy, m, &mode) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, " MODE %d: failed to query (%s)\n", m, SDL_GetError()); + } else { + char prefix[64]; + SDL_snprintf(prefix, sizeof (prefix), " MODE %d", m); + print_mode(prefix, &mode); + } + } + + SDL_Log("\n"); + } + + SDL_Quit(); + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ + diff --git a/3rdparty/sdl2-2.0.0/test/testdraw2.c b/3rdparty/sdl2-2.0.4/test/testdraw2.c similarity index 87% rename from 3rdparty/sdl2-2.0.0/test/testdraw2.c rename to 3rdparty/sdl2-2.0.4/test/testdraw2.c index a4509fe749..77bd8c1fe6 100644 --- a/3rdparty/sdl2-2.0.0/test/testdraw2.c +++ b/3rdparty/sdl2-2.0.4/test/testdraw2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -16,6 +16,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" #define NUM_OBJECTS 100 @@ -29,6 +33,8 @@ static int current_alpha = 255; static int current_color = 255; static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; +int done; + void DrawPoints(SDL_Renderer * renderer) { @@ -169,13 +175,45 @@ DrawRects(SDL_Renderer * renderer) } } +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + if (state->windows[i] == NULL) + continue; + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + + DrawRects(renderer); + DrawLines(renderer); + DrawPoints(renderer); + + SDL_RenderPresent(renderer); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - int i, done; - SDL_Event event; + int i; Uint32 then, now, frames; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Initialize parameters */ num_objects = NUM_OBJECTS; @@ -218,8 +256,7 @@ main(int argc, char *argv[]) } } if (consumed < 0) { - fprintf(stderr, - "Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n", + SDL_Log("Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n", argv[0], SDLTest_CommonUsage(state)); return 1; } @@ -243,24 +280,16 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); + loop(); } - for (i = 0; i < state->num_windows; ++i) { - SDL_Renderer *renderer = state->renderers[i]; - SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); - SDL_RenderClear(renderer); +#endif - DrawRects(renderer); - DrawLines(renderer); - DrawPoints(renderer); - - SDL_RenderPresent(renderer); - } - } SDLTest_CommonQuit(state); @@ -268,7 +297,7 @@ main(int argc, char *argv[]) now = SDL_GetTicks(); if (now > then) { double fps = ((double) frames * 1000) / (now - then); - printf("%2.2f frames per second\n", fps); + SDL_Log("%2.2f frames per second\n", fps); } return 0; } diff --git a/3rdparty/sdl2-2.0.4/test/testdrawchessboard.c b/3rdparty/sdl2-2.0.4/test/testdrawchessboard.c new file mode 100644 index 0000000000..f2a1469d47 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testdrawchessboard.c @@ -0,0 +1,135 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. + + This file is created by : Nitin Jain (nitin.j4@samsung.com) +*/ + +/* Sample program: Draw a Chess Board by using SDL_CreateSoftwareRenderer API */ + +#include +#include + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "SDL.h" + +SDL_Window *window; +SDL_Renderer *renderer; +int done; + +void +DrawChessBoard(SDL_Renderer * renderer) +{ + int row = 0,column = 0,x = 0; + SDL_Rect rect, darea; + + /* Get the Size of drawing surface */ + SDL_RenderGetViewport(renderer, &darea); + + for( ; row < 8; row++) + { + column = row%2; + x = column; + for( ; column < 4+(row%2); column++) + { + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0xFF); + + rect.w = darea.w/8; + rect.h = darea.h/8; + rect.x = x * rect.w; + rect.y = row * rect.h; + x = x + 2; + SDL_RenderFillRect(renderer, &rect); + } + } +} + +void +loop() +{ + SDL_Event e; + while (SDL_PollEvent(&e)) { + if (e.type == SDL_QUIT) { + done = 1; +#ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); +#endif + return; + } + + if ((e.type == SDL_KEYDOWN) && (e.key.keysym.sym == SDLK_ESCAPE)) { + done = 1; +#ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); +#endif + return; + } + } + + DrawChessBoard(renderer); + + /* Got everything on rendering surface, + now Update the drawing image on window screen */ + SDL_UpdateWindowSurface(window); +} + +int +main(int argc, char *argv[]) +{ + SDL_Surface *surface; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Initialize SDL */ + if(SDL_Init(SDL_INIT_VIDEO) != 0) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init fail : %s\n", SDL_GetError()); + return 1; + } + + + /* Create window and renderer for given surface */ + window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN); + if(!window) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Window creation fail : %s\n",SDL_GetError()); + return 1; + } + surface = SDL_GetWindowSurface(window); + renderer = SDL_CreateSoftwareRenderer(surface); + if(!renderer) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Render creation for surface fail : %s\n",SDL_GetError()); + return 1; + } + + /* Clear the rendering surface with the specified color */ + SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); + SDL_RenderClear(renderer); + + + /* Draw the Image on rendering surface */ + done = 0; +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); + } +#endif + + SDL_Quit(); + return 0; +} + diff --git a/3rdparty/sdl2-2.0.4/test/testdropfile.c b/3rdparty/sdl2-2.0.4/test/testdropfile.c new file mode 100644 index 0000000000..b7f215ee81 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testdropfile.c @@ -0,0 +1,93 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +#include +#include + +#include "SDL_test_common.h" + +static SDLTest_CommonState *state; + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDLTest_CommonQuit(state); + exit(rc); +} + +int +main(int argc, char *argv[]) +{ + int i, done; + SDL_Event event; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Initialize test framework */ + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + return 1; + } + + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + /* needed voodoo to allow app to launch via OS X Finder */ + if (SDL_strncmp(argv[i], "-psn", 4)==0) { + consumed = 1; + } + if (consumed == 0) { + consumed = -1; + } + if (consumed < 0) { + SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); + quit(1); + } + i += consumed; + } + if (!SDLTest_CommonInit(state)) { + quit(2); + } + + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); + } + + SDL_EventState(SDL_DROPFILE, SDL_ENABLE); + + /* Main render loop */ + done = 0; + while (!done) { + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + + if (event.type == SDL_DROPFILE) { + char *dropped_filedir = event.drop.file; + SDL_Log("File dropped on window: %s", dropped_filedir); + SDL_free(dropped_filedir); + } + } + } + + quit(0); + /* keep the compiler happy ... */ + return(0); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/3rdparty/sdl2-2.0.4/test/testerror.c b/3rdparty/sdl2-2.0.4/test/testerror.c new file mode 100644 index 0000000000..b5fa3fbc08 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testerror.c @@ -0,0 +1,77 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Simple test of the SDL threading code and error handling */ + +#include +#include +#include + +#include "SDL.h" + +static int alive = 0; + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDL_Quit(); + exit(rc); +} + +int SDLCALL +ThreadFunc(void *data) +{ + /* Set the child thread error string */ + SDL_SetError("Thread %s (%lu) had a problem: %s", + (char *) data, SDL_ThreadID(), "nevermind"); + while (alive) { + SDL_Log("Thread '%s' is alive!\n", (char *) data); + SDL_Delay(1 * 1000); + } + SDL_Log("Child thread error string: %s\n", SDL_GetError()); + return (0); +} + +int +main(int argc, char *argv[]) +{ + SDL_Thread *thread; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(0) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return (1); + } + + /* Set the error value for the main thread */ + SDL_SetError("No worries"); + + alive = 1; + thread = SDL_CreateThread(ThreadFunc, NULL, "#1"); + if (thread == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); + quit(1); + } + SDL_Delay(5 * 1000); + SDL_Log("Waiting for thread #1\n"); + alive = 0; + SDL_WaitThread(thread, NULL); + + SDL_Log("Main thread error string: %s\n", SDL_GetError()); + + SDL_Quit(); + return (0); +} diff --git a/3rdparty/sdl2-2.0.0/test/testfile.c b/3rdparty/sdl2-2.0.4/test/testfile.c similarity index 95% rename from 3rdparty/sdl2-2.0.0/test/testfile.c rename to 3rdparty/sdl2-2.0.4/test/testfile.c index d82d0eb7c4..b45795f630 100644 --- a/3rdparty/sdl2-2.0.0/test/testfile.c +++ b/3rdparty/sdl2-2.0.4/test/testfile.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -12,7 +12,7 @@ /* sanity tests on SDL_rwops.c (usefull for alternative implementations of stdio rwops) */ -// quiet windows compiler warnings +/* quiet windows compiler warnings */ #define _CRT_NONSTDC_NO_WARNINGS #include @@ -22,7 +22,6 @@ #endif #include "SDL.h" -#include "SDL_endian.h" #include @@ -44,7 +43,6 @@ static void cleanup(void) { - unlink(FBASENAME1); unlink(FBASENAME2); } @@ -52,8 +50,7 @@ cleanup(void) static void rwops_error_quit(unsigned line, SDL_RWops * rwops) { - - printf("testfile.c(%d): failed\n", line); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "testfile.c(%d): failed\n", line); if (rwops) { rwops->close(rwops); /* This calls SDL_FreeRW(rwops); */ } @@ -71,6 +68,9 @@ main(int argc, char *argv[]) SDL_RWops *rwops = NULL; char test_buf[30]; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + cleanup(); /* test 1 : basic argument test: all those calls to SDL_RWFromFile should fail */ @@ -90,7 +90,7 @@ main(int argc, char *argv[]) rwops = SDL_RWFromFile("something", NULL); if (rwops) RWOP_ERR_QUIT(rwops); - printf("test1 OK\n"); + SDL_Log("test1 OK\n"); /* test 2 : check that inexistent file is not successfully opened/created when required */ /* modes : r, r+ imply that file MUST exist @@ -123,7 +123,7 @@ main(int argc, char *argv[]) RWOP_ERR_QUIT(rwops); rwops->close(rwops); unlink(FBASENAME2); - printf("test2 OK\n"); + SDL_Log("test2 OK\n"); /* test 3 : creation, writing , reading, seeking, test : w mode, r mode, w+ mode @@ -201,7 +201,7 @@ main(int argc, char *argv[]) if (SDL_memcmp(test_buf, "12345678901234567890", 20)) RWOP_ERR_QUIT(rwops); rwops->close(rwops); - printf("test3 OK\n"); + SDL_Log("test3 OK\n"); /* test 4: same in r+ mode */ rwops = SDL_RWFromFile(FBASENAME1, "rb+"); /* write + read + file must exists, no truncation */ @@ -236,7 +236,7 @@ main(int argc, char *argv[]) if (SDL_memcmp(test_buf, "12345678901234567890", 20)) RWOP_ERR_QUIT(rwops); rwops->close(rwops); - printf("test4 OK\n"); + SDL_Log("test4 OK\n"); /* test5 : append mode */ rwops = SDL_RWFromFile(FBASENAME1, "ab+"); /* write + read + append */ @@ -277,7 +277,7 @@ main(int argc, char *argv[]) if (SDL_memcmp(test_buf, "123456789012345678901234567123", 30)) RWOP_ERR_QUIT(rwops); rwops->close(rwops); - printf("test5 OK\n"); + SDL_Log("test5 OK\n"); cleanup(); return 0; /* all ok */ } diff --git a/3rdparty/sdl2-2.0.4/test/testfilesystem.c b/3rdparty/sdl2-2.0.4/test/testfilesystem.c new file mode 100644 index 0000000000..abd301c0e0 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testfilesystem.c @@ -0,0 +1,52 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +/* Simple test of filesystem functions. */ + +#include +#include "SDL.h" + +int +main(int argc, char *argv[]) +{ + char *base_path; + char *pref_path; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (SDL_Init(0) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init() failed: %s\n", SDL_GetError()); + return 1; + } + + base_path = SDL_GetBasePath(); + if(base_path == NULL){ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find base path: %s\n", + SDL_GetError()); + return 0; + } + + SDL_Log("base path: '%s'\n", base_path); + SDL_free(base_path); + + pref_path = SDL_GetPrefPath("libsdl", "testfilesystem"); + if(pref_path == NULL){ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path: %s\n", + SDL_GetError()); + return 0; + } + SDL_Log("pref path: '%s'\n", pref_path); + SDL_free(pref_path); + + SDL_Quit(); + return 0; +} diff --git a/3rdparty/sdl2-2.0.4/test/testgamecontroller.c b/3rdparty/sdl2-2.0.4/test/testgamecontroller.c new file mode 100644 index 0000000000..ec1dfd3229 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testgamecontroller.c @@ -0,0 +1,348 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Simple program to test the SDL game controller routines */ + +#include +#include +#include + +#include "SDL.h" + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#ifndef SDL_JOYSTICK_DISABLED + +#ifdef __IPHONEOS__ +#define SCREEN_WIDTH 480 +#define SCREEN_HEIGHT 320 +#else +#define SCREEN_WIDTH 512 +#define SCREEN_HEIGHT 317 +#endif + +/* This is indexed by SDL_GameControllerButton. */ +static const struct { int x; int y; } button_positions[] = { + {387, 167}, /* A */ + {431, 132}, /* B */ + {342, 132}, /* X */ + {389, 101}, /* Y */ + {174, 132}, /* BACK */ + {233, 132}, /* GUIDE */ + {289, 132}, /* START */ + {75, 154}, /* LEFTSTICK */ + {305, 230}, /* RIGHTSTICK */ + {77, 40}, /* LEFTSHOULDER */ + {396, 36}, /* RIGHTSHOULDER */ + {154, 188}, /* DPAD_UP */ + {154, 249}, /* DPAD_DOWN */ + {116, 217}, /* DPAD_LEFT */ + {186, 217}, /* DPAD_RIGHT */ +}; + +/* This is indexed by SDL_GameControllerAxis. */ +static const struct { int x; int y; double angle; } axis_positions[] = { + {75, 154, 0.0}, /* LEFTX */ + {75, 154, 90.0}, /* LEFTY */ + {305, 230, 0.0}, /* RIGHTX */ + {305, 230, 90.0}, /* RIGHTY */ + {91, 0, 90.0}, /* TRIGGERLEFT */ + {375, 0, 90.0}, /* TRIGGERRIGHT */ +}; + +SDL_Renderer *screen = NULL; +SDL_bool retval = SDL_FALSE; +SDL_bool done = SDL_FALSE; +SDL_Texture *background, *button, *axis; + +static SDL_Texture * +LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) +{ + SDL_Surface *temp = NULL; + SDL_Texture *texture = NULL; + + temp = SDL_LoadBMP(file); + if (temp == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError()); + } else { + /* Set transparent pixel as the pixel at (0,0) */ + if (transparent) { + if (temp->format->BytesPerPixel == 1) { + SDL_SetColorKey(temp, SDL_TRUE, *(Uint8 *)temp->pixels); + } else { + SDL_assert(!temp->format->palette); + SDL_assert(temp->format->BitsPerPixel == 24); + SDL_SetColorKey(temp, SDL_TRUE, (*(Uint32 *)temp->pixels) & 0x00FFFFFF); + } + } + + texture = SDL_CreateTextureFromSurface(renderer, temp); + if (!texture) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); + } + } + if (temp) { + SDL_FreeSurface(temp); + } + return texture; +} + +void +loop(void *arg) +{ + SDL_Event event; + int i; + SDL_GameController *gamecontroller = (SDL_GameController *)arg; + + /* blank screen, set up for drawing this frame. */ + SDL_SetRenderDrawColor(screen, 0xFF, 0xFF, 0xFF, SDL_ALPHA_OPAQUE); + SDL_RenderClear(screen); + SDL_RenderCopy(screen, background, NULL, NULL); + + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_KEYDOWN: + if (event.key.keysym.sym != SDLK_ESCAPE) { + break; + } + /* Fall through to signal quit */ + case SDL_QUIT: + done = SDL_TRUE; + break; + default: + break; + } + } + + /* Update visual controller state */ + for (i = 0; i < SDL_CONTROLLER_BUTTON_MAX; ++i) { + if (SDL_GameControllerGetButton(gamecontroller, (SDL_GameControllerButton)i) == SDL_PRESSED) { + const SDL_Rect dst = { button_positions[i].x, button_positions[i].y, 50, 50 }; + SDL_RenderCopyEx(screen, button, NULL, &dst, 0, NULL, 0); + } + } + + for (i = 0; i < SDL_CONTROLLER_AXIS_MAX; ++i) { + const Sint16 deadzone = 8000; /* !!! FIXME: real deadzone */ + const Sint16 value = SDL_GameControllerGetAxis(gamecontroller, (SDL_GameControllerAxis)(i)); + if (value < -deadzone) { + const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 }; + const double angle = axis_positions[i].angle; + SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0); + } else if (value > deadzone) { + const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 }; + const double angle = axis_positions[i].angle + 180.0; + SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0); + } + } + + SDL_RenderPresent(screen); + + if (!SDL_GameControllerGetAttached(gamecontroller)) { + done = SDL_TRUE; + retval = SDL_TRUE; /* keep going, wait for reattach. */ + } + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +SDL_bool +WatchGameController(SDL_GameController * gamecontroller) +{ + const char *name = SDL_GameControllerName(gamecontroller); + const char *basetitle = "Game Controller Test: "; + const size_t titlelen = SDL_strlen(basetitle) + SDL_strlen(name) + 1; + char *title = (char *)SDL_malloc(titlelen); + SDL_Window *window = NULL; + + retval = SDL_FALSE; + done = SDL_FALSE; + + if (title) { + SDL_snprintf(title, titlelen, "%s%s", basetitle, name); + } + + /* Create a window to display controller state */ + window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, + SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, + SCREEN_HEIGHT, 0); + if (window == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); + return SDL_FALSE; + } + + screen = SDL_CreateRenderer(window, -1, 0); + if (screen == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); + SDL_DestroyWindow(window); + return SDL_FALSE; + } + + SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0x00, SDL_ALPHA_OPAQUE); + SDL_RenderClear(screen); + SDL_RenderPresent(screen); + SDL_RaiseWindow(window); + + /* scale for platforms that don't give you the window size you asked for. */ + SDL_RenderSetLogicalSize(screen, SCREEN_WIDTH, SCREEN_HEIGHT); + + background = LoadTexture(screen, "controllermap.bmp", SDL_FALSE); + button = LoadTexture(screen, "button.bmp", SDL_TRUE); + axis = LoadTexture(screen, "axis.bmp", SDL_TRUE); + + if (!background || !button || !axis) { + SDL_DestroyRenderer(screen); + SDL_DestroyWindow(window); + return SDL_FALSE; + } + SDL_SetTextureColorMod(button, 10, 255, 21); + SDL_SetTextureColorMod(axis, 10, 255, 21); + + /* !!! FIXME: */ + /*SDL_RenderSetLogicalSize(screen, background->w, background->h);*/ + + /* Print info about the controller we are watching */ + SDL_Log("Watching controller %s\n", name ? name : "Unknown Controller"); + + /* Loop, getting controller events! */ +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop_arg(loop, gamecontroller, 0, 1); +#else + while (!done) { + loop(gamecontroller); + } +#endif + + SDL_DestroyRenderer(screen); + screen = NULL; + background = NULL; + button = NULL; + axis = NULL; + SDL_DestroyWindow(window); + return retval; +} + +int +main(int argc, char *argv[]) +{ + int i; + int nController = 0; + int retcode = 0; + char guid[64]; + SDL_GameController *gamecontroller; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Initialize SDL (Note: video is required to start event loop) */ + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER ) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 1; + } + + SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt"); + + /* Print information about the controller */ + for (i = 0; i < SDL_NumJoysticks(); ++i) { + const char *name; + const char *description; + + SDL_JoystickGetGUIDString(SDL_JoystickGetDeviceGUID(i), + guid, sizeof (guid)); + + if ( SDL_IsGameController(i) ) + { + nController++; + name = SDL_GameControllerNameForIndex(i); + description = "Controller"; + } else { + name = SDL_JoystickNameForIndex(i); + description = "Joystick"; + } + SDL_Log("%s %d: %s (guid %s)\n", description, i, name ? name : "Unknown", guid); + } + SDL_Log("There are %d game controller(s) attached (%d joystick(s))\n", nController, SDL_NumJoysticks()); + + if (argv[1]) { + SDL_bool reportederror = SDL_FALSE; + SDL_bool keepGoing = SDL_TRUE; + SDL_Event event; + int device = atoi(argv[1]); + if (device >= SDL_NumJoysticks()) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%i is an invalid joystick index.\n", device); + retcode = 1; + } else { + SDL_JoystickGetGUIDString(SDL_JoystickGetDeviceGUID(device), + guid, sizeof (guid)); + SDL_Log("Attempting to open device %i, guid %s\n", device, guid); + gamecontroller = SDL_GameControllerOpen(device); + + if (gamecontroller != NULL) { + SDL_assert(SDL_GameControllerFromInstanceID(SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(gamecontroller))) == gamecontroller); + } + + while (keepGoing) { + if (gamecontroller == NULL) { + if (!reportederror) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open gamecontroller %d: %s\n", device, SDL_GetError()); + retcode = 1; + keepGoing = SDL_FALSE; + reportederror = SDL_TRUE; + } + } else { + reportederror = SDL_FALSE; + keepGoing = WatchGameController(gamecontroller); + SDL_GameControllerClose(gamecontroller); + } + + gamecontroller = NULL; + if (keepGoing) { + SDL_Log("Waiting for attach\n"); + } + while (keepGoing) { + SDL_WaitEvent(&event); + if ((event.type == SDL_QUIT) || (event.type == SDL_FINGERDOWN) + || (event.type == SDL_MOUSEBUTTONDOWN)) { + keepGoing = SDL_FALSE; + } else if (event.type == SDL_CONTROLLERDEVICEADDED) { + gamecontroller = SDL_GameControllerOpen(event.cdevice.which); + if (gamecontroller != NULL) { + SDL_assert(SDL_GameControllerFromInstanceID(SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(gamecontroller))) == gamecontroller); + } + break; + } + } + } + } + } + + SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER); + + return retcode; +} + +#else + +int +main(int argc, char *argv[]) +{ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL compiled without Joystick support.\n"); + exit(1); +} + +#endif diff --git a/3rdparty/sdl2-2.0.4/test/testgesture.c b/3rdparty/sdl2-2.0.4/test/testgesture.c new file mode 100644 index 0000000000..a289ce133a --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testgesture.c @@ -0,0 +1,310 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +/* Usage: + * Spacebar to begin recording a gesture on all touches. + * s to save all touches into "./gestureSave" + * l to load all touches from "./gestureSave" + */ + +#include "SDL.h" +#include /* for exit() */ + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#define WIDTH 640 +#define HEIGHT 480 +#define BPP 4 +#define DEPTH 32 + +/* MUST BE A POWER OF 2! */ +#define EVENT_BUF_SIZE 256 + + +#define VERBOSE 0 + +static SDL_Event events[EVENT_BUF_SIZE]; +static int eventWrite; + + +static int colors[7] = {0xFF,0xFF00,0xFF0000,0xFFFF00,0x00FFFF,0xFF00FF,0xFFFFFF}; + +SDL_Surface *screen; +SDL_Window *window; +SDL_bool quitting = SDL_FALSE; + +typedef struct { + float x,y; +} Point; + +typedef struct { + float ang,r; + Point p; +} Knob; + +static Knob knob; + +void setpix(SDL_Surface *screen, float _x, float _y, unsigned int col) +{ + Uint32 *pixmem32; + Uint32 colour; + Uint8 r,g,b; + int x = (int)_x; + int y = (int)_y; + float a; + + if(x < 0 || x >= screen->w) return; + if(y < 0 || y >= screen->h) return; + + pixmem32 = (Uint32*) screen->pixels + y*screen->pitch/BPP + x; + + SDL_memcpy(&colour,pixmem32,screen->format->BytesPerPixel); + + SDL_GetRGB(colour,screen->format,&r,&g,&b); + /* r = 0;g = 0; b = 0; */ + a = (float)((col>>24)&0xFF); + if(a == 0) a = 0xFF; /* Hack, to make things easier. */ + a /= 0xFF; + r = (Uint8)(r*(1-a) + ((col>>16)&0xFF)*(a)); + g = (Uint8)(g*(1-a) + ((col>> 8)&0xFF)*(a)); + b = (Uint8)(b*(1-a) + ((col>> 0)&0xFF)*(a)); + colour = SDL_MapRGB( screen->format,r, g, b); + + + *pixmem32 = colour; +} + +void drawLine(SDL_Surface *screen,float x0,float y0,float x1,float y1,unsigned int col) { + float t; + for(t=0;t<1;t+=(float)(1.f/SDL_max(SDL_fabs(x0-x1),SDL_fabs(y0-y1)))) + setpix(screen,x1+t*(x0-x1),y1+t*(y0-y1),col); +} + +void drawCircle(SDL_Surface* screen,float x,float y,float r,unsigned int c) +{ + float tx,ty; + float xr; + for(ty = (float)-SDL_fabs(r);ty <= (float)SDL_fabs((int)r);ty++) { + xr = (float)SDL_sqrt(r*r - ty*ty); + if(r > 0) { /* r > 0 ==> filled circle */ + for(tx=-xr+.5f;tx<=xr-.5;tx++) { + setpix(screen,x+tx,y+ty,c); + } + } + else { + setpix(screen,x-xr+.5f,y+ty,c); + setpix(screen,x+xr-.5f,y+ty,c); + } + } +} + +void drawKnob(SDL_Surface* screen,Knob k) { + drawCircle(screen,k.p.x*screen->w,k.p.y*screen->h,k.r*screen->w,0xFFFFFF); + drawCircle(screen,(k.p.x+k.r/2*SDL_cosf(k.ang))*screen->w, + (k.p.y+k.r/2*SDL_sinf(k.ang))*screen->h,k.r/4*screen->w,0); +} + +void DrawScreen(SDL_Surface* screen, SDL_Window* window) +{ + int i; +#if 1 + SDL_FillRect(screen, NULL, 0); +#else + int x, y; + for(y = 0;y < screen->h;y++) + for(x = 0;x < screen->w;x++) + setpix(screen,(float)x,(float)y,((x%255)<<16) + ((y%255)<<8) + (x+y)%255); +#endif + + /* draw Touch History */ + for(i = eventWrite; i < eventWrite+EVENT_BUF_SIZE; ++i) { + const SDL_Event *event = &events[i&(EVENT_BUF_SIZE-1)]; + float age = (float)(i - eventWrite) / EVENT_BUF_SIZE; + float x, y; + unsigned int c, col; + + if(event->type == SDL_FINGERMOTION || + event->type == SDL_FINGERDOWN || + event->type == SDL_FINGERUP) { + x = event->tfinger.x; + y = event->tfinger.y; + + /* draw the touch: */ + c = colors[event->tfinger.fingerId%7]; + col = ((unsigned int)(c*(.1+.85))) | (unsigned int)(0xFF*age)<<24; + + if(event->type == SDL_FINGERMOTION) + drawCircle(screen,x*screen->w,y*screen->h,5,col); + else if(event->type == SDL_FINGERDOWN) + drawCircle(screen,x*screen->w,y*screen->h,-10,col); + } + } + + if(knob.p.x > 0) + drawKnob(screen,knob); + + SDL_UpdateWindowSurface(window); +} + +/* Returns a new SDL_Window if window is NULL or window if not. */ +SDL_Window* initWindow(SDL_Window *window, int width,int height) +{ + if (!window) { + window = SDL_CreateWindow("Gesture Test", + SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + width, height, SDL_WINDOW_RESIZABLE); + } + return window; +} + +void loop() +{ + SDL_Event event; + SDL_RWops *stream; + + while(SDL_PollEvent(&event)) + { + /* Record _all_ events */ + events[eventWrite & (EVENT_BUF_SIZE-1)] = event; + eventWrite++; + + switch (event.type) + { + case SDL_QUIT: + quitting = SDL_TRUE; + break; + case SDL_KEYDOWN: + switch (event.key.keysym.sym) + { + case SDLK_i: + { + int i; + for (i = 0; i < SDL_GetNumTouchDevices(); ++i) { + SDL_TouchID id = SDL_GetTouchDevice(i); + SDL_Log("Fingers Down on device %"SDL_PRIs64": %d", id, SDL_GetNumTouchFingers(id)); + } + break; + } + case SDLK_SPACE: + SDL_RecordGesture(-1); + break; + case SDLK_s: + stream = SDL_RWFromFile("gestureSave", "w"); + SDL_Log("Wrote %i templates", SDL_SaveAllDollarTemplates(stream)); + SDL_RWclose(stream); + break; + case SDLK_l: + stream = SDL_RWFromFile("gestureSave", "r"); + SDL_Log("Loaded: %i", SDL_LoadDollarTemplates(-1, stream)); + SDL_RWclose(stream); + break; + case SDLK_ESCAPE: + quitting = SDL_TRUE; + break; + } + break; + case SDL_WINDOWEVENT: + if (event.window.event == SDL_WINDOWEVENT_RESIZED) { + if (!(window = initWindow(window, event.window.data1, event.window.data2)) || + !(screen = SDL_GetWindowSurface(window))) + { + SDL_Quit(); + exit(1); + } + } + break; + case SDL_FINGERMOTION: +#if VERBOSE + SDL_Log("Finger: %"SDL_PRIs64",x: %f, y: %f",event.tfinger.fingerId, + event.tfinger.x,event.tfinger.y); +#endif + break; + case SDL_FINGERDOWN: +#if VERBOSE + SDL_Log("Finger: %"SDL_PRIs64" down - x: %f, y: %f", + event.tfinger.fingerId,event.tfinger.x,event.tfinger.y); +#endif + break; + case SDL_FINGERUP: +#if VERBOSE + SDL_Log("Finger: %"SDL_PRIs64" up - x: %f, y: %f", + event.tfinger.fingerId,event.tfinger.x,event.tfinger.y); +#endif + break; + case SDL_MULTIGESTURE: +#if VERBOSE + SDL_Log("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f", + event.mgesture.x, + event.mgesture.y, + event.mgesture.dTheta, + event.mgesture.dDist); + SDL_Log("MG: numDownTouch = %i",event.mgesture.numFingers); +#endif + knob.p.x = event.mgesture.x; + knob.p.y = event.mgesture.y; + knob.ang += event.mgesture.dTheta; + knob.r += event.mgesture.dDist; + break; + case SDL_DOLLARGESTURE: + SDL_Log("Gesture %"SDL_PRIs64" performed, error: %f", + event.dgesture.gestureId, + event.dgesture.error); + break; + case SDL_DOLLARRECORD: + SDL_Log("Recorded gesture: %"SDL_PRIs64"",event.dgesture.gestureId); + break; + } + } + DrawScreen(screen, window); + +#ifdef __EMSCRIPTEN__ + if (quitting) { + emscripten_cancel_main_loop(); + } +#endif +} + +int main(int argc, char* argv[]) +{ + window = NULL; + screen = NULL; + quitting = SDL_FALSE; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* gesture variables */ + knob.r = .1f; + knob.ang = 0; + + if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1; + + if (!(window = initWindow(window, WIDTH, HEIGHT)) || + !(screen = SDL_GetWindowSurface(window))) + { + SDL_Quit(); + return 1; + } + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while(!quitting) { + loop(); + } +#endif + + SDL_Quit(); + return 0; +} + diff --git a/3rdparty/sdl2-2.0.4/test/testgl2.c b/3rdparty/sdl2-2.0.4/test/testgl2.c new file mode 100644 index 0000000000..74147f9fb9 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testgl2.c @@ -0,0 +1,416 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +#include +#include +#include +#include + +#include "SDL_test_common.h" + +#ifdef __MACOS__ +#define HAVE_OPENGL +#endif + +#ifdef HAVE_OPENGL + +#include "SDL_opengl.h" + +typedef struct GL_Context +{ +#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; +#include "../src/render/opengl/SDL_glfuncs.h" +#undef SDL_PROC +} GL_Context; + + +/* Undefine this if you want a flat cube instead of a rainbow cube */ +#define SHADED_CUBE + +static SDLTest_CommonState *state; +static SDL_GLContext context; +static GL_Context ctx; + +static int LoadContext(GL_Context * data) +{ +#if SDL_VIDEO_DRIVER_UIKIT +#define __SDL_NOGETPROCADDR__ +#elif SDL_VIDEO_DRIVER_ANDROID +#define __SDL_NOGETPROCADDR__ +#elif SDL_VIDEO_DRIVER_PANDORA +#define __SDL_NOGETPROCADDR__ +#endif + +#if defined __SDL_NOGETPROCADDR__ +#define SDL_PROC(ret,func,params) data->func=func; +#else +#define SDL_PROC(ret,func,params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if ( ! data->func ) { \ + return SDL_SetError("Couldn't load GL function %s: %s\n", #func, SDL_GetError()); \ + } \ + } while ( 0 ); +#endif /* __SDL_NOGETPROCADDR__ */ + +#include "../src/render/opengl/SDL_glfuncs.h" +#undef SDL_PROC + return 0; +} + + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + if (context) { + /* SDL_GL_MakeCurrent(0, NULL); *//* doesn't do anything */ + SDL_GL_DeleteContext(context); + } + SDLTest_CommonQuit(state); + exit(rc); +} + +static void +Render() +{ + static float color[8][3] = { + {1.0, 1.0, 0.0}, + {1.0, 0.0, 0.0}, + {0.0, 0.0, 0.0}, + {0.0, 1.0, 0.0}, + {0.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, + {1.0, 0.0, 1.0}, + {0.0, 0.0, 1.0} + }; + static float cube[8][3] = { + {0.5, 0.5, -0.5}, + {0.5, -0.5, -0.5}, + {-0.5, -0.5, -0.5}, + {-0.5, 0.5, -0.5}, + {-0.5, 0.5, 0.5}, + {0.5, 0.5, 0.5}, + {0.5, -0.5, 0.5}, + {-0.5, -0.5, 0.5} + }; + + /* Do our drawing, too. */ + ctx.glClearColor(0.0, 0.0, 0.0, 1.0); + ctx.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + ctx.glBegin(GL_QUADS); + +#ifdef SHADED_CUBE + ctx.glColor3fv(color[0]); + ctx.glVertex3fv(cube[0]); + ctx.glColor3fv(color[1]); + ctx.glVertex3fv(cube[1]); + ctx.glColor3fv(color[2]); + ctx.glVertex3fv(cube[2]); + ctx.glColor3fv(color[3]); + ctx.glVertex3fv(cube[3]); + + ctx.glColor3fv(color[3]); + ctx.glVertex3fv(cube[3]); + ctx.glColor3fv(color[4]); + ctx.glVertex3fv(cube[4]); + ctx.glColor3fv(color[7]); + ctx.glVertex3fv(cube[7]); + ctx.glColor3fv(color[2]); + ctx.glVertex3fv(cube[2]); + + ctx.glColor3fv(color[0]); + ctx.glVertex3fv(cube[0]); + ctx.glColor3fv(color[5]); + ctx.glVertex3fv(cube[5]); + ctx.glColor3fv(color[6]); + ctx.glVertex3fv(cube[6]); + ctx.glColor3fv(color[1]); + ctx.glVertex3fv(cube[1]); + + ctx.glColor3fv(color[5]); + ctx.glVertex3fv(cube[5]); + ctx.glColor3fv(color[4]); + ctx.glVertex3fv(cube[4]); + ctx.glColor3fv(color[7]); + ctx.glVertex3fv(cube[7]); + ctx.glColor3fv(color[6]); + ctx.glVertex3fv(cube[6]); + + ctx.glColor3fv(color[5]); + ctx.glVertex3fv(cube[5]); + ctx.glColor3fv(color[0]); + ctx.glVertex3fv(cube[0]); + ctx.glColor3fv(color[3]); + ctx.glVertex3fv(cube[3]); + ctx.glColor3fv(color[4]); + ctx.glVertex3fv(cube[4]); + + ctx.glColor3fv(color[6]); + ctx.glVertex3fv(cube[6]); + ctx.glColor3fv(color[1]); + ctx.glVertex3fv(cube[1]); + ctx.glColor3fv(color[2]); + ctx.glVertex3fv(cube[2]); + ctx.glColor3fv(color[7]); + ctx.glVertex3fv(cube[7]); +#else /* flat cube */ + ctx.glColor3f(1.0, 0.0, 0.0); + ctx.glVertex3fv(cube[0]); + ctx.glVertex3fv(cube[1]); + ctx.glVertex3fv(cube[2]); + ctx.glVertex3fv(cube[3]); + + ctx.glColor3f(0.0, 1.0, 0.0); + ctx.glVertex3fv(cube[3]); + ctx.glVertex3fv(cube[4]); + ctx.glVertex3fv(cube[7]); + ctx.glVertex3fv(cube[2]); + + ctx.glColor3f(0.0, 0.0, 1.0); + ctx.glVertex3fv(cube[0]); + ctx.glVertex3fv(cube[5]); + ctx.glVertex3fv(cube[6]); + ctx.glVertex3fv(cube[1]); + + ctx.glColor3f(0.0, 1.0, 1.0); + ctx.glVertex3fv(cube[5]); + ctx.glVertex3fv(cube[4]); + ctx.glVertex3fv(cube[7]); + ctx.glVertex3fv(cube[6]); + + ctx.glColor3f(1.0, 1.0, 0.0); + ctx.glVertex3fv(cube[5]); + ctx.glVertex3fv(cube[0]); + ctx.glVertex3fv(cube[3]); + ctx.glVertex3fv(cube[4]); + + ctx.glColor3f(1.0, 0.0, 1.0); + ctx.glVertex3fv(cube[6]); + ctx.glVertex3fv(cube[1]); + ctx.glVertex3fv(cube[2]); + ctx.glVertex3fv(cube[7]); +#endif /* SHADED_CUBE */ + + ctx.glEnd(); + + ctx.glMatrixMode(GL_MODELVIEW); + ctx.glRotatef(5.0, 1.0, 1.0, 1.0); +} + +int +main(int argc, char *argv[]) +{ + int fsaa, accel; + int value; + int i, done; + SDL_DisplayMode mode; + SDL_Event event; + Uint32 then, now, frames; + int status; + int dw, dh; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Initialize parameters */ + fsaa = 0; + accel = -1; + + /* Initialize test framework */ + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + return 1; + } + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (consumed == 0) { + if (SDL_strcasecmp(argv[i], "--fsaa") == 0 && i+1 < argc) { + fsaa = atoi(argv[i+1]); + consumed = 2; + } else if (SDL_strcasecmp(argv[i], "--accel") == 0 && i+1 < argc) { + accel = atoi(argv[i+1]); + consumed = 2; + } else { + consumed = -1; + } + } + if (consumed < 0) { + SDL_Log("Usage: %s %s [--fsaa n] [--accel n]\n", argv[0], + SDLTest_CommonUsage(state)); + quit(1); + } + i += consumed; + } + + /* Set OpenGL parameters */ + state->window_flags |= SDL_WINDOW_OPENGL; + state->gl_red_size = 5; + state->gl_green_size = 5; + state->gl_blue_size = 5; + state->gl_depth_size = 16; + state->gl_double_buffer = 1; + if (fsaa) { + state->gl_multisamplebuffers = 1; + state->gl_multisamplesamples = fsaa; + } + if (accel >= 0) { + state->gl_accelerated = accel; + } + + if (!SDLTest_CommonInit(state)) { + quit(2); + } + + /* Create OpenGL context */ + context = SDL_GL_CreateContext(state->windows[0]); + if (!context) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_GL_CreateContext(): %s\n", SDL_GetError()); + quit(2); + } + + /* Important: call this *after* creating the context */ + if (LoadContext(&ctx) < 0) { + SDL_Log("Could not load GL functions\n"); + quit(2); + return 0; + } + + if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) { + /* try late-swap-tearing first. If not supported, try normal vsync. */ + if (SDL_GL_SetSwapInterval(-1) == -1) { + SDL_GL_SetSwapInterval(1); + } + } else { + SDL_GL_SetSwapInterval(0); /* disable vsync. */ + } + + SDL_GetCurrentDisplayMode(0, &mode); + SDL_Log("Screen BPP : %d\n", SDL_BITSPERPIXEL(mode.format)); + SDL_Log("Swap Interval : %d\n", SDL_GL_GetSwapInterval()); + SDL_GetWindowSize(state->windows[0], &dw, &dh); + SDL_Log("Window Size : %d,%d\n", dw, dh); + SDL_GL_GetDrawableSize(state->windows[0], &dw, &dh); + SDL_Log("Draw Size : %d,%d\n", dw, dh); + SDL_Log("\n"); + SDL_Log("Vendor : %s\n", ctx.glGetString(GL_VENDOR)); + SDL_Log("Renderer : %s\n", ctx.glGetString(GL_RENDERER)); + SDL_Log("Version : %s\n", ctx.glGetString(GL_VERSION)); + SDL_Log("Extensions : %s\n", ctx.glGetString(GL_EXTENSIONS)); + SDL_Log("\n"); + + status = SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value); + if (!status) { + SDL_Log("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value); + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_RED_SIZE: %s\n", SDL_GetError()); + } + status = SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value); + if (!status) { + SDL_Log("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value); + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_GREEN_SIZE: %s\n", SDL_GetError()); + } + status = SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value); + if (!status) { + SDL_Log("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value); + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_BLUE_SIZE: %s\n", SDL_GetError()); + } + status = SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value); + if (!status) { + SDL_Log("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", 16, value); + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_DEPTH_SIZE: %s\n", SDL_GetError()); + } + if (fsaa) { + status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value); + if (!status) { + SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value); + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", + SDL_GetError()); + } + status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value); + if (!status) { + SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, + value); + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", + SDL_GetError()); + } + } + if (accel >= 0) { + status = SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value); + if (!status) { + SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested %d, got %d\n", accel, + value); + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", + SDL_GetError()); + } + } + + /* Set rendering settings */ + ctx.glMatrixMode(GL_PROJECTION); + ctx.glLoadIdentity(); + ctx.glOrtho(-2.0, 2.0, -2.0, 2.0, -20.0, 20.0); + ctx.glMatrixMode(GL_MODELVIEW); + ctx.glLoadIdentity(); + ctx.glEnable(GL_DEPTH_TEST); + ctx.glDepthFunc(GL_LESS); + ctx.glShadeModel(GL_SMOOTH); + + /* Main render loop */ + frames = 0; + then = SDL_GetTicks(); + done = 0; + while (!done) { + /* Check for events */ + ++frames; + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + int w, h; + if (state->windows[i] == NULL) + continue; + SDL_GL_MakeCurrent(state->windows[i], context); + SDL_GL_GetDrawableSize(state->windows[i], &w, &h); + ctx.glViewport(0, 0, w, h); + Render(); + SDL_GL_SwapWindow(state->windows[i]); + } + } + + /* Print out some timing information */ + now = SDL_GetTicks(); + if (now > then) { + SDL_Log("%2.2f frames per second\n", + ((double) frames * 1000) / (now - then)); + } + quit(0); + return 0; +} + +#else /* HAVE_OPENGL */ + +int +main(int argc, char *argv[]) +{ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No OpenGL support on this system\n"); + return 1; +} + +#endif /* HAVE_OPENGL */ diff --git a/3rdparty/sdl2-2.0.0/test/testgles.c b/3rdparty/sdl2-2.0.4/test/testgles.c similarity index 76% rename from 3rdparty/sdl2-2.0.0/test/testgles.c rename to 3rdparty/sdl2-2.0.4/test/testgles.c index 41312a8bba..291661a09d 100644 --- a/3rdparty/sdl2-2.0.0/test/testgles.c +++ b/3rdparty/sdl2-2.0.4/test/testgles.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -110,6 +110,9 @@ main(int argc, char *argv[]) Uint32 then, now, frames; int status; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Initialize parameters */ fsaa = 0; accel = 0; @@ -143,7 +146,7 @@ main(int argc, char *argv[]) } } if (consumed < 0) { - fprintf(stderr, "Usage: %s %s [--fsaa] [--accel] [--zdepth %%d]\n", argv[0], + SDL_Log("Usage: %s %s [--fsaa] [--accel] [--zdepth %%d]\n", argv[0], SDLTest_CommonUsage(state)); quit(1); } @@ -156,6 +159,9 @@ main(int argc, char *argv[]) state->gl_green_size = 5; state->gl_blue_size = 5; state->gl_depth_size = depth; + state->gl_major_version = 1; + state->gl_minor_version = 1; + state->gl_profile_mask = SDL_GL_CONTEXT_PROFILE_ES; if (fsaa) { state->gl_multisamplebuffers=1; state->gl_multisamplesamples=fsaa; @@ -169,7 +175,7 @@ main(int argc, char *argv[]) context = SDL_calloc(state->num_windows, sizeof(context)); if (context == NULL) { - fprintf(stderr, "Out of memory!\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } @@ -177,7 +183,7 @@ main(int argc, char *argv[]) for (i = 0; i < state->num_windows; i++) { context[i] = SDL_GL_CreateContext(state->windows[i]); if (!context[i]) { - fprintf(stderr, "SDL_GL_CreateContext(): %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_GL_CreateContext(): %s\n", SDL_GetError()); quit(2); } } @@ -189,65 +195,65 @@ main(int argc, char *argv[]) } SDL_GetCurrentDisplayMode(0, &mode); - printf("Screen bpp: %d\n", SDL_BITSPERPIXEL(mode.format)); - printf("\n"); - printf("Vendor : %s\n", glGetString(GL_VENDOR)); - printf("Renderer : %s\n", glGetString(GL_RENDERER)); - printf("Version : %s\n", glGetString(GL_VERSION)); - printf("Extensions : %s\n", glGetString(GL_EXTENSIONS)); - printf("\n"); + SDL_Log("Screen bpp: %d\n", SDL_BITSPERPIXEL(mode.format)); + SDL_Log("\n"); + SDL_Log("Vendor : %s\n", glGetString(GL_VENDOR)); + SDL_Log("Renderer : %s\n", glGetString(GL_RENDERER)); + SDL_Log("Version : %s\n", glGetString(GL_VERSION)); + SDL_Log("Extensions : %s\n", glGetString(GL_EXTENSIONS)); + SDL_Log("\n"); status = SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value); if (!status) { - printf("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value); + SDL_Log("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value); } else { - fprintf(stderr, "Failed to get SDL_GL_RED_SIZE: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_RED_SIZE: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value); if (!status) { - printf("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value); + SDL_Log("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value); } else { - fprintf(stderr, "Failed to get SDL_GL_GREEN_SIZE: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_GREEN_SIZE: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value); if (!status) { - printf("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value); + SDL_Log("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value); } else { - fprintf(stderr, "Failed to get SDL_GL_BLUE_SIZE: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_BLUE_SIZE: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value); if (!status) { - printf("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", depth, value); + SDL_Log("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", depth, value); } else { - fprintf(stderr, "Failed to get SDL_GL_DEPTH_SIZE: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_DEPTH_SIZE: %s\n", SDL_GetError()); } if (fsaa) { status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value); if (!status) { - printf("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value); + SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value); } else { - fprintf(stderr, "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value); if (!status) { - printf("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, + SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, value); } else { - fprintf(stderr, "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", SDL_GetError()); } } if (accel) { status = SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value); if (!status) { - printf("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value); + SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value); } else { - fprintf(stderr, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", SDL_GetError()); } } @@ -258,7 +264,7 @@ main(int argc, char *argv[]) status = SDL_GL_MakeCurrent(state->windows[i], context[i]); if (status) { - printf("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); /* Continue for next window */ continue; @@ -292,7 +298,7 @@ main(int argc, char *argv[]) if (event.window.windowID == SDL_GetWindowID(state->windows[i])) { status = SDL_GL_MakeCurrent(state->windows[i], context[i]); if (status) { - printf("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); break; } /* Change view port to the new window dimensions */ @@ -309,9 +315,11 @@ main(int argc, char *argv[]) SDLTest_CommonEvent(state, &event, &done); } for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; status = SDL_GL_MakeCurrent(state->windows[i], context[i]); if (status) { - printf("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); /* Continue for next window */ continue; @@ -324,10 +332,12 @@ main(int argc, char *argv[]) /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { - printf("%2.2f frames per second\n", + SDL_Log("%2.2f frames per second\n", ((double) frames * 1000) / (now - then)); } +#if !defined(__ANDROID__) quit(0); +#endif return 0; } @@ -336,7 +346,7 @@ main(int argc, char *argv[]) int main(int argc, char *argv[]) { - printf("No OpenGL ES support on this system\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No OpenGL ES support on this system\n"); return 1; } diff --git a/3rdparty/sdl2-2.0.4/test/testgles2.c b/3rdparty/sdl2-2.0.4/test/testgles2.c new file mode 100644 index 0000000000..af5962ba48 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testgles2.c @@ -0,0 +1,731 @@ +/* + Copyright (r) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +#include +#include +#include +#include + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "SDL_test_common.h" + +#if defined(__IPHONEOS__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__NACL__) +#define HAVE_OPENGLES2 +#endif + +#ifdef HAVE_OPENGLES2 + +#include "SDL_opengles2.h" + +typedef struct GLES2_Context +{ +#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; +#include "../src/render/opengles2/SDL_gles2funcs.h" +#undef SDL_PROC +} GLES2_Context; + + +static SDLTest_CommonState *state; +static SDL_GLContext *context = NULL; +static int depth = 16; +static GLES2_Context ctx; + +static int LoadContext(GLES2_Context * data) +{ +#if SDL_VIDEO_DRIVER_UIKIT +#define __SDL_NOGETPROCADDR__ +#elif SDL_VIDEO_DRIVER_ANDROID +#define __SDL_NOGETPROCADDR__ +#elif SDL_VIDEO_DRIVER_PANDORA +#define __SDL_NOGETPROCADDR__ +#endif + +#if defined __SDL_NOGETPROCADDR__ +#define SDL_PROC(ret,func,params) data->func=func; +#else +#define SDL_PROC(ret,func,params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if ( ! data->func ) { \ + return SDL_SetError("Couldn't load GLES2 function %s: %s\n", #func, SDL_GetError()); \ + } \ + } while ( 0 ); +#endif /* __SDL_NOGETPROCADDR__ */ + +#include "../src/render/opengles2/SDL_gles2funcs.h" +#undef SDL_PROC + return 0; +} + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + int i; + + if (context != NULL) { + for (i = 0; i < state->num_windows; i++) { + if (context[i]) { + SDL_GL_DeleteContext(context[i]); + } + } + + SDL_free(context); + } + + SDLTest_CommonQuit(state); + exit(rc); +} + +#define GL_CHECK(x) \ + x; \ + { \ + GLenum glError = ctx.glGetError(); \ + if(glError != GL_NO_ERROR) { \ + SDL_Log("glGetError() = %i (0x%.8x) at line %i\n", glError, glError, __LINE__); \ + quit(1); \ + } \ + } + +/* + * Simulates desktop's glRotatef. The matrix is returned in column-major + * order. + */ +static void +rotate_matrix(float angle, float x, float y, float z, float *r) +{ + float radians, c, s, c1, u[3], length; + int i, j; + + radians = (float)(angle * M_PI) / 180.0f; + + c = SDL_cosf(radians); + s = SDL_sinf(radians); + + c1 = 1.0f - SDL_cosf(radians); + + length = (float)SDL_sqrt(x * x + y * y + z * z); + + u[0] = x / length; + u[1] = y / length; + u[2] = z / length; + + for (i = 0; i < 16; i++) { + r[i] = 0.0; + } + + r[15] = 1.0; + + for (i = 0; i < 3; i++) { + r[i * 4 + (i + 1) % 3] = u[(i + 2) % 3] * s; + r[i * 4 + (i + 2) % 3] = -u[(i + 1) % 3] * s; + } + + for (i = 0; i < 3; i++) { + for (j = 0; j < 3; j++) { + r[i * 4 + j] += c1 * u[i] * u[j] + (i == j ? c : 0.0f); + } + } +} + +/* + * Simulates gluPerspectiveMatrix + */ +static void +perspective_matrix(float fovy, float aspect, float znear, float zfar, float *r) +{ + int i; + float f; + + f = 1.0f/SDL_tanf(fovy * 0.5f); + + for (i = 0; i < 16; i++) { + r[i] = 0.0; + } + + r[0] = f / aspect; + r[5] = f; + r[10] = (znear + zfar) / (znear - zfar); + r[11] = -1.0f; + r[14] = (2.0f * znear * zfar) / (znear - zfar); + r[15] = 0.0f; +} + +/* + * Multiplies lhs by rhs and writes out to r. All matrices are 4x4 and column + * major. In-place multiplication is supported. + */ +static void +multiply_matrix(float *lhs, float *rhs, float *r) +{ + int i, j, k; + float tmp[16]; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + tmp[j * 4 + i] = 0.0; + + for (k = 0; k < 4; k++) { + tmp[j * 4 + i] += lhs[k * 4 + i] * rhs[j * 4 + k]; + } + } + } + + for (i = 0; i < 16; i++) { + r[i] = tmp[i]; + } +} + +/* + * Create shader, load in source, compile, dump debug as necessary. + * + * shader: Pointer to return created shader ID. + * source: Passed-in shader source code. + * shader_type: Passed to GL, e.g. GL_VERTEX_SHADER. + */ +void +process_shader(GLuint *shader, const char * source, GLint shader_type) +{ + GLint status = GL_FALSE; + const char *shaders[1] = { NULL }; + char buffer[1024]; + GLsizei length; + + /* Create shader and load into GL. */ + *shader = GL_CHECK(ctx.glCreateShader(shader_type)); + + shaders[0] = source; + + GL_CHECK(ctx.glShaderSource(*shader, 1, shaders, NULL)); + + /* Clean up shader source. */ + shaders[0] = NULL; + + /* Try compiling the shader. */ + GL_CHECK(ctx.glCompileShader(*shader)); + GL_CHECK(ctx.glGetShaderiv(*shader, GL_COMPILE_STATUS, &status)); + + /* Dump debug info (source and log) if compilation failed. */ + if(status != GL_TRUE) { + ctx.glGetProgramInfoLog(*shader, sizeof(buffer), &length, &buffer[0]); + buffer[length] = '\0'; + SDL_Log("Shader compilation failed: %s", buffer);fflush(stderr); + quit(-1); + } +} + +/* 3D data. Vertex range -0.5..0.5 in all axes. +* Z -0.5 is near, 0.5 is far. */ +const float _vertices[] = +{ + /* Front face. */ + /* Bottom left */ + -0.5, 0.5, -0.5, + 0.5, -0.5, -0.5, + -0.5, -0.5, -0.5, + /* Top right */ + -0.5, 0.5, -0.5, + 0.5, 0.5, -0.5, + 0.5, -0.5, -0.5, + /* Left face */ + /* Bottom left */ + -0.5, 0.5, 0.5, + -0.5, -0.5, -0.5, + -0.5, -0.5, 0.5, + /* Top right */ + -0.5, 0.5, 0.5, + -0.5, 0.5, -0.5, + -0.5, -0.5, -0.5, + /* Top face */ + /* Bottom left */ + -0.5, 0.5, 0.5, + 0.5, 0.5, -0.5, + -0.5, 0.5, -0.5, + /* Top right */ + -0.5, 0.5, 0.5, + 0.5, 0.5, 0.5, + 0.5, 0.5, -0.5, + /* Right face */ + /* Bottom left */ + 0.5, 0.5, -0.5, + 0.5, -0.5, 0.5, + 0.5, -0.5, -0.5, + /* Top right */ + 0.5, 0.5, -0.5, + 0.5, 0.5, 0.5, + 0.5, -0.5, 0.5, + /* Back face */ + /* Bottom left */ + 0.5, 0.5, 0.5, + -0.5, -0.5, 0.5, + 0.5, -0.5, 0.5, + /* Top right */ + 0.5, 0.5, 0.5, + -0.5, 0.5, 0.5, + -0.5, -0.5, 0.5, + /* Bottom face */ + /* Bottom left */ + -0.5, -0.5, -0.5, + 0.5, -0.5, 0.5, + -0.5, -0.5, 0.5, + /* Top right */ + -0.5, -0.5, -0.5, + 0.5, -0.5, -0.5, + 0.5, -0.5, 0.5, +}; + +const float _colors[] = +{ + /* Front face */ + /* Bottom left */ + 1.0, 0.0, 0.0, /* red */ + 0.0, 0.0, 1.0, /* blue */ + 0.0, 1.0, 0.0, /* green */ + /* Top right */ + 1.0, 0.0, 0.0, /* red */ + 1.0, 1.0, 0.0, /* yellow */ + 0.0, 0.0, 1.0, /* blue */ + /* Left face */ + /* Bottom left */ + 1.0, 1.0, 1.0, /* white */ + 0.0, 1.0, 0.0, /* green */ + 0.0, 1.0, 1.0, /* cyan */ + /* Top right */ + 1.0, 1.0, 1.0, /* white */ + 1.0, 0.0, 0.0, /* red */ + 0.0, 1.0, 0.0, /* green */ + /* Top face */ + /* Bottom left */ + 1.0, 1.0, 1.0, /* white */ + 1.0, 1.0, 0.0, /* yellow */ + 1.0, 0.0, 0.0, /* red */ + /* Top right */ + 1.0, 1.0, 1.0, /* white */ + 0.0, 0.0, 0.0, /* black */ + 1.0, 1.0, 0.0, /* yellow */ + /* Right face */ + /* Bottom left */ + 1.0, 1.0, 0.0, /* yellow */ + 1.0, 0.0, 1.0, /* magenta */ + 0.0, 0.0, 1.0, /* blue */ + /* Top right */ + 1.0, 1.0, 0.0, /* yellow */ + 0.0, 0.0, 0.0, /* black */ + 1.0, 0.0, 1.0, /* magenta */ + /* Back face */ + /* Bottom left */ + 0.0, 0.0, 0.0, /* black */ + 0.0, 1.0, 1.0, /* cyan */ + 1.0, 0.0, 1.0, /* magenta */ + /* Top right */ + 0.0, 0.0, 0.0, /* black */ + 1.0, 1.0, 1.0, /* white */ + 0.0, 1.0, 1.0, /* cyan */ + /* Bottom face */ + /* Bottom left */ + 0.0, 1.0, 0.0, /* green */ + 1.0, 0.0, 1.0, /* magenta */ + 0.0, 1.0, 1.0, /* cyan */ + /* Top right */ + 0.0, 1.0, 0.0, /* green */ + 0.0, 0.0, 1.0, /* blue */ + 1.0, 0.0, 1.0, /* magenta */ +}; + +const char* _shader_vert_src = +" attribute vec4 av4position; " +" attribute vec3 av3color; " +" uniform mat4 mvp; " +" varying vec3 vv3color; " +" void main() { " +" vv3color = av3color; " +" gl_Position = mvp * av4position; " +" } "; + +const char* _shader_frag_src = +" precision lowp float; " +" varying vec3 vv3color; " +" void main() { " +" gl_FragColor = vec4(vv3color, 1.0); " +" } "; + +typedef struct shader_data +{ + GLuint shader_program, shader_frag, shader_vert; + + GLint attr_position; + GLint attr_color, attr_mvp; + + int angle_x, angle_y, angle_z; + +} shader_data; + +static void +Render(unsigned int width, unsigned int height, shader_data* data) +{ + float matrix_rotate[16], matrix_modelview[16], matrix_perspective[16], matrix_mvp[16]; + + /* + * Do some rotation with Euler angles. It is not a fixed axis as + * quaterions would be, but the effect is cool. + */ + rotate_matrix((float)data->angle_x, 1.0f, 0.0f, 0.0f, matrix_modelview); + rotate_matrix((float)data->angle_y, 0.0f, 1.0f, 0.0f, matrix_rotate); + + multiply_matrix(matrix_rotate, matrix_modelview, matrix_modelview); + + rotate_matrix((float)data->angle_z, 0.0f, 1.0f, 0.0f, matrix_rotate); + + multiply_matrix(matrix_rotate, matrix_modelview, matrix_modelview); + + /* Pull the camera back from the cube */ + matrix_modelview[14] -= 2.5; + + perspective_matrix(45.0f, (float)width/height, 0.01f, 100.0f, matrix_perspective); + multiply_matrix(matrix_perspective, matrix_modelview, matrix_mvp); + + GL_CHECK(ctx.glUniformMatrix4fv(data->attr_mvp, 1, GL_FALSE, matrix_mvp)); + + data->angle_x += 3; + data->angle_y += 2; + data->angle_z += 1; + + if(data->angle_x >= 360) data->angle_x -= 360; + if(data->angle_x < 0) data->angle_x += 360; + if(data->angle_y >= 360) data->angle_y -= 360; + if(data->angle_y < 0) data->angle_y += 360; + if(data->angle_z >= 360) data->angle_z -= 360; + if(data->angle_z < 0) data->angle_z += 360; + + GL_CHECK(ctx.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)); + GL_CHECK(ctx.glDrawArrays(GL_TRIANGLES, 0, 36)); +} + +int done; +Uint32 frames; +shader_data *datas; + +void loop() +{ + SDL_Event event; + int i; + int status; + + /* Check for events */ + ++frames; + while (SDL_PollEvent(&event) && !done) { + switch (event.type) { + case SDL_WINDOWEVENT: + switch (event.window.event) { + case SDL_WINDOWEVENT_RESIZED: + for (i = 0; i < state->num_windows; ++i) { + if (event.window.windowID == SDL_GetWindowID(state->windows[i])) { + int w, h; + status = SDL_GL_MakeCurrent(state->windows[i], context[i]); + if (status) { + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); + break; + } + /* Change view port to the new window dimensions */ + SDL_GL_GetDrawableSize(state->windows[i], &w, &h); + ctx.glViewport(0, 0, w, h); + state->window_w = event.window.data1; + state->window_h = event.window.data2; + /* Update window content */ + Render(event.window.data1, event.window.data2, &datas[i]); + SDL_GL_SwapWindow(state->windows[i]); + break; + } + } + break; + } + } + SDLTest_CommonEvent(state, &event, &done); + } + if (!done) { + for (i = 0; i < state->num_windows; ++i) { + status = SDL_GL_MakeCurrent(state->windows[i], context[i]); + if (status) { + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); + + /* Continue for next window */ + continue; + } + Render(state->window_w, state->window_h, &datas[i]); + SDL_GL_SwapWindow(state->windows[i]); + } + } +#ifdef __EMSCRIPTEN__ + else { + emscripten_cancel_main_loop(); + } +#endif +} + +int +main(int argc, char *argv[]) +{ + int fsaa, accel; + int value; + int i; + SDL_DisplayMode mode; + Uint32 then, now; + int status; + shader_data *data; + + /* Initialize parameters */ + fsaa = 0; + accel = 0; + + /* Initialize test framework */ + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + return 1; + } + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (consumed == 0) { + if (SDL_strcasecmp(argv[i], "--fsaa") == 0) { + ++fsaa; + consumed = 1; + } else if (SDL_strcasecmp(argv[i], "--accel") == 0) { + ++accel; + consumed = 1; + } else if (SDL_strcasecmp(argv[i], "--zdepth") == 0) { + i++; + if (!argv[i]) { + consumed = -1; + } else { + depth = SDL_atoi(argv[i]); + consumed = 1; + } + } else { + consumed = -1; + } + } + if (consumed < 0) { + SDL_Log ("Usage: %s %s [--fsaa] [--accel] [--zdepth %%d]\n", argv[0], + SDLTest_CommonUsage(state)); + quit(1); + } + i += consumed; + } + + /* Set OpenGL parameters */ + state->window_flags |= SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS; + state->gl_red_size = 5; + state->gl_green_size = 5; + state->gl_blue_size = 5; + state->gl_depth_size = depth; + state->gl_major_version = 2; + state->gl_minor_version = 0; + state->gl_profile_mask = SDL_GL_CONTEXT_PROFILE_ES; + + if (fsaa) { + state->gl_multisamplebuffers=1; + state->gl_multisamplesamples=fsaa; + } + if (accel) { + state->gl_accelerated=1; + } + if (!SDLTest_CommonInit(state)) { + quit(2); + return 0; + } + + context = SDL_calloc(state->num_windows, sizeof(context)); + if (context == NULL) { + SDL_Log("Out of memory!\n"); + quit(2); + } + + /* Create OpenGL ES contexts */ + for (i = 0; i < state->num_windows; i++) { + context[i] = SDL_GL_CreateContext(state->windows[i]); + if (!context[i]) { + SDL_Log("SDL_GL_CreateContext(): %s\n", SDL_GetError()); + quit(2); + } + } + + /* Important: call this *after* creating the context */ + if (LoadContext(&ctx) < 0) { + SDL_Log("Could not load GLES2 functions\n"); + quit(2); + return 0; + } + + + + if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) { + SDL_GL_SetSwapInterval(1); + } else { + SDL_GL_SetSwapInterval(0); + } + + SDL_GetCurrentDisplayMode(0, &mode); + SDL_Log("Screen bpp: %d\n", SDL_BITSPERPIXEL(mode.format)); + SDL_Log("\n"); + SDL_Log("Vendor : %s\n", ctx.glGetString(GL_VENDOR)); + SDL_Log("Renderer : %s\n", ctx.glGetString(GL_RENDERER)); + SDL_Log("Version : %s\n", ctx.glGetString(GL_VERSION)); + SDL_Log("Extensions : %s\n", ctx.glGetString(GL_EXTENSIONS)); + SDL_Log("\n"); + + status = SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value); + if (!status) { + SDL_Log("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value); + } else { + SDL_Log( "Failed to get SDL_GL_RED_SIZE: %s\n", + SDL_GetError()); + } + status = SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value); + if (!status) { + SDL_Log("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value); + } else { + SDL_Log( "Failed to get SDL_GL_GREEN_SIZE: %s\n", + SDL_GetError()); + } + status = SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value); + if (!status) { + SDL_Log("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value); + } else { + SDL_Log( "Failed to get SDL_GL_BLUE_SIZE: %s\n", + SDL_GetError()); + } + status = SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value); + if (!status) { + SDL_Log("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", depth, value); + } else { + SDL_Log( "Failed to get SDL_GL_DEPTH_SIZE: %s\n", + SDL_GetError()); + } + if (fsaa) { + status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value); + if (!status) { + SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value); + } else { + SDL_Log( "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", + SDL_GetError()); + } + status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value); + if (!status) { + SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, + value); + } else { + SDL_Log( "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", + SDL_GetError()); + } + } + if (accel) { + status = SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value); + if (!status) { + SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value); + } else { + SDL_Log( "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", + SDL_GetError()); + } + } + + datas = SDL_calloc(state->num_windows, sizeof(shader_data)); + + /* Set rendering settings for each context */ + for (i = 0; i < state->num_windows; ++i) { + + int w, h; + status = SDL_GL_MakeCurrent(state->windows[i], context[i]); + if (status) { + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); + + /* Continue for next window */ + continue; + } + SDL_GL_GetDrawableSize(state->windows[i], &w, &h); + ctx.glViewport(0, 0, w, h); + + data = &datas[i]; + data->angle_x = 0; data->angle_y = 0; data->angle_z = 0; + + /* Shader Initialization */ + process_shader(&data->shader_vert, _shader_vert_src, GL_VERTEX_SHADER); + process_shader(&data->shader_frag, _shader_frag_src, GL_FRAGMENT_SHADER); + + /* Create shader_program (ready to attach shaders) */ + data->shader_program = GL_CHECK(ctx.glCreateProgram()); + + /* Attach shaders and link shader_program */ + GL_CHECK(ctx.glAttachShader(data->shader_program, data->shader_vert)); + GL_CHECK(ctx.glAttachShader(data->shader_program, data->shader_frag)); + GL_CHECK(ctx.glLinkProgram(data->shader_program)); + + /* Get attribute locations of non-fixed attributes like color and texture coordinates. */ + data->attr_position = GL_CHECK(ctx.glGetAttribLocation(data->shader_program, "av4position")); + data->attr_color = GL_CHECK(ctx.glGetAttribLocation(data->shader_program, "av3color")); + + /* Get uniform locations */ + data->attr_mvp = GL_CHECK(ctx.glGetUniformLocation(data->shader_program, "mvp")); + + GL_CHECK(ctx.glUseProgram(data->shader_program)); + + /* Enable attributes for position, color and texture coordinates etc. */ + GL_CHECK(ctx.glEnableVertexAttribArray(data->attr_position)); + GL_CHECK(ctx.glEnableVertexAttribArray(data->attr_color)); + + /* Populate attributes for position, color and texture coordinates etc. */ + GL_CHECK(ctx.glVertexAttribPointer(data->attr_position, 3, GL_FLOAT, GL_FALSE, 0, _vertices)); + GL_CHECK(ctx.glVertexAttribPointer(data->attr_color, 3, GL_FLOAT, GL_FALSE, 0, _colors)); + + GL_CHECK(ctx.glEnable(GL_CULL_FACE)); + GL_CHECK(ctx.glEnable(GL_DEPTH_TEST)); + } + + /* Main render loop */ + frames = 0; + then = SDL_GetTicks(); + done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); + } +#endif + + /* Print out some timing information */ + now = SDL_GetTicks(); + if (now > then) { + SDL_Log("%2.2f frames per second\n", + ((double) frames * 1000) / (now - then)); + } +#if !defined(__ANDROID__) && !defined(__NACL__) + quit(0); +#endif + return 0; +} + +#else /* HAVE_OPENGLES2 */ + +int +main(int argc, char *argv[]) +{ + SDL_Log("No OpenGL ES support on this system\n"); + return 1; +} + +#endif /* HAVE_OPENGLES2 */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/3rdparty/sdl2-2.0.4/test/testhaptic.c b/3rdparty/sdl2-2.0.4/test/testhaptic.c new file mode 100644 index 0000000000..bffe4467de --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testhaptic.c @@ -0,0 +1,369 @@ +/* +Copyright (c) 2008, Edgar Simo Serra +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the Simple Directmedia Layer (SDL) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * includes + */ +#include +#include /* strstr */ +#include /* isdigit */ + +#include "SDL.h" + +#ifndef SDL_HAPTIC_DISABLED + +static SDL_Haptic *haptic; + + +/* + * prototypes + */ +static void abort_execution(void); +static void HapticPrintSupported(SDL_Haptic * haptic); + + +/** + * @brief The entry point of this force feedback demo. + * @param[in] argc Number of arguments. + * @param[in] argv Array of argc arguments. + */ +int +main(int argc, char **argv) +{ + int i; + char *name; + int index; + SDL_HapticEffect efx[9]; + int id[9]; + int nefx; + unsigned int supported; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + name = NULL; + index = -1; + if (argc > 1) { + name = argv[1]; + if ((strcmp(name, "--help") == 0) || (strcmp(name, "-h") == 0)) { + SDL_Log("USAGE: %s [device]\n" + "If device is a two-digit number it'll use it as an index, otherwise\n" + "it'll use it as if it were part of the device's name.\n", + argv[0]); + return 0; + } + + i = strlen(name); + if ((i < 3) && isdigit(name[0]) && ((i == 1) || isdigit(name[1]))) { + index = atoi(name); + name = NULL; + } + } + + /* Initialize the force feedbackness */ + SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK | + SDL_INIT_HAPTIC); + SDL_Log("%d Haptic devices detected.\n", SDL_NumHaptics()); + if (SDL_NumHaptics() > 0) { + /* We'll just use index or the first force feedback device found */ + if (name == NULL) { + i = (index != -1) ? index : 0; + } + /* Try to find matching device */ + else { + for (i = 0; i < SDL_NumHaptics(); i++) { + if (strstr(SDL_HapticName(i), name) != NULL) + break; + } + + if (i >= SDL_NumHaptics()) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find device matching '%s', aborting.\n", + name); + return 1; + } + } + + haptic = SDL_HapticOpen(i); + if (haptic == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create the haptic device: %s\n", + SDL_GetError()); + return 1; + } + SDL_Log("Device: %s\n", SDL_HapticName(i)); + HapticPrintSupported(haptic); + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No Haptic devices found!\n"); + return 1; + } + + /* We only want force feedback errors. */ + SDL_ClearError(); + + /* Create effects. */ + memset(&efx, 0, sizeof(efx)); + nefx = 0; + supported = SDL_HapticQuery(haptic); + + SDL_Log("\nUploading effects\n"); + /* First we'll try a SINE effect. */ + if (supported & SDL_HAPTIC_SINE) { + SDL_Log(" effect %d: Sine Wave\n", nefx); + efx[nefx].type = SDL_HAPTIC_SINE; + efx[nefx].periodic.period = 1000; + efx[nefx].periodic.magnitude = -0x2000; /* Negative magnitude and ... */ + efx[nefx].periodic.phase = 18000; /* ... 180 degrees phase shift => cancel eachother */ + efx[nefx].periodic.length = 5000; + efx[nefx].periodic.attack_length = 1000; + efx[nefx].periodic.fade_length = 1000; + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + /* Now we'll try a SAWTOOTHUP */ + if (supported & SDL_HAPTIC_SAWTOOTHUP) { + SDL_Log(" effect %d: Sawtooth Up\n", nefx); + efx[nefx].type = SDL_HAPTIC_SAWTOOTHUP; + efx[nefx].periodic.period = 500; + efx[nefx].periodic.magnitude = 0x5000; + efx[nefx].periodic.length = 5000; + efx[nefx].periodic.attack_length = 1000; + efx[nefx].periodic.fade_length = 1000; + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + + /* Now the classical constant effect. */ + if (supported & SDL_HAPTIC_CONSTANT) { + SDL_Log(" effect %d: Constant Force\n", nefx); + efx[nefx].type = SDL_HAPTIC_CONSTANT; + efx[nefx].constant.direction.type = SDL_HAPTIC_POLAR; + efx[nefx].constant.direction.dir[0] = 20000; /* Force comes from the south-west. */ + efx[nefx].constant.length = 5000; + efx[nefx].constant.level = 0x6000; + efx[nefx].constant.attack_length = 1000; + efx[nefx].constant.fade_length = 1000; + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + + /* The cute spring effect. */ + if (supported & SDL_HAPTIC_SPRING) { + SDL_Log(" effect %d: Condition Spring\n", nefx); + efx[nefx].type = SDL_HAPTIC_SPRING; + efx[nefx].condition.length = 5000; + for (i = 0; i < SDL_HapticNumAxes(haptic); i++) { + efx[nefx].condition.right_sat[i] = 0xFFFF; + efx[nefx].condition.left_sat[i] = 0xFFFF; + efx[nefx].condition.right_coeff[i] = 0x2000; + efx[nefx].condition.left_coeff[i] = 0x2000; + efx[nefx].condition.center[i] = 0x1000; /* Displace the center for it to move. */ + } + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + /* The interesting damper effect. */ + if (supported & SDL_HAPTIC_DAMPER) { + SDL_Log(" effect %d: Condition Damper\n", nefx); + efx[nefx].type = SDL_HAPTIC_DAMPER; + efx[nefx].condition.length = 5000; + for (i = 0; i < SDL_HapticNumAxes(haptic); i++) { + efx[nefx].condition.right_sat[i] = 0xFFFF; + efx[nefx].condition.left_sat[i] = 0xFFFF; + efx[nefx].condition.right_coeff[i] = 0x2000; + efx[nefx].condition.left_coeff[i] = 0x2000; + } + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + /* The pretty awesome inertia effect. */ + if (supported & SDL_HAPTIC_INERTIA) { + SDL_Log(" effect %d: Condition Inertia\n", nefx); + efx[nefx].type = SDL_HAPTIC_INERTIA; + efx[nefx].condition.length = 5000; + for (i = 0; i < SDL_HapticNumAxes(haptic); i++) { + efx[nefx].condition.right_sat[i] = 0xFFFF; + efx[nefx].condition.left_sat[i] = 0xFFFF; + efx[nefx].condition.right_coeff[i] = 0x2000; + efx[nefx].condition.left_coeff[i] = 0x2000; + efx[nefx].condition.deadband[i] = 0x1000; /* 1/16th of axis-range around the center is 'dead'. */ + } + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + /* The hot friction effect. */ + if (supported & SDL_HAPTIC_FRICTION) { + SDL_Log(" effect %d: Condition Friction\n", nefx); + efx[nefx].type = SDL_HAPTIC_FRICTION; + efx[nefx].condition.length = 5000; + for (i = 0; i < SDL_HapticNumAxes(haptic); i++) { + efx[nefx].condition.right_sat[i] = 0xFFFF; + efx[nefx].condition.left_sat[i] = 0xFFFF; + efx[nefx].condition.right_coeff[i] = 0x2000; + efx[nefx].condition.left_coeff[i] = 0x2000; + } + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + + /* Now we'll try a ramp effect */ + if (supported & SDL_HAPTIC_RAMP) { + SDL_Log(" effect %d: Ramp\n", nefx); + efx[nefx].type = SDL_HAPTIC_RAMP; + efx[nefx].ramp.direction.type = SDL_HAPTIC_CARTESIAN; + efx[nefx].ramp.direction.dir[0] = 1; /* Force comes from */ + efx[nefx].ramp.direction.dir[1] = -1; /* the north-east. */ + efx[nefx].ramp.length = 5000; + efx[nefx].ramp.start = 0x4000; + efx[nefx].ramp.end = -0x4000; + efx[nefx].ramp.attack_length = 1000; + efx[nefx].ramp.fade_length = 1000; + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + + /* Finally we'll try a left/right effect. */ + if (supported & SDL_HAPTIC_LEFTRIGHT) { + SDL_Log(" effect %d: Left/Right\n", nefx); + efx[nefx].type = SDL_HAPTIC_LEFTRIGHT; + efx[nefx].leftright.length = 5000; + efx[nefx].leftright.large_magnitude = 0x3000; + efx[nefx].leftright.small_magnitude = 0xFFFF; + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + + + SDL_Log + ("\nNow playing effects for 5 seconds each with 1 second delay between\n"); + for (i = 0; i < nefx; i++) { + SDL_Log(" Playing effect %d\n", i); + SDL_HapticRunEffect(haptic, id[i], 1); + SDL_Delay(6000); /* Effects only have length 5000 */ + } + + /* Quit */ + if (haptic != NULL) + SDL_HapticClose(haptic); + SDL_Quit(); + + return 0; +} + + +/* + * Cleans up a bit. + */ +static void +abort_execution(void) +{ + SDL_Log("\nAborting program execution.\n"); + + SDL_HapticClose(haptic); + SDL_Quit(); + + exit(1); +} + + +/* + * Displays information about the haptic device. + */ +static void +HapticPrintSupported(SDL_Haptic * haptic) +{ + unsigned int supported; + + supported = SDL_HapticQuery(haptic); + SDL_Log(" Supported effects [%d effects, %d playing]:\n", + SDL_HapticNumEffects(haptic), SDL_HapticNumEffectsPlaying(haptic)); + if (supported & SDL_HAPTIC_CONSTANT) + SDL_Log(" constant\n"); + if (supported & SDL_HAPTIC_SINE) + SDL_Log(" sine\n"); + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /* if (supported & SDL_HAPTIC_SQUARE) + SDL_Log(" square\n"); */ + if (supported & SDL_HAPTIC_TRIANGLE) + SDL_Log(" triangle\n"); + if (supported & SDL_HAPTIC_SAWTOOTHUP) + SDL_Log(" sawtoothup\n"); + if (supported & SDL_HAPTIC_SAWTOOTHDOWN) + SDL_Log(" sawtoothdown\n"); + if (supported & SDL_HAPTIC_RAMP) + SDL_Log(" ramp\n"); + if (supported & SDL_HAPTIC_FRICTION) + SDL_Log(" friction\n"); + if (supported & SDL_HAPTIC_SPRING) + SDL_Log(" spring\n"); + if (supported & SDL_HAPTIC_DAMPER) + SDL_Log(" damper\n"); + if (supported & SDL_HAPTIC_INERTIA) + SDL_Log(" inertia\n"); + if (supported & SDL_HAPTIC_CUSTOM) + SDL_Log(" custom\n"); + if (supported & SDL_HAPTIC_LEFTRIGHT) + SDL_Log(" left/right\n"); + SDL_Log(" Supported capabilities:\n"); + if (supported & SDL_HAPTIC_GAIN) + SDL_Log(" gain\n"); + if (supported & SDL_HAPTIC_AUTOCENTER) + SDL_Log(" autocenter\n"); + if (supported & SDL_HAPTIC_STATUS) + SDL_Log(" status\n"); +} + +#else + +int +main(int argc, char *argv[]) +{ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL compiled without Haptic support.\n"); + exit(1); +} + +#endif diff --git a/3rdparty/sdl2-2.0.4/test/testhittesting.c b/3rdparty/sdl2-2.0.4/test/testhittesting.c new file mode 100644 index 0000000000..5e32be42d0 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testhittesting.c @@ -0,0 +1,134 @@ +#include +#include "SDL.h" + +/* !!! FIXME: rewrite this to be wired in to test framework. */ + +#define RESIZE_BORDER 20 + +const SDL_Rect drag_areas[] = { + { 20, 20, 100, 100 }, + { 200, 70, 100, 100 }, + { 400, 90, 100, 100 } +}; + +static const SDL_Rect *areas = drag_areas; +static int numareas = SDL_arraysize(drag_areas); + +static SDL_HitTestResult +hitTest(SDL_Window *window, const SDL_Point *pt, void *data) +{ + int i; + int w, h; + + for (i = 0; i < numareas; i++) { + if (SDL_PointInRect(pt, &areas[i])) { + SDL_Log("HIT-TEST: DRAGGABLE\n"); + return SDL_HITTEST_DRAGGABLE; + } + } + + SDL_GetWindowSize(window, &w, &h); + + #define REPORT_RESIZE_HIT(name) { \ + SDL_Log("HIT-TEST: RESIZE_" #name "\n"); \ + return SDL_HITTEST_RESIZE_##name; \ + } + + if (pt->x < RESIZE_BORDER && pt->y < RESIZE_BORDER) { + REPORT_RESIZE_HIT(TOPLEFT); + } else if (pt->x > RESIZE_BORDER && pt->x < w - RESIZE_BORDER && pt->y < RESIZE_BORDER) { + REPORT_RESIZE_HIT(TOP); + } else if (pt->x > w - RESIZE_BORDER && pt->y < RESIZE_BORDER) { + REPORT_RESIZE_HIT(TOPRIGHT); + } else if (pt->x > w - RESIZE_BORDER && pt->y > RESIZE_BORDER && pt->y < h - RESIZE_BORDER) { + REPORT_RESIZE_HIT(RIGHT); + } else if (pt->x > w - RESIZE_BORDER && pt->y > h - RESIZE_BORDER) { + REPORT_RESIZE_HIT(BOTTOMRIGHT); + } else if (pt->x < w - RESIZE_BORDER && pt->x > RESIZE_BORDER && pt->y > h - RESIZE_BORDER) { + REPORT_RESIZE_HIT(BOTTOM); + } else if (pt->x < RESIZE_BORDER && pt->y > h - RESIZE_BORDER) { + REPORT_RESIZE_HIT(BOTTOMLEFT); + } else if (pt->x < RESIZE_BORDER && pt->y < h - RESIZE_BORDER && pt->y > RESIZE_BORDER) { + REPORT_RESIZE_HIT(LEFT); + } + + SDL_Log("HIT-TEST: NORMAL\n"); + return SDL_HITTEST_NORMAL; +} + + +int main(int argc, char **argv) +{ + int done = 0; + SDL_Window *window; + SDL_Renderer *renderer; + + /* !!! FIXME: check for errors. */ + SDL_Init(SDL_INIT_VIDEO); + window = SDL_CreateWindow("Drag the red boxes", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE); + renderer = SDL_CreateRenderer(window, -1, 0); + + if (SDL_SetWindowHitTest(window, hitTest, NULL) == -1) { + SDL_Log("Enabling hit-testing failed!\n"); + SDL_Quit(); + return 1; + } + + while (!done) + { + SDL_Event e; + int nothing_to_do = 1; + + SDL_SetRenderDrawColor(renderer, 0, 0, 127, 255); + SDL_RenderClear(renderer); + SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); + SDL_RenderFillRects(renderer, areas, SDL_arraysize(drag_areas)); + SDL_RenderPresent(renderer); + + while (SDL_PollEvent(&e)) { + nothing_to_do = 0; + + switch (e.type) + { + case SDL_MOUSEBUTTONDOWN: + SDL_Log("button down!\n"); + break; + + case SDL_MOUSEBUTTONUP: + SDL_Log("button up!\n"); + break; + + case SDL_WINDOWEVENT: + if (e.window.event == SDL_WINDOWEVENT_MOVED) { + SDL_Log("Window event moved to (%d, %d)!\n", (int) e.window.data1, (int) e.window.data2); + } + break; + + case SDL_KEYDOWN: + if (e.key.keysym.sym == SDLK_ESCAPE) { + done = 1; + } else if (e.key.keysym.sym == SDLK_x) { + if (!areas) { + areas = drag_areas; + numareas = SDL_arraysize(drag_areas); + } else { + areas = NULL; + numareas = 0; + } + } + break; + + case SDL_QUIT: + done = 1; + break; + } + } + + if (nothing_to_do) { + SDL_Delay(50); + } + } + + SDL_Quit(); + return 0; +} diff --git a/3rdparty/sdl2-2.0.4/test/testhotplug.c b/3rdparty/sdl2-2.0.4/test/testhotplug.c new file mode 100644 index 0000000000..1fa9637548 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testhotplug.c @@ -0,0 +1,162 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Simple program to test the SDL joystick hotplugging */ + +#include +#include +#include + +#include "SDL.h" + +#if !defined SDL_JOYSTICK_DISABLED && !defined SDL_HAPTIC_DISABLED + +int +main(int argc, char *argv[]) +{ + SDL_Joystick *joystick = NULL; + SDL_Haptic *haptic = NULL; + SDL_JoystickID instance = -1; + SDL_bool keepGoing = SDL_TRUE; + int i; + SDL_bool enable_haptic = SDL_TRUE; + Uint32 init_subsystems = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK; + + for (i = 1; i < argc; ++i) { + if (SDL_strcasecmp(argv[i], "--nohaptic") == 0) { + enable_haptic = SDL_FALSE; + } + } + + if(enable_haptic) { + init_subsystems |= SDL_INIT_HAPTIC; + } + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); + + /* Initialize SDL (Note: video is required to start event loop) */ + if (SDL_Init(init_subsystems) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + exit(1); + } + + /* + //SDL_CreateWindow("Dummy", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 128, 128, 0); + */ + + SDL_Log("There are %d joysticks at startup\n", SDL_NumJoysticks()); + if (enable_haptic) + SDL_Log("There are %d haptic devices at startup\n", SDL_NumHaptics()); + + while(keepGoing) + { + SDL_Event event; + while(SDL_PollEvent(&event)) + { + switch(event.type) + { + case SDL_QUIT: + keepGoing = SDL_FALSE; + break; + case SDL_JOYDEVICEADDED: + if (joystick != NULL) + { + SDL_Log("Only one joystick supported by this test\n"); + } + else + { + joystick = SDL_JoystickOpen(event.jdevice.which); + instance = SDL_JoystickInstanceID(joystick); + SDL_Log("Joy Added : %d : %s\n", event.jdevice.which, SDL_JoystickName(joystick)); + if (enable_haptic) + { + if (SDL_JoystickIsHaptic(joystick)) + { + haptic = SDL_HapticOpenFromJoystick(joystick); + if (haptic) + { + SDL_Log("Joy Haptic Opened\n"); + if (SDL_HapticRumbleInit( haptic ) != 0) + { + SDL_Log("Could not init Rumble!: %s\n", SDL_GetError()); + SDL_HapticClose(haptic); + haptic = NULL; + } + } else { + SDL_Log("Joy haptic open FAILED!: %s\n", SDL_GetError()); + } + } + else + { + SDL_Log("No haptic found\n"); + } + } + } + break; + case SDL_JOYDEVICEREMOVED: + if (instance == event.jdevice.which) + { + SDL_Log("Joy Removed: %d\n", event.jdevice.which); + instance = -1; + if(enable_haptic && haptic) + { + SDL_HapticClose(haptic); + haptic = NULL; + } + SDL_JoystickClose(joystick); + joystick = NULL; + } else { + SDL_Log("Unknown joystick diconnected\n"); + } + break; + case SDL_JOYAXISMOTION: +/* +// SDL_Log("Axis Move: %d\n", event.jaxis.axis); +*/ + if (enable_haptic) + SDL_HapticRumblePlay(haptic, 0.25, 250); + break; + case SDL_JOYBUTTONDOWN: + SDL_Log("Button Press: %d\n", event.jbutton.button); + if(enable_haptic && haptic) + { + SDL_HapticRumblePlay(haptic, 0.25, 250); + } + if (event.jbutton.button == 0) { + SDL_Log("Exiting due to button press of button 0\n"); + keepGoing = SDL_FALSE; + } + break; + case SDL_JOYBUTTONUP: + SDL_Log("Button Release: %d\n", event.jbutton.button); + break; + } + } + } + + SDL_Quit(); + + return 0; +} +#else + +int +main(int argc, char *argv[]) +{ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL compiled without Joystick and haptic support.\n"); + return 1; +} + +#endif diff --git a/3rdparty/sdl2-2.0.0/test/testiconv.c b/3rdparty/sdl2-2.0.4/test/testiconv.c similarity index 81% rename from 3rdparty/sdl2-2.0.0/test/testiconv.c rename to 3rdparty/sdl2-2.0.4/test/testiconv.c index d2081995d5..79efec8aaa 100644 --- a/3rdparty/sdl2-2.0.0/test/testiconv.c +++ b/3rdparty/sdl2-2.0.4/test/testiconv.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -49,12 +49,15 @@ main(int argc, char *argv[]) FILE *file; int errors = 0; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + if (!argv[1]) { argv[1] = "utf8.txt"; } file = fopen(argv[1], "rb"); if (!file) { - fprintf(stderr, "Unable to open %s\n", argv[1]); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to open %s\n", argv[1]); return (1); } @@ -69,15 +72,11 @@ main(int argc, char *argv[]) test[0] = SDL_iconv_string(formats[i], "UCS-4", ucs4, len); test[1] = SDL_iconv_string("UCS-4", formats[i], test[0], len); if (!test[1] || SDL_memcmp(test[1], ucs4, len) != 0) { - fprintf(stderr, "FAIL: %s\n", formats[i]); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "FAIL: %s\n", formats[i]); ++errors; } - if (test[0]) { - SDL_free(test[0]); - } - if (test[1]) { - SDL_free(test[1]); - } + SDL_free(test[0]); + SDL_free(test[1]); } test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len); SDL_free(ucs4); diff --git a/3rdparty/sdl2-2.0.0/test/testime.c b/3rdparty/sdl2-2.0.4/test/testime.c similarity index 89% rename from 3rdparty/sdl2-2.0.0/test/testime.c rename to 3rdparty/sdl2-2.0.4/test/testime.c index ce9f02b1f5..d6e7ea1f26 100644 --- a/3rdparty/sdl2-2.0.0/test/testime.c +++ b/3rdparty/sdl2-2.0.4/test/testime.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -80,7 +80,7 @@ char *utf8_advance(char *p, size_t distance) void usage() { - printf("usage: testime [--font fontfile]\n"); + SDL_Log("usage: testime [--font fontfile]\n"); exit(0); } @@ -135,7 +135,7 @@ void _Redraw(SDL_Renderer * renderer) { markedRect.w = textRect.w - w; if (markedRect.w < 0) { - // Stop text input because we cannot hold any more characters + /* Stop text input because we cannot hold any more characters */ SDL_StopTextInput(); return; } @@ -196,6 +196,8 @@ void Redraw() { int i; for (i = 0; i < state->num_windows; ++i) { SDL_Renderer *renderer = state->renderers[i]; + if (state->windows[i] == NULL) + continue; SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); SDL_RenderClear(renderer); @@ -210,6 +212,9 @@ int main(int argc, char *argv[]) { SDL_Event event; const char *fontname = DEFAULT_FONT; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); if (!state) { @@ -251,12 +256,12 @@ int main(int argc, char *argv[]) { font = TTF_OpenFont(fontname, DEFAULT_PTSIZE); if (! font) { - fprintf(stderr, "Failed to find font: %s\n", TTF_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to find font: %s\n", TTF_GetError()); exit(-1); } #endif - printf("Using font: %s\n", fontname); + SDL_Log("Using font: %s\n", fontname); atexit(SDL_Quit); InitInput(); @@ -284,7 +289,7 @@ int main(int argc, char *argv[]) { break; case SDLK_BACKSPACE: { - int textlen=SDL_strlen(text); + size_t textlen = SDL_strlen(text); do { if (textlen==0) @@ -321,33 +326,32 @@ int main(int argc, char *argv[]) { break; } - fprintf(stderr, - "Keyboard: scancode 0x%08X = %s, keycode 0x%08X = %s\n", + SDL_Log("Keyboard: scancode 0x%08X = %s, keycode 0x%08X = %s\n", event.key.keysym.scancode, SDL_GetScancodeName(event.key.keysym.scancode), event.key.keysym.sym, SDL_GetKeyName(event.key.keysym.sym)); break; case SDL_TEXTINPUT: - if (SDL_strlen(event.text.text) == 0 || event.text.text[0] == '\n' || + if (event.text.text[0] == '\0' || event.text.text[0] == '\n' || markedRect.w < 0) break; - fprintf(stderr, "Keyboard: text input \"%s\"\n", event.text.text); + SDL_Log("Keyboard: text input \"%s\"\n", event.text.text); if (SDL_strlen(text) + SDL_strlen(event.text.text) < sizeof(text)) SDL_strlcat(text, event.text.text, sizeof(text)); - fprintf(stderr, "text inputed: %s\n", text); + SDL_Log("text inputed: %s\n", text); - // After text inputed, we can clear up markedText because it - // is committed + /* After text inputed, we can clear up markedText because it */ + /* is committed */ markedText[0] = 0; Redraw(); break; case SDL_TEXTEDITING: - fprintf(stderr, "text editing \"%s\", selected range (%d, %d)\n", + SDL_Log("text editing \"%s\", selected range (%d, %d)\n", event.edit.text, event.edit.start, event.edit.length); strcpy(markedText, event.edit.text); diff --git a/3rdparty/sdl2-2.0.4/test/testintersections.c b/3rdparty/sdl2-2.0.4/test/testintersections.c new file mode 100644 index 0000000000..82aae63388 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testintersections.c @@ -0,0 +1,363 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Simple program: draw as many random objects on the screen as possible */ + +#include +#include +#include + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "SDL_test_common.h" + +#define SWAP(typ,a,b) do{typ t=a;a=b;b=t;}while(0) +#define NUM_OBJECTS 100 + +static SDLTest_CommonState *state; +static int num_objects; +static SDL_bool cycle_color; +static SDL_bool cycle_alpha; +static int cycle_direction = 1; +static int current_alpha = 255; +static int current_color = 255; +static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; + +int mouse_begin_x = -1, mouse_begin_y = -1; +int done; + +void +DrawPoints(SDL_Renderer * renderer) +{ + int i; + int x, y; + SDL_Rect viewport; + + /* Query the sizes */ + SDL_RenderGetViewport(renderer, &viewport); + + for (i = 0; i < num_objects * 4; ++i) { + /* Cycle the color and alpha, if desired */ + if (cycle_color) { + current_color += cycle_direction; + if (current_color < 0) { + current_color = 0; + cycle_direction = -cycle_direction; + } + if (current_color > 255) { + current_color = 255; + cycle_direction = -cycle_direction; + } + } + if (cycle_alpha) { + current_alpha += cycle_direction; + if (current_alpha < 0) { + current_alpha = 0; + cycle_direction = -cycle_direction; + } + if (current_alpha > 255) { + current_alpha = 255; + cycle_direction = -cycle_direction; + } + } + SDL_SetRenderDrawColor(renderer, 255, (Uint8) current_color, + (Uint8) current_color, (Uint8) current_alpha); + + x = rand() % viewport.w; + y = rand() % viewport.h; + SDL_RenderDrawPoint(renderer, x, y); + } +} + +#define MAX_LINES 16 +int num_lines = 0; +SDL_Rect lines[MAX_LINES]; +static int +add_line(int x1, int y1, int x2, int y2) +{ + if (num_lines >= MAX_LINES) + return 0; + if ((x1 == x2) && (y1 == y2)) + return 0; + + SDL_Log("adding line (%d, %d), (%d, %d)\n", x1, y1, x2, y2); + lines[num_lines].x = x1; + lines[num_lines].y = y1; + lines[num_lines].w = x2; + lines[num_lines].h = y2; + + return ++num_lines; +} + + +void +DrawLines(SDL_Renderer * renderer) +{ + int i; + SDL_Rect viewport; + + /* Query the sizes */ + SDL_RenderGetViewport(renderer, &viewport); + + SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); + + for (i = 0; i < num_lines; ++i) { + if (i == -1) { + SDL_RenderDrawLine(renderer, 0, 0, viewport.w - 1, viewport.h - 1); + SDL_RenderDrawLine(renderer, 0, viewport.h - 1, viewport.w - 1, 0); + SDL_RenderDrawLine(renderer, 0, viewport.h / 2, viewport.w - 1, viewport.h / 2); + SDL_RenderDrawLine(renderer, viewport.w / 2, 0, viewport.w / 2, viewport.h - 1); + } else { + SDL_RenderDrawLine(renderer, lines[i].x, lines[i].y, lines[i].w, lines[i].h); + } + } +} + +#define MAX_RECTS 16 +int num_rects = 0; +SDL_Rect rects[MAX_RECTS]; +static int +add_rect(int x1, int y1, int x2, int y2) +{ + if (num_rects >= MAX_RECTS) + return 0; + if ((x1 == x2) || (y1 == y2)) + return 0; + + if (x1 > x2) + SWAP(int, x1, x2); + if (y1 > y2) + SWAP(int, y1, y2); + + SDL_Log("adding rect (%d, %d), (%d, %d) [%dx%d]\n", x1, y1, x2, y2, + x2 - x1, y2 - y1); + + rects[num_rects].x = x1; + rects[num_rects].y = y1; + rects[num_rects].w = x2 - x1; + rects[num_rects].h = y2 - y1; + + return ++num_rects; +} + +static void +DrawRects(SDL_Renderer * renderer) +{ + SDL_SetRenderDrawColor(renderer, 255, 127, 0, 255); + SDL_RenderFillRects(renderer, rects, num_rects); +} + +static void +DrawRectLineIntersections(SDL_Renderer * renderer) +{ + int i, j; + + SDL_SetRenderDrawColor(renderer, 0, 255, 55, 255); + + for (i = 0; i < num_rects; i++) + for (j = 0; j < num_lines; j++) { + int x1, y1, x2, y2; + SDL_Rect r; + + r = rects[i]; + x1 = lines[j].x; + y1 = lines[j].y; + x2 = lines[j].w; + y2 = lines[j].h; + + if (SDL_IntersectRectAndLine(&r, &x1, &y1, &x2, &y2)) { + SDL_RenderDrawLine(renderer, x1, y1, x2, y2); + } + } +} + +static void +DrawRectRectIntersections(SDL_Renderer * renderer) +{ + int i, j; + + SDL_SetRenderDrawColor(renderer, 255, 200, 0, 255); + + for (i = 0; i < num_rects; i++) + for (j = i + 1; j < num_rects; j++) { + SDL_Rect r; + if (SDL_IntersectRect(&rects[i], &rects[j], &r)) { + SDL_RenderFillRect(renderer, &r); + } + } +} + +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + switch (event.type) { + case SDL_MOUSEBUTTONDOWN: + mouse_begin_x = event.button.x; + mouse_begin_y = event.button.y; + break; + case SDL_MOUSEBUTTONUP: + if (event.button.button == 3) + add_line(mouse_begin_x, mouse_begin_y, event.button.x, + event.button.y); + if (event.button.button == 1) + add_rect(mouse_begin_x, mouse_begin_y, event.button.x, + event.button.y); + break; + case SDL_KEYDOWN: + switch (event.key.keysym.sym) { + case 'l': + if (event.key.keysym.mod & KMOD_SHIFT) + num_lines = 0; + else + add_line(rand() % 640, rand() % 480, rand() % 640, + rand() % 480); + break; + case 'r': + if (event.key.keysym.mod & KMOD_SHIFT) + num_rects = 0; + else + add_rect(rand() % 640, rand() % 480, rand() % 640, + rand() % 480); + break; + } + break; + default: + break; + } + } + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + if (state->windows[i] == NULL) + continue; + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + + DrawRects(renderer); + DrawPoints(renderer); + DrawRectRectIntersections(renderer); + DrawLines(renderer); + DrawRectLineIntersections(renderer); + + SDL_RenderPresent(renderer); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +int +main(int argc, char *argv[]) +{ + int i; + Uint32 then, now, frames; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Initialize parameters */ + num_objects = NUM_OBJECTS; + + /* Initialize test framework */ + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + return 1; + } + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (consumed == 0) { + consumed = -1; + if (SDL_strcasecmp(argv[i], "--blend") == 0) { + if (argv[i + 1]) { + if (SDL_strcasecmp(argv[i + 1], "none") == 0) { + blendMode = SDL_BLENDMODE_NONE; + consumed = 2; + } else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) { + blendMode = SDL_BLENDMODE_BLEND; + consumed = 2; + } else if (SDL_strcasecmp(argv[i + 1], "add") == 0) { + blendMode = SDL_BLENDMODE_ADD; + consumed = 2; + } else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) { + blendMode = SDL_BLENDMODE_MOD; + consumed = 2; + } + } + } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) { + cycle_color = SDL_TRUE; + consumed = 1; + } else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) { + cycle_alpha = SDL_TRUE; + consumed = 1; + } else if (SDL_isdigit(*argv[i])) { + num_objects = SDL_atoi(argv[i]); + consumed = 1; + } + } + if (consumed < 0) { + SDL_Log("Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n", + argv[0], SDLTest_CommonUsage(state)); + return 1; + } + i += consumed; + } + if (!SDLTest_CommonInit(state)) { + return 2; + } + + /* Create the windows and initialize the renderers */ + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + SDL_SetRenderDrawBlendMode(renderer, blendMode); + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + } + + srand(time(NULL)); + + /* Main render loop */ + frames = 0; + then = SDL_GetTicks(); + done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + ++frames; + loop(); + } +#endif + + SDLTest_CommonQuit(state); + + /* Print out some timing information */ + now = SDL_GetTicks(); + if (now > then) { + double fps = ((double) frames * 1000) / (now - then); + SDL_Log("%2.2f frames per second\n", fps); + } + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/3rdparty/sdl2-2.0.4/test/testjoystick.c b/3rdparty/sdl2-2.0.4/test/testjoystick.c new file mode 100644 index 0000000000..bed27212e1 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testjoystick.c @@ -0,0 +1,346 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Simple program to test the SDL joystick routines */ + +#include +#include +#include + +#include "SDL.h" + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#ifndef SDL_JOYSTICK_DISABLED + +#ifdef __IPHONEOS__ +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 480 +#else +#define SCREEN_WIDTH 640 +#define SCREEN_HEIGHT 480 +#endif + +SDL_Renderer *screen = NULL; +SDL_bool retval = SDL_FALSE; +SDL_bool done = SDL_FALSE; + +static void +DrawRect(SDL_Renderer *r, const int x, const int y, const int w, const int h) +{ + const SDL_Rect area = { x, y, w, h }; + SDL_RenderFillRect(r, &area); +} + +void +loop(void *arg) +{ + SDL_Event event; + int i; + SDL_Joystick *joystick = (SDL_Joystick *)arg; + + /* blank screen, set up for drawing this frame. */ + SDL_SetRenderDrawColor(screen, 0x0, 0x0, 0x0, SDL_ALPHA_OPAQUE); + SDL_RenderClear(screen); + + while (SDL_PollEvent(&event)) { + switch (event.type) { + + case SDL_JOYDEVICEREMOVED: + SDL_Log("Joystick device %d removed.\n", (int) event.jdevice.which); + SDL_Log("Our instance ID is %d\n", (int) SDL_JoystickInstanceID(joystick)); + break; + + case SDL_JOYAXISMOTION: + SDL_Log("Joystick %d axis %d value: %d\n", + event.jaxis.which, + event.jaxis.axis, event.jaxis.value); + break; + case SDL_JOYHATMOTION: + SDL_Log("Joystick %d hat %d value:", + event.jhat.which, event.jhat.hat); + if (event.jhat.value == SDL_HAT_CENTERED) + SDL_Log(" centered"); + if (event.jhat.value & SDL_HAT_UP) + SDL_Log(" up"); + if (event.jhat.value & SDL_HAT_RIGHT) + SDL_Log(" right"); + if (event.jhat.value & SDL_HAT_DOWN) + SDL_Log(" down"); + if (event.jhat.value & SDL_HAT_LEFT) + SDL_Log(" left"); + SDL_Log("\n"); + break; + case SDL_JOYBALLMOTION: + SDL_Log("Joystick %d ball %d delta: (%d,%d)\n", + event.jball.which, + event.jball.ball, event.jball.xrel, event.jball.yrel); + break; + case SDL_JOYBUTTONDOWN: + SDL_Log("Joystick %d button %d down\n", + event.jbutton.which, event.jbutton.button); + break; + case SDL_JOYBUTTONUP: + SDL_Log("Joystick %d button %d up\n", + event.jbutton.which, event.jbutton.button); + break; + case SDL_KEYDOWN: + if ((event.key.keysym.sym != SDLK_ESCAPE) && + (event.key.keysym.sym != SDLK_AC_BACK)) { + break; + } + /* Fall through to signal quit */ + case SDL_FINGERDOWN: + case SDL_MOUSEBUTTONDOWN: + case SDL_QUIT: + done = SDL_TRUE; + break; + default: + break; + } + } + /* Update visual joystick state */ + SDL_SetRenderDrawColor(screen, 0x00, 0xFF, 0x00, SDL_ALPHA_OPAQUE); + for (i = 0; i < SDL_JoystickNumButtons(joystick); ++i) { + if (SDL_JoystickGetButton(joystick, i) == SDL_PRESSED) { + DrawRect(screen, (i%20) * 34, SCREEN_HEIGHT - 68 + (i/20) * 34, 32, 32); + } + } + + SDL_SetRenderDrawColor(screen, 0xFF, 0x00, 0x00, SDL_ALPHA_OPAQUE); + for (i = 0; i < SDL_JoystickNumAxes(joystick); ++i) { + /* Draw the X/Y axis */ + int x, y; + x = (((int) SDL_JoystickGetAxis(joystick, i)) + 32768); + x *= SCREEN_WIDTH; + x /= 65535; + if (x < 0) { + x = 0; + } else if (x > (SCREEN_WIDTH - 16)) { + x = SCREEN_WIDTH - 16; + } + ++i; + if (i < SDL_JoystickNumAxes(joystick)) { + y = (((int) SDL_JoystickGetAxis(joystick, i)) + 32768); + } else { + y = 32768; + } + y *= SCREEN_HEIGHT; + y /= 65535; + if (y < 0) { + y = 0; + } else if (y > (SCREEN_HEIGHT - 16)) { + y = SCREEN_HEIGHT - 16; + } + + DrawRect(screen, x, y, 16, 16); + } + + SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0xFF, SDL_ALPHA_OPAQUE); + for (i = 0; i < SDL_JoystickNumHats(joystick); ++i) { + /* Derive the new position */ + int x = SCREEN_WIDTH/2; + int y = SCREEN_HEIGHT/2; + const Uint8 hat_pos = SDL_JoystickGetHat(joystick, i); + + if (hat_pos & SDL_HAT_UP) { + y = 0; + } else if (hat_pos & SDL_HAT_DOWN) { + y = SCREEN_HEIGHT-8; + } + + if (hat_pos & SDL_HAT_LEFT) { + x = 0; + } else if (hat_pos & SDL_HAT_RIGHT) { + x = SCREEN_WIDTH-8; + } + + DrawRect(screen, x, y, 8, 8); + } + + SDL_RenderPresent(screen); + + if (SDL_JoystickGetAttached( joystick ) == 0) { + done = SDL_TRUE; + retval = SDL_TRUE; /* keep going, wait for reattach. */ + } + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +static SDL_bool +WatchJoystick(SDL_Joystick * joystick) +{ + SDL_Window *window = NULL; + const char *name = NULL; + + retval = SDL_FALSE; + done = SDL_FALSE; + + /* Create a window to display joystick axis position */ + window = SDL_CreateWindow("Joystick Test", SDL_WINDOWPOS_CENTERED, + SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, + SCREEN_HEIGHT, 0); + if (window == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); + return SDL_FALSE; + } + + screen = SDL_CreateRenderer(window, -1, 0); + if (screen == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); + SDL_DestroyWindow(window); + return SDL_FALSE; + } + + SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0x00, SDL_ALPHA_OPAQUE); + SDL_RenderClear(screen); + SDL_RenderPresent(screen); + SDL_RaiseWindow(window); + + /* Print info about the joystick we are watching */ + name = SDL_JoystickName(joystick); + SDL_Log("Watching joystick %d: (%s)\n", SDL_JoystickInstanceID(joystick), + name ? name : "Unknown Joystick"); + SDL_Log("Joystick has %d axes, %d hats, %d balls, and %d buttons\n", + SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick), + SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick)); + + /* Loop, getting joystick events! */ +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop_arg(loop, joystick, 0, 1); +#else + while (!done) { + loop(joystick); + } +#endif + + SDL_DestroyRenderer(screen); + screen = NULL; + SDL_DestroyWindow(window); + return retval; +} + +int +main(int argc, char *argv[]) +{ + const char *name; + int i; + SDL_Joystick *joystick; + + SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Initialize SDL (Note: video is required to start event loop) */ + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + exit(1); + } + + /* Print information about the joysticks */ + SDL_Log("There are %d joysticks attached\n", SDL_NumJoysticks()); + for (i = 0; i < SDL_NumJoysticks(); ++i) { + name = SDL_JoystickNameForIndex(i); + SDL_Log("Joystick %d: %s\n", i, name ? name : "Unknown Joystick"); + joystick = SDL_JoystickOpen(i); + if (joystick == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_JoystickOpen(%d) failed: %s\n", i, + SDL_GetError()); + } else { + char guid[64]; + SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick); + SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick), + guid, sizeof (guid)); + SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joystick)); + SDL_Log(" balls: %d\n", SDL_JoystickNumBalls(joystick)); + SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joystick)); + SDL_Log(" buttons: %d\n", SDL_JoystickNumButtons(joystick)); + SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick)); + SDL_Log(" guid: %s\n", guid); + SDL_JoystickClose(joystick); + } + } + +#if defined(__ANDROID__) || defined(__IPHONEOS__) + if (SDL_NumJoysticks() > 0) { +#else + if (argv[1]) { +#endif + SDL_bool reportederror = SDL_FALSE; + SDL_bool keepGoing = SDL_TRUE; + SDL_Event event; + int device; +#if defined(__ANDROID__) || defined(__IPHONEOS__) + device = 0; +#else + device = atoi(argv[1]); +#endif + joystick = SDL_JoystickOpen(device); + if (joystick != NULL) { + SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick); + } + + while ( keepGoing ) { + if (joystick == NULL) { + if ( !reportederror ) { + SDL_Log("Couldn't open joystick %d: %s\n", device, SDL_GetError()); + keepGoing = SDL_FALSE; + reportederror = SDL_TRUE; + } + } else { + reportederror = SDL_FALSE; + keepGoing = WatchJoystick(joystick); + SDL_JoystickClose(joystick); + } + + joystick = NULL; + if (keepGoing) { + SDL_Log("Waiting for attach\n"); + } + while (keepGoing) { + SDL_WaitEvent(&event); + if ((event.type == SDL_QUIT) || (event.type == SDL_FINGERDOWN) + || (event.type == SDL_MOUSEBUTTONDOWN)) { + keepGoing = SDL_FALSE; + } else if (event.type == SDL_JOYDEVICEADDED) { + joystick = SDL_JoystickOpen(device); + if (joystick != NULL) { + SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick); + } + break; + } + } + } + } + SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK); + + return 0; +} + +#else + +int +main(int argc, char *argv[]) +{ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL compiled without Joystick support.\n"); + exit(1); +} + +#endif diff --git a/3rdparty/sdl2-2.0.4/test/testkeys.c b/3rdparty/sdl2-2.0.4/test/testkeys.c new file mode 100644 index 0000000000..aea496caaf --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testkeys.c @@ -0,0 +1,40 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Print out all the scancodes we have, just to verify them */ + +#include +#include +#include +#include + +#include "SDL.h" + +int +main(int argc, char *argv[]) +{ + SDL_Scancode scancode; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + exit(1); + } + for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) { + SDL_Log("Scancode #%d, \"%s\"\n", scancode, + SDL_GetScancodeName(scancode)); + } + SDL_Quit(); + return (0); +} diff --git a/3rdparty/sdl2-2.0.4/test/testloadso.c b/3rdparty/sdl2-2.0.4/test/testloadso.c new file mode 100644 index 0000000000..fb87fbed7a --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testloadso.c @@ -0,0 +1,82 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Test program to test dynamic loading with the loadso subsystem. +*/ + +#include +#include +#include + +#include "SDL.h" + +typedef int (*fntype) (const char *); + +int +main(int argc, char *argv[]) +{ + int retval = 0; + int hello = 0; + const char *libname = NULL; + const char *symname = NULL; + void *lib = NULL; + fntype fn = NULL; + + if (argc != 3) { + const char *app = argv[0]; + SDL_Log("USAGE: %s \n", app); + SDL_Log(" %s --hello \n", app); + return 1; + } + + /* Initialize SDL */ + if (SDL_Init(0) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 2; + } + + if (strcmp(argv[1], "--hello") == 0) { + hello = 1; + libname = argv[2]; + symname = "puts"; + } else { + libname = argv[1]; + symname = argv[2]; + } + + lib = SDL_LoadObject(libname); + if (lib == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_LoadObject('%s') failed: %s\n", + libname, SDL_GetError()); + retval = 3; + } else { + fn = (fntype) SDL_LoadFunction(lib, symname); + if (fn == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_LoadFunction('%s') failed: %s\n", + symname, SDL_GetError()); + retval = 4; + } else { + SDL_Log("Found %s in %s at %p\n", symname, libname, fn); + if (hello) { + SDL_Log("Calling function...\n"); + fflush(stdout); + fn(" HELLO, WORLD!\n"); + SDL_Log("...apparently, we survived. :)\n"); + SDL_Log("Unloading library...\n"); + fflush(stdout); + } + } + SDL_UnloadObject(lib); + } + SDL_Quit(); + return retval; +} diff --git a/3rdparty/sdl2-2.0.4/test/testlock.c b/3rdparty/sdl2-2.0.4/test/testlock.c new file mode 100644 index 0000000000..1106ec3bf0 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testlock.c @@ -0,0 +1,126 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Test the thread and mutex locking functions + Also exercises the system's signal/thread interaction +*/ + +#include +#include +#include /* for atexit() */ + +#include "SDL.h" + +static SDL_mutex *mutex = NULL; +static SDL_threadID mainthread; +static SDL_Thread *threads[6]; +static volatile int doterminate = 0; + +/* + * SDL_Quit() shouldn't be used with atexit() directly because + * calling conventions may differ... + */ +static void +SDL_Quit_Wrapper(void) +{ + SDL_Quit(); +} + +void +printid(void) +{ + SDL_Log("Process %lu: exiting\n", SDL_ThreadID()); +} + +void +terminate(int sig) +{ + signal(SIGINT, terminate); + doterminate = 1; +} + +void +closemutex(int sig) +{ + SDL_threadID id = SDL_ThreadID(); + int i; + SDL_Log("Process %lu: Cleaning up...\n", id == mainthread ? 0 : id); + doterminate = 1; + for (i = 0; i < 6; ++i) + SDL_WaitThread(threads[i], NULL); + SDL_DestroyMutex(mutex); + exit(sig); +} + +int SDLCALL +Run(void *data) +{ + if (SDL_ThreadID() == mainthread) + signal(SIGTERM, closemutex); + while (!doterminate) { + SDL_Log("Process %lu ready to work\n", SDL_ThreadID()); + if (SDL_LockMutex(mutex) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't lock mutex: %s", SDL_GetError()); + exit(1); + } + SDL_Log("Process %lu, working!\n", SDL_ThreadID()); + SDL_Delay(1 * 1000); + SDL_Log("Process %lu, done!\n", SDL_ThreadID()); + if (SDL_UnlockMutex(mutex) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't unlock mutex: %s", SDL_GetError()); + exit(1); + } + /* If this sleep isn't done, then threads may starve */ + SDL_Delay(10); + } + if (SDL_ThreadID() == mainthread && doterminate) { + SDL_Log("Process %lu: raising SIGTERM\n", SDL_ThreadID()); + raise(SIGTERM); + } + return (0); +} + +int +main(int argc, char *argv[]) +{ + int i; + int maxproc = 6; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(0) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError()); + exit(1); + } + atexit(SDL_Quit_Wrapper); + + if ((mutex = SDL_CreateMutex()) == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create mutex: %s\n", SDL_GetError()); + exit(1); + } + + mainthread = SDL_ThreadID(); + SDL_Log("Main thread: %lu\n", mainthread); + atexit(printid); + for (i = 0; i < maxproc; ++i) { + char name[64]; + SDL_snprintf(name, sizeof (name), "Worker%d", i); + if ((threads[i] = SDL_CreateThread(Run, name, NULL)) == NULL) + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread!\n"); + } + signal(SIGINT, terminate); + Run(NULL); + + return (0); /* Never reached */ +} diff --git a/3rdparty/sdl2-2.0.4/test/testmessage.c b/3rdparty/sdl2-2.0.4/test/testmessage.c new file mode 100644 index 0000000000..91968c322c --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testmessage.c @@ -0,0 +1,193 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Simple test of the SDL MessageBox API */ + +#include +#include +#include + +#include "SDL.h" + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDL_Quit(); + exit(rc); +} + +static int +button_messagebox(void *eventNumber) +{ + const SDL_MessageBoxButtonData buttons[] = { + { + SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, + 0, + "OK" + },{ + SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, + 1, + "Cancel" + }, + }; + + SDL_MessageBoxData data = { + SDL_MESSAGEBOX_INFORMATION, + NULL, /* no parent window */ + "Custom MessageBox", + "This is a custom messagebox", + 2, + buttons, + NULL /* Default color scheme */ + }; + + int button = -1; + int success = 0; + if (eventNumber) { + data.message = "This is a custom messagebox from a background thread."; + } + + success = SDL_ShowMessageBox(&data, &button); + if (success == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); + if (eventNumber) { + SDL_UserEvent event; + event.type = (intptr_t)eventNumber; + SDL_PushEvent((SDL_Event*)&event); + return 1; + } else { + quit(2); + } + } + SDL_Log("Pressed button: %d, %s\n", button, button == -1 ? "[closed]" : button == 1 ? "Cancel" : "OK"); + + if (eventNumber) { + SDL_UserEvent event; + event.type = (intptr_t)eventNumber; + SDL_PushEvent((SDL_Event*)&event); + } + + return 0; +} + +int +main(int argc, char *argv[]) +{ + int success; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, + "Simple MessageBox", + "This is a simple error MessageBox", + NULL); + if (success == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); + quit(1); + } + + success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, + "Simple MessageBox", + "This is a simple MessageBox with a newline:\r\nHello world!", + NULL); + if (success == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); + quit(1); + } + + /* Google says this is Traditional Chinese for "beef with broccoli" */ + success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, + "UTF-8 Simple MessageBox", + "Unicode text: '牛肉西蘭花' ...", + NULL); + if (success == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); + quit(1); + } + + /* Google says this is Traditional Chinese for "beef with broccoli" */ + success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, + "UTF-8 Simple MessageBox", + "Unicode text and newline:\r\n'牛肉西蘭花'\n'牛肉西蘭花'", + NULL); + if (success == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); + quit(1); + } + + /* Google says this is Traditional Chinese for "beef with broccoli" */ + success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, + "牛肉西蘭花", + "Unicode text in the title.", + NULL); + if (success == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); + quit(1); + } + + button_messagebox(NULL); + + /* Test showing a message box from a background thread. + + On Mac OS X, the video subsystem needs to be initialized for this + to work, since the message box events are dispatched by the Cocoa + subsystem on the main thread. + */ + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL video subsystem: %s\n", SDL_GetError()); + return (1); + } + { + int status = 0; + SDL_Event event; + intptr_t eventNumber = SDL_RegisterEvents(1); + SDL_Thread* thread = SDL_CreateThread(&button_messagebox, "MessageBox", (void*)eventNumber); + + while (SDL_WaitEvent(&event)) + { + if (event.type == eventNumber) { + break; + } + } + + SDL_WaitThread(thread, &status); + + SDL_Log("Message box thread return %i\n", status); + } + + /* Test showing a message box with a parent window */ + { + SDL_Event event; + SDL_Window *window = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, 0); + + success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, + "Simple MessageBox", + "This is a simple error MessageBox with a parent window", + window); + if (success == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); + quit(1); + } + + while (SDL_WaitEvent(&event)) + { + if (event.type == SDL_QUIT || event.type == SDL_KEYUP) { + break; + } + } + } + + SDL_Quit(); + return (0); +} diff --git a/3rdparty/sdl2-2.0.4/test/testmultiaudio.c b/3rdparty/sdl2-2.0.4/test/testmultiaudio.c new file mode 100644 index 0000000000..117ef2696c --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testmultiaudio.c @@ -0,0 +1,200 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +#include "SDL.h" + +#include /* for fflush() and stdout */ + +#ifdef __EMSCRIPTEN__ +#include +#endif + +static SDL_AudioSpec spec; +static Uint8 *sound = NULL; /* Pointer to wave data */ +static Uint32 soundlen = 0; /* Length of wave data */ + +typedef struct +{ + SDL_AudioDeviceID dev; + int soundpos; + volatile int done; +} callback_data; + +callback_data cbd[64]; + +void SDLCALL +play_through_once(void *arg, Uint8 * stream, int len) +{ + callback_data *cbd = (callback_data *) arg; + Uint8 *waveptr = sound + cbd->soundpos; + int waveleft = soundlen - cbd->soundpos; + int cpy = len; + if (cpy > waveleft) + cpy = waveleft; + + SDL_memcpy(stream, waveptr, cpy); + len -= cpy; + cbd->soundpos += cpy; + if (len > 0) { + stream += cpy; + SDL_memset(stream, spec.silence, len); + cbd->done++; + } +} + +void +loop() +{ + if(cbd[0].done) { +#ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); +#endif + SDL_PauseAudioDevice(cbd[0].dev, 1); + SDL_CloseAudioDevice(cbd[0].dev); + SDL_FreeWAV(sound); + SDL_Quit(); + } +} + +static void +test_multi_audio(int devcount) +{ + int keep_going = 1; + int i; + +#ifdef __ANDROID__ + SDL_Event event; + + /* Create a Window to get fully initialized event processing for testing pause on Android. */ + SDL_CreateWindow("testmultiaudio", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 320, 240, 0); +#endif + + if (devcount > 64) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Too many devices (%d), clamping to 64...\n", + devcount); + devcount = 64; + } + + spec.callback = play_through_once; + + for (i = 0; i < devcount; i++) { + const char *devname = SDL_GetAudioDeviceName(i, 0); + SDL_Log("playing on device #%d: ('%s')...", i, devname); + fflush(stdout); + + SDL_memset(&cbd[0], '\0', sizeof(callback_data)); + spec.userdata = &cbd[0]; + cbd[0].dev = SDL_OpenAudioDevice(devname, 0, &spec, NULL, 0); + if (cbd[0].dev == 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Open device failed: %s\n", SDL_GetError()); + } else { + SDL_PauseAudioDevice(cbd[0].dev, 0); +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!cbd[0].done) + { + #ifdef __ANDROID__ + /* Empty queue, some application events would prevent pause. */ + while (SDL_PollEvent(&event)){} + #endif + SDL_Delay(100); + } + SDL_PauseAudioDevice(cbd[0].dev, 1); +#endif + SDL_Log("done.\n"); + SDL_CloseAudioDevice(cbd[0].dev); + } + } + + SDL_memset(cbd, '\0', sizeof(cbd)); + + SDL_Log("playing on all devices...\n"); + for (i = 0; i < devcount; i++) { + const char *devname = SDL_GetAudioDeviceName(i, 0); + spec.userdata = &cbd[i]; + cbd[i].dev = SDL_OpenAudioDevice(devname, 0, &spec, NULL, 0); + if (cbd[i].dev == 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Open device %d failed: %s\n", i, SDL_GetError()); + } + } + + for (i = 0; i < devcount; i++) { + if (cbd[i].dev) { + SDL_PauseAudioDevice(cbd[i].dev, 0); + } + } + + while (keep_going) { + keep_going = 0; + for (i = 0; i < devcount; i++) { + if ((cbd[i].dev) && (!cbd[i].done)) { + keep_going = 1; + } + } + #ifdef __ANDROID__ + /* Empty queue, some application events would prevent pause. */ + while (SDL_PollEvent(&event)){} + #endif + + SDL_Delay(100); + } + +#ifndef __EMSCRIPTEN__ + for (i = 0; i < devcount; i++) { + if (cbd[i].dev) { + SDL_PauseAudioDevice(cbd[i].dev, 1); + SDL_CloseAudioDevice(cbd[i].dev); + } + } + + SDL_Log("All done!\n"); +#endif +} + + +int +main(int argc, char **argv) +{ + int devcount = 0; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(SDL_INIT_AUDIO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return (1); + } + + SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver()); + + devcount = SDL_GetNumAudioDevices(0); + if (devcount < 1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Don't see any specific audio devices!\n"); + } else { + if (argv[1] == NULL) { + argv[1] = "sample.wav"; + } + + /* Load the wave file into memory */ + if (SDL_LoadWAV(argv[1], &spec, &sound, &soundlen) == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", argv[1], + SDL_GetError()); + } else { + test_multi_audio(devcount); + SDL_FreeWAV(sound); + } + } + + SDL_Quit(); + return 0; +} diff --git a/3rdparty/sdl2-2.0.0/test/testnative.c b/3rdparty/sdl2-2.0.4/test/testnative.c similarity index 85% rename from 3rdparty/sdl2-2.0.0/test/testnative.c rename to 3rdparty/sdl2-2.0.4/test/testnative.c index 63cba29c3a..049c4c83e9 100644 --- a/3rdparty/sdl2-2.0.0/test/testnative.c +++ b/3rdparty/sdl2-2.0.4/test/testnative.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -58,7 +58,7 @@ LoadSprite(SDL_Renderer *renderer, char *file) /* Load the sprite image */ temp = SDL_LoadBMP(file); if (temp == NULL) { - fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError()); return 0; } @@ -70,7 +70,7 @@ LoadSprite(SDL_Renderer *renderer, char *file) /* Create textures from the image */ sprite = SDL_CreateTextureFromSurface(renderer, temp); if (!sprite) { - fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); SDL_FreeSurface(temp); return 0; } @@ -131,8 +131,11 @@ main(int argc, char *argv[]) int sprite_w, sprite_h; SDL_Event event; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + if (SDL_VideoInit(NULL) < 0) { - fprintf(stderr, "Couldn't initialize SDL video: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL video: %s\n", SDL_GetError()); exit(1); } @@ -146,19 +149,19 @@ main(int argc, char *argv[]) } } if (!factory) { - fprintf(stderr, "Couldn't find native window code for %s driver\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find native window code for %s driver\n", driver); quit(2); } - printf("Creating native window for %s driver\n", driver); + SDL_Log("Creating native window for %s driver\n", driver); native_window = factory->CreateNativeWindow(WINDOW_W, WINDOW_H); if (!native_window) { - fprintf(stderr, "Couldn't create native window\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create native window\n"); quit(3); } window = SDL_CreateWindowFrom(native_window); if (!window) { - fprintf(stderr, "Couldn't create SDL window: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create SDL window: %s\n", SDL_GetError()); quit(4); } SDL_SetWindowTitle(window, "SDL Native Window Test"); @@ -166,7 +169,7 @@ main(int argc, char *argv[]) /* Create the renderer */ renderer = SDL_CreateRenderer(window, -1, 0); if (!renderer) { - fprintf(stderr, "Couldn't create renderer: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); quit(5); } @@ -185,7 +188,7 @@ main(int argc, char *argv[]) positions = (SDL_Rect *) SDL_malloc(NUM_SPRITES * sizeof(SDL_Rect)); velocities = (SDL_Rect *) SDL_malloc(NUM_SPRITES * sizeof(SDL_Rect)); if (!positions || !velocities) { - fprintf(stderr, "Out of memory!\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } srand(time(NULL)); diff --git a/3rdparty/sdl2-2.0.0/test/testnative.h b/3rdparty/sdl2-2.0.4/test/testnative.h similarity index 95% rename from 3rdparty/sdl2-2.0.0/test/testnative.h rename to 3rdparty/sdl2-2.0.4/test/testnative.h index 275c0d616d..ed2bf7e52c 100644 --- a/3rdparty/sdl2-2.0.0/test/testnative.h +++ b/3rdparty/sdl2-2.0.4/test/testnative.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/3rdparty/sdl2-2.0.0/test/testnativecocoa.m b/3rdparty/sdl2-2.0.4/test/testnativecocoa.m similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/testnativecocoa.m rename to 3rdparty/sdl2-2.0.4/test/testnativecocoa.m diff --git a/3rdparty/sdl2-2.0.0/test/testnativew32.c b/3rdparty/sdl2-2.0.4/test/testnativew32.c similarity index 97% rename from 3rdparty/sdl2-2.0.0/test/testnativew32.c rename to 3rdparty/sdl2-2.0.4/test/testnativew32.c index 2cb57ddebf..aaea267d26 100644 --- a/3rdparty/sdl2-2.0.0/test/testnativew32.c +++ b/3rdparty/sdl2-2.0.4/test/testnativew32.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/3rdparty/sdl2-2.0.0/test/testnativex11.c b/3rdparty/sdl2-2.0.4/test/testnativex11.c similarity index 94% rename from 3rdparty/sdl2-2.0.0/test/testnativex11.c rename to 3rdparty/sdl2-2.0.4/test/testnativex11.c index 9f4150c493..69fa37bbf1 100644 --- a/3rdparty/sdl2-2.0.0/test/testnativex11.c +++ b/3rdparty/sdl2-2.0.4/test/testnativex11.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/3rdparty/sdl2-2.0.4/test/testoverlay2.c b/3rdparty/sdl2-2.0.4/test/testoverlay2.c new file mode 100644 index 0000000000..453f0f443a --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testoverlay2.c @@ -0,0 +1,511 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +/******************************************************************************** + * * + * Test of the overlay used for moved pictures, test more closed to real life. * + * Running trojan moose :) Coded by Mike Gorchak. * + * * + ********************************************************************************/ + +#include +#include +#include + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "SDL.h" + +#define MOOSEPIC_W 64 +#define MOOSEPIC_H 88 + +#define MOOSEFRAME_SIZE (MOOSEPIC_W * MOOSEPIC_H) +#define MOOSEFRAMES_COUNT 10 + +SDL_Color MooseColors[84] = { + {49, 49, 49} + , {66, 24, 0} + , {66, 33, 0} + , {66, 66, 66} + , + {66, 115, 49} + , {74, 33, 0} + , {74, 41, 16} + , {82, 33, 8} + , + {82, 41, 8} + , {82, 49, 16} + , {82, 82, 82} + , {90, 41, 8} + , + {90, 41, 16} + , {90, 57, 24} + , {99, 49, 16} + , {99, 66, 24} + , + {99, 66, 33} + , {99, 74, 33} + , {107, 57, 24} + , {107, 82, 41} + , + {115, 57, 33} + , {115, 66, 33} + , {115, 66, 41} + , {115, 74, 0} + , + {115, 90, 49} + , {115, 115, 115} + , {123, 82, 0} + , {123, 99, 57} + , + {132, 66, 41} + , {132, 74, 41} + , {132, 90, 8} + , {132, 99, 33} + , + {132, 99, 66} + , {132, 107, 66} + , {140, 74, 49} + , {140, 99, 16} + , + {140, 107, 74} + , {140, 115, 74} + , {148, 107, 24} + , {148, 115, 82} + , + {148, 123, 74} + , {148, 123, 90} + , {156, 115, 33} + , {156, 115, 90} + , + {156, 123, 82} + , {156, 132, 82} + , {156, 132, 99} + , {156, 156, 156} + , + {165, 123, 49} + , {165, 123, 90} + , {165, 132, 82} + , {165, 132, 90} + , + {165, 132, 99} + , {165, 140, 90} + , {173, 132, 57} + , {173, 132, 99} + , + {173, 140, 107} + , {173, 140, 115} + , {173, 148, 99} + , {173, 173, 173} + , + {181, 140, 74} + , {181, 148, 115} + , {181, 148, 123} + , {181, 156, 107} + , + {189, 148, 123} + , {189, 156, 82} + , {189, 156, 123} + , {189, 156, 132} + , + {189, 189, 189} + , {198, 156, 123} + , {198, 165, 132} + , {206, 165, 99} + , + {206, 165, 132} + , {206, 173, 140} + , {206, 206, 206} + , {214, 173, 115} + , + {214, 173, 140} + , {222, 181, 148} + , {222, 189, 132} + , {222, 189, 156} + , + {222, 222, 222} + , {231, 198, 165} + , {231, 231, 231} + , {239, 206, 173} +}; + +Uint8 MooseFrame[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE*2]; +SDL_Texture *MooseTexture; +SDL_Rect displayrect; +int window_w; +int window_h; +SDL_Window *window; +SDL_Renderer *renderer; +int paused = 0; +int i; +SDL_bool done = SDL_FALSE; +Uint32 pixel_format = SDL_PIXELFORMAT_YV12; +int fpsdelay; + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDL_Quit(); + exit(rc); +} + +/* All RGB2YUV conversion code and some other parts of code has been taken from testoverlay.c */ + +/* NOTE: These RGB conversion functions are not intended for speed, + only as examples. +*/ + +void +RGBtoYUV(Uint8 * rgb, int *yuv, int monochrome, int luminance) +{ + if (monochrome) { +#if 1 /* these are the two formulas that I found on the FourCC site... */ + yuv[0] = (int)(0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]); + yuv[1] = 128; + yuv[2] = 128; +#else + yuv[0] = (int)(0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16; + yuv[1] = 128; + yuv[2] = 128; +#endif + } else { +#if 1 /* these are the two formulas that I found on the FourCC site... */ + yuv[0] = (int)(0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]); + yuv[1] = (int)((rgb[2] - yuv[0]) * 0.565 + 128); + yuv[2] = (int)((rgb[0] - yuv[0]) * 0.713 + 128); +#else + yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16; + yuv[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]); + yuv[2] = 128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]); +#endif + } + + if (luminance != 100) { + yuv[0] = yuv[0] * luminance / 100; + if (yuv[0] > 255) + yuv[0] = 255; + } +} + +void +ConvertRGBtoYV12(Uint8 *rgb, Uint8 *out, int w, int h, + int monochrome, int luminance) +{ + int x, y; + int yuv[3]; + Uint8 *op[3]; + + op[0] = out; + op[1] = op[0] + w*h; + op[2] = op[1] + w*h/4; + for (y = 0; y < h; ++y) { + for (x = 0; x < w; ++x) { + RGBtoYUV(rgb, yuv, monochrome, luminance); + *(op[0]++) = yuv[0]; + if (x % 2 == 0 && y % 2 == 0) { + *(op[1]++) = yuv[2]; + *(op[2]++) = yuv[1]; + } + rgb += 3; + } + } +} + +void +ConvertRGBtoNV12(Uint8 *rgb, Uint8 *out, int w, int h, + int monochrome, int luminance) +{ + int x, y; + int yuv[3]; + Uint8 *op[2]; + + op[0] = out; + op[1] = op[0] + w*h; + for (y = 0; y < h; ++y) { + for (x = 0; x < w; ++x) { + RGBtoYUV(rgb, yuv, monochrome, luminance); + *(op[0]++) = yuv[0]; + if (x % 2 == 0 && y % 2 == 0) { + *(op[1]++) = yuv[1]; + *(op[1]++) = yuv[2]; + } + rgb += 3; + } + } +} + +static void +PrintUsage(char *argv0) +{ + SDL_Log("Usage: %s [arg] [arg] [arg] ...\n", argv0); + SDL_Log("\n"); + SDL_Log("Where 'arg' is any of the following options:\n"); + SDL_Log("\n"); + SDL_Log(" -fps \n"); + SDL_Log(" -nodelay\n"); + SDL_Log(" -format (one of the: YV12, IYUV, YUY2, UYVY, YVYU)\n"); + SDL_Log(" -scale (initial scale of the overlay)\n"); + SDL_Log(" -help (shows this help)\n"); + SDL_Log("\n"); + SDL_Log("Press ESC to exit, or SPACE to freeze the movie while application running.\n"); + SDL_Log("\n"); +} + +void +loop() +{ + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_WINDOWEVENT: + if (event.window.event == SDL_WINDOWEVENT_RESIZED) { + SDL_RenderSetViewport(renderer, NULL); + displayrect.w = window_w = event.window.data1; + displayrect.h = window_h = event.window.data2; + } + break; + case SDL_MOUSEBUTTONDOWN: + displayrect.x = event.button.x - window_w / 2; + displayrect.y = event.button.y - window_h / 2; + break; + case SDL_MOUSEMOTION: + if (event.motion.state) { + displayrect.x = event.motion.x - window_w / 2; + displayrect.y = event.motion.y - window_h / 2; + } + break; + case SDL_KEYDOWN: + if (event.key.keysym.sym == SDLK_SPACE) { + paused = !paused; + break; + } + if (event.key.keysym.sym != SDLK_ESCAPE) { + break; + } + case SDL_QUIT: + done = SDL_TRUE; + break; + } + } + +#ifndef __EMSCRIPTEN__ + SDL_Delay(fpsdelay); +#endif + + if (!paused) { + i = (i + 1) % MOOSEFRAMES_COUNT; + + SDL_UpdateTexture(MooseTexture, NULL, MooseFrame[i], MOOSEPIC_W*SDL_BYTESPERPIXEL(pixel_format)); + } + SDL_RenderClear(renderer); + SDL_RenderCopy(renderer, MooseTexture, NULL, &displayrect); + SDL_RenderPresent(renderer); + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +int +main(int argc, char **argv) +{ + Uint8 *RawMooseData; + SDL_RWops *handle; + SDL_Window *window; + int j; + int fps = 12; + int fpsdelay; + int nodelay = 0; +#ifdef TEST_NV12 + Uint32 pixel_format = SDL_PIXELFORMAT_NV12; +#else + Uint32 pixel_format = SDL_PIXELFORMAT_YV12; +#endif + int scale = 5; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 3; + } + + while (argc > 1) { + if (strcmp(argv[1], "-fps") == 0) { + if (argv[2]) { + fps = atoi(argv[2]); + if (fps == 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, + "The -fps option requires an argument [from 1 to 1000], default is 12.\n"); + quit(10); + } + if ((fps < 0) || (fps > 1000)) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, + "The -fps option must be in range from 1 to 1000, default is 12.\n"); + quit(10); + } + argv += 2; + argc -= 2; + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, + "The -fps option requires an argument [from 1 to 1000], default is 12.\n"); + quit(10); + } + } else if (strcmp(argv[1], "-nodelay") == 0) { + nodelay = 1; + argv += 1; + argc -= 1; + } else if (strcmp(argv[1], "-scale") == 0) { + if (argv[2]) { + scale = atoi(argv[2]); + if (scale == 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, + "The -scale option requires an argument [from 1 to 50], default is 5.\n"); + quit(10); + } + if ((scale < 0) || (scale > 50)) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, + "The -scale option must be in range from 1 to 50, default is 5.\n"); + quit(10); + } + argv += 2; + argc -= 2; + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, + "The -fps option requires an argument [from 1 to 1000], default is 12.\n"); + quit(10); + } + } else if ((strcmp(argv[1], "-help") == 0) + || (strcmp(argv[1], "-h") == 0)) { + PrintUsage(argv[0]); + quit(0); + } else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unrecognized option: %s.\n", argv[1]); + quit(10); + } + break; + } + + RawMooseData = (Uint8 *) malloc(MOOSEFRAME_SIZE * MOOSEFRAMES_COUNT); + if (RawMooseData == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't allocate memory for movie !\n"); + free(RawMooseData); + quit(1); + } + + /* load the trojan moose images */ + handle = SDL_RWFromFile("moose.dat", "rb"); + if (handle == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't find the file moose.dat !\n"); + free(RawMooseData); + quit(2); + } + + SDL_RWread(handle, RawMooseData, MOOSEFRAME_SIZE, MOOSEFRAMES_COUNT); + + SDL_RWclose(handle); + + /* Create the window and renderer */ + window_w = MOOSEPIC_W * scale; + window_h = MOOSEPIC_H * scale; + window = SDL_CreateWindow("Happy Moose", + SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, + window_w, window_h, + SDL_WINDOW_RESIZABLE); + if (!window) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create window: %s\n", SDL_GetError()); + free(RawMooseData); + quit(4); + } + + renderer = SDL_CreateRenderer(window, -1, 0); + if (!renderer) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create renderer: %s\n", SDL_GetError()); + free(RawMooseData); + quit(4); + } + + MooseTexture = SDL_CreateTexture(renderer, pixel_format, SDL_TEXTUREACCESS_STREAMING, MOOSEPIC_W, MOOSEPIC_H); + if (!MooseTexture) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create texture: %s\n", SDL_GetError()); + free(RawMooseData); + quit(5); + } + /* Uncomment this to check vertex color with a YUV texture */ + /* SDL_SetTextureColorMod(MooseTexture, 0xff, 0x80, 0x80); */ + + for (i = 0; i < MOOSEFRAMES_COUNT; i++) { + Uint8 MooseFrameRGB[MOOSEFRAME_SIZE*3]; + Uint8 *rgb; + Uint8 *frame; + + rgb = MooseFrameRGB; + frame = RawMooseData + i * MOOSEFRAME_SIZE; + for (j = 0; j < MOOSEFRAME_SIZE; ++j) { + rgb[0] = MooseColors[frame[j]].r; + rgb[1] = MooseColors[frame[j]].g; + rgb[2] = MooseColors[frame[j]].b; + rgb += 3; + } + switch (pixel_format) { + case SDL_PIXELFORMAT_YV12: + ConvertRGBtoYV12(MooseFrameRGB, MooseFrame[i], MOOSEPIC_W, MOOSEPIC_H, 0, 100); + break; + case SDL_PIXELFORMAT_NV12: + ConvertRGBtoNV12(MooseFrameRGB, MooseFrame[i], MOOSEPIC_W, MOOSEPIC_H, 0, 100); + break; + default: + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unsupported pixel format\n"); + break; + } + } + + free(RawMooseData); + + /* set the start frame */ + i = 0; + if (nodelay) { + fpsdelay = 0; + } else { + fpsdelay = 1000 / fps; + } + + displayrect.x = 0; + displayrect.y = 0; + displayrect.w = window_w; + displayrect.h = window_h; + + /* Ignore key up events, they don't even get filtered */ + SDL_EventState(SDL_KEYUP, SDL_IGNORE); + + /* Loop, waiting for QUIT or RESIZE */ +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, nodelay ? 0 : fps, 1); +#else + while (!done) { + loop(); + } +#endif + + SDL_DestroyRenderer(renderer); + quit(0); + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/3rdparty/sdl2-2.0.4/test/testplatform.c b/3rdparty/sdl2-2.0.4/test/testplatform.c new file mode 100644 index 0000000000..14acac4b11 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testplatform.c @@ -0,0 +1,204 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +#include + +#include "SDL.h" + +/* + * Watcom C flags these as Warning 201: "Unreachable code" if you just + * compare them directly, so we push it through a function to keep the + * compiler quiet. --ryan. + */ +static int +badsize(size_t sizeoftype, size_t hardcodetype) +{ + return sizeoftype != hardcodetype; +} + +int +TestTypes(SDL_bool verbose) +{ + int error = 0; + + if (badsize(sizeof(Uint8), 1)) { + if (verbose) + SDL_Log("sizeof(Uint8) != 1, instead = %u\n", + (unsigned int)sizeof(Uint8)); + ++error; + } + if (badsize(sizeof(Uint16), 2)) { + if (verbose) + SDL_Log("sizeof(Uint16) != 2, instead = %u\n", + (unsigned int)sizeof(Uint16)); + ++error; + } + if (badsize(sizeof(Uint32), 4)) { + if (verbose) + SDL_Log("sizeof(Uint32) != 4, instead = %u\n", + (unsigned int)sizeof(Uint32)); + ++error; + } + if (badsize(sizeof(Uint64), 8)) { + if (verbose) + SDL_Log("sizeof(Uint64) != 8, instead = %u\n", + (unsigned int)sizeof(Uint64)); + ++error; + } + if (verbose && !error) + SDL_Log("All data types are the expected size.\n"); + + return (error ? 1 : 0); +} + +int +TestEndian(SDL_bool verbose) +{ + int error = 0; + Uint16 value = 0x1234; + int real_byteorder; + Uint16 value16 = 0xCDAB; + Uint16 swapped16 = 0xABCD; + Uint32 value32 = 0xEFBEADDE; + Uint32 swapped32 = 0xDEADBEEF; + Uint64 value64, swapped64; + + value64 = 0xEFBEADDE; + value64 <<= 32; + value64 |= 0xCDAB3412; + swapped64 = 0x1234ABCD; + swapped64 <<= 32; + swapped64 |= 0xDEADBEEF; + + if (verbose) { + SDL_Log("Detected a %s endian machine.\n", + (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big"); + } + if ((*((char *) &value) >> 4) == 0x1) { + real_byteorder = SDL_BIG_ENDIAN; + } else { + real_byteorder = SDL_LIL_ENDIAN; + } + if (real_byteorder != SDL_BYTEORDER) { + if (verbose) { + SDL_Log("Actually a %s endian machine!\n", + (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big"); + } + ++error; + } + if (verbose) { + SDL_Log("Value 16 = 0x%X, swapped = 0x%X\n", value16, + SDL_Swap16(value16)); + } + if (SDL_Swap16(value16) != swapped16) { + if (verbose) { + SDL_Log("16 bit value swapped incorrectly!\n"); + } + ++error; + } + if (verbose) { + SDL_Log("Value 32 = 0x%X, swapped = 0x%X\n", value32, + SDL_Swap32(value32)); + } + if (SDL_Swap32(value32) != swapped32) { + if (verbose) { + SDL_Log("32 bit value swapped incorrectly!\n"); + } + ++error; + } + if (verbose) { + SDL_Log("Value 64 = 0x%"SDL_PRIX64", swapped = 0x%"SDL_PRIX64"\n", value64, + SDL_Swap64(value64)); + } + if (SDL_Swap64(value64) != swapped64) { + if (verbose) { + SDL_Log("64 bit value swapped incorrectly!\n"); + } + ++error; + } + return (error ? 1 : 0); +} + + +int +TestCPUInfo(SDL_bool verbose) +{ + if (verbose) { + SDL_Log("CPU count: %d\n", SDL_GetCPUCount()); + SDL_Log("CPU cache line size: %d\n", SDL_GetCPUCacheLineSize()); + SDL_Log("RDTSC %s\n", SDL_HasRDTSC()? "detected" : "not detected"); + SDL_Log("AltiVec %s\n", SDL_HasAltiVec()? "detected" : "not detected"); + SDL_Log("MMX %s\n", SDL_HasMMX()? "detected" : "not detected"); + SDL_Log("3DNow! %s\n", SDL_Has3DNow()? "detected" : "not detected"); + SDL_Log("SSE %s\n", SDL_HasSSE()? "detected" : "not detected"); + SDL_Log("SSE2 %s\n", SDL_HasSSE2()? "detected" : "not detected"); + SDL_Log("SSE3 %s\n", SDL_HasSSE3()? "detected" : "not detected"); + SDL_Log("SSE4.1 %s\n", SDL_HasSSE41()? "detected" : "not detected"); + SDL_Log("SSE4.2 %s\n", SDL_HasSSE42()? "detected" : "not detected"); + SDL_Log("AVX %s\n", SDL_HasAVX()? "detected" : "not detected"); + SDL_Log("System RAM %d MB\n", SDL_GetSystemRAM()); + } + return (0); +} + +int +TestAssertions(SDL_bool verbose) +{ + SDL_assert(1); + SDL_assert_release(1); + SDL_assert_paranoid(1); + SDL_assert(0 || 1); + SDL_assert_release(0 || 1); + SDL_assert_paranoid(0 || 1); + +#if 0 /* enable this to test assertion failures. */ + SDL_assert_release(1 == 2); + SDL_assert_release(5 < 4); + SDL_assert_release(0 && "This is a test"); +#endif + + { + const SDL_AssertData *item = SDL_GetAssertionReport(); + while (item) { + SDL_Log("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n", + item->condition, item->function, item->filename, + item->linenum, item->trigger_count, + item->always_ignore ? "yes" : "no"); + item = item->next; + } + } + return (0); +} + +int +main(int argc, char *argv[]) +{ + SDL_bool verbose = SDL_TRUE; + int status = 0; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (argv[1] && (SDL_strcmp(argv[1], "-q") == 0)) { + verbose = SDL_FALSE; + } + if (verbose) { + SDL_Log("This system is running %s\n", SDL_GetPlatform()); + } + + status += TestTypes(verbose); + status += TestEndian(verbose); + status += TestCPUInfo(verbose); + status += TestAssertions(verbose); + + return status; +} diff --git a/3rdparty/sdl2-2.0.4/test/testpower.c b/3rdparty/sdl2-2.0.4/test/testpower.c new file mode 100644 index 0000000000..300d21a24d --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testpower.c @@ -0,0 +1,80 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +/* Simple test of power subsystem. */ + +#include +#include "SDL.h" + +static void +report_power(void) +{ + int seconds, percent; + const SDL_PowerState state = SDL_GetPowerInfo(&seconds, &percent); + char *statestr = NULL; + + SDL_Log("SDL-reported power info...\n"); + switch (state) { + case SDL_POWERSTATE_UNKNOWN: + statestr = "Unknown"; + break; + case SDL_POWERSTATE_ON_BATTERY: + statestr = "On battery"; + break; + case SDL_POWERSTATE_NO_BATTERY: + statestr = "No battery"; + break; + case SDL_POWERSTATE_CHARGING: + statestr = "Charging"; + break; + case SDL_POWERSTATE_CHARGED: + statestr = "Charged"; + break; + default: + statestr = "!!API ERROR!!"; + break; + } + + SDL_Log("State: %s\n", statestr); + + if (percent == -1) { + SDL_Log("Percent left: unknown\n"); + } else { + SDL_Log("Percent left: %d%%\n", percent); + } + + if (seconds == -1) { + SDL_Log("Time left: unknown\n"); + } else { + SDL_Log("Time left: %d minutes, %d seconds\n", (int) (seconds / 60), + (int) (seconds % 60)); + } +} + + +int +main(int argc, char *argv[]) +{ + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (SDL_Init(0) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init() failed: %s\n", SDL_GetError()); + return 1; + } + + report_power(); + + SDL_Quit(); + return 0; +} + +/* end of testpower.c ... */ diff --git a/3rdparty/sdl2-2.0.4/test/testrelative.c b/3rdparty/sdl2-2.0.4/test/testrelative.c new file mode 100644 index 0000000000..59d23f6388 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testrelative.c @@ -0,0 +1,126 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Simple program: Test relative mouse motion */ + +#include +#include +#include + +#include "SDL_test_common.h" + +#ifdef __EMSCRIPTEN__ +#include +#endif + +static SDLTest_CommonState *state; +int i, done; +SDL_Rect rect; +SDL_Event event; + +static void +DrawRects(SDL_Renderer * renderer, SDL_Rect * rect) +{ + SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); + SDL_RenderFillRect(renderer, rect); +} + +static void +loop(){ + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + switch(event.type) { + case SDL_MOUSEMOTION: + { + rect.x += event.motion.xrel; + rect.y += event.motion.yrel; + } + break; + } + } + for (i = 0; i < state->num_windows; ++i) { + SDL_Rect viewport; + SDL_Renderer *renderer = state->renderers[i]; + if (state->windows[i] == NULL) + continue; + SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); + SDL_RenderClear(renderer); + + /* Wrap the cursor rectangle at the screen edges to keep it visible */ + SDL_RenderGetViewport(renderer, &viewport); + if (rect.x < viewport.x) rect.x += viewport.w; + if (rect.y < viewport.y) rect.y += viewport.h; + if (rect.x > viewport.x + viewport.w) rect.x -= viewport.w; + if (rect.y > viewport.y + viewport.h) rect.y -= viewport.h; + + DrawRects(renderer, &rect); + + SDL_RenderPresent(renderer); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +int +main(int argc, char *argv[]) +{ + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Initialize test framework */ + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + return 1; + } + for (i = 1; i < argc; ++i) { + SDLTest_CommonArg(state, i); + } + if (!SDLTest_CommonInit(state)) { + return 2; + } + + /* Create the windows and initialize the renderers */ + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE); + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + } + + srand((unsigned int)time(NULL)); + if(SDL_SetRelativeMouseMode(SDL_TRUE) < 0) { + return 3; + }; + + rect.x = DEFAULT_WINDOW_WIDTH / 2; + rect.y = DEFAULT_WINDOW_HEIGHT / 2; + rect.w = 10; + rect.h = 10; + /* Main render loop */ + done = 0; +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); + } +#endif + SDLTest_CommonQuit(state); + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/3rdparty/sdl2-2.0.0/test/testrendercopyex.c b/3rdparty/sdl2-2.0.4/test/testrendercopyex.c similarity index 82% rename from 3rdparty/sdl2-2.0.0/test/testrendercopyex.c rename to 3rdparty/sdl2-2.0.4/test/testrendercopyex.c index 6dd59c0ac2..856abf7d0b 100644 --- a/3rdparty/sdl2-2.0.0/test/testrendercopyex.c +++ b/3rdparty/sdl2-2.0.4/test/testrendercopyex.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" @@ -29,6 +33,9 @@ typedef struct { int scale_direction; } DrawState; +DrawState *drawstates; +int done; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -46,7 +53,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) /* Load the sprite image */ temp = SDL_LoadBMP(file); if (temp == NULL) { - fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError()); return NULL; } @@ -77,7 +84,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) /* Create textures from the image */ texture = SDL_CreateTextureFromSurface(renderer, temp); if (!texture) { - fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); SDL_FreeSurface(temp); return NULL; } @@ -127,18 +134,41 @@ Draw(DrawState *s) /* Update the screen! */ SDL_RenderPresent(s->renderer); - //SDL_Delay(10); + /* SDL_Delay(10); */ +} + +void loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + Draw(&drawstates[i]); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int main(int argc, char *argv[]) { - DrawState *drawstates; - int i, done; - SDL_Event event; + int i; int frames; Uint32 then, now; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); if (!state) { @@ -149,7 +179,7 @@ main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (consumed == 0) { - fprintf(stderr, "Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); + SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); return 1; } i += consumed; @@ -178,22 +208,20 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - for (i = 0; i < state->num_windows; ++i) { - Draw(&drawstates[i]); + loop(); } - } - +#endif /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { double fps = ((double) frames * 1000) / (now - then); - printf("%2.2f frames per second\n", fps); + SDL_Log("%2.2f frames per second\n", fps); } SDL_stack_free(drawstates); diff --git a/3rdparty/sdl2-2.0.0/test/testrendertarget.c b/3rdparty/sdl2-2.0.4/test/testrendertarget.c similarity index 84% rename from 3rdparty/sdl2-2.0.0/test/testrendertarget.c rename to 3rdparty/sdl2-2.0.4/test/testrendertarget.c index bc31048251..c5e1dce05b 100644 --- a/3rdparty/sdl2-2.0.0/test/testrendertarget.c +++ b/3rdparty/sdl2-2.0.4/test/testrendertarget.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" @@ -29,6 +33,10 @@ typedef struct { int scale_direction; } DrawState; +DrawState *drawstates; +int done; +SDL_bool test_composite = SDL_FALSE; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -46,7 +54,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) /* Load the sprite image */ temp = SDL_LoadBMP(file); if (temp == NULL) { - fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError()); return NULL; } @@ -77,7 +85,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) /* Create textures from the image */ texture = SDL_CreateTextureFromSurface(renderer, temp); if (!texture) { - fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); SDL_FreeSurface(temp); return NULL; } @@ -87,7 +95,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) return texture; } -void +SDL_bool DrawComposite(DrawState *s) { SDL_Rect viewport, R; @@ -114,7 +122,7 @@ DrawComposite(DrawState *s) SDL_RenderCopy(s->renderer, A, NULL, NULL); SDL_RenderReadPixels(s->renderer, NULL, SDL_PIXELFORMAT_ARGB8888, &P, sizeof(P)); - printf("Blended pixel: 0x%8.8X\n", P); + SDL_Log("Blended pixel: 0x%8.8X\n", P); SDL_DestroyTexture(A); SDL_DestroyTexture(B); @@ -167,9 +175,10 @@ DrawComposite(DrawState *s) /* Update the screen! */ SDL_RenderPresent(s->renderer); + return SDL_TRUE; } -void +SDL_bool Draw(DrawState *s) { SDL_Rect viewport; @@ -178,6 +187,10 @@ Draw(DrawState *s) SDL_RenderGetViewport(s->renderer, &viewport); target = SDL_CreateTexture(s->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, viewport.w, viewport.h); + if (!target) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create render target texture: %s\n", SDL_GetError()); + return SDL_FALSE; + } SDL_SetRenderTarget(s->renderer, target); /* Draw the background */ @@ -206,17 +219,44 @@ Draw(DrawState *s) /* Update the screen! */ SDL_RenderPresent(s->renderer); + return SDL_TRUE; +} + +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + if (test_composite) { + if (!DrawComposite(&drawstates[i])) done = 1; + } else { + if (!Draw(&drawstates[i])) done = 1; + } + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int main(int argc, char *argv[]) { - DrawState *drawstates; - int i, done; - SDL_Event event; + int i; int frames; Uint32 then, now; - SDL_bool test_composite = SDL_FALSE; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); @@ -235,8 +275,7 @@ main(int argc, char *argv[]) } } if (consumed < 0) { - fprintf(stderr, - "Usage: %s %s [--composite]\n", + SDL_Log("Usage: %s %s [--composite]\n", argv[0], SDLTest_CommonUsage(state)); quit(1); } @@ -270,26 +309,21 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - for (i = 0; i < state->num_windows; ++i) { - if (test_composite) { - DrawComposite(&drawstates[i]); - } else { - Draw(&drawstates[i]); - } - } + loop(); } +#endif /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { double fps = ((double) frames * 1000) / (now - then); - printf("%2.2f frames per second\n", fps); + SDL_Log("%2.2f frames per second\n", fps); } SDL_stack_free(drawstates); diff --git a/3rdparty/sdl2-2.0.4/test/testresample.c b/3rdparty/sdl2-2.0.4/test/testresample.c new file mode 100644 index 0000000000..0e92bbe11a --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testresample.c @@ -0,0 +1,118 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +#include "SDL.h" + +int +main(int argc, char **argv) +{ + SDL_AudioSpec spec; + SDL_AudioCVT cvt; + Uint32 len = 0; + Uint8 *data = NULL; + int cvtfreq = 0; + int bitsize = 0; + int blockalign = 0; + int avgbytes = 0; + SDL_RWops *io = NULL; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (argc != 4) { + SDL_Log("USAGE: %s in.wav out.wav newfreq\n", argv[0]); + return 1; + } + + cvtfreq = SDL_atoi(argv[3]); + + if (SDL_Init(SDL_INIT_AUDIO) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init() failed: %s\n", SDL_GetError()); + return 2; + } + + if (SDL_LoadWAV(argv[1], &spec, &data, &len) == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "failed to load %s: %s\n", argv[1], SDL_GetError()); + SDL_Quit(); + return 3; + } + + if (SDL_BuildAudioCVT(&cvt, spec.format, spec.channels, spec.freq, + spec.format, spec.channels, cvtfreq) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "failed to build CVT: %s\n", SDL_GetError()); + SDL_FreeWAV(data); + SDL_Quit(); + return 4; + } + + cvt.len = len; + cvt.buf = (Uint8 *) SDL_malloc(len * cvt.len_mult); + if (cvt.buf == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory.\n"); + SDL_FreeWAV(data); + SDL_Quit(); + return 5; + } + SDL_memcpy(cvt.buf, data, len); + + if (SDL_ConvertAudio(&cvt) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Conversion failed: %s\n", SDL_GetError()); + SDL_free(cvt.buf); + SDL_FreeWAV(data); + SDL_Quit(); + return 6; + } + + /* write out a WAV header... */ + io = SDL_RWFromFile(argv[2], "wb"); + if (io == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "fopen('%s') failed: %s\n", argv[2], SDL_GetError()); + SDL_free(cvt.buf); + SDL_FreeWAV(data); + SDL_Quit(); + return 7; + } + + bitsize = SDL_AUDIO_BITSIZE(spec.format); + blockalign = (bitsize / 8) * spec.channels; + avgbytes = cvtfreq * blockalign; + + SDL_WriteLE32(io, 0x46464952); /* RIFF */ + SDL_WriteLE32(io, len * cvt.len_mult + 36); + SDL_WriteLE32(io, 0x45564157); /* WAVE */ + SDL_WriteLE32(io, 0x20746D66); /* fmt */ + SDL_WriteLE32(io, 16); /* chunk size */ + SDL_WriteLE16(io, 1); /* uncompressed */ + SDL_WriteLE16(io, spec.channels); /* channels */ + SDL_WriteLE32(io, cvtfreq); /* sample rate */ + SDL_WriteLE32(io, avgbytes); /* average bytes per second */ + SDL_WriteLE16(io, blockalign); /* block align */ + SDL_WriteLE16(io, bitsize); /* significant bits per sample */ + SDL_WriteLE32(io, 0x61746164); /* data */ + SDL_WriteLE32(io, cvt.len_cvt); /* size */ + SDL_RWwrite(io, cvt.buf, cvt.len_cvt, 1); + + if (SDL_RWclose(io) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "fclose('%s') failed: %s\n", argv[2], SDL_GetError()); + SDL_free(cvt.buf); + SDL_FreeWAV(data); + SDL_Quit(); + return 8; + } /* if */ + + SDL_free(cvt.buf); + SDL_FreeWAV(data); + SDL_Quit(); + return 0; +} /* main */ + +/* end of testresample.c ... */ diff --git a/3rdparty/sdl2-2.0.0/test/testrumble.c b/3rdparty/sdl2-2.0.4/test/testrumble.c similarity index 77% rename from 3rdparty/sdl2-2.0.0/test/testrumble.c rename to 3rdparty/sdl2-2.0.4/test/testrumble.c index e5b5424d46..ea7466d2da 100644 --- a/3rdparty/sdl2-2.0.0/test/testrumble.c +++ b/3rdparty/sdl2-2.0.4/test/testrumble.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * includes */ #include -#include /* printf */ #include /* strstr */ #include /* isdigit */ @@ -34,8 +33,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #ifndef SDL_HAPTIC_DISABLED -#include "SDL_haptic.h" - static SDL_Haptic *haptic; @@ -51,12 +48,15 @@ main(int argc, char **argv) char *name; int index; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + name = NULL; index = -1; if (argc > 1) { name = argv[1]; if ((strcmp(name, "--help") == 0) || (strcmp(name, "-h") == 0)) { - printf("USAGE: %s [device]\n" + SDL_Log("USAGE: %s [device]\n" "If device is a two-digit number it'll use it as an index, otherwise\n" "it'll use it as if it were part of the device's name.\n", argv[0]); @@ -73,7 +73,7 @@ main(int argc, char **argv) /* Initialize the force feedbackness */ SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC); - printf("%d Haptic devices detected.\n", SDL_NumHaptics()); + SDL_Log("%d Haptic devices detected.\n", SDL_NumHaptics()); if (SDL_NumHaptics() > 0) { /* We'll just use index or the first force feedback device found */ if (name == NULL) { @@ -87,7 +87,7 @@ main(int argc, char **argv) } if (i >= SDL_NumHaptics()) { - printf("Unable to find device matching '%s', aborting.\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find device matching '%s', aborting.\n", name); return 1; } @@ -95,13 +95,13 @@ main(int argc, char **argv) haptic = SDL_HapticOpen(i); if (haptic == NULL) { - printf("Unable to create the haptic device: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create the haptic device: %s\n", SDL_GetError()); return 1; } - printf("Device: %s\n", SDL_HapticName(i)); + SDL_Log("Device: %s\n", SDL_HapticName(i)); } else { - printf("No Haptic devices found!\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No Haptic devices found!\n"); return 1; } @@ -109,25 +109,25 @@ main(int argc, char **argv) SDL_ClearError(); if (SDL_HapticRumbleSupported(haptic) == SDL_FALSE) { - printf("\nRumble not supported!\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Rumble not supported!\n"); return 1; } if (SDL_HapticRumbleInit(haptic) != 0) { - printf("\nFailed to initialize rumble: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to initialize rumble: %s\n", SDL_GetError()); return 1; } - printf("Playing 2 second rumble at 0.5 magnitude.\n"); + SDL_Log("Playing 2 second rumble at 0.5 magnitude.\n"); if (SDL_HapticRumblePlay(haptic, 0.5, 5000) != 0) { - printf("\nFailed to play rumble: %s\n", SDL_GetError() ); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to play rumble: %s\n", SDL_GetError() ); return 1; } SDL_Delay(2000); - printf("Stopping rumble.\n"); + SDL_Log("Stopping rumble.\n"); SDL_HapticRumbleStop(haptic); SDL_Delay(2000); - printf("Playing 2 second rumble at 0.3 magnitude.\n"); + SDL_Log("Playing 2 second rumble at 0.3 magnitude.\n"); if (SDL_HapticRumblePlay(haptic, 0.3f, 5000) != 0) { - printf("\nFailed to play rumble: %s\n", SDL_GetError() ); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to play rumble: %s\n", SDL_GetError() ); return 1; } SDL_Delay(2000); @@ -145,7 +145,7 @@ main(int argc, char **argv) int main(int argc, char *argv[]) { - fprintf(stderr, "SDL compiled without Haptic support.\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL compiled without Haptic support.\n"); exit(1); } diff --git a/3rdparty/sdl2-2.0.0/test/testscale.c b/3rdparty/sdl2-2.0.4/test/testscale.c similarity index 81% rename from 3rdparty/sdl2-2.0.0/test/testscale.c rename to 3rdparty/sdl2-2.0.4/test/testscale.c index 0f0096c6e2..9f5fdbff10 100644 --- a/3rdparty/sdl2-2.0.0/test/testscale.c +++ b/3rdparty/sdl2-2.0.4/test/testscale.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" #define WINDOW_WIDTH 640 @@ -31,6 +35,9 @@ typedef struct { int scale_direction; } DrawState; +DrawState *drawstates; +int done; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -48,7 +55,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) /* Load the sprite image */ temp = SDL_LoadBMP(file); if (temp == NULL) { - fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError()); return NULL; } @@ -79,7 +86,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) /* Create textures from the image */ texture = SDL_CreateTextureFromSurface(renderer, temp); if (!texture) { - fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); SDL_FreeSurface(temp); return NULL; } @@ -120,15 +127,38 @@ Draw(DrawState *s) SDL_RenderPresent(s->renderer); } +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + Draw(&drawstates[i]); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - DrawState *drawstates; - int i, done; - SDL_Event event; + int i; int frames; Uint32 then, now; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); if (!state) { @@ -139,7 +169,7 @@ main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (consumed == 0) { - fprintf(stderr, "Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); + SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); return 1; } i += consumed; @@ -168,22 +198,21 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - for (i = 0; i < state->num_windows; ++i) { - Draw(&drawstates[i]); - } + loop(); } +#endif /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { double fps = ((double) frames * 1000) / (now - then); - printf("%2.2f frames per second\n", fps); + SDL_Log("%2.2f frames per second\n", fps); } SDL_stack_free(drawstates); diff --git a/3rdparty/sdl2-2.0.4/test/testsem.c b/3rdparty/sdl2-2.0.4/test/testsem.c new file mode 100644 index 0000000000..b8d3b27491 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testsem.c @@ -0,0 +1,130 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Simple test of the SDL semaphore code */ + +#include +#include +#include + +#include "SDL.h" + +#define NUM_THREADS 10 + +static SDL_sem *sem; +int alive = 1; + +int SDLCALL +ThreadFunc(void *data) +{ + int threadnum = (int) (uintptr_t) data; + while (alive) { + SDL_SemWait(sem); + SDL_Log("Thread number %d has got the semaphore (value = %d)!\n", + threadnum, SDL_SemValue(sem)); + SDL_Delay(200); + SDL_SemPost(sem); + SDL_Log("Thread number %d has released the semaphore (value = %d)!\n", + threadnum, SDL_SemValue(sem)); + SDL_Delay(1); /* For the scheduler */ + } + SDL_Log("Thread number %d exiting.\n", threadnum); + return 0; +} + +static void +killed(int sig) +{ + alive = 0; +} + +static void +TestWaitTimeout(void) +{ + Uint32 start_ticks; + Uint32 end_ticks; + Uint32 duration; + int retval; + + sem = SDL_CreateSemaphore(0); + SDL_Log("Waiting 2 seconds on semaphore\n"); + + start_ticks = SDL_GetTicks(); + retval = SDL_SemWaitTimeout(sem, 2000); + end_ticks = SDL_GetTicks(); + + duration = end_ticks - start_ticks; + + /* Accept a little offset in the effective wait */ + if (duration > 1900 && duration < 2050) + SDL_Log("Wait done.\n"); + else + SDL_Log("Wait took %d milliseconds\n", duration); + + /* Check to make sure the return value indicates timed out */ + if (retval != SDL_MUTEX_TIMEDOUT) + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_SemWaitTimeout returned: %d; expected: %d\n", retval, SDL_MUTEX_TIMEDOUT); +} + +int +main(int argc, char **argv) +{ + SDL_Thread *threads[NUM_THREADS]; + uintptr_t i; + int init_sem; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (argc < 2) { + SDL_Log("Usage: %s init_value\n", argv[0]); + return (1); + } + + /* Load the SDL library */ + if (SDL_Init(0) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return (1); + } + signal(SIGTERM, killed); + signal(SIGINT, killed); + + init_sem = atoi(argv[1]); + sem = SDL_CreateSemaphore(init_sem); + + SDL_Log("Running %d threads, semaphore value = %d\n", NUM_THREADS, + init_sem); + /* Create all the threads */ + for (i = 0; i < NUM_THREADS; ++i) { + char name[64]; + SDL_snprintf(name, sizeof (name), "Thread%u", (unsigned int) i); + threads[i] = SDL_CreateThread(ThreadFunc, name, (void *) i); + } + + /* Wait 10 seconds */ + SDL_Delay(10 * 1000); + + /* Wait for all threads to finish */ + SDL_Log("Waiting for threads to finish\n"); + alive = 0; + for (i = 0; i < NUM_THREADS; ++i) { + SDL_WaitThread(threads[i], NULL); + } + SDL_Log("Finished waiting for threads\n"); + + SDL_DestroySemaphore(sem); + + TestWaitTimeout(); + + SDL_Quit(); + return (0); +} diff --git a/3rdparty/sdl2-2.0.0/test/testshader.c b/3rdparty/sdl2-2.0.4/test/testshader.c similarity index 80% rename from 3rdparty/sdl2-2.0.0/test/testshader.c rename to 3rdparty/sdl2-2.0.4/test/testshader.c index 376b445e79..fc6da29875 100644 --- a/3rdparty/sdl2-2.0.0/test/testshader.c +++ b/3rdparty/sdl2-2.0.4/test/testshader.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -11,7 +11,6 @@ */ /* This is a simple example of using GLSL shaders with SDL */ -#include /* for printf() */ #include "SDL.h" #ifdef HAVE_OPENGL @@ -139,7 +138,7 @@ static SDL_bool CompileShader(GLhandleARB shader, const char *source) glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); info = SDL_stack_alloc(char, length+1); glGetInfoLogARB(shader, length, NULL, info); - fprintf(stderr, "Failed to compile shader:\n%s\n%s", source, info); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to compile shader:\n%s\n%s", source, info); SDL_stack_free(info); return SDL_FALSE; @@ -188,7 +187,7 @@ static SDL_bool CompileShaderProgram(ShaderData *data) } glUseProgramObjectARB(0); - return (glGetError() == GL_NO_ERROR); + return (glGetError() == GL_NO_ERROR) ? SDL_TRUE : SDL_FALSE; } static void DestroyShaderProgram(ShaderData *data) @@ -245,7 +244,7 @@ static SDL_bool InitShaders() /* Compile all the shaders */ for (i = 0; i < NUM_SHADERS; ++i) { if (!CompileShaderProgram(&shaders[i])) { - fprintf(stderr, "Unable to compile shader!\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to compile shader!\n"); return SDL_FALSE; } } @@ -333,19 +332,19 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord) } /* A general OpenGL initialization function. Sets all of the initial parameters. */ -void InitGL(int Width, int Height) // We call this right after our OpenGL window is created. +void InitGL(int Width, int Height) /* We call this right after our OpenGL window is created. */ { GLdouble aspect; glViewport(0, 0, Width, Height); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // This Will Clear The Background Color To Black - glClearDepth(1.0); // Enables Clearing Of The Depth Buffer - glDepthFunc(GL_LESS); // The Type Of Depth Test To Do - glEnable(GL_DEPTH_TEST); // Enables Depth Testing - glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); /* This Will Clear The Background Color To Black */ + glClearDepth(1.0); /* Enables Clearing Of The Depth Buffer */ + glDepthFunc(GL_LESS); /* The Type Of Depth Test To Do */ + glEnable(GL_DEPTH_TEST); /* Enables Depth Testing */ + glShadeModel(GL_SMOOTH); /* Enables Smooth Color Shading */ glMatrixMode(GL_PROJECTION); - glLoadIdentity(); // Reset The Projection Matrix + glLoadIdentity(); /* Reset The Projection Matrix */ aspect = (GLdouble)Width / Height; glOrtho(-3.0, 3.0, -3.0 / aspect, 3.0 / aspect, 0.0, 1.0); @@ -364,29 +363,29 @@ void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat * texcoord) MAXY }; - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer - glLoadIdentity(); // Reset The View + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* Clear The Screen And The Depth Buffer */ + glLoadIdentity(); /* Reset The View */ - glTranslatef(-1.5f,0.0f,0.0f); // Move Left 1.5 Units + glTranslatef(-1.5f,0.0f,0.0f); /* Move Left 1.5 Units */ - // draw a triangle (in smooth coloring mode) - glBegin(GL_POLYGON); // start drawing a polygon - glColor3f(1.0f,0.0f,0.0f); // Set The Color To Red - glVertex3f( 0.0f, 1.0f, 0.0f); // Top - glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green - glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right - glColor3f(0.0f,0.0f,1.0f); // Set The Color To Blue - glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left - glEnd(); // we're done with the polygon (smooth color interpolation) + /* draw a triangle (in smooth coloring mode) */ + glBegin(GL_POLYGON); /* start drawing a polygon */ + glColor3f(1.0f,0.0f,0.0f); /* Set The Color To Red */ + glVertex3f( 0.0f, 1.0f, 0.0f); /* Top */ + glColor3f(0.0f,1.0f,0.0f); /* Set The Color To Green */ + glVertex3f( 1.0f,-1.0f, 0.0f); /* Bottom Right */ + glColor3f(0.0f,0.0f,1.0f); /* Set The Color To Blue */ + glVertex3f(-1.0f,-1.0f, 0.0f); /* Bottom Left */ + glEnd(); /* we're done with the polygon (smooth color interpolation) */ - glTranslatef(3.0f,0.0f,0.0f); // Move Right 3 Units + glTranslatef(3.0f,0.0f,0.0f); /* Move Right 3 Units */ - // Enable blending + /* Enable blending */ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - // draw a textured square (quadrilateral) + /* draw a textured square (quadrilateral) */ glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture); glColor3f(1.0f,1.0f,1.0f); @@ -394,23 +393,23 @@ void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat * texcoord) glUseProgramObjectARB(shaders[current_shader].program); } - glBegin(GL_QUADS); // start drawing a polygon (4 sided) + glBegin(GL_QUADS); /* start drawing a polygon (4 sided) */ glTexCoord2f(texcoord[MINX], texcoord[MINY]); - glVertex3f(-1.0f, 1.0f, 0.0f); // Top Left + glVertex3f(-1.0f, 1.0f, 0.0f); /* Top Left */ glTexCoord2f(texcoord[MAXX], texcoord[MINY]); - glVertex3f( 1.0f, 1.0f, 0.0f); // Top Right + glVertex3f( 1.0f, 1.0f, 0.0f); /* Top Right */ glTexCoord2f(texcoord[MAXX], texcoord[MAXY]); - glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right + glVertex3f( 1.0f,-1.0f, 0.0f); /* Bottom Right */ glTexCoord2f(texcoord[MINX], texcoord[MAXY]); - glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left - glEnd(); // done with the polygon + glVertex3f(-1.0f,-1.0f, 0.0f); /* Bottom Left */ + glEnd(); /* done with the polygon */ if (shaders_supported) { glUseProgramObjectARB(0); } glDisable(GL_TEXTURE_2D); - // swap buffers to display, since we're double buffered. + /* swap buffers to display, since we're double buffered. */ SDL_GL_SwapWindow(window); } @@ -422,29 +421,32 @@ int main(int argc, char **argv) GLuint texture; GLfloat texcoords[4]; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Initialize SDL for video output */ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { - fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to initialize SDL: %s\n", SDL_GetError()); exit(1); } /* Create a 640x480 OpenGL screen */ window = SDL_CreateWindow( "Shader Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL ); if ( !window ) { - fprintf(stderr, "Unable to create OpenGL window: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create OpenGL window: %s\n", SDL_GetError()); SDL_Quit(); exit(2); } if ( !SDL_GL_CreateContext(window)) { - fprintf(stderr, "Unable to create OpenGL context: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create OpenGL context: %s\n", SDL_GetError()); SDL_Quit(); exit(2); } surface = SDL_LoadBMP("icon.bmp"); if ( ! surface ) { - fprintf(stderr, "Unable to load icon.bmp: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to load icon.bmp: %s\n", SDL_GetError()); SDL_Quit(); exit(3); } @@ -454,9 +456,9 @@ int main(int argc, char **argv) /* Loop, drawing and checking events */ InitGL(640, 480); if (InitShaders()) { - printf("Shaders supported, press SPACE to cycle them.\n"); + SDL_Log("Shaders supported, press SPACE to cycle them.\n"); } else { - printf("Shaders not supported!\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Shaders not supported!\n"); } done = 0; while ( ! done ) { @@ -489,7 +491,7 @@ int main(int argc, char **argv) int main(int argc, char *argv[]) { - printf("No OpenGL support on this system\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No OpenGL support on this system\n"); return 1; } diff --git a/3rdparty/sdl2-2.0.4/test/testshape.c b/3rdparty/sdl2-2.0.4/test/testshape.c new file mode 100644 index 0000000000..00750a9708 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testshape.c @@ -0,0 +1,201 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +#include +#include +#include +#include "SDL.h" +#include "SDL_shape.h" + +#define SHAPED_WINDOW_X 150 +#define SHAPED_WINDOW_Y 150 +#define SHAPED_WINDOW_DIMENSION 640 + +typedef struct LoadedPicture { + SDL_Surface *surface; + SDL_Texture *texture; + SDL_WindowShapeMode mode; + const char* name; +} LoadedPicture; + +void render(SDL_Renderer *renderer,SDL_Texture *texture,SDL_Rect texture_dimensions) +{ + /* Clear render-target to blue. */ + SDL_SetRenderDrawColor(renderer,0x00,0x00,0xff,0xff); + SDL_RenderClear(renderer); + + /* Render the texture. */ + SDL_RenderCopy(renderer,texture,&texture_dimensions,&texture_dimensions); + + SDL_RenderPresent(renderer); +} + +int main(int argc,char** argv) +{ + Uint8 num_pictures; + LoadedPicture* pictures; + int i, j; + SDL_PixelFormat* format = NULL; + SDL_Window *window; + SDL_Renderer *renderer; + SDL_Color black = {0,0,0,0xff}; + SDL_Event event; + int event_pending = 0; + int should_exit = 0; + unsigned int current_picture; + int button_down; + Uint32 pixelFormat = 0; + int access = 0; + SDL_Rect texture_dimensions; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if(argc < 2) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Shape requires at least one bitmap file as argument."); + exit(-1); + } + + if(SDL_VideoInit(NULL) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not initialize SDL video."); + exit(-2); + } + + num_pictures = argc - 1; + pictures = (LoadedPicture *)SDL_malloc(sizeof(LoadedPicture)*num_pictures); + for(i=0;iformat; + if(SDL_ISPIXELFORMAT_ALPHA(format->format)) { + pictures[i].mode.mode = ShapeModeBinarizeAlpha; + pictures[i].mode.parameters.binarizationCutoff = 255; + } + else { + pictures[i].mode.mode = ShapeModeColorKey; + pictures[i].mode.parameters.colorKey = black; + } + } + + window = SDL_CreateShapedWindow("SDL_Shape test", + SHAPED_WINDOW_X, SHAPED_WINDOW_Y, + SHAPED_WINDOW_DIMENSION,SHAPED_WINDOW_DIMENSION, + 0); + SDL_SetWindowPosition(window, SHAPED_WINDOW_X, SHAPED_WINDOW_Y); + if(window == NULL) { + for(i=0;i= num_pictures) + current_picture = 0; + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Changing to shaped bmp: %s", pictures[current_picture].name); + SDL_QueryTexture(pictures[current_picture].texture,(Uint32 *)&pixelFormat,(int *)&access,&texture_dimensions.w,&texture_dimensions.h); + SDL_SetWindowSize(window,texture_dimensions.w,texture_dimensions.h); + SDL_SetWindowShape(window,pictures[current_picture].surface,&pictures[current_picture].mode); + } + if(event.type == SDL_QUIT) + should_exit = 1; + event_pending = 0; + } + render(renderer,pictures[current_picture].texture,texture_dimensions); + SDL_Delay(10); + } + + /* Free the textures. */ + for(i=0;i + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test.h" #include "SDL_test_common.h" @@ -38,19 +42,15 @@ static SDL_BlendMode blendMode = SDL_BLENDMODE_BLEND; /* -1: infinite random moves (default); >=0: enables N deterministic moves */ static int iterations = -1; +int done; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) { - if (sprites) { - SDL_free(sprites); - } - if (positions) { - SDL_free(positions); - } - if (velocities) { - SDL_free(velocities); - } + SDL_free(sprites); + SDL_free(positions); + SDL_free(velocities); SDLTest_CommonQuit(state); exit(rc); } @@ -64,7 +64,7 @@ LoadSprite(const char *file) /* Load the sprite image */ temp = SDL_LoadBMP(file); if (temp == NULL) { - fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError()); return (-1); } sprite_w = temp->w; @@ -95,7 +95,7 @@ LoadSprite(const char *file) SDL_Renderer *renderer = state->renderers[i]; sprites[i] = SDL_CreateTextureFromSurface(renderer, temp); if (!sprites[i]) { - fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); SDL_FreeSurface(temp); return (-1); } @@ -203,13 +203,13 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) velocity = &velocities[i]; position->x += velocity->x; if ((position->x < 0) || (position->x >= (viewport.w - sprite_w))) { - velocity->x = -velocity->x; - position->x += velocity->x; + velocity->x = -velocity->x; + position->x += velocity->x; } position->y += velocity->y; if ((position->y < 0) || (position->y >= (viewport.h - sprite_h))) { - velocity->y = -velocity->y; - position->y += velocity->y; + velocity->y = -velocity->y; + position->y += velocity->y; } } @@ -227,7 +227,7 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) /* Draw sprites */ for (i = 0; i < num_sprites; ++i) { position = &positions[i]; - + /* Blit the sprite onto the screen */ SDL_RenderCopy(renderer, sprite, NULL, position); } @@ -236,13 +236,34 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) SDL_RenderPresent(renderer); } +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + MoveSprites(state->renderers[i], sprites[i]); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - int i, done; - SDL_Event event; + int i; Uint32 then, now, frames; - Uint64 seed; + Uint64 seed; const char *icon = "icon.bmp"; /* Initialize parameters */ @@ -254,8 +275,6 @@ main(int argc, char *argv[]) return 1; } - state->window_flags |= SDL_WINDOW_RESIZABLE; - for (i = 1; i < argc;) { int consumed; @@ -299,8 +318,7 @@ main(int argc, char *argv[]) } } if (consumed < 0) { - fprintf(stderr, - "Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha] [--iterations N] [num_sprites] [icon.bmp]\n", + SDL_Log("Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha] [--iterations N] [num_sprites] [icon.bmp]\n", argv[0], SDLTest_CommonUsage(state)); quit(1); } @@ -314,7 +332,7 @@ main(int argc, char *argv[]) sprites = (SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites)); if (!sprites) { - fprintf(stderr, "Out of memory!\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } for (i = 0; i < state->num_windows; ++i) { @@ -330,7 +348,7 @@ main(int argc, char *argv[]) positions = (SDL_Rect *) SDL_malloc(num_sprites * sizeof(SDL_Rect)); velocities = (SDL_Rect *) SDL_malloc(num_sprites * sizeof(SDL_Rect)); if (!positions || !velocities) { - fprintf(stderr, "Out of memory!\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } @@ -360,22 +378,21 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - for (i = 0; i < state->num_windows; ++i) { - MoveSprites(state->renderers[i], sprites[i]); - } + loop(); } +#endif /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { double fps = ((double) frames * 1000) / (now - then); - printf("%2.2f frames per second\n", fps); + SDL_Log("%2.2f frames per second\n", fps); } quit(0); return 0; diff --git a/3rdparty/sdl2-2.0.0/test/testspriteminimal.c b/3rdparty/sdl2-2.0.4/test/testspriteminimal.c similarity index 82% rename from 3rdparty/sdl2-2.0.0/test/testspriteminimal.c rename to 3rdparty/sdl2-2.0.4/test/testspriteminimal.c index 6f3ac25c04..05f97309c0 100644 --- a/3rdparty/sdl2-2.0.0/test/testspriteminimal.c +++ b/3rdparty/sdl2-2.0.4/test/testspriteminimal.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL.h" #define WINDOW_WIDTH 640 @@ -27,6 +31,9 @@ static SDL_Rect positions[NUM_SPRITES]; static SDL_Rect velocities[NUM_SPRITES]; static int sprite_w, sprite_h; +SDL_Renderer *renderer; +int done; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -42,7 +49,7 @@ LoadSprite(char *file, SDL_Renderer *renderer) /* Load the sprite image */ temp = SDL_LoadBMP(file); if (temp == NULL) { - fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", file, SDL_GetError()); return (-1); } sprite_w = temp->w; @@ -73,7 +80,7 @@ LoadSprite(char *file, SDL_Renderer *renderer) /* Create textures from the image */ sprite = SDL_CreateTextureFromSurface(renderer, temp); if (!sprite) { - fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); SDL_FreeSurface(temp); return (-1); } @@ -118,13 +125,33 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) SDL_RenderPresent(renderer); } +void loop() +{ + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + if (event.type == SDL_QUIT || event.type == SDL_KEYDOWN) { + done = 1; + } + } + MoveSprites(renderer, sprite); +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { SDL_Window *window; - SDL_Renderer *renderer; - int i, done; - SDL_Event event; + int i; + + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); if (SDL_CreateWindowAndRenderer(WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer) < 0) { quit(2); @@ -151,16 +178,14 @@ main(int argc, char *argv[]) /* Main render loop */ done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ - while (SDL_PollEvent(&event)) { - if (event.type == SDL_QUIT || event.type == SDL_KEYDOWN) { - done = 1; - } - } - MoveSprites(renderer, sprite); + loop(); } - +#endif quit(0); return 0; /* to prevent compiler warning */ diff --git a/3rdparty/sdl2-2.0.4/test/teststreaming.c b/3rdparty/sdl2-2.0.4/test/teststreaming.c new file mode 100644 index 0000000000..86cc13917b --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/teststreaming.c @@ -0,0 +1,190 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +/******************************************************************************** + * * + * Running moose :) Coded by Mike Gorchak. * + * * + ********************************************************************************/ + +#include +#include + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "SDL.h" + +#define MOOSEPIC_W 64 +#define MOOSEPIC_H 88 + +#define MOOSEFRAME_SIZE (MOOSEPIC_W * MOOSEPIC_H) +#define MOOSEFRAMES_COUNT 10 + +SDL_Color MooseColors[84] = { + {49, 49, 49, 255}, {66, 24, 0, 255}, {66, 33, 0, 255}, {66, 66, 66, 255}, + {66, 115, 49, 255}, {74, 33, 0, 255}, {74, 41, 16, 255}, {82, 33, 8, 255}, + {82, 41, 8, 255}, {82, 49, 16, 255}, {82, 82, 82, 255}, {90, 41, 8, 255}, + {90, 41, 16, 255}, {90, 57, 24, 255}, {99, 49, 16, 255}, {99, 66, 24, 255}, + {99, 66, 33, 255}, {99, 74, 33, 255}, {107, 57, 24, 255}, {107, 82, 41, 255}, + {115, 57, 33, 255}, {115, 66, 33, 255}, {115, 66, 41, 255}, {115, 74, 0, 255}, + {115, 90, 49, 255}, {115, 115, 115, 255}, {123, 82, 0, 255}, {123, 99, 57, 255}, + {132, 66, 41, 255}, {132, 74, 41, 255}, {132, 90, 8, 255}, {132, 99, 33, 255}, + {132, 99, 66, 255}, {132, 107, 66, 255}, {140, 74, 49, 255}, {140, 99, 16, 255}, + {140, 107, 74, 255}, {140, 115, 74, 255}, {148, 107, 24, 255}, {148, 115, 82, 255}, + {148, 123, 74, 255}, {148, 123, 90, 255}, {156, 115, 33, 255}, {156, 115, 90, 255}, + {156, 123, 82, 255}, {156, 132, 82, 255}, {156, 132, 99, 255}, {156, 156, 156, 255}, + {165, 123, 49, 255}, {165, 123, 90, 255}, {165, 132, 82, 255}, {165, 132, 90, 255}, + {165, 132, 99, 255}, {165, 140, 90, 255}, {173, 132, 57, 255}, {173, 132, 99, 255}, + {173, 140, 107, 255}, {173, 140, 115, 255}, {173, 148, 99, 255}, {173, 173, 173, 255}, + {181, 140, 74, 255}, {181, 148, 115, 255}, {181, 148, 123, 255}, {181, 156, 107, 255}, + {189, 148, 123, 255}, {189, 156, 82, 255}, {189, 156, 123, 255}, {189, 156, 132, 255}, + {189, 189, 189, 255}, {198, 156, 123, 255}, {198, 165, 132, 255}, {206, 165, 99, 255}, + {206, 165, 132, 255}, {206, 173, 140, 255}, {206, 206, 206, 255}, {214, 173, 115, 255}, + {214, 173, 140, 255}, {222, 181, 148, 255}, {222, 189, 132, 255}, {222, 189, 156, 255}, + {222, 222, 222, 255}, {231, 198, 165, 255}, {231, 231, 231, 255}, {239, 206, 173, 255} +}; + +Uint8 MooseFrames[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE]; + +SDL_Renderer *renderer; +int frame; +SDL_Texture *MooseTexture; +SDL_bool done = SDL_FALSE; + +void quit(int rc) +{ + SDL_Quit(); + exit(rc); +} + +void UpdateTexture(SDL_Texture *texture, int frame) +{ + SDL_Color *color; + Uint8 *src; + Uint32 *dst; + int row, col; + void *pixels; + int pitch; + + if (SDL_LockTexture(texture, NULL, &pixels, &pitch) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't lock texture: %s\n", SDL_GetError()); + quit(5); + } + src = MooseFrames[frame]; + for (row = 0; row < MOOSEPIC_H; ++row) { + dst = (Uint32*)((Uint8*)pixels + row * pitch); + for (col = 0; col < MOOSEPIC_W; ++col) { + color = &MooseColors[*src++]; + *dst++ = (0xFF000000|(color->r<<16)|(color->g<<8)|color->b); + } + } + SDL_UnlockTexture(texture); +} + +void +loop() +{ + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_KEYDOWN: + if (event.key.keysym.sym == SDLK_ESCAPE) { + done = SDL_TRUE; + } + break; + case SDL_QUIT: + done = SDL_TRUE; + break; + } + } + + frame = (frame + 1) % MOOSEFRAMES_COUNT; + UpdateTexture(MooseTexture, frame); + + SDL_RenderClear(renderer); + SDL_RenderCopy(renderer, MooseTexture, NULL, NULL); + SDL_RenderPresent(renderer); + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +int +main(int argc, char **argv) +{ + SDL_Window *window; + SDL_RWops *handle; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 1; + } + + /* load the moose images */ + handle = SDL_RWFromFile("moose.dat", "rb"); + if (handle == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't find the file moose.dat !\n"); + quit(2); + } + SDL_RWread(handle, MooseFrames, MOOSEFRAME_SIZE, MOOSEFRAMES_COUNT); + SDL_RWclose(handle); + + + /* Create the window and renderer */ + window = SDL_CreateWindow("Happy Moose", + SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, + MOOSEPIC_W*4, MOOSEPIC_H*4, + SDL_WINDOW_RESIZABLE); + if (!window) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create window: %s\n", SDL_GetError()); + quit(3); + } + + renderer = SDL_CreateRenderer(window, -1, 0); + if (!renderer) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create renderer: %s\n", SDL_GetError()); + quit(4); + } + + MooseTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, MOOSEPIC_W, MOOSEPIC_H); + if (!MooseTexture) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create texture: %s\n", SDL_GetError()); + quit(5); + } + + /* Loop, waiting for QUIT or the escape key */ + frame = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); + } +#endif + + SDL_DestroyRenderer(renderer); + + quit(0); + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/3rdparty/sdl2-2.0.4/test/testthread.c b/3rdparty/sdl2-2.0.4/test/testthread.c new file mode 100644 index 0000000000..90e2c60c58 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testthread.c @@ -0,0 +1,98 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Simple test of the SDL threading code */ + +#include +#include +#include + +#include "SDL.h" + +static SDL_TLSID tls; +static int alive = 0; + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDL_Quit(); + exit(rc); +} + +int SDLCALL +ThreadFunc(void *data) +{ + SDL_TLSSet(tls, "baby thread", NULL); + SDL_Log("Started thread %s: My thread id is %lu, thread data = %s\n", + (char *) data, SDL_ThreadID(), (const char *)SDL_TLSGet(tls)); + while (alive) { + SDL_Log("Thread '%s' is alive!\n", (char *) data); + SDL_Delay(1 * 1000); + } + SDL_Log("Thread '%s' exiting!\n", (char *) data); + return (0); +} + +static void +killed(int sig) +{ + SDL_Log("Killed with SIGTERM, waiting 5 seconds to exit\n"); + SDL_Delay(5 * 1000); + alive = 0; + quit(0); +} + +int +main(int argc, char *argv[]) +{ + SDL_Thread *thread; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(0) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return (1); + } + + tls = SDL_TLSCreate(); + SDL_assert(tls); + SDL_TLSSet(tls, "main thread", NULL); + SDL_Log("Main thread data initially: %s\n", (const char *)SDL_TLSGet(tls)); + + alive = 1; + thread = SDL_CreateThread(ThreadFunc, "One", "#1"); + if (thread == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); + quit(1); + } + SDL_Delay(5 * 1000); + SDL_Log("Waiting for thread #1\n"); + alive = 0; + SDL_WaitThread(thread, NULL); + + SDL_Log("Main thread data finally: %s\n", (const char *)SDL_TLSGet(tls)); + + alive = 1; + signal(SIGTERM, killed); + thread = SDL_CreateThread(ThreadFunc, "Two", "#2"); + if (thread == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); + quit(1); + } + raise(SIGTERM); + + SDL_Quit(); /* Never reached */ + return (0); /* Never reached */ +} diff --git a/3rdparty/sdl2-2.0.4/test/testtimer.c b/3rdparty/sdl2-2.0.4/test/testtimer.c new file mode 100644 index 0000000000..32b7490982 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testtimer.c @@ -0,0 +1,122 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Test program to check the resolution of the SDL timer on the current + platform +*/ + +#include +#include + +#include "SDL.h" + +#define DEFAULT_RESOLUTION 1 + +static int ticks = 0; + +static Uint32 SDLCALL +ticktock(Uint32 interval, void *param) +{ + ++ticks; + return (interval); +} + +static Uint32 SDLCALL +callback(Uint32 interval, void *param) +{ + SDL_Log("Timer %d : param = %d\n", interval, (int) (uintptr_t) param); + return interval; +} + +int +main(int argc, char *argv[]) +{ + int i, desired; + SDL_TimerID t1, t2, t3; + Uint32 start32, now32; + Uint64 start, now; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (SDL_Init(SDL_INIT_TIMER) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return (1); + } + + /* Start the timer */ + desired = 0; + if (argv[1]) { + desired = atoi(argv[1]); + } + if (desired == 0) { + desired = DEFAULT_RESOLUTION; + } + t1 = SDL_AddTimer(desired, ticktock, NULL); + + /* Wait 10 seconds */ + SDL_Log("Waiting 10 seconds\n"); + SDL_Delay(10 * 1000); + + /* Stop the timer */ + SDL_RemoveTimer(t1); + + /* Print the results */ + if (ticks) { + SDL_Log("Timer resolution: desired = %d ms, actual = %f ms\n", + desired, (double) (10 * 1000) / ticks); + } + + /* Test multiple timers */ + SDL_Log("Testing multiple timers...\n"); + t1 = SDL_AddTimer(100, callback, (void *) 1); + if (!t1) + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"Could not create timer 1: %s\n", SDL_GetError()); + t2 = SDL_AddTimer(50, callback, (void *) 2); + if (!t2) + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"Could not create timer 2: %s\n", SDL_GetError()); + t3 = SDL_AddTimer(233, callback, (void *) 3); + if (!t3) + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"Could not create timer 3: %s\n", SDL_GetError()); + + /* Wait 10 seconds */ + SDL_Log("Waiting 10 seconds\n"); + SDL_Delay(10 * 1000); + + SDL_Log("Removing timer 1 and waiting 5 more seconds\n"); + SDL_RemoveTimer(t1); + + SDL_Delay(5 * 1000); + + SDL_RemoveTimer(t2); + SDL_RemoveTimer(t3); + + start = SDL_GetPerformanceCounter(); + for (i = 0; i < 1000000; ++i) { + ticktock(0, NULL); + } + now = SDL_GetPerformanceCounter(); + SDL_Log("1 million iterations of ticktock took %f ms\n", (double)((now - start)*1000) / SDL_GetPerformanceFrequency()); + + SDL_Log("Performance counter frequency: %"SDL_PRIu64"\n", (unsigned long long) SDL_GetPerformanceFrequency()); + start32 = SDL_GetTicks(); + start = SDL_GetPerformanceCounter(); + SDL_Delay(1000); + now = SDL_GetPerformanceCounter(); + now32 = SDL_GetTicks(); + SDL_Log("Delay 1 second = %d ms in ticks, %f ms according to performance counter\n", (now32-start32), (double)((now - start)*1000) / SDL_GetPerformanceFrequency()); + + SDL_Quit(); + return (0); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/3rdparty/sdl2-2.0.4/test/testver.c b/3rdparty/sdl2-2.0.4/test/testver.c new file mode 100644 index 0000000000..f0e3bcf3c2 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testver.c @@ -0,0 +1,47 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Test program to compare the compile-time version of SDL with the linked + version of SDL +*/ + +#include +#include + +#include "SDL.h" +#include "SDL_revision.h" + +int +main(int argc, char *argv[]) +{ + SDL_version compiled; + SDL_version linked; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + +#if SDL_VERSION_ATLEAST(2, 0, 0) + SDL_Log("Compiled with SDL 2.0 or newer\n"); +#else + SDL_Log("Compiled with SDL older than 2.0\n"); +#endif + SDL_VERSION(&compiled); + SDL_Log("Compiled version: %d.%d.%d.%d (%s)\n", + compiled.major, compiled.minor, compiled.patch, + SDL_REVISION_NUMBER, SDL_REVISION); + SDL_GetVersion(&linked); + SDL_Log("Linked version: %d.%d.%d.%d (%s)\n", + linked.major, linked.minor, linked.patch, + SDL_GetRevisionNumber(), SDL_GetRevision()); + SDL_Quit(); + return (0); +} diff --git a/3rdparty/sdl2-2.0.4/test/testviewport.c b/3rdparty/sdl2-2.0.4/test/testviewport.c new file mode 100644 index 0000000000..7ed4e6ec35 --- /dev/null +++ b/3rdparty/sdl2-2.0.4/test/testviewport.c @@ -0,0 +1,217 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +/* Simple program: Check viewports */ + +#include +#include +#include + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "SDL_test.h" +#include "SDL_test_common.h" + + +static SDLTest_CommonState *state; + +SDL_Rect viewport; +int done, j; +SDL_bool use_target = SDL_FALSE; +#ifdef __EMSCRIPTEN__ +Uint32 wait_start; +#endif + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDLTest_CommonQuit(state); + exit(rc); +} + +void +DrawOnViewport(SDL_Renderer * renderer, SDL_Rect viewport) +{ + SDL_Rect rect; + + /* Set the viewport */ + SDL_RenderSetViewport(renderer, &viewport); + + /* Draw a gray background */ + SDL_SetRenderDrawColor(renderer, 0x80, 0x80, 0x80, 0xFF); + SDL_RenderClear(renderer); + + /* Test inside points */ + SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xF, 0xFF); + SDL_RenderDrawPoint(renderer, viewport.h/2 + 10, viewport.w/2); + SDL_RenderDrawPoint(renderer, viewport.h/2 - 10, viewport.w/2); + SDL_RenderDrawPoint(renderer, viewport.h/2 , viewport.w/2 - 10); + SDL_RenderDrawPoint(renderer, viewport.h/2 , viewport.w/2 + 10); + + /* Test horizontal and vertical lines */ + SDL_SetRenderDrawColor(renderer, 0x00, 0xFF, 0x00, 0xFF); + SDL_RenderDrawLine(renderer, 1, 0, viewport.w-2, 0); + SDL_RenderDrawLine(renderer, 1, viewport.h-1, viewport.w-2, viewport.h-1); + SDL_RenderDrawLine(renderer, 0, 1, 0, viewport.h-2); + SDL_RenderDrawLine(renderer, viewport.w-1, 1, viewport.w-1, viewport.h-2); + + /* Test diagonal lines */ + SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0xFF, 0xFF); + SDL_RenderDrawLine(renderer, 0, 0, + viewport.w-1, viewport.h-1); + SDL_RenderDrawLine(renderer, viewport.w-1, 0, + 0, viewport.h-1); + + /* Test outside points */ + SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xF, 0xFF); + SDL_RenderDrawPoint(renderer, viewport.h/2 + viewport.h, viewport.w/2); + SDL_RenderDrawPoint(renderer, viewport.h/2 - viewport.h, viewport.w/2); + SDL_RenderDrawPoint(renderer, viewport.h/2 , viewport.w/2 - viewport.w); + SDL_RenderDrawPoint(renderer, viewport.h/2 , viewport.w/2 + viewport.w); + + /* Add a box at the top */ + rect.w = 8; + rect.h = 8; + rect.x = (viewport.w - rect.w) / 2; + rect.y = 0; + SDL_RenderFillRect(renderer, &rect); +} + +void +loop() +{ +#ifdef __EMSCRIPTEN__ + /* Avoid using delays */ + if(SDL_GetTicks() - wait_start < 1000) + return; + wait_start = SDL_GetTicks(); +#endif + SDL_Event event; + int i; + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + + /* Move a viewport box in steps around the screen */ + viewport.x = j * 100; + viewport.y = viewport.x; + viewport.w = 100 + j * 50; + viewport.h = 100 + j * 50; + j = (j + 1) % 4; + SDL_Log("Current Viewport x=%i y=%i w=%i h=%i", viewport.x, viewport.y, viewport.w, viewport.h); + + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + + /* Draw using viewport */ + DrawOnViewport(state->renderers[i], viewport); + + /* Update the screen! */ + if (use_target) { + SDL_SetRenderTarget(state->renderers[i], NULL); + SDL_RenderCopy(state->renderers[i], state->targets[i], NULL, NULL); + SDL_RenderPresent(state->renderers[i]); + SDL_SetRenderTarget(state->renderers[i], state->targets[i]); + } else { + SDL_RenderPresent(state->renderers[i]); + } + } + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +int +main(int argc, char *argv[]) +{ + int i; + Uint32 then, now, frames; + + /* Initialize test framework */ + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + return 1; + } + + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (consumed == 0) { + consumed = -1; + if (SDL_strcasecmp(argv[i], "--target") == 0) { + use_target = SDL_TRUE; + consumed = 1; + } + } + if (consumed < 0) { + SDL_Log("Usage: %s %s [--target]\n", + argv[0], SDLTest_CommonUsage(state)); + quit(1); + } + i += consumed; + } + if (!SDLTest_CommonInit(state)) { + quit(2); + } + + if (use_target) { + int w, h; + + for (i = 0; i < state->num_windows; ++i) { + SDL_GetWindowSize(state->windows[i], &w, &h); + state->targets[i] = SDL_CreateTexture(state->renderers[i], SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, w, h); + SDL_SetRenderTarget(state->renderers[i], state->targets[i]); + } + } + + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + } + + /* Main render loop */ + frames = 0; + then = SDL_GetTicks(); + done = 0; + j = 0; + +#ifdef __EMSCRIPTEN__ + wait_start = SDL_GetTicks(); + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + ++frames; + loop(); + SDL_Delay(1000); + } +#endif + + /* Print out some timing information */ + now = SDL_GetTicks(); + if (now > then) { + double fps = ((double) frames * 1000) / (now - then); + SDL_Log("%2.2f frames per second\n", fps); + } + quit(0); + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/3rdparty/sdl2-2.0.0/test/testwm2.c b/3rdparty/sdl2-2.0.4/test/testwm2.c similarity index 81% rename from 3rdparty/sdl2-2.0.0/test/testwm2.c rename to 3rdparty/sdl2-2.0.4/test/testwm2.c index efe6ea4dd1..94ba513bed 100644 --- a/3rdparty/sdl2-2.0.0/test/testwm2.c +++ b/3rdparty/sdl2-2.0.4/test/testwm2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -13,22 +13,16 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" static SDLTest_CommonState *state; +int done; -/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ -static void -quit(int rc) -{ - SDLTest_CommonQuit(state); - exit(rc); -} - -int -main(int argc, char *argv[]) -{ - static const char *cursorNames[] = { +static const char *cursorNames[] = { "arrow", "ibeam", "wait", @@ -41,41 +35,22 @@ main(int argc, char *argv[]) "sizeALL", "NO", "hand", - }; - - int i, done; - SDL_Event event; - int system_cursor = -1; - SDL_Cursor *cursor = NULL; - - SDL_assert(SDL_arraysize(cursorNames) == SDL_NUM_SYSTEM_CURSORS); - - /* Initialize test framework */ - state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { - return 1; - } - state->skip_renderer = SDL_TRUE; - for (i = 1; i < argc;) { - int consumed; +}; +int system_cursor = -1; +SDL_Cursor *cursor = NULL; - consumed = SDLTest_CommonArg(state, i); - if (consumed == 0) { - consumed = -1; - } - if (consumed < 0) { - fprintf(stderr, "Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); - quit(1); - } - i += consumed; - } - if (!SDLTest_CommonInit(state)) { - quit(2); - } +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDLTest_CommonQuit(state); + exit(rc); +} - /* Main render loop */ - done = 0; - while (!done) { +void +loop() +{ + SDL_Event event; /* Check for events */ while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); @@ -84,7 +59,7 @@ main(int argc, char *argv[]) if (event.window.event == SDL_WINDOWEVENT_RESIZED) { SDL_Window *window = SDL_GetWindowFromID(event.window.windowID); if (window) { - printf("Window %d resized to %dx%d\n", + SDL_Log("Window %d resized to %dx%d\n", event.window.windowID, event.window.data1, event.window.data2); @@ -93,7 +68,7 @@ main(int argc, char *argv[]) if (event.window.event == SDL_WINDOWEVENT_MOVED) { SDL_Window *window = SDL_GetWindowFromID(event.window.windowID); if (window) { - printf("Window %d moved to %d,%d (display %s)\n", + SDL_Log("Window %d moved to %d,%d (display %s)\n", event.window.windowID, event.window.data1, event.window.data2, @@ -125,11 +100,59 @@ main(int argc, char *argv[]) } } } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +int +main(int argc, char *argv[]) +{ + int i; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + SDL_assert(SDL_arraysize(cursorNames) == SDL_NUM_SYSTEM_CURSORS); + + /* Initialize test framework */ + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + return 1; + } + state->skip_renderer = SDL_TRUE; + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (consumed == 0) { + consumed = -1; + } + if (consumed < 0) { + SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); + quit(1); + } + i += consumed; + } + if (!SDLTest_CommonInit(state)) { + quit(2); + } + + /* Main render loop */ + done = 0; +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); } +#endif SDL_FreeCursor(cursor); quit(0); - // keep the compiler happy ... + /* keep the compiler happy ... */ return(0); } diff --git a/3rdparty/sdl2-2.0.0/test/torturethread.c b/3rdparty/sdl2-2.0.4/test/torturethread.c similarity index 76% rename from 3rdparty/sdl2-2.0.0/test/torturethread.c rename to 3rdparty/sdl2-2.0.4/test/torturethread.c index 795b60b935..5719a71950 100644 --- a/3rdparty/sdl2-2.0.0/test/torturethread.c +++ b/3rdparty/sdl2-2.0.4/test/torturethread.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -18,7 +18,6 @@ #include #include "SDL.h" -#include "SDL_thread.h" #define NUMTHREADS 10 @@ -36,7 +35,7 @@ int SDLCALL SubThreadFunc(void *data) { while (!*(int volatile *) data) { - ; /*SDL_Delay(10); *//* do nothing */ + ; /* SDL_Delay(10); *//* do nothing */ } return 0; } @@ -49,7 +48,7 @@ ThreadFunc(void *data) int i; int tid = (int) (uintptr_t) data; - fprintf(stderr, "Creating Thread %d\n", tid); + SDL_Log("Creating Thread %d\n", tid); for (i = 0; i < NUMTHREADS; i++) { char name[64]; @@ -58,18 +57,18 @@ ThreadFunc(void *data) sub_threads[i] = SDL_CreateThread(SubThreadFunc, name, &flags[i]); } - printf("Thread '%d' waiting for signal\n", tid); + SDL_Log("Thread '%d' waiting for signal\n", tid); while (time_for_threads_to_die[tid] != 1) { ; /* do nothing */ } - printf("Thread '%d' sending signals to subthreads\n", tid); + SDL_Log("Thread '%d' sending signals to subthreads\n", tid); for (i = 0; i < NUMTHREADS; i++) { flags[i] = 1; SDL_WaitThread(sub_threads[i], NULL); } - printf("Thread '%d' exiting!\n", tid); + SDL_Log("Thread '%d' exiting!\n", tid); return 0; } @@ -80,9 +79,12 @@ main(int argc, char *argv[]) SDL_Thread *threads[NUMTHREADS]; int i; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Load the SDL library */ if (SDL_Init(0) < 0) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return (1); } @@ -94,7 +96,7 @@ main(int argc, char *argv[]) threads[i] = SDL_CreateThread(ThreadFunc, name, (void*) (uintptr_t) i); if (threads[i] == NULL) { - fprintf(stderr, "Couldn't create thread: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } } diff --git a/3rdparty/sdl2-2.0.0/test/utf8.txt b/3rdparty/sdl2-2.0.4/test/utf8.txt similarity index 100% rename from 3rdparty/sdl2-2.0.0/test/utf8.txt rename to 3rdparty/sdl2-2.0.4/test/utf8.txt diff --git a/3rdparty/untz/src/native/android/UntzSystem.cpp b/3rdparty/untz/src/native/android/UntzSystem.cpp index 1729d9cda9..1025bea99b 100644 --- a/3rdparty/untz/src/native/android/UntzSystem.cpp +++ b/3rdparty/untz/src/native/android/UntzSystem.cpp @@ -152,9 +152,9 @@ void PlaybackThread::run() bool isPlaying = true; // Set the playback rate -// int error = env->CallNonvirtualIntMethod(track, audioTrackClass, setPlaybackRateMethod, mpSystemData->mSampleRate); -// if(error != 0) -// __android_log_write(ANDROID_LOG_ERROR, "UntzJNI", "Failed to set playback rate"); + int error = env->CallNonvirtualIntMethod(track, audioTrackClass, setPlaybackRateMethod, mpSystemData->mSampleRate); + if(error != 0) + __android_log_write(ANDROID_LOG_ERROR, "UntzJNI", "Failed to set playback rate"); // Get our buffer jarray buffer = env->NewByteArray(bufferSizeInBytes); @@ -306,8 +306,26 @@ UInt32 System::getSampleRate() return d->mSampleRate; } +// This function was left empty so this implementation may +// need refactoring void System::setSampleRate(UInt32 sampleRate) { + //__android_log_write(ANDROID_LOG_VERBOSE, "UntzJNI", "setSampleRate"); + + AndroidSystemData *d = (AndroidSystemData*)mpData; + d->mSampleRate = sampleRate; + + // set up audio thread. + d->mpAudioThread = PlaybackThread::getInstance(); + d->mpAudioThread->deleteInstance (); + d->mpAudioThread = PlaybackThread::getInstance(); + + //__android_log_write(ANDROID_LOG_VERBOSE, "UntzJNI", "getInstance2"); + // FIXME: set up audio thread. + d->mpAudioThread->setData(d); + d->mpAudioThread->start(); + + //__android_log_write(ANDROID_LOG_VERBOSE, "UntzJNI", "start"); } void System::setVolume(float volume) diff --git a/ant/libmoai-build.bat b/ant/libmoai-build.bat new file mode 100644 index 0000000000..d4896640ba --- /dev/null +++ b/ant/libmoai-build.bat @@ -0,0 +1,10 @@ +setlocal +set PATH=%ANDROID_NDK%;%PATH% +pushd libmoai\jni +ndk-build -j4 +if ERRORLEVEL 1 ( + popd + exit /b 1 +) +popd + diff --git a/ant/libmoai-clean.bat b/ant/libmoai-clean.bat new file mode 100644 index 0000000000..db73645e2f --- /dev/null +++ b/ant/libmoai-clean.bat @@ -0,0 +1,5 @@ + +rmdir /S/Q libmoai\obj +rmdir /S/Q libmoai\libs + +..\util\pito.bat ant-libmoai diff --git a/ant/libmoai/jni/Android.mk b/ant/libmoai/jni/Android.mk index 0c7866da9f..49005a4d44 100644 --- a/ant/libmoai/jni/Android.mk +++ b/ant/libmoai/jni/Android.mk @@ -9,6 +9,7 @@ include $(CLEAR_VARS) MOAI_SDK_HOME := $(abspath ../../../) + MY_ARM_MODE := arm MY_ARM_ARCH := armeabi-v7a arm64-v8a x86 @@ -32,6 +33,7 @@ MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/expat-2.1.0/amiga MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/expat-2.1.0/lib MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/expat-2.1.0/xmlwf + MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/kissfft MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/jansson-2.7/src MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/lua-5.1.3/src MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/ooid-0.99 @@ -41,14 +43,15 @@ MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/tlsf-2.0 MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/zlib-1.2.3 - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-contrib.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-expat.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-json.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-lua.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-sfmt.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-sqlite.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-tinyxml.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-zlib.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-contrib.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-expat.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-json.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-kissfft.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-lua.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-sfmt.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-sqlite.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-tinyxml.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-zlib.mk #================================================================# # moai core @@ -59,10 +62,10 @@ MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/src MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/src/config-default - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/zl-core.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/zl-vfs.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-core.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-util.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/zl-core.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/zl-vfs.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-core.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-util.mk #================================================================# # moai modules @@ -72,13 +75,13 @@ # ADCOLONY MY_HEADER_SEARCH_PATHS += - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-adcolony.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-adcolony.mk #--------------------------------------------------------------# # ANDROID MY_HEADER_SEARCH_PATHS += - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-android.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-android.mk #--------------------------------------------------------------# # BOX2D @@ -91,14 +94,14 @@ MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/box2d-2.3.0/Box2D/Dynamics MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/box2d-2.3.0/Box2D/Dynamics/Contacts MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/box2d-2.3.0/Box2D/Dynamics/Joints - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-box2d.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-box2d.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-box2d.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-box2d.mk #--------------------------------------------------------------# # CHARTBOOST MY_HEADER_SEARCH_PATHS += - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-chartboost.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-chartboost.mk #--------------------------------------------------------------# # CRYPTO @@ -107,30 +110,36 @@ MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/openssl-1.0.0m/include MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/openssl-1.0.0m MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/openssl-1.0.0m/crypto - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-crypto-a.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-crypto-b.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-crypto-c.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-crypto-d.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/zl-crypto.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-crypto.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-crypto-a.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-crypto-b.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-crypto-c.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-crypto-d.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/zl-crypto.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-crypto.mk + + #--------------------------------------------------------------# + # DELTADNA + + MY_HEADER_SEARCH_PATHS += + MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-deltadna.mk #--------------------------------------------------------------# # FACEBOOK MY_HEADER_SEARCH_PATHS += - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-facebook.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-facebook.mk #--------------------------------------------------------------# # FLURRY MY_HEADER_SEARCH_PATHS += - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-flurry.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-flurry.mk #--------------------------------------------------------------# # GOOGLE_PLAY_SERVICES MY_HEADER_SEARCH_PATHS += - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-google-play-services.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-google-play-services.mk #--------------------------------------------------------------# # HTTP_CLIENT @@ -140,45 +149,45 @@ MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/curl-7.19.7/include-android MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/openssl-1.0.0m/include-android MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/openssl-1.0.0m/include - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-c-ares.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-curl.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-ssl.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-http-client.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-c-ares.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-curl.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-ssl.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-http-client.mk #--------------------------------------------------------------# # HTTP_SERVER MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/mongoose - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-mongoose.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-http-server.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-mongoose.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-http-server.mk #--------------------------------------------------------------# # IMAGE_JPG MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/jpeg-8c - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-jpg.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-image-jpg.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-jpg.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-image-jpg.mk #--------------------------------------------------------------# # IMAGE_PNG MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/lpng140 - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-png.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-image-png.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-png.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-image-png.mk #--------------------------------------------------------------# # IMAGE_PVR MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/libpvr-3.4 - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-pvr.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-image-pvr.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-pvr.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-image-pvr.mk #--------------------------------------------------------------# # IMAGE_WEBP MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-webp.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-image-webp.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-webp.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-image-webp.mk #--------------------------------------------------------------# # LUAEXT @@ -189,7 +198,7 @@ MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/luasocket-2.0.2/src MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/luasocket-2.0.2-embed/src MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/luasql-2.2.0/src - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-luaext.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-luaext.mk #--------------------------------------------------------------# # SIM @@ -201,22 +210,22 @@ MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/freetype-2.4.4/src MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/freetype-2.4.4/config MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/libtess2/Include - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-freetype.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-tess.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/zl-gfx.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-sim.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-freetype.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-tess.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/zl-gfx.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-sim.mk #--------------------------------------------------------------# # TAPJOY MY_HEADER_SEARCH_PATHS += - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-tapjoy.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-tapjoy.mk #--------------------------------------------------------------# # TWITTER MY_HEADER_SEARCH_PATHS += - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-twitter.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-twitter.mk #--------------------------------------------------------------# # UNTZ @@ -228,16 +237,16 @@ MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/libvorbis-1.3.2/include MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/libvorbis-1.3.2/lib MY_HEADER_SEARCH_PATHS += $(MOAI_SDK_HOME)/3rdparty/libogg-1.2.2/include - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-ogg.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-vorbis.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/3rdparty-untz.mk - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-untz.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-ogg.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-vorbis.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/3rdparty-untz.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-untz.mk #--------------------------------------------------------------# # VUNGLE MY_HEADER_SEARCH_PATHS += - MY_INCLUDES += $(MOAI_SDK_HOME)/util/ant-libmoai/modules/moai-vungle.mk + MY_INCLUDES += $(MOAI_MODULES)/modules/moai-vungle.mk #================================================================# @@ -245,4 +254,9 @@ #================================================================# include libraries.mk + ifdef USE_PREBUILT + include $(MOAI_SDK_HOME)/libmoai/jni/prebuiltcore.mk + include $(MOAI_SDK_HOME)/libmoai/jni/prebuilt.mk + else include $(MY_INCLUDES) + endif diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 47a192c5fb..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,6 +0,0 @@ -shallow_clone: true -clone_depth: 2 - -build_script: bin\ci-windows.bat - -test: off diff --git a/bin/api-reference-parser/.bundle/config b/bin/api-reference-parser/.bundle/config deleted file mode 100644 index 57d4641d13..0000000000 --- a/bin/api-reference-parser/.bundle/config +++ /dev/null @@ -1,3 +0,0 @@ ---- -BUNDLE_PATH: vendor/bundle -BUNDLE_DISABLE_SHARED_GEMS: '1' diff --git a/bin/api-reference-parser/Gemfile b/bin/api-reference-parser/Gemfile deleted file mode 100644 index c0e746c357..0000000000 --- a/bin/api-reference-parser/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' - -gem 'ruby-progressbar' -gem 'haml' -gem 'nokogiri' \ No newline at end of file diff --git a/bin/api-reference-parser/Gemfile.lock b/bin/api-reference-parser/Gemfile.lock deleted file mode 100644 index 9561820533..0000000000 --- a/bin/api-reference-parser/Gemfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - haml (4.0.3) - tilt - nokogiri (1.5.9) - ruby-progressbar (1.0.2) - tilt (1.4.1) - -PLATFORMS - ruby - -DEPENDENCIES - haml - nokogiri - ruby-progressbar diff --git a/bin/api-reference-parser/intro_page.haml b/bin/api-reference-parser/intro_page.haml deleted file mode 100644 index b890e6d939..0000000000 --- a/bin/api-reference-parser/intro_page.haml +++ /dev/null @@ -1,59 +0,0 @@ -%h1 Welcome to Moai! - -%p - Thanks for installing the SDK.  Here's the scoop. - -%h2 Sample code - -%p - Go to the samples folder, choose a sample, then execute run.bat (or run.sh) to see it perform. -%p - One of our priorities is to build richer samples for Moai developers, so if you'd like to see a particular code sample, let us know by posting in the - %a{ href: "http://getmoai.com/forums/" } Moai Forums. - -%h2 FAQ - -%p - Answers to frequently asked questions are available in the - %a{ href: "http://getmoai.com/marketing/moai-faqs.html" } Moai FAQ. - -%h2 Wiki - -%p - You can find detailed documentation, instructions and other helpful information in the - %a{ href: "http://getmoai.com/wiki/" } Moai Wiki. - -%h2 Moai Cloud - -%p - You can sign in for a Moai Cloud account which allows you to upload Lua scripts to be hosted and run as web services via the - %a{ href: "http://dashboard.moaicloud.com/" } Moai Cloud Dashboard. - -%p - If you have support questions, post them to the - %a{ href: "http://getmoai.com/forums/moai-cloud-developer-support.html" } Moai Cloud Developer Support Forum - or check out the - %a{ href: "http://getmoai.com/wiki/" } Moai Wiki. - -%h2 License -%p - This SDK uses the - %a{ href: "http://www.opensource.org/licenses/cpal_1.0" } CPAL license. - -%h2 Made with Moai SDK -%p - Refer to the - %a{ href: "http://getmoai.com/marketing/made-with-moai.html"} Made With Moai page - for attribution screens to include with games made with Moai. - -%h2 Summary -%p - Happy game-making with Moai. -%p - Check out the - %a{ href: "http://getmoai.com/wiki/" } Moai Wiki - , ping us through - %a{ href: "http://getmoai.com/forums/" } the forums - or email us at - %a{ href: "mailto:support@getmoai.com" } support@getmoai.com - if you need help. The Moai team is here to help. \ No newline at end of file diff --git a/bin/api-reference-parser/lib/moai_api_parser.rb b/bin/api-reference-parser/lib/moai_api_parser.rb deleted file mode 100644 index 77da08800b..0000000000 --- a/bin/api-reference-parser/lib/moai_api_parser.rb +++ /dev/null @@ -1,417 +0,0 @@ -require 'ruby-progressbar' -require 'haml' -require 'nokogiri' -require 'fileutils' - -class MoaiAPIParser - - # - # source should be a string indicating the directory - # where all the source files are located. - attr_accessor :source, :version_major, :version_revision, :version_author - - # - # destination should be a string indicating the directory - # where the generated documentation should go to. - attr_accessor :destination - - def initialize ( source, destination ) - - # - # Check if source directory exists and it's actually - # a directory. - if !(File.exists?(source) and File.directory?(source)) - # Raise an error and exit if that's the case - raise "Source directory doesn't exist" - exit 1 - end - - self.source = source - self.destination = destination - - end - - # - # this will make all the magic happen - def parse - copy_source - parse_with_lua - parse_version - parse_with_doxygen - inject_intro_page - cleanup_doxygen_html - cleanup_doxygen_js - cleanup_extra_files - end - - # - # This method copies our source tree to a temporary directory - def copy_source - FileUtils.makedirs(destination) - FileUtils.cp_r source, destination - self.source = destination + "src" - - # Remove the files that are not from MOAI - # This includes: - # * FMOD Files ( using /Source/ as the pattern to match ) - # * OpenGLContext from NaCL - Dir.glob(destination + 'src/**/*').each { |f| - if !File.directory?(f) and (( f =~ /\/Source\// ) or ( f =~ /opengl_context\.h/)) - File.delete(f) - end - } - - end - - # - # We use some custom tags to annotate our source code. - # In order for that to be parsable by doxygen we need to - # run a couple of replacements. - def parse_with_lua - ['h', 'cpp', 'mm'].each do |extension| - parse_with_lua_for(extension) - end - end - - # - # We have lua-based parsers that search and replace - # our code for specific stuff using MOAIParser. - # This method searchs for all the files for a specific - # extension and then runs the replacements using - # the system's moai executable - def parse_with_lua_for(extension) - - # - # Our parsers expect a file called - # input.[extension] and return a file called output.[extension] - # so we need to cleanup everything just in case. - if File.exists?("input.#{extension}") - FileUtils.rm ("input.#{extension}") - end - if File.exists?("output.#{extension}") - FileUtils.rm ("output.#{extension}") - end - - # Since we have different scripts for each different - # file type, we have to decide which script to run... - parser_script = File.dirname(__FILE__) + "/../lua-parsers/" - case extension - when "h" - parser_script += "header-files.lua" - when "cpp" - parser_script += "source-files-cpp.lua" - when "mm" - parser_script += "source-files-mm.lua" - end - - # Now we iterate through all these files and - # parse them. - files = all_source_files(source, extension) - pb = ProgressBar.create(:title => "Fixing #{extension}", :total => files.size) - files.each do |file| - FileUtils.cp file, "input.#{extension}" - system "moai #{parser_script} >/dev/null" - - # The moai parser outputs a file called output.[extension] - # so we want to copy it back. - FileUtils.mv "output.#{extension}", file - FileUtils.rm "input.#{extension}" - pb.increment - end - - end - - def parse_version - File.open ( destination + "src/config-default/moai_version_major.h" ) do |file| - data = file.read - - data.match ( /MOAI_SDK_VERSION_MAJOR_MINOR\s(\S*)\s*/ ) - self.version_major = $1 - end - File.open ( destination + "src/config-default/moai_version_minor.h" ) do |file| - data = file.read - - data.match ( /MOAI_SDK_VERSION_REVISION\s(\S*)\s*/ ) - self.version_revision = $1 - end - File.open ( destination + "src/config-default/moai_version_author.h" ) do |file| - data = file.read - - data.match ( /MOAI_SDK_VERSION_AUTHOR\s\"(.*)\"\s*/ ) - self.version_author = $1 - end - end - - def full_version - v = "#{version_major}" - - if version_revision.to_i > 0 - v += " revision #{version_revision}" - v += " (#{version_author})" if version_author.length > 0 - else - v += " (ad hoc build by #{version_author})" if version_author.length > 0 - end - v - end - - def parse_with_doxygen - configure_doxygen - system ( "doxygen #{destination}moai-api-doxygen.cfg" ) - end - - def configure_doxygen - # Copy default configuration file to our destination - # directory. - FileUtils.cp(File.dirname(__FILE__) + '/../moai-api-doxygen.cfg', destination + "moai-api-doxygen.cfg") - - # Replace the output and input directories with the correct ones - file = File.open(destination + 'moai-api-doxygen.cfg', 'r') - config = file.read - - config.gsub!(/@@OUTPUT_DIRECTORY@@/, destination) - config.gsub!(/@@INPUT_DIRECTORY@@/, source) - config.gsub!(/@@VERSION@@/, "#{full_version}") - - File.open(destination + 'moai-api-doxygen.cfg', 'w') do |file| - file.write config - end - end - - # - # We're using a customized intro page that gets injected into - # doxygen's index.html through this method. - # To modify the intro page, just change the intro_page.haml on - # the root directory of this library. - # It's written using http://haml.info/ - def inject_intro_page - - # Open the haml file and get the html version - file = File.open(File.dirname(__FILE__) + "/../intro_page.haml", "r") - haml_string = file.read - html_string = Haml::Engine.new(haml_string).render - file.close - - # Open doxygen's index.html and inject the generated html - file = File.open(destination + "html/index.html", "r") - index_string = file.read - index_string.gsub!(/
\s+<\/div>/, - "
\n#{html_string}<\/div>") - file.close - - # write the result string into index.html - file = File.open(destination + "html/index.html", "w") do |file| - file.write ( index_string ) - end - end - - # There are some other replacements that are needed - # for our final version of the docs. - # These are made using gsub and a set of predefined regexps - HTML_REPLACEMENTS = [ - { :regexp => /Static .*? Member Functions/, :replace_with => "Function List" }, - { :regexp => /Member Function Documentation/, :replace_with => "Function Documentation" }, - { :regexp => /static int(?.*?\"\>?)_(?.*?\<\/a\>?)/, :replace_with => "\\k\\k" }, - { :regexp => /\(lua_State \*L\)/, :replace_with => "" }, - { :regexp => /\>lua_State \*.*?\ "><" }, - { :regexp => /int \<(?.*?)MOAI.*?::.*_(?.*?)\<\/a\>/, :replace_with => "<\\k\\k" }, - { :regexp => /\L\<\/em\>/, :replace_with => "" }, - { :regexp => /\\<\/td\>/, :replace_with => "" }, - { :regexp => /\\<\/td\>/, :replace_with => "" }, - { :regexp => /\\(\<\/td\>/, :replace_with => "" }, - { :regexp => /\\)\<\/td\>/, :replace_with => "" }, - { :regexp => /\[static, private\]/, :replace_with => "" }, - { :regexp => /\[static, protected\]/, :replace_with => "" }, - { :regexp => /\[private, static\]/, :replace_with => "" }, - { :regexp => /\[protected, static\]/, :replace_with => "" }, - { :regexp => /\_(?.*?)\n/, :replace_with => "
  • \\k" }, - - # Methods in -members.html files - { :regexp => /\\.+?)\"\>_(?.+?)\<\/a\>\<\/td\>/, :replace_with => "\">\\k\n"}, - - # - # Doxytags - { :regexp => /\<\!\-\-\sdoxytag:\smember="(?.+?)_(?.+?)\"/, :replace_with => " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/jni/Android.mk b/host-templates/android/studio/MoaiTemplate/app/src/main/jni/Android.mk deleted file mode 100644 index d5ef546e0e..0000000000 --- a/host-templates/android/studio/MoaiTemplate/app/src/main/jni/Android.mk +++ /dev/null @@ -1,51 +0,0 @@ -LOCAL_PATH := $(call my-dir) -MOAI_LIB_DIR := $(LOCAL_PATH)/../../../libmoai -MOAI_LIB_ROOT := $(MOAI_LIB_DIR)/$(TARGET_ARCH_ABI) -MOAI_MODULES := $(LOCAL_PATH)/MoaiModules.mk -MOAI_AKU_FLAGS := - -include $(MOAI_MODULES) - - -MOAI_ANDROID_MODULES := $(MOAI_LIB_DIR)/modules/jni/moaiandroid.mk -MOAI_JNI_MODULES := -MOAI_STATIC_LIBRARIES := - -include $(MOAI_ANDROID_MODULES) - - - -include $(CLEAR_VARS) - - -LOCAL_MODULE := moai -LOCAL_CFLAGS := -DDISABLE_IMPORTGL -LOCAL_LDLIBS := -llog -lGLESv1_CM -lGLESv2 -landroid -lEGL -LOCAL_STATIC_LIBRARIES := $(MOAI_STATIC_LIBRARIES) moai-android moai-image-webp moai-image-pvr moai-image-jpg moai-image-png moai-http-client moai-http-server moai-luaext moai-box2d moai-untz moai-crypto moai-sim moai-util moai-core zlcore luaext luasql luacrypto luacurl luasocket luafilesystem liblua-static zlcrypto zlvfs contrib expat freetype png box2d zlib jpg pvr jansson untz vorbis ogg sqlite3 mongoose tinyxml tlsf curl ssl crypto cares sfmt tess webp cpufeatures - -# sfmt chipmunk curl ssl crypto tlsf tinyxml mongoose sqlite3 ogg vorbis untz jansson cares jpg zlib box2d png freetype expat contrib zlvfs liblua-static luafilesystem luasocket luacurl luacrypto luasql luaext zlcore moai-core moai-util moai-sim moai-untz moai-box2d moai-luaext moai-http-client moai-chipmunk moai-android - -LOCAL_SRC_PATH := $(LOCAL_PATH) -LOCAL_SRC_FILES := $(MOAI_JNI_MODULES) -LOCAL_SRC_FILES += jni.cpp -LOCAL_SRC_FILES += moai.cpp -LOCAL_SRC_FILES += host-modules/aku_modules.cpp -LOCAL_SRC_FILES += host-modules/aku_modules_util.cpp -LOCAL_SRC_FILES += $(MOAI_LIB_DIR)/src/host-modules/aku_plugins.cpp -LOCAL_SRC_FILES += host-modules/aku_modules_android.cpp - - -LOCAL_C_INCLUDES := $(LOCAL_PATH) -LOCAL_C_INCLUDES += $(MOAI_LIB_ROOT)/include -LOCAL_C_INCLUDES += $(MOAI_LIB_ROOT)/include/config -LOCAL_C_INCLUDES += $(MOAI_LIB_ROOT)/include/lua -LOCAL_C_INCLUDES += $(MOAI_LIB_ROOT)/include/expat -LOCAL_C_INCLUDES += $(MOAI_LIB_ROOT)/include/tinyxml -LOCAL_C_INCLUDES += $(MOAI_LIB_ROOT)/include/freetype -LOCAL_C_INCLUDES += $(MOAI_LIB_ROOT)/include/jansson - -LOCAL_CPPFLAGS := -DAKU_WITH_ANDROID=1 $(MOAI_AKU_FLAGS) - -include $(BUILD_SHARED_LIBRARY) - - diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/jni/Application.mk b/host-templates/android/studio/MoaiTemplate/app/src/main/jni/Application.mk deleted file mode 100644 index 5c26626854..0000000000 --- a/host-templates/android/studio/MoaiTemplate/app/src/main/jni/Application.mk +++ /dev/null @@ -1,3 +0,0 @@ -APP_ABI := armeabi armeabi-v7a x86 -APP_PLATFORM := android-10 - APP_STL := gnustl_static \ No newline at end of file diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/jni/MoaiModules.mk b/host-templates/android/studio/MoaiTemplate/app/src/main/jni/MoaiModules.mk deleted file mode 100644 index e26842c7da..0000000000 --- a/host-templates/android/studio/MoaiTemplate/app/src/main/jni/MoaiModules.mk +++ /dev/null @@ -1,289 +0,0 @@ - -MOAI_LIBS := $(MOAI_LIB_ROOT)/lib -include $(CLEAR_VARS) - - -LOCAL_MODULE := sfmt -LOCAL_SRC_FILES := $(MOAI_LIBS)/libsfmt.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := pvr -LOCAL_SRC_FILES := $(MOAI_LIBS)/libpvr.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-core -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-core.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := curl -LOCAL_SRC_FILES := $(MOAI_LIBS)/libcurl.a - -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := ssl -LOCAL_SRC_FILES := $(MOAI_LIBS)/libssl.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := tess -LOCAL_SRC_FILES := $(MOAI_LIBS)/libtess.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := crypto -LOCAL_SRC_FILES := $(MOAI_LIBS)/libcrypto.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := tlsf -LOCAL_SRC_FILES := $(MOAI_LIBS)/libtlsf.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-http-client -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-http-client.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := luacrypto -LOCAL_SRC_FILES := $(MOAI_LIBS)/libluacrypto.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := tinyxml -LOCAL_SRC_FILES := $(MOAI_LIBS)/libtinyxml.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := mongoose -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmongoose.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := sqlite3 -LOCAL_SRC_FILES := $(MOAI_LIBS)/libsqlite3.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := ogg -LOCAL_SRC_FILES := $(MOAI_LIBS)/libogg.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := vorbis -LOCAL_SRC_FILES := $(MOAI_LIBS)/libvorbis.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := untz -LOCAL_SRC_FILES := $(MOAI_LIBS)/libuntz.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-luaext -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-luaext.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-untz -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-untz.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-box2d -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-box2d.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-crypto -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-crypto.a - -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-util -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-util.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-sim -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-sim.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := liblua-static -LOCAL_SRC_FILES := $(MOAI_LIBS)/libliblua-static.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := luafilesystem -LOCAL_SRC_FILES := $(MOAI_LIBS)/libluafilesystem.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := jansson -LOCAL_SRC_FILES := $(MOAI_LIBS)/libjansson.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := cares -LOCAL_SRC_FILES := $(MOAI_LIBS)/libcares.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := jpg -LOCAL_SRC_FILES := $(MOAI_LIBS)/libjpg.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := luasocket -LOCAL_SRC_FILES := $(MOAI_LIBS)/libluasocket.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := zlcore -LOCAL_SRC_FILES := $(MOAI_LIBS)/libzlcore.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := zlcrypto -LOCAL_SRC_FILES := $(MOAI_LIBS)/libzlcrypto.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := zlib -LOCAL_SRC_FILES := $(MOAI_LIBS)/libzlib.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := box2d -LOCAL_SRC_FILES := $(MOAI_LIBS)/libbox2d.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-android -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-android.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := png -LOCAL_SRC_FILES := $(MOAI_LIBS)/libpng.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := freetype -LOCAL_SRC_FILES := $(MOAI_LIBS)/libfreetype.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := expat -LOCAL_SRC_FILES := $(MOAI_LIBS)/libexpat.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := contrib -LOCAL_SRC_FILES := $(MOAI_LIBS)/libcontrib.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := luasql -LOCAL_SRC_FILES := $(MOAI_LIBS)/libluasql.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-spine -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-spine.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := zlvfs -LOCAL_SRC_FILES := $(MOAI_LIBS)/libzlvfs.a - -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := luacurl -LOCAL_SRC_FILES := $(MOAI_LIBS)/libluacurl.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-image-jpg -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-image-jpg.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-image-png -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-image-png.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-image-pvr -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-image-pvr.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := cpufeatures -LOCAL_SRC_FILES := $(MOAI_LIBS)/libcpufeatures.a - -include $(PREBUILT_STATIC_LIBRARY) -include $(CLEAR_VARS) - -LOCAL_MODULE := webp -LOCAL_SRC_FILES := $(MOAI_LIBS)/libwebp.a - -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := moai-image-webp -LOCAL_SRC_FILES := $(MOAI_LIBS)/libmoai-image-webp.a - -include $(PREBUILT_STATIC_LIBRARY) diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/jni/jni.cpp b/host-templates/android/studio/MoaiTemplate/app/src/main/jni/jni.cpp deleted file mode 100644 index 1453b3e8d4..0000000000 --- a/host-templates/android/studio/MoaiTemplate/app/src/main/jni/jni.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include - -//================================================================// -// JNI set up -//================================================================// - -JavaVM* jvm; - -//----------------------------------------------------------------// -int JNI_OnLoad ( JavaVM* vm, void* reserved ) { - - jvm = vm; - - return JNI_VERSION_1_4; -} diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-hdpi/icon.png b/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-hdpi/icon.png deleted file mode 100644 index a6a333a8ef..0000000000 Binary files a/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-mdpi/icon.png b/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-mdpi/icon.png deleted file mode 100644 index 76df4e4ed9..0000000000 Binary files a/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-xhdpi/icon.png b/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-xhdpi/icon.png deleted file mode 100644 index 24e94d5955..0000000000 Binary files a/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-xhdpi/icon.png and /dev/null differ diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-xxhdpi/icon.png b/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-xxhdpi/icon.png deleted file mode 100644 index a60767bc42..0000000000 Binary files a/host-templates/android/studio/MoaiTemplate/app/src/main/res/drawable-xxhdpi/icon.png and /dev/null differ diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/res/values/strings.xml b/host-templates/android/studio/MoaiTemplate/app/src/main/res/values/strings.xml deleted file mode 100644 index 00113df816..0000000000 --- a/host-templates/android/studio/MoaiTemplate/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - Moai Template - - - 0 - - - moaischeme - - - 0 - - - 0 - diff --git a/host-templates/android/studio/MoaiTemplate/app/src/main/res/values/styles.xml b/host-templates/android/studio/MoaiTemplate/app/src/main/res/values/styles.xml deleted file mode 100644 index 084b42b7b1..0000000000 --- a/host-templates/android/studio/MoaiTemplate/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/host-templates/android/studio/MoaiTemplate/build.bat b/host-templates/android/studio/MoaiTemplate/build.bat deleted file mode 100644 index 079ab7b049..0000000000 --- a/host-templates/android/studio/MoaiTemplate/build.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -call gradlew assembleDebug \ No newline at end of file diff --git a/host-templates/android/studio/MoaiTemplate/build.gradle b/host-templates/android/studio/MoaiTemplate/build.gradle deleted file mode 100644 index 21943264e1..0000000000 --- a/host-templates/android/studio/MoaiTemplate/build.gradle +++ /dev/null @@ -1,65 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' - - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - jcenter() - } -} - -//common settings for all but our app -subprojects { - apply plugin: MoaiModulePlugin - - //get our build artifacts out of src - buildDir = new File(rootProject.projectDir, "gradleBuild/" + project.name) - - //android defaults - if (project.name == 'app') { - apply plugin: 'com.android.application' - } else { - println("configuring: " + project.name) - apply plugin: 'com.android.library' - } - - android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" - - defaultConfig { - minSdkVersion 17 - targetSdkVersion 22 - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - } - -} - - - -class MoaiModulePlugin implements Plugin { - void apply(Project project) { - project.extensions.create("moai", MoaiModuleExtension) - } -} - -class MoaiModuleExtension { - String nativeLib -} \ No newline at end of file diff --git a/host-templates/android/studio/MoaiTemplate/build.sh b/host-templates/android/studio/MoaiTemplate/build.sh deleted file mode 100755 index 550cea674f..0000000000 --- a/host-templates/android/studio/MoaiTemplate/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -ndkdir=$( awk -F"=" '/^ndk.dir=/{print $2}' < local.properties ) -if [ ! $? -eq 0 ]; then - echo "could not find the 'ndk.dir' property in your local.properties file" - exit 1; -fi - - -if [ ! -e "$ndkdir" ]; then - echo "path set for 'ndk.dir' in local.properties was not found ($ndkdir)" - exit 1; -fi - -bash ./gradlew assembleDebug \ No newline at end of file diff --git a/host-templates/android/studio/MoaiTemplate/gradle.properties b/host-templates/android/studio/MoaiTemplate/gradle.properties deleted file mode 100644 index ab18a69186..0000000000 --- a/host-templates/android/studio/MoaiTemplate/gradle.properties +++ /dev/null @@ -1,31 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Settings specified in this file will override any Gradle settings -# configured through the IDE. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -moaiLibRoot=./lib -moaiSrcRoot=./lib/src -moaiLuaRoot=lua -#valid modules: moai-android-adcolony, moai-android-amazon-billing, moai-android-chartboost, moai-android-crittercism, -# moai-android-facebook, moai-android-flurry, moai-android-fortumo, moai-android-google-billing, -# moai-android-google-play-services, moai-android-google-push, moai-android-tapjoy, -# moai-android-twitter, moai-android-vungle -moaiModules= - -android.useDeprecatedNdk=true - - diff --git a/host-templates/android/studio/MoaiTemplate/gradle/wrapper/gradle-wrapper.jar b/host-templates/android/studio/MoaiTemplate/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 8c0fb64a86..0000000000 Binary files a/host-templates/android/studio/MoaiTemplate/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/host-templates/android/studio/MoaiTemplate/gradle/wrapper/gradle-wrapper.properties b/host-templates/android/studio/MoaiTemplate/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 90382a6758..0000000000 --- a/host-templates/android/studio/MoaiTemplate/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Sat Dec 13 14:17:34 EST 2014 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/host-templates/android/studio/MoaiTemplate/gradlew b/host-templates/android/studio/MoaiTemplate/gradlew deleted file mode 100755 index 91a7e269e1..0000000000 --- a/host-templates/android/studio/MoaiTemplate/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/host-templates/android/studio/MoaiTemplate/gradlew.bat b/host-templates/android/studio/MoaiTemplate/gradlew.bat deleted file mode 100644 index aec99730b4..0000000000 --- a/host-templates/android/studio/MoaiTemplate/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/host-templates/android/studio/MoaiTemplate/local.properties.template b/host-templates/android/studio/MoaiTemplate/local.properties.template deleted file mode 100644 index 5249bbd91e..0000000000 --- a/host-templates/android/studio/MoaiTemplate/local.properties.template +++ /dev/null @@ -1,12 +0,0 @@ -## This file is automatically generated by Android Studio. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must *NOT* be checked into Version Control Systems, -# as it contains information specific to your local configuration. -# -# Location of the SDK. This is only used by Gradle. -# For customization when using a Version Control System, please read the -# header note. -#Thu Oct 23 20:09:49 EST 2014 -sdk.dir=C\:\\Users\\David\\AppData\\Local\\Android\\sdk -ndk.dir=K\:\\dev\\mobile\\moaiforge\\android-ndk-r9d \ No newline at end of file diff --git a/host-templates/android/studio/MoaiTemplate/moaisettings.gradle b/host-templates/android/studio/MoaiTemplate/moaisettings.gradle deleted file mode 100644 index eb1b3aa86d..0000000000 --- a/host-templates/android/studio/MoaiTemplate/moaisettings.gradle +++ /dev/null @@ -1,55 +0,0 @@ -apply plugin: MoaiSettings - -class MoaiSettings implements Plugin { - - - void apply(Settings settings) { - //get any enabled modules - - def libRoot = "lib" - if (settings.hasProperty('moaiLibRoot')) { - libRoot = settings.moaiLibRoot - } else { - settings.moaiLibRoot = libRoot - } - - - def srcRoot = "src" - if (settings.hasProperty('moaiSrcRoot')) { - srcRoot = settings.moaiSrcRoot - } else { - settings.moaiSrcRoot = srcRoot - } - - if (!settings.hasProperty('moaiModules') || settings.moaiModules == null) { - settings.moaiModules="" - } - def modules = settings.moaiModules.toString().split(",").collect { i -> i.trim() } - if (settings.moaiModules == "") { - modules = [] - } - //always include core - settings.include(":core") - settings.project(":core").projectDir = new File(srcRoot+"/moai-android/java") - - def enableModule = { - module -> - def modproj = new File(srcRoot+"/"+module+"/java/build.gradle") - if (modproj.exists()) { - println("enabling ${module}") - settings.include(":${module}") - settings.project(":${module}").projectDir = new File(srcRoot+"/"+module+"/java") - settings.project(":${module}").name = module - } else { - throw new Exception("Missing module ${module} not found at ${srcRoot}/${module}/java") - } - } - - //include enabled modules projects - for (module in modules) { - enableModule(module) - } - - settings.ext.enableModule = enableModule - } -} \ No newline at end of file diff --git a/host-templates/android/studio/MoaiTemplate/run.bat b/host-templates/android/studio/MoaiTemplate/run.bat deleted file mode 100644 index 72a882d739..0000000000 --- a/host-templates/android/studio/MoaiTemplate/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -call gradlew runApp diff --git a/host-templates/android/studio/MoaiTemplate/run.sh b/host-templates/android/studio/MoaiTemplate/run.sh deleted file mode 100755 index bb5b48252e..0000000000 --- a/host-templates/android/studio/MoaiTemplate/run.sh +++ /dev/null @@ -1 +0,0 @@ -./gradlew runApp \ No newline at end of file diff --git a/host-templates/android/studio/MoaiTemplate/settings.gradle b/host-templates/android/studio/MoaiTemplate/settings.gradle deleted file mode 100644 index 10710d6586..0000000000 --- a/host-templates/android/studio/MoaiTemplate/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -apply from: 'moaisettings.gradle' - -include ':app' diff --git a/host-templates/html/README.md b/host-templates/html/README.md deleted file mode 100644 index 79ef8c6ed1..0000000000 --- a/host-templates/html/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# HTML5 Host Template - -To run your Moai game using HTML5, you need the following things: the host template, `moaijs.js`, and the ROM containing your assets. - -- The *host template* in this folder (`host-templates/html`) includes the required initialization code and libraries. It also comes with a simple Node.js server app to serve your project during testing. -- *`moaijs.js`* contains the core Moai SDK in JavaScript. You can build it from the C++ Moai sources. -- *The ROM* is a binary blob that contains all your scripts and assets. You can build it from a `src` directory. - -## Building the Moai SDK - -The HTML5 host requires a JavaScript version of the Moai SDK. You can build it from the C++ source files via Emscripten. See the `README.md` file in `src/host-html` for details. The result is a file `moaijs.js` in the newly-created directory `lib/html`. - -## Setting Up Your Output Directory - -Now, create a directory that you want to use as output directory. This is where the host template files, `moaijs.js`, and the ROM files will all end up in. - -Now navigate into the `util` directory and execute the following command: - -`pito.bat host-html --use-symlink --output-dir ` - -Replace `` with your output directory. Note that you can shorten `--use-symlink` to `-s` and `--output-dir` to -`o`. - -This will copy the host template from `host-templates/html` to your output directory. It will also create a symbolic link on your hard-disk that makes the generated `moaijs.js` file show up in the `www/lib` sub-folder of your output directory. The advantage of the symbolic link is that any time you re-compile Moai, your output directory automatically contains the current version without any copying. If you leave off the `-use-symlink` option, the file will be copied instead. - -## Creating the ROM - -Before you can do much, your assets and source files will need to be packaged into a single ROM file. To do this you will need Python 2.7+ installed. Make sure your Python `bin` directory is on the path. - -To create the ROM, place your sources and assets (in the folder layout they expect) into the `/src` folder (again, create the folder manually or symlink it). The HTML5 host automatically will run `main.lua` from the `src/` folder when it loads and will treat the `src/` folder as root of the virtual filesystem. - -Then run the `buildrom.sh` or `buildrom.bat` (for Windows) file. This will package up your src folder into a file called `moaiapp.rom` and create a metadata file called `moaiapp.rom.json`. -These files will automatically be placed into the `/www` folder which is what you will need to deploy or serve to test your app. - -Your host should now be ready to run! - -## Testing/Running - -To run your app you need to serve the contents of the www directory from a webserver. -> Using file:// will not work because of xhr2 security policy. - -There is a simple Node.js express server `app.js` in this folder which can be run with a copy of Node.js by -``` - > npm install - > node app.js -``` - -You can then see the host by visiting `http://localhost:3000/index.html` this is an example of the host in an iframe, the fullscreen -version of the host (which is used in the iframe) is located at `/moai.html`. - -Alternatively, you can download the [Mongoose server](http://cesanta.com/mongoose.shtml). Simply place the executable into your `www` directory and execute it. Note that Mongoose doesn't seem to like it if `joaijs.js` is symbolically linked. - -To refresh your code while developing you do not need to restart the server. Just rerun `buildrom.sh` and -refresh your browser. - -You can poke your running app from the developer console in the browser by calling -``` - player.moai.AKURunString('print("hello from moai"') - or - player.moai.AKURunScript('otherluafilehere.lua') -``` - -You can refresh the lua context with -``` - player.moai.RefreshContext() -``` - -## Modifying the Template - -To change the size of the player look for the iframe and change its width and height properties - -The width and height of the player canvas are passed into moai as verticalResolution and horizontalResolution -like on mobile devices. - -`MoaiSim.OpenWindow()` (from lua code) will cause the canvas to resize to the requested size. The element with the class -`moai-title` will be updated with the title of the window from OpenWindow. - -The element with the class `moai-status` is updated with the loading progress of the host. diff --git a/host-templates/html/build.bat b/host-templates/html/build.bat deleted file mode 100644 index 804e2d1d5d..0000000000 --- a/host-templates/html/build.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -call buildrom.bat @SRC@ \ No newline at end of file diff --git a/host-templates/html/build.sh b/host-templates/html/build.sh deleted file mode 100755 index 5c90794fbc..0000000000 --- a/host-templates/html/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -bash buildrom.sh @SRC@ \ No newline at end of file diff --git a/host-templates/html/buildrom.bat b/host-templates/html/buildrom.bat deleted file mode 100644 index 1fd9e5af5d..0000000000 --- a/host-templates/html/buildrom.bat +++ /dev/null @@ -1,5 +0,0 @@ -moai file_packager.lua %1 moaiapp - -move /y moaiapp.rom ./www/moaiapp.rom -move /y moaiapp.rom.json ./www/moaiapp.rom.json - diff --git a/host-templates/html/buildrom.sh b/host-templates/html/buildrom.sh deleted file mode 100644 index d5a3d0111a..0000000000 --- a/host-templates/html/buildrom.sh +++ /dev/null @@ -1,3 +0,0 @@ -moai file_packager.lua $1 moaiapp -mv -f moaiapp.rom www/moaiapp.rom -mv -f moaiapp.rom.json www/moaiapp.rom.json diff --git a/host-templates/html/file_packager.lua b/host-templates/html/file_packager.lua deleted file mode 100644 index eea4dbfb28..0000000000 --- a/host-templates/html/file_packager.lua +++ /dev/null @@ -1,98 +0,0 @@ -iterateFiles = function ( path ) - path = MOAIFileSystem.getAbsoluteDirectoryPath ( path ) - - local doRecurse - doRecurse = function ( dirname ) - - local files = MOAIFileSystem.listFiles ( path .. dirname ) or {} - for i, filename in ipairs ( files ) do - coroutine.yield ( string.format ( '%s%s', dirname, filename ), false) - end - - local dirs = MOAIFileSystem.listDirectories ( path .. dirname ) or {} - for i, subdir in ipairs ( dirs ) do - local thisdir = string.format ( '%s%s', dirname, subdir ) - coroutine.yield ( thisdir, true ) - doRecurse ( thisdir..'/' ) - end - - end - - local co = coroutine.create ( function () - doRecurse ( '' ) - end ) - - return function () - local status, result, isdir = coroutine.resume ( co ) - if status then - return result, isdir - else - return nil - end - end -end - -local function uuid() - math.randomseed(os.time()) - local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' - return string.gsub(template, '[xy]', function (c) - local v = (c == 'x') and math.random(0, 0xf) or math.random(8, 0xb) - return string.format('%x', v) - end) -end - - -local luaSrc=MOAIFileSystem.getAbsoluteDirectoryPath(arg[1]) -local destRom=arg[2] -local dumpfile = string.format("%s.rom",destRom) -local jsonfile = string.format("%s.json",dumpfile) -local fileinfo = {} -local partial_dirs = {} - -print ("Creating ", dumpfile) -local outstream = MOAIFileStream.new() -outstream:open(dumpfile, MOAIFileStream.READ_WRITE_NEW) -local file_start = 0 - - -for file, isdir in iterateFiles(luaSrc) do - print ("Processing "..file.."...") - if isdir then - table.insert(partial_dirs, '/'..file) - else - local stream = MOAIFileStream.new() - if stream:open(luaSrc..file, MOAIFileStream.READ) then - - --dump the data - local data, size = stream:read() - local outsize = outstream:write(data) - if size ~= outsize then - print("Write size did not match read size. Error creating package") - os.exit(1) - end - outstream:flush() - - --update file_info - local file_end = file_start + size - table.insert(fileinfo, { ['filename'] = '/'..file, ['start'] = file_start, ['end'] = file_end }) - file_start = file_end - else - print("error creating read stream",luaSrc..file) - end - end -end -outstream:close() - ---json dump -local uuid = uuid() -local jsonstream = MOAIFileStream.new() -jsonstream:open(jsonfile,MOAIFileStream.READ_WRITE_NEW) -jsonstream:write( - MOAIJsonParser.encode({ - ['bundle_file'] = dumpfile , ['directories'] = partial_dirs, ['files'] = fileinfo, ['package_uuid'] = uuid - }) -) -jsonstream:flush() -jsonstream:close() - -print ("Complete.") \ No newline at end of file diff --git a/host-templates/html/run.bat b/host-templates/html/run.bat deleted file mode 100644 index 668b0e70df..0000000000 --- a/host-templates/html/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -pushd www -pito serve -popd diff --git a/host-templates/html/run.sh b/host-templates/html/run.sh deleted file mode 100755 index 668b0e70df..0000000000 --- a/host-templates/html/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -pushd www -pito serve -popd diff --git a/host-templates/html/www/background.jpg b/host-templates/html/www/background.jpg deleted file mode 100644 index ff3f6dd2b8..0000000000 Binary files a/host-templates/html/www/background.jpg and /dev/null differ diff --git a/host-templates/html/www/css/style.css b/host-templates/html/www/css/style.css deleted file mode 100644 index b586d266ac..0000000000 --- a/host-templates/html/www/css/style.css +++ /dev/null @@ -1,184 +0,0 @@ -/* moai window */ - -.moai-window canvas { - outline:none; -} - - - -.moai-window { - font-family: Helvetica,'Trebuchet MS','Liberation Sans',FreeSans,sans-serif; - font-size:14px; - display: table; - height:100%; - width:100%; -} - - -.moai-canvas-wrapper, -.moai-info -{ - background-color: #202025; - width: 100%; - /* height: calc(100% - 30px); */ - position: absolute; - left: 0; - bottom: 30px; - top: 0; - right: 0; - text-align: center; - /* display:table-row; */ -} - - -.moai-canvas-wrapper canvas { - width: 100%; - height: auto; - background-color: black; - /* margin: auto; */ - max-width: none; - max-height: 100%; - /* max-width: 100%; */ -} - -.moai-canvas-wrapper.portrait canvas { - width: auto; - max-width: 100%; - max-height: none; - height: 100%; - margin: auto; -} - -.moai-header { - color: #CCC; - background-color: #111; - width:100%; - box-sizing:border-box; - -moz-box-sizing: border-box; - height: 30px; -} -.moai-header .moai-title { - font-size: 19px; - padding-left: 5px; - line-height:30px; -} -.moai-header .moai-status { - float:right; - line-height: 30px; - text-align: right; - padding-right: 5px; -} -.moai-footer -{ - /*display: none;*/ - height: 30px; - background-color: #111; - position: absolute; - bottom: 0; - left: 0; - right: 0; -} - -.moai-footer:after { - content: ' '; - clear: both; -} - -.moai-attrib { - margin-right: 8px; - padding-left: 136px; /* logo */ - font-size: 10px; - text-align: right; - display:none; -} - -#moai-pause,#moai-play, #moai-stop { - font-size:25px; - line-height:30px; - padding-left:5px; - color:#444; -} -#moai-pause.paused { - background-color: #CCC; - -} - -.moai-window #moai-play { - display:inline-block; -} - -html { - height: 100%; -} -body { - color: #CCC; - font-size: 14px; - height:100%; - margin:0; - padding:0; - background-color: #202025; -} - -#moaiplayer { - width: 100%; - height: 100%; - margin:auto; - background-color: #202025; -} - -.moai-cpal { - width: 150px; - max-width:100%; - margin: auto; - font-size: 10px; - position:absolute; - bottom: 30px; - left: 50%; - margin-left: -85px; - background-color: rgba(32,32,37,0.9); - padding: 10px; - border-radius: 4px; -} - -.moai-cpal img { - margin: 5px 0; - width: 100%; - opacity: 0.4; -} -.moai-cpal a { - color: #CCC; -} - - -#runMe { - position: absolute; - width: 150px; - height: 100px; - top: 45%; - left: 50%; - margin-left: -75px; - margin-top: -50px; - border-radius: 10px; - border: 1px solid #CCC; - background-color: #CCC; - opacity: 0.6; - z-index:1000; - line-height: 100px; - color: #777; - font-size: 65px; -} -#runMe:hover { - opacity: 1; -} - - -.moai-info { - background-image: url(../background.jpg); - background-position-x: 50%; - background-position-y: 50%; - background-size: contain; - background-repeat: no-repeat; -} - - - diff --git a/host-templates/html/www/howler.js b/host-templates/html/www/howler.js deleted file mode 100644 index e676ebe6ca..0000000000 --- a/host-templates/html/www/howler.js +++ /dev/null @@ -1,1217 +0,0 @@ -/*! - * howler.js v1.1.12 - * howlerjs.com - * - * (c) 2013, James Simpson of GoldFire Studios - * goldfirestudios.com - * - * Modifications by David Pershouse (github.com/halfnelson) - * - * MIT License - * - */ - -(function() { - // setup - var cache = {}; - - // setup the audio context - var ctx = null, - usingWebAudio = true, - noAudio = false; - if (typeof AudioContext !== 'undefined') { - ctx = new AudioContext(); - } else if (typeof webkitAudioContext !== 'undefined') { - ctx = new webkitAudioContext(); - } else if (typeof Audio !== 'undefined') { - usingWebAudio = false; - try { - new Audio(); - } catch(e) { - noAudio = true; - } - } else { - usingWebAudio = false; - noAudio = true; - } - - // create a master gain node - if (usingWebAudio) { - var masterGain = (typeof ctx.createGain === 'undefined') ? ctx.createGainNode() : ctx.createGain(); - masterGain.gain.value = 1; - masterGain.connect(ctx.destination); - } - - // create global controller - var HowlerGlobal = function() { - this._volume = 1; - this._muted = false; - this.usingWebAudio = usingWebAudio; - this._howls = []; - }; - HowlerGlobal.prototype = { - /** - * Get/set the global volume for all sounds. - * @param {Float} vol Volume from 0.0 to 1.0. - * @return {Howler/Float} Returns self or current volume. - */ - volume: function(vol) { - var self = this; - - // make sure volume is a number - vol = parseFloat(vol); - - if (vol && vol >= 0 && vol <= 1) { - self._volume = vol; - - if (usingWebAudio) { - masterGain.gain.value = vol; - } - - // loop through cache and change volume of all nodes that are using HTML5 Audio - for (var key in self._howls) { - if (self._howls.hasOwnProperty(key) && self._howls[key]._webAudio === false) { - // loop through the audio nodes - for (var i=0; i= 2) ? ext[1] : self._urls[i].toLowerCase().match(/data\:audio\/([^?]+);/)[1]; - } - - if (canPlay[ext]) { - url = self._urls[i]; - break; - } - } - - if (!url) { - self.on('loaderror'); - return; - } - - self._src = url; - - if (self._webAudio) { - loadBuffer(self, url); - } else { - var newNode = new Audio(); - self._audioNode.push(newNode); - - // setup the new audio node - newNode.src = url; - newNode._pos = 0; - newNode.preload = 'auto'; - newNode.volume = (Howler._muted) ? 0 : self._volume * Howler.volume(); - - // add this sound to the cache - cache[url] = self; - - // setup the event listener to start playing the sound - // as soon as it has buffered enough - var listener = function() { - self._duration = newNode.duration; - - // setup a sprite if none is defined - if (Object.getOwnPropertyNames(self._sprite).length === 0) { - self._sprite = {_default: [0, self._duration * 1000]}; - } - - if (!self._loaded) { - self._loaded = true; - self.on('load'); - } - - if (self._autoplay) { - self.play(); - } - - // clear the event listener - newNode.removeEventListener('canplaythrough', listener, false); - }; - newNode.addEventListener('canplaythrough', listener, false); - newNode.load(); - } - - return self; - }, - - /** - * Get/set the URLs to be pulled from to play in this source. - * @param {Array} urls Arry of URLs to load from - * @return {Howl} Returns self or the current URLs - */ - urls: function(urls) { - var self = this; - - if (urls) { - self.stop(); - self._urls = (typeof urls === 'string') ? [urls] : urls; - self._loaded = false; - self.load(); - - return self; - } else { - return self._urls; - } - }, - - /** - * Play a sound from the current time (0 by default). - * @param {String} sprite (optional) Plays from the specified position in the sound sprite definition. - * @param {Function} callback (optional) Returns the unique playback id for this sound instance. - * @return {Howl} - */ - play: function(sprite, callback) { - var self = this; - - // if no sprite was passed but a callback was, update the variables - if (typeof sprite === 'function') { - callback = sprite; - } - - // use the default sprite if none is passed - if (!sprite || typeof sprite === 'function') { - sprite = '_default'; - } - - // if the sound hasn't been loaded, add it to the event queue - if (!self._loaded) { - self.on('load', function() { - self.play(sprite, callback); - }); - - return self; - } - - // if the sprite doesn't exist, play nothing - if (!self._sprite[sprite]) { - if (typeof callback === 'function') callback(); - return self; - } - - // get the node to playback - self._inactiveNode(function(node) { - // persist the sprite being played - node._sprite = sprite; - - // determine where to start playing from - var pos = (node._pos > 0) ? node._pos : self._sprite[sprite][0] / 1000, - duration = self._sprite[sprite][1] / 1000 - node._pos; - - // determine if this sound should be looped - var loop = !!(self._loop || self._sprite[sprite][2]); - - // set timer to fire the 'onend' event - var soundId = (typeof callback === 'string') ? callback : Math.round(Date.now() * Math.random()) + '', - timerId; - (function() { - var data = { - id: soundId, - sprite: sprite, - loop: loop - }; - timerId = setTimeout(function() { - // if looping, restart the track - if (!self._webAudio && loop) { - self.stop(data.id, data.timer).play(sprite, data.id); - } - - // set web audio node to paused at end - if (self._webAudio && !loop) { - self._nodeById(data.id).paused = true; - } - - // end the track if it is HTML audio and a sprite - if (!self._webAudio && !loop) { - self.stop(data.id, data.timer); - } - - // fire ended event - self.on('end', soundId); - }, duration * 1000); - - // store the reference to the timer - self._onendTimer.push(timerId); - - // remember which timer to cancel - data.timer = self._onendTimer[self._onendTimer.length - 1]; - })(); - - if (self._webAudio) { - var loopStart = self._sprite[sprite][0] / 1000, - loopEnd = self._sprite[sprite][1] / 1000; - - // set the play id to this node and load into context - node.id = soundId; - node.paused = false; - refreshBuffer(self, [loop, loopStart, loopEnd], soundId); - self._playStart = ctx.currentTime; - node.gain.value = self._volume; - - if (typeof node.bufferSource.start === 'undefined') { - node.bufferSource.noteGrainOn(0, pos, duration); - } else { - node.bufferSource.start(0, pos, duration); - } - } else { - if (node.readyState === 4) { - node.id = soundId; - node.currentTime = pos; - node.muted = Howler._muted; - node.volume = self._volume * Howler.volume(); - setTimeout(function() { node.play(); }, 0); - } else { - self._clearEndTimer(timerId); - - (function(){ - var sound = self, - playSprite = sprite, - fn = callback, - newNode = node; - var listener = function() { - sound.play(playSprite, fn); - - // clear the event listener - newNode.removeEventListener('canplaythrough', listener, false); - }; - newNode.addEventListener('canplaythrough', listener, false); - })(); - - return self; - } - } - - // fire the play event and send the soundId back in the callback - self.on('play'); - if (typeof callback === 'function') callback(soundId); - - return self; - }); - - return self; - }, - - /** - * Pause playback and save the current position. - * @param {String} id (optional) The play instance ID. - * @param {String} timerId (optional) Clear the correct timeout ID. - * @return {Howl} - */ - pause: function(id, timerId) { - var self = this; - - // if the sound hasn't been loaded, add it to the event queue - if (!self._loaded) { - self.on('play', function() { - self.pause(id); - }); - - return self; - } - - // clear 'onend' timer - self._clearEndTimer(timerId || 0); - - var activeNode = (id) ? self._nodeById(id) : self._activeNode(); - if (activeNode) { - activeNode._pos = self.pos(null, id); - - if (self._webAudio) { - // make sure the sound has been created - if (!activeNode.bufferSource) { - return self; - } - - activeNode.paused = true; - if (typeof activeNode.bufferSource.stop === 'undefined') { - activeNode.bufferSource.noteOff(0); - } else { - activeNode.bufferSource.stop(0); - } - } else { - activeNode.pause(); - } - } - - self.on('pause'); - - return self; - }, - - /** - * Stop playback and reset to start. - * @param {String} id (optional) The play instance ID. - * @param {String} timerId (optional) Clear the correct timeout ID. - * @return {Howl} - */ - stop: function(id, timerId) { - var self = this; - - // if the sound hasn't been loaded, add it to the event queue - if (!self._loaded) { - self.on('play', function() { - self.stop(id); - }); - - return self; - } - - // clear 'onend' timer - self._clearEndTimer(timerId || 0); - - var activeNode = (id) ? self._nodeById(id) : self._activeNode(); - if (activeNode) { - activeNode._pos = 0; - - if (self._webAudio) { - // make sure the sound has been created - if (!activeNode.bufferSource) { - return self; - } - - activeNode.paused = true; - - if (typeof activeNode.bufferSource.stop === 'undefined') { - activeNode.bufferSource.noteOff(0); - } else { - activeNode.bufferSource.stop(0); - } - } else { - activeNode.pause(); - activeNode.currentTime = 0; - } - } - - return self; - }, - - /** - * Mute this sound. - * @param {String} id (optional) The play instance ID. - * @return {Howl} - */ - mute: function(id) { - var self = this; - - // if the sound hasn't been loaded, add it to the event queue - if (!self._loaded) { - self.on('play', function() { - self.mute(id); - }); - - return self; - } - - var activeNode = (id) ? self._nodeById(id) : self._activeNode(); - if (activeNode) { - if (self._webAudio) { - activeNode.gain.value = 0; - } else { - activeNode.volume = 0; - } - } - - return self; - }, - - /** - * Unmute this sound. - * @param {String} id (optional) The play instance ID. - * @return {Howl} - */ - unmute: function(id) { - var self = this; - - // if the sound hasn't been loaded, add it to the event queue - if (!self._loaded) { - self.on('play', function() { - self.unmute(id); - }); - - return self; - } - - var activeNode = (id) ? self._nodeById(id) : self._activeNode(); - if (activeNode) { - if (self._webAudio) { - activeNode.gain.value = self._volume; - } else { - activeNode.volume = self._volume; - } - } - - return self; - }, - - /** - * Get/set volume of this sound. - * @param {Float} vol Volume from 0.0 to 1.0. - * @param {String} id (optional) The play instance ID. - * @return {Howl/Float} Returns self or current volume. - */ - volume: function(vol, id) { - var self = this; - - // make sure volume is a number - vol = parseFloat(vol); - - if (vol >= 0 && vol <= 1) { - self._volume = vol; - - // if the sound hasn't been loaded, add it to the event queue - if (!self._loaded) { - self.on('play', function() { - self.volume(vol, id); - }); - - return self; - } - - var activeNode = (id) ? self._nodeById(id) : self._activeNode(); - if (activeNode) { - if (self._webAudio) { - activeNode.gain.value = vol; - } else { - activeNode.volume = vol * Howler.volume(); - } - } - - return self; - } else { - return self._volume; - } - }, - - /** - * Get/set whether to loop the sound. - * @param {Boolean} loop To loop or not to loop, that is the question. - * @return {Howl/Boolean} Returns self or current looping value. - */ - loop: function(loop) { - var self = this; - - if (typeof loop === 'boolean') { - self._loop = loop; - - return self; - } else { - return self._loop; - } - }, - - /** - * Get/set sound sprite definition. - * @param {Object} sprite Example: {spriteName: [offset, duration, loop]} - * @param {Integer} offset Where to begin playback in milliseconds - * @param {Integer} duration How long to play in milliseconds - * @param {Boolean} loop (optional) Set true to loop this sprite - * @return {Howl} Returns current sprite sheet or self. - */ - sprite: function(sprite) { - var self = this; - - if (typeof sprite === 'object') { - self._sprite = sprite; - - return self; - } else { - return self._sprite; - } - }, - - /** - * Get/set the position of playback. - * @param {Float} pos The position to move current playback to. - * @param {String} id (optional) The play instance ID. - * @return {Howl/Float} Returns self or current playback position. - */ - pos: function(pos, id) { - var self = this; - - // if the sound hasn't been loaded, add it to the event queue - if (!self._loaded) { - self.on('load', function() { - self.pos(pos); - }); - - return typeof pos === 'number' ? self : self._pos || 0; - } - - // make sure we are dealing with a number for pos - pos = parseFloat(pos); - - var activeNode = (id) ? self._nodeById(id) : self._activeNode(); - if (activeNode) { - if (self._webAudio) { - if (pos >= 0) { - activeNode._pos = pos; - self.pause(id).play(activeNode._sprite, id); - - return self; - } else { - return activeNode._pos + (ctx.currentTime - self._playStart); - } - } else { - if (pos >= 0) { - activeNode.currentTime = pos; - - return self; - } else { - return activeNode.currentTime; - } - } - } else if (pos >= 0) { - return self; - } else { - // find the first inactive node to return the pos for - for (var i=0; i= 0 || x < 0) { - if (self._webAudio) { - var activeNode = (id) ? self._nodeById(id) : self._activeNode(); - if (activeNode) { - self._pos3d = [x, y, z]; - activeNode.panner.setPosition(x, y, z); - } - } - } else { - return self._pos3d; - } - - return self; - }, - - /** - * Fade a currently playing sound between two volumes. - * @param {Number} from The volume to fade from (0.0 to 1.0). - * @param {Number} to The volume to fade to (0.0 to 1.0). - * @param {Number} len Time in milliseconds to fade. - * @param {Function} callback (optional) Fired when the fade is complete. - * @param {String} id (optional) The play instance ID. - * @return {Howl} - */ - fade: function(from, to, len, callback, id) { - var self = this, - diff = Math.abs(from - to), - dir = from > to ? 'down' : 'up', - steps = diff / 0.01, - stepTime = len / steps; - - // if the sound hasn't been loaded, add it to the event queue - if (!self._loaded) { - self.on('load', function() { - self.fade(from, to, len, callback, id); - }); - - return self; - } - - // set the volume to the start position - self.volume(from, id); - - for (var i=1; i<=steps; i++) { - (function() { - var change = self._volume + (dir === 'up' ? 0.01 : -0.01) * i, - vol = Math.round(1000 * change) / 1000, - toVol = to; - - setTimeout(function() { - self.volume(vol, id); - - if (vol === toVol) { - if (callback) callback(); - } - }, stepTime * i); - })(); - } - }, - - /** - * [DEPRECATED] Fade in the current sound. - * @param {Float} to Volume to fade to (0.0 to 1.0). - * @param {Number} len Time in milliseconds to fade. - * @param {Function} callback - * @return {Howl} - */ - fadeIn: function(to, len, callback) { - return this.volume(0).play().fade(0, to, len, callback); - }, - - /** - * [DEPRECATED] Fade out the current sound and pause when finished. - * @param {Float} to Volume to fade to (0.0 to 1.0). - * @param {Number} len Time in milliseconds to fade. - * @param {Function} callback - * @param {String} id (optional) The play instance ID. - * @return {Howl} - */ - fadeOut: function(to, len, callback, id) { - var self = this; - - return self.fade(self._volume, to, len, function() { - if (callback) callback(); - self.pause(id); - - // fire ended event - self.on('end'); - }, id); - }, - - /** - * Get an audio node by ID. - * @return {Howl} Audio node. - */ - _nodeById: function(id) { - var self = this, - node = self._audioNode[0]; - - // find the node with this ID - for (var i=0; i=0; i--) { - if (inactive <= 5) { - break; - } - - if (self._audioNode[i].paused) { - // disconnect the audio source if using Web Audio - if (self._webAudio) { - self._audioNode[i].disconnect(0); - } - - inactive--; - self._audioNode.splice(i, 1); - } - } - }, - - /** - * Clear 'onend' timeout before it ends. - * @param {Number} timerId The ID of the sound to be cancelled. - */ - _clearEndTimer: function(timerId) { - var self = this, - timer = self._onendTimer.indexOf(timerId); - - // make sure the timer gets cleared - timer = timer >= 0 ? timer : 0; - - if (self._onendTimer[timer]) { - clearTimeout(self._onendTimer[timer]); - self._onendTimer.splice(timer, 1); - } - }, - - /** - * Setup the gain node and panner for a Web Audio instance. - * @return {Object} The new audio node. - */ - _setupAudioNode: function() { - var self = this, - node = self._audioNode, - index = self._audioNode.length; - - // create gain node - node[index] = (typeof ctx.createGain === 'undefined') ? ctx.createGainNode() : ctx.createGain(); - node[index].gain.value = self._volume; - node[index].paused = true; - node[index]._pos = 0; - node[index].readyState = 4; - node[index].connect(masterGain); - - // create the panner - node[index].panner = ctx.createPanner(); - node[index].panner.setPosition(self._pos3d[0], self._pos3d[1], self._pos3d[2]); - node[index].panner.connect(node[index]); - - return node[index]; - }, - - /** - * Call/set custom events. - * @param {String} event Event type. - * @param {Function} fn Function to call. - * @return {Howl} - */ - on: function(event, fn) { - var self = this, - events = self['_on' + event]; - - if (typeof fn === "function") { - events.push(fn); - } else { - for (var i=0; i - - Moai Player Embedded example - - - - - \ No newline at end of file diff --git a/host-templates/html/www/moai.html b/host-templates/html/www/moai.html deleted file mode 100644 index cebac9c91b..0000000000 --- a/host-templates/html/www/moai.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - MoaiJS - - - - - - - -
    -
    - -
    - - - - - - - - - - - - diff --git a/host-templates/html/www/moaihost.js b/host-templates/html/www/moaihost.js deleted file mode 100644 index 8fa3cc876b..0000000000 --- a/host-templates/html/www/moaihost.js +++ /dev/null @@ -1,938 +0,0 @@ -/* Promise lib (c) Jonathan Gotti - licence: https://github.com/malko/d.js/LICENCE.txt @version 0.6.0*/ -!function(a){"use strict";function b(a){j(function(){throw a})}function c(b){return this.then(b,a)}function d(b){return this.then(a,b)}function e(b,c){return this.then(function(a){return k(b)?b.apply(null,l(a)?a:[a]):t.onlyFuncs?a:b},c||a)}function f(a){function b(){a()}return this.then(b,b),this}function g(a){return this.then(function(b){return k(a)?a.apply(null,l(b)?b.splice(0,0,void 0)&&b:[void 0,b]):t.onlyFuncs?b:a},function(b){return a(b)})}function h(c){return this.then(a,c?function(a){throw c(a),a}:b)}function i(a,b){var c=o(a);if(1===c.length&&l(c[0])){if(!c[0].length)return t.fulfilled([]);c=c[0]}var d=[],e=t(),f=c.length;if(f)for(var g=(function(a){c[a]=t.promisify(c[a]),c[a].then(function(g){a in d||(d[a]=b?c[a]:g,--f||e.resolve(d))},function(g){a in d||(b?(d[a]=c[a],--f||e.resolve(d)):e.reject(g))})}),h=0,i=f;i>h;h++)g(h);else e.resolve(d);return e.promise}var j,k=function(a){return"function"==typeof a},l=function(a){return Array.isArray?Array.isArray(a):a instanceof Array},m=function(a){return!(!a||!(typeof a).match(/function|object/))},n=function(b){return b===!1||b===a||null===b},o=function(a,b){return[].slice.call(a,b)},p="undefined",q=typeof TypeError===p?Error:TypeError;if(typeof process!==p&&process.nextTick)j=process.nextTick;else if(typeof MessageChannel!==p){var r=new MessageChannel,s=[];r.port1.onmessage=function(){s.length&&s.shift()()},j=function(a){s.push(a),r.port2.postMessage(0)}}else j=function(a){setTimeout(a,0)};var t=function(b){function i(){if(0!==s){var a,b=u,c=0,d=b.length,e=~s?0:1;for(u=[];d>c;c++)(a=b[c][e])&&a(p)}}function l(a){function b(a){return function(b){return c?void 0:(c=!0,a(b))}}var c=!1;if(s)return this;try{var d=m(a)&&a.then;if(k(d)){if(a===v)throw new q("Promise can't resolve itself");return d.call(a,b(l),b(o)),this}}catch(e){return b(o)(e),this}return r(function(){p=a,s=1,i()}),this}function o(a){return s||r(function(){try{throw a}catch(b){p=b}s=-1,i()}),this}var p,r=(a!==b?b:t.alwaysAsync)?j:function(a){a()},s=0,u=[],v={then:function(a,b){var c=t();return u.push([function(b){try{n(a)?c.resolve(b):c.resolve(k(a)?a(b):t.onlyFuncs?b:a)}catch(d){c.reject(d)}},function(a){if((n(b)||!k(b)&&t.onlyFuncs)&&c.reject(a),b)try{c.resolve(k(b)?b(a):b)}catch(d){c.reject(d)}}]),0!==s&&r(i),c.promise},success:c,error:d,otherwise:d,apply:e,spread:e,ensure:f,nodify:g,rethrow:h,isPending:function(){return!(0!==s)},getStatus:function(){return s}};return v.toSource=v.toString=v.valueOf=function(){return p===a?this:p},{promise:v,resolve:l,fulfill:l,reject:o}};t.deferred=t.defer=t,t.nextTick=j,t.alwaysAsync=!0,t.onlyFuncs=!0,t.resolved=t.fulfilled=function(a){return t(!0).resolve(a).promise},t.rejected=function(a){return t(!0).reject(a).promise},t.wait=function(a){var b=t();return setTimeout(b.resolve,a||0),b.promise},t.delay=function(a,b){var c=t();return setTimeout(function(){try{c.resolve(a.apply(null))}catch(b){c.reject(b)}},b||0),c.promise},t.promisify=function(a){return a&&k(a.then)?a:t.resolved(a)},t.all=function(){return i(arguments,!1)},t.resolveAll=function(){return i(arguments,!0)},t.nodeCapsule=function(a,b){return b||(b=a,a=void 0),function(){var c=t(),d=o(arguments);d.push(function(a,b){a?c.reject(a):c.resolve(arguments.length>2?o(arguments,1):b)});try{b.apply(a,d)}catch(e){c.reject(e)}return c.promise}},typeof window!==p&&(window.D=t),typeof module!==p&&module.exports&&(module.exports=t)}(); - -var RomLoader = (function() { - -/* rom cache */ -function RomCache() { - this.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; - - this.IDB_RO = "readonly"; - this.IDB_RW = "readwrite"; - this.DB_NAME = 'EM_PRELOAD_CACHE'; - this.DB_VERSION = 1; - this.METADATA_STORE_NAME = 'METADATA'; - this.PACKAGE_STORE_NAME = 'PACKAGES'; -} - -RomCache.prototype.openDatabase = function() { - var that = this; - var d = D.defer(); - if (!this.indexedDB) { - return D.rejected("no Indexed DB") - } - - try { - var openRequest = this.indexedDB.open(this.DB_NAME, this.DB_VERSION); - } catch (e) { - return D.rejected(e); - } - openRequest.onupgradeneeded = function(event) { - var db = event.target.result; - - if(db.objectStoreNames.contains(that.PACKAGE_STORE_NAME)) { - db.deleteObjectStore(that.PACKAGE_STORE_NAME); - } - var packages = db.createObjectStore(that.PACKAGE_STORE_NAME); - - if(db.objectStoreNames.contains(that.METADATA_STORE_NAME)) { - db.deleteObjectStore(that.METADATA_STORE_NAME); - } - var metadata = db.createObjectStore(that.METADATA_STORE_NAME); - }; - openRequest.onsuccess = function(event) { - var db = event.target.result; - d.resolve(db); - }; - openRequest.onerror = function(error) { - d.reject(error); - }; - - return d.promise; -}; - -RomCache.prototype.getDb = function() { - if (!this.openedDatabase) { - this.openedDatabase = this.openDatabase(); - } - return this.openedDatabase; -} - -RomCache.prototype.checkCachedPackage = function( packageName, uuid) { - var that = this; - return this.getDb().then(function(db) { - return that.dbCheckCachedPackage(db, packageName, uuid) - }).otherwise(function(e) { - console.log("Can't check package cache :",e); - return false; - }); -} - - /* Check if there's a cached package, and if so whether it's the latest available */ -RomCache.prototype.dbCheckCachedPackage = function(db, packageName, uuid) { - var d = D.defer(); - var transaction = db.transaction([this.METADATA_STORE_NAME], this.IDB_RO); - var metadata = transaction.objectStore(this.METADATA_STORE_NAME); - - var getRequest = metadata.get(packageName); - getRequest.onsuccess = function(event) { - var result = event.target.result; - if (!result) { - return d.resolve(false); - } else { - return d.resolve(uuid=== result.uuid); - } - }; - getRequest.onerror = function(error) { - d.reject(error); - }; - return d.promise; -}; - -RomCache.prototype.fetchCachedPackage = function(packageName) { - var that = this; - return this.getDb().then(function(db) { - return that.dbFetchCachedPackage(db, packageName) - }); -}; - -RomCache.prototype.dbFetchCachedPackage = function(db, packageName) { - var d = D.defer(); - var transaction = db.transaction([this.PACKAGE_STORE_NAME], this.IDB_RO); - var packages = transaction.objectStore(this.PACKAGE_STORE_NAME); - - var getRequest = packages.get(packageName); - getRequest.onsuccess = function(event) { - var result = event.target.result; - d.resolve(result); - }; - getRequest.onerror = function(error) { - d.reject(error); - }; - return d.promise; -}; - -RomCache.prototype.cacheRemotePackage = function(packageName, packageData, packageMeta) { - var that = this; - return this.getDb().then(function(db) { - return that.dbCacheRemotePackage(db, packageName, packageData, packageMeta); - }).otherwise(function(e) { - console.log("Can't cache package:",e); - return false; - }); -}; - -RomCache.prototype.dbCacheRemotePackage = function(db, packageName, packageData, packageMeta) { - var d = D.defer(); - var transaction = db.transaction([this.PACKAGE_STORE_NAME, this.METADATA_STORE_NAME], this.IDB_RW); - var packages = transaction.objectStore(this.PACKAGE_STORE_NAME); - var metadata = transaction.objectStore(this.METADATA_STORE_NAME); - - var putPackageRequest = packages.put(packageData, packageName); - putPackageRequest.onsuccess = function(event) { - var putMetadataRequest = metadata.put(packageMeta, packageName); - putMetadataRequest.onsuccess = function(event) { - d.resolve(packageData); - }; - putMetadataRequest.onerror = function(error) { - d.reject(error); - }; - }; - putPackageRequest.onerror = function(error) { - d.reject(error); - }; - return d.promise; -}; - -/** - Load Json - then Read Rom - then wait for FS - then install Files - */ - -/** - Grabs filesystem metadata json from the given url -*/ -function LoadFileSystemJson(fsJsonUrl) { - var d = D.defer(); - var xhr = new XMLHttpRequest(); - xhr.open('GET', fsJsonUrl, true); - xhr.responseType = "json"; - xhr.onload = function(event) { - var packageInfo = xhr.response; - if (typeof packageInfo == "string") { - //safari and older browsers can't do responseType=json :( - packageInfo = JSON.parse(packageInfo); - } - d.resolve(packageInfo); - }; - xhr.onerror = function(event) { - d.reject("Failed to download "+fsJsonUrl+":"+xhr.statusText); - }; - xhr.send(null); - return d.promise; -} - -/** - Grabs the filesystem data blob from the given url -*/ -function LoadRemoteFileSystemData(romPackageUrl, progress) { - var d = D.defer(); - var xhr = new XMLHttpRequest(); - xhr.open('GET', romPackageUrl, true); - xhr.responseType = 'arraybuffer'; - xhr.onload = function(event) { - var packageData = xhr.response; - d.resolve(packageData); - }; - xhr.onprogress = function(event) { - progress(event.loaded, event.total); - } - xhr.onerror = function(event) { - d.reject("Failed to download FS data"+romPackageUrl+":"+xhr.statusText); - }; - xhr.send(null); - return d.promise; -} - -/** - Loads the filesystem data either via cache or via remoteUrl - also caches it if it wasn't previously cached -*/ -function LoadFileSystemData(packageName, uuid, romUrl, progress) { - var romCache = new RomCache(); - return romCache.checkCachedPackage(packageName, uuid) - .then(function(packageExists) { - if (packageExists) { - return romCache.fetchCachedPackage(packageName) - } else { - return LoadRemoteFileSystemData(romUrl, progress) - .then(function(packageRaw) { - //add it to the cache for next time - romCache.cacheRemotePackage(packageName, packageRaw, { uuid: uuid }); - return packageRaw; //just return it, who cares if cache fails. - }) - } - }); -} - - -function installFileSystemData(emscripten, romPackageRaw) { - var byteArray = new Uint8Array(romPackageRaw); - - // copy the entire loaded file into a spot in the heap. Files will refer to slices in that. They cannot be freed though. - var ptr = emscripten['_malloc'](byteArray.length); - emscripten['HEAPU8'].set(byteArray, ptr); - return emscripten['HEAPU8'].subarray(ptr, ptr+byteArray.length); -} - -function installFile(emscripten, romPackage, start, end, name) { - var byteArray = romPackage.subarray(start, end); - var d = D.defer() - emscripten['FS_createPreloadedFile'](name, null, byteArray, true, true, function() { - d.resolve(true) - }, function() { - d.reject( 'Preloading file ' + name + ' failed'); - }, false, true); - return d.promise; -} - -function installFiles(emscripten, romPackage, fsInfo, fileProgress) { - var fileLoads = []; - var fileCount = fsInfo.files.length; - var loaded = 0; - - //create directories - for (var i = 0; i < fsInfo.directories.length; i++) { - emscripten['FS_createPath']('/', fsInfo.directories[i], true, true); - } - - - - function fileComplete() { - loaded = loaded + 1; - fileProgress(loaded, fileCount); - return true; - } - for (var i = 0; i < fileCount; i++) { - var fileInfo = fsInfo.files[i]; - var filePromise = installFile(emscripten, romPackage, fileInfo.start, fileInfo.end, fileInfo.filename) - .then(fileComplete) - fileLoads.push(filePromise); - } - //this is a promise for ALL the files, dont resolve until they are all installed into the filesystem - return D.all(fileLoads); -} - -//takes an emscripten instance and rom url, and returns a promise for the rom installed in that emscriptens -//filesystem -function doLoadRom(emscripten, romUrl, romProgress, fileProgress ) { - var romJsonUrl = romUrl + ".json"; - - var fileSystemInfo; - var packageName = romUrl; - - var InstalledFileSystem = LoadFileSystemJson(romJsonUrl) //load json metadata - .then(function(fsInfo) { - //load the rom blob from cache or fetch - fileSystemInfo = fsInfo; - return LoadFileSystemData(packageName, fsInfo.package_uuid, romUrl, romProgress); - }) - .then(function(romPackageRaw) { - //install into emscripten heap - return installFileSystemData(emscripten, romPackageRaw); - }) - .then(function(installedRomPackage) { - //create filesystem entries pointing to blob segements - return installFiles(emscripten, installedRomPackage, fileSystemInfo, fileProgress); - }) - //return our promise for a fully created file system - return InstalledFileSystem; -} - - function doLoadRomRaw(emscripten, romPackageRaw, fileSystemInfo, fileProgress ) { - //return our promise for a fully created file system - var installedData = installFileSystemData(emscripten, romPackageRaw) - - //create filesystem entries pointing to blob segements - return installFiles(emscripten, installedData, fileSystemInfo, fileProgress); - } - - - return { - LoadRom: doLoadRom, - LoadRomRaw: doLoadRomRaw - }; //only expose this function -})(); - - - -var MoaiJS = (function() { - - -function MoaiJS(canvas, total_memory, onTitleChange, onStatusChange, onError, onPrint, onResolutionChange ) { - this.canvas = canvas; - this.onTitleChange = onTitleChange; - this.onStatusChange = onStatusChange; - this.onError = onError; - this.onPrint = onPrint; - this.onResolutionChange = onResolutionChange; - this.emscripten = null; - this.total_memory = total_memory; - this.loadedFileSystems = []; //array of filesystem urls to load - - console.log("MoaiJS Init"); -} - -MoaiJS.prototype.getEmscripten = function() { - if (this.emscripten) return this.emscripten; - var Opts = { //our required emscripten settings - canvas: this.canvas, - setStatus: this.onStatusChange, - print: this.onPrint, - printErr: this.onError, - noExitRuntime: true, - totalDependencies: 0, - TOTAL_MEMORY: this.total_memory - }; - console.log("MoaiJS Emscripten Init"); - this.emscripten = window.CreateMoaiRuntime(Opts); - - //bring our emscripten host functions into the normal javascript world - var Module = this.emscripten; - this.RefreshContext = Module.cwrap('RefreshContext','number',null); - this.AKURunString = function(str) { - Module.cwrap('AKULoadFuncFromString','number',['string'])(str); - Module.cwrap('AKUCallFunc','number',null)(); - } - this.AKURunScript = function(str) { - Module.cwrap('AKULoadFuncFromFile','number',['string'])(str); - Module.cwrap('AKUCallFunc','number',null)(); - } - - - this.AKUSetWorkingDirectory = Module.cwrap('AKUSetWorkingDirectory','number',['string']); - this.AKUGetSimStep = Module.cwrap('AKUGetSimStep','number',null); - this.onPaint = Module.cwrap('onPaint','number',null); - this.onReshape = Module.cwrap('onReshape','number',['number','number']); - this.onTimer = Module.cwrap('onTimer','number',null); - this.onMouseButton = Module.cwrap('onMouseButton', 'number',['number','number']); - this.onMouseMove = Module.cwrap('onMouseMove', 'number',['number','number']); - this.onKeyDown = Module.cwrap('onKeyDown', 'number',['number']); - this.onKeyUp = Module.cwrap('onKeyUp','number',['number']); - this.onChar = Module.cwrap('onChar','number',['number']); - - //callbacks - this.emscripten.SetOpenWindowFunc(this.OpenWindowFunc.bind(this)); - this.emscripten.SetSaveFunc(this.SaveFile.bind(this)); - return this.emscripten; -} - -MoaiJS.prototype.loadFileSystem = function(romUrl) { - var that = this; - function makeProgress(prefix) { - return function(done,total) { - that.onStatusChange(prefix+": "+done+"/"+total); - } - }; - console.log("MoaiJS Load Filesystem "+romUrl); - this.loadedFileSystems.push(RomLoader.LoadRom(this.getEmscripten(),romUrl, makeProgress('Loading Data'), makeProgress('Installing File'))); -} - - -MoaiJS.prototype.loadFileSystemRaw = function(romDataRaw, fileSystemInfo) { - var that = this; - function makeProgress(prefix) { - return function(done,total) { - that.onStatusChange(prefix+": "+done+"/"+total); - } - } - console.log("MoaiJS Installing Filesystem"); - this.loadedFileSystems.push(RomLoader.LoadRomRaw(this.getEmscripten(), romDataRaw, fileSystemInfo, makeProgress('Installing File'))); -} - -MoaiJS.prototype.runFunc = function(func) { - var that=this; - D.all(this.loadedFileSystems).then(function(){ - console.log("MoaiJS Filesystem Loaded"); - that.emscripten.run(); - that.hostinit(); - func(); - - }).rethrow(); -} - -MoaiJS.prototype.run = function(mainLua) { - var that = this; - this.runFunc(function() { - that.runhost(mainLua); - }); -} - -MoaiJS.prototype.runString = function(luaStr) { - var that = this; - this.runFunc(function() { - that.AKURunString(luaStr); - }); -} - - -MoaiJS.prototype.renderloop = function() { - this.onPaint(); - this.emscripten.requestAnimationFrame(this.renderloop.bind(this)); -} - -MoaiJS.prototype.updateloop = function() { - this.onTimer(); -} - -MoaiJS.prototype.mousedown = function(e) { - - var btn = e.button; - - if (btn != 2) { - this.onMouseButton(0, 0); //MOUSE_LEFT, MOUSE_DOWN - } else { - this.onMouseButton(2, 0); - } - -} - -MoaiJS.prototype.cancelMouseButtons = function() { - this.onMouseButton(0, 1); - this.onMouseButton(2, 1); -}; - -MoaiJS.prototype.mouseup = function(e) { - - var btn = e.button; - - if (btn != 2) { - this.onMouseButton(0, 1); //MOUSE_LEFT, MOUSE_Up - } else { - this.onMouseButton(2, 1); - } -} - -MoaiJS.prototype.mousemove = function(e) { - - var can = this.canvas; - var canX = e.offsetX || e.layerX; - var canY = e.offsetY || e.layerY; - this.onMouseMove(Math.floor(canX*this.canvasScale),Math.floor(canY*this.canvasScale)); -} - -var charLookup = { - 0x20:' ', - 0x30:'0', 0x31:'1', 0x32:'2', 0x33:'3', 0x34:'4', 0x35:'5', 0x36:'6', 0x37:'7', 0x38:'8', 0x39:'9', - 0x41:'a', 0x42:'b', 0x43:'c', 0x44:'d', 0x45:'e', 0x46:'f', 0x47:'g', 0x48:'h', 0x49:'i', 0x4A:'j', - 0x4B:'k', 0x4C:'l', 0x4D:'m', 0x4E:'n', 0x4F:'o', 0x50:'p', 0x51:'q', 0x52:'r', 0x53:'s', 0x54:'t', - 0x55:'u', 0x56:'v', 0x57:'w', 0x58:'x', 0x59:'y', 0x5A:'z', - 0xBA:';', 0xBB:'=', 0xBC:',', 0xBD:'-', 0xBE:'.', 0xBF:'/', 0xC0:'`', 0xDB:'[', 0xDC:'\\', 0xDD:']', 0xDE:"'" -} - -function getMoaiKeyCode(keyCode) { - // Browsers send virtual key codes, see http://msdn.microsoft.com/library/windows/desktop/dd375731. - // Moai's key codes are based on virtual key codes, with two modifications: - // - Keys that produce a character on a US keyboard use that character's ASCII code instead - // - To avoid clashes, all regular key codes are offset by 256. - if (keyCode == 0) return; - if (keyCode in charLookup) return charLookup[keyCode].charCodeAt(0); - return keyCode + 256; -}; - -function keyIsPrintable(keyCode) { - return keyCode in charLookup; -} - -MoaiJS.prototype.keydown = function(e) { - var moaiKeyCode = getMoaiKeyCode(e.keyCode); - if (moaiKeyCode) { - this.onKeyDown(moaiKeyCode); - } - - // If we prevent further event handling, keypress() will not be called either. - // So let's do that only for keys that don't represent a character. - // That's not perfect (Ctrl+D will still be handled by the brower), - // but it's the best I could come up with. - if (!keyIsPrintable(e.keyCode)) { - e.preventDefault(); - } - - if (e.keyCode == 8) { - return false; //eat backspace ! - } -} - -MoaiJS.prototype.keyup = function(e) { - var moaiKeyCode = getMoaiKeyCode(e.keyCode); - if (moaiKeyCode) { - this.onKeyUp(moaiKeyCode); - } - - e.preventDefault(); -} - -MoaiJS.prototype.keypress = function(e) { - if (e.which) { - this.onChar(e.which); - } - - e.preventDefault(); - if (e.keyCode == 8) { - return false; - } -} - -MoaiJS.prototype.OpenWindowFunc = function(title,width,height) { - var canvas = this.canvas; - if (this.onTitleChange) { - this.onTitleChange(title); - } - if (this.onResolutionChange) { - this.onResolutionChange(width,height) - } - this.canvas.style.display = "block"; - - canvas.width = width; - canvas.height = height; - this.canvasScale = canvas.width/$(canvas).width(); - - canvas.focus(); - - //hook mouse - canvas.addEventListener("mousedown",this.mousedown.bind(this),false); - canvas.addEventListener("mouseup",this.mouseup.bind(this),false); - canvas.addEventListener("mousemove",this.mousemove.bind(this),false); - - //grab focus on hover - canvas.addEventListener("mouseover",function() { canvas.focus(); },false); - canvas.addEventListener("mouseout",(function() { canvas.blur(); this.cancelMouseButtons(); }).bind(this),false); - - //grab keys - canvas.addEventListener("keydown", this.keydown.bind(this), false); - canvas.addEventListener("keyup", this.keyup.bind(this), false); - canvas.addEventListener("keypress", this.keypress.bind(this), false); - - canvas.addEventListener("contextmenu", function(e) { - e.preventDefault(); - return false; - }); - //now start rendering and updationg - this.startUpdates(); - this.emscripten.requestAnimationFrame(this.renderloop.bind(this)); - - window.addEventListener("resize", resizeThrottler, false); - - var resizeTimeout; - function resizeThrottler() { - // ignore resize events as long as an actualResizeHandler execution is in the queue - if ( !resizeTimeout ) { - resizeTimeout = setTimeout(function() { - resizeTimeout = null; - resizeHandler(); - - // The actualResizeHandler will execute at a rate of 15fps - }, 66); - } - } - var that = this; - function resizeHandler() { - that.recalibrateInput(); - } - - return canvas; -}; - -MoaiJS.prototype.recalibrateInput = function() { - this.canvasScale = this.canvas.width/$(this.canvas).width(); -} - -MoaiJS.prototype.startUpdates = function() { - var step = this.AKUGetSimStep() || ((1000/60)/1000) - if (this.moaiInterval) { - window.clearInterval(this.moaiInterval); - } - this.moaiInterval = window.setInterval( this.updateloop.bind(this), step*1000); -} - -MoaiJS.prototype.stopUpdates = function() { - if (this.moaiInterval) { - window.clearInterval(this.moaiInterval); - } - this.moaiInterval = null; -} - -MoaiJS.prototype.pause = function() { - this.stopUpdates(); -} - -MoaiJS.prototype.unpause = function() { - this.startUpdates(); -} - -MoaiJS.prototype.hostinit = function() { - console.log("refreshing context"); - this.RefreshContext(); - console.log("setting working directory"); - this.AKUSetWorkingDirectory('/'); - console.log("setting up canvas"); - this.AKURunString('MOAIEnvironment.horizontalResolution = '+$(this.canvas).parent().width()); - this.AKURunString('MOAIEnvironment.verticalResolution = '+$(this.canvas).parent().height()); -} - -MoaiJS.prototype.runhost = function(mainLua) { - console.log("runhost called"); - console.log("restoring save state"); - this.restoreDocumentDirectory(); - - this.hostinit(); - - var main = mainLua || 'main.lua' - console.log("launching "+main); - this.AKURunScript(main); -} - -//Courtesy of Mozilla -function b64ToUint6 (nChr) { - - return nChr > 64 && nChr < 91 ? - nChr - 65 - : nChr > 96 && nChr < 123 ? - nChr - 71 - : nChr > 47 && nChr < 58 ? - nChr + 4 - : nChr === 43 ? - 62 - : nChr === 47 ? - 63 - : - 0; - -} -//Courtesy of Mozilla -function base64DecToArr (sBase64) { - - var - sB64Enc = sBase64.replace(/[^A-Za-z0-9\+\/]/g, ""), nInLen = sB64Enc.length, - nOutLen = nInLen * 3 + 1 >> 2, aBytes = new Uint8Array(nOutLen); - - for (var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) { - nMod4 = nInIdx & 3; - nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4; - if (nMod4 === 3 || nInLen - nInIdx === 1) { - for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { - aBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255; - } - nUint24 = 0; - - } - } - - return aBytes; -} - -function dataUriToArr(sDataUri) { - return base64DecToArr(sDataUri.split(',')[1]); -} - - -MoaiJS.prototype.restoreDocumentDirectory = function() { - var docsjson = window.localStorage.getItem('moai-docs'); - if (!docsjson) return; - var docs = JSON.parse(docsjson); - for (var path in docs ) { - //restore each file - var data = dataUriToArr(docs[path]); - this.emscripten._RestoreFile(path,data); - } -} - -MoaiJS.prototype.saveToDocumentDirectory = function(path,filedata) { - var docsjson = localStorage.getItem('moai-docs'); - if (!docsjson) docsjson="{}"; - var docs = JSON.parse(docsjson); - docs[path] = filedata; - localStorage.setItem('moai-docs',JSON.stringify(docs)); -} - -MoaiJS.prototype.SaveFile = function(path,data) { - //get data as arraybuffer - var dataArray = (data.buffer)? data : new Uint8Array(data); - var dataBlob = new Blob([dataArray],{'type':'application/octet-stream'}); - var reader = new FileReader(); - var that = this; - reader.onload =function(event) { - that.saveToDocumentDirectory(path,event.target.result); - }; - reader.readAsDataURL(dataBlob); -}; - -return MoaiJS -})(); //end module - -//assume Jquery - -function MoaiPlayer(element, skipTemplate) { - var el = $(element) - var template = '
    \ -
    \ - MOAI \ -
    \ -
    \ -
    \ - \ - \ -
    '; - - //inject our original element contents into the fiddle-inf - - - var oldcontent = el.html(); - var infoEl; - if (!skipTemplate) { - el.html(template); - infoEl = el.find(".moai-info"); - infoEl.html(oldcontent); - } else { - infoEl = el.find(".moai-info"); - } - this.el = el; - var titleEl = el.find(".moai-title").first(); - var statusEl = el.find(".moai-status").first(); - var canvasEl = el.find(".moai-canvas").first(); - this.canvas = canvasEl[0]; - - var canvasWrapperEl = el.find(".moai-canvas-wrapper").first(); - this.canvasWrapper = canvasWrapperEl; - var pause = el.find("#moai-pause").first(); - //get settings - this.url = el.attr('data-url'); - this.script = el.attr('data-script') || 'main.lua'; - var ram = parseInt(el.attr('data-ram') || "48" ,10); - var title = el.attr('data-title') || 'Moai Player'; - - var paused= false; - - pause.on("click",function() { - paused= !paused; - if (paused) { - this.pause(); - pause.addClass("paused") - } else { - this.unpause(); - pause.removeClass("paused"); - } - }.bind(this)); - - function onTitleChange(title) { - titleEl.html(title); - } - - function onStatusChange(status) { - statusEl.html(status); - } - - - this.onResolutionChange = function(width, height) { - //resize canvas after moaijs has finished its stuff - window.setTimeout(function() { - this.resizeCanvas(); - }.bind(this),10); - } - - this.onError = function(err) { - console.log("ERROR: ",err); - }; - - this.onPrint = function(x) { - console.log(x); - }; - - function onPrint(x) { - this.onPrint(x); - } - - function onError(x) { - this.onError(x); - } - onTitleChange(title); - - this.hideInfo = function() { - infoEl[0].style.display = "none"; - canvasWrapperEl[0].style.display="table-row"; -} - - window.addEventListener("resize", resizeThrottler, false); - - var resizeTimeout; - function resizeThrottler() { - // ignore resize events as long as an actualResizeHandler execution is in the queue - if ( !resizeTimeout ) { - resizeTimeout = setTimeout(function() { - resizeTimeout = null; - resizeHandler(); - - // The actualResizeHandler will execute at a rate of 15fps - }, 66); - } - } - - var resizeHandler = function() { - this.resizeCanvas(); - }.bind(this); - - - - this.initMoai = function() { - this.moai = new MoaiJS(canvasEl[0], ram * 1024 * 1024, onTitleChange, onStatusChange, onError.bind(this), onPrint.bind(this), this.onResolutionChange.bind(this)); - } -} - - -MoaiPlayer.prototype.resizeCanvas = function() { - //we apply portrait class if the ratio of width to height is larger than our canvases - var wantedRatio = this.canvas.width / this.canvas.height; - var actualRatio = this.canvasWrapper.width() / this.canvasWrapper.height(); - this.el.find('.moai-canvas-wrapper').first().toggleClass("portrait", (actualRatio > wantedRatio)); -} - -MoaiPlayer.prototype.isSupported = function() { - var gl = false; - var testCanvas = document.createElement("canvas"); - try { gl = testCanvas.getContext("webgl"); } - catch (x) { gl = null; } - - if (gl === null) { - try { gl = canvas.getContext("experimental-webgl");} - catch (x) { gl = null; } - } - - if (!gl) { - console.log("GLERROR: No gl context"); - return false; - } - - - if ("function" !== typeof gl.getParameter && "object" !== typeof gl.getParameter) { - console.log("GLERROR: no getParameter function"); - return false; - } - - var version = gl.getParameter(gl["VERSION"]); - if (!version) { - console.log("GLERROR: could not determine webgl version"); - return false; - } - - var majorVerMatch = (version + "").match(/WebGL (\d*)\.\d*/); - if (majorVerMatch.length < 2) { - console.log("GLERROR: couldnt parse gl version: ",version); - return false; - } - var majorVer = majorVerMatch[1] << 0; - if (majorVer < 1) { - console.log("GLERROR: major version must be above 1 got :",majorVer,"from:",version); - return false; - } - - gl = null; - testCanvas = null; - //all good here - return true; -}; - - -MoaiPlayer.prototype.run = function() { - //init moai when they go to run to avoid chewing up ram on pages where the user isn't interested in playing our embedded game - this.hideInfo(); - if (!this.moai) { this.initMoai(); } - this.moai.loadFileSystem(this.url); - this.moai.run(this.script); -} - -MoaiPlayer.prototype.loadRom = function(rom) { - if (!this.moai) { this.initMoai(); } - this.moai.loadFileSystem(rom); -} - -MoaiPlayer.prototype.loadRomRaw = function(romRaw, fsInfo) { - if (!this.moai) { this.initMoai(); } - this.moai.loadFileSystemRaw(romRaw, fsInfo); -} - -MoaiPlayer.prototype.runString = function(str) { - this.hideInfo(); - if (!this.moai) { this.initMoai(); } - this.moai.runString(str); -} - -MoaiPlayer.prototype.stop = function() { - //TODO unhook events and free up moai host ram - this.moai.pause(); - this.moai = null; -} - -MoaiPlayer.prototype.pause = function() { - if (!this.moai) return; - this.moai.pause(); -} - -MoaiPlayer.prototype.unpause = function() { - if (!this.moai) return; - this.moai.unpause(); -} - - - - diff --git a/host-templates/html/www/moailogo-white.svg b/host-templates/html/www/moailogo-white.svg deleted file mode 100644 index 3ef8b1379d..0000000000 --- a/host-templates/html/www/moailogo-white.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/host-templates/html/www/vendor/font-awesome-4.0.3/css/font-awesome.css b/host-templates/html/www/vendor/font-awesome-4.0.3/css/font-awesome.css deleted file mode 100644 index 048cff9739..0000000000 --- a/host-templates/html/www/vendor/font-awesome-4.0.3/css/font-awesome.css +++ /dev/null @@ -1,1338 +0,0 @@ -/*! - * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */ -/* FONT PATH - * -------------------------- */ -@font-face { - font-family: 'FontAwesome'; - src: url('../fonts/fontawesome-webfont.eot?v=4.0.3'); - src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg'); - font-weight: normal; - font-style: normal; -} -.fa { - display: inline-block; - font-family: FontAwesome; - font-style: normal; - font-weight: normal; - line-height: 1; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -/* makes the font 33% larger relative to the icon container */ -.fa-lg { - font-size: 1.3333333333333333em; - line-height: 0.75em; - vertical-align: -15%; -} -.fa-2x { - font-size: 2em; -} -.fa-3x { - font-size: 3em; -} -.fa-4x { - font-size: 4em; -} -.fa-5x { - font-size: 5em; -} -.fa-fw { - width: 1.2857142857142858em; - text-align: center; -} -.fa-ul { - padding-left: 0; - margin-left: 2.142857142857143em; - list-style-type: none; -} -.fa-ul > li { - position: relative; -} -.fa-li { - position: absolute; - left: -2.142857142857143em; - width: 2.142857142857143em; - top: 0.14285714285714285em; - text-align: center; -} -.fa-li.fa-lg { - left: -1.8571428571428572em; -} -.fa-border { - padding: .2em .25em .15em; - border: solid 0.08em #eeeeee; - border-radius: .1em; -} -.pull-right { - float: right; -} -.pull-left { - float: left; -} -.fa.pull-left { - margin-right: .3em; -} -.fa.pull-right { - margin-left: .3em; -} -.fa-spin { - -webkit-animation: spin 2s infinite linear; - -moz-animation: spin 2s infinite linear; - -o-animation: spin 2s infinite linear; - animation: spin 2s infinite linear; -} -@-moz-keyframes spin { - 0% { - -moz-transform: rotate(0deg); - } - 100% { - -moz-transform: rotate(359deg); - } -} -@-webkit-keyframes spin { - 0% { - -webkit-transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(359deg); - } -} -@-o-keyframes spin { - 0% { - -o-transform: rotate(0deg); - } - 100% { - -o-transform: rotate(359deg); - } -} -@-ms-keyframes spin { - 0% { - -ms-transform: rotate(0deg); - } - 100% { - -ms-transform: rotate(359deg); - } -} -@keyframes spin { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(359deg); - } -} -.fa-rotate-90 { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); - -webkit-transform: rotate(90deg); - -moz-transform: rotate(90deg); - -ms-transform: rotate(90deg); - -o-transform: rotate(90deg); - transform: rotate(90deg); -} -.fa-rotate-180 { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); - -webkit-transform: rotate(180deg); - -moz-transform: rotate(180deg); - -ms-transform: rotate(180deg); - -o-transform: rotate(180deg); - transform: rotate(180deg); -} -.fa-rotate-270 { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); - -webkit-transform: rotate(270deg); - -moz-transform: rotate(270deg); - -ms-transform: rotate(270deg); - -o-transform: rotate(270deg); - transform: rotate(270deg); -} -.fa-flip-horizontal { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); - -webkit-transform: scale(-1, 1); - -moz-transform: scale(-1, 1); - -ms-transform: scale(-1, 1); - -o-transform: scale(-1, 1); - transform: scale(-1, 1); -} -.fa-flip-vertical { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); - -webkit-transform: scale(1, -1); - -moz-transform: scale(1, -1); - -ms-transform: scale(1, -1); - -o-transform: scale(1, -1); - transform: scale(1, -1); -} -.fa-stack { - position: relative; - display: inline-block; - width: 2em; - height: 2em; - line-height: 2em; - vertical-align: middle; -} -.fa-stack-1x, -.fa-stack-2x { - position: absolute; - left: 0; - width: 100%; - text-align: center; -} -.fa-stack-1x { - line-height: inherit; -} -.fa-stack-2x { - font-size: 2em; -} -.fa-inverse { - color: #ffffff; -} -/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen - readers do not read off random characters that represent icons */ -.fa-glass:before { - content: "\f000"; -} -.fa-music:before { - content: "\f001"; -} -.fa-search:before { - content: "\f002"; -} -.fa-envelope-o:before { - content: "\f003"; -} -.fa-heart:before { - content: "\f004"; -} -.fa-star:before { - content: "\f005"; -} -.fa-star-o:before { - content: "\f006"; -} -.fa-user:before { - content: "\f007"; -} -.fa-film:before { - content: "\f008"; -} -.fa-th-large:before { - content: "\f009"; -} -.fa-th:before { - content: "\f00a"; -} -.fa-th-list:before { - content: "\f00b"; -} -.fa-check:before { - content: "\f00c"; -} -.fa-times:before { - content: "\f00d"; -} -.fa-search-plus:before { - content: "\f00e"; -} -.fa-search-minus:before { - content: "\f010"; -} -.fa-power-off:before { - content: "\f011"; -} -.fa-signal:before { - content: "\f012"; -} -.fa-gear:before, -.fa-cog:before { - content: "\f013"; -} -.fa-trash-o:before { - content: "\f014"; -} -.fa-home:before { - content: "\f015"; -} -.fa-file-o:before { - content: "\f016"; -} -.fa-clock-o:before { - content: "\f017"; -} -.fa-road:before { - content: "\f018"; -} -.fa-download:before { - content: "\f019"; -} -.fa-arrow-circle-o-down:before { - content: "\f01a"; -} -.fa-arrow-circle-o-up:before { - content: "\f01b"; -} -.fa-inbox:before { - content: "\f01c"; -} -.fa-play-circle-o:before { - content: "\f01d"; -} -.fa-rotate-right:before, -.fa-repeat:before { - content: "\f01e"; -} -.fa-refresh:before { - content: "\f021"; -} -.fa-list-alt:before { - content: "\f022"; -} -.fa-lock:before { - content: "\f023"; -} -.fa-flag:before { - content: "\f024"; -} -.fa-headphones:before { - content: "\f025"; -} -.fa-volume-off:before { - content: "\f026"; -} -.fa-volume-down:before { - content: "\f027"; -} -.fa-volume-up:before { - content: "\f028"; -} -.fa-qrcode:before { - content: "\f029"; -} -.fa-barcode:before { - content: "\f02a"; -} -.fa-tag:before { - content: "\f02b"; -} -.fa-tags:before { - content: "\f02c"; -} -.fa-book:before { - content: "\f02d"; -} -.fa-bookmark:before { - content: "\f02e"; -} -.fa-print:before { - content: "\f02f"; -} -.fa-camera:before { - content: "\f030"; -} -.fa-font:before { - content: "\f031"; -} -.fa-bold:before { - content: "\f032"; -} -.fa-italic:before { - content: "\f033"; -} -.fa-text-height:before { - content: "\f034"; -} -.fa-text-width:before { - content: "\f035"; -} -.fa-align-left:before { - content: "\f036"; -} -.fa-align-center:before { - content: "\f037"; -} -.fa-align-right:before { - content: "\f038"; -} -.fa-align-justify:before { - content: "\f039"; -} -.fa-list:before { - content: "\f03a"; -} -.fa-dedent:before, -.fa-outdent:before { - content: "\f03b"; -} -.fa-indent:before { - content: "\f03c"; -} -.fa-video-camera:before { - content: "\f03d"; -} -.fa-picture-o:before { - content: "\f03e"; -} -.fa-pencil:before { - content: "\f040"; -} -.fa-map-marker:before { - content: "\f041"; -} -.fa-adjust:before { - content: "\f042"; -} -.fa-tint:before { - content: "\f043"; -} -.fa-edit:before, -.fa-pencil-square-o:before { - content: "\f044"; -} -.fa-share-square-o:before { - content: "\f045"; -} -.fa-check-square-o:before { - content: "\f046"; -} -.fa-arrows:before { - content: "\f047"; -} -.fa-step-backward:before { - content: "\f048"; -} -.fa-fast-backward:before { - content: "\f049"; -} -.fa-backward:before { - content: "\f04a"; -} -.fa-play:before { - content: "\f04b"; -} -.fa-pause:before { - content: "\f04c"; -} -.fa-stop:before { - content: "\f04d"; -} -.fa-forward:before { - content: "\f04e"; -} -.fa-fast-forward:before { - content: "\f050"; -} -.fa-step-forward:before { - content: "\f051"; -} -.fa-eject:before { - content: "\f052"; -} -.fa-chevron-left:before { - content: "\f053"; -} -.fa-chevron-right:before { - content: "\f054"; -} -.fa-plus-circle:before { - content: "\f055"; -} -.fa-minus-circle:before { - content: "\f056"; -} -.fa-times-circle:before { - content: "\f057"; -} -.fa-check-circle:before { - content: "\f058"; -} -.fa-question-circle:before { - content: "\f059"; -} -.fa-info-circle:before { - content: "\f05a"; -} -.fa-crosshairs:before { - content: "\f05b"; -} -.fa-times-circle-o:before { - content: "\f05c"; -} -.fa-check-circle-o:before { - content: "\f05d"; -} -.fa-ban:before { - content: "\f05e"; -} -.fa-arrow-left:before { - content: "\f060"; -} -.fa-arrow-right:before { - content: "\f061"; -} -.fa-arrow-up:before { - content: "\f062"; -} -.fa-arrow-down:before { - content: "\f063"; -} -.fa-mail-forward:before, -.fa-share:before { - content: "\f064"; -} -.fa-expand:before { - content: "\f065"; -} -.fa-compress:before { - content: "\f066"; -} -.fa-plus:before { - content: "\f067"; -} -.fa-minus:before { - content: "\f068"; -} -.fa-asterisk:before { - content: "\f069"; -} -.fa-exclamation-circle:before { - content: "\f06a"; -} -.fa-gift:before { - content: "\f06b"; -} -.fa-leaf:before { - content: "\f06c"; -} -.fa-fire:before { - content: "\f06d"; -} -.fa-eye:before { - content: "\f06e"; -} -.fa-eye-slash:before { - content: "\f070"; -} -.fa-warning:before, -.fa-exclamation-triangle:before { - content: "\f071"; -} -.fa-plane:before { - content: "\f072"; -} -.fa-calendar:before { - content: "\f073"; -} -.fa-random:before { - content: "\f074"; -} -.fa-comment:before { - content: "\f075"; -} -.fa-magnet:before { - content: "\f076"; -} -.fa-chevron-up:before { - content: "\f077"; -} -.fa-chevron-down:before { - content: "\f078"; -} -.fa-retweet:before { - content: "\f079"; -} -.fa-shopping-cart:before { - content: "\f07a"; -} -.fa-folder:before { - content: "\f07b"; -} -.fa-folder-open:before { - content: "\f07c"; -} -.fa-arrows-v:before { - content: "\f07d"; -} -.fa-arrows-h:before { - content: "\f07e"; -} -.fa-bar-chart-o:before { - content: "\f080"; -} -.fa-twitter-square:before { - content: "\f081"; -} -.fa-facebook-square:before { - content: "\f082"; -} -.fa-camera-retro:before { - content: "\f083"; -} -.fa-key:before { - content: "\f084"; -} -.fa-gears:before, -.fa-cogs:before { - content: "\f085"; -} -.fa-comments:before { - content: "\f086"; -} -.fa-thumbs-o-up:before { - content: "\f087"; -} -.fa-thumbs-o-down:before { - content: "\f088"; -} -.fa-star-half:before { - content: "\f089"; -} -.fa-heart-o:before { - content: "\f08a"; -} -.fa-sign-out:before { - content: "\f08b"; -} -.fa-linkedin-square:before { - content: "\f08c"; -} -.fa-thumb-tack:before { - content: "\f08d"; -} -.fa-external-link:before { - content: "\f08e"; -} -.fa-sign-in:before { - content: "\f090"; -} -.fa-trophy:before { - content: "\f091"; -} -.fa-github-square:before { - content: "\f092"; -} -.fa-upload:before { - content: "\f093"; -} -.fa-lemon-o:before { - content: "\f094"; -} -.fa-phone:before { - content: "\f095"; -} -.fa-square-o:before { - content: "\f096"; -} -.fa-bookmark-o:before { - content: "\f097"; -} -.fa-phone-square:before { - content: "\f098"; -} -.fa-twitter:before { - content: "\f099"; -} -.fa-facebook:before { - content: "\f09a"; -} -.fa-github:before { - content: "\f09b"; -} -.fa-unlock:before { - content: "\f09c"; -} -.fa-credit-card:before { - content: "\f09d"; -} -.fa-rss:before { - content: "\f09e"; -} -.fa-hdd-o:before { - content: "\f0a0"; -} -.fa-bullhorn:before { - content: "\f0a1"; -} -.fa-bell:before { - content: "\f0f3"; -} -.fa-certificate:before { - content: "\f0a3"; -} -.fa-hand-o-right:before { - content: "\f0a4"; -} -.fa-hand-o-left:before { - content: "\f0a5"; -} -.fa-hand-o-up:before { - content: "\f0a6"; -} -.fa-hand-o-down:before { - content: "\f0a7"; -} -.fa-arrow-circle-left:before { - content: "\f0a8"; -} -.fa-arrow-circle-right:before { - content: "\f0a9"; -} -.fa-arrow-circle-up:before { - content: "\f0aa"; -} -.fa-arrow-circle-down:before { - content: "\f0ab"; -} -.fa-globe:before { - content: "\f0ac"; -} -.fa-wrench:before { - content: "\f0ad"; -} -.fa-tasks:before { - content: "\f0ae"; -} -.fa-filter:before { - content: "\f0b0"; -} -.fa-briefcase:before { - content: "\f0b1"; -} -.fa-arrows-alt:before { - content: "\f0b2"; -} -.fa-group:before, -.fa-users:before { - content: "\f0c0"; -} -.fa-chain:before, -.fa-link:before { - content: "\f0c1"; -} -.fa-cloud:before { - content: "\f0c2"; -} -.fa-flask:before { - content: "\f0c3"; -} -.fa-cut:before, -.fa-scissors:before { - content: "\f0c4"; -} -.fa-copy:before, -.fa-files-o:before { - content: "\f0c5"; -} -.fa-paperclip:before { - content: "\f0c6"; -} -.fa-save:before, -.fa-floppy-o:before { - content: "\f0c7"; -} -.fa-square:before { - content: "\f0c8"; -} -.fa-bars:before { - content: "\f0c9"; -} -.fa-list-ul:before { - content: "\f0ca"; -} -.fa-list-ol:before { - content: "\f0cb"; -} -.fa-strikethrough:before { - content: "\f0cc"; -} -.fa-underline:before { - content: "\f0cd"; -} -.fa-table:before { - content: "\f0ce"; -} -.fa-magic:before { - content: "\f0d0"; -} -.fa-truck:before { - content: "\f0d1"; -} -.fa-pinterest:before { - content: "\f0d2"; -} -.fa-pinterest-square:before { - content: "\f0d3"; -} -.fa-google-plus-square:before { - content: "\f0d4"; -} -.fa-google-plus:before { - content: "\f0d5"; -} -.fa-money:before { - content: "\f0d6"; -} -.fa-caret-down:before { - content: "\f0d7"; -} -.fa-caret-up:before { - content: "\f0d8"; -} -.fa-caret-left:before { - content: "\f0d9"; -} -.fa-caret-right:before { - content: "\f0da"; -} -.fa-columns:before { - content: "\f0db"; -} -.fa-unsorted:before, -.fa-sort:before { - content: "\f0dc"; -} -.fa-sort-down:before, -.fa-sort-asc:before { - content: "\f0dd"; -} -.fa-sort-up:before, -.fa-sort-desc:before { - content: "\f0de"; -} -.fa-envelope:before { - content: "\f0e0"; -} -.fa-linkedin:before { - content: "\f0e1"; -} -.fa-rotate-left:before, -.fa-undo:before { - content: "\f0e2"; -} -.fa-legal:before, -.fa-gavel:before { - content: "\f0e3"; -} -.fa-dashboard:before, -.fa-tachometer:before { - content: "\f0e4"; -} -.fa-comment-o:before { - content: "\f0e5"; -} -.fa-comments-o:before { - content: "\f0e6"; -} -.fa-flash:before, -.fa-bolt:before { - content: "\f0e7"; -} -.fa-sitemap:before { - content: "\f0e8"; -} -.fa-umbrella:before { - content: "\f0e9"; -} -.fa-paste:before, -.fa-clipboard:before { - content: "\f0ea"; -} -.fa-lightbulb-o:before { - content: "\f0eb"; -} -.fa-exchange:before { - content: "\f0ec"; -} -.fa-cloud-download:before { - content: "\f0ed"; -} -.fa-cloud-upload:before { - content: "\f0ee"; -} -.fa-user-md:before { - content: "\f0f0"; -} -.fa-stethoscope:before { - content: "\f0f1"; -} -.fa-suitcase:before { - content: "\f0f2"; -} -.fa-bell-o:before { - content: "\f0a2"; -} -.fa-coffee:before { - content: "\f0f4"; -} -.fa-cutlery:before { - content: "\f0f5"; -} -.fa-file-text-o:before { - content: "\f0f6"; -} -.fa-building-o:before { - content: "\f0f7"; -} -.fa-hospital-o:before { - content: "\f0f8"; -} -.fa-ambulance:before { - content: "\f0f9"; -} -.fa-medkit:before { - content: "\f0fa"; -} -.fa-fighter-jet:before { - content: "\f0fb"; -} -.fa-beer:before { - content: "\f0fc"; -} -.fa-h-square:before { - content: "\f0fd"; -} -.fa-plus-square:before { - content: "\f0fe"; -} -.fa-angle-double-left:before { - content: "\f100"; -} -.fa-angle-double-right:before { - content: "\f101"; -} -.fa-angle-double-up:before { - content: "\f102"; -} -.fa-angle-double-down:before { - content: "\f103"; -} -.fa-angle-left:before { - content: "\f104"; -} -.fa-angle-right:before { - content: "\f105"; -} -.fa-angle-up:before { - content: "\f106"; -} -.fa-angle-down:before { - content: "\f107"; -} -.fa-desktop:before { - content: "\f108"; -} -.fa-laptop:before { - content: "\f109"; -} -.fa-tablet:before { - content: "\f10a"; -} -.fa-mobile-phone:before, -.fa-mobile:before { - content: "\f10b"; -} -.fa-circle-o:before { - content: "\f10c"; -} -.fa-quote-left:before { - content: "\f10d"; -} -.fa-quote-right:before { - content: "\f10e"; -} -.fa-spinner:before { - content: "\f110"; -} -.fa-circle:before { - content: "\f111"; -} -.fa-mail-reply:before, -.fa-reply:before { - content: "\f112"; -} -.fa-github-alt:before { - content: "\f113"; -} -.fa-folder-o:before { - content: "\f114"; -} -.fa-folder-open-o:before { - content: "\f115"; -} -.fa-smile-o:before { - content: "\f118"; -} -.fa-frown-o:before { - content: "\f119"; -} -.fa-meh-o:before { - content: "\f11a"; -} -.fa-gamepad:before { - content: "\f11b"; -} -.fa-keyboard-o:before { - content: "\f11c"; -} -.fa-flag-o:before { - content: "\f11d"; -} -.fa-flag-checkered:before { - content: "\f11e"; -} -.fa-terminal:before { - content: "\f120"; -} -.fa-code:before { - content: "\f121"; -} -.fa-reply-all:before { - content: "\f122"; -} -.fa-mail-reply-all:before { - content: "\f122"; -} -.fa-star-half-empty:before, -.fa-star-half-full:before, -.fa-star-half-o:before { - content: "\f123"; -} -.fa-location-arrow:before { - content: "\f124"; -} -.fa-crop:before { - content: "\f125"; -} -.fa-code-fork:before { - content: "\f126"; -} -.fa-unlink:before, -.fa-chain-broken:before { - content: "\f127"; -} -.fa-question:before { - content: "\f128"; -} -.fa-info:before { - content: "\f129"; -} -.fa-exclamation:before { - content: "\f12a"; -} -.fa-superscript:before { - content: "\f12b"; -} -.fa-subscript:before { - content: "\f12c"; -} -.fa-eraser:before { - content: "\f12d"; -} -.fa-puzzle-piece:before { - content: "\f12e"; -} -.fa-microphone:before { - content: "\f130"; -} -.fa-microphone-slash:before { - content: "\f131"; -} -.fa-shield:before { - content: "\f132"; -} -.fa-calendar-o:before { - content: "\f133"; -} -.fa-fire-extinguisher:before { - content: "\f134"; -} -.fa-rocket:before { - content: "\f135"; -} -.fa-maxcdn:before { - content: "\f136"; -} -.fa-chevron-circle-left:before { - content: "\f137"; -} -.fa-chevron-circle-right:before { - content: "\f138"; -} -.fa-chevron-circle-up:before { - content: "\f139"; -} -.fa-chevron-circle-down:before { - content: "\f13a"; -} -.fa-html5:before { - content: "\f13b"; -} -.fa-css3:before { - content: "\f13c"; -} -.fa-anchor:before { - content: "\f13d"; -} -.fa-unlock-alt:before { - content: "\f13e"; -} -.fa-bullseye:before { - content: "\f140"; -} -.fa-ellipsis-h:before { - content: "\f141"; -} -.fa-ellipsis-v:before { - content: "\f142"; -} -.fa-rss-square:before { - content: "\f143"; -} -.fa-play-circle:before { - content: "\f144"; -} -.fa-ticket:before { - content: "\f145"; -} -.fa-minus-square:before { - content: "\f146"; -} -.fa-minus-square-o:before { - content: "\f147"; -} -.fa-level-up:before { - content: "\f148"; -} -.fa-level-down:before { - content: "\f149"; -} -.fa-check-square:before { - content: "\f14a"; -} -.fa-pencil-square:before { - content: "\f14b"; -} -.fa-external-link-square:before { - content: "\f14c"; -} -.fa-share-square:before { - content: "\f14d"; -} -.fa-compass:before { - content: "\f14e"; -} -.fa-toggle-down:before, -.fa-caret-square-o-down:before { - content: "\f150"; -} -.fa-toggle-up:before, -.fa-caret-square-o-up:before { - content: "\f151"; -} -.fa-toggle-right:before, -.fa-caret-square-o-right:before { - content: "\f152"; -} -.fa-euro:before, -.fa-eur:before { - content: "\f153"; -} -.fa-gbp:before { - content: "\f154"; -} -.fa-dollar:before, -.fa-usd:before { - content: "\f155"; -} -.fa-rupee:before, -.fa-inr:before { - content: "\f156"; -} -.fa-cny:before, -.fa-rmb:before, -.fa-yen:before, -.fa-jpy:before { - content: "\f157"; -} -.fa-ruble:before, -.fa-rouble:before, -.fa-rub:before { - content: "\f158"; -} -.fa-won:before, -.fa-krw:before { - content: "\f159"; -} -.fa-bitcoin:before, -.fa-btc:before { - content: "\f15a"; -} -.fa-file:before { - content: "\f15b"; -} -.fa-file-text:before { - content: "\f15c"; -} -.fa-sort-alpha-asc:before { - content: "\f15d"; -} -.fa-sort-alpha-desc:before { - content: "\f15e"; -} -.fa-sort-amount-asc:before { - content: "\f160"; -} -.fa-sort-amount-desc:before { - content: "\f161"; -} -.fa-sort-numeric-asc:before { - content: "\f162"; -} -.fa-sort-numeric-desc:before { - content: "\f163"; -} -.fa-thumbs-up:before { - content: "\f164"; -} -.fa-thumbs-down:before { - content: "\f165"; -} -.fa-youtube-square:before { - content: "\f166"; -} -.fa-youtube:before { - content: "\f167"; -} -.fa-xing:before { - content: "\f168"; -} -.fa-xing-square:before { - content: "\f169"; -} -.fa-youtube-play:before { - content: "\f16a"; -} -.fa-dropbox:before { - content: "\f16b"; -} -.fa-stack-overflow:before { - content: "\f16c"; -} -.fa-instagram:before { - content: "\f16d"; -} -.fa-flickr:before { - content: "\f16e"; -} -.fa-adn:before { - content: "\f170"; -} -.fa-bitbucket:before { - content: "\f171"; -} -.fa-bitbucket-square:before { - content: "\f172"; -} -.fa-tumblr:before { - content: "\f173"; -} -.fa-tumblr-square:before { - content: "\f174"; -} -.fa-long-arrow-down:before { - content: "\f175"; -} -.fa-long-arrow-up:before { - content: "\f176"; -} -.fa-long-arrow-left:before { - content: "\f177"; -} -.fa-long-arrow-right:before { - content: "\f178"; -} -.fa-apple:before { - content: "\f179"; -} -.fa-windows:before { - content: "\f17a"; -} -.fa-android:before { - content: "\f17b"; -} -.fa-linux:before { - content: "\f17c"; -} -.fa-dribbble:before { - content: "\f17d"; -} -.fa-skype:before { - content: "\f17e"; -} -.fa-foursquare:before { - content: "\f180"; -} -.fa-trello:before { - content: "\f181"; -} -.fa-female:before { - content: "\f182"; -} -.fa-male:before { - content: "\f183"; -} -.fa-gittip:before { - content: "\f184"; -} -.fa-sun-o:before { - content: "\f185"; -} -.fa-moon-o:before { - content: "\f186"; -} -.fa-archive:before { - content: "\f187"; -} -.fa-bug:before { - content: "\f188"; -} -.fa-vk:before { - content: "\f189"; -} -.fa-weibo:before { - content: "\f18a"; -} -.fa-renren:before { - content: "\f18b"; -} -.fa-pagelines:before { - content: "\f18c"; -} -.fa-stack-exchange:before { - content: "\f18d"; -} -.fa-arrow-circle-o-right:before { - content: "\f18e"; -} -.fa-arrow-circle-o-left:before { - content: "\f190"; -} -.fa-toggle-left:before, -.fa-caret-square-o-left:before { - content: "\f191"; -} -.fa-dot-circle-o:before { - content: "\f192"; -} -.fa-wheelchair:before { - content: "\f193"; -} -.fa-vimeo-square:before { - content: "\f194"; -} -.fa-turkish-lira:before, -.fa-try:before { - content: "\f195"; -} -.fa-plus-square-o:before { - content: "\f196"; -} diff --git a/host-templates/html/www/vendor/font-awesome-4.0.3/css/font-awesome.min.css b/host-templates/html/www/vendor/font-awesome-4.0.3/css/font-awesome.min.css deleted file mode 100644 index 449d6ac551..0000000000 --- a/host-templates/html/www/vendor/font-awesome-4.0.3/css/font-awesome.min.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! - * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.0.3');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857142858em;text-align:center}.fa-ul{padding-left:0;margin-left:2.142857142857143em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;top:.14285714285714285em;text-align:center}.fa-li.fa-lg{left:-1.8571428571428572em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0,mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2,mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-asc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-desc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-reply-all:before{content:"\f122"}.fa-mail-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"} \ No newline at end of file diff --git a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/FontAwesome.otf b/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/FontAwesome.otf deleted file mode 100644 index 8b0f54e47e..0000000000 Binary files a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/FontAwesome.otf and /dev/null differ diff --git a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.eot b/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.eot deleted file mode 100644 index 7c79c6a6bc..0000000000 Binary files a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.svg b/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.svg deleted file mode 100644 index 45fdf33830..0000000000 --- a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,414 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.ttf b/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.ttf deleted file mode 100644 index e89738de5e..0000000000 Binary files a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.woff b/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.woff deleted file mode 100644 index 8c1748aab7..0000000000 Binary files a/host-templates/html/www/vendor/font-awesome-4.0.3/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/host-templates/html/www/vendor/jquery-1.10.2.js b/host-templates/html/www/vendor/jquery-1.10.2.js deleted file mode 100644 index c5c648255c..0000000000 --- a/host-templates/html/www/vendor/jquery-1.10.2.js +++ /dev/null @@ -1,9789 +0,0 @@ -/*! - * jQuery JavaScript Library v1.10.2 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2013-07-03T13:48Z - */ -(function( window, undefined ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -//"use strict"; -var - // The deferred used on DOM ready - readyList, - - // A central reference to the root jQuery(document) - rootjQuery, - - // Support: IE<10 - // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` - core_strundefined = typeof undefined, - - // Use the correct document accordingly with window argument (sandbox) - location = window.location, - document = window.document, - docElem = document.documentElement, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // [[Class]] -> type pairs - class2type = {}, - - // List of deleted data cache ids, so we can reuse them - core_deletedIds = [], - - core_version = "1.10.2", - - // Save a reference to some core methods - core_concat = core_deletedIds.concat, - core_push = core_deletedIds.push, - core_slice = core_deletedIds.slice, - core_indexOf = core_deletedIds.indexOf, - core_toString = class2type.toString, - core_hasOwn = class2type.hasOwnProperty, - core_trim = core_version.trim, - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Used for matching numbers - core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, - - // Used for splitting on whitespace - core_rnotwhite = /\S+/g, - - // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, - rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }, - - // The ready event handler - completed = function( event ) { - - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } - }, - // Clean-up method for dom ready events - detach = function() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: core_version, - - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return core_slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; - }, - - slice: function() { - return this.pushStack( core_slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: core_push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), - - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger("ready").off("ready"); - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - if ( obj == null ) { - return String( obj ); - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ core_toString.call(obj) ] || "object" : - typeof obj; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !core_hasOwn.call(obj, "constructor") && - !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( jQuery.support.ownLast ) { - for ( key in obj ) { - return core_hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || core_hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - // data: string of html - // context (optional): If specified, the fragment will be created in this context, defaults to document - // keepScripts (optional): If true, will include scripts passed in the html string - parseHTML: function( data, context, keepScripts ) { - if ( !data || typeof data !== "string" ) { - return null; - } - if ( typeof context === "boolean" ) { - keepScripts = context; - context = false; - } - context = context || document; - - var parsed = rsingleTag.exec( data ), - scripts = !keepScripts && []; - - // Single tag - if ( parsed ) { - return [ context.createElement( parsed[1] ) ]; - } - - parsed = jQuery.buildFragment( [ data ], context, scripts ); - if ( scripts ) { - jQuery( scripts ).remove(); - } - return jQuery.merge( [], parsed.childNodes ); - }, - - parseJSON: function( data ) { - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - if ( data === null ) { - return data; - } - - if ( typeof data === "string" ) { - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - if ( data ) { - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - } - } - } - - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - if ( !data || typeof data !== "string" ) { - return null; - } - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Use native String.trim function wherever possible - trim: core_trim && !core_trim.call("\uFEFF\xA0") ? - function( text ) { - return text == null ? - "" : - core_trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - core_push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( core_indexOf ) { - return core_indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var l = second.length, - i = first.length, - j = 0; - - if ( typeof l === "number" ) { - for ( ; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var retVal, - ret = [], - i = 0, - length = elems.length; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return core_concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = core_slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - // Multifunctional method to get and set values of a collection - // The value/s can optionally be executed if it's a function - access: function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; - }, - - now: function() { - return ( new Date() ).getTime(); - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations. - // Note: this method belongs to the css module but it's needed here for the support module. - // If support gets modularized, this method should be moved back to the css module. - swap: function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; - } -}); - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || type !== "function" && - ( length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj ); -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); -/*! - * Sizzle CSS Selector Engine v1.10.2 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2013-07-03 - */ -(function( window, undefined ) { - -var i, - support, - cachedruns, - Expr, - getText, - isXML, - compile, - outermostContext, - sortInput, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - hasDuplicate = false, - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + - "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", - - // Prefer arguments quoted, - // then not containing pseudos/brackets, - // then attribute selectors/non-parenthetical expressions, - // then anything else - // These preferences are here to reduce the number of selectors - // needing tokenize in the PSEUDO preFilter - pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rsibling = new RegExp( whitespace + "*[+~]" ), - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - // BMP codepoint - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && context.parentNode || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key += " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Detect xml - * @param {Element|Object} elem An element or a document - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent.attachEvent && parent !== parent.top ) { - parent.attachEvent( "onbeforeunload", function() { - setDocument(); - }); - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = assert(function( div ) { - div.innerHTML = "
    "; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - - // Support: Opera 10-12/IE8 - // ^= $= *= and empty values - // Should not select anything - // Support: Windows 8 Native Apps - // The type attribute is restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "t", "" ); - - if ( div.querySelectorAll("[t^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = docElem.compareDocumentPosition ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); - - if ( compare ) { - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } - - // Not directly comparable, sort on existence of method - return a.compareDocumentPosition ? -1 : 1; - } : - function( a, b ) { - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Parentless nodes are either documents or disconnected - } else if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [elem] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val === undefined ? - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null : - val; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - for ( ; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (see #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[5] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] && match[4] !== undefined ) { - match[2] = match[4]; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), - // not comment, processing instructions, or others - // Thanks to Diego Perini for the nodeName shortcut - // Greater than "@" means alpha characters (specifically not starting with "#" or "?") - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -function tokenize( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( tokens = [] ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -} - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var data, cache, outerCache, - dirkey = dirruns + " " + doneName; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { - if ( (data = cache[1]) === true || data === cachedruns ) { - return data === true; - } - } else { - cache = outerCache[ dir ] = [ dirkey ]; - cache[1] = matcher( elem, context, xml ) || cachedruns; - if ( cache[1] === true ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - // A counter to specify which element is currently being matched - var matcherCachedRuns = 0, - bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, expandContext ) { - var elem, j, matcher, - setMatched = [], - matchedCount = 0, - i = "0", - unmatched = seed && [], - outermost = expandContext != null, - contextBackup = outermostContext, - // We must always have either seed elements or context - elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); - - if ( outermost ) { - outermostContext = context !== document && context; - cachedruns = matcherCachedRuns; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - for ( ; (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - cachedruns = ++matcherCachedRuns; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !group ) { - group = tokenize( selector ); - } - i = group.length; - while ( i-- ) { - cached = matcherFromTokens( group[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - } - return cached; -}; - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function select( selector, context, results, seed ) { - var i, tokens, token, type, find, - match = tokenize( selector ); - - if ( !seed ) { - // Try to minimize operations if there is only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - } - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && context.parentNode || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - } - - // Compile and execute a filtering function - // Provide `match` to avoid retokenization if we modified the selector above - compile( selector, match )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) - ); - return results; -} - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - elem[ name ] === true ? name.toLowerCase() : null; - } - }); -} - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})( window ); -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var action = tuple[ 0 ], - fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = core_slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; - if( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); -jQuery.support = (function( support ) { - - var all, a, input, select, fragment, opt, eventName, isSupported, i, - div = document.createElement("div"); - - // Setup - div.setAttribute( "className", "t" ); - div.innerHTML = "
    a"; - - // Finish early in limited (non-browser) environments - all = div.getElementsByTagName("*") || []; - a = div.getElementsByTagName("a")[ 0 ]; - if ( !a || !a.style || !all.length ) { - return support; - } - - // First batch of tests - select = document.createElement("select"); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName("input")[ 0 ]; - - a.style.cssText = "top:1px;float:left;opacity:.5"; - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - support.getSetAttribute = div.className !== "t"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName("tbody").length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName("link").length; - - // Get the style information from getAttribute - // (IE uses .cssText instead) - support.style = /top/.test( a.getAttribute("style") ); - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - support.hrefNormalized = a.getAttribute("href") === "/a"; - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - support.opacity = /^0.5/.test( a.style.opacity ); - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - support.cssFloat = !!a.style.cssFloat; - - // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) - support.checkOn = !!input.value; - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - support.optSelected = opt.selected; - - // Tests for enctype support on a form (#6743) - support.enctype = !!document.createElement("form").enctype; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>"; - - // Will be defined later - support.inlineBlockNeedsLayout = false; - support.shrinkWrapBlocks = false; - support.pixelPosition = false; - support.deleteExpando = true; - support.noCloneEvent = true; - support.reliableMarginRight = true; - support.boxSizingReliable = true; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Support: IE<9 - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - // Check if we can trust getAttribute("value") - input = document.createElement("input"); - input.setAttribute( "value", "" ); - support.input = input.getAttribute( "value" ) === ""; - - // Check if an input maintains its value after becoming a radio - input.value = "t"; - input.setAttribute( "type", "radio" ); - support.radioValue = input.value === "t"; - - // #11217 - WebKit loses check when the name is after the checked attribute - input.setAttribute( "checked", "t" ); - input.setAttribute( "name", "t" ); - - fragment = document.createDocumentFragment(); - fragment.appendChild( input ); - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - for ( i in { submit: true, change: true, focusin: true }) { - div.setAttribute( eventName = "on" + i, "t" ); - - support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; - } - - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - // Support: IE<9 - // Iteration over object's inherited properties before its own. - for ( i in jQuery( support ) ) { - break; - } - support.ownLast = i !== "0"; - - // Run tests that need a body at doc ready - jQuery(function() { - var container, marginDiv, tds, - divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - container = document.createElement("div"); - container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; - - body.appendChild( container ).appendChild( div ); - - // Support: IE8 - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - div.innerHTML = "
    t
    "; - tds = div.getElementsByTagName("td"); - tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Support: IE8 - // Check if empty table cells still have offsetWidth/Height - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Check box-sizing and margin behavior. - div.innerHTML = ""; - div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; - - // Workaround failing boxSizing test due to offsetWidth returning wrong value - // with some non-1 values of body zoom, ticket #13543 - jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { - support.boxSizing = div.offsetWidth === 4; - }); - - // Use window.getComputedStyle because jsdom on node.js will break without it. - if ( window.getComputedStyle ) { - support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; - support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. (#3333) - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - marginDiv = div.appendChild( document.createElement("div") ); - marginDiv.style.cssText = div.style.cssText = divReset; - marginDiv.style.marginRight = marginDiv.style.width = "0"; - div.style.width = "1px"; - - support.reliableMarginRight = - !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); - } - - if ( typeof div.style.zoom !== core_strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.innerHTML = ""; - div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); - - // Support: IE6 - // Check if elements with layout shrink-wrap their children - div.style.display = "block"; - div.innerHTML = "
    "; - div.firstChild.style.width = "5px"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - - if ( support.inlineBlockNeedsLayout ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); - - // Null elements to avoid leaks in IE - container = div = tds = marginDiv = null; - }); - - // Null elements to avoid leaks in IE - all = select = fragment = opt = a = input = null; - - return support; -})({}); - -var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, - rmultiDash = /([A-Z])/g; - -function internalData( elem, name, data, pvt /* Internal Use Only */ ){ - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( jQuery.support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "applet": true, - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - // Do not set data on non-element because it will not be cleared (#8335). - if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { - return false; - } - - var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; - - // nodes accept data unless otherwise specified; rejection can be conditional - return !noData || noData !== true && elem.getAttribute("classid") === noData; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var attrs, name, - data = null, - i = 0, - elem = this[0]; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - attrs = elem.attributes; - for ( ; i < attrs.length; i++ ) { - name = attrs[i].name; - - if ( name.indexOf("data-") === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - - dataAttr( elem, name, data[ name ] ); - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return arguments.length > 1 ? - - // Sets one value - this.each(function() { - jQuery.data( this, key, value ); - }) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var nodeHook, boolHook, - rclass = /[\t\r\n\f]/g, - rreturn = /\r/g, - rfocusable = /^(?:input|select|textarea|button|object)$/i, - rclickable = /^(?:a|area)$/i, - ruseDefault = /^(?:checked|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - getSetInput = jQuery.support.input; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call( this, j, this.className ) ); - }); - } - - if ( proceed ) { - // The disjunction here is for better compressibility (see removeClass) - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - " " - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - elem.className = jQuery.trim( cur ); - - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = arguments.length === 0 || typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call( this, j, this.className ) ); - }); - } - if ( proceed ) { - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - "" - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - elem.className = value ? jQuery.trim( cur ) : ""; - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value; - - if ( typeof stateVal === "boolean" && type === "string" ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - classNames = value.match( core_rnotwhite ) || []; - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( type === core_strundefined || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // If the element has a class name or if we're passed "false", - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var ret, hooks, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // Use proper attribute retrieval(#6932, #12072) - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - elem.text; - } - }, - select: { - get: function( elem ) { - var value, option, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one" || index < 0, - values = one ? null : [], - max = one ? index + 1 : options.length, - i = index < 0 ? - max : - one ? index : 0; - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // oldIE doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - // Don't return options that are disabled or in a disabled optgroup - ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && - ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { - optionSet = true; - } - } - - // force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attr: function( elem, name, value ) { - var hooks, ret, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === core_strundefined ) { - return jQuery.prop( elem, name, value ); - } - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - - } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, value + "" ); - return value; - } - - } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var name, propName, - i = 0, - attrNames = value && value.match( core_rnotwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( (name = attrNames[i++]) ) { - propName = jQuery.propFix[ name ] || name; - - // Boolean attributes get special treatment (#10870) - if ( jQuery.expr.match.bool.test( name ) ) { - // Set corresponding property to false - if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { - elem[ propName ] = false; - // Support: IE<9 - // Also clear defaultChecked/defaultSelected (if appropriate) - } else { - elem[ jQuery.camelCase( "default-" + name ) ] = - elem[ propName ] = false; - } - - // See #9699 for explanation of this approach (setting first, then removal) - } else { - jQuery.attr( elem, name, "" ); - } - - elem.removeAttribute( getSetAttribute ? name : propName ); - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to default in case type is set after value during creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? - ret : - ( elem[ name ] = value ); - - } else { - return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? - ret : - elem[ name ]; - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - return tabindex ? - parseInt( tabindex, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - -1; - } - } - } -}); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { - // IE<8 needs the *property* name - elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); - - // Use defaultChecked and defaultSelected for oldIE - } else { - elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; - } - - return name; - } -}; -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { - var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; - - jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? - function( elem, name, isXML ) { - var fn = jQuery.expr.attrHandle[ name ], - ret = isXML ? - undefined : - /* jshint eqeqeq: false */ - (jQuery.expr.attrHandle[ name ] = undefined) != - getter( elem, name, isXML ) ? - - name.toLowerCase() : - null; - jQuery.expr.attrHandle[ name ] = fn; - return ret; - } : - function( elem, name, isXML ) { - return isXML ? - undefined : - elem[ jQuery.camelCase( "default-" + name ) ] ? - name.toLowerCase() : - null; - }; -}); - -// fix oldIE attroperties -if ( !getSetInput || !getSetAttribute ) { - jQuery.attrHooks.value = { - set: function( elem, value, name ) { - if ( jQuery.nodeName( elem, "input" ) ) { - // Does not return so that setAttribute is also used - elem.defaultValue = value; - } else { - // Use nodeHook if defined (#1954); otherwise setAttribute is fine - return nodeHook && nodeHook.set( elem, value, name ); - } - } - }; -} - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = { - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - elem.setAttributeNode( - (ret = elem.ownerDocument.createAttribute( name )) - ); - } - - ret.value = value += ""; - - // Break association with cloned elements by also using setAttribute (#9646) - return name === "value" || value === elem.getAttribute( name ) ? - value : - undefined; - } - }; - jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = - // Some attributes are constructed with empty-string values when not defined - function( elem, name, isXML ) { - var ret; - return isXML ? - undefined : - (ret = elem.getAttributeNode( name )) && ret.value !== "" ? - ret.value : - null; - }; - jQuery.valHooks.button = { - get: function( elem, name ) { - var ret = elem.getAttributeNode( name ); - return ret && ret.specified ? - ret.value : - undefined; - }, - set: nodeHook.set - }; - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - set: function( elem, value, name ) { - nodeHook.set( elem, value === "" ? false : value, name ); - } - }; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }; - }); -} - - -// Some attributes require a special call on IE -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !jQuery.support.hrefNormalized ) { - // href/src property should get the full normalized URL (#10299/#12915) - jQuery.each([ "href", "src" ], function( i, name ) { - jQuery.propHooks[ name ] = { - get: function( elem ) { - return elem.getAttribute( name, 4 ); - } - }; - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Note: IE uppercases css property names, but if we were to .toLowerCase() - // .cssText, that would destroy case senstitivity in URL's, like in "background" - return elem.style.cssText || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = value + "" ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }; -} - -jQuery.each([ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -}); - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }; - if ( !jQuery.support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - // Support: Webkit - // "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - }; - } -}); -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = core_hasOwn.call( event, "type" ) ? event.type : event, - namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = core_slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Even when returnValue equals to undefined Firefox will still show alert - if ( event.result !== undefined ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === core_strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); -var isSimple = /^.[^:#\[\.,]*$/, - rparentsprev = /^(?:parents|prev(?:Until|All))/, - rneedsContext = jQuery.expr.match.needsContext, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - ret = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - cur = ret.push( cur ); - break; - } - } - } - - return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( jQuery.unique(all) ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( isSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); -} -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
    ", "
    " ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
    " ], - tr: [ 2, "", "
    " ], - col: [ 2, "", "
    " ], - td: [ 3, "", "
    " ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
    ", "
    " ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -jQuery.fn.extend({ - text: function( value ) { - return jQuery.access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - // keepData is for internal use only--do not document - remove: function( selector, keepData ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function () { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return jQuery.access( this, function( value ) { - var elem = this[0] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var - // Snapshot the DOM in case .domManip sweeps something relevant into its fragment - args = jQuery.map( this, function( elem ) { - return [ elem.nextSibling, elem.parentNode ]; - }), - i = 0; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - var next = args[ i++ ], - parent = args[ i++ ]; - - if ( parent ) { - // Don't use the snapshot next if it has moved (#13810) - if ( next && next.parentNode !== parent ) { - next = this.nextSibling; - } - jQuery( this ).remove(); - parent.insertBefore( elem, next ); - } - // Allow new content to include elements from the context set - }, true ); - - // Force removal if there was no new content (e.g., from empty arguments) - return i ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback, allowIntersection ) { - - // Flatten any nested arrays - args = core_concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); - } - self.domManip( args, callback, allowIntersection ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Hope ajax is available... - jQuery._evalUrl( node.src ); - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - core_push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( manipulation_rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !jQuery.support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
    " && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !jQuery.support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = jQuery.support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== core_strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - core_deletedIds.push( id ); - } - } - } - } - }, - - _evalUrl: function( url ) { - return jQuery.ajax({ - url: url, - type: "GET", - dataType: "script", - async: false, - global: false, - "throws": true - }); - } -}); -jQuery.fn.extend({ - wrapAll: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapAll( html.call(this, i) ); - }); - } - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); - - if ( this[0].parentNode ) { - wrap.insertBefore( this[0] ); - } - - wrap.map(function() { - var elem = this; - - while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { - elem = elem.firstChild; - } - - return elem; - }).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapInner( html.call(this, i) ); - }); - } - - return this.each(function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - }); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each(function(i) { - jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); - }); - }, - - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); - } -}); -var iframe, getStyles, curCSS, - ralpha = /alpha\([^)]*\)/i, - ropacity = /opacity\s*=\s*([^)]*)/, - rposition = /^(top|right|bottom|left)$/, - // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" - // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rmargin = /^margin/, - rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), - rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), - rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), - elemdisplay = { BODY: "block" }, - - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: 0, - fontWeight: 400 - }, - - cssExpand = [ "Top", "Right", "Bottom", "Left" ], - cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; - -// return a css property mapped to a potentially vendor prefixed property -function vendorPropName( style, name ) { - - // shortcut for names that are not vendor prefixed - if ( name in style ) { - return name; - } - - // check for vendor prefixed names - var capName = name.charAt(0).toUpperCase() + name.slice(1), - origName = name, - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in style ) { - return name; - } - } - - return origName; -} - -function isHidden( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); -} - -function showHide( elements, show ) { - var display, elem, hidden, - values = [], - index = 0, - length = elements.length; - - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - values[ index ] = jQuery._data( elem, "olddisplay" ); - display = elem.style.display; - if ( show ) { - // Reset the inline display of this element to learn if it is - // being hidden by cascaded rules or not - if ( !values[ index ] && display === "none" ) { - elem.style.display = ""; - } - - // Set elements which have been overridden with display: none - // in a stylesheet to whatever the default browser style is - // for such an element - if ( elem.style.display === "" && isHidden( elem ) ) { - values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); - } - } else { - - if ( !values[ index ] ) { - hidden = isHidden( elem ); - - if ( display && display !== "none" || !hidden ) { - jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); - } - } - } - } - - // Set the display of most of the elements in a second loop - // to avoid the constant reflow - for ( index = 0; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - if ( !show || elem.style.display === "none" || elem.style.display === "" ) { - elem.style.display = show ? values[ index ] || "" : "none"; - } - } - - return elements; -} - -jQuery.fn.extend({ - css: function( name, value ) { - return jQuery.access( this, function( elem, name, value ) { - var len, styles, - map = {}, - i = 0; - - if ( jQuery.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - }, - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each(function() { - if ( isHidden( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - }); - } -}); - -jQuery.extend({ - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "columnCount": true, - "fillOpacity": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - // normalize float css property - "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - style = elem.style; - - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // convert relative number strings (+= or -=) to relative numbers. #7345 - if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); - // Fixes bug #9237 - type = "number"; - } - - // Make sure that NaN and null values aren't set. See: #7116 - if ( value == null || type === "number" && isNaN( value ) ) { - return; - } - - // If a number was passed in, add 'px' to the (except for certain CSS properties) - if ( type === "number" && !jQuery.cssNumber[ origName ] ) { - value += "px"; - } - - // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, - // but it would mean to define eight (for every problematic property) identical functions - if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { - - // Wrapped to prevent IE from throwing errors when 'invalid' values are provided - // Fixes bug #5509 - try { - style[ name ] = value; - } catch(e) {} - } - - } else { - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var num, val, hooks, - origName = jQuery.camelCase( name ); - - // Make sure that we're working with the right name - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - //convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Return, converting to number if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; - } - return val; - } -}); - -// NOTE: we've included the "window" in window.getComputedStyle -// because jsdom on node.js will break without it. -if ( window.getComputedStyle ) { - getStyles = function( elem ) { - return window.getComputedStyle( elem, null ); - }; - - curCSS = function( elem, name, _computed ) { - var width, minWidth, maxWidth, - computed = _computed || getStyles( elem ), - - // getPropertyValue is only needed for .css('filter') in IE9, see #12537 - ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, - style = elem.style; - - if ( computed ) { - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right - // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values - if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret; - }; -} else if ( document.documentElement.currentStyle ) { - getStyles = function( elem ) { - return elem.currentStyle; - }; - - curCSS = function( elem, name, _computed ) { - var left, rs, rsLeft, - computed = _computed || getStyles( elem ), - ret = computed ? computed[ name ] : undefined, - style = elem.style; - - // Avoid setting ret to empty string here - // so we don't default to auto - if ( ret == null && style && style[ name ] ) { - ret = style[ name ]; - } - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - // but not position css attributes, as those are proportional to the parent element instead - // and we can't measure the parent instead because it might trigger a "stacking dolls" problem - if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { - - // Remember the original values - left = style.left; - rs = elem.runtimeStyle; - rsLeft = rs && rs.left; - - // Put in the new values to get a computed value out - if ( rsLeft ) { - rs.left = elem.currentStyle.left; - } - style.left = name === "fontSize" ? "1em" : ret; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - if ( rsLeft ) { - rs.left = rsLeft; - } - } - - return ret === "" ? "auto" : ret; - }; -} - -function setPositiveNumber( elem, value, subtract ) { - var matches = rnumsplit.exec( value ); - return matches ? - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i = extra === ( isBorderBox ? "border" : "content" ) ? - // If we already have the right measurement, avoid augmentation - 4 : - // Otherwise initialize for horizontal or vertical properties - name === "width" ? 1 : 0, - - val = 0; - - for ( ; i < 4; i += 2 ) { - // both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // at this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - // at this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // at this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with offset property, which is equivalent to the border-box value - var valueIsBorderBox = true, - val = name === "width" ? elem.offsetWidth : elem.offsetHeight, - styles = getStyles( elem ), - isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // some non-html elements return undefined for offsetWidth, so check for null/undefined - // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 - // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 - if ( val <= 0 || val == null ) { - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name, styles ); - if ( val < 0 || val == null ) { - val = elem.style[ name ]; - } - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test(val) ) { - return val; - } - - // we need the check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - } - - // use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -// Try to determine the default display value of an element -function css_defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - // Use the already-created iframe if possible - iframe = ( iframe || - jQuery(" - - - - - - - - \ No newline at end of file diff --git a/util/build-sample-browser/player/components/sample-browser.html b/util/build-sample-browser/player/components/sample-browser.html deleted file mode 100644 index f301d304bf..0000000000 --- a/util/build-sample-browser/player/components/sample-browser.html +++ /dev/null @@ -1,127 +0,0 @@ - -
    -

    Moai Sample Browser

    { sample }

    -
    - - - - - - - - - - - - - - -
    \ No newline at end of file diff --git a/util/build-sample-browser/player/components/sample-list-tag.html b/util/build-sample-browser/player/components/sample-list-tag.html deleted file mode 100644 index 092f8d2cd4..0000000000 --- a/util/build-sample-browser/player/components/sample-list-tag.html +++ /dev/null @@ -1,88 +0,0 @@ - - -
    -
      -
    • {name}
    • -
    -
    - -
    \ No newline at end of file diff --git a/util/build-sample-browser/player/components/sample-search-tag.html b/util/build-sample-browser/player/components/sample-search-tag.html deleted file mode 100644 index 1241d7d765..0000000000 --- a/util/build-sample-browser/player/components/sample-search-tag.html +++ /dev/null @@ -1,50 +0,0 @@ - - - -
    -   -   - -
    - - - - - - - -
    \ No newline at end of file diff --git a/util/build-sample-browser/player/components/splitter-handle-tag.html b/util/build-sample-browser/player/components/splitter-handle-tag.html deleted file mode 100644 index cfcf4e36cb..0000000000 --- a/util/build-sample-browser/player/components/splitter-handle-tag.html +++ /dev/null @@ -1,43 +0,0 @@ - - - -
    - -
    \ No newline at end of file diff --git a/util/build-sample-browser/player/components/splitter-panel-tag.html b/util/build-sample-browser/player/components/splitter-panel-tag.html deleted file mode 100644 index 9062f8443a..0000000000 --- a/util/build-sample-browser/player/components/splitter-panel-tag.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - -
    - -
    - - - -
    \ No newline at end of file diff --git a/util/build-sample-browser/player/components/splitter-tag.html b/util/build-sample-browser/player/components/splitter-tag.html deleted file mode 100644 index e5cf224912..0000000000 --- a/util/build-sample-browser/player/components/splitter-tag.html +++ /dev/null @@ -1,106 +0,0 @@ - - - -
    -
    - -
    -
    - - -
    \ No newline at end of file diff --git a/util/build-sample-browser/player/css/normalize.css b/util/build-sample-browser/player/css/normalize.css deleted file mode 100644 index 458eea1ea3..0000000000 --- a/util/build-sample-browser/player/css/normalize.css +++ /dev/null @@ -1,427 +0,0 @@ -/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ - -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS text size adjust after orientation change, without disabling - * user zoom. - */ - -html { - font-family: sans-serif; /* 1 */ - -ms-text-size-adjust: 100%; /* 2 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/** - * Remove default margin. - */ - -body { - margin: 0; -} - -/* HTML5 display definitions - ========================================================================== */ - -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 - * and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} - -/** - * 1. Correct `inline-block` display not defined in IE 8/9. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ - -audio, -canvas, -progress, -video { - display: inline-block; /* 1 */ - vertical-align: baseline; /* 2 */ -} - -/** - * Prevent modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. - */ - -[hidden], -template { - display: none; -} - -/* Links - ========================================================================== */ - -/** - * Remove the gray background color from active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * Improve readability when focused and also mouse hovered in all browsers. - */ - -a:active, -a:hover { - outline: 0; -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -/** - * Address styling not present in Safari and Chrome. - */ - -dfn { - font-style: italic; -} - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/** - * Address styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - -/** - * Address inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove border when inside `a` element in IE 8/9/10. - */ - -img { - border: 0; -} - -/** - * Correct overflow not hidden in IE 9/10/11. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* Grouping content - ========================================================================== */ - -/** - * Address margin not present in IE 8/9 and Safari. - */ - -figure { - margin: 1em 40px; -} - -/** - * Address differences between Firefox and other browsers. - */ - -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} - -/** - * Contain overflow in all browsers. - */ - -pre { - overflow: auto; -} - -/** - * Address odd `em`-unit font size rendering in all browsers. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} - -/* Forms - ========================================================================== */ - -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ - -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - */ - -button, -input, -optgroup, -select, -textarea { - color: inherit; /* 1 */ - font: inherit; /* 2 */ - margin: 0; /* 3 */ -} - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ - -button { - overflow: visible; -} - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ - -button, -select { - text-transform: none; -} - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ -} - -/** - * Re-set default cursor for disabled elements. - */ - -button[disabled], -html input[disabled] { - cursor: default; -} - -/** - * Remove inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -input { - line-height: normal; -} - -/** - * It's recommended that you don't attempt to style these elements. - * Firefox's implementation doesn't respect box-sizing, padding, or width. - * - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Fix the cursor style for Chrome's increment/decrement buttons. For certain - * `font-size` values of the `input`, it causes the cursor style of the - * decrement button to change from `default` to `text`. - */ - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome - * (include `-moz` to future-proof). - */ - -input[type="search"] { - -webkit-appearance: textfield; /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; /* 2 */ - box-sizing: content-box; -} - -/** - * Remove inner padding and search cancel button in Safari and Chrome on OS X. - * Safari (but not Chrome) clips the cancel button when the search input has - * padding (and `textfield` appearance). - */ - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ - -textarea { - overflow: auto; -} - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ - -optgroup { - font-weight: bold; -} - -/* Tables - ========================================================================== */ - -/** - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} - -td, -th { - padding: 0; -} diff --git a/util/build-sample-browser/player/css/style.css b/util/build-sample-browser/player/css/style.css deleted file mode 100644 index 66b5966ea7..0000000000 --- a/util/build-sample-browser/player/css/style.css +++ /dev/null @@ -1,328 +0,0 @@ -header { - display: block; - height: 40px; - background: #2F3129; - padding-left: 20px; -} - -header h2 { - line-height: 40px; - color: white; - font-weight: normal; - margin: 0; - width: 250px; - display:inline-block; - float: left; -} -header h3 { - line-height: 40px; - color: white; - padding:0; - margin:0; - margin-right: 20px; - font-size: 20px; - float:right; - font-weight: normal; -} - -sample-search { - width: 100%; - display: block; - position: relative; - height: 28px; - padding-top:4px; - font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; -} - -#samplesearch i { - position: absolute; - left: 5px; - line-height: 23px; -} -#samplesearch input { - width:calc(100% - 41px); - /* margin: 0 0 0 30px; */ - box-sizing: border-box; - line-height: 21px; - padding-left: 10px; - border: 0; - border-radius: 13px; - font-size: 13px; - background-color: #2F3129; -} - -#samplesearch .awesomplete { - margin-left: 30px; - width: 100%; - z-index: 1000; -} - -#samplesearch .awesomplete > ul { - background: #2F3129; - font-size: 13px; -} - - -sample-list { - display: block; - position: absolute; - left: 4px; - width: 15%; - background-color:#272822; - bottom: 4px; - top: 44px; - color: #F8F8F2; - /* overflow-y: scroll; */ - /* overflow: auto; */ -} - -#samplelist { - width:100%; - height: calc(100% - 35px); - position: relative; -} - -#samplelist ul { - list-style-type: none; - padding: 0; - margin: 0; -} - -#samplelist li { - padding: 4px 20px; - font-size: 15px; - cursor: pointer; -} - -#samplelist li.selected { - background-color: #A1B56C; -} - -#samplelist li:hover { - background-color: #A1B56C; - transition: all 300ms linear; - -moz-transition: all 300ms linear; - -webkit-transition: all 300ms linear; - -o-transition: all 300ms linear; -} - - -file-display { - /* left: calc(15% + 8px); */ - /* top: 44px; */ - position: absolute; - /* bottom: 4px; */ - /* right: 360px; */ - left: 0; - right: 0; - bottom: 0; - top: 0; -} - -player { - position: absolute; - /* left: calc(100% - 356px); */ - /* right: 4px; */ - /* bottom: 4px; */ - /* top: 44px; */ - left: 0; - right: 0; - background-color:#272822; - top: 0; - bottom: 0; -} - -player .player-wrapper { - /* max-height: 480px; */ - height: 70%; - width: 100%; -} - -player iframe { - width: 100%; - height: 100%; - border: none; - background-color:black; -} - -file-item-display { - display: block; - background-color: #272822; - top: 0px; - position: absolute; - bottom: 154px; - right:0px; - left: 0px; -} - -file-item-display #editor { - /* top: 0px; */ - /* bottom: 0px; */ - position: relative; - /* right:0px; */ - height: 100%; - width: 100%; - /* left: 0px; */ - /* overflow: auto; */ -} - -file-list { - display: block; - position: absolute; - bottom: 0; - left: 0; - right: 0; - height: 150px; - background-color: #272822; - color: #F8F8F2; - } - - -#filelist { - position: relative; - width: 100%; - height: 150px; - overflow: auto; - box-sizing: border-box; -} - -#filelist ul { - list-style-type: none; - margin:0; - padding:20px; -} -#filelist li { - margin: 5px; -} - -file-icon { - display: block; - width: 96px; - height: 96px; - float: left; - overflow:hidden; - margin: 5px; -} - -file-icon.selected .icon, -file-icon:hover .icon, -file-icon:hover .caption -{ - transition: all 300ms linear; - -moz-transition: all 300ms linear; - -webkit-transition: all 300ms linear; - -o-transition: all 300ms linear; - color: #A1B56C; -} - - - -file-icon.selected .caption { - color: white; - background-color: #A1B56C; -} - - - - -file-icon .icon { - display: block; - margin: 5px auto; - font-size: 48px; - width: 100%; - text-align: center; -} - -file-icon .caption { - /*font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;*/ - font-size: 13px; - max-width: 96px; - display: block; - text-align: center; - padding: 2px; - word-wrap:break-word; -} - -player-console { - display: block; - /* height: 150px; */ - height: 30%; - bottom: 0; - left: 0; - right: 0; - position: absolute; - box-sizing: border-box; - overflow: auto; -} - -#terminal { - height: 100%; - box-sizing: border-box; - overflow: auto; -} - -picture-viewer { - width: 100%; - height: 100%; - display: block; - overflow: auto; -} - -picture-viewer .trans { - background-image: url('../images/transback.svg'); - display: inline-block; - line-height: 0; -} - -font-viewer { - display: block; - overflow: auto; - width: 100%; - height: 100%; - color: #F8F8F2; - -} - -#contentsplitter { - left: calc(15% + 8px); - top: 44px; - position: absolute; - bottom: 5px; - right: 4px; -} - - -body { - background-color: #171812; - -} - -body .ace_scrollbar { - display: none; -} - -body .ace_editor:hover .ace_scrollbar { - display: block; -} - -.file-info { - padding: 10px; - color: #F8F8F2; -} - -::-webkit-scrollbar { - width: 0.5em; -} - -::-webkit-scrollbar-track { - box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); -} - -::-webkit-scrollbar-thumb { - background: rgba(100, 100, 100, 0.8); -} - -::-webkit-scrollbar-corner, -::-webkit-scrollbar-thumb:window-inactive { - background: rgba(100, 100, 100, 0.4); -} diff --git a/util/build-sample-browser/player/deferredscript.js b/util/build-sample-browser/player/deferredscript.js deleted file mode 100644 index 716ee1f53f..0000000000 --- a/util/build-sample-browser/player/deferredscript.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Created by David on 4/11/2015. - */ -function appendScriptTag(path) { - var s = document.createElement("script"); - s.type = "text/javascript"; - s.src = path; - document.body.appendChild(s); - console.log("Appended script",path); -} - -function loadDeferredScripts( scripts, defines, callback ) { - //we defer moaijs.js and our rom - - for (var i = 0; i < defines.length; i++) { - window[defines[i]] = undefined; - } - for (var i = 0; i < scripts.length; i++) { - appendScriptTag(scripts[i]); - } - - console.log("started deferred loading of scripts",scripts); - console.log("waiting on scripts to load by watching for ",defines); - var awaiter = window.setInterval( - function() { - var finished = 0; - for(var i = 0; i < defines.length; i++) { - if (window[defines[i]]) { - console.log("script finished loading", scripts[i]); - finished = finished + 1; - } - } - if (finished == defines.length) { - console.log("Deferred scripts loaded"); - window.clearInterval(awaiter); - callback(); - } - }, 10); -}; \ No newline at end of file diff --git a/util/build-sample-browser/player/fileutil.js b/util/build-sample-browser/player/fileutil.js deleted file mode 100644 index 416a808e89..0000000000 --- a/util/build-sample-browser/player/fileutil.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Created by David on 7/11/2015. - */ - -var fileUtil = function() { - var M = {}; - - var typemap = { - 'ttf': {type: 'font', mime: 'application/font-sfnt'}, - 'bmp': {type: 'image', mime: 'image/bmp'}, - 'svg': {type: 'image', mime: 'image/svg+xml'}, - 'png': {type: 'image', mime: 'image/png'}, - 'jpg': {type: 'image', mime: 'image/jpeg'}, - 'jpeg': {type: 'image', mime: 'image/jpeg'}, - 'ogg': {type: 'audio', mime: 'audio/ogg'}, - 'wav': {type: 'audio', mime: 'audio/vnd.wave'}, - 'mp3': {type: 'audio', mime: 'audio/mpeg'}, - 'lua': {type: 'text', mime: 'text/plain'}, - 'json': {type: 'text', mime: 'text/plain'}, - 'xml': {type: 'text', mime: 'text/plain'}, - 'conf': {type: 'text', mime: 'text/plain'}, - 'cfg': {type: 'text', mime: 'text/plain'}, - 'txt': {type: 'text', mime: 'text/plain'}, - 'fnt': {type: 'text', mime: 'text/plain'} - }; - - function arrayToString(arr) { - return (String.fromCharCode).apply(null, new Uint16Array(arr)); - } - - M.asText = function (file) { - return arrayToString(file.data); - }; - - - M.getExtension = function(filename) { - var parts = filename.split('.'); - return _(parts).last().toLowerCase(); - }; - - M.getType = function(file) { - var ext = M.getExtension(file.filename); - var typeinfo = typemap[ext]; - if (!typeinfo) return 'unknown'; - return typeinfo.type; - }; - - M.getMimetype = function(file) { - var ext = M.getExtension(file.filename); - var typeinfo = typemap[ext]; - if (!typeinfo) return 'application/octet-stream'; - return typeinfo.mime; - }; - - M.asObjectUrl = function(file) { - var arr = file.data; - var mime = M.getMimetype(file); - var blob = new Blob([arr], {type: mime}); - return URL.createObjectURL(blob); - }; - - - M.isType = function(file, type) { - return M.getType(file) == type; - }; - return M; -}(); - - diff --git a/util/build-sample-browser/player/images/transback.svg b/util/build-sample-browser/player/images/transback.svg deleted file mode 100644 index 5085fdc2b5..0000000000 --- a/util/build-sample-browser/player/images/transback.svg +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/util/build-sample-browser/player/index.html b/util/build-sample-browser/player/index.html deleted file mode 100644 index 9843f7fa44..0000000000 --- a/util/build-sample-browser/player/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Moai Sample Browser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/util/build-sample-browser/player/samplehost.html b/util/build-sample-browser/player/samplehost.html deleted file mode 100644 index 620d8ea480..0000000000 --- a/util/build-sample-browser/player/samplehost.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - MoaiJS - - - - - - - -
    - -
    -
    -
    -
    - - -
    - -
    - - - - - - - - - - - - - diff --git a/util/build-sample-browser/player/vendor/ace/ace.js b/util/build-sample-browser/player/vendor/ace/ace.js deleted file mode 100644 index 7c895b36a7..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ace.js +++ /dev/null @@ -1,17601 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -(function() { - -var ACE_NAMESPACE = "ace"; - -var global = (function() { - return this; -})(); - - -if (!ACE_NAMESPACE && typeof requirejs !== "undefined") - return; - - -var _define = function(module, deps, payload) { - if (typeof module !== 'string') { - if (_define.original) - _define.original.apply(window, arguments); - else { - console.error('dropping module because define wasn\'t a string.'); - console.trace(); - } - return; - } - - if (arguments.length == 2) - payload = deps; - - if (!_define.modules) { - _define.modules = {}; - _define.payloads = {}; - } - - _define.payloads[module] = payload; - _define.modules[module] = null; -}; -var _require = function(parentId, module, callback) { - if (Object.prototype.toString.call(module) === "[object Array]") { - var params = []; - for (var i = 0, l = module.length; i < l; ++i) { - var dep = lookup(parentId, module[i]); - if (!dep && _require.original) - return _require.original.apply(window, arguments); - params.push(dep); - } - if (callback) { - callback.apply(null, params); - } - } - else if (typeof module === 'string') { - var payload = lookup(parentId, module); - if (!payload && _require.original) - return _require.original.apply(window, arguments); - - if (callback) { - callback(); - } - - return payload; - } - else { - if (_require.original) - return _require.original.apply(window, arguments); - } -}; - -var normalizeModule = function(parentId, moduleName) { - if (moduleName.indexOf("!") !== -1) { - var chunks = moduleName.split("!"); - return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]); - } - if (moduleName.charAt(0) == ".") { - var base = parentId.split("/").slice(0, -1).join("/"); - moduleName = base + "/" + moduleName; - - while(moduleName.indexOf(".") !== -1 && previous != moduleName) { - var previous = moduleName; - moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); - } - } - - return moduleName; -}; -var lookup = function(parentId, moduleName) { - - moduleName = normalizeModule(parentId, moduleName); - - var module = _define.modules[moduleName]; - if (!module) { - module = _define.payloads[moduleName]; - if (typeof module === 'function') { - var exports = {}; - var mod = { - id: moduleName, - uri: '', - exports: exports, - packaged: true - }; - - var req = function(module, callback) { - return _require(moduleName, module, callback); - }; - - var returnValue = module(req, exports, mod); - exports = returnValue || mod.exports; - _define.modules[moduleName] = exports; - delete _define.payloads[moduleName]; - } - module = _define.modules[moduleName] = exports || module; - } - return module; -}; - -function exportAce(ns) { - var require = function(module, callback) { - return _require("", module, callback); - }; - - var root = global; - if (ns) { - if (!global[ns]) - global[ns] = {}; - root = global[ns]; - } - - if (!root.define || !root.define.packaged) { - _define.original = root.define; - root.define = _define; - root.define.packaged = true; - } - - if (!root.require || !root.require.packaged) { - _require.original = root.require; - root.require = require; - root.require.packaged = true; - } -} - -exportAce(ACE_NAMESPACE); - -})(); - -ace.define('ace/ace', ['require', 'exports', 'module' , 'ace/lib/fixoldbrowsers', 'ace/lib/dom', 'ace/lib/event', 'ace/editor', 'ace/edit_session', 'ace/undomanager', 'ace/virtual_renderer', 'ace/multi_select', 'ace/worker/worker_client', 'ace/keyboard/hash_handler', 'ace/placeholder', 'ace/mode/folding/fold_mode', 'ace/theme/textmate', 'ace/ext/error_marker', 'ace/config'], function(require, exports, module) { - - -require("./lib/fixoldbrowsers"); - -var dom = require("./lib/dom"); -var event = require("./lib/event"); - -var Editor = require("./editor").Editor; -var EditSession = require("./edit_session").EditSession; -var UndoManager = require("./undomanager").UndoManager; -var Renderer = require("./virtual_renderer").VirtualRenderer; -var MultiSelect = require("./multi_select").MultiSelect; -require("./worker/worker_client"); -require("./keyboard/hash_handler"); -require("./placeholder"); -require("./mode/folding/fold_mode"); -require("./theme/textmate"); -require("./ext/error_marker"); - -exports.config = require("./config"); -exports.require = require; -exports.edit = function(el) { - if (typeof(el) == "string") { - var _id = el; - var el = document.getElementById(_id); - if (!el) - throw new Error("ace.edit can't find div #" + _id); - } - - if (el.env && el.env.editor instanceof Editor) - return el.env.editor; - - var doc = exports.createEditSession(dom.getInnerText(el)); - el.innerHTML = ''; - - var editor = new Editor(new Renderer(el)); - new MultiSelect(editor); - editor.setSession(doc); - - var env = { - document: doc, - editor: editor, - onResize: editor.resize.bind(editor, null) - }; - event.addListener(window, "resize", env.onResize); - editor.on("destroy", function() { - event.removeListener(window, "resize", env.onResize); - }); - el.env = editor.env = env; - return editor; -}; -exports.createEditSession = function(text, mode) { - var doc = new EditSession(text, mode); - doc.setUndoManager(new UndoManager()); - return doc; -} -exports.EditSession = EditSession; -exports.UndoManager = UndoManager; -}); - -ace.define('ace/mode/behaviour', ['require', 'exports', 'module' ], function(require, exports, module) { - - -var Behaviour = function() { - this.$behaviours = {}; -}; - -(function () { - - this.add = function (name, action, callback) { - switch (undefined) { - case this.$behaviours: - this.$behaviours = {}; - case this.$behaviours[name]: - this.$behaviours[name] = {}; - } - this.$behaviours[name][action] = callback; - } - - this.addBehaviours = function (behaviours) { - for (var key in behaviours) { - for (var action in behaviours[key]) { - this.add(key, action, behaviours[key][action]); - } - } - } - - this.remove = function (name) { - if (this.$behaviours && this.$behaviours[name]) { - delete this.$behaviours[name]; - } - } - - this.inherit = function (mode, filter) { - if (typeof mode === "function") { - var behaviours = new mode().getBehaviours(filter); - } else { - var behaviours = mode.getBehaviours(filter); - } - this.addBehaviours(behaviours); - } - - this.getBehaviours = function (filter) { - if (!filter) { - return this.$behaviours; - } else { - var ret = {} - for (var i = 0; i < filter.length; i++) { - if (this.$behaviours[filter[i]]) { - ret[filter[i]] = this.$behaviours[filter[i]]; - } - } - return ret; - } - } - -}).call(Behaviour.prototype); - -exports.Behaviour = Behaviour; -}); -ace.define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { -exports.packages = {}; - -addUnicodePackage({ - L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", - Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A", - Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A", - Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC", - Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F", - Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", - M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26", - Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26", - Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC", - Me: "0488048906DE20DD-20E020E2-20E4A670-A672", - N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", - Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", - Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF", - No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835", - P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65", - Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D", - Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62", - Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63", - Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20", - Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21", - Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F", - Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65", - S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD", - Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC", - Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6", - Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3", - So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD", - Z: "002000A01680180E2000-200A20282029202F205F3000", - Zs: "002000A01680180E2000-200A202F205F3000", - Zl: "2028", - Zp: "2029", - C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF", - Cc: "0000-001F007F-009F", - Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB", - Co: "E000-F8FF", - Cs: "D800-DFFF", - Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF" -}); - -function addUnicodePackage (pack) { - var codePoint = /\w{4}/g; - for (var name in pack) - exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); -}; - -}); - -ace.define('ace/token_iterator', ['require', 'exports', 'module' ], function(require, exports, module) { -var TokenIterator = function(session, initialRow, initialColumn) { - this.$session = session; - this.$row = initialRow; - this.$rowTokens = session.getTokens(initialRow); - - var token = session.getTokenAt(initialRow, initialColumn); - this.$tokenIndex = token ? token.index : -1; -}; - -(function() { - this.stepBackward = function() { - this.$tokenIndex -= 1; - - while (this.$tokenIndex < 0) { - this.$row -= 1; - if (this.$row < 0) { - this.$row = 0; - return null; - } - - this.$rowTokens = this.$session.getTokens(this.$row); - this.$tokenIndex = this.$rowTokens.length - 1; - } - - return this.$rowTokens[this.$tokenIndex]; - }; - this.stepForward = function() { - this.$tokenIndex += 1; - var rowCount; - while (this.$tokenIndex >= this.$rowTokens.length) { - this.$row += 1; - if (!rowCount) - rowCount = this.$session.getLength(); - if (this.$row >= rowCount) { - this.$row = rowCount - 1; - return null; - } - - this.$rowTokens = this.$session.getTokens(this.$row); - this.$tokenIndex = 0; - } - - return this.$rowTokens[this.$tokenIndex]; - }; - this.getCurrentToken = function () { - return this.$rowTokens[this.$tokenIndex]; - }; - this.getCurrentTokenRow = function () { - return this.$row; - }; - this.getCurrentTokenColumn = function() { - var rowTokens = this.$rowTokens; - var tokenIndex = this.$tokenIndex; - var column = rowTokens[tokenIndex].start; - if (column !== undefined) - return column; - - column = 0; - while (tokenIndex > 0) { - tokenIndex -= 1; - column += rowTokens[tokenIndex].value.length; - } - - return column; - }; - -}).call(TokenIterator.prototype); - -exports.TokenIterator = TokenIterator; -}); - -ace.define('ace/mode/text_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) { - - -var lang = require("../lib/lang"); - -var TextHighlightRules = function() { - - this.$rules = { - "start" : [{ - token : "empty_line", - regex : '^$' - }, { - defaultToken : "text" - }] - }; -}; - -(function() { - - this.addRules = function(rules, prefix) { - if (!prefix) { - for (var key in rules) - this.$rules[key] = rules[key]; - return; - } - for (var key in rules) { - var state = rules[key]; - for (var i = 0; i < state.length; i++) { - var rule = state[i]; - if (rule.next) { - if (typeof rule.next != "string") { - if (rule.nextState && rule.nextState.indexOf(prefix) !== 0) - rule.nextState = prefix + rule.nextState; - } else { - if (rule.next.indexOf(prefix) !== 0) - rule.next = prefix + rule.next; - } - - } - } - this.$rules[prefix + key] = state; - } - }; - - this.getRules = function() { - return this.$rules; - }; - - this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) { - var embedRules = typeof HighlightRules == "function" - ? new HighlightRules().getRules() - : HighlightRules; - if (states) { - for (var i = 0; i < states.length; i++) - states[i] = prefix + states[i]; - } else { - states = []; - for (var key in embedRules) - states.push(prefix + key); - } - - this.addRules(embedRules, prefix); - - if (escapeRules) { - var addRules = Array.prototype[append ? "push" : "unshift"]; - for (var i = 0; i < states.length; i++) - addRules.apply(this.$rules[states[i]], lang.deepCopy(escapeRules)); - } - - if (!this.$embeds) - this.$embeds = []; - this.$embeds.push(prefix); - }; - - this.getEmbeds = function() { - return this.$embeds; - }; - - var pushState = function(currentState, stack) { - if (currentState != "start" || stack.length) - stack.unshift(this.nextState, currentState); - return this.nextState; - }; - var popState = function(currentState, stack) { - stack.shift(); - return stack.shift() || "start"; - }; - - this.normalizeRules = function() { - var id = 0; - var rules = this.$rules; - function processState(key) { - var state = rules[key]; - state.processed = true; - for (var i = 0; i < state.length; i++) { - var rule = state[i]; - if (!rule.regex && rule.start) { - rule.regex = rule.start; - if (!rule.next) - rule.next = []; - rule.next.push({ - defaultToken: rule.token - }, { - token: rule.token + ".end", - regex: rule.end || rule.start, - next: "pop" - }); - rule.token = rule.token + ".start"; - rule.push = true; - } - var next = rule.next || rule.push; - if (next && Array.isArray(next)) { - var stateName = rule.stateName; - if (!stateName) { - stateName = rule.token; - if (typeof stateName != "string") - stateName = stateName[0] || ""; - if (rules[stateName]) - stateName += id++; - } - rules[stateName] = next; - rule.next = stateName; - processState(stateName); - } else if (next == "pop") { - rule.next = popState; - } - - if (rule.push) { - rule.nextState = rule.next || rule.push; - rule.next = pushState; - delete rule.push; - } - - if (rule.rules) { - for (var r in rule.rules) { - if (rules[r]) { - if (rules[r].push) - rules[r].push.apply(rules[r], rule.rules[r]); - } else { - rules[r] = rule.rules[r]; - } - } - } - if (rule.include || typeof rule == "string") { - var includeName = rule.include || rule; - var toInsert = rules[includeName]; - } else if (Array.isArray(rule)) - toInsert = rule; - - if (toInsert) { - var args = [i, 1].concat(toInsert); - if (rule.noEscape) - args = args.filter(function(x) {return !x.next;}); - state.splice.apply(state, args); - i--; - toInsert = null - } - - if (rule.keywordMap) { - rule.token = this.createKeywordMapper( - rule.keywordMap, rule.defaultToken || "text", rule.caseInsensitive - ); - delete rule.defaultToken; - } - } - }; - Object.keys(rules).forEach(processState, this); - }; - - this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) { - var keywords = Object.create(null); - Object.keys(map).forEach(function(className) { - var a = map[className]; - if (ignoreCase) - a = a.toLowerCase(); - var list = a.split(splitChar || "|"); - for (var i = list.length; i--; ) - keywords[list[i]] = className; - }); - if (Object.getPrototypeOf(keywords)) { - keywords.__proto__ = null; - } - this.$keywordList = Object.keys(keywords); - map = null; - return ignoreCase - ? function(value) {return keywords[value.toLowerCase()] || defaultToken } - : function(value) {return keywords[value] || defaultToken }; - } - - this.getKeywords = function() { - return this.$keywords; - }; - -}).call(TextHighlightRules.prototype); - -exports.TextHighlightRules = TextHighlightRules; -}); - -ace.define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - -var Anchor = exports.Anchor = function(doc, row, column) { - this.$onChange = this.onChange.bind(this); - this.attach(doc); - - if (typeof column == "undefined") - this.setPosition(row.row, row.column); - else - this.setPosition(row, column); -}; - -(function() { - - oop.implement(this, EventEmitter); - this.getPosition = function() { - return this.$clipPositionToDocument(this.row, this.column); - }; - this.getDocument = function() { - return this.document; - }; - this.$insertRight = false; - this.onChange = function(e) { - var delta = e.data; - var range = delta.range; - - if (range.start.row == range.end.row && range.start.row != this.row) - return; - - if (range.start.row > this.row) - return; - - if (range.start.row == this.row && range.start.column > this.column) - return; - - var row = this.row; - var column = this.column; - var start = range.start; - var end = range.end; - - if (delta.action === "insertText") { - if (start.row === row && start.column <= column) { - if (start.column === column && this.$insertRight) { - } else if (start.row === end.row) { - column += end.column - start.column; - } else { - column -= start.column; - row += end.row - start.row; - } - } else if (start.row !== end.row && start.row < row) { - row += end.row - start.row; - } - } else if (delta.action === "insertLines") { - if (start.row <= row) { - row += end.row - start.row; - } - } else if (delta.action === "removeText") { - if (start.row === row && start.column < column) { - if (end.column >= column) - column = start.column; - else - column = Math.max(0, column - (end.column - start.column)); - - } else if (start.row !== end.row && start.row < row) { - if (end.row === row) - column = Math.max(0, column - end.column) + start.column; - row -= (end.row - start.row); - } else if (end.row === row) { - row -= end.row - start.row; - column = Math.max(0, column - end.column) + start.column; - } - } else if (delta.action == "removeLines") { - if (start.row <= row) { - if (end.row <= row) - row -= end.row - start.row; - else { - row = start.row; - column = 0; - } - } - } - - this.setPosition(row, column, true); - }; - this.setPosition = function(row, column, noClip) { - var pos; - if (noClip) { - pos = { - row: row, - column: column - }; - } else { - pos = this.$clipPositionToDocument(row, column); - } - - if (this.row == pos.row && this.column == pos.column) - return; - - var old = { - row: this.row, - column: this.column - }; - - this.row = pos.row; - this.column = pos.column; - this._signal("change", { - old: old, - value: pos - }); - }; - this.detach = function() { - this.document.removeEventListener("change", this.$onChange); - }; - this.attach = function(doc) { - this.document = doc || this.document; - this.document.on("change", this.$onChange); - }; - this.$clipPositionToDocument = function(row, column) { - var pos = {}; - - if (row >= this.document.getLength()) { - pos.row = Math.max(0, this.document.getLength() - 1); - pos.column = this.document.getLine(pos.row).length; - } - else if (row < 0) { - pos.row = 0; - pos.column = 0; - } - else { - pos.row = row; - pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); - } - - if (column < 0) - pos.column = 0; - - return pos; - }; - -}).call(Anchor.prototype); - -}); - -ace.define('ace/background_tokenizer', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - -var BackgroundTokenizer = function(tokenizer, editor) { - this.running = false; - this.lines = []; - this.states = []; - this.currentLine = 0; - this.tokenizer = tokenizer; - - var self = this; - - this.$worker = function() { - if (!self.running) { return; } - - var workerStart = new Date(); - var currentLine = self.currentLine; - var endLine = -1; - var doc = self.doc; - - while (self.lines[currentLine]) - currentLine++; - - var startLine = currentLine; - - var len = doc.getLength(); - var processedLines = 0; - self.running = false; - while (currentLine < len) { - self.$tokenizeRow(currentLine); - endLine = currentLine; - do { - currentLine++; - } while (self.lines[currentLine]); - processedLines ++; - if ((processedLines % 5 == 0) && (new Date() - workerStart) > 20) { - self.running = setTimeout(self.$worker, 20); - self.currentLine = currentLine; - return; - } - } - self.currentLine = currentLine; - - if (startLine <= endLine) - self.fireUpdateEvent(startLine, endLine); - }; -}; - -(function(){ - - oop.implement(this, EventEmitter); - this.setTokenizer = function(tokenizer) { - this.tokenizer = tokenizer; - this.lines = []; - this.states = []; - - this.start(0); - }; - this.setDocument = function(doc) { - this.doc = doc; - this.lines = []; - this.states = []; - - this.stop(); - }; - this.fireUpdateEvent = function(firstRow, lastRow) { - var data = { - first: firstRow, - last: lastRow - }; - this._signal("update", {data: data}); - }; - this.start = function(startRow) { - this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength()); - this.lines.splice(this.currentLine, this.lines.length); - this.states.splice(this.currentLine, this.states.length); - - this.stop(); - this.running = setTimeout(this.$worker, 700); - }; - - this.scheduleStart = function() { - if (!this.running) - this.running = setTimeout(this.$worker, 700); - } - - this.$updateOnChange = function(delta) { - var range = delta.range; - var startRow = range.start.row; - var len = range.end.row - startRow; - - if (len === 0) { - this.lines[startRow] = null; - } else if (delta.action == "removeText" || delta.action == "removeLines") { - this.lines.splice(startRow, len + 1, null); - this.states.splice(startRow, len + 1, null); - } else { - var args = Array(len + 1); - args.unshift(startRow, 1); - this.lines.splice.apply(this.lines, args); - this.states.splice.apply(this.states, args); - } - - this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength()); - - this.stop(); - }; - this.stop = function() { - if (this.running) - clearTimeout(this.running); - this.running = false; - }; - this.getTokens = function(row) { - return this.lines[row] || this.$tokenizeRow(row); - }; - this.getState = function(row) { - if (this.currentLine == row) - this.$tokenizeRow(row); - return this.states[row] || "start"; - }; - - this.$tokenizeRow = function(row) { - var line = this.doc.getLine(row); - var state = this.states[row - 1]; - - var data = this.tokenizer.getLineTokens(line, state, row); - - if (this.states[row] + "" !== data.state + "") { - this.states[row] = data.state; - this.lines[row + 1] = null; - if (this.currentLine > row + 1) - this.currentLine = row + 1; - } else if (this.currentLine == row) { - this.currentLine = row + 1; - } - - return this.lines[row] = data.tokens; - }; - -}).call(BackgroundTokenizer.prototype); - -exports.BackgroundTokenizer = BackgroundTokenizer; -}); - -ace.define('ace/search_highlight', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/lib/oop', 'ace/range'], function(require, exports, module) { - - -var lang = require("./lib/lang"); -var oop = require("./lib/oop"); -var Range = require("./range").Range; - -var SearchHighlight = function(regExp, clazz, type) { - this.setRegexp(regExp); - this.clazz = clazz; - this.type = type || "text"; -}; - -(function() { - this.MAX_RANGES = 500; - - this.setRegexp = function(regExp) { - if (this.regExp+"" == regExp+"") - return; - this.regExp = regExp; - this.cache = []; - }; - - this.update = function(html, markerLayer, session, config) { - if (!this.regExp) - return; - var start = config.firstRow, end = config.lastRow; - - for (var i = start; i <= end; i++) { - var ranges = this.cache[i]; - if (ranges == null) { - ranges = lang.getMatchOffsets(session.getLine(i), this.regExp); - if (ranges.length > this.MAX_RANGES) - ranges = ranges.slice(0, this.MAX_RANGES); - ranges = ranges.map(function(match) { - return new Range(i, match.offset, i, match.offset + match.length); - }); - this.cache[i] = ranges.length ? ranges : ""; - } - - for (var j = ranges.length; j --; ) { - markerLayer.drawSingleLineMarker( - html, ranges[j].toScreenRange(session), this.clazz, config); - } - } - }; - -}).call(SearchHighlight.prototype); - -exports.SearchHighlight = SearchHighlight; -}); - -ace.define('ace/edit_session/folding', ['require', 'exports', 'module' , 'ace/range', 'ace/edit_session/fold_line', 'ace/edit_session/fold', 'ace/token_iterator'], function(require, exports, module) { - - -var Range = require("../range").Range; -var FoldLine = require("./fold_line").FoldLine; -var Fold = require("./fold").Fold; -var TokenIterator = require("../token_iterator").TokenIterator; - -function Folding() { - this.getFoldAt = function(row, column, side) { - var foldLine = this.getFoldLine(row); - if (!foldLine) - return null; - - var folds = foldLine.folds; - for (var i = 0; i < folds.length; i++) { - var fold = folds[i]; - if (fold.range.contains(row, column)) { - if (side == 1 && fold.range.isEnd(row, column)) { - continue; - } else if (side == -1 && fold.range.isStart(row, column)) { - continue; - } - return fold; - } - } - }; - this.getFoldsInRange = function(range) { - var start = range.start; - var end = range.end; - var foldLines = this.$foldData; - var foundFolds = []; - - start.column += 1; - end.column -= 1; - - for (var i = 0; i < foldLines.length; i++) { - var cmp = foldLines[i].range.compareRange(range); - if (cmp == 2) { - continue; - } - else if (cmp == -2) { - break; - } - - var folds = foldLines[i].folds; - for (var j = 0; j < folds.length; j++) { - var fold = folds[j]; - cmp = fold.range.compareRange(range); - if (cmp == -2) { - break; - } else if (cmp == 2) { - continue; - } else - if (cmp == 42) { - break; - } - foundFolds.push(fold); - } - } - start.column -= 1; - end.column += 1; - - return foundFolds; - }; - - this.getFoldsInRangeList = function(ranges) { - if (Array.isArray(ranges)) { - var folds = []; - ranges.forEach(function(range) { - folds = folds.concat(this.getFoldsInRange(range)); - }, this); - } else { - var folds = this.getFoldsInRange(ranges); - } - return folds; - } - this.getAllFolds = function() { - var folds = []; - var foldLines = this.$foldData; - - for (var i = 0; i < foldLines.length; i++) - for (var j = 0; j < foldLines[i].folds.length; j++) - folds.push(foldLines[i].folds[j]); - - return folds; - }; - this.getFoldStringAt = function(row, column, trim, foldLine) { - foldLine = foldLine || this.getFoldLine(row); - if (!foldLine) - return null; - - var lastFold = { - end: { column: 0 } - }; - var str, fold; - for (var i = 0; i < foldLine.folds.length; i++) { - fold = foldLine.folds[i]; - var cmp = fold.range.compareEnd(row, column); - if (cmp == -1) { - str = this - .getLine(fold.start.row) - .substring(lastFold.end.column, fold.start.column); - break; - } - else if (cmp === 0) { - return null; - } - lastFold = fold; - } - if (!str) - str = this.getLine(fold.start.row).substring(lastFold.end.column); - - if (trim == -1) - return str.substring(0, column - lastFold.end.column); - else if (trim == 1) - return str.substring(column - lastFold.end.column); - else - return str; - }; - - this.getFoldLine = function(docRow, startFoldLine) { - var foldData = this.$foldData; - var i = 0; - if (startFoldLine) - i = foldData.indexOf(startFoldLine); - if (i == -1) - i = 0; - for (i; i < foldData.length; i++) { - var foldLine = foldData[i]; - if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) { - return foldLine; - } else if (foldLine.end.row > docRow) { - return null; - } - } - return null; - }; - this.getNextFoldLine = function(docRow, startFoldLine) { - var foldData = this.$foldData; - var i = 0; - if (startFoldLine) - i = foldData.indexOf(startFoldLine); - if (i == -1) - i = 0; - for (i; i < foldData.length; i++) { - var foldLine = foldData[i]; - if (foldLine.end.row >= docRow) { - return foldLine; - } - } - return null; - }; - - this.getFoldedRowCount = function(first, last) { - var foldData = this.$foldData, rowCount = last-first+1; - for (var i = 0; i < foldData.length; i++) { - var foldLine = foldData[i], - end = foldLine.end.row, - start = foldLine.start.row; - if (end >= last) { - if(start < last) { - if(start >= first) - rowCount -= last-start; - else - rowCount = 0;//in one fold - } - break; - } else if(end >= first){ - if (start >= first) //fold inside range - rowCount -= end-start; - else - rowCount -= end-first+1; - } - } - return rowCount; - }; - - this.$addFoldLine = function(foldLine) { - this.$foldData.push(foldLine); - this.$foldData.sort(function(a, b) { - return a.start.row - b.start.row; - }); - return foldLine; - }; - this.addFold = function(placeholder, range) { - var foldData = this.$foldData; - var added = false; - var fold; - - if (placeholder instanceof Fold) - fold = placeholder; - else { - fold = new Fold(range, placeholder); - fold.collapseChildren = range.collapseChildren; - } - this.$clipRangeToDocument(fold.range); - - var startRow = fold.start.row; - var startColumn = fold.start.column; - var endRow = fold.end.row; - var endColumn = fold.end.column; - if (!(startRow < endRow || - startRow == endRow && startColumn <= endColumn - 2)) - throw new Error("The range has to be at least 2 characters width"); - - var startFold = this.getFoldAt(startRow, startColumn, 1); - var endFold = this.getFoldAt(endRow, endColumn, -1); - if (startFold && endFold == startFold) - return startFold.addSubFold(fold); - - if ( - (startFold && !startFold.range.isStart(startRow, startColumn)) - || (endFold && !endFold.range.isEnd(endRow, endColumn)) - ) { - throw new Error("A fold can't intersect already existing fold" + fold.range + startFold.range); - } - var folds = this.getFoldsInRange(fold.range); - if (folds.length > 0) { - this.removeFolds(folds); - folds.forEach(function(subFold) { - fold.addSubFold(subFold); - }); - } - - for (var i = 0; i < foldData.length; i++) { - var foldLine = foldData[i]; - if (endRow == foldLine.start.row) { - foldLine.addFold(fold); - added = true; - break; - } else if (startRow == foldLine.end.row) { - foldLine.addFold(fold); - added = true; - if (!fold.sameRow) { - var foldLineNext = foldData[i + 1]; - if (foldLineNext && foldLineNext.start.row == endRow) { - foldLine.merge(foldLineNext); - break; - } - } - break; - } else if (endRow <= foldLine.start.row) { - break; - } - } - - if (!added) - foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold)); - - if (this.$useWrapMode) - this.$updateWrapData(foldLine.start.row, foldLine.start.row); - else - this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row); - this.$modified = true; - this._emit("changeFold", { data: fold, action: "add" }); - - return fold; - }; - - this.addFolds = function(folds) { - folds.forEach(function(fold) { - this.addFold(fold); - }, this); - }; - - this.removeFold = function(fold) { - var foldLine = fold.foldLine; - var startRow = foldLine.start.row; - var endRow = foldLine.end.row; - - var foldLines = this.$foldData; - var folds = foldLine.folds; - if (folds.length == 1) { - foldLines.splice(foldLines.indexOf(foldLine), 1); - } else - if (foldLine.range.isEnd(fold.end.row, fold.end.column)) { - folds.pop(); - foldLine.end.row = folds[folds.length - 1].end.row; - foldLine.end.column = folds[folds.length - 1].end.column; - } else - if (foldLine.range.isStart(fold.start.row, fold.start.column)) { - folds.shift(); - foldLine.start.row = folds[0].start.row; - foldLine.start.column = folds[0].start.column; - } else - if (fold.sameRow) { - folds.splice(folds.indexOf(fold), 1); - } else - { - var newFoldLine = foldLine.split(fold.start.row, fold.start.column); - folds = newFoldLine.folds; - folds.shift(); - newFoldLine.start.row = folds[0].start.row; - newFoldLine.start.column = folds[0].start.column; - } - - if (!this.$updating) { - if (this.$useWrapMode) - this.$updateWrapData(startRow, endRow); - else - this.$updateRowLengthCache(startRow, endRow); - } - this.$modified = true; - this._emit("changeFold", { data: fold, action: "remove" }); - }; - - this.removeFolds = function(folds) { - var cloneFolds = []; - for (var i = 0; i < folds.length; i++) { - cloneFolds.push(folds[i]); - } - - cloneFolds.forEach(function(fold) { - this.removeFold(fold); - }, this); - this.$modified = true; - }; - - this.expandFold = function(fold) { - this.removeFold(fold); - fold.subFolds.forEach(function(subFold) { - fold.restoreRange(subFold); - this.addFold(subFold); - }, this); - if (fold.collapseChildren > 0) { - this.foldAll(fold.start.row+1, fold.end.row, fold.collapseChildren-1); - } - fold.subFolds = []; - }; - - this.expandFolds = function(folds) { - folds.forEach(function(fold) { - this.expandFold(fold); - }, this); - }; - - this.unfold = function(location, expandInner) { - var range, folds; - if (location == null) { - range = new Range(0, 0, this.getLength(), 0); - expandInner = true; - } else if (typeof location == "number") - range = new Range(location, 0, location, this.getLine(location).length); - else if ("row" in location) - range = Range.fromPoints(location, location); - else - range = location; - - folds = this.getFoldsInRangeList(range); - if (expandInner) { - this.removeFolds(folds); - } else { - var subFolds = folds; - while (subFolds.length) { - this.expandFolds(subFolds); - subFolds = this.getFoldsInRangeList(range); - } - } - if (folds.length) - return folds; - }; - this.isRowFolded = function(docRow, startFoldRow) { - return !!this.getFoldLine(docRow, startFoldRow); - }; - - this.getRowFoldEnd = function(docRow, startFoldRow) { - var foldLine = this.getFoldLine(docRow, startFoldRow); - return foldLine ? foldLine.end.row : docRow; - }; - - this.getRowFoldStart = function(docRow, startFoldRow) { - var foldLine = this.getFoldLine(docRow, startFoldRow); - return foldLine ? foldLine.start.row : docRow; - }; - - this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) { - if (startRow == null) { - startRow = foldLine.start.row; - startColumn = 0; - } - - if (endRow == null) { - endRow = foldLine.end.row; - endColumn = this.getLine(endRow).length; - } - var doc = this.doc; - var textLine = ""; - - foldLine.walk(function(placeholder, row, column, lastColumn) { - if (row < startRow) - return; - if (row == startRow) { - if (column < startColumn) - return; - lastColumn = Math.max(startColumn, lastColumn); - } - - if (placeholder != null) { - textLine += placeholder; - } else { - textLine += doc.getLine(row).substring(lastColumn, column); - } - }, endRow, endColumn); - return textLine; - }; - - this.getDisplayLine = function(row, endColumn, startRow, startColumn) { - var foldLine = this.getFoldLine(row); - - if (!foldLine) { - var line; - line = this.doc.getLine(row); - return line.substring(startColumn || 0, endColumn || line.length); - } else { - return this.getFoldDisplayLine( - foldLine, row, endColumn, startRow, startColumn); - } - }; - - this.$cloneFoldData = function() { - var fd = []; - fd = this.$foldData.map(function(foldLine) { - var folds = foldLine.folds.map(function(fold) { - return fold.clone(); - }); - return new FoldLine(fd, folds); - }); - - return fd; - }; - - this.toggleFold = function(tryToUnfold) { - var selection = this.selection; - var range = selection.getRange(); - var fold; - var bracketPos; - - if (range.isEmpty()) { - var cursor = range.start; - fold = this.getFoldAt(cursor.row, cursor.column); - - if (fold) { - this.expandFold(fold); - return; - } else if (bracketPos = this.findMatchingBracket(cursor)) { - if (range.comparePoint(bracketPos) == 1) { - range.end = bracketPos; - } else { - range.start = bracketPos; - range.start.column++; - range.end.column--; - } - } else if (bracketPos = this.findMatchingBracket({row: cursor.row, column: cursor.column + 1})) { - if (range.comparePoint(bracketPos) == 1) - range.end = bracketPos; - else - range.start = bracketPos; - - range.start.column++; - } else { - range = this.getCommentFoldRange(cursor.row, cursor.column) || range; - } - } else { - var folds = this.getFoldsInRange(range); - if (tryToUnfold && folds.length) { - this.expandFolds(folds); - return; - } else if (folds.length == 1 ) { - fold = folds[0]; - } - } - - if (!fold) - fold = this.getFoldAt(range.start.row, range.start.column); - - if (fold && fold.range.toString() == range.toString()) { - this.expandFold(fold); - return; - } - - var placeholder = "..."; - if (!range.isMultiLine()) { - placeholder = this.getTextRange(range); - if(placeholder.length < 4) - return; - placeholder = placeholder.trim().substring(0, 2) + ".."; - } - - this.addFold(placeholder, range); - }; - - this.getCommentFoldRange = function(row, column, dir) { - var iterator = new TokenIterator(this, row, column); - var token = iterator.getCurrentToken(); - if (token && /^comment|string/.test(token.type)) { - var range = new Range(); - var re = new RegExp(token.type.replace(/\..*/, "\\.")); - if (dir != 1) { - do { - token = iterator.stepBackward(); - } while(token && re.test(token.type)); - iterator.stepForward(); - } - - range.start.row = iterator.getCurrentTokenRow(); - range.start.column = iterator.getCurrentTokenColumn() + 2; - - iterator = new TokenIterator(this, row, column); - - if (dir != -1) { - do { - token = iterator.stepForward(); - } while(token && re.test(token.type)); - token = iterator.stepBackward(); - } else - token = iterator.getCurrentToken(); - - range.end.row = iterator.getCurrentTokenRow(); - range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 2; - return range; - } - }; - - this.foldAll = function(startRow, endRow, depth) { - if (depth == undefined) - depth = 100000; // JSON.stringify doesn't hanle Infinity - var foldWidgets = this.foldWidgets; - if (!foldWidgets) - return; // mode doesn't support folding - endRow = endRow || this.getLength(); - startRow = startRow || 0; - for (var row = startRow; row < endRow; row++) { - if (foldWidgets[row] == null) - foldWidgets[row] = this.getFoldWidget(row); - if (foldWidgets[row] != "start") - continue; - - var range = this.getFoldWidgetRange(row); - if (range && range.isMultiLine() - && range.end.row <= endRow - && range.start.row >= startRow - ) { - row = range.end.row; - try { - var fold = this.addFold("...", range); - if (fold) - fold.collapseChildren = depth; - } catch(e) {} - } - } - }; - this.$foldStyles = { - "manual": 1, - "markbegin": 1, - "markbeginend": 1 - }; - this.$foldStyle = "markbegin"; - this.setFoldStyle = function(style) { - if (!this.$foldStyles[style]) - throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]"); - - if (this.$foldStyle == style) - return; - - this.$foldStyle = style; - - if (style == "manual") - this.unfold(); - var mode = this.$foldMode; - this.$setFolding(null); - this.$setFolding(mode); - }; - - this.$setFolding = function(foldMode) { - if (this.$foldMode == foldMode) - return; - - this.$foldMode = foldMode; - - this.removeListener('change', this.$updateFoldWidgets); - this._emit("changeAnnotation"); - - if (!foldMode || this.$foldStyle == "manual") { - this.foldWidgets = null; - return; - } - - this.foldWidgets = []; - this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle); - this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle); - - this.$updateFoldWidgets = this.updateFoldWidgets.bind(this); - this.on('change', this.$updateFoldWidgets); - - }; - - this.getParentFoldRangeData = function (row, ignoreCurrent) { - var fw = this.foldWidgets; - if (!fw || (ignoreCurrent && fw[row])) - return {}; - - var i = row - 1, firstRange; - while (i >= 0) { - var c = fw[i]; - if (c == null) - c = fw[i] = this.getFoldWidget(i); - - if (c == "start") { - var range = this.getFoldWidgetRange(i); - if (!firstRange) - firstRange = range; - if (range && range.end.row >= row) - break; - } - i--; - } - - return { - range: i !== -1 && range, - firstRange: firstRange - }; - } - - this.onFoldWidgetClick = function(row, e) { - e = e.domEvent; - var options = { - children: e.shiftKey, - all: e.ctrlKey || e.metaKey, - siblings: e.altKey - }; - - var range = this.$toggleFoldWidget(row, options); - if (!range) { - var el = (e.target || e.srcElement) - if (el && /ace_fold-widget/.test(el.className)) - el.className += " ace_invalid"; - } - }; - - this.$toggleFoldWidget = function(row, options) { - if (!this.getFoldWidget) - return; - var type = this.getFoldWidget(row); - var line = this.getLine(row); - - var dir = type === "end" ? -1 : 1; - var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir); - - if (fold) { - if (options.children || options.all) - this.removeFold(fold); - else - this.expandFold(fold); - return; - } - - var range = this.getFoldWidgetRange(row, true); - if (range && !range.isMultiLine()) { - fold = this.getFoldAt(range.start.row, range.start.column, 1); - if (fold && range.isEqual(fold.range)) { - this.removeFold(fold); - return; - } - } - - if (options.siblings) { - var data = this.getParentFoldRangeData(row); - if (data.range) { - var startRow = data.range.start.row + 1; - var endRow = data.range.end.row; - } - this.foldAll(startRow, endRow, options.all ? 10000 : 0); - } else if (options.children) { - endRow = range ? range.end.row : this.getLength(); - this.foldAll(row + 1, range.end.row, options.all ? 10000 : 0); - } else if (range) { - if (options.all) - range.collapseChildren = 10000; - this.addFold("...", range); - } - - return range; - }; - - - - this.toggleFoldWidget = function(toggleParent) { - var row = this.selection.getCursor().row; - row = this.getRowFoldStart(row); - var range = this.$toggleFoldWidget(row, {}); - - if (range) - return; - var data = this.getParentFoldRangeData(row, true); - range = data.range || data.firstRange; - - if (range) { - row = range.start.row; - var fold = this.getFoldAt(row, this.getLine(row).length, 1); - - if (fold) { - this.removeFold(fold); - } else { - this.addFold("...", range); - } - } - }; - - this.updateFoldWidgets = function(e) { - var delta = e.data; - var range = delta.range; - var firstRow = range.start.row; - var len = range.end.row - firstRow; - - if (len === 0) { - this.foldWidgets[firstRow] = null; - } else if (delta.action == "removeText" || delta.action == "removeLines") { - this.foldWidgets.splice(firstRow, len + 1, null); - } else { - var args = Array(len + 1); - args.unshift(firstRow, 1); - this.foldWidgets.splice.apply(this.foldWidgets, args); - } - }; - -} - -exports.Folding = Folding; - -}); - -ace.define('ace/edit_session/fold_line', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; -function FoldLine(foldData, folds) { - this.foldData = foldData; - if (Array.isArray(folds)) { - this.folds = folds; - } else { - folds = this.folds = [ folds ]; - } - - var last = folds[folds.length - 1] - this.range = new Range(folds[0].start.row, folds[0].start.column, - last.end.row, last.end.column); - this.start = this.range.start; - this.end = this.range.end; - - this.folds.forEach(function(fold) { - fold.setFoldLine(this); - }, this); -} - -(function() { - this.shiftRow = function(shift) { - this.start.row += shift; - this.end.row += shift; - this.folds.forEach(function(fold) { - fold.start.row += shift; - fold.end.row += shift; - }); - } - - this.addFold = function(fold) { - if (fold.sameRow) { - if (fold.start.row < this.startRow || fold.endRow > this.endRow) { - throw new Error("Can't add a fold to this FoldLine as it has no connection"); - } - this.folds.push(fold); - this.folds.sort(function(a, b) { - return -a.range.compareEnd(b.start.row, b.start.column); - }); - if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) { - this.end.row = fold.end.row; - this.end.column = fold.end.column; - } else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) { - this.start.row = fold.start.row; - this.start.column = fold.start.column; - } - } else if (fold.start.row == this.end.row) { - this.folds.push(fold); - this.end.row = fold.end.row; - this.end.column = fold.end.column; - } else if (fold.end.row == this.start.row) { - this.folds.unshift(fold); - this.start.row = fold.start.row; - this.start.column = fold.start.column; - } else { - throw new Error("Trying to add fold to FoldRow that doesn't have a matching row"); - } - fold.foldLine = this; - } - - this.containsRow = function(row) { - return row >= this.start.row && row <= this.end.row; - } - - this.walk = function(callback, endRow, endColumn) { - var lastEnd = 0, - folds = this.folds, - fold, - comp, stop, isNewRow = true; - - if (endRow == null) { - endRow = this.end.row; - endColumn = this.end.column; - } - - for (var i = 0; i < folds.length; i++) { - fold = folds[i]; - - comp = fold.range.compareStart(endRow, endColumn); - if (comp == -1) { - callback(null, endRow, endColumn, lastEnd, isNewRow); - return; - } - - stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow); - stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd); - if (stop || comp == 0) { - return; - } - isNewRow = !fold.sameRow; - lastEnd = fold.end.column; - } - callback(null, endRow, endColumn, lastEnd, isNewRow); - } - - this.getNextFoldTo = function(row, column) { - var fold, cmp; - for (var i = 0; i < this.folds.length; i++) { - fold = this.folds[i]; - cmp = fold.range.compareEnd(row, column); - if (cmp == -1) { - return { - fold: fold, - kind: "after" - }; - } else if (cmp == 0) { - return { - fold: fold, - kind: "inside" - } - } - } - return null; - } - - this.addRemoveChars = function(row, column, len) { - var ret = this.getNextFoldTo(row, column), - fold, folds; - if (ret) { - fold = ret.fold; - if (ret.kind == "inside" - && fold.start.column != column - && fold.start.row != row) - { - window.console && window.console.log(row, column, fold); - } else if (fold.start.row == row) { - folds = this.folds; - var i = folds.indexOf(fold); - if (i == 0) { - this.start.column += len; - } - for (i; i < folds.length; i++) { - fold = folds[i]; - fold.start.column += len; - if (!fold.sameRow) { - return; - } - fold.end.column += len; - } - this.end.column += len; - } - } - } - - this.split = function(row, column) { - var fold = this.getNextFoldTo(row, column).fold; - var folds = this.folds; - var foldData = this.foldData; - - if (!fold) - return null; - - var i = folds.indexOf(fold); - var foldBefore = folds[i - 1]; - this.end.row = foldBefore.end.row; - this.end.column = foldBefore.end.column; - folds = folds.splice(i, folds.length - i); - - var newFoldLine = new FoldLine(foldData, folds); - foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine); - return newFoldLine; - } - - this.merge = function(foldLineNext) { - var folds = foldLineNext.folds; - for (var i = 0; i < folds.length; i++) { - this.addFold(folds[i]); - } - var foldData = this.foldData; - foldData.splice(foldData.indexOf(foldLineNext), 1); - } - - this.toString = function() { - var ret = [this.range.toString() + ": [" ]; - - this.folds.forEach(function(fold) { - ret.push(" " + fold.toString()); - }); - ret.push("]") - return ret.join("\n"); - } - - this.idxToPosition = function(idx) { - var lastFoldEndColumn = 0; - var fold; - - for (var i = 0; i < this.folds.length; i++) { - var fold = this.folds[i]; - - idx -= fold.start.column - lastFoldEndColumn; - if (idx < 0) { - return { - row: fold.start.row, - column: fold.start.column + idx - }; - } - - idx -= fold.placeholder.length; - if (idx < 0) { - return fold.start; - } - - lastFoldEndColumn = fold.end.column; - } - - return { - row: this.end.row, - column: this.end.column + idx - }; - } -}).call(FoldLine.prototype); - -exports.FoldLine = FoldLine; -}); - -ace.define('ace/tokenizer', ['require', 'exports', 'module' ], function(require, exports, module) { -var MAX_TOKEN_COUNT = 1000; -var Tokenizer = function(rules) { - this.states = rules; - - this.regExps = {}; - this.matchMappings = {}; - for (var key in this.states) { - var state = this.states[key]; - var ruleRegExps = []; - var matchTotal = 0; - var mapping = this.matchMappings[key] = {defaultToken: "text"}; - var flag = "g"; - - var splitterRurles = []; - for (var i = 0; i < state.length; i++) { - var rule = state[i]; - if (rule.defaultToken) - mapping.defaultToken = rule.defaultToken; - if (rule.caseInsensitive) - flag = "gi"; - if (rule.regex == null) - continue; - - if (rule.regex instanceof RegExp) - rule.regex = rule.regex.toString().slice(1, -1); - var adjustedregex = rule.regex; - var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; - if (Array.isArray(rule.token)) { - if (rule.token.length == 1 || matchcount == 1) { - rule.token = rule.token[0]; - } else if (matchcount - 1 != rule.token.length) { - throw new Error("number of classes and regexp groups in '" + - rule.token + "'\n'" + rule.regex + "' doesn't match\n" - + (matchcount - 1) + "!=" + rule.token.length); - } else { - rule.tokenArray = rule.token; - rule.token = null; - rule.onMatch = this.$arrayTokens; - } - } else if (typeof rule.token == "function" && !rule.onMatch) { - if (matchcount > 1) - rule.onMatch = this.$applyToken; - else - rule.onMatch = rule.token; - } - - if (matchcount > 1) { - if (/\\\d/.test(rule.regex)) { - adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) { - return "\\" + (parseInt(digit, 10) + matchTotal + 1); - }); - } else { - matchcount = 1; - adjustedregex = this.removeCapturingGroups(rule.regex); - } - if (!rule.splitRegex && typeof rule.token != "string") - splitterRurles.push(rule); // flag will be known only at the very end - } - - mapping[matchTotal] = i; - matchTotal += matchcount; - - ruleRegExps.push(adjustedregex); - if (!rule.onMatch) - rule.onMatch = null; - rule.__proto__ = null; - } - - splitterRurles.forEach(function(rule) { - rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); - }, this); - - this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); - } -}; - -(function() { - this.$setMaxTokenCount = function(m) { - MAX_TOKEN_COUNT = m | 0; - }; - - this.$applyToken = function(str) { - var values = this.splitRegex.exec(str).slice(1); - var types = this.token.apply(this, values); - if (typeof types === "string") - return [{type: types, value: str}]; - - var tokens = []; - for (var i = 0, l = types.length; i < l; i++) { - if (values[i]) - tokens[tokens.length] = { - type: types[i], - value: values[i] - }; - } - return tokens; - }, - - this.$arrayTokens = function(str) { - if (!str) - return []; - var values = this.splitRegex.exec(str); - if (!values) - return "text"; - var tokens = []; - var types = this.tokenArray; - for (var i = 0, l = types.length; i < l; i++) { - if (values[i + 1]) - tokens[tokens.length] = { - type: types[i], - value: values[i + 1] - }; - } - return tokens; - }; - - this.removeCapturingGroups = function(src) { - var r = src.replace( - /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, - function(x, y) {return y ? "(?:" : x;} - ); - return r; - }; - - this.createSplitterRegexp = function(src, flag) { - if (src.indexOf("(?=") != -1) { - var stack = 0; - var inChClass = false; - var lastCapture = {}; - src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function( - m, esc, parenOpen, parenClose, square, index - ) { - if (inChClass) { - inChClass = square != "]"; - } else if (square) { - inChClass = true; - } else if (parenClose) { - if (stack == lastCapture.stack) { - lastCapture.end = index+1; - lastCapture.stack = -1; - } - stack--; - } else if (parenOpen) { - stack++; - if (parenOpen.length != 1) { - lastCapture.stack = stack - lastCapture.start = index; - } - } - return m; - }); - - if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end))) - src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end); - } - return new RegExp(src, (flag||"").replace("g", "")); - }; - this.getLineTokens = function(line, startState) { - if (startState && typeof startState != "string") { - var stack = startState.slice(0); - startState = stack[0]; - } else - var stack = []; - - var currentState = startState || "start"; - var state = this.states[currentState]; - if (!state) { - currentState = "start"; - state = this.states[currentState]; - } - var mapping = this.matchMappings[currentState]; - var re = this.regExps[currentState]; - re.lastIndex = 0; - - var match, tokens = []; - var lastIndex = 0; - - var token = {type: null, value: ""}; - - while (match = re.exec(line)) { - var type = mapping.defaultToken; - var rule = null; - var value = match[0]; - var index = re.lastIndex; - - if (index - value.length > lastIndex) { - var skipped = line.substring(lastIndex, index - value.length); - if (token.type == type) { - token.value += skipped; - } else { - if (token.type) - tokens.push(token); - token = {type: type, value: skipped}; - } - } - - for (var i = 0; i < match.length-2; i++) { - if (match[i + 1] === undefined) - continue; - - rule = state[mapping[i]]; - - if (rule.onMatch) - type = rule.onMatch(value, currentState, stack); - else - type = rule.token; - - if (rule.next) { - if (typeof rule.next == "string") - currentState = rule.next; - else - currentState = rule.next(currentState, stack); - - state = this.states[currentState]; - if (!state) { - window.console && console.error && console.error(currentState, "doesn't exist"); - currentState = "start"; - state = this.states[currentState]; - } - mapping = this.matchMappings[currentState]; - lastIndex = index; - re = this.regExps[currentState]; - re.lastIndex = index; - } - break; - } - - if (value) { - if (typeof type == "string") { - if ((!rule || rule.merge !== false) && token.type === type) { - token.value += value; - } else { - if (token.type) - tokens.push(token); - token = {type: type, value: value}; - } - } else if (type) { - if (token.type) - tokens.push(token); - token = {type: null, value: ""}; - for (var i = 0; i < type.length; i++) - tokens.push(type[i]); - } - } - - if (lastIndex == line.length) - break; - - lastIndex = index; - - if (tokens.length > MAX_TOKEN_COUNT) { - while (lastIndex < line.length) { - if (token.type) - tokens.push(token); - token = { - value: line.substring(lastIndex, lastIndex += 2000), - type: "overflow" - }; - } - currentState = "start"; - stack = []; - break; - } - } - - if (token.type) - tokens.push(token); - - if (stack.length > 1) { - if (stack[0] !== currentState) - stack.unshift(currentState); - } - return { - tokens : tokens, - state : stack.length ? stack : currentState - }; - }; - -}).call(Tokenizer.prototype); - -exports.Tokenizer = Tokenizer; -}); - -ace.define('ace/edit_session/fold', ['require', 'exports', 'module' , 'ace/range', 'ace/range_list', 'ace/lib/oop'], function(require, exports, module) { - - -var Range = require("../range").Range; -var RangeList = require("../range_list").RangeList; -var oop = require("../lib/oop") -var Fold = exports.Fold = function(range, placeholder) { - this.foldLine = null; - this.placeholder = placeholder; - this.range = range; - this.start = range.start; - this.end = range.end; - - this.sameRow = range.start.row == range.end.row; - this.subFolds = this.ranges = []; -}; - -oop.inherits(Fold, RangeList); - -(function() { - - this.toString = function() { - return '"' + this.placeholder + '" ' + this.range.toString(); - }; - - this.setFoldLine = function(foldLine) { - this.foldLine = foldLine; - this.subFolds.forEach(function(fold) { - fold.setFoldLine(foldLine); - }); - }; - - this.clone = function() { - var range = this.range.clone(); - var fold = new Fold(range, this.placeholder); - this.subFolds.forEach(function(subFold) { - fold.subFolds.push(subFold.clone()); - }); - fold.collapseChildren = this.collapseChildren; - return fold; - }; - - this.addSubFold = function(fold) { - if (this.range.isEqual(fold)) - return; - - if (!this.range.containsRange(fold)) - throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); - consumeRange(fold, this.start); - - var row = fold.start.row, column = fold.start.column; - for (var i = 0, cmp = -1; i < this.subFolds.length; i++) { - cmp = this.subFolds[i].range.compare(row, column); - if (cmp != 1) - break; - } - var afterStart = this.subFolds[i]; - - if (cmp == 0) - return afterStart.addSubFold(fold); - var row = fold.range.end.row, column = fold.range.end.column; - for (var j = i, cmp = -1; j < this.subFolds.length; j++) { - cmp = this.subFolds[j].range.compare(row, column); - if (cmp != 1) - break; - } - var afterEnd = this.subFolds[j]; - - if (cmp == 0) - throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); - - var consumedFolds = this.subFolds.splice(i, j - i, fold); - fold.setFoldLine(this.foldLine); - - return fold; - }; - - this.restoreRange = function(range) { - return restoreRange(range, this.start); - }; - -}).call(Fold.prototype); - -function consumePoint(point, anchor) { - point.row -= anchor.row; - if (point.row == 0) - point.column -= anchor.column; -} -function consumeRange(range, anchor) { - consumePoint(range.start, anchor); - consumePoint(range.end, anchor); -} -function restorePoint(point, anchor) { - if (point.row == 0) - point.column += anchor.column; - point.row += anchor.row; -} -function restoreRange(range, anchor) { - restorePoint(range.start, anchor); - restorePoint(range.end, anchor); -} - -}); - -ace.define('ace/mode/text', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/behaviour', 'ace/unicode', 'ace/lib/lang', 'ace/token_iterator', 'ace/range'], function(require, exports, module) { - - -var Tokenizer = require("../tokenizer").Tokenizer; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var Behaviour = require("./behaviour").Behaviour; -var unicode = require("../unicode"); -var lang = require("../lib/lang"); -var TokenIterator = require("../token_iterator").TokenIterator; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = TextHighlightRules; - this.$behaviour = new Behaviour(); -}; - -(function() { - - this.tokenRe = new RegExp("^[" - + unicode.packages.L - + unicode.packages.Mn + unicode.packages.Mc - + unicode.packages.Nd - + unicode.packages.Pc + "\\$_]+", "g" - ); - - this.nonTokenRe = new RegExp("^(?:[^" - + unicode.packages.L - + unicode.packages.Mn + unicode.packages.Mc - + unicode.packages.Nd - + unicode.packages.Pc + "\\$_]|\\s])+", "g" - ); - - this.getTokenizer = function() { - if (!this.$tokenizer) { - this.$highlightRules = new this.HighlightRules(); - this.$tokenizer = new Tokenizer(this.$highlightRules.getRules()); - } - return this.$tokenizer; - }; - - this.lineCommentStart = ""; - this.blockComment = ""; - - this.toggleCommentLines = function(state, session, startRow, endRow) { - var doc = session.doc; - - var ignoreBlankLines = true; - var shouldRemove = true; - var minIndent = Infinity; - var tabSize = session.getTabSize(); - var insertAtTabStop = false; - - if (!this.lineCommentStart) { - if (!this.blockComment) - return false; - var lineCommentStart = this.blockComment.start; - var lineCommentEnd = this.blockComment.end; - var regexpStart = new RegExp("^(\\s*)(?:" + lang.escapeRegExp(lineCommentStart) + ")"); - var regexpEnd = new RegExp("(?:" + lang.escapeRegExp(lineCommentEnd) + ")\\s*$"); - - var comment = function(line, i) { - if (testRemove(line, i)) - return; - if (!ignoreBlankLines || /\S/.test(line)) { - doc.insertInLine({row: i, column: line.length}, lineCommentEnd); - doc.insertInLine({row: i, column: minIndent}, lineCommentStart); - } - }; - - var uncomment = function(line, i) { - var m; - if (m = line.match(regexpEnd)) - doc.removeInLine(i, line.length - m[0].length, line.length); - if (m = line.match(regexpStart)) - doc.removeInLine(i, m[1].length, m[0].length); - }; - - var testRemove = function(line, row) { - if (regexpStart.test(line)) - return true; - var tokens = session.getTokens(row); - for (var i = 0; i < tokens.length; i++) { - if (tokens[i].type === 'comment') - return true; - } - }; - } else { - if (Array.isArray(this.lineCommentStart)) { - var regexpStart = this.lineCommentStart.map(lang.escapeRegExp).join("|"); - var lineCommentStart = this.lineCommentStart[0]; - } else { - var regexpStart = lang.escapeRegExp(this.lineCommentStart); - var lineCommentStart = this.lineCommentStart; - } - regexpStart = new RegExp("^(\\s*)(?:" + regexpStart + ") ?"); - - insertAtTabStop = session.getUseSoftTabs(); - - var uncomment = function(line, i) { - var m = line.match(regexpStart); - if (!m) return; - var start = m[1].length, end = m[0].length; - if (!shouldInsertSpace(line, start, end) && m[0][end - 1] == " ") - end--; - doc.removeInLine(i, start, end); - }; - var commentWithSpace = lineCommentStart + " "; - var comment = function(line, i) { - if (!ignoreBlankLines || /\S/.test(line)) { - if (shouldInsertSpace(line, minIndent, minIndent)) - doc.insertInLine({row: i, column: minIndent}, commentWithSpace); - else - doc.insertInLine({row: i, column: minIndent}, lineCommentStart); - } - }; - var testRemove = function(line, i) { - return regexpStart.test(line); - }; - - var shouldInsertSpace = function(line, before, after) { - var spaces = 0; - while (before-- && line.charAt(before) == " ") - spaces++; - if (spaces % tabSize != 0) - return false; - var spaces = 0; - while (line.charAt(after++) == " ") - spaces++; - if (tabSize > 2) - return spaces % tabSize != tabSize - 1; - else - return spaces % tabSize == 0; - return true; - }; - } - - function iter(fun) { - for (var i = startRow; i <= endRow; i++) - fun(doc.getLine(i), i); - } - - - var minEmptyLength = Infinity; - iter(function(line, i) { - var indent = line.search(/\S/); - if (indent !== -1) { - if (indent < minIndent) - minIndent = indent; - if (shouldRemove && !testRemove(line, i)) - shouldRemove = false; - } else if (minEmptyLength > line.length) { - minEmptyLength = line.length; - } - }); - - if (minIndent == Infinity) { - minIndent = minEmptyLength; - ignoreBlankLines = false; - shouldRemove = false; - } - - if (insertAtTabStop && minIndent % tabSize != 0) - minIndent = Math.floor(minIndent / tabSize) * tabSize; - - iter(shouldRemove ? uncomment : comment); - }; - - this.toggleBlockComment = function(state, session, range, cursor) { - var comment = this.blockComment; - if (!comment) - return; - if (!comment.start && comment[0]) - comment = comment[0]; - - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - - var sel = session.selection; - var initialRange = session.selection.toOrientedRange(); - var startRow, colDiff; - - if (token && /comment/.test(token.type)) { - var startRange, endRange; - while (token && /comment/.test(token.type)) { - var i = token.value.indexOf(comment.start); - if (i != -1) { - var row = iterator.getCurrentTokenRow(); - var column = iterator.getCurrentTokenColumn() + i; - startRange = new Range(row, column, row, column + comment.start.length); - break; - } - token = iterator.stepBackward(); - } - - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - while (token && /comment/.test(token.type)) { - var i = token.value.indexOf(comment.end); - if (i != -1) { - var row = iterator.getCurrentTokenRow(); - var column = iterator.getCurrentTokenColumn() + i; - endRange = new Range(row, column, row, column + comment.end.length); - break; - } - token = iterator.stepForward(); - } - if (endRange) - session.remove(endRange); - if (startRange) { - session.remove(startRange); - startRow = startRange.start.row; - colDiff = -comment.start.length; - } - } else { - colDiff = comment.start.length; - startRow = range.start.row; - session.insert(range.end, comment.end); - session.insert(range.start, comment.start); - } - if (initialRange.start.row == startRow) - initialRange.start.column += colDiff; - if (initialRange.end.row == startRow) - initialRange.end.column += colDiff; - session.selection.fromOrientedRange(initialRange); - }; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.autoOutdent = function(state, doc, row) { - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - - this.createWorker = function(session) { - return null; - }; - - this.createModeDelegates = function (mapping) { - this.$embeds = []; - this.$modes = {}; - for (var i in mapping) { - if (mapping[i]) { - this.$embeds.push(i); - this.$modes[i] = new mapping[i](); - } - } - - var delegations = ['toggleBlockComment', 'toggleCommentLines', 'getNextLineIndent', - 'checkOutdent', 'autoOutdent', 'transformAction', 'getCompletions']; - - for (var i = 0; i < delegations.length; i++) { - (function(scope) { - var functionName = delegations[i]; - var defaultHandler = scope[functionName]; - scope[delegations[i]] = function() { - return this.$delegator(functionName, arguments, defaultHandler); - }; - } (this)); - } - }; - - this.$delegator = function(method, args, defaultHandler) { - var state = args[0]; - if (typeof state != "string") - state = state[0]; - for (var i = 0; i < this.$embeds.length; i++) { - if (!this.$modes[this.$embeds[i]]) continue; - - var split = state.split(this.$embeds[i]); - if (!split[0] && split[1]) { - args[0] = split[1]; - var mode = this.$modes[this.$embeds[i]]; - return mode[method].apply(mode, args); - } - } - var ret = defaultHandler.apply(this, args); - return defaultHandler ? ret : undefined; - }; - - this.transformAction = function(state, action, editor, session, param) { - if (this.$behaviour) { - var behaviours = this.$behaviour.getBehaviours(); - for (var key in behaviours) { - if (behaviours[key][action]) { - var ret = behaviours[key][action].apply(this, arguments); - if (ret) { - return ret; - } - } - } - } - }; - - this.getKeywords = function(append) { - if (!this.completionKeywords) { - var rules = this.$tokenizer.rules; - var completionKeywords = []; - for (var rule in rules) { - var ruleItr = rules[rule]; - for (var r = 0, l = ruleItr.length; r < l; r++) { - if (typeof ruleItr[r].token === "string") { - if (/keyword|support|storage/.test(ruleItr[r].token)) - completionKeywords.push(ruleItr[r].regex); - } - else if (typeof ruleItr[r].token === "object") { - for (var a = 0, aLength = ruleItr[r].token.length; a < aLength; a++) { - if (/keyword|support|storage/.test(ruleItr[r].token[a])) { - var rule = ruleItr[r].regex.match(/\(.+?\)/g)[a]; - completionKeywords.push(rule.substr(1, rule.length - 2)); - } - } - } - } - } - this.completionKeywords = completionKeywords; - } - if (!append) - return this.$keywordList; - return completionKeywords.concat(this.$keywordList || []); - }; - - this.$createKeywordList = function() { - if (!this.$highlightRules) - this.getTokenizer(); - return this.$keywordList = this.$highlightRules.$keywordList || []; - }; - - this.getCompletions = function(state, session, pos, prefix) { - var keywords = this.$keywordList || this.$createKeywordList(); - return keywords.map(function(word) { - return { - name: word, - value: word, - score: 0, - meta: "keyword" - }; - }); - }; - - this.$id = "ace/mode/text"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/range_list', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - -var Range = require("./range").Range; -var comparePoints = Range.comparePoints; - -var RangeList = function() { - this.ranges = []; -}; - -(function() { - this.comparePoints = comparePoints; - - this.pointIndex = function(pos, excludeEdges, startIndex) { - var list = this.ranges; - - for (var i = startIndex || 0; i < list.length; i++) { - var range = list[i]; - var cmpEnd = comparePoints(pos, range.end); - if (cmpEnd > 0) - continue; - var cmpStart = comparePoints(pos, range.start); - if (cmpEnd === 0) - return excludeEdges && cmpStart !== 0 ? -i-2 : i; - if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges)) - return i; - - return -i-1; - } - return -i - 1; - }; - - this.add = function(range) { - var excludeEdges = !range.isEmpty(); - var startIndex = this.pointIndex(range.start, excludeEdges); - if (startIndex < 0) - startIndex = -startIndex - 1; - - var endIndex = this.pointIndex(range.end, excludeEdges, startIndex); - - if (endIndex < 0) - endIndex = -endIndex - 1; - else - endIndex++; - return this.ranges.splice(startIndex, endIndex - startIndex, range); - }; - - this.addList = function(list) { - var removed = []; - for (var i = list.length; i--; ) { - removed.push.call(removed, this.add(list[i])); - } - return removed; - }; - - this.substractPoint = function(pos) { - var i = this.pointIndex(pos); - - if (i >= 0) - return this.ranges.splice(i, 1); - }; - this.merge = function() { - var removed = []; - var list = this.ranges; - - list = list.sort(function(a, b) { - return comparePoints(a.start, b.start); - }); - - var next = list[0], range; - for (var i = 1; i < list.length; i++) { - range = next; - next = list[i]; - var cmp = comparePoints(range.end, next.start); - if (cmp < 0) - continue; - - if (cmp == 0 && !range.isEmpty() && !next.isEmpty()) - continue; - - if (comparePoints(range.end, next.end) < 0) { - range.end.row = next.end.row; - range.end.column = next.end.column; - } - - list.splice(i, 1); - removed.push(next); - next = range; - i--; - } - - this.ranges = list; - - return removed; - }; - - this.contains = function(row, column) { - return this.pointIndex({row: row, column: column}) >= 0; - }; - - this.containsPoint = function(pos) { - return this.pointIndex(pos) >= 0; - }; - - this.rangeAtPoint = function(pos) { - var i = this.pointIndex(pos); - if (i >= 0) - return this.ranges[i]; - }; - - - this.clipRows = function(startRow, endRow) { - var list = this.ranges; - if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow) - return []; - - var startIndex = this.pointIndex({row: startRow, column: 0}); - if (startIndex < 0) - startIndex = -startIndex - 1; - var endIndex = this.pointIndex({row: endRow, column: 0}, startIndex); - if (endIndex < 0) - endIndex = -endIndex - 1; - - var clipped = []; - for (var i = startIndex; i < endIndex; i++) { - clipped.push(list[i]); - } - return clipped; - }; - - this.removeAll = function() { - return this.ranges.splice(0, this.ranges.length); - }; - - this.attach = function(session) { - if (this.session) - this.detach(); - - this.session = session; - this.onChange = this.$onChange.bind(this); - - this.session.on('change', this.onChange); - }; - - this.detach = function() { - if (!this.session) - return; - this.session.removeListener('change', this.onChange); - this.session = null; - }; - - this.$onChange = function(e) { - var changeRange = e.data.range; - if (e.data.action[0] == "i"){ - var start = changeRange.start; - var end = changeRange.end; - } else { - var end = changeRange.start; - var start = changeRange.end; - } - var startRow = start.row; - var endRow = end.row; - var lineDif = endRow - startRow; - - var colDiff = -start.column + end.column; - var ranges = this.ranges; - - for (var i = 0, n = ranges.length; i < n; i++) { - var r = ranges[i]; - if (r.end.row < startRow) - continue; - if (r.start.row > startRow) - break; - - if (r.start.row == startRow && r.start.column >= start.column ) { - if (r.start.column == start.column && this.$insertRight) { - } else { - r.start.column += colDiff; - r.start.row += lineDif; - } - } - if (r.end.row == startRow && r.end.column >= start.column) { - if (r.end.column == start.column && this.$insertRight) { - continue; - } - if (r.end.column == start.column && colDiff > 0 && i < n - 1) { - if (r.end.column > r.start.column && r.end.column == ranges[i+1].start.column) - r.end.column -= colDiff; - } - r.end.column += colDiff; - r.end.row += lineDif; - } - } - - if (lineDif != 0 && i < n) { - for (; i < n; i++) { - var r = ranges[i]; - r.start.row += lineDif; - r.end.row += lineDif; - } - } - }; - -}).call(RangeList.prototype); - -exports.RangeList = RangeList; -}); - -ace.define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) { - -var comparePoints = function(p1, p2) { - return p1.row - p2.row || p1.column - p2.column; -}; -var Range = function(startRow, startColumn, endRow, endColumn) { - this.start = { - row: startRow, - column: startColumn - }; - - this.end = { - row: endRow, - column: endColumn - }; -}; - -(function() { - this.isEqual = function(range) { - return this.start.row === range.start.row && - this.end.row === range.end.row && - this.start.column === range.start.column && - this.end.column === range.end.column; - }; - this.toString = function() { - return ("Range: [" + this.start.row + "/" + this.start.column + - "] -> [" + this.end.row + "/" + this.end.column + "]"); - }; - - this.contains = function(row, column) { - return this.compare(row, column) == 0; - }; - this.compareRange = function(range) { - var cmp, - end = range.end, - start = range.start; - - cmp = this.compare(end.row, end.column); - if (cmp == 1) { - cmp = this.compare(start.row, start.column); - if (cmp == 1) { - return 2; - } else if (cmp == 0) { - return 1; - } else { - return 0; - } - } else if (cmp == -1) { - return -2; - } else { - cmp = this.compare(start.row, start.column); - if (cmp == -1) { - return -1; - } else if (cmp == 1) { - return 42; - } else { - return 0; - } - } - }; - this.comparePoint = function(p) { - return this.compare(p.row, p.column); - }; - this.containsRange = function(range) { - return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; - }; - this.intersects = function(range) { - var cmp = this.compareRange(range); - return (cmp == -1 || cmp == 0 || cmp == 1); - }; - this.isEnd = function(row, column) { - return this.end.row == row && this.end.column == column; - }; - this.isStart = function(row, column) { - return this.start.row == row && this.start.column == column; - }; - this.setStart = function(row, column) { - if (typeof row == "object") { - this.start.column = row.column; - this.start.row = row.row; - } else { - this.start.row = row; - this.start.column = column; - } - }; - this.setEnd = function(row, column) { - if (typeof row == "object") { - this.end.column = row.column; - this.end.row = row.row; - } else { - this.end.row = row; - this.end.column = column; - } - }; - this.inside = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column) || this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - }; - this.insideStart = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column)) { - return false; - } else { - return true; - } - } - return false; - }; - this.insideEnd = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - }; - this.compare = function(row, column) { - if (!this.isMultiLine()) { - if (row === this.start.row) { - return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); - }; - } - - if (row < this.start.row) - return -1; - - if (row > this.end.row) - return 1; - - if (this.start.row === row) - return column >= this.start.column ? 0 : -1; - - if (this.end.row === row) - return column <= this.end.column ? 0 : 1; - - return 0; - }; - this.compareStart = function(row, column) { - if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - }; - this.compareEnd = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else { - return this.compare(row, column); - } - }; - this.compareInside = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - }; - this.clipRows = function(firstRow, lastRow) { - if (this.end.row > lastRow) - var end = {row: lastRow + 1, column: 0}; - else if (this.end.row < firstRow) - var end = {row: firstRow, column: 0}; - - if (this.start.row > lastRow) - var start = {row: lastRow + 1, column: 0}; - else if (this.start.row < firstRow) - var start = {row: firstRow, column: 0}; - - return Range.fromPoints(start || this.start, end || this.end); - }; - this.extend = function(row, column) { - var cmp = this.compare(row, column); - - if (cmp == 0) - return this; - else if (cmp == -1) - var start = {row: row, column: column}; - else - var end = {row: row, column: column}; - - return Range.fromPoints(start || this.start, end || this.end); - }; - - this.isEmpty = function() { - return (this.start.row === this.end.row && this.start.column === this.end.column); - }; - this.isMultiLine = function() { - return (this.start.row !== this.end.row); - }; - this.clone = function() { - return Range.fromPoints(this.start, this.end); - }; - this.collapseRows = function() { - if (this.end.column == 0) - return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) - else - return new Range(this.start.row, 0, this.end.row, 0) - }; - this.toScreenRange = function(session) { - var screenPosStart = session.documentToScreenPosition(this.start); - var screenPosEnd = session.documentToScreenPosition(this.end); - - return new Range( - screenPosStart.row, screenPosStart.column, - screenPosEnd.row, screenPosEnd.column - ); - }; - this.moveBy = function(row, column) { - this.start.row += row; - this.start.column += column; - this.end.row += row; - this.end.column += column; - }; - -}).call(Range.prototype); -Range.fromPoints = function(start, end) { - return new Range(start.row, start.column, end.row, end.column); -}; -Range.comparePoints = comparePoints; - -Range.comparePoints = function(p1, p2) { - return p1.row - p2.row || p1.column - p2.column; -}; - - -exports.Range = Range; -}); - -ace.define('ace/edit_session/bracket_match', ['require', 'exports', 'module' , 'ace/token_iterator', 'ace/range'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; -var Range = require("../range").Range; - - -function BracketMatch() { - - this.findMatchingBracket = function(position, chr) { - if (position.column == 0) return null; - - var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column-1); - if (charBeforeCursor == "") return null; - - var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/); - if (!match) - return null; - - if (match[1]) - return this.$findClosingBracket(match[1], position); - else - return this.$findOpeningBracket(match[2], position); - }; - - this.getBracketRange = function(pos) { - var line = this.getLine(pos.row); - var before = true, range; - - var chr = line.charAt(pos.column-1); - var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); - if (!match) { - chr = line.charAt(pos.column); - pos = {row: pos.row, column: pos.column + 1}; - match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); - before = false; - } - if (!match) - return null; - - if (match[1]) { - var bracketPos = this.$findClosingBracket(match[1], pos); - if (!bracketPos) - return null; - range = Range.fromPoints(pos, bracketPos); - if (!before) { - range.end.column++; - range.start.column--; - } - range.cursor = range.end; - } else { - var bracketPos = this.$findOpeningBracket(match[2], pos); - if (!bracketPos) - return null; - range = Range.fromPoints(bracketPos, pos); - if (!before) { - range.start.column++; - range.end.column--; - } - range.cursor = range.start; - } - - return range; - }; - - this.$brackets = { - ")": "(", - "(": ")", - "]": "[", - "[": "]", - "{": "}", - "}": "{" - }; - - this.$findOpeningBracket = function(bracket, position, typeRe) { - var openBracket = this.$brackets[bracket]; - var depth = 1; - - var iterator = new TokenIterator(this, position.row, position.column); - var token = iterator.getCurrentToken(); - if (!token) - token = iterator.stepForward(); - if (!token) - return; - - if (!typeRe){ - typeRe = new RegExp( - "(\\.?" + - token.type.replace(".", "\\.").replace("rparen", ".paren") - + ")+" - ); - } - var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2; - var value = token.value; - - while (true) { - - while (valueIndex >= 0) { - var chr = value.charAt(valueIndex); - if (chr == openBracket) { - depth -= 1; - if (depth == 0) { - return {row: iterator.getCurrentTokenRow(), - column: valueIndex + iterator.getCurrentTokenColumn()}; - } - } - else if (chr == bracket) { - depth += 1; - } - valueIndex -= 1; - } - do { - token = iterator.stepBackward(); - } while (token && !typeRe.test(token.type)); - - if (token == null) - break; - - value = token.value; - valueIndex = value.length - 1; - } - - return null; - }; - - this.$findClosingBracket = function(bracket, position, typeRe) { - var closingBracket = this.$brackets[bracket]; - var depth = 1; - - var iterator = new TokenIterator(this, position.row, position.column); - var token = iterator.getCurrentToken(); - if (!token) - token = iterator.stepForward(); - if (!token) - return; - - if (!typeRe){ - typeRe = new RegExp( - "(\\.?" + - token.type.replace(".", "\\.").replace("lparen", ".paren") - + ")+" - ); - } - var valueIndex = position.column - iterator.getCurrentTokenColumn(); - - while (true) { - - var value = token.value; - var valueLength = value.length; - while (valueIndex < valueLength) { - var chr = value.charAt(valueIndex); - if (chr == closingBracket) { - depth -= 1; - if (depth == 0) { - return {row: iterator.getCurrentTokenRow(), - column: valueIndex + iterator.getCurrentTokenColumn()}; - } - } - else if (chr == bracket) { - depth += 1; - } - valueIndex += 1; - } - do { - token = iterator.stepForward(); - } while (token && !typeRe.test(token.type)); - - if (token == null) - break; - - valueIndex = 0; - } - - return null; - }; -} -exports.BracketMatch = BracketMatch; - -}); - -ace.define('ace/selection', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/lib/event_emitter', 'ace/range'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var lang = require("./lib/lang"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var Range = require("./range").Range; -var Selection = function(session) { - this.session = session; - this.doc = session.getDocument(); - - this.clearSelection(); - this.lead = this.selectionLead = this.doc.createAnchor(0, 0); - this.anchor = this.selectionAnchor = this.doc.createAnchor(0, 0); - - var self = this; - this.lead.on("change", function(e) { - self._emit("changeCursor"); - if (!self.$isEmpty) - self._emit("changeSelection"); - if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column) - self.$desiredColumn = null; - }); - - this.selectionAnchor.on("change", function() { - if (!self.$isEmpty) - self._emit("changeSelection"); - }); -}; - -(function() { - - oop.implement(this, EventEmitter); - this.isEmpty = function() { - return (this.$isEmpty || ( - this.anchor.row == this.lead.row && - this.anchor.column == this.lead.column - )); - }; - this.isMultiLine = function() { - if (this.isEmpty()) { - return false; - } - - return this.getRange().isMultiLine(); - }; - this.getCursor = function() { - return this.lead.getPosition(); - }; - this.setSelectionAnchor = function(row, column) { - this.anchor.setPosition(row, column); - - if (this.$isEmpty) { - this.$isEmpty = false; - this._emit("changeSelection"); - } - }; - this.getSelectionAnchor = function() { - if (this.$isEmpty) - return this.getSelectionLead() - else - return this.anchor.getPosition(); - }; - this.getSelectionLead = function() { - return this.lead.getPosition(); - }; - this.shiftSelection = function(columns) { - if (this.$isEmpty) { - this.moveCursorTo(this.lead.row, this.lead.column + columns); - return; - }; - - var anchor = this.getSelectionAnchor(); - var lead = this.getSelectionLead(); - - var isBackwards = this.isBackwards(); - - if (!isBackwards || anchor.column !== 0) - this.setSelectionAnchor(anchor.row, anchor.column + columns); - - if (isBackwards || lead.column !== 0) { - this.$moveSelection(function() { - this.moveCursorTo(lead.row, lead.column + columns); - }); - } - }; - this.isBackwards = function() { - var anchor = this.anchor; - var lead = this.lead; - return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column)); - }; - this.getRange = function() { - var anchor = this.anchor; - var lead = this.lead; - - if (this.isEmpty()) - return Range.fromPoints(lead, lead); - - if (this.isBackwards()) { - return Range.fromPoints(lead, anchor); - } - else { - return Range.fromPoints(anchor, lead); - } - }; - this.clearSelection = function() { - if (!this.$isEmpty) { - this.$isEmpty = true; - this._emit("changeSelection"); - } - }; - this.selectAll = function() { - var lastRow = this.doc.getLength() - 1; - this.setSelectionAnchor(0, 0); - this.moveCursorTo(lastRow, this.doc.getLine(lastRow).length); - }; - this.setRange = - this.setSelectionRange = function(range, reverse) { - if (reverse) { - this.setSelectionAnchor(range.end.row, range.end.column); - this.selectTo(range.start.row, range.start.column); - } else { - this.setSelectionAnchor(range.start.row, range.start.column); - this.selectTo(range.end.row, range.end.column); - } - if (this.getRange().isEmpty()) - this.$isEmpty = true; - this.$desiredColumn = null; - }; - - this.$moveSelection = function(mover) { - var lead = this.lead; - if (this.$isEmpty) - this.setSelectionAnchor(lead.row, lead.column); - - mover.call(this); - }; - this.selectTo = function(row, column) { - this.$moveSelection(function() { - this.moveCursorTo(row, column); - }); - }; - this.selectToPosition = function(pos) { - this.$moveSelection(function() { - this.moveCursorToPosition(pos); - }); - }; - this.moveTo = function(row, column) { - this.clearSelection(); - this.moveCursorTo(row, column); - }; - this.moveToPosition = function(pos) { - this.clearSelection(); - this.moveCursorToPosition(pos); - }; - this.selectUp = function() { - this.$moveSelection(this.moveCursorUp); - }; - this.selectDown = function() { - this.$moveSelection(this.moveCursorDown); - }; - this.selectRight = function() { - this.$moveSelection(this.moveCursorRight); - }; - this.selectLeft = function() { - this.$moveSelection(this.moveCursorLeft); - }; - this.selectLineStart = function() { - this.$moveSelection(this.moveCursorLineStart); - }; - this.selectLineEnd = function() { - this.$moveSelection(this.moveCursorLineEnd); - }; - this.selectFileEnd = function() { - this.$moveSelection(this.moveCursorFileEnd); - }; - this.selectFileStart = function() { - this.$moveSelection(this.moveCursorFileStart); - }; - this.selectWordRight = function() { - this.$moveSelection(this.moveCursorWordRight); - }; - this.selectWordLeft = function() { - this.$moveSelection(this.moveCursorWordLeft); - }; - this.getWordRange = function(row, column) { - if (typeof column == "undefined") { - var cursor = row || this.lead; - row = cursor.row; - column = cursor.column; - } - return this.session.getWordRange(row, column); - }; - this.selectWord = function() { - this.setSelectionRange(this.getWordRange()); - }; - this.selectAWord = function() { - var cursor = this.getCursor(); - var range = this.session.getAWordRange(cursor.row, cursor.column); - this.setSelectionRange(range); - }; - - this.getLineRange = function(row, excludeLastChar) { - var rowStart = typeof row == "number" ? row : this.lead.row; - var rowEnd; - - var foldLine = this.session.getFoldLine(rowStart); - if (foldLine) { - rowStart = foldLine.start.row; - rowEnd = foldLine.end.row; - } else { - rowEnd = rowStart; - } - if (excludeLastChar === true) - return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length); - else - return new Range(rowStart, 0, rowEnd + 1, 0); - }; - this.selectLine = function() { - this.setSelectionRange(this.getLineRange()); - }; - this.moveCursorUp = function() { - this.moveCursorBy(-1, 0); - }; - this.moveCursorDown = function() { - this.moveCursorBy(1, 0); - }; - this.moveCursorLeft = function() { - var cursor = this.lead.getPosition(), - fold; - - if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) { - this.moveCursorTo(fold.start.row, fold.start.column); - } else if (cursor.column == 0) { - if (cursor.row > 0) { - this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length); - } - } - else { - var tabSize = this.session.getTabSize(); - if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column-tabSize, cursor.column).split(" ").length-1 == tabSize) - this.moveCursorBy(0, -tabSize); - else - this.moveCursorBy(0, -1); - } - }; - this.moveCursorRight = function() { - var cursor = this.lead.getPosition(), - fold; - if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) { - this.moveCursorTo(fold.end.row, fold.end.column); - } - else if (this.lead.column == this.doc.getLine(this.lead.row).length) { - if (this.lead.row < this.doc.getLength() - 1) { - this.moveCursorTo(this.lead.row + 1, 0); - } - } - else { - var tabSize = this.session.getTabSize(); - var cursor = this.lead; - if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column, cursor.column+tabSize).split(" ").length-1 == tabSize) - this.moveCursorBy(0, tabSize); - else - this.moveCursorBy(0, 1); - } - }; - this.moveCursorLineStart = function() { - var row = this.lead.row; - var column = this.lead.column; - var screenRow = this.session.documentToScreenRow(row, column); - var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0); - var beforeCursor = this.session.getDisplayLine( - row, null, firstColumnPosition.row, - firstColumnPosition.column - ); - - var leadingSpace = beforeCursor.match(/^\s*/); - if (leadingSpace[0].length != column && !this.session.$useEmacsStyleLineStart) - firstColumnPosition.column += leadingSpace[0].length; - this.moveCursorToPosition(firstColumnPosition); - }; - this.moveCursorLineEnd = function() { - var lead = this.lead; - var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column); - if (this.lead.column == lineEnd.column) { - var line = this.session.getLine(lineEnd.row); - if (lineEnd.column == line.length) { - var textEnd = line.search(/\s+$/); - if (textEnd > 0) - lineEnd.column = textEnd; - } - } - - this.moveCursorTo(lineEnd.row, lineEnd.column); - }; - this.moveCursorFileEnd = function() { - var row = this.doc.getLength() - 1; - var column = this.doc.getLine(row).length; - this.moveCursorTo(row, column); - }; - this.moveCursorFileStart = function() { - this.moveCursorTo(0, 0); - }; - this.moveCursorLongWordRight = function() { - var row = this.lead.row; - var column = this.lead.column; - var line = this.doc.getLine(row); - var rightOfCursor = line.substring(column); - - var match; - this.session.nonTokenRe.lastIndex = 0; - this.session.tokenRe.lastIndex = 0; - var fold = this.session.getFoldAt(row, column, 1); - if (fold) { - this.moveCursorTo(fold.end.row, fold.end.column); - return; - } - if (match = this.session.nonTokenRe.exec(rightOfCursor)) { - column += this.session.nonTokenRe.lastIndex; - this.session.nonTokenRe.lastIndex = 0; - rightOfCursor = line.substring(column); - } - if (column >= line.length) { - this.moveCursorTo(row, line.length); - this.moveCursorRight(); - if (row < this.doc.getLength() - 1) - this.moveCursorWordRight(); - return; - } - if (match = this.session.tokenRe.exec(rightOfCursor)) { - column += this.session.tokenRe.lastIndex; - this.session.tokenRe.lastIndex = 0; - } - - this.moveCursorTo(row, column); - }; - this.moveCursorLongWordLeft = function() { - var row = this.lead.row; - var column = this.lead.column; - var fold; - if (fold = this.session.getFoldAt(row, column, -1)) { - this.moveCursorTo(fold.start.row, fold.start.column); - return; - } - - var str = this.session.getFoldStringAt(row, column, -1); - if (str == null) { - str = this.doc.getLine(row).substring(0, column) - } - - var leftOfCursor = lang.stringReverse(str); - var match; - this.session.nonTokenRe.lastIndex = 0; - this.session.tokenRe.lastIndex = 0; - if (match = this.session.nonTokenRe.exec(leftOfCursor)) { - column -= this.session.nonTokenRe.lastIndex; - leftOfCursor = leftOfCursor.slice(this.session.nonTokenRe.lastIndex); - this.session.nonTokenRe.lastIndex = 0; - } - if (column <= 0) { - this.moveCursorTo(row, 0); - this.moveCursorLeft(); - if (row > 0) - this.moveCursorWordLeft(); - return; - } - if (match = this.session.tokenRe.exec(leftOfCursor)) { - column -= this.session.tokenRe.lastIndex; - this.session.tokenRe.lastIndex = 0; - } - - this.moveCursorTo(row, column); - }; - - this.$shortWordEndIndex = function(rightOfCursor) { - var match, index = 0, ch; - var whitespaceRe = /\s/; - var tokenRe = this.session.tokenRe; - - tokenRe.lastIndex = 0; - if (match = this.session.tokenRe.exec(rightOfCursor)) { - index = this.session.tokenRe.lastIndex; - } else { - while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) - index ++; - - if (index < 1) { - tokenRe.lastIndex = 0; - while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { - tokenRe.lastIndex = 0; - index ++; - if (whitespaceRe.test(ch)) { - if (index > 2) { - index-- - break; - } else { - while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) - index ++; - if (index > 2) - break - } - } - } - } - } - tokenRe.lastIndex = 0; - - return index; - }; - - this.moveCursorShortWordRight = function() { - var row = this.lead.row; - var column = this.lead.column; - var line = this.doc.getLine(row); - var rightOfCursor = line.substring(column); - - var fold = this.session.getFoldAt(row, column, 1); - if (fold) - return this.moveCursorTo(fold.end.row, fold.end.column); - - if (column == line.length) { - var l = this.doc.getLength(); - do { - row++; - rightOfCursor = this.doc.getLine(row) - } while (row < l && /^\s*$/.test(rightOfCursor)) - - if (!/^\s+/.test(rightOfCursor)) - rightOfCursor = "" - column = 0; - } - - var index = this.$shortWordEndIndex(rightOfCursor); - - this.moveCursorTo(row, column + index); - }; - - this.moveCursorShortWordLeft = function() { - var row = this.lead.row; - var column = this.lead.column; - - var fold; - if (fold = this.session.getFoldAt(row, column, -1)) - return this.moveCursorTo(fold.start.row, fold.start.column); - - var line = this.session.getLine(row).substring(0, column); - if (column == 0) { - do { - row--; - line = this.doc.getLine(row); - } while (row > 0 && /^\s*$/.test(line)) - - column = line.length; - if (!/\s+$/.test(line)) - line = "" - } - - var leftOfCursor = lang.stringReverse(line); - var index = this.$shortWordEndIndex(leftOfCursor); - - return this.moveCursorTo(row, column - index); - }; - - this.moveCursorWordRight = function() { - if (this.session.$selectLongWords) - this.moveCursorLongWordRight(); - else - this.moveCursorShortWordRight(); - }; - - this.moveCursorWordLeft = function() { - if (this.session.$selectLongWords) - this.moveCursorLongWordLeft(); - else - this.moveCursorShortWordLeft(); - }; - this.moveCursorBy = function(rows, chars) { - var screenPos = this.session.documentToScreenPosition( - this.lead.row, - this.lead.column - ); - - if (chars === 0) { - if (this.$desiredColumn) - screenPos.column = this.$desiredColumn; - else - this.$desiredColumn = screenPos.column; - } - - var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column); - - if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) { - if (this.session.lineWidgets && this.session.lineWidgets[docPos.row]) - docPos.row++; - } - this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0); - }; - this.moveCursorToPosition = function(position) { - this.moveCursorTo(position.row, position.column); - }; - this.moveCursorTo = function(row, column, keepDesiredColumn) { - var fold = this.session.getFoldAt(row, column, 1); - if (fold) { - row = fold.start.row; - column = fold.start.column; - } - - this.$keepDesiredColumnOnChange = true; - this.lead.setPosition(row, column); - this.$keepDesiredColumnOnChange = false; - - if (!keepDesiredColumn) - this.$desiredColumn = null; - }; - this.moveCursorToScreen = function(row, column, keepDesiredColumn) { - var pos = this.session.screenToDocumentPosition(row, column); - this.moveCursorTo(pos.row, pos.column, keepDesiredColumn); - }; - this.detach = function() { - this.lead.detach(); - this.anchor.detach(); - this.session = this.doc = null; - } - - this.fromOrientedRange = function(range) { - this.setSelectionRange(range, range.cursor == range.start); - this.$desiredColumn = range.desiredColumn || this.$desiredColumn; - } - - this.toOrientedRange = function(range) { - var r = this.getRange(); - if (range) { - range.start.column = r.start.column; - range.start.row = r.start.row; - range.end.column = r.end.column; - range.end.row = r.end.row; - } else { - range = r; - } - - range.cursor = this.isBackwards() ? range.start : range.end; - range.desiredColumn = this.$desiredColumn; - return range; - } - - this.toJSON = function() { - if (this.rangeCount) { - var data = this.ranges.map(function(r) { - var r1 = r.clone(); - r1.isBackwards = r.cursor == r.start; - return r1; - }); - } else { - var data = this.getRange(); - data.isBackwards = this.isBackwards(); - } - return data; - }; - - this.fromJSON = function(data) { - if (data.start == undefined) { - if (this.rangeList) { - this.toSingleRange(data[0]); - for (var i = data.length; i--; ) { - var r = Range.fromPoints(data[i].start, data[i].end); - if (data.isBackwards) - r.cursor = r.start; - this.addRange(r, true); - } - return; - } else - data = data[0]; - } - if (this.rangeList) - this.toSingleRange(data); - this.setSelectionRange(data, data.isBackwards); - }; - - this.isEqual = function(data) { - if ((data.length || this.rangeCount) && data.length != this.rangeCount) - return false; - if (!data.length || !this.ranges) - return this.getRange().isEqual(data); - - for (var i = this.ranges.length; i--; ) { - if (!this.ranges[i].isEqual(data[i])) - return false - } - return true; - } - -}).call(Selection.prototype); - -exports.Selection = Selection; -}); - -ace.define('ace/search', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/lib/oop', 'ace/range'], function(require, exports, module) { - - -var lang = require("./lib/lang"); -var oop = require("./lib/oop"); -var Range = require("./range").Range; - -var Search = function() { - this.$options = {}; -}; - -(function() { - this.set = function(options) { - oop.mixin(this.$options, options); - return this; - }; - this.getOptions = function() { - return lang.copyObject(this.$options); - }; - this.setOptions = function(options) { - this.$options = options; - }; - this.find = function(session) { - var iterator = this.$matchIterator(session, this.$options); - - if (!iterator) - return false; - - var firstRange = null; - iterator.forEach(function(range, row, offset) { - if (!range.start) { - var column = range.offset + (offset || 0); - firstRange = new Range(row, column, row, column+range.length); - } else - firstRange = range; - return true; - }); - - return firstRange; - }; - this.findAll = function(session) { - var options = this.$options; - if (!options.needle) - return []; - this.$assembleRegExp(options); - - var range = options.range; - var lines = range - ? session.getLines(range.start.row, range.end.row) - : session.doc.getAllLines(); - - var ranges = []; - var re = options.re; - if (options.$isMultiLine) { - var len = re.length; - var maxRow = lines.length - len; - var prevRange; - outer: for (var row = re.offset || 0; row <= maxRow; row++) { - for (var j = 0; j < len; j++) - if (lines[row + j].search(re[j]) == -1) - continue outer; - - var startLine = lines[row]; - var line = lines[row + len - 1]; - var startIndex = startLine.length - startLine.match(re[0])[0].length; - var endIndex = line.match(re[len - 1])[0].length; - - if (prevRange && prevRange.end.row === row && - prevRange.end.column > startIndex - ) { - continue; - } - ranges.push(prevRange = new Range( - row, startIndex, row + len - 1, endIndex - )); - if (len > 2) - row = row + len - 2; - } - } else { - for (var i = 0; i < lines.length; i++) { - var matches = lang.getMatchOffsets(lines[i], re); - for (var j = 0; j < matches.length; j++) { - var match = matches[j]; - ranges.push(new Range(i, match.offset, i, match.offset + match.length)); - } - } - } - - if (range) { - var startColumn = range.start.column; - var endColumn = range.start.column; - var i = 0, j = ranges.length - 1; - while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == range.start.row) - i++; - - while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == range.end.row) - j--; - - ranges = ranges.slice(i, j + 1); - for (i = 0, j = ranges.length; i < j; i++) { - ranges[i].start.row += range.start.row; - ranges[i].end.row += range.start.row; - } - } - - return ranges; - }; - this.replace = function(input, replacement) { - var options = this.$options; - - var re = this.$assembleRegExp(options); - if (options.$isMultiLine) - return replacement; - - if (!re) - return; - - var match = re.exec(input); - if (!match || match[0].length != input.length) - return null; - - replacement = input.replace(re, replacement); - if (options.preserveCase) { - replacement = replacement.split(""); - for (var i = Math.min(input.length, input.length); i--; ) { - var ch = input[i]; - if (ch && ch.toLowerCase() != ch) - replacement[i] = replacement[i].toUpperCase(); - else - replacement[i] = replacement[i].toLowerCase(); - } - replacement = replacement.join(""); - } - - return replacement; - }; - - this.$matchIterator = function(session, options) { - var re = this.$assembleRegExp(options); - if (!re) - return false; - - var self = this, callback, backwards = options.backwards; - - if (options.$isMultiLine) { - var len = re.length; - var matchIterator = function(line, row, offset) { - var startIndex = line.search(re[0]); - if (startIndex == -1) - return; - for (var i = 1; i < len; i++) { - line = session.getLine(row + i); - if (line.search(re[i]) == -1) - return; - } - - var endIndex = line.match(re[len - 1])[0].length; - - var range = new Range(row, startIndex, row + len - 1, endIndex); - if (re.offset == 1) { - range.start.row--; - range.start.column = Number.MAX_VALUE; - } else if (offset) - range.start.column += offset; - - if (callback(range)) - return true; - }; - } else if (backwards) { - var matchIterator = function(line, row, startIndex) { - var matches = lang.getMatchOffsets(line, re); - for (var i = matches.length-1; i >= 0; i--) - if (callback(matches[i], row, startIndex)) - return true; - }; - } else { - var matchIterator = function(line, row, startIndex) { - var matches = lang.getMatchOffsets(line, re); - for (var i = 0; i < matches.length; i++) - if (callback(matches[i], row, startIndex)) - return true; - }; - } - - return { - forEach: function(_callback) { - callback = _callback; - self.$lineIterator(session, options).forEach(matchIterator); - } - }; - }; - - this.$assembleRegExp = function(options, $disableFakeMultiline) { - if (options.needle instanceof RegExp) - return options.re = options.needle; - - var needle = options.needle; - - if (!options.needle) - return options.re = false; - - if (!options.regExp) - needle = lang.escapeRegExp(needle); - - if (options.wholeWord) - needle = "\\b" + needle + "\\b"; - - var modifier = options.caseSensitive ? "g" : "gi"; - - options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle); - if (options.$isMultiLine) - return options.re = this.$assembleMultilineRegExp(needle, modifier); - - try { - var re = new RegExp(needle, modifier); - } catch(e) { - re = false; - } - return options.re = re; - }; - - this.$assembleMultilineRegExp = function(needle, modifier) { - var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n"); - var re = []; - for (var i = 0; i < parts.length; i++) try { - re.push(new RegExp(parts[i], modifier)); - } catch(e) { - return false; - } - if (parts[0] == "") { - re.shift(); - re.offset = 1; - } else { - re.offset = 0; - } - return re; - }; - - this.$lineIterator = function(session, options) { - var backwards = options.backwards == true; - var skipCurrent = options.skipCurrent != false; - - var range = options.range; - var start = options.start; - if (!start) - start = range ? range[backwards ? "end" : "start"] : session.selection.getRange(); - - if (start.start) - start = start[skipCurrent != backwards ? "end" : "start"]; - - var firstRow = range ? range.start.row : 0; - var lastRow = range ? range.end.row : session.getLength() - 1; - - var forEach = backwards ? function(callback) { - var row = start.row; - - var line = session.getLine(row).substring(0, start.column); - if (callback(line, row)) - return; - - for (row--; row >= firstRow; row--) - if (callback(session.getLine(row), row)) - return; - - if (options.wrap == false) - return; - - for (row = lastRow, firstRow = start.row; row >= firstRow; row--) - if (callback(session.getLine(row), row)) - return; - } : function(callback) { - var row = start.row; - - var line = session.getLine(row).substr(start.column); - if (callback(line, row, start.column)) - return; - - for (row = row+1; row <= lastRow; row++) - if (callback(session.getLine(row), row)) - return; - - if (options.wrap == false) - return; - - for (row = firstRow, lastRow = start.row; row <= lastRow; row++) - if (callback(session.getLine(row), row)) - return; - }; - - return {forEach: forEach}; - }; - -}).call(Search.prototype); - -exports.Search = Search; -}); - -ace.define('ace/edit_session', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/config', 'ace/lib/event_emitter', 'ace/selection', 'ace/mode/text', 'ace/range', 'ace/document', 'ace/background_tokenizer', 'ace/search_highlight', 'ace/edit_session/folding', 'ace/edit_session/bracket_match'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var lang = require("./lib/lang"); -var config = require("./config"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var Selection = require("./selection").Selection; -var TextMode = require("./mode/text").Mode; -var Range = require("./range").Range; -var Document = require("./document").Document; -var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer; -var SearchHighlight = require("./search_highlight").SearchHighlight; - -var EditSession = function(text, mode) { - this.$breakpoints = []; - this.$decorations = []; - this.$frontMarkers = {}; - this.$backMarkers = {}; - this.$markerId = 1; - this.$undoSelect = true; - - this.$foldData = []; - this.$foldData.toString = function() { - return this.join("\n"); - } - this.on("changeFold", this.onChangeFold.bind(this)); - this.$onChange = this.onChange.bind(this); - - if (typeof text != "object" || !text.getLine) - text = new Document(text); - - this.setDocument(text); - this.selection = new Selection(this); - - config.resetOptions(this); - this.setMode(mode); - config._signal("session", this); -}; - - -(function() { - - oop.implement(this, EventEmitter); - this.setDocument = function(doc) { - if (this.doc) - this.doc.removeListener("change", this.$onChange); - - this.doc = doc; - doc.on("change", this.$onChange); - - if (this.bgTokenizer) - this.bgTokenizer.setDocument(this.getDocument()); - - this.resetCaches(); - }; - this.getDocument = function() { - return this.doc; - }; - this.$resetRowCache = function(docRow) { - if (!docRow) { - this.$docRowCache = []; - this.$screenRowCache = []; - return; - } - var l = this.$docRowCache.length; - var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1; - if (l > i) { - this.$docRowCache.splice(i, l); - this.$screenRowCache.splice(i, l); - } - }; - - this.$getRowCacheIndex = function(cacheArray, val) { - var low = 0; - var hi = cacheArray.length - 1; - - while (low <= hi) { - var mid = (low + hi) >> 1; - var c = cacheArray[mid]; - - if (val > c) - low = mid + 1; - else if (val < c) - hi = mid - 1; - else - return mid; - } - - return low -1; - }; - - this.resetCaches = function() { - this.$modified = true; - this.$wrapData = []; - this.$rowLengthCache = []; - this.$resetRowCache(0); - if (this.bgTokenizer) - this.bgTokenizer.start(0); - }; - - this.onChangeFold = function(e) { - var fold = e.data; - this.$resetRowCache(fold.start.row); - }; - - this.onChange = function(e) { - var delta = e.data; - this.$modified = true; - - this.$resetRowCache(delta.range.start.row); - - var removedFolds = this.$updateInternalDataOnChange(e); - if (!this.$fromUndo && this.$undoManager && !delta.ignore) { - this.$deltasDoc.push(delta); - if (removedFolds && removedFolds.length != 0) { - this.$deltasFold.push({ - action: "removeFolds", - folds: removedFolds - }); - } - - this.$informUndoManager.schedule(); - } - - this.bgTokenizer.$updateOnChange(delta); - this._signal("change", e); - }; - this.setValue = function(text) { - this.doc.setValue(text); - this.selection.moveTo(0, 0); - - this.$resetRowCache(0); - this.$deltas = []; - this.$deltasDoc = []; - this.$deltasFold = []; - this.setUndoManager(this.$undoManager); - this.getUndoManager().reset(); - }; - this.getValue = - this.toString = function() { - return this.doc.getValue(); - }; - this.getSelection = function() { - return this.selection; - }; - this.getState = function(row) { - return this.bgTokenizer.getState(row); - }; - this.getTokens = function(row) { - return this.bgTokenizer.getTokens(row); - }; - this.getTokenAt = function(row, column) { - var tokens = this.bgTokenizer.getTokens(row); - var token, c = 0; - if (column == null) { - i = tokens.length - 1; - c = this.getLine(row).length; - } else { - for (var i = 0; i < tokens.length; i++) { - c += tokens[i].value.length; - if (c >= column) - break; - } - } - token = tokens[i]; - if (!token) - return null; - token.index = i; - token.start = c - token.value.length; - return token; - }; - this.setUndoManager = function(undoManager) { - this.$undoManager = undoManager; - this.$deltas = []; - this.$deltasDoc = []; - this.$deltasFold = []; - - if (this.$informUndoManager) - this.$informUndoManager.cancel(); - - if (undoManager) { - var self = this; - - this.$syncInformUndoManager = function() { - self.$informUndoManager.cancel(); - - if (self.$deltasFold.length) { - self.$deltas.push({ - group: "fold", - deltas: self.$deltasFold - }); - self.$deltasFold = []; - } - - if (self.$deltasDoc.length) { - self.$deltas.push({ - group: "doc", - deltas: self.$deltasDoc - }); - self.$deltasDoc = []; - } - - if (self.$deltas.length > 0) { - undoManager.execute({ - action: "aceupdate", - args: [self.$deltas, self], - merge: self.mergeUndoDeltas - }); - } - self.mergeUndoDeltas = false; - self.$deltas = []; - }; - this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager); - } - }; - this.markUndoGroup = function() { - if (this.$syncInformUndoManager) - this.$syncInformUndoManager(); - }; - - this.$defaultUndoManager = { - undo: function() {}, - redo: function() {}, - reset: function() {} - }; - this.getUndoManager = function() { - return this.$undoManager || this.$defaultUndoManager; - }; - this.getTabString = function() { - if (this.getUseSoftTabs()) { - return lang.stringRepeat(" ", this.getTabSize()); - } else { - return "\t"; - } - }; - this.setUseSoftTabs = function(val) { - this.setOption("useSoftTabs", val); - }; - this.getUseSoftTabs = function() { - return this.$useSoftTabs && !this.$mode.$indentWithTabs; - }; - this.setTabSize = function(tabSize) { - this.setOption("tabSize", tabSize); - }; - this.getTabSize = function() { - return this.$tabSize; - }; - this.isTabStop = function(position) { - return this.$useSoftTabs && (position.column % this.$tabSize === 0); - }; - - this.$overwrite = false; - this.setOverwrite = function(overwrite) { - this.setOption("overwrite", overwrite); - }; - this.getOverwrite = function() { - return this.$overwrite; - }; - this.toggleOverwrite = function() { - this.setOverwrite(!this.$overwrite); - }; - this.addGutterDecoration = function(row, className) { - if (!this.$decorations[row]) - this.$decorations[row] = ""; - this.$decorations[row] += " " + className; - this._signal("changeBreakpoint", {}); - }; - this.removeGutterDecoration = function(row, className) { - this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, ""); - this._signal("changeBreakpoint", {}); - }; - this.getBreakpoints = function() { - return this.$breakpoints; - }; - this.setBreakpoints = function(rows) { - this.$breakpoints = []; - for (var i=0; i 0) - inToken = !!line.charAt(column - 1).match(this.tokenRe); - - if (!inToken) - inToken = !!line.charAt(column).match(this.tokenRe); - - if (inToken) - var re = this.tokenRe; - else if (/^\s+$/.test(line.slice(column-1, column+1))) - var re = /\s/; - else - var re = this.nonTokenRe; - - var start = column; - if (start > 0) { - do { - start--; - } - while (start >= 0 && line.charAt(start).match(re)); - start++; - } - - var end = column; - while (end < line.length && line.charAt(end).match(re)) { - end++; - } - - return new Range(row, start, row, end); - }; - this.getAWordRange = function(row, column) { - var wordRange = this.getWordRange(row, column); - var line = this.getLine(wordRange.end.row); - - while (line.charAt(wordRange.end.column).match(/[ \t]/)) { - wordRange.end.column += 1; - } - return wordRange; - }; - this.setNewLineMode = function(newLineMode) { - this.doc.setNewLineMode(newLineMode); - }; - this.getNewLineMode = function() { - return this.doc.getNewLineMode(); - }; - this.setUseWorker = function(useWorker) { this.setOption("useWorker", useWorker); }; - this.getUseWorker = function() { return this.$useWorker; }; - this.onReloadTokenizer = function(e) { - var rows = e.data; - this.bgTokenizer.start(rows.first); - this._signal("tokenizerUpdate", e); - }; - - this.$modes = {}; - this.$mode = null; - this.$modeId = null; - this.setMode = function(mode, cb) { - if (mode && typeof mode === "object") { - if (mode.getTokenizer) - return this.$onChangeMode(mode); - var options = mode; - var path = options.path; - } else { - path = mode || "ace/mode/text"; - } - if (!this.$modes["ace/mode/text"]) - this.$modes["ace/mode/text"] = new TextMode(); - - if (this.$modes[path] && !options) { - this.$onChangeMode(this.$modes[path]); - cb && cb(); - return; - } - this.$modeId = path; - config.loadModule(["mode", path], function(m) { - if (this.$modeId !== path) - return cb && cb(); - if (this.$modes[path] && !options) - return this.$onChangeMode(this.$modes[path]); - if (m && m.Mode) { - m = new m.Mode(options); - if (!options) { - this.$modes[path] = m; - m.$id = path; - } - this.$onChangeMode(m); - cb && cb(); - } - }.bind(this)); - if (!this.$mode) - this.$onChangeMode(this.$modes["ace/mode/text"], true); - }; - - this.$onChangeMode = function(mode, $isPlaceholder) { - if (!$isPlaceholder) - this.$modeId = mode.$id; - if (this.$mode === mode) - return; - - this.$mode = mode; - - this.$stopWorker(); - - if (this.$useWorker) - this.$startWorker(); - - var tokenizer = mode.getTokenizer(); - - if(tokenizer.addEventListener !== undefined) { - var onReloadTokenizer = this.onReloadTokenizer.bind(this); - tokenizer.addEventListener("update", onReloadTokenizer); - } - - if (!this.bgTokenizer) { - this.bgTokenizer = new BackgroundTokenizer(tokenizer); - var _self = this; - this.bgTokenizer.addEventListener("update", function(e) { - _self._signal("tokenizerUpdate", e); - }); - } else { - this.bgTokenizer.setTokenizer(tokenizer); - } - - this.bgTokenizer.setDocument(this.getDocument()); - - this.tokenRe = mode.tokenRe; - this.nonTokenRe = mode.nonTokenRe; - - - if (!$isPlaceholder) { - this.$options.wrapMethod.set.call(this, this.$wrapMethod); - this.$setFolding(mode.foldingRules); - this.bgTokenizer.start(0); - this._emit("changeMode"); - } - }; - - - this.$stopWorker = function() { - if (this.$worker) - this.$worker.terminate(); - - this.$worker = null; - }; - - this.$startWorker = function() { - if (typeof Worker !== "undefined" && !require.noWorker) { - try { - this.$worker = this.$mode.createWorker(this); - } catch (e) { - console.log("Could not load worker"); - console.log(e); - this.$worker = null; - } - } - else - this.$worker = null; - }; - this.getMode = function() { - return this.$mode; - }; - - this.$scrollTop = 0; - this.setScrollTop = function(scrollTop) { - if (this.$scrollTop === scrollTop || isNaN(scrollTop)) - return; - - this.$scrollTop = scrollTop; - this._signal("changeScrollTop", scrollTop); - }; - this.getScrollTop = function() { - return this.$scrollTop; - }; - - this.$scrollLeft = 0; - this.setScrollLeft = function(scrollLeft) { - if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft)) - return; - - this.$scrollLeft = scrollLeft; - this._signal("changeScrollLeft", scrollLeft); - }; - this.getScrollLeft = function() { - return this.$scrollLeft; - }; - this.getScreenWidth = function() { - this.$computeWidth(); - if (this.lineWidgets) - return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth); - return this.screenWidth; - }; - - this.getLineWidgetMaxWidth = function() { - if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth; - var width = 0; - this.lineWidgets.forEach(function(w) { - if (w && w.screenWidth > width) - width = w.screenWidth; - }); - return this.lineWidgetWidth = width; - }; - - this.$computeWidth = function(force) { - if (this.$modified || force) { - this.$modified = false; - - if (this.$useWrapMode) - return this.screenWidth = this.$wrapLimit; - - var lines = this.doc.getAllLines(); - var cache = this.$rowLengthCache; - var longestScreenLine = 0; - var foldIndex = 0; - var foldLine = this.$foldData[foldIndex]; - var foldStart = foldLine ? foldLine.start.row : Infinity; - var len = lines.length; - - for (var i = 0; i < len; i++) { - if (i > foldStart) { - i = foldLine.end.row + 1; - if (i >= len) - break; - foldLine = this.$foldData[foldIndex++]; - foldStart = foldLine ? foldLine.start.row : Infinity; - } - - if (cache[i] == null) - cache[i] = this.$getStringScreenWidth(lines[i])[0]; - - if (cache[i] > longestScreenLine) - longestScreenLine = cache[i]; - } - this.screenWidth = longestScreenLine; - } - }; - this.getLine = function(row) { - return this.doc.getLine(row); - }; - this.getLines = function(firstRow, lastRow) { - return this.doc.getLines(firstRow, lastRow); - }; - this.getLength = function() { - return this.doc.getLength(); - }; - this.getTextRange = function(range) { - return this.doc.getTextRange(range || this.selection.getRange()); - }; - this.insert = function(position, text) { - return this.doc.insert(position, text); - }; - this.remove = function(range) { - return this.doc.remove(range); - }; - this.undoChanges = function(deltas, dontSelect) { - if (!deltas.length) - return; - - this.$fromUndo = true; - var lastUndoRange = null; - for (var i = deltas.length - 1; i != -1; i--) { - var delta = deltas[i]; - if (delta.group == "doc") { - this.doc.revertDeltas(delta.deltas); - lastUndoRange = - this.$getUndoSelection(delta.deltas, true, lastUndoRange); - } else { - delta.deltas.forEach(function(foldDelta) { - this.addFolds(foldDelta.folds); - }, this); - } - } - this.$fromUndo = false; - lastUndoRange && - this.$undoSelect && - !dontSelect && - this.selection.setSelectionRange(lastUndoRange); - return lastUndoRange; - }; - this.redoChanges = function(deltas, dontSelect) { - if (!deltas.length) - return; - - this.$fromUndo = true; - var lastUndoRange = null; - for (var i = 0; i < deltas.length; i++) { - var delta = deltas[i]; - if (delta.group == "doc") { - this.doc.applyDeltas(delta.deltas); - lastUndoRange = - this.$getUndoSelection(delta.deltas, false, lastUndoRange); - } - } - this.$fromUndo = false; - lastUndoRange && - this.$undoSelect && - !dontSelect && - this.selection.setSelectionRange(lastUndoRange); - return lastUndoRange; - }; - this.setUndoSelect = function(enable) { - this.$undoSelect = enable; - }; - - this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { - function isInsert(delta) { - var insert = - delta.action === "insertText" || delta.action === "insertLines"; - return isUndo ? !insert : insert; - } - - var delta = deltas[0]; - var range, point; - var lastDeltaIsInsert = false; - if (isInsert(delta)) { - range = Range.fromPoints(delta.range.start, delta.range.end); - lastDeltaIsInsert = true; - } else { - range = Range.fromPoints(delta.range.start, delta.range.start); - lastDeltaIsInsert = false; - } - - for (var i = 1; i < deltas.length; i++) { - delta = deltas[i]; - if (isInsert(delta)) { - point = delta.range.start; - if (range.compare(point.row, point.column) == -1) { - range.setStart(delta.range.start); - } - point = delta.range.end; - if (range.compare(point.row, point.column) == 1) { - range.setEnd(delta.range.end); - } - lastDeltaIsInsert = true; - } else { - point = delta.range.start; - if (range.compare(point.row, point.column) == -1) { - range = - Range.fromPoints(delta.range.start, delta.range.start); - } - lastDeltaIsInsert = false; - } - } - if (lastUndoRange != null) { - if (Range.comparePoints(lastUndoRange.start, range.start) === 0) { - lastUndoRange.start.column += range.end.column - range.start.column; - lastUndoRange.end.column += range.end.column - range.start.column; - } - - var cmp = lastUndoRange.compareRange(range); - if (cmp == 1) { - range.setStart(lastUndoRange.start); - } else if (cmp == -1) { - range.setEnd(lastUndoRange.end); - } - } - - return range; - }; - this.replace = function(range, text) { - return this.doc.replace(range, text); - }; - this.moveText = function(fromRange, toPosition, copy) { - var text = this.getTextRange(fromRange); - var folds = this.getFoldsInRange(fromRange); - - var toRange = Range.fromPoints(toPosition, toPosition); - if (!copy) { - this.remove(fromRange); - var rowDiff = fromRange.start.row - fromRange.end.row; - var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column; - if (collDiff) { - if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column) - toRange.start.column += collDiff; - if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column) - toRange.end.column += collDiff; - } - if (rowDiff && toRange.start.row >= fromRange.end.row) { - toRange.start.row += rowDiff; - toRange.end.row += rowDiff; - } - } - - toRange.end = this.insert(toRange.start, text); - if (folds.length) { - var oldStart = fromRange.start; - var newStart = toRange.start; - var rowDiff = newStart.row - oldStart.row; - var collDiff = newStart.column - oldStart.column; - this.addFolds(folds.map(function(x) { - x = x.clone(); - if (x.start.row == oldStart.row) - x.start.column += collDiff; - if (x.end.row == oldStart.row) - x.end.column += collDiff; - x.start.row += rowDiff; - x.end.row += rowDiff; - return x; - })); - } - - return toRange; - }; - this.indentRows = function(startRow, endRow, indentString) { - indentString = indentString.replace(/\t/g, this.getTabString()); - for (var row=startRow; row<=endRow; row++) - this.insert({row: row, column:0}, indentString); - }; - this.outdentRows = function (range) { - var rowRange = range.collapseRows(); - var deleteRange = new Range(0, 0, 0, 0); - var size = this.getTabSize(); - - for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) { - var line = this.getLine(i); - - deleteRange.start.row = i; - deleteRange.end.row = i; - for (var j = 0; j < size; ++j) - if (line.charAt(j) != ' ') - break; - if (j < size && line.charAt(j) == '\t') { - deleteRange.start.column = j; - deleteRange.end.column = j + 1; - } else { - deleteRange.start.column = 0; - deleteRange.end.column = j; - } - this.remove(deleteRange); - } - }; - - this.$moveLines = function(firstRow, lastRow, dir) { - firstRow = this.getRowFoldStart(firstRow); - lastRow = this.getRowFoldEnd(lastRow); - if (dir < 0) { - var row = this.getRowFoldStart(firstRow + dir); - if (row < 0) return 0; - var diff = row-firstRow; - } else if (dir > 0) { - var row = this.getRowFoldEnd(lastRow + dir); - if (row > this.doc.getLength()-1) return 0; - var diff = row-lastRow; - } else { - firstRow = this.$clipRowToDocument(firstRow); - lastRow = this.$clipRowToDocument(lastRow); - var diff = lastRow - firstRow + 1; - } - - var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE); - var folds = this.getFoldsInRange(range).map(function(x){ - x = x.clone(); - x.start.row += diff; - x.end.row += diff; - return x; - }); - - var lines = dir == 0 - ? this.doc.getLines(firstRow, lastRow) - : this.doc.removeLines(firstRow, lastRow); - this.doc.insertLines(firstRow+diff, lines); - folds.length && this.addFolds(folds); - return diff; - }; - this.moveLinesUp = function(firstRow, lastRow) { - return this.$moveLines(firstRow, lastRow, -1); - }; - this.moveLinesDown = function(firstRow, lastRow) { - return this.$moveLines(firstRow, lastRow, 1); - }; - this.duplicateLines = function(firstRow, lastRow) { - return this.$moveLines(firstRow, lastRow, 0); - }; - - - this.$clipRowToDocument = function(row) { - return Math.max(0, Math.min(row, this.doc.getLength()-1)); - }; - - this.$clipColumnToRow = function(row, column) { - if (column < 0) - return 0; - return Math.min(this.doc.getLine(row).length, column); - }; - - - this.$clipPositionToDocument = function(row, column) { - column = Math.max(0, column); - - if (row < 0) { - row = 0; - column = 0; - } else { - var len = this.doc.getLength(); - if (row >= len) { - row = len - 1; - column = this.doc.getLine(len-1).length; - } else { - column = Math.min(this.doc.getLine(row).length, column); - } - } - - return { - row: row, - column: column - }; - }; - - this.$clipRangeToDocument = function(range) { - if (range.start.row < 0) { - range.start.row = 0; - range.start.column = 0; - } else { - range.start.column = this.$clipColumnToRow( - range.start.row, - range.start.column - ); - } - - var len = this.doc.getLength() - 1; - if (range.end.row > len) { - range.end.row = len; - range.end.column = this.doc.getLine(len).length; - } else { - range.end.column = this.$clipColumnToRow( - range.end.row, - range.end.column - ); - } - return range; - }; - this.$wrapLimit = 80; - this.$useWrapMode = false; - this.$wrapLimitRange = { - min : null, - max : null - }; - this.setUseWrapMode = function(useWrapMode) { - if (useWrapMode != this.$useWrapMode) { - this.$useWrapMode = useWrapMode; - this.$modified = true; - this.$resetRowCache(0); - if (useWrapMode) { - var len = this.getLength(); - this.$wrapData = Array(len); - this.$updateWrapData(0, len - 1); - } - - this._signal("changeWrapMode"); - } - }; - this.getUseWrapMode = function() { - return this.$useWrapMode; - }; - this.setWrapLimitRange = function(min, max) { - if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { - this.$wrapLimitRange = { - min: min, - max: max - }; - this.$modified = true; - this._signal("changeWrapMode"); - } - }; - this.adjustWrapLimit = function(desiredLimit, $printMargin) { - var limits = this.$wrapLimitRange - if (limits.max < 0) - limits = {min: $printMargin, max: $printMargin}; - var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max); - if (wrapLimit != this.$wrapLimit && wrapLimit > 1) { - this.$wrapLimit = wrapLimit; - this.$modified = true; - if (this.$useWrapMode) { - this.$updateWrapData(0, this.getLength() - 1); - this.$resetRowCache(0); - this._signal("changeWrapLimit"); - } - return true; - } - return false; - }; - - this.$constrainWrapLimit = function(wrapLimit, min, max) { - if (min) - wrapLimit = Math.max(min, wrapLimit); - - if (max) - wrapLimit = Math.min(max, wrapLimit); - - return wrapLimit; - }; - this.getWrapLimit = function() { - return this.$wrapLimit; - }; - this.setWrapLimit = function (limit) { - this.setWrapLimitRange(limit, limit); - }; - this.getWrapLimitRange = function() { - return { - min : this.$wrapLimitRange.min, - max : this.$wrapLimitRange.max - }; - }; - - this.$updateInternalDataOnChange = function(e) { - var useWrapMode = this.$useWrapMode; - var len; - var action = e.data.action; - var firstRow = e.data.range.start.row; - var lastRow = e.data.range.end.row; - var start = e.data.range.start; - var end = e.data.range.end; - var removedFolds = null; - - if (action.indexOf("Lines") != -1) { - if (action == "insertLines") { - lastRow = firstRow + (e.data.lines.length); - } else { - lastRow = firstRow; - } - len = e.data.lines ? e.data.lines.length : lastRow - firstRow; - } else { - len = lastRow - firstRow; - } - - this.$updating = true; - if (len != 0) { - if (action.indexOf("remove") != -1) { - this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len); - - var foldLines = this.$foldData; - removedFolds = this.getFoldsInRange(e.data.range); - this.removeFolds(removedFolds); - - var foldLine = this.getFoldLine(end.row); - var idx = 0; - if (foldLine) { - foldLine.addRemoveChars(end.row, end.column, start.column - end.column); - foldLine.shiftRow(-len); - - var foldLineBefore = this.getFoldLine(firstRow); - if (foldLineBefore && foldLineBefore !== foldLine) { - foldLineBefore.merge(foldLine); - foldLine = foldLineBefore; - } - idx = foldLines.indexOf(foldLine) + 1; - } - - for (idx; idx < foldLines.length; idx++) { - var foldLine = foldLines[idx]; - if (foldLine.start.row >= end.row) { - foldLine.shiftRow(-len); - } - } - - lastRow = firstRow; - } else { - var args = Array(len); - args.unshift(firstRow, 0); - var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache - arr.splice.apply(arr, args); - var foldLines = this.$foldData; - var foldLine = this.getFoldLine(firstRow); - var idx = 0; - if (foldLine) { - var cmp = foldLine.range.compareInside(start.row, start.column) - if (cmp == 0) { - foldLine = foldLine.split(start.row, start.column); - foldLine.shiftRow(len); - foldLine.addRemoveChars( - lastRow, 0, end.column - start.column); - } else - if (cmp == -1) { - foldLine.addRemoveChars(firstRow, 0, end.column - start.column); - foldLine.shiftRow(len); - } - idx = foldLines.indexOf(foldLine) + 1; - } - - for (idx; idx < foldLines.length; idx++) { - var foldLine = foldLines[idx]; - if (foldLine.start.row >= firstRow) { - foldLine.shiftRow(len); - } - } - } - } else { - len = Math.abs(e.data.range.start.column - e.data.range.end.column); - if (action.indexOf("remove") != -1) { - removedFolds = this.getFoldsInRange(e.data.range); - this.removeFolds(removedFolds); - - len = -len; - } - var foldLine = this.getFoldLine(firstRow); - if (foldLine) { - foldLine.addRemoveChars(firstRow, start.column, len); - } - } - - if (useWrapMode && this.$wrapData.length != this.doc.getLength()) { - console.error("doc.getLength() and $wrapData.length have to be the same!"); - } - this.$updating = false; - - if (useWrapMode) - this.$updateWrapData(firstRow, lastRow); - else - this.$updateRowLengthCache(firstRow, lastRow); - - return removedFolds; - }; - - this.$updateRowLengthCache = function(firstRow, lastRow, b) { - this.$rowLengthCache[firstRow] = null; - this.$rowLengthCache[lastRow] = null; - }; - - this.$updateWrapData = function(firstRow, lastRow) { - var lines = this.doc.getAllLines(); - var tabSize = this.getTabSize(); - var wrapData = this.$wrapData; - var wrapLimit = this.$wrapLimit; - var tokens; - var foldLine; - - var row = firstRow; - lastRow = Math.min(lastRow, lines.length - 1); - while (row <= lastRow) { - foldLine = this.getFoldLine(row, foldLine); - if (!foldLine) { - tokens = this.$getDisplayTokens(lines[row]); - wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); - row ++; - } else { - tokens = []; - foldLine.walk(function(placeholder, row, column, lastColumn) { - var walkTokens; - if (placeholder != null) { - walkTokens = this.$getDisplayTokens( - placeholder, tokens.length); - walkTokens[0] = PLACEHOLDER_START; - for (var i = 1; i < walkTokens.length; i++) { - walkTokens[i] = PLACEHOLDER_BODY; - } - } else { - walkTokens = this.$getDisplayTokens( - lines[row].substring(lastColumn, column), - tokens.length); - } - tokens = tokens.concat(walkTokens); - }.bind(this), - foldLine.end.row, - lines[foldLine.end.row].length + 1 - ); - - wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); - row = foldLine.end.row + 1; - } - } - }; - var CHAR = 1, - CHAR_EXT = 2, - PLACEHOLDER_START = 3, - PLACEHOLDER_BODY = 4, - PUNCTUATION = 9, - SPACE = 10, - TAB = 11, - TAB_SPACE = 12; - - - this.$computeWrapSplits = function(tokens, wrapLimit) { - if (tokens.length == 0) { - return []; - } - - var splits = []; - var displayLength = tokens.length; - var lastSplit = 0, lastDocSplit = 0; - - var isCode = this.$wrapAsCode; - - function addSplit(screenPos) { - var displayed = tokens.slice(lastSplit, screenPos); - var len = displayed.length; - displayed.join(""). - replace(/12/g, function() { - len -= 1; - }). - replace(/2/g, function() { - len -= 1; - }); - - lastDocSplit += len; - splits.push(lastDocSplit); - lastSplit = screenPos; - } - - while (displayLength - lastSplit > wrapLimit) { - var split = lastSplit + wrapLimit; - if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) { - addSplit(split); - continue; - } - if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) { - for (split; split != lastSplit - 1; split--) { - if (tokens[split] == PLACEHOLDER_START) { - break; - } - } - if (split > lastSplit) { - addSplit(split); - continue; - } - split = lastSplit + wrapLimit; - for (split; split < tokens.length; split++) { - if (tokens[split] != PLACEHOLDER_BODY) { - break; - } - } - if (split == tokens.length) { - break; // Breaks the while-loop. - } - addSplit(split); - continue; - } - var minSplit = Math.max(split - (isCode ? 10 : wrapLimit-(wrapLimit>>2)), lastSplit - 1); - while (split > minSplit && tokens[split] < PLACEHOLDER_START) { - split --; - } - if (isCode) { - while (split > minSplit && tokens[split] < PLACEHOLDER_START) { - split --; - } - while (split > minSplit && tokens[split] == PUNCTUATION) { - split --; - } - } else { - while (split > minSplit && tokens[split] < SPACE) { - split --; - } - } - if (split > minSplit) { - addSplit(++split); - continue; - } - split = lastSplit + wrapLimit; - addSplit(split); - } - return splits; - }; - this.$getDisplayTokens = function(str, offset) { - var arr = []; - var tabSize; - offset = offset || 0; - - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - if (c == 9) { - tabSize = this.getScreenTabSize(arr.length + offset); - arr.push(TAB); - for (var n = 1; n < tabSize; n++) { - arr.push(TAB_SPACE); - } - } - else if (c == 32) { - arr.push(SPACE); - } else if((c > 39 && c < 48) || (c > 57 && c < 64)) { - arr.push(PUNCTUATION); - } - else if (c >= 0x1100 && isFullWidth(c)) { - arr.push(CHAR, CHAR_EXT); - } else { - arr.push(CHAR); - } - } - return arr; - }; - this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { - if (maxScreenColumn == 0) - return [0, 0]; - if (maxScreenColumn == null) - maxScreenColumn = Infinity; - screenColumn = screenColumn || 0; - - var c, column; - for (column = 0; column < str.length; column++) { - c = str.charCodeAt(column); - if (c == 9) { - screenColumn += this.getScreenTabSize(screenColumn); - } - else if (c >= 0x1100 && isFullWidth(c)) { - screenColumn += 2; - } else { - screenColumn += 1; - } - if (screenColumn > maxScreenColumn) { - break; - } - } - - return [screenColumn, column]; - }; - - this.lineWidgets = null; - this.getRowLength = function(row) { - if (this.lineWidgets) - var h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; - else - h = 0 - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1 + h; - } else { - return this.$wrapData[row].length + 1 + h; - } - }; - this.getRowLineCount = function(row) { - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1; - } else { - return this.$wrapData[row].length + 1; - } - }; - this.getScreenLastRowColumn = function(screenRow) { - var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); - return this.documentToScreenColumn(pos.row, pos.column); - }; - this.getDocumentLastRowColumn = function(docRow, docColumn) { - var screenRow = this.documentToScreenRow(docRow, docColumn); - return this.getScreenLastRowColumn(screenRow); - }; - this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { - var screenRow = this.documentToScreenRow(docRow, docColumn); - return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); - }; - this.getRowSplitData = function(row) { - if (!this.$useWrapMode) { - return undefined; - } else { - return this.$wrapData[row]; - } - }; - this.getScreenTabSize = function(screenColumn) { - return this.$tabSize - screenColumn % this.$tabSize; - }; - - - this.screenToDocumentRow = function(screenRow, screenColumn) { - return this.screenToDocumentPosition(screenRow, screenColumn).row; - }; - - - this.screenToDocumentColumn = function(screenRow, screenColumn) { - return this.screenToDocumentPosition(screenRow, screenColumn).column; - }; - this.screenToDocumentPosition = function(screenRow, screenColumn) { - if (screenRow < 0) - return {row: 0, column: 0}; - - var line; - var docRow = 0; - var docColumn = 0; - var column; - var row = 0; - var rowLength = 0; - - var rowCache = this.$screenRowCache; - var i = this.$getRowCacheIndex(rowCache, screenRow); - var l = rowCache.length; - if (l && i >= 0) { - var row = rowCache[i]; - var docRow = this.$docRowCache[i]; - var doCache = screenRow > rowCache[l - 1]; - } else { - var doCache = !l; - } - - var maxRow = this.getLength() - 1; - var foldLine = this.getNextFoldLine(docRow); - var foldStart = foldLine ? foldLine.start.row : Infinity; - - while (row <= screenRow) { - rowLength = this.getRowLength(docRow); - if (row + rowLength > screenRow || docRow >= maxRow) { - break; - } else { - row += rowLength; - docRow++; - if (docRow > foldStart) { - docRow = foldLine.end.row+1; - foldLine = this.getNextFoldLine(docRow, foldLine); - foldStart = foldLine ? foldLine.start.row : Infinity; - } - } - - if (doCache) { - this.$docRowCache.push(docRow); - this.$screenRowCache.push(row); - } - } - - if (foldLine && foldLine.start.row <= docRow) { - line = this.getFoldDisplayLine(foldLine); - docRow = foldLine.start.row; - } else if (row + rowLength <= screenRow || docRow > maxRow) { - return { - row: maxRow, - column: this.getLine(maxRow).length - } - } else { - line = this.getLine(docRow); - foldLine = null; - } - - if (this.$useWrapMode) { - var splits = this.$wrapData[docRow]; - if (splits) { - var splitIndex = Math.floor(screenRow - row); - column = splits[splitIndex]; - if(splitIndex > 0 && splits.length) { - docColumn = splits[splitIndex - 1] || splits[splits.length - 1]; - line = line.substring(docColumn); - } - } - } - - docColumn += this.$getStringScreenWidth(line, screenColumn)[1]; - if (this.$useWrapMode && docColumn >= column) - docColumn = column - 1; - - if (foldLine) - return foldLine.idxToPosition(docColumn); - - return {row: docRow, column: docColumn}; - }; - this.documentToScreenPosition = function(docRow, docColumn) { - if (typeof docColumn === "undefined") - var pos = this.$clipPositionToDocument(docRow.row, docRow.column); - else - pos = this.$clipPositionToDocument(docRow, docColumn); - - docRow = pos.row; - docColumn = pos.column; - - var screenRow = 0; - var foldStartRow = null; - var fold = null; - fold = this.getFoldAt(docRow, docColumn, 1); - if (fold) { - docRow = fold.start.row; - docColumn = fold.start.column; - } - - var rowEnd, row = 0; - - - var rowCache = this.$docRowCache; - var i = this.$getRowCacheIndex(rowCache, docRow); - var l = rowCache.length; - if (l && i >= 0) { - var row = rowCache[i]; - var screenRow = this.$screenRowCache[i]; - var doCache = docRow > rowCache[l - 1]; - } else { - var doCache = !l; - } - - var foldLine = this.getNextFoldLine(row); - var foldStart = foldLine ?foldLine.start.row :Infinity; - - while (row < docRow) { - if (row >= foldStart) { - rowEnd = foldLine.end.row + 1; - if (rowEnd > docRow) - break; - foldLine = this.getNextFoldLine(rowEnd, foldLine); - foldStart = foldLine ?foldLine.start.row :Infinity; - } - else { - rowEnd = row + 1; - } - - screenRow += this.getRowLength(row); - row = rowEnd; - - if (doCache) { - this.$docRowCache.push(row); - this.$screenRowCache.push(screenRow); - } - } - var textLine = ""; - if (foldLine && row >= foldStart) { - textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn); - foldStartRow = foldLine.start.row; - } else { - textLine = this.getLine(docRow).substring(0, docColumn); - foldStartRow = docRow; - } - if (this.$useWrapMode) { - var wrapRow = this.$wrapData[foldStartRow]; - if (wrapRow) { - var screenRowOffset = 0; - while (textLine.length >= wrapRow[screenRowOffset]) { - screenRow ++; - screenRowOffset++; - } - textLine = textLine.substring( - wrapRow[screenRowOffset - 1] || 0, textLine.length - ); - } - } - - return { - row: screenRow, - column: this.$getStringScreenWidth(textLine)[0] - }; - }; - this.documentToScreenColumn = function(row, docColumn) { - return this.documentToScreenPosition(row, docColumn).column; - }; - this.documentToScreenRow = function(docRow, docColumn) { - return this.documentToScreenPosition(docRow, docColumn).row; - }; - this.getScreenLength = function() { - var screenRows = 0; - var fold = null; - if (!this.$useWrapMode) { - screenRows = this.getLength(); - var foldData = this.$foldData; - for (var i = 0; i < foldData.length; i++) { - fold = foldData[i]; - screenRows -= fold.end.row - fold.start.row; - } - } else { - var lastRow = this.$wrapData.length; - var row = 0, i = 0; - var fold = this.$foldData[i++]; - var foldStart = fold ? fold.start.row :Infinity; - - while (row < lastRow) { - var splits = this.$wrapData[row]; - screenRows += splits ? splits.length + 1 : 1; - row ++; - if (row > foldStart) { - row = fold.end.row+1; - fold = this.$foldData[i++]; - foldStart = fold ?fold.start.row :Infinity; - } - } - } - if (this.lineWidgets) - screenRows += this.$getWidgetScreenLength(); - - return screenRows; - }; - this.$setFontMetrics = function(fm) { - } - function isFullWidth(c) { - if (c < 0x1100) - return false; - return c >= 0x1100 && c <= 0x115F || - c >= 0x11A3 && c <= 0x11A7 || - c >= 0x11FA && c <= 0x11FF || - c >= 0x2329 && c <= 0x232A || - c >= 0x2E80 && c <= 0x2E99 || - c >= 0x2E9B && c <= 0x2EF3 || - c >= 0x2F00 && c <= 0x2FD5 || - c >= 0x2FF0 && c <= 0x2FFB || - c >= 0x3000 && c <= 0x303E || - c >= 0x3041 && c <= 0x3096 || - c >= 0x3099 && c <= 0x30FF || - c >= 0x3105 && c <= 0x312D || - c >= 0x3131 && c <= 0x318E || - c >= 0x3190 && c <= 0x31BA || - c >= 0x31C0 && c <= 0x31E3 || - c >= 0x31F0 && c <= 0x321E || - c >= 0x3220 && c <= 0x3247 || - c >= 0x3250 && c <= 0x32FE || - c >= 0x3300 && c <= 0x4DBF || - c >= 0x4E00 && c <= 0xA48C || - c >= 0xA490 && c <= 0xA4C6 || - c >= 0xA960 && c <= 0xA97C || - c >= 0xAC00 && c <= 0xD7A3 || - c >= 0xD7B0 && c <= 0xD7C6 || - c >= 0xD7CB && c <= 0xD7FB || - c >= 0xF900 && c <= 0xFAFF || - c >= 0xFE10 && c <= 0xFE19 || - c >= 0xFE30 && c <= 0xFE52 || - c >= 0xFE54 && c <= 0xFE66 || - c >= 0xFE68 && c <= 0xFE6B || - c >= 0xFF01 && c <= 0xFF60 || - c >= 0xFFE0 && c <= 0xFFE6; - }; - -}).call(EditSession.prototype); - -require("./edit_session/folding").Folding.call(EditSession.prototype); -require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype); - - -config.defineOptions(EditSession.prototype, "session", { - wrap: { - set: function(value) { - if (!value || value == "off") - value = false; - else if (value == "free") - value = true; - else if (value == "printMargin") - value = -1; - else if (typeof value == "string") - value = parseInt(value, 10) || false; - - if (this.$wrap == value) - return; - if (!value) { - this.setUseWrapMode(false); - } else { - var col = typeof value == "number" ? value : null; - this.setWrapLimitRange(col, col); - this.setUseWrapMode(true); - } - this.$wrap = value; - }, - get: function() { - if (this.getUseWrapMode()) { - if (this.$wrap == -1) - return "printMargin"; - if (!this.getWrapLimitRange().min) - return "free"; - return this.$wrap; - } - return "off"; - }, - handlesSet: true - }, - wrapMethod: { - set: function(val) { - val = val == "auto" - ? this.$mode.type != "text" - : val != "text"; - if (val != this.$wrapAsCode) { - this.$wrapAsCode = val; - if (this.$useWrapMode) { - this.$modified = true; - this.$resetRowCache(0); - this.$updateWrapData(0, this.getLength() - 1); - } - } - }, - initialValue: "auto" - }, - firstLineNumber: { - set: function() {this._signal("changeBreakpoint");}, - initialValue: 1 - }, - useWorker: { - set: function(useWorker) { - this.$useWorker = useWorker; - - this.$stopWorker(); - if (useWorker) - this.$startWorker(); - }, - initialValue: true - }, - useSoftTabs: {initialValue: true}, - tabSize: { - set: function(tabSize) { - if (isNaN(tabSize) || this.$tabSize === tabSize) return; - - this.$modified = true; - this.$rowLengthCache = []; - this.$tabSize = tabSize; - this._signal("changeTabSize"); - }, - initialValue: 4, - handlesSet: true - }, - overwrite: { - set: function(val) {this._signal("changeOverwrite");}, - initialValue: false - }, - newLineMode: { - set: function(val) {this.doc.setNewLineMode(val)}, - get: function() {return this.doc.getNewLineMode()}, - handlesSet: true - }, - mode: { - set: function(val) { this.setMode(val) }, - get: function() { return this.$modeId } - } -}); - -exports.EditSession = EditSession; -}); -ace.define('ace/commands/command_manager', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/keyboard/hash_handler', 'ace/lib/event_emitter'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var EventEmitter = require("../lib/event_emitter").EventEmitter; - -var CommandManager = function(platform, commands) { - HashHandler.call(this, commands, platform); - this.byName = this.commands; - this.setDefaultHandler("exec", function(e) { - return e.command.exec(e.editor, e.args || {}); - }); -}; - -oop.inherits(CommandManager, HashHandler); - -(function() { - - oop.implement(this, EventEmitter); - - this.exec = function(command, editor, args) { - if (typeof command === 'string') - command = this.commands[command]; - - if (!command) - return false; - - if (editor && editor.$readOnly && !command.readOnly) - return false; - - var e = {editor: editor, command: command, args: args}; - var retvalue = this._emit("exec", e); - this._signal("afterExec", e); - - return retvalue === false ? false : true; - }; - - this.toggleRecording = function(editor) { - if (this.$inReplay) - return; - - editor && editor._emit("changeStatus"); - if (this.recording) { - this.macro.pop(); - this.removeEventListener("exec", this.$addCommandToMacro); - - if (!this.macro.length) - this.macro = this.oldMacro; - - return this.recording = false; - } - if (!this.$addCommandToMacro) { - this.$addCommandToMacro = function(e) { - this.macro.push([e.command, e.args]); - }.bind(this); - } - - this.oldMacro = this.macro; - this.macro = []; - this.on("exec", this.$addCommandToMacro); - return this.recording = true; - }; - - this.replay = function(editor) { - if (this.$inReplay || !this.macro) - return; - - if (this.recording) - return this.toggleRecording(editor); - - try { - this.$inReplay = true; - this.macro.forEach(function(x) { - if (typeof x == "string") - this.exec(x, editor); - else - this.exec(x[0], editor, x[1]); - }, this); - } finally { - this.$inReplay = false; - } - }; - - this.trimMacro = function(m) { - return m.map(function(x){ - if (typeof x[0] != "string") - x[0] = x[0].name; - if (!x[1]) - x = x[0]; - return x; - }); - }; - -}).call(CommandManager.prototype); - -exports.CommandManager = CommandManager; - -}); - -ace.define('ace/keyboard/keybinding', ['require', 'exports', 'module' , 'ace/lib/keys', 'ace/lib/event'], function(require, exports, module) { - - -var keyUtil = require("../lib/keys"); -var event = require("../lib/event"); - -var KeyBinding = function(editor) { - this.$editor = editor; - this.$data = {}; - this.$handlers = []; - this.setDefaultHandler(editor.commands); -}; - -(function() { - this.setDefaultHandler = function(kb) { - this.removeKeyboardHandler(this.$defaultHandler); - this.$defaultHandler = kb; - this.addKeyboardHandler(kb, 0); - this.$data = {editor: this.$editor}; - }; - - this.setKeyboardHandler = function(kb) { - var h = this.$handlers; - if (h[h.length - 1] == kb) - return; - - while (h[h.length - 1] && h[h.length - 1] != this.$defaultHandler) - this.removeKeyboardHandler(h[h.length - 1]); - - this.addKeyboardHandler(kb, 1); - }; - - this.addKeyboardHandler = function(kb, pos) { - if (!kb) - return; - if (typeof kb == "function" && !kb.handleKeyboard) - kb.handleKeyboard = kb; - var i = this.$handlers.indexOf(kb); - if (i != -1) - this.$handlers.splice(i, 1); - - if (pos == undefined) - this.$handlers.push(kb); - else - this.$handlers.splice(pos, 0, kb); - - if (i == -1 && kb.attach) - kb.attach(this.$editor); - }; - - this.removeKeyboardHandler = function(kb) { - var i = this.$handlers.indexOf(kb); - if (i == -1) - return false; - this.$handlers.splice(i, 1); - kb.detach && kb.detach(this.$editor); - return true; - }; - - this.getKeyboardHandler = function() { - return this.$handlers[this.$handlers.length - 1]; - }; - - this.$callKeyboardHandlers = function (hashId, keyString, keyCode, e) { - var toExecute; - var success = false; - var commands = this.$editor.commands; - - for (var i = this.$handlers.length; i--;) { - toExecute = this.$handlers[i].handleKeyboard( - this.$data, hashId, keyString, keyCode, e - ); - if (!toExecute || !toExecute.command) - continue; - if (toExecute.command == "null") { - success = true; - } else { - success = commands.exec(toExecute.command, this.$editor, toExecute.args, e); - } - if (success && e && hashId != -1 && - toExecute.passEvent != true && toExecute.command.passEvent != true - ) { - event.stopEvent(e); - } - if (success) - break; - } - return success; - }; - - this.onCommandKey = function(e, hashId, keyCode) { - var keyString = keyUtil.keyCodeToString(keyCode); - this.$callKeyboardHandlers(hashId, keyString, keyCode, e); - }; - - this.onTextInput = function(text) { - var success = this.$callKeyboardHandlers(-1, text); - if (!success) - this.$editor.commands.exec("insertstring", this.$editor, text); - }; - -}).call(KeyBinding.prototype); - -exports.KeyBinding = KeyBinding; -}); - -ace.define('ace/keyboard/hash_handler', ['require', 'exports', 'module' , 'ace/lib/keys', 'ace/lib/useragent'], function(require, exports, module) { - - -var keyUtil = require("../lib/keys"); -var useragent = require("../lib/useragent"); - -function HashHandler(config, platform) { - this.platform = platform || (useragent.isMac ? "mac" : "win"); - this.commands = {}; - this.commandKeyBinding = {}; - if (this.__defineGetter__ && this.__defineSetter__ && typeof console != "undefined" && console.error) { - var warned = false; - var warn = function() { - if (!warned) { - warned = true; - console.error("commmandKeyBinding has too many m's. use commandKeyBinding"); - } - }; - this.__defineGetter__("commmandKeyBinding", function() { - warn(); - return this.commandKeyBinding; - }); - this.__defineSetter__("commmandKeyBinding", function(val) { - warn(); - return this.commandKeyBinding = val; - }); - } else { - this.commmandKeyBinding = this.commandKeyBinding; - } - - this.addCommands(config); -}; - -(function() { - - this.addCommand = function(command) { - if (this.commands[command.name]) - this.removeCommand(command); - - this.commands[command.name] = command; - - if (command.bindKey) - this._buildKeyHash(command); - }; - - this.removeCommand = function(command) { - var name = (typeof command === 'string' ? command : command.name); - command = this.commands[name]; - delete this.commands[name]; - var ckb = this.commandKeyBinding; - for (var hashId in ckb) { - for (var key in ckb[hashId]) { - if (ckb[hashId][key] == command) - delete ckb[hashId][key]; - } - } - }; - - this.bindKey = function(key, command) { - if(!key) - return; - if (typeof command == "function") { - this.addCommand({exec: command, bindKey: key, name: command.name || key}); - return; - } - - var ckb = this.commandKeyBinding; - key.split("|").forEach(function(keyPart) { - var binding = this.parseKeys(keyPart, command); - var hashId = binding.hashId; - (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; - }, this); - }; - - this.addCommands = function(commands) { - commands && Object.keys(commands).forEach(function(name) { - var command = commands[name]; - if (!command) - return; - - if (typeof command === "string") - return this.bindKey(command, name); - - if (typeof command === "function") - command = { exec: command }; - - if (typeof command !== "object") - return; - - if (!command.name) - command.name = name; - - this.addCommand(command); - }, this); - }; - - this.removeCommands = function(commands) { - Object.keys(commands).forEach(function(name) { - this.removeCommand(commands[name]); - }, this); - }; - - this.bindKeys = function(keyList) { - Object.keys(keyList).forEach(function(key) { - this.bindKey(key, keyList[key]); - }, this); - }; - - this._buildKeyHash = function(command) { - var binding = command.bindKey; - if (!binding) - return; - - var key = typeof binding == "string" ? binding: binding[this.platform]; - this.bindKey(key, command); - }; - this.parseKeys = function(keys) { - if (keys.indexOf(" ") != -1) - keys = keys.split(/\s+/).pop(); - - var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x}); - var key = parts.pop(); - - var keyCode = keyUtil[key]; - if (keyUtil.FUNCTION_KEYS[keyCode]) - key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase(); - else if (!parts.length) - return {key: key, hashId: -1}; - else if (parts.length == 1 && parts[0] == "shift") - return {key: key.toUpperCase(), hashId: -1}; - - var hashId = 0; - for (var i = parts.length; i--;) { - var modifier = keyUtil.KEY_MODS[parts[i]]; - if (modifier == null) { - if (typeof console != "undefined") - console.error("invalid modifier " + parts[i] + " in " + keys); - return false; - } - hashId |= modifier; - } - return {key: key, hashId: hashId}; - }; - - this.findKeyCommand = function findKeyCommand(hashId, keyString) { - var ckbr = this.commandKeyBinding; - return ckbr[hashId] && ckbr[hashId][keyString]; - }; - - this.handleKeyboard = function(data, hashId, keyString, keyCode) { - return { - command: this.findKeyCommand(hashId, keyString) - }; - }; - -}).call(HashHandler.prototype) - -exports.HashHandler = HashHandler; -}); - -ace.define('ace/mouse/fold_handler', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function FoldHandler(editor) { - - editor.on("click", function(e) { - var position = e.getDocumentPosition(); - var session = editor.session; - var fold = session.getFoldAt(position.row, position.column, 1); - if (fold) { - if (e.getAccelKey()) - session.removeFold(fold); - else - session.expandFold(fold); - - e.stop(); - } - }); - - editor.on("gutterclick", function(e) { - var gutterRegion = editor.renderer.$gutterLayer.getRegion(e); - - if (gutterRegion == "foldWidgets") { - var row = e.getDocumentPosition().row; - var session = editor.session; - if (session.foldWidgets && session.foldWidgets[row]) - editor.session.onFoldWidgetClick(row, e); - if (!editor.isFocused()) - editor.focus(); - e.stop(); - } - }); - - editor.on("gutterdblclick", function(e) { - var gutterRegion = editor.renderer.$gutterLayer.getRegion(e); - - if (gutterRegion == "foldWidgets") { - var row = e.getDocumentPosition().row; - var session = editor.session; - var data = session.getParentFoldRangeData(row, true); - var range = data.range || data.firstRange; - - if (range) { - row = range.start.row; - var fold = session.getFoldAt(row, session.getLine(row).length, 1); - - if (fold) { - session.removeFold(fold); - } else { - session.addFold("...", range); - editor.renderer.scrollCursorIntoView({row: range.start.row, column: 0}); - } - } - e.stop(); - } - }); -} - -exports.FoldHandler = FoldHandler; - -}); - -ace.define('ace/commands/default_commands', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/config'], function(require, exports, module) { - - -var lang = require("../lib/lang"); -var config = require("../config"); - -function bindKey(win, mac) { - return {win: win, mac: mac}; -} -exports.commands = [{ - name: "showSettingsMenu", - bindKey: bindKey("Ctrl-,", "Command-,"), - exec: function(editor) { - config.loadModule("ace/ext/settings_menu", function(module) { - module.init(editor); - editor.showSettingsMenu(); - }); - }, - readOnly: true -}, { - name: "goToNextError", - bindKey: bindKey("Alt-E", "Ctrl-E"), - exec: function(editor) { - config.loadModule("ace/ext/error_marker", function(module) { - module.showErrorMarker(editor, 1); - }); - }, - scrollIntoView: "animate", - readOnly: true -}, { - name: "goToPreviousError", - bindKey: bindKey("Alt-Shift-E", "Ctrl-Shift-E"), - exec: function(editor) { - config.loadModule("ace/ext/error_marker", function(module) { - module.showErrorMarker(editor, -1); - }); - }, - scrollIntoView: "animate", - readOnly: true -}, { - name: "selectall", - bindKey: bindKey("Ctrl-A", "Command-A"), - exec: function(editor) { editor.selectAll(); }, - readOnly: true -}, { - name: "centerselection", - bindKey: bindKey(null, "Ctrl-L"), - exec: function(editor) { editor.centerSelection(); }, - readOnly: true -}, { - name: "gotoline", - bindKey: bindKey("Ctrl-L", "Command-L"), - exec: function(editor) { - var line = parseInt(prompt("Enter line number:"), 10); - if (!isNaN(line)) { - editor.gotoLine(line); - } - }, - readOnly: true -}, { - name: "fold", - bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"), - exec: function(editor) { editor.session.toggleFold(false); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "unfold", - bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"), - exec: function(editor) { editor.session.toggleFold(true); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "toggleFoldWidget", - bindKey: bindKey("F2", "F2"), - exec: function(editor) { editor.session.toggleFoldWidget(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "toggleParentFoldWidget", - bindKey: bindKey("Alt-F2", "Alt-F2"), - exec: function(editor) { editor.session.toggleFoldWidget(true); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "foldall", - bindKey: bindKey("Ctrl-Alt-0", "Ctrl-Command-Option-0"), - exec: function(editor) { editor.session.foldAll(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "foldOther", - bindKey: bindKey("Alt-0", "Command-Option-0"), - exec: function(editor) { - editor.session.foldAll(); - editor.session.unfold(editor.selection.getAllRanges()); - }, - scrollIntoView: "center", - readOnly: true -}, { - name: "unfoldall", - bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"), - exec: function(editor) { editor.session.unfold(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "findnext", - bindKey: bindKey("Ctrl-K", "Command-G"), - exec: function(editor) { editor.findNext(); }, - readOnly: true -}, { - name: "findprevious", - bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), - exec: function(editor) { editor.findPrevious(); }, - readOnly: true -}, { - name: "selectOrFindNext", - bindKey: bindKey("ALt-K", "Ctrl-G"), - exec: function(editor) { - if (editor.selection.isEmpty()) - editor.selection.selectWord(); - else - editor.findNext(); - }, - readOnly: true -}, { - name: "selectOrFindPrevious", - bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"), - exec: function(editor) { - if (editor.selection.isEmpty()) - editor.selection.selectWord(); - else - editor.findPrevious(); - }, - readOnly: true -}, { - name: "find", - bindKey: bindKey("Ctrl-F", "Command-F"), - exec: function(editor) { - config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor)}); - }, - readOnly: true -}, { - name: "overwrite", - bindKey: "Insert", - exec: function(editor) { editor.toggleOverwrite(); }, - readOnly: true -}, { - name: "selecttostart", - bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Up"), - exec: function(editor) { editor.getSelection().selectFileStart(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "gotostart", - bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"), - exec: function(editor) { editor.navigateFileStart(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "selectup", - bindKey: bindKey("Shift-Up", "Shift-Up"), - exec: function(editor) { editor.getSelection().selectUp(); }, - multiSelectAction: "forEach", - readOnly: true -}, { - name: "golineup", - bindKey: bindKey("Up", "Up|Ctrl-P"), - exec: function(editor, args) { editor.navigateUp(args.times); }, - multiSelectAction: "forEach", - readOnly: true -}, { - name: "selecttoend", - bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-Down"), - exec: function(editor) { editor.getSelection().selectFileEnd(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "gotoend", - bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"), - exec: function(editor) { editor.navigateFileEnd(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "selectdown", - bindKey: bindKey("Shift-Down", "Shift-Down"), - exec: function(editor) { editor.getSelection().selectDown(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "golinedown", - bindKey: bindKey("Down", "Down|Ctrl-N"), - exec: function(editor, args) { editor.navigateDown(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectwordleft", - bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"), - exec: function(editor) { editor.getSelection().selectWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotowordleft", - bindKey: bindKey("Ctrl-Left", "Option-Left"), - exec: function(editor) { editor.navigateWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selecttolinestart", - bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"), - exec: function(editor) { editor.getSelection().selectLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotolinestart", - bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), - exec: function(editor) { editor.navigateLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectleft", - bindKey: bindKey("Shift-Left", "Shift-Left"), - exec: function(editor) { editor.getSelection().selectLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotoleft", - bindKey: bindKey("Left", "Left|Ctrl-B"), - exec: function(editor, args) { editor.navigateLeft(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectwordright", - bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"), - exec: function(editor) { editor.getSelection().selectWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotowordright", - bindKey: bindKey("Ctrl-Right", "Option-Right"), - exec: function(editor) { editor.navigateWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selecttolineend", - bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"), - exec: function(editor) { editor.getSelection().selectLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotolineend", - bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"), - exec: function(editor) { editor.navigateLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectright", - bindKey: bindKey("Shift-Right", "Shift-Right"), - exec: function(editor) { editor.getSelection().selectRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotoright", - bindKey: bindKey("Right", "Right|Ctrl-F"), - exec: function(editor, args) { editor.navigateRight(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectpagedown", - bindKey: "Shift-PageDown", - exec: function(editor) { editor.selectPageDown(); }, - readOnly: true -}, { - name: "pagedown", - bindKey: bindKey(null, "Option-PageDown"), - exec: function(editor) { editor.scrollPageDown(); }, - readOnly: true -}, { - name: "gotopagedown", - bindKey: bindKey("PageDown", "PageDown|Ctrl-V"), - exec: function(editor) { editor.gotoPageDown(); }, - readOnly: true -}, { - name: "selectpageup", - bindKey: "Shift-PageUp", - exec: function(editor) { editor.selectPageUp(); }, - readOnly: true -}, { - name: "pageup", - bindKey: bindKey(null, "Option-PageUp"), - exec: function(editor) { editor.scrollPageUp(); }, - readOnly: true -}, { - name: "gotopageup", - bindKey: "PageUp", - exec: function(editor) { editor.gotoPageUp(); }, - readOnly: true -}, { - name: "scrollup", - bindKey: bindKey("Ctrl-Up", null), - exec: function(e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); }, - readOnly: true -}, { - name: "scrolldown", - bindKey: bindKey("Ctrl-Down", null), - exec: function(e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); }, - readOnly: true -}, { - name: "selectlinestart", - bindKey: "Shift-Home", - exec: function(editor) { editor.getSelection().selectLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectlineend", - bindKey: "Shift-End", - exec: function(editor) { editor.getSelection().selectLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "togglerecording", - bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"), - exec: function(editor) { editor.commands.toggleRecording(editor); }, - readOnly: true -}, { - name: "replaymacro", - bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"), - exec: function(editor) { editor.commands.replay(editor); }, - readOnly: true -}, { - name: "jumptomatching", - bindKey: bindKey("Ctrl-P", "Ctrl-Shift-P"), - exec: function(editor) { editor.jumpToMatching(); }, - multiSelectAction: "forEach", - readOnly: true -}, { - name: "selecttomatching", - bindKey: bindKey("Ctrl-Shift-P", null), - exec: function(editor) { editor.jumpToMatching(true); }, - multiSelectAction: "forEach", - readOnly: true -}, -{ - name: "cut", - exec: function(editor) { - var range = editor.getSelectionRange(); - editor._emit("cut", range); - - if (!editor.selection.isEmpty()) { - editor.session.remove(range); - editor.clearSelection(); - } - }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "removeline", - bindKey: bindKey("Ctrl-D", "Command-D"), - exec: function(editor) { editor.removeLines(); }, - scrollIntoView: "cursor", - multiSelectAction: "forEachLine" -}, { - name: "duplicateSelection", - bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"), - exec: function(editor) { editor.duplicateSelection(); }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "sortlines", - bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"), - exec: function(editor) { editor.sortLines(); }, - scrollIntoView: "selection", - multiSelectAction: "forEachLine" -}, { - name: "togglecomment", - bindKey: bindKey("Ctrl-/", "Command-/"), - exec: function(editor) { editor.toggleCommentLines(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "toggleBlockComment", - bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"), - exec: function(editor) { editor.toggleBlockComment(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "modifyNumberUp", - bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"), - exec: function(editor) { editor.modifyNumber(1); }, - multiSelectAction: "forEach" -}, { - name: "modifyNumberDown", - bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"), - exec: function(editor) { editor.modifyNumber(-1); }, - multiSelectAction: "forEach" -}, { - name: "replace", - bindKey: bindKey("Ctrl-H", "Command-Option-F"), - exec: function(editor) { - config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor, true)}); - } -}, { - name: "undo", - bindKey: bindKey("Ctrl-Z", "Command-Z"), - exec: function(editor) { editor.undo(); } -}, { - name: "redo", - bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"), - exec: function(editor) { editor.redo(); } -}, { - name: "copylinesup", - bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"), - exec: function(editor) { editor.copyLinesUp(); }, - scrollIntoView: "cursor" -}, { - name: "movelinesup", - bindKey: bindKey("Alt-Up", "Option-Up"), - exec: function(editor) { editor.moveLinesUp(); }, - scrollIntoView: "cursor" -}, { - name: "copylinesdown", - bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"), - exec: function(editor) { editor.copyLinesDown(); }, - scrollIntoView: "cursor" -}, { - name: "movelinesdown", - bindKey: bindKey("Alt-Down", "Option-Down"), - exec: function(editor) { editor.moveLinesDown(); }, - scrollIntoView: "cursor" -}, { - name: "del", - bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"), - exec: function(editor) { editor.remove("right"); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "backspace", - bindKey: bindKey( - "Shift-Backspace|Backspace", - "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H" - ), - exec: function(editor) { editor.remove("left"); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "cut_or_delete", - bindKey: bindKey("Shift-Delete", null), - exec: function(editor) { - if (editor.selection.isEmpty()) { - editor.remove("left"); - } else { - return false; - } - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removetolinestart", - bindKey: bindKey("Alt-Backspace", "Command-Backspace"), - exec: function(editor) { editor.removeToLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removetolineend", - bindKey: bindKey("Alt-Delete", "Ctrl-K"), - exec: function(editor) { editor.removeToLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removewordleft", - bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"), - exec: function(editor) { editor.removeWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removewordright", - bindKey: bindKey("Ctrl-Delete", "Alt-Delete"), - exec: function(editor) { editor.removeWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "outdent", - bindKey: bindKey("Shift-Tab", "Shift-Tab"), - exec: function(editor) { editor.blockOutdent(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "indent", - bindKey: bindKey("Tab", "Tab"), - exec: function(editor) { editor.indent(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "blockoutdent", - bindKey: bindKey("Ctrl-[", "Ctrl-["), - exec: function(editor) { editor.blockOutdent(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "blockindent", - bindKey: bindKey("Ctrl-]", "Ctrl-]"), - exec: function(editor) { editor.blockIndent(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "insertstring", - exec: function(editor, str) { editor.insert(str); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "inserttext", - exec: function(editor, args) { - editor.insert(lang.stringRepeat(args.text || "", args.times || 1)); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "splitline", - bindKey: bindKey(null, "Ctrl-O"), - exec: function(editor) { editor.splitLine(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "transposeletters", - bindKey: bindKey("Ctrl-T", "Ctrl-T"), - exec: function(editor) { editor.transposeLetters(); }, - multiSelectAction: function(editor) {editor.transposeSelections(1); }, - scrollIntoView: "cursor" -}, { - name: "touppercase", - bindKey: bindKey("Ctrl-U", "Ctrl-U"), - exec: function(editor) { editor.toUpperCase(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "tolowercase", - bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"), - exec: function(editor) { editor.toLowerCase(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}]; - -}); - -ace.define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) { - - -var EventEmitter = {}; -var stopPropagation = function() { this.propagationStopped = true; }; -var preventDefault = function() { this.defaultPrevented = true; }; - -EventEmitter._emit = -EventEmitter._dispatchEvent = function(eventName, e) { - this._eventRegistry || (this._eventRegistry = {}); - this._defaultHandlers || (this._defaultHandlers = {}); - - var listeners = this._eventRegistry[eventName] || []; - var defaultHandler = this._defaultHandlers[eventName]; - if (!listeners.length && !defaultHandler) - return; - - if (typeof e != "object" || !e) - e = {}; - - if (!e.type) - e.type = eventName; - if (!e.stopPropagation) - e.stopPropagation = stopPropagation; - if (!e.preventDefault) - e.preventDefault = preventDefault; - - listeners = listeners.slice(); - for (var i=0; i 0; - }; - this.hasRedo = function() { - return this.$redoStack.length > 0; - }; - this.markClean = function() { - this.dirtyCounter = 0; - }; - this.isClean = function() { - return this.dirtyCounter === 0; - }; - -}).call(UndoManager.prototype); - -exports.UndoManager = UndoManager; -}); -ace.define('ace/lib/net', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -var dom = require("./dom"); - -exports.get = function (url, callback) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - callback(xhr.responseText); - } - }; - xhr.send(null); -}; - -exports.loadScript = function(path, callback) { - var head = dom.getDocumentHead(); - var s = document.createElement('script'); - - s.src = path; - head.appendChild(s); - - s.onload = s.onreadystatechange = function(_, isAbort) { - if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") { - s = s.onload = s.onreadystatechange = null; - if (!isAbort) - callback(); - } - }; -}; - -}); - -ace.define('ace/virtual_renderer', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/config', 'ace/layer/gutter', 'ace/layer/marker', 'ace/layer/text', 'ace/layer/cursor', 'ace/scrollbar', 'ace/renderloop', 'ace/layer/font_metrics', 'ace/lib/event_emitter'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -var config = require("./config"); -var GutterLayer = require("./layer/gutter").Gutter; -var MarkerLayer = require("./layer/marker").Marker; -var TextLayer = require("./layer/text").Text; -var CursorLayer = require("./layer/cursor").Cursor; -var HScrollBar = require("./scrollbar").HScrollBar; -var VScrollBar = require("./scrollbar").VScrollBar; -var RenderLoop = require("./renderloop").RenderLoop; -var FontMetrics = require("./layer/font_metrics").FontMetrics; -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var editorCss = ".ace_editor {\ -position: relative;\ -overflow: hidden;\ -font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\ -font-size: 12px;\ -line-height: normal;\ -direction: ltr;\ -}\ -.ace_scroller {\ -position: absolute;\ -overflow: hidden;\ -top: 0;\ -bottom: 0;\ -background-color: inherit;\ --ms-user-select: none;\ --moz-user-select: none;\ --webkit-user-select: none;\ -user-select: none;\ -}\ -.ace_content {\ -position: absolute;\ --moz-box-sizing: border-box;\ --webkit-box-sizing: border-box;\ -box-sizing: border-box;\ -cursor: text;\ -min-width: 100%;\ -}\ -.ace_dragging, .ace_dragging * {\ -cursor: move !important;\ -}\ -.ace_dragging .ace_scroller:before{\ -position: absolute;\ -top: 0;\ -left: 0;\ -right: 0;\ -bottom: 0;\ -content: '';\ -background: rgba(250, 250, 250, 0.01);\ -z-index: 1000;\ -}\ -.ace_dragging.ace_dark .ace_scroller:before{\ -background: rgba(0, 0, 0, 0.01);\ -}\ -.ace_selecting, .ace_selecting * {\ -cursor: text !important;\ -}\ -.ace_gutter {\ -position: absolute;\ -overflow : hidden;\ -width: auto;\ -top: 0;\ -bottom: 0;\ -left: 0;\ -cursor: default;\ -z-index: 4;\ --ms-user-select: none;\ --moz-user-select: none;\ --webkit-user-select: none;\ -user-select: none;\ -}\ -.ace_gutter-active-line {\ -position: absolute;\ -left: 0;\ -right: 0;\ -}\ -.ace_scroller.ace_scroll-left {\ -box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\ -}\ -.ace_gutter-cell {\ -padding-left: 19px;\ -padding-right: 6px;\ -background-repeat: no-repeat;\ -}\ -.ace_gutter-cell.ace_error {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");\ -background-repeat: no-repeat;\ -background-position: 2px center;\ -}\ -.ace_gutter-cell.ace_warning {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");\ -background-position: 2px center;\ -}\ -.ace_gutter-cell.ace_info {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");\ -background-position: 2px center;\ -}\ -.ace_dark .ace_gutter-cell.ace_info {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");\ -}\ -.ace_scrollbar {\ -position: absolute;\ -right: 0;\ -bottom: 0;\ -z-index: 6;\ -}\ -.ace_scrollbar-inner {\ -position: absolute;\ -cursor: text;\ -left: 0;\ -top: 0;\ -}\ -.ace_scrollbar-v{\ -overflow-x: hidden;\ -overflow-y: scroll;\ -top: 0;\ -}\ -.ace_scrollbar-h {\ -overflow-x: scroll;\ -overflow-y: hidden;\ -left: 0;\ -}\ -.ace_print-margin {\ -position: absolute;\ -height: 100%;\ -}\ -.ace_text-input {\ -position: absolute;\ -z-index: 0;\ -width: 0.5em;\ -height: 1em;\ -opacity: 0;\ -background: transparent;\ --moz-appearance: none;\ -appearance: none;\ -border: none;\ -resize: none;\ -outline: none;\ -overflow: hidden;\ -font: inherit;\ -padding: 0 1px;\ -margin: 0 -1px;\ -text-indent: -1em;\ --ms-user-select: text;\ --moz-user-select: text;\ --webkit-user-select: text;\ -user-select: text;\ -}\ -.ace_text-input.ace_composition {\ -background: #f8f8f8;\ -color: #111;\ -z-index: 1000;\ -opacity: 1;\ -text-indent: 0;\ -}\ -.ace_layer {\ -z-index: 1;\ -position: absolute;\ -overflow: hidden;\ -white-space: pre;\ -height: 100%;\ -width: 100%;\ --moz-box-sizing: border-box;\ --webkit-box-sizing: border-box;\ -box-sizing: border-box;\ -/* setting pointer-events: auto; on node under the mouse, which changes\ -during scroll, will break mouse wheel scrolling in Safari */\ -pointer-events: none;\ -}\ -.ace_gutter-layer {\ -position: relative;\ -width: auto;\ -text-align: right;\ -pointer-events: auto;\ -}\ -.ace_text-layer {\ -font: inherit !important;\ -}\ -.ace_cjk {\ -display: inline-block;\ -text-align: center;\ -}\ -.ace_cursor-layer {\ -z-index: 4;\ -}\ -.ace_cursor {\ -z-index: 4;\ -position: absolute;\ --moz-box-sizing: border-box;\ --webkit-box-sizing: border-box;\ -box-sizing: border-box;\ -border-left: 2px solid\ -}\ -.ace_slim-cursors .ace_cursor {\ -border-left-width: 1px;\ -}\ -.ace_overwrite-cursors .ace_cursor {\ -border-left-width: 0px;\ -border-bottom: 1px solid;\ -}\ -.ace_hidden-cursors .ace_cursor {\ -opacity: 0.2;\ -}\ -.ace_smooth-blinking .ace_cursor {\ --moz-transition: opacity 0.18s;\ --webkit-transition: opacity 0.18s;\ --o-transition: opacity 0.18s;\ --ms-transition: opacity 0.18s;\ -transition: opacity 0.18s;\ -}\ -.ace_editor.ace_multiselect .ace_cursor {\ -border-left-width: 1px;\ -}\ -.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\ -position: absolute;\ -z-index: 3;\ -}\ -.ace_marker-layer .ace_selection {\ -position: absolute;\ -z-index: 5;\ -}\ -.ace_marker-layer .ace_bracket {\ -position: absolute;\ -z-index: 6;\ -}\ -.ace_marker-layer .ace_active-line {\ -position: absolute;\ -z-index: 2;\ -}\ -.ace_marker-layer .ace_selected-word {\ -position: absolute;\ -z-index: 4;\ --moz-box-sizing: border-box;\ --webkit-box-sizing: border-box;\ -box-sizing: border-box;\ -}\ -.ace_line .ace_fold {\ --moz-box-sizing: border-box;\ --webkit-box-sizing: border-box;\ -box-sizing: border-box;\ -display: inline-block;\ -height: 11px;\ -margin-top: -2px;\ -vertical-align: middle;\ -background-image:\ -url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\ -url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\ -background-repeat: no-repeat, repeat-x;\ -background-position: center center, top left;\ -color: transparent;\ -border: 1px solid black;\ --moz-border-radius: 2px;\ --webkit-border-radius: 2px;\ -border-radius: 2px;\ -cursor: pointer;\ -pointer-events: auto;\ -}\ -.ace_dark .ace_fold {\ -}\ -.ace_fold:hover{\ -background-image:\ -url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\ -url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\ -}\ -.ace_tooltip {\ -background-color: #FFF;\ -background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));\ -background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));\ -border: 1px solid gray;\ -border-radius: 1px;\ -box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\ -color: black;\ -display: block;\ -max-width: 100%;\ -padding: 3px 4px;\ -position: fixed;\ -z-index: 999999;\ --moz-box-sizing: border-box;\ --webkit-box-sizing: border-box;\ -box-sizing: border-box;\ -cursor: default;\ -white-space: pre;\ -word-wrap: break-word;\ -line-height: normal;\ -font-style: normal;\ -font-weight: normal;\ -letter-spacing: normal;\ -pointer-events: none;\ -}\ -.ace_folding-enabled > .ace_gutter-cell {\ -padding-right: 13px;\ -}\ -.ace_fold-widget {\ --moz-box-sizing: border-box;\ --webkit-box-sizing: border-box;\ -box-sizing: border-box;\ -margin: 0 -12px 0 1px;\ -display: none;\ -width: 11px;\ -vertical-align: top;\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\ -background-repeat: no-repeat;\ -background-position: center;\ -border-radius: 3px;\ -border: 1px solid transparent;\ -cursor: pointer;\ -}\ -.ace_folding-enabled .ace_fold-widget {\ -display: inline-block; \ -}\ -.ace_fold-widget.ace_end {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\ -}\ -.ace_fold-widget.ace_closed {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\ -}\ -.ace_fold-widget:hover {\ -border: 1px solid rgba(0, 0, 0, 0.3);\ -background-color: rgba(255, 255, 255, 0.2);\ --moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\ --webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\ -box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\ -}\ -.ace_fold-widget:active {\ -border: 1px solid rgba(0, 0, 0, 0.4);\ -background-color: rgba(0, 0, 0, 0.05);\ --moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\ --webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\ -box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\ -}\ -/**\ -* Dark version for fold widgets\ -*/\ -.ace_dark .ace_fold-widget {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\ -}\ -.ace_dark .ace_fold-widget.ace_end {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\ -}\ -.ace_dark .ace_fold-widget.ace_closed {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\ -}\ -.ace_dark .ace_fold-widget:hover {\ -box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ -background-color: rgba(255, 255, 255, 0.1);\ -}\ -.ace_dark .ace_fold-widget:active {\ --moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ --webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ -box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ -}\ -.ace_fold-widget.ace_invalid {\ -background-color: #FFB4B4;\ -border-color: #DE5555;\ -}\ -.ace_fade-fold-widgets .ace_fold-widget {\ --moz-transition: opacity 0.4s ease 0.05s;\ --webkit-transition: opacity 0.4s ease 0.05s;\ --o-transition: opacity 0.4s ease 0.05s;\ --ms-transition: opacity 0.4s ease 0.05s;\ -transition: opacity 0.4s ease 0.05s;\ -opacity: 0;\ -}\ -.ace_fade-fold-widgets:hover .ace_fold-widget {\ --moz-transition: opacity 0.05s ease 0.05s;\ --webkit-transition: opacity 0.05s ease 0.05s;\ --o-transition: opacity 0.05s ease 0.05s;\ --ms-transition: opacity 0.05s ease 0.05s;\ -transition: opacity 0.05s ease 0.05s;\ -opacity:1;\ -}\ -.ace_underline {\ -text-decoration: underline;\ -}\ -.ace_bold {\ -font-weight: bold;\ -}\ -.ace_nobold .ace_bold {\ -font-weight: normal;\ -}\ -.ace_italic {\ -font-style: italic;\ -}\ -.ace_error-marker {\ -background-color: rgba(255, 0, 0,0.2);\ -position: absolute;\ -z-index: 9;\ -}\ -.ace_highlight-marker {\ -background-color: rgba(255, 255, 0,0.2);\ -position: absolute;\ -z-index: 8;\ -}\ -"; - -dom.importCssString(editorCss, "ace_editor"); - -var VirtualRenderer = function(container, theme) { - var _self = this; - - this.container = container || dom.createElement("div"); - this.$keepTextAreaAtCursor = true; - - dom.addCssClass(this.container, "ace_editor"); - - this.setTheme(theme); - - this.$gutter = dom.createElement("div"); - this.$gutter.className = "ace_gutter"; - this.container.appendChild(this.$gutter); - - this.scroller = dom.createElement("div"); - this.scroller.className = "ace_scroller"; - this.container.appendChild(this.scroller); - - this.content = dom.createElement("div"); - this.content.className = "ace_content"; - this.scroller.appendChild(this.content); - - this.$gutterLayer = new GutterLayer(this.$gutter); - this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)); - - this.$markerBack = new MarkerLayer(this.content); - - var textLayer = this.$textLayer = new TextLayer(this.content); - this.canvas = textLayer.element; - - this.$markerFront = new MarkerLayer(this.content); - - this.$cursorLayer = new CursorLayer(this.content); - this.$horizScroll = false; - this.$vScroll = false; - - this.scrollBar = - this.scrollBarV = new VScrollBar(this.container, this); - this.scrollBarH = new HScrollBar(this.container, this); - this.scrollBarV.addEventListener("scroll", function(e) { - if (!_self.$scrollAnimation) - _self.session.setScrollTop(e.data - _self.scrollMargin.top); - }); - this.scrollBarH.addEventListener("scroll", function(e) { - if (!_self.$scrollAnimation) - _self.session.setScrollLeft(e.data - _self.scrollMargin.left); - }); - - this.scrollTop = 0; - this.scrollLeft = 0; - - this.cursorPos = { - row : 0, - column : 0 - }; - - this.$fontMetrics = new FontMetrics(this.container, 500); - this.$textLayer.$setFontMetrics(this.$fontMetrics); - this.$textLayer.addEventListener("changeCharacterSize", function(e) { - _self.updateCharacterSize(); - _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); - _self._signal("changeCharacterSize", e); - }); - - this.$size = { - width: 0, - height: 0, - scrollerHeight: 0, - scrollerWidth: 0, - $dirty: true - }; - - this.layerConfig = { - width : 1, - padding : 0, - firstRow : 0, - firstRowScreen: 0, - lastRow : 0, - lineHeight : 0, - characterWidth : 0, - minHeight : 1, - maxHeight : 1, - offset : 0, - height : 1, - gutterOffset: 1 - }; - - this.scrollMargin = { - left: 0, - right: 0, - top: 0, - bottom: 0, - v: 0, - h: 0 - }; - - this.$loop = new RenderLoop( - this.$renderChanges.bind(this), - this.container.ownerDocument.defaultView - ); - this.$loop.schedule(this.CHANGE_FULL); - - this.updateCharacterSize(); - this.setPadding(4); - config.resetOptions(this); - config._emit("renderer", this); -}; - -(function() { - - this.CHANGE_CURSOR = 1; - this.CHANGE_MARKER = 2; - this.CHANGE_GUTTER = 4; - this.CHANGE_SCROLL = 8; - this.CHANGE_LINES = 16; - this.CHANGE_TEXT = 32; - this.CHANGE_SIZE = 64; - this.CHANGE_MARKER_BACK = 128; - this.CHANGE_MARKER_FRONT = 256; - this.CHANGE_FULL = 512; - this.CHANGE_H_SCROLL = 1024; - - oop.implement(this, EventEmitter); - - this.updateCharacterSize = function() { - if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) { - this.$allowBoldFonts = this.$textLayer.allowBoldFonts; - this.setStyle("ace_nobold", !this.$allowBoldFonts); - } - - this.layerConfig.characterWidth = - this.characterWidth = this.$textLayer.getCharacterWidth(); - this.layerConfig.lineHeight = - this.lineHeight = this.$textLayer.getLineHeight(); - this.$updatePrintMargin(); - }; - this.setSession = function(session) { - if (this.session) - this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode); - - this.session = session; - if (!session) - return; - - if (this.scrollMargin.top && session.getScrollTop() <= 0) - session.setScrollTop(-this.scrollMargin.top); - - this.$cursorLayer.setSession(session); - this.$markerBack.setSession(session); - this.$markerFront.setSession(session); - this.$gutterLayer.setSession(session); - this.$textLayer.setSession(session); - this.$loop.schedule(this.CHANGE_FULL); - this.session.$setFontMetrics(this.$fontMetrics); - - this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this); - this.onChangeNewLineMode() - this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode); - }; - this.updateLines = function(firstRow, lastRow) { - if (lastRow === undefined) - lastRow = Infinity; - - if (!this.$changedLines) { - this.$changedLines = { - firstRow: firstRow, - lastRow: lastRow - }; - } - else { - if (this.$changedLines.firstRow > firstRow) - this.$changedLines.firstRow = firstRow; - - if (this.$changedLines.lastRow < lastRow) - this.$changedLines.lastRow = lastRow; - } - - if (this.$changedLines.firstRow > this.layerConfig.lastRow || - this.$changedLines.lastRow < this.layerConfig.firstRow) - return; - this.$loop.schedule(this.CHANGE_LINES); - }; - - this.onChangeNewLineMode = function() { - this.$loop.schedule(this.CHANGE_TEXT); - this.$textLayer.$updateEolChar(); - }; - - this.onChangeTabSize = function() { - this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER); - this.$textLayer.onChangeTabSize(); - }; - this.updateText = function() { - this.$loop.schedule(this.CHANGE_TEXT); - }; - this.updateFull = function(force) { - if (force) - this.$renderChanges(this.CHANGE_FULL, true); - else - this.$loop.schedule(this.CHANGE_FULL); - }; - this.updateFontSize = function() { - this.$textLayer.checkForSizeChanges(); - }; - - this.$changes = 0; - this.$updateSizeAsync = function() { - if (this.$loop.pending) - this.$size.$dirty = true; - else - this.onResize(); - }; - this.onResize = function(force, gutterWidth, width, height) { - if (this.resizing > 2) - return; - else if (this.resizing > 0) - this.resizing++; - else - this.resizing = force ? 1 : 0; - var el = this.container; - if (!height) - height = el.clientHeight || el.scrollHeight; - if (!width) - width = el.clientWidth || el.scrollWidth; - var changes = this.$updateCachedSize(force, gutterWidth, width, height); - - if (!this.$size.scrollerHeight || (!width && !height)) - return this.resizing = 0; - - if (force) - this.$gutterLayer.$padding = null; - - if (force) - this.$renderChanges(changes | this.$changes, true); - else - this.$loop.schedule(changes | this.$changes); - - if (this.resizing) - this.resizing = 0; - }; - - this.$updateCachedSize = function(force, gutterWidth, width, height) { - height -= (this.$extraHeight || 0); - var changes = 0; - var size = this.$size; - var oldSize = { - width: size.width, - height: size.height, - scrollerHeight: size.scrollerHeight, - scrollerWidth: size.scrollerWidth - }; - if (height && (force || size.height != height)) { - size.height = height; - changes |= this.CHANGE_SIZE; - - size.scrollerHeight = size.height; - if (this.$horizScroll) - size.scrollerHeight -= this.scrollBarH.getHeight(); - this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px"; - - changes = changes | this.CHANGE_SCROLL; - } - - if (width && (force || size.width != width)) { - changes |= this.CHANGE_SIZE; - size.width = width; - - if (gutterWidth == null) - gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; - - this.gutterWidth = gutterWidth; - - this.scrollBarH.element.style.left = - this.scroller.style.left = gutterWidth + "px"; - size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth()); - - this.scrollBarH.element.style.right = - this.scroller.style.right = this.scrollBarV.getWidth() + "px"; - this.scroller.style.bottom = this.scrollBarH.getHeight() + "px"; - - if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) - changes |= this.CHANGE_FULL; - } - - size.$dirty = !width || !height; - - if (changes) - this._signal("resize", oldSize); - - return changes; - }; - - this.onGutterResize = function() { - var gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; - if (gutterWidth != this.gutterWidth) - this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height); - - if (this.session.getUseWrapMode() && this.adjustWrapLimit()) { - this.$loop.schedule(this.CHANGE_FULL); - } else if (this.$size.$dirty) { - this.$loop.schedule(this.CHANGE_FULL); - } else { - this.$computeLayerConfig(); - this.$loop.schedule(this.CHANGE_MARKER); - } - }; - this.adjustWrapLimit = function() { - var availableWidth = this.$size.scrollerWidth - this.$padding * 2; - var limit = Math.floor(availableWidth / this.characterWidth); - return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn); - }; - this.setAnimatedScroll = function(shouldAnimate){ - this.setOption("animatedScroll", shouldAnimate); - }; - this.getAnimatedScroll = function() { - return this.$animatedScroll; - }; - this.setShowInvisibles = function(showInvisibles) { - this.setOption("showInvisibles", showInvisibles); - }; - this.getShowInvisibles = function() { - return this.getOption("showInvisibles"); - }; - this.getDisplayIndentGuides = function() { - return this.getOption("displayIndentGuides"); - }; - - this.setDisplayIndentGuides = function(display) { - this.setOption("displayIndentGuides", display); - }; - this.setShowPrintMargin = function(showPrintMargin) { - this.setOption("showPrintMargin", showPrintMargin); - }; - this.getShowPrintMargin = function() { - return this.getOption("showPrintMargin"); - }; - this.setPrintMarginColumn = function(showPrintMargin) { - this.setOption("printMarginColumn", showPrintMargin); - }; - this.getPrintMarginColumn = function() { - return this.getOption("printMarginColumn"); - }; - this.getShowGutter = function(){ - return this.getOption("showGutter"); - }; - this.setShowGutter = function(show){ - return this.setOption("showGutter", show); - }; - - this.getFadeFoldWidgets = function(){ - return this.getOption("fadeFoldWidgets") - }; - - this.setFadeFoldWidgets = function(show) { - this.setOption("fadeFoldWidgets", show); - }; - - this.setHighlightGutterLine = function(shouldHighlight) { - this.setOption("highlightGutterLine", shouldHighlight); - }; - - this.getHighlightGutterLine = function() { - return this.getOption("highlightGutterLine"); - }; - - this.$updateGutterLineHighlight = function() { - var pos = this.$cursorLayer.$pixelPos; - var height = this.layerConfig.lineHeight; - if (this.session.getUseWrapMode()) { - var cursor = this.session.selection.getCursor(); - cursor.column = 0; - pos = this.$cursorLayer.getPixelPosition(cursor, true); - height *= this.session.getRowLength(cursor.row); - } - this.$gutterLineHighlight.style.top = pos.top - this.layerConfig.offset + "px"; - this.$gutterLineHighlight.style.height = height + "px"; - }; - - this.$updatePrintMargin = function() { - if (!this.$showPrintMargin && !this.$printMarginEl) - return; - - if (!this.$printMarginEl) { - var containerEl = dom.createElement("div"); - containerEl.className = "ace_layer ace_print-margin-layer"; - this.$printMarginEl = dom.createElement("div"); - this.$printMarginEl.className = "ace_print-margin"; - containerEl.appendChild(this.$printMarginEl); - this.content.insertBefore(containerEl, this.content.firstChild); - } - - var style = this.$printMarginEl.style; - style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px"; - style.visibility = this.$showPrintMargin ? "visible" : "hidden"; - - if (this.session && this.session.$wrap == -1) - this.adjustWrapLimit(); - }; - this.getContainerElement = function() { - return this.container; - }; - this.getMouseEventTarget = function() { - return this.content; - }; - this.getTextAreaContainer = function() { - return this.container; - }; - this.$moveTextAreaToCursor = function() { - if (!this.$keepTextAreaAtCursor) - return; - var config = this.layerConfig; - var posTop = this.$cursorLayer.$pixelPos.top; - var posLeft = this.$cursorLayer.$pixelPos.left; - posTop -= config.offset; - - var h = this.lineHeight; - if (posTop < 0 || posTop > config.height - h) - return; - - var w = this.characterWidth; - if (this.$composition) { - var val = this.textarea.value.replace(/^\x01+/, ""); - w *= (this.session.$getStringScreenWidth(val)[0]+2); - h += 2; - posTop -= 1; - } - posLeft -= this.scrollLeft; - if (posLeft > this.$size.scrollerWidth - w) - posLeft = this.$size.scrollerWidth - w; - - posLeft -= this.scrollBar.width; - - this.textarea.style.height = h + "px"; - this.textarea.style.width = w + "px"; - this.textarea.style.right = Math.max(0, this.$size.scrollerWidth - posLeft - w) + "px"; - this.textarea.style.bottom = Math.max(0, this.$size.height - posTop - h) + "px"; - }; - this.getFirstVisibleRow = function() { - return this.layerConfig.firstRow; - }; - this.getFirstFullyVisibleRow = function() { - return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1); - }; - this.getLastFullyVisibleRow = function() { - var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight); - return this.layerConfig.firstRow - 1 + flint; - }; - this.getLastVisibleRow = function() { - return this.layerConfig.lastRow; - }; - - this.$padding = null; - this.setPadding = function(padding) { - this.$padding = padding; - this.$textLayer.setPadding(padding); - this.$cursorLayer.setPadding(padding); - this.$markerFront.setPadding(padding); - this.$markerBack.setPadding(padding); - this.$loop.schedule(this.CHANGE_FULL); - this.$updatePrintMargin(); - }; - - this.setScrollMargin = function(top, bottom, left, right) { - var sm = this.scrollMargin; - sm.top = top|0; - sm.bottom = bottom|0; - sm.right = right|0; - sm.left = left|0; - sm.v = sm.top + sm.bottom; - sm.h = sm.left + sm.right; - if (sm.top && this.scrollTop <= 0 && this.session) - this.session.setScrollTop(-sm.top); - this.updateFull(); - }; - this.getHScrollBarAlwaysVisible = function() { - return this.$hScrollBarAlwaysVisible; - }; - this.setHScrollBarAlwaysVisible = function(alwaysVisible) { - this.setOption("hScrollBarAlwaysVisible", alwaysVisible); - }; - this.getVScrollBarAlwaysVisible = function() { - return this.$hScrollBarAlwaysVisible; - }; - this.setVScrollBarAlwaysVisible = function(alwaysVisible) { - this.setOption("vScrollBarAlwaysVisible", alwaysVisible); - }; - - this.$updateScrollBarV = function() { - this.scrollBarV.setScrollHeight(this.layerConfig.maxHeight + this.scrollMargin.v); - this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top); - }; - this.$updateScrollBarH = function() { - this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h); - this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left); - }; - - this.$frozen = false; - this.freeze = function() { - this.$frozen = true; - }; - - this.unfreeze = function() { - this.$frozen = false; - }; - - this.$renderChanges = function(changes, force) { - if (this.$changes) { - changes |= this.$changes; - this.$changes = 0; - } - if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) { - this.$changes |= changes; - return; - } - if (this.$size.$dirty) { - this.$changes |= changes; - return this.onResize(true); - } - if (!this.lineHeight) { - this.$textLayer.checkForSizeChanges(); - } - - this._signal("beforeRender"); - var config = this.layerConfig; - if (changes & this.CHANGE_FULL || - changes & this.CHANGE_SIZE || - changes & this.CHANGE_TEXT || - changes & this.CHANGE_LINES || - changes & this.CHANGE_SCROLL || - changes & this.CHANGE_H_SCROLL - ) { - changes |= this.$computeLayerConfig(); - config = this.layerConfig; - this.$updateScrollBarV(); - if (changes & this.CHANGE_H_SCROLL) - this.$updateScrollBarH(); - this.$gutterLayer.element.style.marginTop = (-config.offset) + "px"; - this.content.style.marginTop = (-config.offset) + "px"; - this.content.style.width = config.width + 2 * this.$padding + "px"; - this.content.style.height = config.minHeight + "px"; - } - if (changes & this.CHANGE_H_SCROLL) { - this.content.style.marginLeft = -this.scrollLeft + "px"; - this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left"; - } - if (changes & this.CHANGE_FULL) { - this.$textLayer.update(config); - if (this.$showGutter) - this.$gutterLayer.update(config); - this.$markerBack.update(config); - this.$markerFront.update(config); - this.$cursorLayer.update(config); - this.$moveTextAreaToCursor(); - this.$highlightGutterLine && this.$updateGutterLineHighlight(); - this._signal("afterRender"); - return; - } - if (changes & this.CHANGE_SCROLL) { - if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES) - this.$textLayer.update(config); - else - this.$textLayer.scrollLines(config); - - if (this.$showGutter) - this.$gutterLayer.update(config); - this.$markerBack.update(config); - this.$markerFront.update(config); - this.$cursorLayer.update(config); - this.$highlightGutterLine && this.$updateGutterLineHighlight(); - this.$moveTextAreaToCursor(); - this._signal("afterRender"); - return; - } - - if (changes & this.CHANGE_TEXT) { - this.$textLayer.update(config); - if (this.$showGutter) - this.$gutterLayer.update(config); - } - else if (changes & this.CHANGE_LINES) { - if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter) - this.$gutterLayer.update(config); - } - else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) { - if (this.$showGutter) - this.$gutterLayer.update(config); - } - - if (changes & this.CHANGE_CURSOR) { - this.$cursorLayer.update(config); - this.$moveTextAreaToCursor(); - this.$highlightGutterLine && this.$updateGutterLineHighlight(); - } - - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) { - this.$markerFront.update(config); - } - - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) { - this.$markerBack.update(config); - } - - this._signal("afterRender"); - }; - - - this.$autosize = function() { - var height = this.session.getScreenLength() * this.lineHeight; - var maxHeight = this.$maxLines * this.lineHeight; - var desiredHeight = Math.max( - (this.$minLines||1) * this.lineHeight, - Math.min(maxHeight, height) - ) + this.scrollMargin.v + (this.$extraHeight || 0); - var vScroll = height > maxHeight; - - if (desiredHeight != this.desiredHeight || - this.$size.height != this.desiredHeight || vScroll != this.$vScroll) { - if (vScroll != this.$vScroll) { - this.$vScroll = vScroll; - this.scrollBarV.setVisible(vScroll); - } - - var w = this.container.clientWidth; - this.container.style.height = desiredHeight + "px"; - this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight); - this.desiredHeight = desiredHeight; - } - }; - - this.$computeLayerConfig = function() { - if (this.$maxLines && this.lineHeight > 1) - this.$autosize(); - - var session = this.session; - var size = this.$size; - - var hideScrollbars = size.height <= 2 * this.lineHeight; - var screenLines = this.session.getScreenLength(); - var maxHeight = screenLines * this.lineHeight; - - var offset = this.scrollTop % this.lineHeight; - var minHeight = size.scrollerHeight + this.lineHeight; - - var longestLine = this.$getLongestLine(); - - var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible || - size.scrollerWidth - longestLine - 2 * this.$padding < 0); - - var hScrollChanged = this.$horizScroll !== horizScroll; - if (hScrollChanged) { - this.$horizScroll = horizScroll; - this.scrollBarH.setVisible(horizScroll); - } - - if (!this.$maxLines && this.$scrollPastEnd) { - if (this.scrollTop > maxHeight - size.scrollerHeight) - maxHeight += Math.min( - (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd, - this.scrollTop - maxHeight + size.scrollerHeight - ); - } - - var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible || - size.scrollerHeight - maxHeight < 0); - var vScrollChanged = this.$vScroll !== vScroll; - if (vScrollChanged) { - this.$vScroll = vScroll; - this.scrollBarV.setVisible(vScroll); - } - - this.session.setScrollTop(Math.max(-this.scrollMargin.top, - Math.min(this.scrollTop, maxHeight - size.scrollerHeight + this.scrollMargin.bottom))); - - this.session.setScrollLeft(Math.max(-this.scrollMargin.left, Math.min(this.scrollLeft, - longestLine + 2 * this.$padding - size.scrollerWidth + this.scrollMargin.right))); - - var lineCount = Math.ceil(minHeight / this.lineHeight) - 1; - var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight)); - var lastRow = firstRow + lineCount; - var firstRowScreen, firstRowHeight; - var lineHeight = this.lineHeight; - firstRow = session.screenToDocumentRow(firstRow, 0); - var foldLine = session.getFoldLine(firstRow); - if (foldLine) { - firstRow = foldLine.start.row; - } - - firstRowScreen = session.documentToScreenRow(firstRow, 0); - firstRowHeight = session.getRowLength(firstRow) * lineHeight; - - lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1); - minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + - firstRowHeight; - - offset = this.scrollTop - firstRowScreen * lineHeight; - - var changes = 0; - if (this.layerConfig.width != longestLine) - changes = this.CHANGE_H_SCROLL; - if (hScrollChanged || vScrollChanged) { - changes = this.$updateCachedSize(true, this.gutterWidth, size.width, size.height); - this._signal("scrollbarVisibilityChanged"); - if (vScrollChanged) - longestLine = this.$getLongestLine(); - } - - this.layerConfig = { - width : longestLine, - padding : this.$padding, - firstRow : firstRow, - firstRowScreen: firstRowScreen, - lastRow : lastRow, - lineHeight : lineHeight, - characterWidth : this.characterWidth, - minHeight : minHeight, - maxHeight : maxHeight, - offset : offset, - gutterOffset : Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)), - height : this.$size.scrollerHeight - }; - - return changes; - }; - - this.$updateLines = function() { - var firstRow = this.$changedLines.firstRow; - var lastRow = this.$changedLines.lastRow; - this.$changedLines = null; - - var layerConfig = this.layerConfig; - - if (firstRow > layerConfig.lastRow + 1) { return; } - if (lastRow < layerConfig.firstRow) { return; } - if (lastRow === Infinity) { - if (this.$showGutter) - this.$gutterLayer.update(layerConfig); - this.$textLayer.update(layerConfig); - return; - } - this.$textLayer.updateLines(layerConfig, firstRow, lastRow); - return true; - }; - - this.$getLongestLine = function() { - var charCount = this.session.getScreenWidth(); - if (this.showInvisibles && !this.session.$useWrapMode) - charCount += 1; - - return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth)); - }; - this.updateFrontMarkers = function() { - this.$markerFront.setMarkers(this.session.getMarkers(true)); - this.$loop.schedule(this.CHANGE_MARKER_FRONT); - }; - this.updateBackMarkers = function() { - this.$markerBack.setMarkers(this.session.getMarkers()); - this.$loop.schedule(this.CHANGE_MARKER_BACK); - }; - this.addGutterDecoration = function(row, className){ - this.$gutterLayer.addGutterDecoration(row, className); - }; - this.removeGutterDecoration = function(row, className){ - this.$gutterLayer.removeGutterDecoration(row, className); - }; - this.updateBreakpoints = function(rows) { - this.$loop.schedule(this.CHANGE_GUTTER); - }; - this.setAnnotations = function(annotations) { - this.$gutterLayer.setAnnotations(annotations); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - this.updateCursor = function() { - this.$loop.schedule(this.CHANGE_CURSOR); - }; - this.hideCursor = function() { - this.$cursorLayer.hideCursor(); - }; - this.showCursor = function() { - this.$cursorLayer.showCursor(); - }; - - this.scrollSelectionIntoView = function(anchor, lead, offset) { - this.scrollCursorIntoView(anchor, offset); - this.scrollCursorIntoView(lead, offset); - }; - this.scrollCursorIntoView = function(cursor, offset, $viewMargin) { - if (this.$size.scrollerHeight === 0) - return; - - var pos = this.$cursorLayer.getPixelPosition(cursor); - - var left = pos.left; - var top = pos.top; - - var topMargin = $viewMargin && $viewMargin.top || 0; - var bottomMargin = $viewMargin && $viewMargin.bottom || 0; - - var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop; - - if (scrollTop + topMargin > top) { - if (offset) - top -= offset * this.$size.scrollerHeight; - if (top === 0) - top = -this.scrollMargin.top; - this.session.setScrollTop(top); - } else if (scrollTop + this.$size.scrollerHeight - bottomMargin < top + this.lineHeight) { - if (offset) - top += offset * this.$size.scrollerHeight; - this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight); - } - - var scrollLeft = this.scrollLeft; - - if (scrollLeft > left) { - if (left < this.$padding + 2 * this.layerConfig.characterWidth) - left = -this.scrollMargin.left; - this.session.setScrollLeft(left); - } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { - this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); - } else if (scrollLeft <= this.$padding && left - scrollLeft < this.characterWidth) { - this.session.setScrollLeft(0); - } - }; - this.getScrollTop = function() { - return this.session.getScrollTop(); - }; - this.getScrollLeft = function() { - return this.session.getScrollLeft(); - }; - this.getScrollTopRow = function() { - return this.scrollTop / this.lineHeight; - }; - this.getScrollBottomRow = function() { - return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1); - }; - this.scrollToRow = function(row) { - this.session.setScrollTop(row * this.lineHeight); - }; - - this.alignCursor = function(cursor, alignment) { - if (typeof cursor == "number") - cursor = {row: cursor, column: 0}; - - var pos = this.$cursorLayer.getPixelPosition(cursor); - var h = this.$size.scrollerHeight - this.lineHeight; - var offset = pos.top - h * (alignment || 0); - - this.session.setScrollTop(offset); - return offset; - }; - - this.STEPS = 8; - this.$calcSteps = function(fromValue, toValue){ - var i = 0; - var l = this.STEPS; - var steps = []; - - var func = function(t, x_min, dx) { - return dx * (Math.pow(t - 1, 3) + 1) + x_min; - }; - - for (i = 0; i < l; ++i) - steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); - - return steps; - }; - this.scrollToLine = function(line, center, animate, callback) { - var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); - var offset = pos.top; - if (center) - offset -= this.$size.scrollerHeight / 2; - - var initialScroll = this.scrollTop; - this.session.setScrollTop(offset); - if (animate !== false) - this.animateScrolling(initialScroll, callback); - }; - - this.animateScrolling = function(fromValue, callback) { - var toValue = this.scrollTop; - if (!this.$animatedScroll) - return; - var _self = this; - - if (fromValue == toValue) - return; - - if (this.$scrollAnimation) { - var oldSteps = this.$scrollAnimation.steps; - if (oldSteps.length) { - fromValue = oldSteps[0]; - if (fromValue == toValue) - return; - } - } - - var steps = _self.$calcSteps(fromValue, toValue); - this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps}; - - clearInterval(this.$timer); - - _self.session.setScrollTop(steps.shift()); - _self.session.$scrollTop = toValue; - this.$timer = setInterval(function() { - if (steps.length) { - _self.session.setScrollTop(steps.shift()); - _self.session.$scrollTop = toValue; - } else if (toValue != null) { - _self.session.$scrollTop = -1; - _self.session.setScrollTop(toValue); - toValue = null; - } else { - _self.$timer = clearInterval(_self.$timer); - _self.$scrollAnimation = null; - callback && callback(); - } - }, 10); - }; - this.scrollToY = function(scrollTop) { - if (this.scrollTop !== scrollTop) { - this.$loop.schedule(this.CHANGE_SCROLL); - this.scrollTop = scrollTop; - } - }; - this.scrollToX = function(scrollLeft) { - if (this.scrollLeft !== scrollLeft) - this.scrollLeft = scrollLeft; - this.$loop.schedule(this.CHANGE_H_SCROLL); - }; - this.scrollTo = function(x, y) { - this.session.setScrollTop(y); - this.session.setScrollLeft(y); - }; - this.scrollBy = function(deltaX, deltaY) { - deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY); - deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX); - }; - this.isScrollableBy = function(deltaX, deltaY) { - if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) - return true; - if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - - this.layerConfig.maxHeight - (this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd - < -1 + this.scrollMargin.bottom) - return true; - if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) - return true; - if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth - - this.layerConfig.width < -1 + this.scrollMargin.right) - return true; - }; - - this.pixelToScreenCoordinates = function(x, y) { - var canvasPos = this.scroller.getBoundingClientRect(); - - var offset = (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth; - var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight); - var col = Math.round(offset); - - return {row: row, column: col, side: offset - col > 0 ? 1 : -1}; - }; - - this.screenToTextCoordinates = function(x, y) { - var canvasPos = this.scroller.getBoundingClientRect(); - - var col = Math.round( - (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth - ); - - var row = (y + this.scrollTop - canvasPos.top) / this.lineHeight; - - return this.session.screenToDocumentPosition(row, Math.max(col, 0)); - }; - this.textToScreenCoordinates = function(row, column) { - var canvasPos = this.scroller.getBoundingClientRect(); - var pos = this.session.documentToScreenPosition(row, column); - - var x = this.$padding + Math.round(pos.column * this.characterWidth); - var y = pos.row * this.lineHeight; - - return { - pageX: canvasPos.left + x - this.scrollLeft, - pageY: canvasPos.top + y - this.scrollTop - }; - }; - this.visualizeFocus = function() { - dom.addCssClass(this.container, "ace_focus"); - }; - this.visualizeBlur = function() { - dom.removeCssClass(this.container, "ace_focus"); - }; - this.showComposition = function(position) { - if (!this.$composition) - this.$composition = { - keepTextAreaAtCursor: this.$keepTextAreaAtCursor, - cssText: this.textarea.style.cssText - }; - - this.$keepTextAreaAtCursor = true; - dom.addCssClass(this.textarea, "ace_composition"); - this.textarea.style.cssText = ""; - this.$moveTextAreaToCursor(); - }; - this.setCompositionText = function(text) { - this.$moveTextAreaToCursor(); - }; - this.hideComposition = function() { - if (!this.$composition) - return; - - dom.removeCssClass(this.textarea, "ace_composition"); - this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor; - this.textarea.style.cssText = this.$composition.cssText; - this.$composition = null; - }; - this.setTheme = function(theme, cb) { - var _self = this; - this.$themeId = theme; - _self._dispatchEvent('themeChange',{theme:theme}); - - if (!theme || typeof theme == "string") { - var moduleName = theme || this.$options.theme.initialValue; - config.loadModule(["theme", moduleName], afterLoad); - } else { - afterLoad(theme); - } - - function afterLoad(module) { - if (_self.$themeId != theme) - return cb && cb(); - if (!module.cssClass) - return; - dom.importCssString( - module.cssText, - module.cssClass, - _self.container.ownerDocument - ); - - if (_self.theme) - dom.removeCssClass(_self.container, _self.theme.cssClass); - - var padding = "padding" in module ? module.padding - : "padding" in (_self.theme || {}) ? 4 : _self.$padding; - if (_self.$padding && padding != _self.$padding) - _self.setPadding(padding); - _self.$theme = module.cssClass; - - _self.theme = module; - dom.addCssClass(_self.container, module.cssClass); - dom.setCssClass(_self.container, "ace_dark", module.isDark); - if (_self.$size) { - _self.$size.width = 0; - _self.$updateSizeAsync(); - } - - _self._dispatchEvent('themeLoaded', {theme:module}); - cb && cb(); - } - }; - this.getTheme = function() { - return this.$themeId; - }; - this.setStyle = function(style, include) { - dom.setCssClass(this.container, style, include !== false); - }; - this.unsetStyle = function(style) { - dom.removeCssClass(this.container, style); - }; - - this.setCursorStyle = function(style) { - if (this.content.style.cursor != style) - this.content.style.cursor = style; - }; - this.setMouseCursor = function(cursorStyle) { - this.content.style.cursor = cursorStyle; - }; - this.destroy = function() { - this.$textLayer.destroy(); - this.$cursorLayer.destroy(); - }; - -}).call(VirtualRenderer.prototype); - - -config.defineOptions(VirtualRenderer.prototype, "renderer", { - animatedScroll: {initialValue: false}, - showInvisibles: { - set: function(value) { - if (this.$textLayer.setShowInvisibles(value)) - this.$loop.schedule(this.CHANGE_TEXT); - }, - initialValue: false - }, - showPrintMargin: { - set: function() { this.$updatePrintMargin(); }, - initialValue: true - }, - printMarginColumn: { - set: function() { this.$updatePrintMargin(); }, - initialValue: 80 - }, - printMargin: { - set: function(val) { - if (typeof val == "number") - this.$printMarginColumn = val; - this.$showPrintMargin = !!val; - this.$updatePrintMargin(); - }, - get: function() { - return this.$showPrintMargin && this.$printMarginColumn; - } - }, - showGutter: { - set: function(show){ - this.$gutter.style.display = show ? "block" : "none"; - this.$loop.schedule(this.CHANGE_FULL); - this.onGutterResize(); - }, - initialValue: true - }, - fadeFoldWidgets: { - set: function(show) { - dom.setCssClass(this.$gutter, "ace_fade-fold-widgets", show); - }, - initialValue: false - }, - showFoldWidgets: { - set: function(show) {this.$gutterLayer.setShowFoldWidgets(show)}, - initialValue: true - }, - showLineNumbers: { - set: function(show) { - this.$gutterLayer.setShowLineNumbers(show); - this.$loop.schedule(this.CHANGE_GUTTER); - }, - initialValue: true - }, - displayIndentGuides: { - set: function(show) { - if (this.$textLayer.setDisplayIndentGuides(show)) - this.$loop.schedule(this.CHANGE_TEXT); - }, - initialValue: true - }, - highlightGutterLine: { - set: function(shouldHighlight) { - if (!this.$gutterLineHighlight) { - this.$gutterLineHighlight = dom.createElement("div"); - this.$gutterLineHighlight.className = "ace_gutter-active-line"; - this.$gutter.appendChild(this.$gutterLineHighlight); - return; - } - - this.$gutterLineHighlight.style.display = shouldHighlight ? "" : "none"; - if (this.$cursorLayer.$pixelPos) - this.$updateGutterLineHighlight(); - }, - initialValue: false, - value: true - }, - hScrollBarAlwaysVisible: { - set: function(val) { - if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) - this.$loop.schedule(this.CHANGE_SCROLL); - }, - initialValue: false - }, - vScrollBarAlwaysVisible: { - set: function(val) { - if (!this.$vScrollBarAlwaysVisible || !this.$vScroll) - this.$loop.schedule(this.CHANGE_SCROLL); - }, - initialValue: false - }, - fontSize: { - set: function(size) { - if (typeof size == "number") - size = size + "px"; - this.container.style.fontSize = size; - this.updateFontSize(); - }, - initialValue: 12 - }, - fontFamily: { - set: function(name) { - this.container.style.fontFamily = name; - this.updateFontSize(); - } - }, - maxLines: { - set: function(val) { - this.updateFull(); - } - }, - minLines: { - set: function(val) { - this.updateFull(); - } - }, - scrollPastEnd: { - set: function(val) { - val = +val || 0; - if (this.$scrollPastEnd == val) - return; - this.$scrollPastEnd = val; - this.$loop.schedule(this.CHANGE_SCROLL); - }, - initialValue: 0, - handlesSet: true - }, - fixedWidthGutter: { - set: function(val) { - this.$gutterLayer.$fixedWidth = !!val; - this.$loop.schedule(this.CHANGE_GUTTER); - } - }, - theme: { - set: function(val) { this.setTheme(val) }, - get: function() { return this.$themeId || this.theme; }, - initialValue: "./theme/textmate", - handlesSet: true - } -}); - -exports.VirtualRenderer = VirtualRenderer; -}); - -ace.define('ace/config', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/lib/oop', 'ace/lib/net', 'ace/lib/event_emitter'], function(require, exports, module) { -"no use strict"; - -var lang = require("./lib/lang"); -var oop = require("./lib/oop"); -var net = require("./lib/net"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - -var global = (function() { - return this; -})(); - -var options = { - packaged: false, - workerPath: null, - modePath: null, - themePath: null, - basePath: "", - suffix: ".js", - $moduleUrls: {} -}; - -exports.get = function(key) { - if (!options.hasOwnProperty(key)) - throw new Error("Unknown config key: " + key); - - return options[key]; -}; - -exports.set = function(key, value) { - if (!options.hasOwnProperty(key)) - throw new Error("Unknown config key: " + key); - - options[key] = value; -}; - -exports.all = function() { - return lang.copyObject(options); -}; -oop.implement(exports, EventEmitter); - -exports.moduleUrl = function(name, component) { - if (options.$moduleUrls[name]) - return options.$moduleUrls[name]; - - var parts = name.split("/"); - component = component || parts[parts.length - 2] || ""; - var sep = component == "snippets" ? "/" : "-"; - var base = parts[parts.length - 1]; - if (sep == "-") { - var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g"); - base = base.replace(re, ""); - } - - if ((!base || base == component) && parts.length > 1) - base = parts[parts.length - 2]; - var path = options[component + "Path"]; - if (path == null) { - path = options.basePath; - } else if (sep == "/") { - component = sep = ""; - } - if (path && path.slice(-1) != "/") - path += "/"; - return path + component + sep + base + this.get("suffix"); -}; - -exports.setModuleUrl = function(name, subst) { - return options.$moduleUrls[name] = subst; -}; - -exports.$loading = {}; -exports.loadModule = function(moduleName, onLoad) { - var module, moduleType; - if (Array.isArray(moduleName)) { - moduleType = moduleName[0]; - moduleName = moduleName[1]; - } - - try { - module = require(moduleName); - } catch (e) {} - if (module && !exports.$loading[moduleName]) - return onLoad && onLoad(module); - - if (!exports.$loading[moduleName]) - exports.$loading[moduleName] = []; - - exports.$loading[moduleName].push(onLoad); - - if (exports.$loading[moduleName].length > 1) - return; - - var afterLoad = function() { - require([moduleName], function(module) { - exports._emit("load.module", {name: moduleName, module: module}); - var listeners = exports.$loading[moduleName]; - exports.$loading[moduleName] = null; - listeners.forEach(function(onLoad) { - onLoad && onLoad(module); - }); - }); - }; - - if (!exports.get("packaged")) - return afterLoad(); - net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad); -}; -init(true);function init(packaged) { - - options.packaged = packaged || require.packaged || module.packaged || (global.define && define.packaged); - - if (!global.document) - return ""; - - var scriptOptions = {}; - var scriptUrl = ""; - - var scripts = document.getElementsByTagName("script"); - for (var i=0; i foldStart) { - row = fold.end.row + 1; - fold = session.getNextFoldLine(row, fold); - foldStart = fold ? fold.start.row : Infinity; - } - if (row > lastRow) { - while (this.$cells.length > index + 1) { - cell = this.$cells.pop(); - this.element.removeChild(cell.element); - } - break; - } - - cell = this.$cells[++index]; - if (!cell) { - cell = {element: null, textNode: null, foldWidget: null}; - cell.element = dom.createElement("div"); - cell.textNode = document.createTextNode(''); - cell.element.appendChild(cell.textNode); - this.element.appendChild(cell.element); - this.$cells[index] = cell; - } - - var className = "ace_gutter-cell "; - if (breakpoints[row]) - className += breakpoints[row]; - if (decorations[row]) - className += decorations[row]; - if (this.$annotations[row]) - className += this.$annotations[row].className; - if (cell.element.className != className) - cell.element.className = className; - - var height = session.getRowLength(row) * config.lineHeight + "px"; - if (height != cell.element.style.height) - cell.element.style.height = height; - - if (foldWidgets) { - var c = foldWidgets[row]; - if (c == null) - c = foldWidgets[row] = session.getFoldWidget(row); - } - - if (c) { - if (!cell.foldWidget) { - cell.foldWidget = dom.createElement("span"); - cell.element.appendChild(cell.foldWidget); - } - var className = "ace_fold-widget ace_" + c; - if (c == "start" && row == foldStart && row < fold.end.row) - className += " ace_closed"; - else - className += " ace_open"; - if (cell.foldWidget.className != className) - cell.foldWidget.className = className; - - var height = config.lineHeight + "px"; - if (cell.foldWidget.style.height != height) - cell.foldWidget.style.height = height; - } else { - if (cell.foldWidget) { - cell.element.removeChild(cell.foldWidget); - cell.foldWidget = null; - } - } - - var text = lastLineNumber = gutterRenderer - ? gutterRenderer.getText(session, row) - : row + firstLineNumber; - if (text != cell.textNode.data) - cell.textNode.data = text; - - row++; - } - - this.element.style.height = config.minHeight + "px"; - - if (this.$fixedWidth || session.$useWrapMode) - lastLineNumber = session.getLength() + firstLineNumber; - - var gutterWidth = gutterRenderer - ? gutterRenderer.getWidth(session, lastLineNumber, config) - : lastLineNumber.toString().length * config.characterWidth; - - var padding = this.$padding || this.$computePadding(); - gutterWidth += padding.left + padding.right; - if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) { - this.gutterWidth = gutterWidth; - this.element.style.width = Math.ceil(this.gutterWidth) + "px"; - this._emit("changeGutterWidth", gutterWidth); - } - }; - - this.$fixedWidth = false; - - this.$showLineNumbers = true; - this.$renderer = ""; - this.setShowLineNumbers = function(show) { - this.$renderer = !show && { - getWidth: function() {return ""}, - getText: function() {return ""} - }; - }; - - this.getShowLineNumbers = function() { - return this.$showLineNumbers; - }; - - this.$showFoldWidgets = true; - this.setShowFoldWidgets = function(show) { - if (show) - dom.addCssClass(this.element, "ace_folding-enabled"); - else - dom.removeCssClass(this.element, "ace_folding-enabled"); - - this.$showFoldWidgets = show; - this.$padding = null; - }; - - this.getShowFoldWidgets = function() { - return this.$showFoldWidgets; - }; - - this.$computePadding = function() { - if (!this.element.firstChild) - return {left: 0, right: 0}; - var style = dom.computedStyle(this.element.firstChild); - this.$padding = {}; - this.$padding.left = parseInt(style.paddingLeft) + 1 || 0; - this.$padding.right = parseInt(style.paddingRight) || 0; - return this.$padding; - }; - - this.getRegion = function(point) { - var padding = this.$padding || this.$computePadding(); - var rect = this.element.getBoundingClientRect(); - if (point.x < padding.left + rect.left) - return "markers"; - if (this.$showFoldWidgets && point.x > rect.right - padding.right) - return "foldWidgets"; - }; - -}).call(Gutter.prototype); - -exports.Gutter = Gutter; - -}); - -ace.define('ace/mouse/dragdrop_handler', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/event', 'ace/lib/useragent'], function(require, exports, module) { - - -var dom = require("../lib/dom"); -var event = require("../lib/event"); -var useragent = require("../lib/useragent"); - -var AUTOSCROLL_DELAY = 200; -var SCROLL_CURSOR_DELAY = 200; -var SCROLL_CURSOR_HYSTERESIS = 5; - -function DragdropHandler(mouseHandler) { - - var editor = mouseHandler.editor; - - var blankImage = dom.createElement("img"); - blankImage.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (useragent.isOpera) - blankImage.style.cssText = "width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"; - - var exports = ["dragWait", "dragWaitEnd", "startDrag", "dragReadyEnd", "onMouseDrag"]; - - exports.forEach(function(x) { - mouseHandler[x] = this[x]; - }, this); - editor.addEventListener("mousedown", this.onMouseDown.bind(mouseHandler)); - - - var mouseTarget = editor.container; - var dragSelectionMarker, x, y; - var timerId, range; - var dragCursor, counter = 0; - var dragOperation; - var isInternal; - var autoScrollStartTime; - var cursorMovedTime; - var cursorPointOnCaretMoved; - - this.onDragStart = function(e) { - if (this.cancelDrag || !mouseTarget.draggable) { - var self = this; - setTimeout(function(){ - self.startSelect(); - self.captureMouse(e); - }, 0); - return e.preventDefault(); - } - range = editor.getSelectionRange(); - - var dataTransfer = e.dataTransfer; - dataTransfer.effectAllowed = editor.getReadOnly() ? "copy" : "copyMove"; - if (useragent.isOpera) { - editor.container.appendChild(blankImage); - blankImage._top = blankImage.offsetTop; - } - dataTransfer.setDragImage && dataTransfer.setDragImage(blankImage, 0, 0); - if (useragent.isOpera) { - editor.container.removeChild(blankImage); - } - dataTransfer.clearData(); - dataTransfer.setData("Text", editor.session.getTextRange()); - - isInternal = true; - this.setState("drag"); - }; - - this.onDragEnd = function(e) { - mouseTarget.draggable = false; - isInternal = false; - this.setState(null); - if (!editor.getReadOnly()) { - var dropEffect = e.dataTransfer.dropEffect; - if (!dragOperation && dropEffect == "move") - editor.session.remove(editor.getSelectionRange()); - editor.renderer.$cursorLayer.setBlinking(true); - } - this.editor.unsetStyle("ace_dragging"); - }; - - this.onDragEnter = function(e) { - if (editor.getReadOnly() || !canAccept(e.dataTransfer)) - return; - if (!dragSelectionMarker) - addDragMarker(); - counter++; - e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); - return event.preventDefault(e); - }; - - this.onDragOver = function(e) { - if (editor.getReadOnly() || !canAccept(e.dataTransfer)) - return; - if (!dragSelectionMarker) { - addDragMarker(); - counter++; - } - if (onMouseMoveTimer !== null) - onMouseMoveTimer = null; - x = e.clientX; - y = e.clientY; - - e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); - return event.preventDefault(e); - }; - - this.onDragLeave = function(e) { - counter--; - if (counter <= 0 && dragSelectionMarker) { - clearDragMarker(); - dragOperation = null; - return event.preventDefault(e); - } - }; - - this.onDrop = function(e) { - if (!dragSelectionMarker) - return; - var dataTransfer = e.dataTransfer; - if (isInternal) { - switch (dragOperation) { - case "move": - if (range.contains(dragCursor.row, dragCursor.column)) { - range = { - start: dragCursor, - end: dragCursor - }; - } else { - range = editor.moveText(range, dragCursor); - } - break; - case "copy": - range = editor.moveText(range, dragCursor, true); - break; - } - } else { - var dropData = dataTransfer.getData('Text'); - range = { - start: dragCursor, - end: editor.session.insert(dragCursor, dropData) - }; - editor.focus(); - dragOperation = null; - } - clearDragMarker(); - return event.preventDefault(e); - }; - - event.addListener(mouseTarget, "dragstart", this.onDragStart.bind(mouseHandler)); - event.addListener(mouseTarget, "dragend", this.onDragEnd.bind(mouseHandler)); - event.addListener(mouseTarget, "dragenter", this.onDragEnter.bind(mouseHandler)); - event.addListener(mouseTarget, "dragover", this.onDragOver.bind(mouseHandler)); - event.addListener(mouseTarget, "dragleave", this.onDragLeave.bind(mouseHandler)); - event.addListener(mouseTarget, "drop", this.onDrop.bind(mouseHandler)); - - function scrollCursorIntoView(cursor, prevCursor) { - var now = Date.now(); - var vMovement = !prevCursor || cursor.row != prevCursor.row; - var hMovement = !prevCursor || cursor.column != prevCursor.column; - if (!cursorMovedTime || vMovement || hMovement) { - editor.$blockScrolling += 1; - editor.moveCursorToPosition(cursor); - editor.$blockScrolling -= 1; - cursorMovedTime = now; - cursorPointOnCaretMoved = {x: x, y: y}; - } else { - var distance = calcDistance(cursorPointOnCaretMoved.x, cursorPointOnCaretMoved.y, x, y); - if (distance > SCROLL_CURSOR_HYSTERESIS) { - cursorMovedTime = null; - } else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) { - editor.renderer.scrollCursorIntoView(); - cursorMovedTime = null; - } - } - } - - function autoScroll(cursor, prevCursor) { - var now = Date.now(); - var lineHeight = editor.renderer.layerConfig.lineHeight; - var characterWidth = editor.renderer.layerConfig.characterWidth; - var editorRect = editor.renderer.scroller.getBoundingClientRect(); - var offsets = { - x: { - left: x - editorRect.left, - right: editorRect.right - x - }, - y: { - top: y - editorRect.top, - bottom: editorRect.bottom - y - } - }; - var nearestXOffset = Math.min(offsets.x.left, offsets.x.right); - var nearestYOffset = Math.min(offsets.y.top, offsets.y.bottom); - var scrollCursor = {row: cursor.row, column: cursor.column}; - if (nearestXOffset / characterWidth <= 2) { - scrollCursor.column += (offsets.x.left < offsets.x.right ? -3 : +2); - } - if (nearestYOffset / lineHeight <= 1) { - scrollCursor.row += (offsets.y.top < offsets.y.bottom ? -1 : +1); - } - var vScroll = cursor.row != scrollCursor.row; - var hScroll = cursor.column != scrollCursor.column; - var vMovement = !prevCursor || cursor.row != prevCursor.row; - if (vScroll || (hScroll && !vMovement)) { - if (!autoScrollStartTime) - autoScrollStartTime = now; - else if (now - autoScrollStartTime >= AUTOSCROLL_DELAY) - editor.renderer.scrollCursorIntoView(scrollCursor); - } else { - autoScrollStartTime = null; - } - } - - function onDragInterval() { - var prevCursor = dragCursor; - dragCursor = editor.renderer.screenToTextCoordinates(x, y); - scrollCursorIntoView(dragCursor, prevCursor); - autoScroll(dragCursor, prevCursor); - } - - function addDragMarker() { - range = editor.selection.toOrientedRange(); - dragSelectionMarker = editor.session.addMarker(range, "ace_selection", editor.getSelectionStyle()); - editor.clearSelection(); - if (editor.isFocused()) - editor.renderer.$cursorLayer.setBlinking(false); - clearInterval(timerId); - timerId = setInterval(onDragInterval, 20); - counter = 0; - event.addListener(document, "mousemove", onMouseMove); - } - - function clearDragMarker() { - clearInterval(timerId); - editor.session.removeMarker(dragSelectionMarker); - dragSelectionMarker = null; - editor.$blockScrolling += 1; - editor.selection.fromOrientedRange(range); - editor.$blockScrolling -= 1; - if (editor.isFocused() && !isInternal) - editor.renderer.$cursorLayer.setBlinking(!editor.getReadOnly()); - range = null; - counter = 0; - autoScrollStartTime = null; - cursorMovedTime = null; - event.removeListener(document, "mousemove", onMouseMove); - } - var onMouseMoveTimer = null; - function onMouseMove() { - if (onMouseMoveTimer == null) { - onMouseMoveTimer = setTimeout(function() { - if (onMouseMoveTimer != null && dragSelectionMarker) - clearDragMarker(); - }, 20); - } - } - - function canAccept(dataTransfer) { - var types = dataTransfer.types; - return !types || Array.prototype.some.call(types, function(type) { - return type == 'text/plain' || type == 'Text'; - }); - } - - function getDropEffect(e) { - var copyAllowed = ['copy', 'copymove', 'all', 'uninitialized']; - var moveAllowed = ['move', 'copymove', 'linkmove', 'all', 'uninitialized']; - - var copyModifierState = useragent.isMac ? e.altKey : e.ctrlKey; - var effectAllowed = "uninitialized"; - try { - effectAllowed = e.dataTransfer.effectAllowed.toLowerCase(); - } catch (e) {} - var dropEffect = "none"; - - if (copyModifierState && copyAllowed.indexOf(effectAllowed) >= 0) - dropEffect = "copy"; - else if (moveAllowed.indexOf(effectAllowed) >= 0) - dropEffect = "move"; - else if (copyAllowed.indexOf(effectAllowed) >= 0) - dropEffect = "copy"; - - return dropEffect; - } -} - -(function() { - - this.dragWait = function() { - var interval = Date.now() - this.mousedownEvent.time; - if (interval > this.editor.getDragDelay()) - this.startDrag(); - }; - - this.dragWaitEnd = function() { - var target = this.editor.container; - target.draggable = false; - this.startSelect(this.mousedownEvent.getDocumentPosition()); - this.selectEnd(); - }; - - this.dragReadyEnd = function(e) { - this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()); - this.editor.unsetStyle("ace_dragging"); - this.dragWaitEnd(); - }; - - this.startDrag = function(){ - this.cancelDrag = false; - var target = this.editor.container; - target.draggable = true; - this.editor.renderer.$cursorLayer.setBlinking(false); - this.editor.setStyle("ace_dragging"); - this.setState("dragReady"); - }; - - this.onMouseDrag = function(e) { - var target = this.editor.container; - if (useragent.isIE && this.state == "dragReady") { - var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); - if (distance > 3) - target.dragDrop(); - } - if (this.state === "dragWait") { - var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); - if (distance > 0) { - target.draggable = false; - this.startSelect(this.mousedownEvent.getDocumentPosition()); - } - } - }; - - this.onMouseDown = function(e) { - if (!this.$dragEnabled) - return; - this.mousedownEvent = e; - var editor = this.editor; - - var inSelection = e.inSelection(); - var button = e.getButton(); - var clickCount = e.domEvent.detail || 1; - if (clickCount === 1 && button === 0 && inSelection) { - if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey())) - return; - this.mousedownEvent.time = Date.now(); - var eventTarget = e.domEvent.target || e.domEvent.srcElement; - if ("unselectable" in eventTarget) - eventTarget.unselectable = "on"; - if (editor.getDragDelay()) { - if (useragent.isWebKit) { - this.cancelDrag = true; - var mouseTarget = editor.container; - mouseTarget.draggable = true; - } - this.setState("dragWait"); - } else { - this.startDrag(); - } - this.captureMouse(e, this.onMouseDrag.bind(this)); - e.defaultPrevented = true; - } - }; - -}).call(DragdropHandler.prototype); - - -function calcDistance(ax, ay, bx, by) { - return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); -} - -exports.DragdropHandler = DragdropHandler; - -}); - -ace.define('ace/layer/marker', ['require', 'exports', 'module' , 'ace/range', 'ace/lib/dom'], function(require, exports, module) { - - -var Range = require("../range").Range; -var dom = require("../lib/dom"); - -var Marker = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_marker-layer"; - parentEl.appendChild(this.element); -}; - -(function() { - - this.$padding = 0; - - this.setPadding = function(padding) { - this.$padding = padding; - }; - this.setSession = function(session) { - this.session = session; - }; - - this.setMarkers = function(markers) { - this.markers = markers; - }; - - this.update = function(config) { - var config = config || this.config; - if (!config) - return; - - this.config = config; - - - var html = []; - for (var key in this.markers) { - var marker = this.markers[key]; - - if (!marker.range) { - marker.update(html, this, this.session, config); - continue; - } - - var range = marker.range.clipRows(config.firstRow, config.lastRow); - if (range.isEmpty()) continue; - - range = range.toScreenRange(this.session); - if (marker.renderer) { - var top = this.$getTop(range.start.row, config); - var left = this.$padding + range.start.column * config.characterWidth; - marker.renderer(html, range, left, top, config); - } else if (marker.type == "fullLine") { - this.drawFullLineMarker(html, range, marker.clazz, config); - } else if (marker.type == "screenLine") { - this.drawScreenLineMarker(html, range, marker.clazz, config); - } else if (range.isMultiLine()) { - if (marker.type == "text") - this.drawTextMarker(html, range, marker.clazz, config); - else - this.drawMultiLineMarker(html, range, marker.clazz, config); - } else { - this.drawSingleLineMarker(html, range, marker.clazz + " ace_start", config); - } - } - this.element = dom.setInnerHtml(this.element, html.join("")); - }; - - this.$getTop = function(row, layerConfig) { - return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; - }; - this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig, extraStyle) { - var row = range.start.row; - - var lineRange = new Range( - row, range.start.column, - row, this.session.getScreenLastRowColumn(row) - ); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz + " ace_start", layerConfig, 1, extraStyle); - row = range.end.row; - lineRange = new Range(row, 0, row, range.end.column); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 0, extraStyle); - - for (row = range.start.row + 1; row < range.end.row; row++) { - lineRange.start.row = row; - lineRange.end.row = row; - lineRange.end.column = this.session.getScreenLastRowColumn(row); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, extraStyle); - } - }; - this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { - var padding = this.$padding; - var height = config.lineHeight; - var top = this.$getTop(range.start.row, config); - var left = padding + range.start.column * config.characterWidth; - extraStyle = extraStyle || ""; - - stringBuilder.push( - "
    " - ); - top = this.$getTop(range.end.row, config); - var width = range.end.column * config.characterWidth; - - stringBuilder.push( - "
    " - ); - height = (range.end.row - range.start.row - 1) * config.lineHeight; - if (height < 0) - return; - top = this.$getTop(range.start.row + 1, config); - - stringBuilder.push( - "
    " - ); - }; - this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) { - var height = config.lineHeight; - var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth; - - var top = this.$getTop(range.start.row, config); - var left = this.$padding + range.start.column * config.characterWidth; - - stringBuilder.push( - "
    " - ); - }; - - this.drawFullLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { - var top = this.$getTop(range.start.row, config); - var height = config.lineHeight; - if (range.start.row != range.end.row) - height += this.$getTop(range.end.row, config) - top; - - stringBuilder.push( - "
    " - ); - }; - - this.drawScreenLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { - var top = this.$getTop(range.start.row, config); - var height = config.lineHeight; - - stringBuilder.push( - "
    " - ); - }; - -}).call(Marker.prototype); - -exports.Marker = Marker; - -}); - -ace.define('ace/mouse/mouse_event', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/lib/useragent'], function(require, exports, module) { - - -var event = require("../lib/event"); -var useragent = require("../lib/useragent"); -var MouseEvent = exports.MouseEvent = function(domEvent, editor) { - this.domEvent = domEvent; - this.editor = editor; - - this.x = this.clientX = domEvent.clientX; - this.y = this.clientY = domEvent.clientY; - - this.$pos = null; - this.$inSelection = null; - - this.propagationStopped = false; - this.defaultPrevented = false; -}; - -(function() { - - this.stopPropagation = function() { - event.stopPropagation(this.domEvent); - this.propagationStopped = true; - }; - - this.preventDefault = function() { - event.preventDefault(this.domEvent); - this.defaultPrevented = true; - }; - - this.stop = function() { - this.stopPropagation(); - this.preventDefault(); - }; - this.getDocumentPosition = function() { - if (this.$pos) - return this.$pos; - - this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY); - return this.$pos; - }; - this.inSelection = function() { - if (this.$inSelection !== null) - return this.$inSelection; - - var editor = this.editor; - - - var selectionRange = editor.getSelectionRange(); - if (selectionRange.isEmpty()) - this.$inSelection = false; - else { - var pos = this.getDocumentPosition(); - this.$inSelection = selectionRange.contains(pos.row, pos.column); - } - - return this.$inSelection; - }; - this.getButton = function() { - return event.getButton(this.domEvent); - }; - this.getShiftKey = function() { - return this.domEvent.shiftKey; - }; - - this.getAccelKey = useragent.isMac - ? function() { return this.domEvent.metaKey; } - : function() { return this.domEvent.ctrlKey; }; - -}).call(MouseEvent.prototype); - -}); - -ace.define('ace/layer/text', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/useragent', 'ace/lib/event_emitter'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var useragent = require("../lib/useragent"); -var EventEmitter = require("../lib/event_emitter").EventEmitter; - -var Text = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_text-layer"; - parentEl.appendChild(this.element); - this.$updateEolChar = this.$updateEolChar.bind(this); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.EOF_CHAR = "\xB6"; - this.EOL_CHAR_LF = "\xAC"; - this.EOL_CHAR_CRLF = "\xa4"; - this.EOL_CHAR = this.EOL_CHAR_LF; - this.TAB_CHAR = "\u2192"; //"\u21E5"; - this.SPACE_CHAR = "\xB7"; - this.$padding = 0; - - this.$updateEolChar = function() { - var EOL_CHAR = this.session.doc.getNewLineCharacter() == "\n" - ? this.EOL_CHAR_LF - : this.EOL_CHAR_CRLF; - if (this.EOL_CHAR != EOL_CHAR) { - this.EOL_CHAR = EOL_CHAR; - return true; - } - } - - this.setPadding = function(padding) { - this.$padding = padding; - this.element.style.padding = "0 " + padding + "px"; - }; - - this.getLineHeight = function() { - return this.$fontMetrics.$characterSize.height || 0; - }; - - this.getCharacterWidth = function() { - return this.$fontMetrics.$characterSize.width || 0; - }; - - this.$setFontMetrics = function(measure) { - this.$fontMetrics = measure; - this.$fontMetrics.on("changeCharacterSize", function(e) { - this._signal("changeCharacterSize", e); - }.bind(this)); - this.$pollSizeChanges(); - } - - this.checkForSizeChanges = function() { - this.$fontMetrics.checkForSizeChanges(); - }; - this.$pollSizeChanges = function() { - return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges(); - }; - this.setSession = function(session) { - this.session = session; - this.$computeTabString(); - }; - - this.showInvisibles = false; - this.setShowInvisibles = function(showInvisibles) { - if (this.showInvisibles == showInvisibles) - return false; - - this.showInvisibles = showInvisibles; - this.$computeTabString(); - return true; - }; - - this.displayIndentGuides = true; - this.setDisplayIndentGuides = function(display) { - if (this.displayIndentGuides == display) - return false; - - this.displayIndentGuides = display; - this.$computeTabString(); - return true; - }; - - this.$tabStrings = []; - this.onChangeTabSize = - this.$computeTabString = function() { - var tabSize = this.session.getTabSize(); - this.tabSize = tabSize; - var tabStr = this.$tabStrings = [0]; - for (var i = 1; i < tabSize + 1; i++) { - if (this.showInvisibles) { - tabStr.push("" - + this.TAB_CHAR - + lang.stringRepeat("\xa0", i - 1) - + ""); - } else { - tabStr.push(lang.stringRepeat("\xa0", i)); - } - } - if (this.displayIndentGuides) { - this.$indentGuideRe = /\s\S| \t|\t |\s$/; - var className = "ace_indent-guide"; - if (this.showInvisibles) { - className += " ace_invisible"; - var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize); - var tabContent = this.TAB_CHAR + lang.stringRepeat("\xa0", this.tabSize - 1); - } else{ - var spaceContent = lang.stringRepeat("\xa0", this.tabSize); - var tabContent = spaceContent; - } - - this.$tabStrings[" "] = "" + spaceContent + ""; - this.$tabStrings["\t"] = "" + tabContent + ""; - } - }; - - this.updateLines = function(config, firstRow, lastRow) { - if (this.config.lastRow != config.lastRow || - this.config.firstRow != config.firstRow) { - this.scrollLines(config); - } - this.config = config; - - var first = Math.max(firstRow, config.firstRow); - var last = Math.min(lastRow, config.lastRow); - - var lineElements = this.element.childNodes; - var lineElementsIdx = 0; - - for (var row = config.firstRow; row < first; row++) { - var foldLine = this.session.getFoldLine(row); - if (foldLine) { - if (foldLine.containsRow(first)) { - first = foldLine.start.row; - break; - } else { - row = foldLine.end.row; - } - } - lineElementsIdx ++; - } - - var row = first; - var foldLine = this.session.getNextFoldLine(row); - var foldStart = foldLine ? foldLine.start.row : Infinity; - - while (true) { - if (row > foldStart) { - row = foldLine.end.row+1; - foldLine = this.session.getNextFoldLine(row, foldLine); - foldStart = foldLine ? foldLine.start.row :Infinity; - } - if (row > last) - break; - - var lineElement = lineElements[lineElementsIdx++]; - if (lineElement) { - var html = []; - this.$renderLine( - html, row, !this.$useLineGroups(), row == foldStart ? foldLine : false - ); - lineElement.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; - dom.setInnerHtml(lineElement, html.join("")); - } - row++; - } - }; - - this.scrollLines = function(config) { - var oldConfig = this.config; - this.config = config; - - if (!oldConfig || oldConfig.lastRow < config.firstRow) - return this.update(config); - - if (config.lastRow < oldConfig.firstRow) - return this.update(config); - - var el = this.element; - if (oldConfig.firstRow < config.firstRow) - for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--) - el.removeChild(el.firstChild); - - if (oldConfig.lastRow > config.lastRow) - for (var row=this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row>0; row--) - el.removeChild(el.lastChild); - - if (config.firstRow < oldConfig.firstRow) { - var fragment = this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1); - if (el.firstChild) - el.insertBefore(fragment, el.firstChild); - else - el.appendChild(fragment); - } - - if (config.lastRow > oldConfig.lastRow) { - var fragment = this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow); - el.appendChild(fragment); - } - }; - - this.$renderLinesFragment = function(config, firstRow, lastRow) { - var fragment = this.element.ownerDocument.createDocumentFragment(); - var row = firstRow; - var foldLine = this.session.getNextFoldLine(row); - var foldStart = foldLine ? foldLine.start.row : Infinity; - - while (true) { - if (row > foldStart) { - row = foldLine.end.row+1; - foldLine = this.session.getNextFoldLine(row, foldLine); - foldStart = foldLine ? foldLine.start.row : Infinity; - } - if (row > lastRow) - break; - - var container = dom.createElement("div"); - - var html = []; - this.$renderLine(html, row, false, row == foldStart ? foldLine : false); - container.innerHTML = html.join(""); - if (this.$useLineGroups()) { - container.className = 'ace_line_group'; - fragment.appendChild(container); - container.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; - - } else { - while(container.firstChild) - fragment.appendChild(container.firstChild); - } - - row++; - } - return fragment; - }; - - this.update = function(config) { - this.config = config; - - var html = []; - var firstRow = config.firstRow, lastRow = config.lastRow; - - var row = firstRow; - var foldLine = this.session.getNextFoldLine(row); - var foldStart = foldLine ? foldLine.start.row : Infinity; - - while (true) { - if (row > foldStart) { - row = foldLine.end.row+1; - foldLine = this.session.getNextFoldLine(row, foldLine); - foldStart = foldLine ? foldLine.start.row :Infinity; - } - if (row > lastRow) - break; - - if (this.$useLineGroups()) - html.push("
    ") - - this.$renderLine(html, row, false, row == foldStart ? foldLine : false); - - if (this.$useLineGroups()) - html.push("
    "); // end the line group - - row++; - } - this.element = dom.setInnerHtml(this.element, html.join("")); - }; - - this.$textToken = { - "text": true, - "rparen": true, - "lparen": true - }; - - this.$renderToken = function(stringBuilder, screenColumn, token, value) { - var self = this; - var replaceReg = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; - var replaceFunc = function(c, a, b, tabIdx, idx4) { - if (a) { - return self.showInvisibles ? - "" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "" : - lang.stringRepeat("\xa0", c.length); - } else if (c == "&") { - return "&"; - } else if (c == "<") { - return "<"; - } else if (c == "\t") { - var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); - screenColumn += tabSize - 1; - return self.$tabStrings[tabSize]; - } else if (c == "\u3000") { - var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk"; - var space = self.showInvisibles ? self.SPACE_CHAR : ""; - screenColumn += 1; - return "" + space + ""; - } else if (b) { - return "" + self.SPACE_CHAR + ""; - } else { - screenColumn += 1; - return "" + c + ""; - } - }; - - var output = value.replace(replaceReg, replaceFunc); - - if (!this.$textToken[token.type]) { - var classes = "ace_" + token.type.replace(/\./g, " ace_"); - var style = ""; - if (token.type == "fold") - style = " style='width:" + (token.value.length * this.config.characterWidth) + "px;' "; - stringBuilder.push("", output, ""); - } - else { - stringBuilder.push(output); - } - return screenColumn + value.length; - }; - - this.renderIndentGuide = function(stringBuilder, value, max) { - var cols = value.search(this.$indentGuideRe); - if (cols <= 0 || cols >= max) - return value; - if (value[0] == " ") { - cols -= cols % this.tabSize; - stringBuilder.push(lang.stringRepeat(this.$tabStrings[" "], cols/this.tabSize)); - return value.substr(cols); - } else if (value[0] == "\t") { - stringBuilder.push(lang.stringRepeat(this.$tabStrings["\t"], cols)); - return value.substr(cols); - } - return value; - }; - - this.$renderWrappedLine = function(stringBuilder, tokens, splits, onlyContents) { - var chars = 0; - var split = 0; - var splitChars = splits[0]; - var screenColumn = 0; - - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - var value = token.value; - if (i == 0 && this.displayIndentGuides) { - chars = value.length; - value = this.renderIndentGuide(stringBuilder, value, splitChars); - if (!value) - continue; - chars -= value.length; - } - - if (chars + value.length < splitChars) { - screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); - chars += value.length; - } else { - while (chars + value.length >= splitChars) { - screenColumn = this.$renderToken( - stringBuilder, screenColumn, - token, value.substring(0, splitChars - chars) - ); - value = value.substring(splitChars - chars); - chars = splitChars; - - if (!onlyContents) { - stringBuilder.push("", - "
    " - ); - } - - split ++; - screenColumn = 0; - splitChars = splits[split] || Number.MAX_VALUE; - } - if (value.length != 0) { - chars += value.length; - screenColumn = this.$renderToken( - stringBuilder, screenColumn, token, value - ); - } - } - } - }; - - this.$renderSimpleLine = function(stringBuilder, tokens) { - var screenColumn = 0; - var token = tokens[0]; - var value = token.value; - if (this.displayIndentGuides) - value = this.renderIndentGuide(stringBuilder, value); - if (value) - screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); - for (var i = 1; i < tokens.length; i++) { - token = tokens[i]; - value = token.value; - screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); - } - }; - this.$renderLine = function(stringBuilder, row, onlyContents, foldLine) { - if (!foldLine && foldLine != false) - foldLine = this.session.getFoldLine(row); - - if (foldLine) - var tokens = this.$getFoldLineTokens(row, foldLine); - else - var tokens = this.session.getTokens(row); - - - if (!onlyContents) { - stringBuilder.push( - "
    " - ); - } - - if (tokens.length) { - var splits = this.session.getRowSplitData(row); - if (splits && splits.length) - this.$renderWrappedLine(stringBuilder, tokens, splits, onlyContents); - else - this.$renderSimpleLine(stringBuilder, tokens); - } - - if (this.showInvisibles) { - if (foldLine) - row = foldLine.end.row - - stringBuilder.push( - "", - row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, - "" - ); - } - if (!onlyContents) - stringBuilder.push("
    "); - }; - - this.$getFoldLineTokens = function(row, foldLine) { - var session = this.session; - var renderTokens = []; - - function addTokens(tokens, from, to) { - var idx = 0, col = 0; - while ((col + tokens[idx].value.length) < from) { - col += tokens[idx].value.length; - idx++; - - if (idx == tokens.length) - return; - } - if (col != from) { - var value = tokens[idx].value.substring(from - col); - if (value.length > (to - from)) - value = value.substring(0, to - from); - - renderTokens.push({ - type: tokens[idx].type, - value: value - }); - - col = from + value.length; - idx += 1; - } - - while (col < to && idx < tokens.length) { - var value = tokens[idx].value; - if (value.length + col > to) { - renderTokens.push({ - type: tokens[idx].type, - value: value.substring(0, to - col) - }); - } else - renderTokens.push(tokens[idx]); - col += value.length; - idx += 1; - } - } - - var tokens = session.getTokens(row); - foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { - if (placeholder != null) { - renderTokens.push({ - type: "fold", - value: placeholder - }); - } else { - if (isNewRow) - tokens = session.getTokens(row); - - if (tokens.length) - addTokens(tokens, lastColumn, column); - } - }, foldLine.end.row, this.session.getLine(foldLine.end.row).length); - - return renderTokens; - }; - - this.$useLineGroups = function() { - return this.session.getUseWrapMode(); - }; - - this.destroy = function() { - clearInterval(this.$pollSizeChangesTimer); - if (this.$measureNode) - this.$measureNode.parentNode.removeChild(this.$measureNode); - delete this.$measureNode; - }; - -}).call(Text.prototype); - -exports.Text = Text; - -}); - -ace.define('ace/tooltip', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -function Tooltip (parentNode) { - this.isOpen = false; - this.$element = null; - this.$parentNode = parentNode; -} - -(function() { - this.$init = function() { - this.$element = dom.createElement("div"); - this.$element.className = "ace_tooltip"; - this.$element.style.display = "none"; - this.$parentNode.appendChild(this.$element); - return this.$element; - }; - this.getElement = function() { - return this.$element || this.$init(); - }; - this.setText = function(text) { - dom.setInnerText(this.getElement(), text); - }; - this.setHtml = function(html) { - this.getElement().innerHTML = html; - }; - this.setPosition = function(x, y) { - this.getElement().style.left = x + "px"; - this.getElement().style.top = y + "px"; - }; - this.setClassName = function(className) { - dom.addCssClass(this.getElement(), className); - }; - this.show = function(text, x, y) { - if (text != null) - this.setText(text); - if (x != null && y != null) - this.setPosition(x, y); - if (!this.isOpen) { - this.getElement().style.display = "block"; - this.isOpen = true; - } - }; - - this.hide = function() { - if (this.isOpen) { - this.getElement().style.display = "none"; - this.isOpen = false; - } - }; - this.getHeight = function() { - return this.getElement().offsetHeight; - }; - this.getWidth = function() { - return this.getElement().offsetWidth; - }; - -}).call(Tooltip.prototype); - -exports.Tooltip = Tooltip; -}); - -ace.define('ace/layer/cursor', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - - -var dom = require("../lib/dom"); -var IE8; - -var Cursor = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_cursor-layer"; - parentEl.appendChild(this.element); - - if (IE8 === undefined) - IE8 = "opacity" in this.element; - - this.isVisible = false; - this.isBlinking = true; - this.blinkInterval = 1000; - this.smoothBlinking = false; - - this.cursors = []; - this.cursor = this.addCursor(); - dom.addCssClass(this.element, "ace_hidden-cursors"); - this.$updateCursors = this.$updateVisibility.bind(this); -}; - -(function() { - - this.$updateVisibility = function(val) { - var cursors = this.cursors; - for (var i = cursors.length; i--; ) - cursors[i].style.visibility = val ? "" : "hidden"; - }; - this.$updateOpacity = function(val) { - var cursors = this.cursors; - for (var i = cursors.length; i--; ) - cursors[i].style.opacity = val ? "" : "0"; - }; - - - this.$padding = 0; - this.setPadding = function(padding) { - this.$padding = padding; - }; - - this.setSession = function(session) { - this.session = session; - }; - - this.setBlinking = function(blinking) { - if (blinking != this.isBlinking){ - this.isBlinking = blinking; - this.restartTimer(); - } - }; - - this.setBlinkInterval = function(blinkInterval) { - if (blinkInterval != this.blinkInterval){ - this.blinkInterval = blinkInterval; - this.restartTimer(); - } - }; - - this.setSmoothBlinking = function(smoothBlinking) { - if (smoothBlinking != this.smoothBlinking && !IE8) { - this.smoothBlinking = smoothBlinking; - dom.setCssClass(this.element, "ace_smooth-blinking", smoothBlinking); - this.$updateCursors(true); - this.$updateCursors = (smoothBlinking - ? this.$updateOpacity - : this.$updateVisibility).bind(this); - this.restartTimer(); - } - }; - - this.addCursor = function() { - var el = dom.createElement("div"); - el.className = "ace_cursor"; - this.element.appendChild(el); - this.cursors.push(el); - return el; - }; - - this.removeCursor = function() { - if (this.cursors.length > 1) { - var el = this.cursors.pop(); - el.parentNode.removeChild(el); - return el; - } - }; - - this.hideCursor = function() { - this.isVisible = false; - dom.addCssClass(this.element, "ace_hidden-cursors"); - this.restartTimer(); - }; - - this.showCursor = function() { - this.isVisible = true; - dom.removeCssClass(this.element, "ace_hidden-cursors"); - this.restartTimer(); - }; - - this.restartTimer = function() { - var update = this.$updateCursors; - clearInterval(this.intervalId); - clearTimeout(this.timeoutId); - if (this.smoothBlinking) { - dom.removeCssClass(this.element, "ace_smooth-blinking"); - } - - update(true); - - if (!this.isBlinking || !this.blinkInterval || !this.isVisible) - return; - - if (this.smoothBlinking) { - setTimeout(function(){ - dom.addCssClass(this.element, "ace_smooth-blinking"); - }.bind(this)); - } - - var blink = function(){ - this.timeoutId = setTimeout(function() { - update(false); - }, 0.6 * this.blinkInterval); - }.bind(this); - - this.intervalId = setInterval(function() { - update(true); - blink(); - }, this.blinkInterval); - - blink(); - }; - - this.getPixelPosition = function(position, onScreen) { - if (!this.config || !this.session) - return {left : 0, top : 0}; - - if (!position) - position = this.session.selection.getCursor(); - var pos = this.session.documentToScreenPosition(position); - var cursorLeft = this.$padding + pos.column * this.config.characterWidth; - var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * - this.config.lineHeight; - - return {left : cursorLeft, top : cursorTop}; - }; - - this.update = function(config) { - this.config = config; - - var selections = this.session.$selectionMarkers; - var i = 0, cursorIndex = 0; - - if (selections === undefined || selections.length === 0){ - selections = [{cursor: null}]; - } - - for (var i = 0, n = selections.length; i < n; i++) { - var pixelPos = this.getPixelPosition(selections[i].cursor, true); - if ((pixelPos.top > config.height + config.offset || - pixelPos.top < 0) && i > 1) { - continue; - } - - var style = (this.cursors[cursorIndex++] || this.addCursor()).style; - - style.left = pixelPos.left + "px"; - style.top = pixelPos.top + "px"; - style.width = config.characterWidth + "px"; - style.height = config.lineHeight + "px"; - } - while (this.cursors.length > cursorIndex) - this.removeCursor(); - - var overwrite = this.session.getOverwrite(); - this.$setOverwrite(overwrite); - this.$pixelPos = pixelPos; - this.restartTimer(); - }; - - this.$setOverwrite = function(overwrite) { - if (overwrite != this.overwrite) { - this.overwrite = overwrite; - if (overwrite) - dom.addCssClass(this.element, "ace_overwrite-cursors"); - else - dom.removeCssClass(this.element, "ace_overwrite-cursors"); - } - }; - - this.destroy = function() { - clearInterval(this.intervalId); - clearTimeout(this.timeoutId); - }; - -}).call(Cursor.prototype); - -exports.Cursor = Cursor; - -}); - -ace.define('ace/mouse/default_gutter_handler', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/oop', 'ace/lib/event', 'ace/tooltip'], function(require, exports, module) { - -var dom = require("../lib/dom"); -var oop = require("../lib/oop"); -var event = require("../lib/event"); -var Tooltip = require("../tooltip").Tooltip; - -function GutterHandler(mouseHandler) { - var editor = mouseHandler.editor; - var gutter = editor.renderer.$gutterLayer; - var tooltip = new GutterTooltip(editor.container); - - mouseHandler.editor.setDefaultHandler("guttermousedown", function(e) { - if (!editor.isFocused() || e.getButton() != 0) - return; - var gutterRegion = gutter.getRegion(e); - - if (gutterRegion == "foldWidgets") - return; - - var row = e.getDocumentPosition().row; - var selection = editor.session.selection; - - if (e.getShiftKey()) - selection.selectTo(row, 0); - else { - if (e.domEvent.detail == 2) { - editor.selectAll(); - return e.preventDefault(); - } - mouseHandler.$clickSelection = editor.selection.getLineRange(row); - } - mouseHandler.setState("selectByLines"); - mouseHandler.captureMouse(e); - return e.preventDefault(); - }); - - - var tooltipTimeout, mouseEvent, tooltipAnnotation; - - function showTooltip() { - var row = mouseEvent.getDocumentPosition().row; - var annotation = gutter.$annotations[row]; - if (!annotation) - return hideTooltip(); - - var maxRow = editor.session.getLength(); - if (row == maxRow) { - var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row; - var pos = mouseEvent.$pos; - if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column)) - return hideTooltip(); - } - - if (tooltipAnnotation == annotation) - return; - tooltipAnnotation = annotation.text.join("
    "); - - tooltip.setHtml(tooltipAnnotation); - tooltip.show(); - editor.on("mousewheel", hideTooltip); - - if (mouseHandler.$tooltipFollowsMouse) { - moveTooltip(mouseEvent); - } else { - var gutterElement = gutter.$cells[row].element; - var rect = gutterElement.getBoundingClientRect(); - var style = tooltip.getElement().style; - style.left = rect.right + "px"; - style.top = rect.bottom + "px"; - } - } - - function hideTooltip() { - if (tooltipTimeout) - tooltipTimeout = clearTimeout(tooltipTimeout); - if (tooltipAnnotation) { - tooltip.hide(); - tooltipAnnotation = null; - editor.removeEventListener("mousewheel", hideTooltip); - } - } - - function moveTooltip(e) { - tooltip.setPosition(e.x, e.y); - } - - mouseHandler.editor.setDefaultHandler("guttermousemove", function(e) { - var target = e.domEvent.target || e.domEvent.srcElement; - if (dom.hasCssClass(target, "ace_fold-widget")) - return hideTooltip(); - - if (tooltipAnnotation && mouseHandler.$tooltipFollowsMouse) - moveTooltip(e); - - mouseEvent = e; - if (tooltipTimeout) - return; - tooltipTimeout = setTimeout(function() { - tooltipTimeout = null; - if (mouseEvent && !mouseHandler.isMousePressed) - showTooltip(); - else - hideTooltip(); - }, 50); - }); - - event.addListener(editor.renderer.$gutter, "mouseout", function(e) { - mouseEvent = null; - if (!tooltipAnnotation || tooltipTimeout) - return; - - tooltipTimeout = setTimeout(function() { - tooltipTimeout = null; - hideTooltip(); - }, 50); - }); - - editor.on("changeSession", hideTooltip); -} - -function GutterTooltip(parentNode) { - Tooltip.call(this, parentNode); -} - -oop.inherits(GutterTooltip, Tooltip); - -(function(){ - this.setPosition = function(x, y) { - var windowWidth = window.innerWidth || document.documentElement.clientWidth; - var windowHeight = window.innerHeight || document.documentElement.clientHeight; - var width = this.getWidth(); - var height = this.getHeight(); - x += 15; - y += 15; - if (x + width > windowWidth) { - x -= (x + width) - windowWidth; - } - if (y + height > windowHeight) { - y -= 20 + height; - } - Tooltip.prototype.setPosition.call(this, x, y); - }; - -}).call(GutterTooltip.prototype); - - - -exports.GutterHandler = GutterHandler; - -}); - -ace.define('ace/scrollbar', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/event', 'ace/lib/event_emitter'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -var event = require("./lib/event"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var ScrollBar = function(parent) { - this.element = dom.createElement("div"); - this.element.className = "ace_scrollbar ace_scrollbar" + this.classSuffix; - - this.inner = dom.createElement("div"); - this.inner.className = "ace_scrollbar-inner"; - this.element.appendChild(this.inner); - - parent.appendChild(this.element); - - this.setVisible(false); - this.skipEvent = false; - - event.addListener(this.element, "scroll", this.onScroll.bind(this)); - event.addListener(this.element, "mousedown", event.preventDefault); -}; - -(function() { - oop.implement(this, EventEmitter); - - this.setVisible = function(isVisible) { - this.element.style.display = isVisible ? "" : "none"; - this.isVisible = isVisible; - }; -}).call(ScrollBar.prototype); -var VScrollBar = function(parent, renderer) { - ScrollBar.call(this, parent); - this.scrollTop = 0; - renderer.$scrollbarWidth = - this.width = dom.scrollbarWidth(parent.ownerDocument); - this.inner.style.width = - this.element.style.width = (this.width || 15) + 5 + "px"; -}; - -oop.inherits(VScrollBar, ScrollBar); - -(function() { - - this.classSuffix = '-v'; - this.onScroll = function() { - if (!this.skipEvent) { - this.scrollTop = this.element.scrollTop; - this._emit("scroll", {data: this.scrollTop}); - } - this.skipEvent = false; - }; - this.getWidth = function() { - return this.isVisible ? this.width : 0; - }; - this.setHeight = function(height) { - this.element.style.height = height + "px"; - }; - this.setInnerHeight = function(height) { - this.inner.style.height = height + "px"; - }; - this.setScrollHeight = function(height) { - this.inner.style.height = height + "px"; - }; - this.setScrollTop = function(scrollTop) { - if (this.scrollTop != scrollTop) { - this.skipEvent = true; - this.scrollTop = this.element.scrollTop = scrollTop; - } - }; - -}).call(VScrollBar.prototype); -var HScrollBar = function(parent, renderer) { - ScrollBar.call(this, parent); - this.scrollLeft = 0; - this.height = renderer.$scrollbarWidth; - this.inner.style.height = - this.element.style.height = (this.height || 15) + 5 + "px"; -}; - -oop.inherits(HScrollBar, ScrollBar); - -(function() { - - this.classSuffix = '-h'; - this.onScroll = function() { - if (!this.skipEvent) { - this.scrollLeft = this.element.scrollLeft; - this._emit("scroll", {data: this.scrollLeft}); - } - this.skipEvent = false; - }; - this.getHeight = function() { - return this.isVisible ? this.height : 0; - }; - this.setWidth = function(width) { - this.element.style.width = width + "px"; - }; - this.setInnerWidth = function(width) { - this.inner.style.width = width + "px"; - }; - this.setScrollWidth = function(width) { - this.inner.style.width = width + "px"; - }; - this.setScrollLeft = function(scrollLeft) { - if (this.scrollLeft != scrollLeft) { - this.skipEvent = true; - this.scrollLeft = this.element.scrollLeft = scrollLeft; - } - }; - -}).call(HScrollBar.prototype); - - -exports.ScrollBar = VScrollBar; // backward compatibility -exports.ScrollBarV = VScrollBar; // backward compatibility -exports.ScrollBarH = HScrollBar; // backward compatibility - -exports.VScrollBar = VScrollBar; -exports.HScrollBar = HScrollBar; -}); - -ace.define('ace/mouse/default_handlers', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/event', 'ace/lib/useragent'], function(require, exports, module) { - - -var dom = require("../lib/dom"); -var event = require("../lib/event"); -var useragent = require("../lib/useragent"); - -var DRAG_OFFSET = 0; // pixels - -function DefaultHandlers(mouseHandler) { - mouseHandler.$clickSelection = null; - - var editor = mouseHandler.editor; - editor.setDefaultHandler("mousedown", this.onMouseDown.bind(mouseHandler)); - editor.setDefaultHandler("dblclick", this.onDoubleClick.bind(mouseHandler)); - editor.setDefaultHandler("tripleclick", this.onTripleClick.bind(mouseHandler)); - editor.setDefaultHandler("quadclick", this.onQuadClick.bind(mouseHandler)); - editor.setDefaultHandler("mousewheel", this.onMouseWheel.bind(mouseHandler)); - - var exports = ["select", "startSelect", "selectEnd", "selectAllEnd", "selectByWordsEnd", - "selectByLinesEnd", "dragWait", "dragWaitEnd", "focusWait"]; - - exports.forEach(function(x) { - mouseHandler[x] = this[x]; - }, this); - - mouseHandler.selectByLines = this.extendSelectionBy.bind(mouseHandler, "getLineRange"); - mouseHandler.selectByWords = this.extendSelectionBy.bind(mouseHandler, "getWordRange"); -} - -(function() { - - this.onMouseDown = function(ev) { - var inSelection = ev.inSelection(); - var pos = ev.getDocumentPosition(); - this.mousedownEvent = ev; - var editor = this.editor; - - var button = ev.getButton(); - if (button !== 0) { - var selectionRange = editor.getSelectionRange(); - var selectionEmpty = selectionRange.isEmpty(); - - if (selectionEmpty) { - editor.selection.moveToPosition(pos); - } - editor.textInput.onContextMenu(ev.domEvent); - return; // stopping event here breaks contextmenu on ff mac - } - if (inSelection && !editor.isFocused()) { - editor.focus(); - if (this.$focusTimout && !this.$clickSelection && !editor.inMultiSelectMode) { - this.mousedownEvent.time = Date.now(); - this.setState("focusWait"); - this.captureMouse(ev); - return; - } - } - - this.captureMouse(ev); - if (!inSelection || this.$clickSelection || ev.getShiftKey() || editor.inMultiSelectMode) { - this.startSelect(pos); - } else if (inSelection) { - this.mousedownEvent.time = Date.now(); - this.startSelect(pos); - } - return ev.preventDefault(); - }; - - this.startSelect = function(pos) { - pos = pos || this.editor.renderer.screenToTextCoordinates(this.x, this.y); - var editor = this.editor; - var shiftPressed = this.mousedownEvent.getShiftKey(); - if (shiftPressed) { - editor.selection.selectToPosition(pos); - } - else if (!this.$clickSelection) { - editor.selection.moveToPosition(pos); - } - if (editor.renderer.scroller.setCapture) { - editor.renderer.scroller.setCapture(); - } - editor.setStyle("ace_selecting"); - this.setState("select"); - }; - - this.select = function() { - var anchor, editor = this.editor; - var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y); - - if (this.$clickSelection) { - var cmp = this.$clickSelection.comparePoint(cursor); - - if (cmp == -1) { - anchor = this.$clickSelection.end; - } else if (cmp == 1) { - anchor = this.$clickSelection.start; - } else { - var orientedRange = calcRangeOrientation(this.$clickSelection, cursor); - cursor = orientedRange.cursor; - anchor = orientedRange.anchor; - } - editor.selection.setSelectionAnchor(anchor.row, anchor.column); - } - editor.selection.selectToPosition(cursor); - - editor.renderer.scrollCursorIntoView(); - }; - - this.extendSelectionBy = function(unitName) { - var anchor, editor = this.editor; - var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y); - var range = editor.selection[unitName](cursor.row, cursor.column); - - if (this.$clickSelection) { - var cmpStart = this.$clickSelection.comparePoint(range.start); - var cmpEnd = this.$clickSelection.comparePoint(range.end); - - if (cmpStart == -1 && cmpEnd <= 0) { - anchor = this.$clickSelection.end; - if (range.end.row != cursor.row || range.end.column != cursor.column) - cursor = range.start; - } else if (cmpEnd == 1 && cmpStart >= 0) { - anchor = this.$clickSelection.start; - if (range.start.row != cursor.row || range.start.column != cursor.column) - cursor = range.end; - } else if (cmpStart == -1 && cmpEnd == 1) { - cursor = range.end; - anchor = range.start; - } else { - var orientedRange = calcRangeOrientation(this.$clickSelection, cursor); - cursor = orientedRange.cursor; - anchor = orientedRange.anchor; - } - editor.selection.setSelectionAnchor(anchor.row, anchor.column); - } - editor.selection.selectToPosition(cursor); - - editor.renderer.scrollCursorIntoView(); - }; - - this.selectEnd = - this.selectAllEnd = - this.selectByWordsEnd = - this.selectByLinesEnd = function() { - this.editor.unsetStyle("ace_selecting"); - if (this.editor.renderer.scroller.releaseCapture) { - this.editor.renderer.scroller.releaseCapture(); - } - }; - - this.focusWait = function() { - var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); - var time = Date.now(); - - if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimout) - this.startSelect(this.mousedownEvent.getDocumentPosition()); - }; - - this.onDoubleClick = function(ev) { - var pos = ev.getDocumentPosition(); - var editor = this.editor; - var session = editor.session; - - var range = session.getBracketRange(pos); - if (range) { - if (range.isEmpty()) { - range.start.column--; - range.end.column++; - } - this.setState("select"); - } else { - range = editor.selection.getWordRange(pos.row, pos.column); - this.setState("selectByWords"); - } - this.$clickSelection = range; - this[this.state] && this[this.state](ev); - }; - - this.onTripleClick = function(ev) { - var pos = ev.getDocumentPosition(); - var editor = this.editor; - - this.setState("selectByLines"); - this.$clickSelection = editor.selection.getLineRange(pos.row); - this[this.state] && this[this.state](ev); - }; - - this.onQuadClick = function(ev) { - var editor = this.editor; - - editor.selectAll(); - this.$clickSelection = editor.getSelectionRange(); - this.setState("selectAll"); - }; - - this.onMouseWheel = function(ev) { - if (ev.getAccelKey()) - return; - if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) { - ev.wheelX = ev.wheelY; - ev.wheelY = 0; - } - - var t = ev.domEvent.timeStamp; - var dt = t - (this.$lastScrollTime||0); - - var editor = this.editor; - var isScrolable = editor.renderer.isScrollableBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); - if (isScrolable || dt < 200) { - this.$lastScrollTime = t; - editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); - return ev.stop(); - } - }; - -}).call(DefaultHandlers.prototype); - -exports.DefaultHandlers = DefaultHandlers; - -function calcDistance(ax, ay, bx, by) { - return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); -} - -function calcRangeOrientation(range, cursor) { - if (range.start.row == range.end.row) - var cmp = 2 * cursor.column - range.start.column - range.end.column; - else if (range.start.row == range.end.row - 1 && !range.start.column && !range.end.column) - var cmp = cursor.column - 4; - else - var cmp = 2 * cursor.row - range.start.row - range.end.row; - - if (cmp < 0) - return {cursor: range.start, anchor: range.end}; - else - return {cursor: range.end, anchor: range.start}; -} - -}); - -ace.define('ace/renderloop', ['require', 'exports', 'module' , 'ace/lib/event'], function(require, exports, module) { - - -var event = require("./lib/event"); - - -var RenderLoop = function(onRender, win) { - this.onRender = onRender; - this.pending = false; - this.changes = 0; - this.window = win || window; -}; - -(function() { - - - this.schedule = function(change) { - this.changes = this.changes | change; - if (!this.pending && this.changes) { - this.pending = true; - var _self = this; - event.nextFrame(function() { - _self.pending = false; - var changes; - while (changes = _self.changes) { - _self.changes = 0; - _self.onRender(changes); - } - }, this.window); - } - }; - -}).call(RenderLoop.prototype); - -exports.RenderLoop = RenderLoop; -}); - -ace.define('ace/mouse/mouse_handler', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/lib/useragent', 'ace/mouse/default_handlers', 'ace/mouse/default_gutter_handler', 'ace/mouse/mouse_event', 'ace/mouse/dragdrop_handler', 'ace/config'], function(require, exports, module) { - - -var event = require("../lib/event"); -var useragent = require("../lib/useragent"); -var DefaultHandlers = require("./default_handlers").DefaultHandlers; -var DefaultGutterHandler = require("./default_gutter_handler").GutterHandler; -var MouseEvent = require("./mouse_event").MouseEvent; -var DragdropHandler = require("./dragdrop_handler").DragdropHandler; -var config = require("../config"); - -var MouseHandler = function(editor) { - this.editor = editor; - - new DefaultHandlers(this); - new DefaultGutterHandler(this); - new DragdropHandler(this); - - var mouseTarget = editor.renderer.getMouseEventTarget(); - event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click")); - event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove")); - event.addMultiMouseDownListener(mouseTarget, [300, 300, 250], this, "onMouseEvent"); - if (editor.renderer.scrollBarV) { - event.addMultiMouseDownListener(editor.renderer.scrollBarV.inner, [300, 300, 250], this, "onMouseEvent"); - event.addMultiMouseDownListener(editor.renderer.scrollBarH.inner, [300, 300, 250], this, "onMouseEvent"); - } - event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, "mousewheel")); - - var gutterEl = editor.renderer.$gutter; - event.addListener(gutterEl, "mousedown", this.onMouseEvent.bind(this, "guttermousedown")); - event.addListener(gutterEl, "click", this.onMouseEvent.bind(this, "gutterclick")); - event.addListener(gutterEl, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick")); - event.addListener(gutterEl, "mousemove", this.onMouseEvent.bind(this, "guttermousemove")); - - event.addListener(mouseTarget, "mousedown", function(e) { - editor.focus(); - }); - - event.addListener(gutterEl, "mousedown", function(e) { - editor.focus(); - return event.preventDefault(e); - }); -}; - -(function() { - this.onMouseEvent = function(name, e) { - this.editor._emit(name, new MouseEvent(e, this.editor)); - }; - - this.onMouseMove = function(name, e) { - var listeners = this.editor._eventRegistry && this.editor._eventRegistry.mousemove; - if (!listeners || !listeners.length) - return; - - this.editor._emit(name, new MouseEvent(e, this.editor)); - }; - - this.onMouseWheel = function(name, e) { - var mouseEvent = new MouseEvent(e, this.editor); - mouseEvent.speed = this.$scrollSpeed * 2; - mouseEvent.wheelX = e.wheelX; - mouseEvent.wheelY = e.wheelY; - - this.editor._emit(name, mouseEvent); - }; - - this.setState = function(state) { - this.state = state; - }; - - this.captureMouse = function(ev, mouseMoveHandler) { - this.x = ev.x; - this.y = ev.y; - - this.isMousePressed = true; - var renderer = this.editor.renderer; - if (renderer.$keepTextAreaAtCursor) - renderer.$keepTextAreaAtCursor = null; - - var self = this; - var onMouseMove = function(e) { - self.x = e.clientX; - self.y = e.clientY; - mouseMoveHandler && mouseMoveHandler(e); - self.mouseEvent = new MouseEvent(e, self.editor); - self.$mouseMoved = true; - }; - - var onCaptureEnd = function(e) { - clearInterval(timerId); - onCaptureInterval(); - self[self.state + "End"] && self[self.state + "End"](e); - self.$clickSelection = null; - if (renderer.$keepTextAreaAtCursor == null) { - renderer.$keepTextAreaAtCursor = true; - renderer.$moveTextAreaToCursor(); - } - self.isMousePressed = false; - self.$onCaptureMouseMove = self.releaseMouse = null; - self.onMouseEvent("mouseup", e); - }; - - var onCaptureInterval = function() { - self[self.state] && self[self.state](); - self.$mouseMoved = false; - }; - - if (useragent.isOldIE && ev.domEvent.type == "dblclick") { - return setTimeout(function() {onCaptureEnd(ev);}); - } - - self.$onCaptureMouseMove = onMouseMove; - self.releaseMouse = event.capture(this.editor.container, onMouseMove, onCaptureEnd); - var timerId = setInterval(onCaptureInterval, 20); - }; - this.releaseMouse = null; -}).call(MouseHandler.prototype); - -config.defineOptions(MouseHandler.prototype, "mouseHandler", { - scrollSpeed: {initialValue: 2}, - dragDelay: {initialValue: 150}, - dragEnabled: {initialValue: true}, - focusTimout: {initialValue: 0}, - tooltipFollowsMouse: {initialValue: true} -}); - - -exports.MouseHandler = MouseHandler; -}); - -ace.define('ace/layer/font_metrics', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/event_emitter'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var EventEmitter = require("../lib/event_emitter").EventEmitter; - -var CHAR_COUNT = 0; - -var FontMetrics = exports.FontMetrics = function(parentEl, interval) { - this.el = dom.createElement("div"); - this.$setMeasureNodeStyles(this.el.style, true); - - this.$main = dom.createElement("div"); - this.$setMeasureNodeStyles(this.$main.style); - - this.$measureNode = dom.createElement("div"); - this.$setMeasureNodeStyles(this.$measureNode.style); - - - this.el.appendChild(this.$main); - this.el.appendChild(this.$measureNode); - parentEl.appendChild(this.el); - - if (!CHAR_COUNT) - this.$testFractionalRect(); - this.$measureNode.textContent = lang.stringRepeat("X", CHAR_COUNT); - - this.$characterSize = {width: 0, height: 0}; - this.checkForSizeChanges(); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.$characterSize = {width: 0, height: 0}; - - this.$testFractionalRect = function() { - var el = dom.createElement("div"); - this.$setMeasureNodeStyles(el.style); - el.style.width = "0.2px"; - document.documentElement.appendChild(el); - var w = el.getBoundingClientRect().width; - if (w > 0 && w < 1) - CHAR_COUNT = 1; - else - CHAR_COUNT = 100; - el.parentNode.removeChild(el); - }; - - this.$setMeasureNodeStyles = function(style, isRoot) { - style.width = style.height = "auto"; - style.left = style.top = "-100px"; - style.visibility = "hidden"; - style.position = "fixed"; - style.whiteSpace = "pre"; - style.font = "inherit"; - style.overflow = isRoot ? "hidden" : "visible"; - }; - - this.checkForSizeChanges = function() { - var size = this.$measureSizes(); - if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) { - this.$measureNode.style.fontWeight = "bold"; - var boldSize = this.$measureSizes(); - this.$measureNode.style.fontWeight = ""; - this.$characterSize = size; - this.charSizes = Object.create(null); - this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height; - this._emit("changeCharacterSize", {data: size}); - } - }; - - this.$pollSizeChanges = function() { - if (this.$pollSizeChangesTimer) - return this.$pollSizeChangesTimer; - var self = this; - return this.$pollSizeChangesTimer = setInterval(function() { - self.checkForSizeChanges(); - }, 500); - }; - - this.setPolling = function(val) { - if (val) { - this.$pollSizeChanges(); - } else { - if (this.$pollSizeChangesTimer) - this.$pollSizeChangesTimer; - } - }; - - this.$measureSizes = function() { - var rect = this.$measureNode.getBoundingClientRect(); - var size = { - height: rect.height, - width: rect.width / CHAR_COUNT - }; - if (size.width === 0 || size.height === 0) - return null; - return size; - }; - - this.$measureCharWidth = function(ch) { - this.$main.textContent = lang.stringRepeat(ch, CHAR_COUNT); - var rect = this.$main.getBoundingClientRect(); - return rect.width / CHAR_COUNT; - }; - - this.getCharacterWidth = function(ch) { - var w = this.charSizes[ch]; - if (w === undefined) { - this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width; - } - return w; - }; - - this.destroy = function() { - clearInterval(this.$pollSizeChangesTimer); - if (this.el && this.el.parentNode) - this.el.parentNode.removeChild(this.el); - }; - -}).call(FontMetrics.prototype); - -}); - -ace.define('ace/keyboard/textinput', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/lib/useragent', 'ace/lib/dom', 'ace/lib/lang'], function(require, exports, module) { - - -var event = require("../lib/event"); -var useragent = require("../lib/useragent"); -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var BROKEN_SETDATA = useragent.isChrome < 18; - -var TextInput = function(parentNode, host) { - var text = dom.createElement("textarea"); - text.className = "ace_text-input"; - - if (useragent.isTouchPad) - text.setAttribute("x-palm-disable-auto-cap", true); - - text.wrap = "off"; - text.autocorrect = "off"; - text.autocapitalize = "off"; - text.spellcheck = false; - - text.style.opacity = "0"; - parentNode.insertBefore(text, parentNode.firstChild); - - var PLACEHOLDER = "\x01\x01"; - - var cut = false; - var copied = false; - var pasted = false; - var inComposition = false; - var tempStyle = ''; - var isSelectionEmpty = true; - try { var isFocused = document.activeElement === text; } catch(e) {} - - event.addListener(text, "blur", function() { - host.onBlur(); - isFocused = false; - }); - event.addListener(text, "focus", function() { - isFocused = true; - host.onFocus(); - resetSelection(); - }); - this.focus = function() { text.focus(); }; - this.blur = function() { text.blur(); }; - this.isFocused = function() { - return isFocused; - }; - var syncSelection = lang.delayedCall(function() { - isFocused && resetSelection(isSelectionEmpty); - }); - var syncValue = lang.delayedCall(function() { - if (!inComposition) { - text.value = PLACEHOLDER; - isFocused && resetSelection(); - } - }); - - function resetSelection(isEmpty) { - if (inComposition) - return; - if (inputHandler) { - selectionStart = 0; - selectionEnd = isEmpty ? 0 : text.value.length - 1; - } else { - var selectionStart = isEmpty ? 2 : 1; - var selectionEnd = 2; - } - try { - text.setSelectionRange(selectionStart, selectionEnd); - } catch(e){} - } - - function resetValue() { - if (inComposition) - return; - text.value = PLACEHOLDER; - if (useragent.isWebKit) - syncValue.schedule(); - } - - useragent.isWebKit || host.addEventListener('changeSelection', function() { - if (host.selection.isEmpty() != isSelectionEmpty) { - isSelectionEmpty = !isSelectionEmpty; - syncSelection.schedule(); - } - }); - - resetValue(); - if (isFocused) - host.onFocus(); - - - var isAllSelected = function(text) { - return text.selectionStart === 0 && text.selectionEnd === text.value.length; - }; - if (!text.setSelectionRange && text.createTextRange) { - text.setSelectionRange = function(selectionStart, selectionEnd) { - var range = this.createTextRange(); - range.collapse(true); - range.moveStart('character', selectionStart); - range.moveEnd('character', selectionEnd); - range.select(); - }; - isAllSelected = function(text) { - try { - var range = text.ownerDocument.selection.createRange(); - }catch(e) {} - if (!range || range.parentElement() != text) return false; - return range.text == text.value; - } - } - if (useragent.isOldIE) { - var inPropertyChange = false; - var onPropertyChange = function(e){ - if (inPropertyChange) - return; - var data = text.value; - if (inComposition || !data || data == PLACEHOLDER) - return; - if (e && data == PLACEHOLDER[0]) - return syncProperty.schedule(); - - sendText(data); - inPropertyChange = true; - resetValue(); - inPropertyChange = false; - }; - var syncProperty = lang.delayedCall(onPropertyChange); - event.addListener(text, "propertychange", onPropertyChange); - - var keytable = { 13:1, 27:1 }; - event.addListener(text, "keyup", function (e) { - if (inComposition && (!text.value || keytable[e.keyCode])) - setTimeout(onCompositionEnd, 0); - if ((text.value.charCodeAt(0)||0) < 129) { - return syncProperty.call(); - } - inComposition ? onCompositionUpdate() : onCompositionStart(); - }); - event.addListener(text, "keydown", function (e) { - syncProperty.schedule(50); - }); - } - - var onSelect = function(e) { - if (cut) { - cut = false; - } else if (copied) { - copied = false; - } else if (isAllSelected(text)) { - host.selectAll(); - resetSelection(); - } else if (inputHandler) { - resetSelection(host.selection.isEmpty()); - } - }; - - var inputHandler = null; - this.setInputHandler = function(cb) {inputHandler = cb}; - this.getInputHandler = function() {return inputHandler}; - var afterContextMenu = false; - - var sendText = function(data) { - if (inputHandler) { - data = inputHandler(data); - inputHandler = null; - } - if (pasted) { - resetSelection(); - if (data) - host.onPaste(data); - pasted = false; - } else if (data == PLACEHOLDER.charAt(0)) { - if (afterContextMenu) - host.execCommand("del", {source: "ace"}); - else // some versions of android do not fire keydown when pressing backspace - host.execCommand("backspace", {source: "ace"}); - } else { - if (data.substring(0, 2) == PLACEHOLDER) - data = data.substr(2); - else if (data.charAt(0) == PLACEHOLDER.charAt(0)) - data = data.substr(1); - else if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) - data = data.slice(0, -1); - if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) - data = data.slice(0, -1); - - if (data) - host.onTextInput(data); - } - if (afterContextMenu) - afterContextMenu = false; - }; - var onInput = function(e) { - if (inComposition) - return; - var data = text.value; - sendText(data); - resetValue(); - }; - - var onCut = function(e) { - var data = host.getCopyText(); - if (!data) { - event.preventDefault(e); - return; - } - - var clipboardData = e.clipboardData || window.clipboardData; - - if (clipboardData && !BROKEN_SETDATA) { - var supported = clipboardData.setData("Text", data); - if (supported) { - host.onCut(); - event.preventDefault(e); - } - } - - if (!supported) { - cut = true; - text.value = data; - text.select(); - setTimeout(function(){ - cut = false; - resetValue(); - resetSelection(); - host.onCut(); - }); - } - }; - - var onCopy = function(e) { - var data = host.getCopyText(); - if (!data) { - event.preventDefault(e); - return; - } - - var clipboardData = e.clipboardData || window.clipboardData; - if (clipboardData && !BROKEN_SETDATA) { - var supported = clipboardData.setData("Text", data); - if (supported) { - host.onCopy(); - event.preventDefault(e); - } - } - if (!supported) { - copied = true; - text.value = data; - text.select(); - setTimeout(function(){ - copied = false; - resetValue(); - resetSelection(); - host.onCopy(); - }); - } - }; - - var onPaste = function(e) { - var clipboardData = e.clipboardData || window.clipboardData; - - if (clipboardData) { - var data = clipboardData.getData("Text"); - if (data) - host.onPaste(data); - if (useragent.isIE) - setTimeout(resetSelection); - event.preventDefault(e); - } - else { - text.value = ""; - pasted = true; - } - }; - - event.addCommandKeyListener(text, host.onCommandKey.bind(host)); - - event.addListener(text, "select", onSelect); - - event.addListener(text, "input", onInput); - - event.addListener(text, "cut", onCut); - event.addListener(text, "copy", onCopy); - event.addListener(text, "paste", onPaste); - if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)){ - event.addListener(parentNode, "keydown", function(e) { - if ((useragent.isMac && !e.metaKey) || !e.ctrlKey) - return; - - switch (e.keyCode) { - case 67: - onCopy(e); - break; - case 86: - onPaste(e); - break; - case 88: - onCut(e); - break; - } - }); - } - var onCompositionStart = function(e) { - if (inComposition || !host.onCompositionStart) return; - inComposition = {}; - host.onCompositionStart(); - setTimeout(onCompositionUpdate, 0); - host.on("mousedown", onCompositionEnd); - if (!host.selection.isEmpty()) { - host.insert(""); - host.session.markUndoGroup(); - host.selection.clearSelection(); - } - host.session.markUndoGroup(); - }; - - var onCompositionUpdate = function() { - if (!inComposition || !host.onCompositionUpdate) return; - var val = text.value.replace(/\x01/g, ""); - if (inComposition.lastValue === val) return; - - host.onCompositionUpdate(val); - if (inComposition.lastValue) - host.undo(); - inComposition.lastValue = val; - if (inComposition.lastValue) { - var r = host.selection.getRange(); - host.insert(inComposition.lastValue); - host.session.markUndoGroup(); - inComposition.range = host.selection.getRange(); - host.selection.setRange(r); - host.selection.clearSelection(); - } - }; - - var onCompositionEnd = function(e) { - if (!host.onCompositionEnd) return; - var c = inComposition; - inComposition = false; - var timer = setTimeout(function() { - timer = null; - var str = text.value.replace(/\x01/g, ""); - if (inComposition) - return - else if (str == c.lastValue) - resetValue(); - else if (!c.lastValue && str) { - resetValue(); - sendText(str); - } - }); - inputHandler = function compositionInputHandler(str) { - if (timer) - clearTimeout(timer); - str = str.replace(/\x01/g, ""); - if (str == c.lastValue) - return ""; - if (c.lastValue && timer) - host.undo(); - return str; - }; - host.onCompositionEnd(); - host.removeListener("mousedown", onCompositionEnd); - if (e.type == "compositionend" && c.range) { - host.selection.setRange(c.range); - } - }; - - - - var syncComposition = lang.delayedCall(onCompositionUpdate, 50); - - event.addListener(text, "compositionstart", onCompositionStart); - if (useragent.isGecko) { - event.addListener(text, "text", function(){syncComposition.schedule()}); - } else { - event.addListener(text, "keyup", function(){syncComposition.schedule()}); - event.addListener(text, "keydown", function(){syncComposition.schedule()}); - } - event.addListener(text, "compositionend", onCompositionEnd); - - this.getElement = function() { - return text; - }; - - this.setReadOnly = function(readOnly) { - text.readOnly = readOnly; - }; - - this.onContextMenu = function(e) { - afterContextMenu = true; - if (!tempStyle) - tempStyle = text.style.cssText; - - text.style.cssText = "z-index:100000;" + (useragent.isIE ? "opacity:0.1;" : ""); - - resetSelection(host.selection.isEmpty()); - host._emit("nativecontextmenu", {target: host, domEvent: e}); - var rect = host.container.getBoundingClientRect(); - var style = dom.computedStyle(host.container); - var top = rect.top + (parseInt(style.borderTopWidth) || 0); - var left = rect.left + (parseInt(rect.borderLeftWidth) || 0); - var maxTop = rect.bottom - top - text.clientHeight; - var move = function(e) { - text.style.left = e.clientX - left - 2 + "px"; - text.style.top = Math.min(e.clientY - top - 2, maxTop) + "px"; - }; - move(e); - - if (e.type != "mousedown") - return; - - if (host.renderer.$keepTextAreaAtCursor) - host.renderer.$keepTextAreaAtCursor = null; - if (useragent.isWin) - event.capture(host.container, move, onContextMenuClose); - }; - - this.onContextMenuClose = onContextMenuClose; - function onContextMenuClose() { - setTimeout(function () { - if (tempStyle) { - text.style.cssText = tempStyle; - tempStyle = ''; - } - if (host.renderer.$keepTextAreaAtCursor == null) { - host.renderer.$keepTextAreaAtCursor = true; - host.renderer.$moveTextAreaToCursor(); - } - }, 0); - } - if (!useragent.isGecko || useragent.isMac) { - var onContextMenu = function(e) { - host.textInput.onContextMenu(e); - onContextMenuClose(); - }; - event.addListener(host.renderer.scroller, "contextmenu", onContextMenu); - event.addListener(text, "contextmenu", onContextMenu); - } -}; - -exports.TextInput = TextInput; -}); - -ace.define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.last = function(a) { - return a[a.length - 1]; -}; - -exports.stringReverse = function(string) { - return string.split("").reverse().join(""); -}; - -exports.stringRepeat = function (string, count) { - var result = ''; - while (count > 0) { - if (count & 1) - result += string; - - if (count >>= 1) - string += string; - } - return result; -}; - -var trimBeginRegexp = /^\s\s*/; -var trimEndRegexp = /\s\s*$/; - -exports.stringTrimLeft = function (string) { - return string.replace(trimBeginRegexp, ''); -}; - -exports.stringTrimRight = function (string) { - return string.replace(trimEndRegexp, ''); -}; - -exports.copyObject = function(obj) { - var copy = {}; - for (var key in obj) { - copy[key] = obj[key]; - } - return copy; -}; - -exports.copyArray = function(array){ - var copy = []; - for (var i=0, l=array.length; i 1 && !this.inMultiSelectMode) { - this._signal("multiSelect"); - this.inMultiSelectMode = true; - this.session.$undoSelect = false; - this.rangeList.attach(this.session); - } - - return $blockChangeEvents || this.fromOrientedRange(range); - }; - - this.toSingleRange = function(range) { - range = range || this.ranges[0]; - var removed = this.rangeList.removeAll(); - if (removed.length) - this.$onRemoveRange(removed); - - range && this.fromOrientedRange(range); - }; - this.substractPoint = function(pos) { - var removed = this.rangeList.substractPoint(pos); - if (removed) { - this.$onRemoveRange(removed); - return removed[0]; - } - }; - this.mergeOverlappingRanges = function() { - var removed = this.rangeList.merge(); - if (removed.length) - this.$onRemoveRange(removed); - else if(this.ranges[0]) - this.fromOrientedRange(this.ranges[0]); - }; - - this.$onAddRange = function(range) { - this.rangeCount = this.rangeList.ranges.length; - this.ranges.unshift(range); - this._signal("addRange", {range: range}); - }; - - this.$onRemoveRange = function(removed) { - this.rangeCount = this.rangeList.ranges.length; - if (this.rangeCount == 1 && this.inMultiSelectMode) { - var lastRange = this.rangeList.ranges.pop(); - removed.push(lastRange); - this.rangeCount = 0; - } - - for (var i = removed.length; i--; ) { - var index = this.ranges.indexOf(removed[i]); - this.ranges.splice(index, 1); - } - - this._signal("removeRange", {ranges: removed}); - - if (this.rangeCount == 0 && this.inMultiSelectMode) { - this.inMultiSelectMode = false; - this._signal("singleSelect"); - this.session.$undoSelect = true; - this.rangeList.detach(this.session); - } - - lastRange = lastRange || this.ranges[0]; - if (lastRange && !lastRange.isEqual(this.getRange())) - this.fromOrientedRange(lastRange); - }; - this.$initRangeList = function() { - if (this.rangeList) - return; - - this.rangeList = new RangeList(); - this.ranges = []; - this.rangeCount = 0; - }; - this.getAllRanges = function() { - return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()]; - }; - - this.splitIntoLines = function () { - if (this.rangeCount > 1) { - var ranges = this.rangeList.ranges; - var lastRange = ranges[ranges.length - 1]; - var range = Range.fromPoints(ranges[0].start, lastRange.end); - - this.toSingleRange(); - this.setSelectionRange(range, lastRange.cursor == lastRange.start); - } else { - var range = this.getRange(); - var isBackwards = this.isBackwards(); - var startRow = range.start.row; - var endRow = range.end.row; - if (startRow == endRow) { - if (isBackwards) - var start = range.end, end = range.start; - else - var start = range.start, end = range.end; - - this.addRange(Range.fromPoints(end, end)); - this.addRange(Range.fromPoints(start, start)); - return; - } - - var rectSel = []; - var r = this.getLineRange(startRow, true); - r.start.column = range.start.column; - rectSel.push(r); - - for (var i = startRow + 1; i < endRow; i++) - rectSel.push(this.getLineRange(i, true)); - - r = this.getLineRange(endRow, true); - r.end.column = range.end.column; - rectSel.push(r); - - rectSel.forEach(this.addRange, this); - } - }; - this.toggleBlockSelection = function () { - if (this.rangeCount > 1) { - var ranges = this.rangeList.ranges; - var lastRange = ranges[ranges.length - 1]; - var range = Range.fromPoints(ranges[0].start, lastRange.end); - - this.toSingleRange(); - this.setSelectionRange(range, lastRange.cursor == lastRange.start); - } else { - var cursor = this.session.documentToScreenPosition(this.selectionLead); - var anchor = this.session.documentToScreenPosition(this.selectionAnchor); - - var rectSel = this.rectangularRangeBlock(cursor, anchor); - rectSel.forEach(this.addRange, this); - } - }; - this.rectangularRangeBlock = function(screenCursor, screenAnchor, includeEmptyLines) { - var rectSel = []; - - var xBackwards = screenCursor.column < screenAnchor.column; - if (xBackwards) { - var startColumn = screenCursor.column; - var endColumn = screenAnchor.column; - } else { - var startColumn = screenAnchor.column; - var endColumn = screenCursor.column; - } - - var yBackwards = screenCursor.row < screenAnchor.row; - if (yBackwards) { - var startRow = screenCursor.row; - var endRow = screenAnchor.row; - } else { - var startRow = screenAnchor.row; - var endRow = screenCursor.row; - } - - if (startColumn < 0) - startColumn = 0; - if (startRow < 0) - startRow = 0; - - if (startRow == endRow) - includeEmptyLines = true; - - for (var row = startRow; row <= endRow; row++) { - var range = Range.fromPoints( - this.session.screenToDocumentPosition(row, startColumn), - this.session.screenToDocumentPosition(row, endColumn) - ); - if (range.isEmpty()) { - if (docEnd && isSamePoint(range.end, docEnd)) - break; - var docEnd = range.end; - } - range.cursor = xBackwards ? range.start : range.end; - rectSel.push(range); - } - - if (yBackwards) - rectSel.reverse(); - - if (!includeEmptyLines) { - var end = rectSel.length - 1; - while (rectSel[end].isEmpty() && end > 0) - end--; - if (end > 0) { - var start = 0; - while (rectSel[start].isEmpty()) - start++; - } - for (var i = end; i >= start; i--) { - if (rectSel[i].isEmpty()) - rectSel.splice(i, 1); - } - } - - return rectSel; - }; -}).call(Selection.prototype); -var Editor = require("./editor").Editor; -(function() { - this.updateSelectionMarkers = function() { - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); - }; - this.addSelectionMarker = function(orientedRange) { - if (!orientedRange.cursor) - orientedRange.cursor = orientedRange.end; - - var style = this.getSelectionStyle(); - orientedRange.marker = this.session.addMarker(orientedRange, "ace_selection", style); - - this.session.$selectionMarkers.push(orientedRange); - this.session.selectionMarkerCount = this.session.$selectionMarkers.length; - return orientedRange; - }; - this.removeSelectionMarker = function(range) { - if (!range.marker) - return; - this.session.removeMarker(range.marker); - var index = this.session.$selectionMarkers.indexOf(range); - if (index != -1) - this.session.$selectionMarkers.splice(index, 1); - this.session.selectionMarkerCount = this.session.$selectionMarkers.length; - }; - - this.removeSelectionMarkers = function(ranges) { - var markerList = this.session.$selectionMarkers; - for (var i = ranges.length; i--; ) { - var range = ranges[i]; - if (!range.marker) - continue; - this.session.removeMarker(range.marker); - var index = markerList.indexOf(range); - if (index != -1) - markerList.splice(index, 1); - } - this.session.selectionMarkerCount = markerList.length; - }; - - this.$onAddRange = function(e) { - this.addSelectionMarker(e.range); - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); - }; - - this.$onRemoveRange = function(e) { - this.removeSelectionMarkers(e.ranges); - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); - }; - - this.$onMultiSelect = function(e) { - if (this.inMultiSelectMode) - return; - this.inMultiSelectMode = true; - - this.setStyle("ace_multiselect"); - this.keyBinding.addKeyboardHandler(commands.keyboardHandler); - this.commands.setDefaultHandler("exec", this.$onMultiSelectExec); - - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); - }; - - this.$onSingleSelect = function(e) { - if (this.session.multiSelect.inVirtualMode) - return; - this.inMultiSelectMode = false; - - this.unsetStyle("ace_multiselect"); - this.keyBinding.removeKeyboardHandler(commands.keyboardHandler); - - this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec); - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); - this._emit("changeSelection"); - }; - - this.$onMultiSelectExec = function(e) { - var command = e.command; - var editor = e.editor; - if (!editor.multiSelect) - return; - if (!command.multiSelectAction) { - var result = command.exec(editor, e.args || {}); - editor.multiSelect.addRange(editor.multiSelect.toOrientedRange()); - editor.multiSelect.mergeOverlappingRanges(); - } else if (command.multiSelectAction == "forEach") { - result = editor.forEachSelection(command, e.args); - } else if (command.multiSelectAction == "forEachLine") { - result = editor.forEachSelection(command, e.args, true); - } else if (command.multiSelectAction == "single") { - editor.exitMultiSelectMode(); - result = command.exec(editor, e.args || {}); - } else { - result = command.multiSelectAction(editor, e.args || {}); - } - return result; - }; - this.forEachSelection = function(cmd, args, $byLines) { - if (this.inVirtualSelectionMode) - return; - - var session = this.session; - var selection = this.selection; - var rangeList = selection.rangeList; - var result; - - var reg = selection._eventRegistry; - selection._eventRegistry = {}; - - var tmpSel = new Selection(session); - this.inVirtualSelectionMode = true; - for (var i = rangeList.ranges.length; i--;) { - if ($byLines) { - while (i > 0 && rangeList.ranges[i].start.row == rangeList.ranges[i - 1].end.row) - i--; - } - tmpSel.fromOrientedRange(rangeList.ranges[i]); - tmpSel.id = rangeList.ranges[i].marker; - this.selection = session.selection = tmpSel; - var cmdResult = cmd.exec(this, args || {}); - if (result !== undefined) - result = cmdResult; - tmpSel.toOrientedRange(rangeList.ranges[i]); - } - tmpSel.detach(); - - this.selection = session.selection = selection; - this.inVirtualSelectionMode = false; - selection._eventRegistry = reg; - selection.mergeOverlappingRanges(); - - var anim = this.renderer.$scrollAnimation; - this.onCursorChange(); - this.onSelectionChange(); - if (anim && anim.from == anim.to) - this.renderer.animateScrolling(anim.from); - - return result; - }; - this.exitMultiSelectMode = function() { - if (!this.inMultiSelectMode || this.inVirtualSelectionMode) - return; - this.multiSelect.toSingleRange(); - }; - - this.getSelectedText = function() { - var text = ""; - if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { - var ranges = this.multiSelect.rangeList.ranges; - var buf = []; - for (var i = 0; i < ranges.length; i++) { - buf.push(this.session.getTextRange(ranges[i])); - } - var nl = this.session.getDocument().getNewLineCharacter(); - text = buf.join(nl); - if (text.length == (buf.length - 1) * nl.length) - text = ""; - } else if (!this.selection.isEmpty()) { - text = this.session.getTextRange(this.getSelectionRange()); - } - return text; - }; - this.onPaste = function(text) { - if (this.$readOnly) - return; - - - var e = {text: text}; - this._signal("paste", e); - text = e.text; - if (!this.inMultiSelectMode || this.inVirtualSelectionMode) - return this.insert(text); - - var lines = text.split(/\r\n|\r|\n/); - var ranges = this.selection.rangeList.ranges; - - if (lines.length > ranges.length || lines.length < 2 || !lines[1]) - return this.commands.exec("insertstring", this, text); - - for (var i = ranges.length; i--;) { - var range = ranges[i]; - if (!range.isEmpty()) - this.session.remove(range); - - this.session.insert(range.start, lines[i]); - } - }; - this.findAll = function(needle, options, additive) { - options = options || {}; - options.needle = needle || options.needle; - this.$search.set(options); - - var ranges = this.$search.findAll(this.session); - if (!ranges.length) - return 0; - - this.$blockScrolling += 1; - var selection = this.multiSelect; - - if (!additive) - selection.toSingleRange(ranges[0]); - - for (var i = ranges.length; i--; ) - selection.addRange(ranges[i], true); - - this.$blockScrolling -= 1; - - return ranges.length; - }; - this.selectMoreLines = function(dir, skip) { - var range = this.selection.toOrientedRange(); - var isBackwards = range.cursor == range.end; - - var screenLead = this.session.documentToScreenPosition(range.cursor); - if (this.selection.$desiredColumn) - screenLead.column = this.selection.$desiredColumn; - - var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column); - - if (!range.isEmpty()) { - var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start); - var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column); - } else { - var anchor = lead; - } - - if (isBackwards) { - var newRange = Range.fromPoints(lead, anchor); - newRange.cursor = newRange.start; - } else { - var newRange = Range.fromPoints(anchor, lead); - newRange.cursor = newRange.end; - } - - newRange.desiredColumn = screenLead.column; - if (!this.selection.inMultiSelectMode) { - this.selection.addRange(range); - } else { - if (skip) - var toRemove = range.cursor; - } - - this.selection.addRange(newRange); - if (toRemove) - this.selection.substractPoint(toRemove); - }; - this.transposeSelections = function(dir) { - var session = this.session; - var sel = session.multiSelect; - var all = sel.ranges; - - for (var i = all.length; i--; ) { - var range = all[i]; - if (range.isEmpty()) { - var tmp = session.getWordRange(range.start.row, range.start.column); - range.start.row = tmp.start.row; - range.start.column = tmp.start.column; - range.end.row = tmp.end.row; - range.end.column = tmp.end.column; - } - } - sel.mergeOverlappingRanges(); - - var words = []; - for (var i = all.length; i--; ) { - var range = all[i]; - words.unshift(session.getTextRange(range)); - } - - if (dir < 0) - words.unshift(words.pop()); - else - words.push(words.shift()); - - for (var i = all.length; i--; ) { - var range = all[i]; - var tmp = range.clone(); - session.replace(range, words[i]); - range.start.row = tmp.start.row; - range.start.column = tmp.start.column; - } - }; - this.selectMore = function(dir, skip) { - var session = this.session; - var sel = session.multiSelect; - - var range = sel.toOrientedRange(); - if (range.isEmpty()) { - range = session.getWordRange(range.start.row, range.start.column); - range.cursor = dir == -1 ? range.start : range.end; - this.multiSelect.addRange(range); - } - var needle = session.getTextRange(range); - - var newRange = find(session, needle, dir); - if (newRange) { - newRange.cursor = dir == -1 ? newRange.start : newRange.end; - this.$blockScrolling += 1; - this.session.unfold(newRange); - this.multiSelect.addRange(newRange); - this.$blockScrolling -= 1; - this.renderer.scrollCursorIntoView(null, 0.5); - } - if (skip) - this.multiSelect.substractPoint(range.cursor); - }; - this.alignCursors = function() { - var session = this.session; - var sel = session.multiSelect; - var ranges = sel.ranges; - - if (!ranges.length) { - var range = this.selection.getRange(); - var fr = range.start.row, lr = range.end.row; - var guessRange = fr == lr; - if (guessRange) { - var max = this.session.getLength(); - var line; - do { - line = this.session.getLine(lr); - } while (/[=:]/.test(line) && ++lr < max); - do { - line = this.session.getLine(fr); - } while (/[=:]/.test(line) && --fr > 0); - - if (fr < 0) fr = 0; - if (lr >= max) lr = max - 1; - } - var lines = this.session.doc.removeLines(fr, lr); - lines = this.$reAlignText(lines, guessRange); - this.session.doc.insert({row: fr, column: 0}, lines.join("\n") + "\n"); - if (!guessRange) { - range.start.column = 0; - range.end.column = lines[lines.length - 1].length; - } - this.selection.setRange(range); - } else { - var row = -1; - var sameRowRanges = ranges.filter(function(r) { - if (r.cursor.row == row) - return true; - row = r.cursor.row; - }); - sel.$onRemoveRange(sameRowRanges); - - var maxCol = 0; - var minSpace = Infinity; - var spaceOffsets = ranges.map(function(r) { - var p = r.cursor; - var line = session.getLine(p.row); - var spaceOffset = line.substr(p.column).search(/\S/g); - if (spaceOffset == -1) - spaceOffset = 0; - - if (p.column > maxCol) - maxCol = p.column; - if (spaceOffset < minSpace) - minSpace = spaceOffset; - return spaceOffset; - }); - ranges.forEach(function(r, i) { - var p = r.cursor; - var l = maxCol - p.column; - var d = spaceOffsets[i] - minSpace; - if (l > d) - session.insert(p, lang.stringRepeat(" ", l - d)); - else - session.remove(new Range(p.row, p.column, p.row, p.column - l + d)); - - r.start.column = r.end.column = maxCol; - r.start.row = r.end.row = p.row; - r.cursor = r.end; - }); - sel.fromOrientedRange(ranges[0]); - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); - } - }; - - this.$reAlignText = function(lines, forceLeft) { - var isLeftAligned = true, isRightAligned = true; - var startW, textW, endW; - - return lines.map(function(line) { - var m = line.match(/(\s*)(.*?)(\s*)([=:].*)/); - if (!m) - return [line]; - - if (startW == null) { - startW = m[1].length; - textW = m[2].length; - endW = m[3].length; - return m; - } - - if (startW + textW + endW != m[1].length + m[2].length + m[3].length) - isRightAligned = false; - if (startW != m[1].length) - isLeftAligned = false; - - if (startW > m[1].length) - startW = m[1].length; - if (textW < m[2].length) - textW = m[2].length; - if (endW > m[3].length) - endW = m[3].length; - - return m; - }).map(forceLeft ? alignLeft : - isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign); - - function spaces(n) { - return lang.stringRepeat(" ", n); - } - - function alignLeft(m) { - return !m[2] ? m[0] : spaces(startW) + m[2] - + spaces(textW - m[2].length + endW) - + m[4].replace(/^([=:])\s+/, "$1 ") - } - function alignRight(m) { - return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2] - + spaces(endW, " ") - + m[4].replace(/^([=:])\s+/, "$1 ") - } - function unAlign(m) { - return !m[2] ? m[0] : spaces(startW) + m[2] - + spaces(endW) - + m[4].replace(/^([=:])\s+/, "$1 ") - } - } -}).call(Editor.prototype); - - -function isSamePoint(p1, p2) { - return p1.row == p2.row && p1.column == p2.column; -} -exports.onSessionChange = function(e) { - var session = e.session; - if (!session.multiSelect) { - session.$selectionMarkers = []; - session.selection.$initRangeList(); - session.multiSelect = session.selection; - } - this.multiSelect = session.multiSelect; - - var oldSession = e.oldSession; - if (oldSession) { - oldSession.multiSelect.removeEventListener("addRange", this.$onAddRange); - oldSession.multiSelect.removeEventListener("removeRange", this.$onRemoveRange); - oldSession.multiSelect.removeEventListener("multiSelect", this.$onMultiSelect); - oldSession.multiSelect.removeEventListener("singleSelect", this.$onSingleSelect); - } - - session.multiSelect.on("addRange", this.$onAddRange); - session.multiSelect.on("removeRange", this.$onRemoveRange); - session.multiSelect.on("multiSelect", this.$onMultiSelect); - session.multiSelect.on("singleSelect", this.$onSingleSelect); - - if (this.inMultiSelectMode != session.selection.inMultiSelectMode) { - if (session.selection.inMultiSelectMode) - this.$onMultiSelect(); - else - this.$onSingleSelect(); - } -}; -function MultiSelect(editor) { - if (editor.$multiselectOnSessionChange) - return; - editor.$onAddRange = editor.$onAddRange.bind(editor); - editor.$onRemoveRange = editor.$onRemoveRange.bind(editor); - editor.$onMultiSelect = editor.$onMultiSelect.bind(editor); - editor.$onSingleSelect = editor.$onSingleSelect.bind(editor); - editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor); - - editor.$multiselectOnSessionChange(editor); - editor.on("changeSession", editor.$multiselectOnSessionChange); - - editor.on("mousedown", onMouseDown); - editor.commands.addCommands(commands.defaultCommands); - - addAltCursorListeners(editor); -} - -function addAltCursorListeners(editor){ - var el = editor.textInput.getElement(); - var altCursor = false; - event.addListener(el, "keydown", function(e) { - if (e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey)) { - if (!altCursor) { - editor.renderer.setMouseCursor("crosshair"); - altCursor = true; - } - } else if (altCursor) { - reset(); - } - }); - - event.addListener(el, "keyup", reset); - event.addListener(el, "blur", reset); - function reset(e) { - if (altCursor) { - editor.renderer.setMouseCursor(""); - altCursor = false; - } - } -} - -exports.MultiSelect = MultiSelect; - - -require("./config").defineOptions(Editor.prototype, "editor", { - enableMultiselect: { - set: function(val) { - MultiSelect(this); - if (val) { - this.on("changeSession", this.$multiselectOnSessionChange); - this.on("mousedown", onMouseDown); - } else { - this.off("changeSession", this.$multiselectOnSessionChange); - this.off("mousedown", onMouseDown); - } - }, - value: true - } -}) - - - -}); - -ace.define('ace/editor', ['require', 'exports', 'module' , 'ace/lib/fixoldbrowsers', 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/useragent', 'ace/keyboard/textinput', 'ace/mouse/mouse_handler', 'ace/mouse/fold_handler', 'ace/keyboard/keybinding', 'ace/edit_session', 'ace/search', 'ace/range', 'ace/lib/event_emitter', 'ace/commands/command_manager', 'ace/commands/default_commands', 'ace/config'], function(require, exports, module) { - - -require("./lib/fixoldbrowsers"); - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -var lang = require("./lib/lang"); -var useragent = require("./lib/useragent"); -var TextInput = require("./keyboard/textinput").TextInput; -var MouseHandler = require("./mouse/mouse_handler").MouseHandler; -var FoldHandler = require("./mouse/fold_handler").FoldHandler; -var KeyBinding = require("./keyboard/keybinding").KeyBinding; -var EditSession = require("./edit_session").EditSession; -var Search = require("./search").Search; -var Range = require("./range").Range; -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var CommandManager = require("./commands/command_manager").CommandManager; -var defaultCommands = require("./commands/default_commands").commands; -var config = require("./config"); -var Editor = function(renderer, session) { - var container = renderer.getContainerElement(); - this.container = container; - this.renderer = renderer; - - this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); - this.textInput = new TextInput(renderer.getTextAreaContainer(), this); - this.renderer.textarea = this.textInput.getElement(); - this.keyBinding = new KeyBinding(this); - this.$mouseHandler = new MouseHandler(this); - new FoldHandler(this); - - this.$blockScrolling = 0; - this.$search = new Search().set({ - wrap: true - }); - - this.$historyTracker = this.$historyTracker.bind(this); - this.commands.on("exec", this.$historyTracker); - - this.$initOperationListeners(); - - this._$emitInputEvent = lang.delayedCall(function() { - this._signal("input", {}); - this.session.bgTokenizer && this.session.bgTokenizer.scheduleStart(); - }.bind(this)); - - this.on("change", function(_, _self) { - _self._$emitInputEvent.schedule(31); - }); - - this.setSession(session || new EditSession("")); - config.resetOptions(this); - config._signal("editor", this); -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.$initOperationListeners = function() { - function last(a) {return a[a.length - 1]} - - this.selections = []; - this.commands.on("exec", function(e) { - this.startOperation(e); - - var command = e.command; - if (command.aceCommandGroup == "fileJump") { - var prev = this.prevOp; - if (!prev || prev.command.aceCommandGroup != "fileJump") { - this.lastFileJumpPos = last(this.selections); - } - } else { - this.lastFileJumpPos = null; - } - }.bind(this), true); - - this.commands.on("afterExec", function(e) { - var command = e.command; - - if (command.aceCommandGroup == "fileJump") { - if (this.lastFileJumpPos && !this.curOp.selectionChanged) { - this.selection.fromJSON(this.lastFileJumpPos); - } - } - this.endOperation(e); - }.bind(this), true); - - this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this)); - - this.on("change", function() { - this.curOp || this.startOperation(); - this.curOp.docChanged = true; - }.bind(this), true); - - this.on("changeSelection", function() { - this.curOp || this.startOperation(); - this.curOp.selectionChanged = true; - }.bind(this), true); - }; - - this.curOp = null; - this.prevOp = {}; - this.startOperation = function(commadEvent) { - if (this.curOp) { - if (!commadEvent || this.curOp.command) - return; - this.prevOp = this.curOp; - } - if (!commadEvent) { - this.previousCommand = null; - commadEvent = {}; - } - - this.$opResetTimer.schedule(); - this.curOp = { - command: commadEvent.command || {}, - args: commadEvent.args, - scrollTop: this.renderer.scrollTop - }; - - var command = this.curOp.command; - if (command && command.scrollIntoView) - this.$blockScrolling++; - - this.selections.push(this.selection.toJSON()); - }; - - this.endOperation = function() { - if (this.curOp) { - var command = this.curOp.command; - if (command && command.scrollIntoView) { - this.$blockScrolling--; - switch (command.scrollIntoView) { - case "center": - this.renderer.scrollCursorIntoView(null, 0.5); - break; - case "animate": - case "cursor": - this.renderer.scrollCursorIntoView(); - break; - case "selectionPart": - var range = this.selection.getRange(); - var config = this.renderer.layerConfig; - if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) { - this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead); - } - break; - default: - break; - } - if (command.scrollIntoView == "animate") - this.renderer.animateScrolling(this.curOp.scrollTop); - } - - this.prevOp = this.curOp; - this.curOp = null; - } - }; - - this.$historyTracker = function(e) { - if (!this.$mergeUndoDeltas) - return; - - - var prev = this.prevOp; - var mergeableCommands = ["backspace", "del", "insertstring"]; - var shouldMerge = prev.command && (e.command.name == prev.command.name); - if (e.command.name == "insertstring") { - var text = e.args; - if (this.mergeNextCommand === undefined) - this.mergeNextCommand = true; - - shouldMerge = shouldMerge - && this.mergeNextCommand // previous command allows to coalesce with - && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same type - - this.mergeNextCommand = true; - } else { - shouldMerge = shouldMerge - && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable - } - - if ( - this.$mergeUndoDeltas != "always" - && Date.now() - this.sequenceStartTime > 2000 - ) { - shouldMerge = false; // the sequence is too long - } - - if (shouldMerge) - this.session.mergeUndoDeltas = true; - else if (mergeableCommands.indexOf(e.command.name) !== -1) - this.sequenceStartTime = Date.now(); - }; - this.setKeyboardHandler = function(keyboardHandler) { - if (!keyboardHandler) { - this.keyBinding.setKeyboardHandler(null); - } else if (typeof keyboardHandler === "string") { - this.$keybindingId = keyboardHandler; - var _self = this; - config.loadModule(["keybinding", keyboardHandler], function(module) { - if (_self.$keybindingId == keyboardHandler) - _self.keyBinding.setKeyboardHandler(module && module.handler); - }); - } else { - this.$keybindingId = null; - this.keyBinding.setKeyboardHandler(keyboardHandler); - } - }; - this.getKeyboardHandler = function() { - return this.keyBinding.getKeyboardHandler(); - }; - this.setSession = function(session) { - if (this.session == session) - return; - - var oldSession = this.session; - if (oldSession) { - this.session.removeEventListener("change", this.$onDocumentChange); - this.session.removeEventListener("changeMode", this.$onChangeMode); - this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate); - this.session.removeEventListener("changeTabSize", this.$onChangeTabSize); - this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit); - this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode); - this.session.removeEventListener("onChangeFold", this.$onChangeFold); - this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker); - this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker); - this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint); - this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation); - this.session.removeEventListener("changeOverwrite", this.$onCursorChange); - this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange); - this.session.removeEventListener("changeScrollLeft", this.$onScrollLeftChange); - - var selection = this.session.getSelection(); - selection.removeEventListener("changeCursor", this.$onCursorChange); - selection.removeEventListener("changeSelection", this.$onSelectionChange); - } - - this.session = session; - if (session) { - this.$onDocumentChange = this.onDocumentChange.bind(this); - session.addEventListener("change", this.$onDocumentChange); - this.renderer.setSession(session); - - this.$onChangeMode = this.onChangeMode.bind(this); - session.addEventListener("changeMode", this.$onChangeMode); - - this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this); - session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate); - - this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer); - session.addEventListener("changeTabSize", this.$onChangeTabSize); - - this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this); - session.addEventListener("changeWrapLimit", this.$onChangeWrapLimit); - - this.$onChangeWrapMode = this.onChangeWrapMode.bind(this); - session.addEventListener("changeWrapMode", this.$onChangeWrapMode); - - this.$onChangeFold = this.onChangeFold.bind(this); - session.addEventListener("changeFold", this.$onChangeFold); - - this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this); - this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker); - - this.$onChangeBackMarker = this.onChangeBackMarker.bind(this); - this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker); - - this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this); - this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint); - - this.$onChangeAnnotation = this.onChangeAnnotation.bind(this); - this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation); - - this.$onCursorChange = this.onCursorChange.bind(this); - this.session.addEventListener("changeOverwrite", this.$onCursorChange); - - this.$onScrollTopChange = this.onScrollTopChange.bind(this); - this.session.addEventListener("changeScrollTop", this.$onScrollTopChange); - - this.$onScrollLeftChange = this.onScrollLeftChange.bind(this); - this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange); - - this.selection = session.getSelection(); - this.selection.addEventListener("changeCursor", this.$onCursorChange); - - this.$onSelectionChange = this.onSelectionChange.bind(this); - this.selection.addEventListener("changeSelection", this.$onSelectionChange); - - this.onChangeMode(); - - this.$blockScrolling += 1; - this.onCursorChange(); - this.$blockScrolling -= 1; - - this.onScrollTopChange(); - this.onScrollLeftChange(); - this.onSelectionChange(); - this.onChangeFrontMarker(); - this.onChangeBackMarker(); - this.onChangeBreakpoint(); - this.onChangeAnnotation(); - this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(); - this.renderer.updateFull(); - } - - this._signal("changeSession", { - session: session, - oldSession: oldSession - }); - - oldSession && oldSession._signal("changeEditor", {oldEditor: this}); - session && session._signal("changeEditor", {editor: this}); - }; - this.getSession = function() { - return this.session; - }; - this.setValue = function(val, cursorPos) { - this.session.doc.setValue(val); - - if (!cursorPos) - this.selectAll(); - else if (cursorPos == 1) - this.navigateFileEnd(); - else if (cursorPos == -1) - this.navigateFileStart(); - - return val; - }; - this.getValue = function() { - return this.session.getValue(); - }; - this.getSelection = function() { - return this.selection; - }; - this.resize = function(force) { - this.renderer.onResize(force); - }; - this.setTheme = function(theme, cb) { - this.renderer.setTheme(theme, cb); - }; - this.getTheme = function() { - return this.renderer.getTheme(); - }; - this.setStyle = function(style) { - this.renderer.setStyle(style); - }; - this.unsetStyle = function(style) { - this.renderer.unsetStyle(style); - }; - this.getFontSize = function () { - return this.getOption("fontSize") || - dom.computedStyle(this.container, "fontSize"); - }; - this.setFontSize = function(size) { - this.setOption("fontSize", size); - }; - - this.$highlightBrackets = function() { - if (this.session.$bracketHighlight) { - this.session.removeMarker(this.session.$bracketHighlight); - this.session.$bracketHighlight = null; - } - - if (this.$highlightPending) { - return; - } - var self = this; - this.$highlightPending = true; - setTimeout(function() { - self.$highlightPending = false; - - var pos = self.session.findMatchingBracket(self.getCursorPosition()); - if (pos) { - var range = new Range(pos.row, pos.column, pos.row, pos.column+1); - } else if (self.session.$mode.getMatching) { - var range = self.session.$mode.getMatching(self.session); - } - if (range) - self.session.$bracketHighlight = self.session.addMarker(range, "ace_bracket", "text"); - }, 50); - }; - this.focus = function() { - var _self = this; - setTimeout(function() { - _self.textInput.focus(); - }); - this.textInput.focus(); - }; - this.isFocused = function() { - return this.textInput.isFocused(); - }; - this.blur = function() { - this.textInput.blur(); - }; - this.onFocus = function() { - if (this.$isFocused) - return; - this.$isFocused = true; - this.renderer.showCursor(); - this.renderer.visualizeFocus(); - this._emit("focus"); - }; - this.onBlur = function() { - if (!this.$isFocused) - return; - this.$isFocused = false; - this.renderer.hideCursor(); - this.renderer.visualizeBlur(); - this._emit("blur"); - }; - - this.$cursorChange = function() { - this.renderer.updateCursor(); - }; - this.onDocumentChange = function(e) { - var delta = e.data; - var range = delta.range; - var lastRow; - - if (range.start.row == range.end.row && delta.action != "insertLines" && delta.action != "removeLines") - lastRow = range.end.row; - else - lastRow = Infinity; - this.renderer.updateLines(range.start.row, lastRow); - - this._signal("change", e); - this.$cursorChange(); - }; - - this.onTokenizerUpdate = function(e) { - var rows = e.data; - this.renderer.updateLines(rows.first, rows.last); - }; - - - this.onScrollTopChange = function() { - this.renderer.scrollToY(this.session.getScrollTop()); - }; - - this.onScrollLeftChange = function() { - this.renderer.scrollToX(this.session.getScrollLeft()); - }; - this.onCursorChange = function() { - this.$cursorChange(); - - if (!this.$blockScrolling) { - this.renderer.scrollCursorIntoView(); - } - - this.$highlightBrackets(); - this.$updateHighlightActiveLine(); - this._signal("changeSelection"); - }; - - this.$updateHighlightActiveLine = function() { - var session = this.getSession(); - - var highlight; - if (this.$highlightActiveLine) { - if ((this.$selectionStyle != "line" || !this.selection.isMultiLine())) - highlight = this.getCursorPosition(); - if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1)) - highlight = false; - } - - if (session.$highlightLineMarker && !highlight) { - session.removeMarker(session.$highlightLineMarker.id); - session.$highlightLineMarker = null; - } else if (!session.$highlightLineMarker && highlight) { - var range = new Range(highlight.row, highlight.column, highlight.row, Infinity); - range.id = session.addMarker(range, "ace_active-line", "screenLine"); - session.$highlightLineMarker = range; - } else if (highlight) { - session.$highlightLineMarker.start.row = highlight.row; - session.$highlightLineMarker.end.row = highlight.row; - session.$highlightLineMarker.start.column = highlight.column; - session._signal("changeBackMarker"); - } - }; - - this.onSelectionChange = function(e) { - var session = this.session; - - if (session.$selectionMarker) { - session.removeMarker(session.$selectionMarker); - } - session.$selectionMarker = null; - - if (!this.selection.isEmpty()) { - var range = this.selection.getRange(); - var style = this.getSelectionStyle(); - session.$selectionMarker = session.addMarker(range, "ace_selection", style); - } else { - this.$updateHighlightActiveLine(); - } - - var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp(); - this.session.highlight(re); - - this._signal("changeSelection"); - }; - - this.$getSelectionHighLightRegexp = function() { - var session = this.session; - - var selection = this.getSelectionRange(); - if (selection.isEmpty() || selection.isMultiLine()) - return; - - var startOuter = selection.start.column - 1; - var endOuter = selection.end.column + 1; - var line = session.getLine(selection.start.row); - var lineCols = line.length; - var needle = line.substring(Math.max(startOuter, 0), - Math.min(endOuter, lineCols)); - if ((startOuter >= 0 && /^[\w\d]/.test(needle)) || - (endOuter <= lineCols && /[\w\d]$/.test(needle))) - return; - - needle = line.substring(selection.start.column, selection.end.column); - if (!/^[\w\d]+$/.test(needle)) - return; - - var re = this.$search.$assembleRegExp({ - wholeWord: true, - caseSensitive: true, - needle: needle - }); - - return re; - }; - - - this.onChangeFrontMarker = function() { - this.renderer.updateFrontMarkers(); - }; - - this.onChangeBackMarker = function() { - this.renderer.updateBackMarkers(); - }; - - - this.onChangeBreakpoint = function() { - this.renderer.updateBreakpoints(); - }; - - this.onChangeAnnotation = function() { - this.renderer.setAnnotations(this.session.getAnnotations()); - }; - - - this.onChangeMode = function(e) { - this.renderer.updateText(); - this._emit("changeMode", e); - }; - - - this.onChangeWrapLimit = function() { - this.renderer.updateFull(); - }; - - this.onChangeWrapMode = function() { - this.renderer.onResize(true); - }; - - - this.onChangeFold = function() { - this.$updateHighlightActiveLine(); - this.renderer.updateFull(); - }; - this.getSelectedText = function() { - return this.session.getTextRange(this.getSelectionRange()); - }; - this.getCopyText = function() { - var text = this.getSelectedText(); - this._signal("copy", text); - return text; - }; - this.onCopy = function() { - this.commands.exec("copy", this); - }; - this.onCut = function() { - this.commands.exec("cut", this); - }; - this.onPaste = function(text) { - if (this.$readOnly) - return; - var e = {text: text}; - this._signal("paste", e); - this.insert(e.text, true); - }; - - - this.execCommand = function(command, args) { - this.commands.exec(command, this, args); - }; - this.insert = function(text, pasted) { - var session = this.session; - var mode = session.getMode(); - var cursor = this.getCursorPosition(); - - if (this.getBehavioursEnabled() && !pasted) { - var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text); - if (transform) { - if (text !== transform.text) { - this.session.mergeUndoDeltas = false; - this.$mergeNextCommand = false; - } - text = transform.text; - - } - } - - if (text == "\t") - text = this.session.getTabString(); - if (!this.selection.isEmpty()) { - var range = this.getSelectionRange(); - cursor = this.session.remove(range); - this.clearSelection(); - } - else if (this.session.getOverwrite()) { - var range = new Range.fromPoints(cursor, cursor); - range.end.column += text.length; - this.session.remove(range); - } - - if (text == "\n" || text == "\r\n") { - var line = session.getLine(cursor.row); - if (cursor.column > line.search(/\S|$/)) { - var d = line.substr(cursor.column).search(/\S|$/); - session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d); - } - } - this.clearSelection(); - - var start = cursor.column; - var lineState = session.getState(cursor.row); - var line = session.getLine(cursor.row); - var shouldOutdent = mode.checkOutdent(lineState, line, text); - var end = session.insert(cursor, text); - - if (transform && transform.selection) { - if (transform.selection.length == 2) { // Transform relative to the current column - this.selection.setSelectionRange( - new Range(cursor.row, start + transform.selection[0], - cursor.row, start + transform.selection[1])); - } else { // Transform relative to the current row. - this.selection.setSelectionRange( - new Range(cursor.row + transform.selection[0], - transform.selection[1], - cursor.row + transform.selection[2], - transform.selection[3])); - } - } - - if (session.getDocument().isNewLine(text)) { - var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); - - session.insert({row: cursor.row+1, column: 0}, lineIndent); - } - if (shouldOutdent) - mode.autoOutdent(lineState, session, cursor.row); - }; - - this.onTextInput = function(text) { - this.keyBinding.onTextInput(text); - }; - - this.onCommandKey = function(e, hashId, keyCode) { - this.keyBinding.onCommandKey(e, hashId, keyCode); - }; - this.setOverwrite = function(overwrite) { - this.session.setOverwrite(overwrite); - }; - this.getOverwrite = function() { - return this.session.getOverwrite(); - }; - this.toggleOverwrite = function() { - this.session.toggleOverwrite(); - }; - this.setScrollSpeed = function(speed) { - this.setOption("scrollSpeed", speed); - }; - this.getScrollSpeed = function() { - return this.getOption("scrollSpeed"); - }; - this.setDragDelay = function(dragDelay) { - this.setOption("dragDelay", dragDelay); - }; - this.getDragDelay = function() { - return this.getOption("dragDelay"); - }; - this.setSelectionStyle = function(val) { - this.setOption("selectionStyle", val); - }; - this.getSelectionStyle = function() { - return this.getOption("selectionStyle"); - }; - this.setHighlightActiveLine = function(shouldHighlight) { - this.setOption("highlightActiveLine", shouldHighlight); - }; - this.getHighlightActiveLine = function() { - return this.getOption("highlightActiveLine"); - }; - this.setHighlightGutterLine = function(shouldHighlight) { - this.setOption("highlightGutterLine", shouldHighlight); - }; - - this.getHighlightGutterLine = function() { - return this.getOption("highlightGutterLine"); - }; - this.setHighlightSelectedWord = function(shouldHighlight) { - this.setOption("highlightSelectedWord", shouldHighlight); - }; - this.getHighlightSelectedWord = function() { - return this.$highlightSelectedWord; - }; - - this.setAnimatedScroll = function(shouldAnimate){ - this.renderer.setAnimatedScroll(shouldAnimate); - }; - - this.getAnimatedScroll = function(){ - return this.renderer.getAnimatedScroll(); - }; - this.setShowInvisibles = function(showInvisibles) { - this.renderer.setShowInvisibles(showInvisibles); - }; - this.getShowInvisibles = function() { - return this.renderer.getShowInvisibles(); - }; - - this.setDisplayIndentGuides = function(display) { - this.renderer.setDisplayIndentGuides(display); - }; - - this.getDisplayIndentGuides = function() { - return this.renderer.getDisplayIndentGuides(); - }; - this.setShowPrintMargin = function(showPrintMargin) { - this.renderer.setShowPrintMargin(showPrintMargin); - }; - this.getShowPrintMargin = function() { - return this.renderer.getShowPrintMargin(); - }; - this.setPrintMarginColumn = function(showPrintMargin) { - this.renderer.setPrintMarginColumn(showPrintMargin); - }; - this.getPrintMarginColumn = function() { - return this.renderer.getPrintMarginColumn(); - }; - this.setReadOnly = function(readOnly) { - this.setOption("readOnly", readOnly); - }; - this.getReadOnly = function() { - return this.getOption("readOnly"); - }; - this.setBehavioursEnabled = function (enabled) { - this.setOption("behavioursEnabled", enabled); - }; - this.getBehavioursEnabled = function () { - return this.getOption("behavioursEnabled"); - }; - this.setWrapBehavioursEnabled = function (enabled) { - this.setOption("wrapBehavioursEnabled", enabled); - }; - this.getWrapBehavioursEnabled = function () { - return this.getOption("wrapBehavioursEnabled"); - }; - this.setShowFoldWidgets = function(show) { - this.setOption("showFoldWidgets", show); - - }; - this.getShowFoldWidgets = function() { - return this.getOption("showFoldWidgets"); - }; - - this.setFadeFoldWidgets = function(fade) { - this.setOption("fadeFoldWidgets", fade); - }; - - this.getFadeFoldWidgets = function() { - return this.getOption("fadeFoldWidgets"); - }; - this.remove = function(dir) { - if (this.selection.isEmpty()){ - if (dir == "left") - this.selection.selectLeft(); - else - this.selection.selectRight(); - } - - var range = this.getSelectionRange(); - if (this.getBehavioursEnabled()) { - var session = this.session; - var state = session.getState(range.start.row); - var new_range = session.getMode().transformAction(state, 'deletion', this, session, range); - - if (range.end.column === 0) { - var text = session.getTextRange(range); - if (text[text.length - 1] == "\n") { - var line = session.getLine(range.end.row); - if (/^\s+$/.test(line)) { - range.end.column = line.length; - } - } - } - if (new_range) - range = new_range; - } - - this.session.remove(range); - this.clearSelection(); - }; - this.removeWordRight = function() { - if (this.selection.isEmpty()) - this.selection.selectWordRight(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - this.removeWordLeft = function() { - if (this.selection.isEmpty()) - this.selection.selectWordLeft(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - this.removeToLineStart = function() { - if (this.selection.isEmpty()) - this.selection.selectLineStart(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - this.removeToLineEnd = function() { - if (this.selection.isEmpty()) - this.selection.selectLineEnd(); - - var range = this.getSelectionRange(); - if (range.start.column == range.end.column && range.start.row == range.end.row) { - range.end.column = 0; - range.end.row++; - } - - this.session.remove(range); - this.clearSelection(); - }; - this.splitLine = function() { - if (!this.selection.isEmpty()) { - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - } - - var cursor = this.getCursorPosition(); - this.insert("\n"); - this.moveCursorToPosition(cursor); - }; - this.transposeLetters = function() { - if (!this.selection.isEmpty()) { - return; - } - - var cursor = this.getCursorPosition(); - var column = cursor.column; - if (column === 0) - return; - - var line = this.session.getLine(cursor.row); - var swap, range; - if (column < line.length) { - swap = line.charAt(column) + line.charAt(column-1); - range = new Range(cursor.row, column-1, cursor.row, column+1); - } - else { - swap = line.charAt(column-1) + line.charAt(column-2); - range = new Range(cursor.row, column-2, cursor.row, column); - } - this.session.replace(range, swap); - }; - this.toLowerCase = function() { - var originalRange = this.getSelectionRange(); - if (this.selection.isEmpty()) { - this.selection.selectWord(); - } - - var range = this.getSelectionRange(); - var text = this.session.getTextRange(range); - this.session.replace(range, text.toLowerCase()); - this.selection.setSelectionRange(originalRange); - }; - this.toUpperCase = function() { - var originalRange = this.getSelectionRange(); - if (this.selection.isEmpty()) { - this.selection.selectWord(); - } - - var range = this.getSelectionRange(); - var text = this.session.getTextRange(range); - this.session.replace(range, text.toUpperCase()); - this.selection.setSelectionRange(originalRange); - }; - this.indent = function() { - var session = this.session; - var range = this.getSelectionRange(); - - if (range.start.row < range.end.row) { - var rows = this.$getSelectedRows(); - session.indentRows(rows.first, rows.last, "\t"); - return; - } else if (range.start.column < range.end.column) { - var text = session.getTextRange(range); - if (!/^\s+$/.test(text)) { - var rows = this.$getSelectedRows(); - session.indentRows(rows.first, rows.last, "\t"); - return; - } - } - - var line = session.getLine(range.start.row); - var position = range.start; - var size = session.getTabSize(); - var column = session.documentToScreenColumn(position.row, position.column); - - if (this.session.getUseSoftTabs()) { - var count = (size - column % size); - var indentString = lang.stringRepeat(" ", count); - } else { - var count = column % size; - while (line[range.start.column] == " " && count) { - range.start.column--; - count--; - } - this.selection.setSelectionRange(range); - indentString = "\t"; - } - return this.insert(indentString); - }; - this.blockIndent = function() { - var rows = this.$getSelectedRows(); - this.session.indentRows(rows.first, rows.last, "\t"); - }; - this.blockOutdent = function() { - var selection = this.session.getSelection(); - this.session.outdentRows(selection.getRange()); - }; - this.sortLines = function() { - var rows = this.$getSelectedRows(); - var session = this.session; - - var lines = []; - for (i = rows.first; i <= rows.last; i++) - lines.push(session.getLine(i)); - - lines.sort(function(a, b) { - if (a.toLowerCase() < b.toLowerCase()) return -1; - if (a.toLowerCase() > b.toLowerCase()) return 1; - return 0; - }); - - var deleteRange = new Range(0, 0, 0, 0); - for (var i = rows.first; i <= rows.last; i++) { - var line = session.getLine(i); - deleteRange.start.row = i; - deleteRange.end.row = i; - deleteRange.end.column = line.length; - session.replace(deleteRange, lines[i-rows.first]); - } - }; - this.toggleCommentLines = function() { - var state = this.session.getState(this.getCursorPosition().row); - var rows = this.$getSelectedRows(); - this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last); - }; - - this.toggleBlockComment = function() { - var cursor = this.getCursorPosition(); - var state = this.session.getState(cursor.row); - var range = this.getSelectionRange(); - this.session.getMode().toggleBlockComment(state, this.session, range, cursor); - }; - this.getNumberAt = function(row, column) { - var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g; - _numberRx.lastIndex = 0; - - var s = this.session.getLine(row); - while (_numberRx.lastIndex < column) { - var m = _numberRx.exec(s); - if(m.index <= column && m.index+m[0].length >= column){ - var number = { - value: m[0], - start: m.index, - end: m.index+m[0].length - }; - return number; - } - } - return null; - }; - this.modifyNumber = function(amount) { - var row = this.selection.getCursor().row; - var column = this.selection.getCursor().column; - var charRange = new Range(row, column-1, row, column); - - var c = this.session.getTextRange(charRange); - if (!isNaN(parseFloat(c)) && isFinite(c)) { - var nr = this.getNumberAt(row, column); - if (nr) { - var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end; - var decimals = nr.start + nr.value.length - fp; - - var t = parseFloat(nr.value); - t *= Math.pow(10, decimals); - - - if(fp !== nr.end && column < fp){ - amount *= Math.pow(10, nr.end - column - 1); - } else { - amount *= Math.pow(10, nr.end - column); - } - - t += amount; - t /= Math.pow(10, decimals); - var nnr = t.toFixed(decimals); - var replaceRange = new Range(row, nr.start, row, nr.end); - this.session.replace(replaceRange, nnr); - this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length)); - - } - } - }; - this.removeLines = function() { - var rows = this.$getSelectedRows(); - var range; - if (rows.first === 0 || rows.last+1 < this.session.getLength()) - range = new Range(rows.first, 0, rows.last+1, 0); - else - range = new Range( - rows.first-1, this.session.getLine(rows.first-1).length, - rows.last, this.session.getLine(rows.last).length - ); - this.session.remove(range); - this.clearSelection(); - }; - - this.duplicateSelection = function() { - var sel = this.selection; - var doc = this.session; - var range = sel.getRange(); - var reverse = sel.isBackwards(); - if (range.isEmpty()) { - var row = range.start.row; - doc.duplicateLines(row, row); - } else { - var point = reverse ? range.start : range.end; - var endPoint = doc.insert(point, doc.getTextRange(range), false); - range.start = point; - range.end = endPoint; - - sel.setSelectionRange(range, reverse); - } - }; - this.moveLinesDown = function() { - this.$moveLines(function(firstRow, lastRow) { - return this.session.moveLinesDown(firstRow, lastRow); - }); - }; - this.moveLinesUp = function() { - this.$moveLines(function(firstRow, lastRow) { - return this.session.moveLinesUp(firstRow, lastRow); - }); - }; - this.moveText = function(range, toPosition, copy) { - return this.session.moveText(range, toPosition, copy); - }; - this.copyLinesUp = function() { - this.$moveLines(function(firstRow, lastRow) { - this.session.duplicateLines(firstRow, lastRow); - return 0; - }); - }; - this.copyLinesDown = function() { - this.$moveLines(function(firstRow, lastRow) { - return this.session.duplicateLines(firstRow, lastRow); - }); - }; - this.$moveLines = function(mover) { - var selection = this.selection; - if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) { - var range = selection.toOrientedRange(); - var rows = this.$getSelectedRows(range); - var linesMoved = mover.call(this, rows.first, rows.last); - range.moveBy(linesMoved, 0); - selection.fromOrientedRange(range); - } else { - var ranges = selection.rangeList.ranges; - selection.rangeList.detach(this.session); - - for (var i = ranges.length; i--; ) { - var rangeIndex = i; - var rows = ranges[i].collapseRows(); - var last = rows.end.row; - var first = rows.start.row; - while (i--) { - rows = ranges[i].collapseRows(); - if (first - rows.end.row <= 1) - first = rows.end.row; - else - break; - } - i++; - - var linesMoved = mover.call(this, first, last); - while (rangeIndex >= i) { - ranges[rangeIndex].moveBy(linesMoved, 0); - rangeIndex--; - } - } - selection.fromOrientedRange(selection.ranges[0]); - selection.rangeList.attach(this.session); - } - }; - this.$getSelectedRows = function() { - var range = this.getSelectionRange().collapseRows(); - - return { - first: this.session.getRowFoldStart(range.start.row), - last: this.session.getRowFoldEnd(range.end.row) - }; - }; - - this.onCompositionStart = function(text) { - this.renderer.showComposition(this.getCursorPosition()); - }; - - this.onCompositionUpdate = function(text) { - this.renderer.setCompositionText(text); - }; - - this.onCompositionEnd = function() { - this.renderer.hideComposition(); - }; - this.getFirstVisibleRow = function() { - return this.renderer.getFirstVisibleRow(); - }; - this.getLastVisibleRow = function() { - return this.renderer.getLastVisibleRow(); - }; - this.isRowVisible = function(row) { - return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow()); - }; - this.isRowFullyVisible = function(row) { - return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow()); - }; - this.$getVisibleRowCount = function() { - return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; - }; - - this.$moveByPage = function(dir, select) { - var renderer = this.renderer; - var config = this.renderer.layerConfig; - var rows = dir * Math.floor(config.height / config.lineHeight); - - this.$blockScrolling++; - if (select === true) { - this.selection.$moveSelection(function(){ - this.moveCursorBy(rows, 0); - }); - } else if (select === false) { - this.selection.moveCursorBy(rows, 0); - this.selection.clearSelection(); - } - this.$blockScrolling--; - - var scrollTop = renderer.scrollTop; - - renderer.scrollBy(0, rows * config.lineHeight); - if (select != null) - renderer.scrollCursorIntoView(null, 0.5); - - renderer.animateScrolling(scrollTop); - }; - this.selectPageDown = function() { - this.$moveByPage(1, true); - }; - this.selectPageUp = function() { - this.$moveByPage(-1, true); - }; - this.gotoPageDown = function() { - this.$moveByPage(1, false); - }; - this.gotoPageUp = function() { - this.$moveByPage(-1, false); - }; - this.scrollPageDown = function() { - this.$moveByPage(1); - }; - this.scrollPageUp = function() { - this.$moveByPage(-1); - }; - this.scrollToRow = function(row) { - this.renderer.scrollToRow(row); - }; - this.scrollToLine = function(line, center, animate, callback) { - this.renderer.scrollToLine(line, center, animate, callback); - }; - this.centerSelection = function() { - var range = this.getSelectionRange(); - var pos = { - row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2), - column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2) - }; - this.renderer.alignCursor(pos, 0.5); - }; - this.getCursorPosition = function() { - return this.selection.getCursor(); - }; - this.getCursorPositionScreen = function() { - return this.session.documentToScreenPosition(this.getCursorPosition()); - }; - this.getSelectionRange = function() { - return this.selection.getRange(); - }; - this.selectAll = function() { - this.$blockScrolling += 1; - this.selection.selectAll(); - this.$blockScrolling -= 1; - }; - this.clearSelection = function() { - this.selection.clearSelection(); - }; - this.moveCursorTo = function(row, column) { - this.selection.moveCursorTo(row, column); - }; - this.moveCursorToPosition = function(pos) { - this.selection.moveCursorToPosition(pos); - }; - this.jumpToMatching = function(select) { - var cursor = this.getCursorPosition(); - - var range = this.session.getBracketRange(cursor); - if (!range) { - range = this.find({ - needle: /[{}()\[\]]/g, - preventScroll:true, - start: {row: cursor.row, column: cursor.column - 1} - }); - if (!range) - return; - var pos = range.start; - if (pos.row == cursor.row && Math.abs(pos.column - cursor.column) < 2) - range = this.session.getBracketRange(pos); - } - - pos = range && range.cursor || pos; - if (pos) { - if (select) { - if (range && range.isEqual(this.getSelectionRange())) - this.clearSelection(); - else - this.selection.selectTo(pos.row, pos.column); - } else { - this.selection.moveTo(pos.row, pos.column); - } - } - }; - this.gotoLine = function(lineNumber, column, animate) { - this.selection.clearSelection(); - this.session.unfold({row: lineNumber - 1, column: column || 0}); - - this.$blockScrolling += 1; - this.exitMultiSelectMode && this.exitMultiSelectMode(); - this.moveCursorTo(lineNumber - 1, column || 0); - this.$blockScrolling -= 1; - - if (!this.isRowFullyVisible(lineNumber - 1)) - this.scrollToLine(lineNumber - 1, true, animate); - }; - this.navigateTo = function(row, column) { - this.selection.moveTo(row, column); - }; - this.navigateUp = function(times) { - if (this.selection.isMultiLine() && !this.selection.isBackwards()) { - var selectionStart = this.selection.anchor.getPosition(); - return this.moveCursorToPosition(selectionStart); - } - this.selection.clearSelection(); - this.selection.moveCursorBy(-times || -1, 0); - }; - this.navigateDown = function(times) { - if (this.selection.isMultiLine() && this.selection.isBackwards()) { - var selectionEnd = this.selection.anchor.getPosition(); - return this.moveCursorToPosition(selectionEnd); - } - this.selection.clearSelection(); - this.selection.moveCursorBy(times || 1, 0); - }; - this.navigateLeft = function(times) { - if (!this.selection.isEmpty()) { - var selectionStart = this.getSelectionRange().start; - this.moveCursorToPosition(selectionStart); - } - else { - times = times || 1; - while (times--) { - this.selection.moveCursorLeft(); - } - } - this.clearSelection(); - }; - this.navigateRight = function(times) { - if (!this.selection.isEmpty()) { - var selectionEnd = this.getSelectionRange().end; - this.moveCursorToPosition(selectionEnd); - } - else { - times = times || 1; - while (times--) { - this.selection.moveCursorRight(); - } - } - this.clearSelection(); - }; - this.navigateLineStart = function() { - this.selection.moveCursorLineStart(); - this.clearSelection(); - }; - this.navigateLineEnd = function() { - this.selection.moveCursorLineEnd(); - this.clearSelection(); - }; - this.navigateFileEnd = function() { - this.selection.moveCursorFileEnd(); - this.clearSelection(); - }; - this.navigateFileStart = function() { - this.selection.moveCursorFileStart(); - this.clearSelection(); - }; - this.navigateWordRight = function() { - this.selection.moveCursorWordRight(); - this.clearSelection(); - }; - this.navigateWordLeft = function() { - this.selection.moveCursorWordLeft(); - this.clearSelection(); - }; - this.replace = function(replacement, options) { - if (options) - this.$search.set(options); - - var range = this.$search.find(this.session); - var replaced = 0; - if (!range) - return replaced; - - if (this.$tryReplace(range, replacement)) { - replaced = 1; - } - if (range !== null) { - this.selection.setSelectionRange(range); - this.renderer.scrollSelectionIntoView(range.start, range.end); - } - - return replaced; - }; - this.replaceAll = function(replacement, options) { - if (options) { - this.$search.set(options); - } - - var ranges = this.$search.findAll(this.session); - var replaced = 0; - if (!ranges.length) - return replaced; - - this.$blockScrolling += 1; - - var selection = this.getSelectionRange(); - this.selection.moveTo(0, 0); - - for (var i = ranges.length - 1; i >= 0; --i) { - if(this.$tryReplace(ranges[i], replacement)) { - replaced++; - } - } - - this.selection.setSelectionRange(selection); - this.$blockScrolling -= 1; - - return replaced; - }; - - this.$tryReplace = function(range, replacement) { - var input = this.session.getTextRange(range); - replacement = this.$search.replace(input, replacement); - if (replacement !== null) { - range.end = this.session.replace(range, replacement); - return range; - } else { - return null; - } - }; - this.getLastSearchOptions = function() { - return this.$search.getOptions(); - }; - this.find = function(needle, options, animate) { - if (!options) - options = {}; - - if (typeof needle == "string" || needle instanceof RegExp) - options.needle = needle; - else if (typeof needle == "object") - oop.mixin(options, needle); - - var range = this.selection.getRange(); - if (options.needle == null) { - needle = this.session.getTextRange(range) - || this.$search.$options.needle; - if (!needle) { - range = this.session.getWordRange(range.start.row, range.start.column); - needle = this.session.getTextRange(range); - } - this.$search.set({needle: needle}); - } - - this.$search.set(options); - if (!options.start) - this.$search.set({start: range}); - - var newRange = this.$search.find(this.session); - if (options.preventScroll) - return newRange; - if (newRange) { - this.revealRange(newRange, animate); - return newRange; - } - if (options.backwards) - range.start = range.end; - else - range.end = range.start; - this.selection.setRange(range); - }; - this.findNext = function(options, animate) { - this.find({skipCurrent: true, backwards: false}, options, animate); - }; - this.findPrevious = function(options, animate) { - this.find(options, {skipCurrent: true, backwards: true}, animate); - }; - - this.revealRange = function(range, animate) { - this.$blockScrolling += 1; - this.session.unfold(range); - this.selection.setSelectionRange(range); - this.$blockScrolling -= 1; - - var scrollTop = this.renderer.scrollTop; - this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); - if (animate !== false) - this.renderer.animateScrolling(scrollTop); - }; - this.undo = function() { - this.$blockScrolling++; - this.session.getUndoManager().undo(); - this.$blockScrolling--; - this.renderer.scrollCursorIntoView(null, 0.5); - }; - this.redo = function() { - this.$blockScrolling++; - this.session.getUndoManager().redo(); - this.$blockScrolling--; - this.renderer.scrollCursorIntoView(null, 0.5); - }; - this.destroy = function() { - this.renderer.destroy(); - this._signal("destroy", this); - }; - this.setAutoScrollEditorIntoView = function(enable) { - if (!enable) - return; - var rect; - var self = this; - var shouldScroll = false; - if (!this.$scrollAnchor) - this.$scrollAnchor = document.createElement("div"); - var scrollAnchor = this.$scrollAnchor; - scrollAnchor.style.cssText = "position:absolute"; - this.container.insertBefore(scrollAnchor, this.container.firstChild); - var onChangeSelection = this.on("changeSelection", function() { - shouldScroll = true; - }); - var onBeforeRender = this.renderer.on("beforeRender", function() { - if (shouldScroll) - rect = self.renderer.container.getBoundingClientRect(); - }); - var onAfterRender = this.renderer.on("afterRender", function() { - if (shouldScroll && rect && self.isFocused()) { - var renderer = self.renderer; - var pos = renderer.$cursorLayer.$pixelPos; - var config = renderer.layerConfig; - var top = pos.top - config.offset; - if (pos.top >= 0 && top + rect.top < 0) { - shouldScroll = true; - } else if (pos.top < config.height && - pos.top + rect.top + config.lineHeight > window.innerHeight) { - shouldScroll = false; - } else { - shouldScroll = null; - } - if (shouldScroll != null) { - scrollAnchor.style.top = top + "px"; - scrollAnchor.style.left = pos.left + "px"; - scrollAnchor.style.height = config.lineHeight + "px"; - scrollAnchor.scrollIntoView(shouldScroll); - } - shouldScroll = rect = null; - } - }); - this.setAutoScrollEditorIntoView = function(enable) { - if (enable) - return; - delete this.setAutoScrollEditorIntoView; - this.removeEventListener("changeSelection", onChangeSelection); - this.renderer.removeEventListener("afterRender", onAfterRender); - this.renderer.removeEventListener("beforeRender", onBeforeRender); - }; - }; - - - this.$resetCursorStyle = function() { - var style = this.$cursorStyle || "ace"; - var cursorLayer = this.renderer.$cursorLayer; - if (!cursorLayer) - return; - cursorLayer.setSmoothBlinking(style == "smooth"); - cursorLayer.isBlinking = !this.$readOnly && style != "wide"; - }; - -}).call(Editor.prototype); - - - -config.defineOptions(Editor.prototype, "editor", { - selectionStyle: { - set: function(style) { - this.onSelectionChange(); - this._signal("changeSelectionStyle", {data: style}); - }, - initialValue: "line" - }, - highlightActiveLine: { - set: function() {this.$updateHighlightActiveLine();}, - initialValue: true - }, - highlightSelectedWord: { - set: function(shouldHighlight) {this.$onSelectionChange();}, - initialValue: true - }, - readOnly: { - set: function(readOnly) { - this.textInput.setReadOnly(readOnly); - this.$resetCursorStyle(); - }, - initialValue: false - }, - cursorStyle: { - set: function(val) { this.$resetCursorStyle(); }, - values: ["ace", "slim", "smooth", "wide"], - initialValue: "ace" - }, - mergeUndoDeltas: { - values: [false, true, "always"], - initialValue: true - }, - behavioursEnabled: {initialValue: true}, - wrapBehavioursEnabled: {initialValue: true}, - autoScrollEditorIntoView: { - set: function(val) {this.setAutoScrollEditorIntoView(val)} - }, - - hScrollBarAlwaysVisible: "renderer", - vScrollBarAlwaysVisible: "renderer", - highlightGutterLine: "renderer", - animatedScroll: "renderer", - showInvisibles: "renderer", - showPrintMargin: "renderer", - printMarginColumn: "renderer", - printMargin: "renderer", - fadeFoldWidgets: "renderer", - showFoldWidgets: "renderer", - showLineNumbers: "renderer", - showGutter: "renderer", - displayIndentGuides: "renderer", - fontSize: "renderer", - fontFamily: "renderer", - maxLines: "renderer", - minLines: "renderer", - scrollPastEnd: "renderer", - fixedWidthGutter: "renderer", - theme: "renderer", - - scrollSpeed: "$mouseHandler", - dragDelay: "$mouseHandler", - dragEnabled: "$mouseHandler", - focusTimout: "$mouseHandler", - tooltipFollowsMouse: "$mouseHandler", - - firstLineNumber: "session", - overwrite: "session", - newLineMode: "session", - useWorker: "session", - useSoftTabs: "session", - tabSize: "session", - wrap: "session", - foldStyle: "session", - mode: "session" -}); - -exports.Editor = Editor; -}); - -ace.define('ace/mouse/multi_select_handler', ['require', 'exports', 'module' , 'ace/lib/event'], function(require, exports, module) { - -var event = require("../lib/event"); -function isSamePoint(p1, p2) { - return p1.row == p2.row && p1.column == p2.column; -} - -function onMouseDown(e) { - var ev = e.domEvent; - var alt = ev.altKey; - var shift = ev.shiftKey; - var ctrl = e.getAccelKey(); - var button = e.getButton(); - - if (e.editor.inMultiSelectMode && button == 2) { - e.editor.textInput.onContextMenu(e.domEvent); - return; - } - - if (!ctrl && !alt) { - if (button === 0 && e.editor.inMultiSelectMode) - e.editor.exitMultiSelectMode(); - return; - } - - var editor = e.editor; - var selection = editor.selection; - var isMultiSelect = editor.inMultiSelectMode; - var pos = e.getDocumentPosition(); - var cursor = selection.getCursor(); - var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor)); - - - var mouseX = e.x, mouseY = e.y; - var onMouseSelection = function(e) { - mouseX = e.clientX; - mouseY = e.clientY; - }; - - var blockSelect = function() { - var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); - var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column); - - if (isSamePoint(screenCursor, newCursor) - && isSamePoint(cursor, selection.selectionLead)) - return; - screenCursor = newCursor; - - editor.selection.moveToPosition(cursor); - editor.renderer.scrollCursorIntoView(); - - editor.removeSelectionMarkers(rectSel); - rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor); - rectSel.forEach(editor.addSelectionMarker, editor); - editor.updateSelectionMarkers(); - }; - - var session = editor.session; - var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); - var screenCursor = screenAnchor; - - - - if (ctrl && !alt && !shift && button === 0) { - if (!isMultiSelect && inSelection) - return; // dragging - - if (!isMultiSelect) { - var range = selection.toOrientedRange(); - editor.addSelectionMarker(range); - } - - var oldRange = selection.rangeList.rangeAtPoint(pos); - - editor.$blockScrolling++; - editor.once("mouseup", function() { - var tmpSel = selection.toOrientedRange(); - - if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor)) - selection.substractPoint(tmpSel.cursor); - else { - if (range) { - editor.removeSelectionMarker(range); - selection.addRange(range); - } - selection.addRange(tmpSel); - } - editor.$blockScrolling--; - }); - - } else if (alt && button === 0) { - e.stop(); - - if (isMultiSelect && !ctrl) - selection.toSingleRange(); - else if (!isMultiSelect && ctrl) - selection.addRange(); - - var rectSel = []; - if (shift) { - screenAnchor = session.documentToScreenPosition(selection.lead); - blockSelect(); - } else { - selection.moveToPosition(pos); - } - - - var onMouseSelectionEnd = function(e) { - clearInterval(timerId); - editor.removeSelectionMarkers(rectSel); - for (var i = 0; i < rectSel.length; i++) - selection.addRange(rectSel[i]); - }; - - var onSelectionInterval = blockSelect; - - event.capture(editor.container, onMouseSelection, onMouseSelectionEnd); - var timerId = setInterval(function() {onSelectionInterval();}, 20); - - return e.preventDefault(); - } -} - - -exports.onMouseDown = onMouseDown; - -}); - -ace.define('ace/lib/useragent', ['require', 'exports', 'module' ], function(require, exports, module) { -exports.OS = { - LINUX: "LINUX", - MAC: "MAC", - WINDOWS: "WINDOWS" -}; -exports.getOS = function() { - if (exports.isMac) { - return exports.OS.MAC; - } else if (exports.isLinux) { - return exports.OS.LINUX; - } else { - return exports.OS.WINDOWS; - } -}; -if (typeof navigator != "object") - return; - -var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); -var ua = navigator.userAgent; -exports.isWin = (os == "win"); -exports.isMac = (os == "mac"); -exports.isLinux = (os == "linux"); -exports.isIE = - (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0) - && parseFloat(navigator.userAgent.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:|MSIE )([0-9]+[\.0-9]+)/)[1]); - -exports.isOldIE = exports.isIE && exports.isIE < 9; -exports.isGecko = exports.isMozilla = window.controllers && window.navigator.product === "Gecko"; -exports.isOldGecko = exports.isGecko && parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1], 10) < 4; -exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]"; -exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; - -exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined; - -exports.isAIR = ua.indexOf("AdobeAIR") >= 0; - -exports.isIPad = ua.indexOf("iPad") >= 0; - -exports.isTouchPad = ua.indexOf("TouchPad") >= 0; - -}); - -ace.define('ace/commands/multi_select_commands', ['require', 'exports', 'module' , 'ace/keyboard/hash_handler'], function(require, exports, module) { -exports.defaultCommands = [{ - name: "addCursorAbove", - exec: function(editor) { editor.selectMoreLines(-1); }, - bindKey: {win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up"}, - readonly: true -}, { - name: "addCursorBelow", - exec: function(editor) { editor.selectMoreLines(1); }, - bindKey: {win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down"}, - readonly: true -}, { - name: "addCursorAboveSkipCurrent", - exec: function(editor) { editor.selectMoreLines(-1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up"}, - readonly: true -}, { - name: "addCursorBelowSkipCurrent", - exec: function(editor) { editor.selectMoreLines(1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down"}, - readonly: true -}, { - name: "selectMoreBefore", - exec: function(editor) { editor.selectMore(-1); }, - bindKey: {win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left"}, - readonly: true -}, { - name: "selectMoreAfter", - exec: function(editor) { editor.selectMore(1); }, - bindKey: {win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right"}, - readonly: true -}, { - name: "selectNextBefore", - exec: function(editor) { editor.selectMore(-1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left"}, - readonly: true -}, { - name: "selectNextAfter", - exec: function(editor) { editor.selectMore(1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right"}, - readonly: true -}, { - name: "splitIntoLines", - exec: function(editor) { editor.multiSelect.splitIntoLines(); }, - bindKey: {win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L"}, - readonly: true -}, { - name: "alignCursors", - exec: function(editor) { editor.alignCursors(); }, - bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"} -}]; -exports.multiSelectCommands = [{ - name: "singleSelection", - bindKey: "esc", - exec: function(editor) { editor.exitMultiSelectMode(); }, - readonly: true, - isAvailable: function(editor) {return editor && editor.inMultiSelectMode} -}]; - -var HashHandler = require("../keyboard/hash_handler").HashHandler; -exports.keyboardHandler = new HashHandler(exports.multiSelectCommands); - -}); - -ace.define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -exports.mixin = function(obj, mixin) { - for (var key in mixin) { - obj[key] = mixin[key]; - } - return obj; -}; - -exports.implement = function(proto, mixin) { - exports.mixin(proto, mixin); -}; - -}); - -ace.define('ace/worker/worker_client', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/config'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var EventEmitter = require("../lib/event_emitter").EventEmitter; -var config = require("../config"); - -var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) { - this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); - this.changeListener = this.changeListener.bind(this); - this.onMessage = this.onMessage.bind(this); - if (require.nameToUrl && !require.toUrl) - require.toUrl = require.nameToUrl; - - if (config.get("packaged") || !require.toUrl) { - workerUrl = workerUrl || config.moduleUrl(mod, "worker"); - } else { - var normalizePath = this.$normalizePath; - workerUrl = workerUrl || normalizePath(require.toUrl("ace/worker/worker.js", null, "_")); - - var tlns = {}; - topLevelNamespaces.forEach(function(ns) { - tlns[ns] = normalizePath(require.toUrl(ns, null, "_").replace(/(\.js)?(\?.*)?$/, "")); - }); - } - - try { - this.$worker = new Worker(workerUrl); - } catch(e) { - if (e instanceof window.DOMException) { - var blob = this.$workerBlob(workerUrl); - var URL = window.URL || window.webkitURL; - var blobURL = URL.createObjectURL(blob); - - this.$worker = new Worker(blobURL); - URL.revokeObjectURL(blobURL); - } else { - throw e; - } - } - this.$worker.postMessage({ - init : true, - tlns : tlns, - module : mod, - classname : classname - }); - - this.callbackId = 1; - this.callbacks = {}; - - this.$worker.onmessage = this.onMessage; -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.onMessage = function(e) { - var msg = e.data; - switch(msg.type) { - case "log": - window.console && console.log && console.log.apply(console, msg.data); - break; - - case "event": - this._signal(msg.name, {data: msg.data}); - break; - - case "call": - var callback = this.callbacks[msg.id]; - if (callback) { - callback(msg.data); - delete this.callbacks[msg.id]; - } - break; - } - }; - - this.$normalizePath = function(path) { - if (!location.host) // needed for file:// protocol - return path; - path = path.replace(/^[a-z]+:\/\/[^\/]+/, ""); // Remove domain name and rebuild it - path = location.protocol + "//" + location.host - + (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, "")) - + "/" + path.replace(/^[\/]+/, ""); - return path; - }; - - this.terminate = function() { - this._signal("terminate", {}); - this.deltaQueue = null; - this.$worker.terminate(); - this.$worker = null; - this.$doc.removeEventListener("change", this.changeListener); - this.$doc = null; - }; - - this.send = function(cmd, args) { - this.$worker.postMessage({command: cmd, args: args}); - }; - - this.call = function(cmd, args, callback) { - if (callback) { - var id = this.callbackId++; - this.callbacks[id] = callback; - args.push(id); - } - this.send(cmd, args); - }; - - this.emit = function(event, data) { - try { - this.$worker.postMessage({event: event, data: {data: data.data}}); - } - catch(ex) {} - }; - - this.attachToDocument = function(doc) { - if(this.$doc) - this.terminate(); - - this.$doc = doc; - this.call("setValue", [doc.getValue()]); - doc.on("change", this.changeListener); - }; - - this.changeListener = function(e) { - if (!this.deltaQueue) { - this.deltaQueue = [e.data]; - setTimeout(this.$sendDeltaQueue, 0); - } else - this.deltaQueue.push(e.data); - }; - - this.$sendDeltaQueue = function() { - var q = this.deltaQueue; - if (!q) return; - this.deltaQueue = null; - if (q.length > 20 && q.length > this.$doc.getLength() >> 1) { - this.call("setValue", [this.$doc.getValue()]); - } else - this.emit("change", {data: q}); - }; - - this.$workerBlob = function(workerUrl) { - var script = "importScripts('" + workerUrl + "');"; - try { - return new Blob([script], {"type": "application/javascript"}); - } catch (e) { // Backwards-compatibility - var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder; - var blobBuilder = new BlobBuilder(); - blobBuilder.append(script); - return blobBuilder.getBlob("application/javascript"); - } - }; - -}).call(WorkerClient.prototype); - - -var UIWorkerClient = function(topLevelNamespaces, mod, classname) { - this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); - this.changeListener = this.changeListener.bind(this); - this.callbackId = 1; - this.callbacks = {}; - this.messageBuffer = []; - - var main = null; - var emitSync = false; - var sender = Object.create(EventEmitter); - var _self = this; - - this.$worker = {}; - this.$worker.terminate = function() {}; - this.$worker.postMessage = function(e) { - _self.messageBuffer.push(e); - if (main) { - if (emitSync) - setTimeout(processNext); - else - processNext(); - } - }; - this.setEmitSync = function(val) { emitSync = val }; - - var processNext = function() { - var msg = _self.messageBuffer.shift(); - if (msg.command) - main[msg.command].apply(main, msg.args); - else if (msg.event) - sender._signal(msg.event, msg.data); - }; - - sender.postMessage = function(msg) { - _self.onMessage({data: msg}); - }; - sender.callback = function(data, callbackId) { - this.postMessage({type: "call", id: callbackId, data: data}); - }; - sender.emit = function(name, data) { - this.postMessage({type: "event", name: name, data: data}); - }; - - config.loadModule(["worker", mod], function(Main) { - main = new Main[classname](sender); - while (_self.messageBuffer.length) - processNext(); - }); -}; - -UIWorkerClient.prototype = WorkerClient.prototype; - -exports.UIWorkerClient = UIWorkerClient; -exports.WorkerClient = WorkerClient; - -}); - -ace.define('ace/lib/keys', ['require', 'exports', 'module' , 'ace/lib/oop'], function(require, exports, module) { - - -var oop = require("./oop"); -var Keys = (function() { - var ret = { - MODIFIER_KEYS: { - 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta' - }, - - KEY_MODS: { - "ctrl": 1, "alt": 2, "option" : 2, "shift": 4, - "super": 8, "meta": 8, "command": 8, "cmd": 8 - }, - - FUNCTION_KEYS : { - 8 : "Backspace", - 9 : "Tab", - 13 : "Return", - 19 : "Pause", - 27 : "Esc", - 32 : "Space", - 33 : "PageUp", - 34 : "PageDown", - 35 : "End", - 36 : "Home", - 37 : "Left", - 38 : "Up", - 39 : "Right", - 40 : "Down", - 44 : "Print", - 45 : "Insert", - 46 : "Delete", - 96 : "Numpad0", - 97 : "Numpad1", - 98 : "Numpad2", - 99 : "Numpad3", - 100: "Numpad4", - 101: "Numpad5", - 102: "Numpad6", - 103: "Numpad7", - 104: "Numpad8", - 105: "Numpad9", - '-13': "NumpadEnter", - 112: "F1", - 113: "F2", - 114: "F3", - 115: "F4", - 116: "F5", - 117: "F6", - 118: "F7", - 119: "F8", - 120: "F9", - 121: "F10", - 122: "F11", - 123: "F12", - 144: "Numlock", - 145: "Scrolllock" - }, - - PRINTABLE_KEYS: { - 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', - 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 61: '=', 65: 'a', - 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', - 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', - 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v', - 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.', - 188: ',', 190: '.', 191: '/', 192: '`', 219: '[', 220: '\\', - 221: ']', 222: '\'' - } - }; - var name, i; - for (i in ret.FUNCTION_KEYS) { - name = ret.FUNCTION_KEYS[i].toLowerCase(); - ret[name] = parseInt(i, 10); - } - for (i in ret.PRINTABLE_KEYS) { - name = ret.PRINTABLE_KEYS[i].toLowerCase(); - ret[name] = parseInt(i, 10); - } - oop.mixin(ret, ret.MODIFIER_KEYS); - oop.mixin(ret, ret.PRINTABLE_KEYS); - oop.mixin(ret, ret.FUNCTION_KEYS); - ret.enter = ret["return"]; - ret.escape = ret.esc; - ret.del = ret["delete"]; - ret[173] = '-'; - - (function() { - var mods = ["cmd", "ctrl", "alt", "shift"]; - for (var i = Math.pow(2, mods.length); i--;) { - ret.KEY_MODS[i] = mods.filter(function(x) { - return i & ret.KEY_MODS[x]; - }).join("-") + "-"; - } - })(); - - return ret; -})(); -oop.mixin(exports, Keys); - -exports.keyCodeToString = function(keyCode) { - return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase(); -}; - -}); -ace.define('ace/placeholder', ['require', 'exports', 'module' , 'ace/range', 'ace/lib/event_emitter', 'ace/lib/oop'], function(require, exports, module) { - - -var Range = require("./range").Range; -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var oop = require("./lib/oop"); - -var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) { - var _self = this; - this.length = length; - this.session = session; - this.doc = session.getDocument(); - this.mainClass = mainClass; - this.othersClass = othersClass; - this.$onUpdate = this.onUpdate.bind(this); - this.doc.on("change", this.$onUpdate); - this.$others = others; - - this.$onCursorChange = function() { - setTimeout(function() { - _self.onCursorChange(); - }); - }; - - this.$pos = pos; - var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || {length: -1}; - this.$undoStackDepth = undoStack.length; - this.setup(); - - session.selection.on("changeCursor", this.$onCursorChange); -}; - -(function() { - - oop.implement(this, EventEmitter); - this.setup = function() { - var _self = this; - var doc = this.doc; - var session = this.session; - var pos = this.$pos; - - this.pos = doc.createAnchor(pos.row, pos.column); - this.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false); - this.pos.on("change", function(event) { - session.removeMarker(_self.markerId); - _self.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.mainClass, null, false); - }); - this.others = []; - this.$others.forEach(function(other) { - var anchor = doc.createAnchor(other.row, other.column); - _self.others.push(anchor); - }); - session.setUndoSelect(false); - }; - this.showOtherMarkers = function() { - if(this.othersActive) return; - var session = this.session; - var _self = this; - this.othersActive = true; - this.others.forEach(function(anchor) { - anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column+_self.length), _self.othersClass, null, false); - anchor.on("change", function(event) { - session.removeMarker(anchor.markerId); - anchor.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.othersClass, null, false); - }); - }); - }; - this.hideOtherMarkers = function() { - if(!this.othersActive) return; - this.othersActive = false; - for (var i = 0; i < this.others.length; i++) { - this.session.removeMarker(this.others[i].markerId); - } - }; - this.onUpdate = function(event) { - var delta = event.data; - var range = delta.range; - if(range.start.row !== range.end.row) return; - if(range.start.row !== this.pos.row) return; - if (this.$updating) return; - this.$updating = true; - var lengthDiff = delta.action === "insertText" ? range.end.column - range.start.column : range.start.column - range.end.column; - - if(range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1) { - var distanceFromStart = range.start.column - this.pos.column; - this.length += lengthDiff; - if(!this.session.$fromUndo) { - if(delta.action === "insertText") { - for (var i = this.others.length - 1; i >= 0; i--) { - var otherPos = this.others[i]; - var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; - if(otherPos.row === range.start.row && range.start.column < otherPos.column) - newPos.column += lengthDiff; - this.doc.insert(newPos, delta.text); - } - } else if(delta.action === "removeText") { - for (var i = this.others.length - 1; i >= 0; i--) { - var otherPos = this.others[i]; - var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; - if(otherPos.row === range.start.row && range.start.column < otherPos.column) - newPos.column += lengthDiff; - this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff)); - } - } - if(range.start.column === this.pos.column && delta.action === "insertText") { - setTimeout(function() { - this.pos.setPosition(this.pos.row, this.pos.column - lengthDiff); - for (var i = 0; i < this.others.length; i++) { - var other = this.others[i]; - var newPos = {row: other.row, column: other.column - lengthDiff}; - if(other.row === range.start.row && range.start.column < other.column) - newPos.column += lengthDiff; - other.setPosition(newPos.row, newPos.column); - } - }.bind(this), 0); - } - else if(range.start.column === this.pos.column && delta.action === "removeText") { - setTimeout(function() { - for (var i = 0; i < this.others.length; i++) { - var other = this.others[i]; - if(other.row === range.start.row && range.start.column < other.column) { - other.setPosition(other.row, other.column - lengthDiff); - } - } - }.bind(this), 0); - } - } - this.pos._emit("change", {value: this.pos}); - for (var i = 0; i < this.others.length; i++) { - this.others[i]._emit("change", {value: this.others[i]}); - } - } - this.$updating = false; - }; - - this.onCursorChange = function(event) { - if (this.$updating) return; - var pos = this.session.selection.getCursor(); - if(pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) { - this.showOtherMarkers(); - this._emit("cursorEnter", event); - } else { - this.hideOtherMarkers(); - this._emit("cursorLeave", event); - } - }; - this.detach = function() { - this.session.removeMarker(this.markerId); - this.hideOtherMarkers(); - this.doc.removeEventListener("change", this.$onUpdate); - this.session.selection.removeEventListener("changeCursor", this.$onCursorChange); - this.pos.detach(); - for (var i = 0; i < this.others.length; i++) { - this.others[i].detach(); - } - this.session.setUndoSelect(true); - }; - this.cancel = function() { - if(this.$undoStackDepth === -1) - throw Error("Canceling placeholders only supported with undo manager attached to session."); - var undoManager = this.session.getUndoManager(); - var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth; - for (var i = 0; i < undosRequired; i++) { - undoManager.undo(true); - } - }; -}).call(PlaceHolder.prototype); - - -exports.PlaceHolder = PlaceHolder; -}); - -ace.define('ace/lib/event', ['require', 'exports', 'module' , 'ace/lib/keys', 'ace/lib/useragent'], function(require, exports, module) { - - -var keys = require("./keys"); -var useragent = require("./useragent"); - -exports.addListener = function(elem, type, callback) { - if (elem.addEventListener) { - return elem.addEventListener(type, callback, false); - } - if (elem.attachEvent) { - var wrapper = function() { - callback.call(elem, window.event); - }; - callback._wrapper = wrapper; - elem.attachEvent("on" + type, wrapper); - } -}; - -exports.removeListener = function(elem, type, callback) { - if (elem.removeEventListener) { - return elem.removeEventListener(type, callback, false); - } - if (elem.detachEvent) { - elem.detachEvent("on" + type, callback._wrapper || callback); - } -}; -exports.stopEvent = function(e) { - exports.stopPropagation(e); - exports.preventDefault(e); - return false; -}; - -exports.stopPropagation = function(e) { - if (e.stopPropagation) - e.stopPropagation(); - else - e.cancelBubble = true; -}; - -exports.preventDefault = function(e) { - if (e.preventDefault) - e.preventDefault(); - else - e.returnValue = false; -}; -exports.getButton = function(e) { - if (e.type == "dblclick") - return 0; - if (e.type == "contextmenu" || (e.ctrlKey && useragent.isMac)) - return 2; - if (e.preventDefault) { - return e.button; - } - else { - return {1:0, 2:2, 4:1}[e.button]; - } -}; - -exports.capture = function(el, eventHandler, releaseCaptureHandler) { - function onMouseUp(e) { - eventHandler && eventHandler(e); - releaseCaptureHandler && releaseCaptureHandler(e); - - exports.removeListener(document, "mousemove", eventHandler, true); - exports.removeListener(document, "mouseup", onMouseUp, true); - exports.removeListener(document, "dragstart", onMouseUp, true); - } - - exports.addListener(document, "mousemove", eventHandler, true); - exports.addListener(document, "mouseup", onMouseUp, true); - exports.addListener(document, "dragstart", onMouseUp, true); - - return onMouseUp; -}; - -exports.addMouseWheelListener = function(el, callback) { - if ("onmousewheel" in el) { - exports.addListener(el, "mousewheel", function(e) { - var factor = 8; - if (e.wheelDeltaX !== undefined) { - e.wheelX = -e.wheelDeltaX / factor; - e.wheelY = -e.wheelDeltaY / factor; - } else { - e.wheelX = 0; - e.wheelY = -e.wheelDelta / factor; - } - callback(e); - }); - } else if ("onwheel" in el) { - exports.addListener(el, "wheel", function(e) { - var factor = 0.35; - switch (e.deltaMode) { - case e.DOM_DELTA_PIXEL: - e.wheelX = e.deltaX * factor || 0; - e.wheelY = e.deltaY * factor || 0; - break; - case e.DOM_DELTA_LINE: - case e.DOM_DELTA_PAGE: - e.wheelX = (e.deltaX || 0) * 5; - e.wheelY = (e.deltaY || 0) * 5; - break; - } - - callback(e); - }); - } else { - exports.addListener(el, "DOMMouseScroll", function(e) { - if (e.axis && e.axis == e.HORIZONTAL_AXIS) { - e.wheelX = (e.detail || 0) * 5; - e.wheelY = 0; - } else { - e.wheelX = 0; - e.wheelY = (e.detail || 0) * 5; - } - callback(e); - }); - } -}; - -exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbackName) { - var clicks = 0; - var startX, startY, timer; - var eventNames = { - 2: "dblclick", - 3: "tripleclick", - 4: "quadclick" - }; - - exports.addListener(el, "mousedown", function(e) { - if (exports.getButton(e) !== 0) { - clicks = 0; - } else if (e.detail > 1) { - clicks++; - if (clicks > 4) - clicks = 1; - } else { - clicks = 1; - } - if (useragent.isIE) { - var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5; - if (isNewClick) { - clicks = 1; - } - if (clicks == 1) { - startX = e.clientX; - startY = e.clientY; - } - } - - eventHandler[callbackName]("mousedown", e); - - if (clicks > 4) - clicks = 0; - else if (clicks > 1) - return eventHandler[callbackName](eventNames[clicks], e); - }); - - if (useragent.isOldIE) { - exports.addListener(el, "dblclick", function(e) { - clicks = 2; - if (timer) - clearTimeout(timer); - timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600); - eventHandler[callbackName]("mousedown", e); - eventHandler[callbackName](eventNames[clicks], e); - }); - } -}; - -var getModifierHash = useragent.isMac && useragent.isOpera && !("KeyboardEvent" in window) - ? function(e) { - return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0); - } - : function(e) { - return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0); - }; - -exports.getModifierString = function(e) { - return keys.KEY_MODS[getModifierHash(e)]; -}; - -function normalizeCommandKeys(callback, e, keyCode) { - var hashId = getModifierHash(e); - - if (!useragent.isMac && pressedKeys) { - if (pressedKeys[91] || pressedKeys[92]) - hashId |= 8; - if (pressedKeys.altGr) { - if ((3 & hashId) != 3) - pressedKeys.altGr = 0; - else - return; - } - if (keyCode === 18 || keyCode === 17) { - var location = e.location || e.keyLocation; - if (keyCode === 17 && location === 1) { - ts = e.timeStamp; - } else if (keyCode === 18 && hashId === 3 && location === 2) { - var dt = -ts; - ts = e.timeStamp; - dt += ts; - if (dt < 3) - pressedKeys.altGr = true; - } - } - } - - if (keyCode in keys.MODIFIER_KEYS) { - switch (keys.MODIFIER_KEYS[keyCode]) { - case "Alt": - hashId = 2; - break; - case "Shift": - hashId = 4; - break; - case "Ctrl": - hashId = 1; - break; - default: - hashId = 8; - break; - } - keyCode = -1; - } - - if (hashId & 8 && (keyCode === 91 || keyCode === 93)) { - keyCode = -1; - } - - if (!hashId && keyCode === 13) { - if (e.location || e.keyLocation === 3) { - callback(e, hashId, -keyCode); - if (e.defaultPrevented) - return; - } - } - if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) { - return false; - } - - return callback(e, hashId, keyCode); -} - -var pressedKeys = null; -var ts = 0; -exports.addCommandKeyListener = function(el, callback) { - var addListener = exports.addListener; - if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) { - var lastKeyDownKeyCode = null; - addListener(el, "keydown", function(e) { - lastKeyDownKeyCode = e.keyCode; - }); - addListener(el, "keypress", function(e) { - return normalizeCommandKeys(callback, e, lastKeyDownKeyCode); - }); - } else { - var lastDefaultPrevented = null; - - addListener(el, "keydown", function(e) { - pressedKeys[e.keyCode] = true; - var result = normalizeCommandKeys(callback, e, e.keyCode); - lastDefaultPrevented = e.defaultPrevented; - return result; - }); - - addListener(el, "keypress", function(e) { - if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) { - exports.stopEvent(e); - lastDefaultPrevented = null; - } - }); - - addListener(el, "keyup", function(e) { - pressedKeys[e.keyCode] = null; - }); - - if (!pressedKeys) { - pressedKeys = Object.create(null); - addListener(window, "focus", function(e) { - pressedKeys = Object.create(null); - }); - } - } -}; - -if (window.postMessage && !useragent.isOldIE) { - var postMessageId = 1; - exports.nextTick = function(callback, win) { - win = win || window; - var messageName = "zero-timeout-message-" + postMessageId; - exports.addListener(win, "message", function listener(e) { - if (e.data == messageName) { - exports.stopPropagation(e); - exports.removeListener(win, "message", listener); - callback(); - } - }); - win.postMessage(messageName, "*"); - }; -} - - -exports.nextFrame = window.requestAnimationFrame || - window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || - window.msRequestAnimationFrame || - window.oRequestAnimationFrame; - -if (exports.nextFrame) - exports.nextFrame = exports.nextFrame.bind(window); -else - exports.nextFrame = function(callback) { - setTimeout(callback, 17); - }; -}); - -ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; - -(function() { - - this.foldingStartMarker = null; - this.foldingStopMarker = null; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - if (this.foldingStartMarker.test(line)) - return "start"; - if (foldStyle == "markbeginend" - && this.foldingStopMarker - && this.foldingStopMarker.test(line)) - return "end"; - return ""; - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - return null; - }; - - this.indentationBlock = function(session, row, column) { - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1) - return; - - var startColumn = column || line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - var level = session.getLine(row).search(re); - - if (level == -1) - continue; - - if (level <= startLevel) - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - - this.openingBracketBlock = function(session, bracket, row, column, typeRe) { - var start = {row: row, column: column + 1}; - var end = session.$findClosingBracket(bracket, start, typeRe); - if (!end) - return; - - var fw = session.foldWidgets[end.row]; - if (fw == null) - fw = session.getFoldWidget(end.row); - - if (fw == "start" && end.row > start.row) { - end.row --; - end.column = session.getLine(end.row).length; - } - return Range.fromPoints(start, end); - }; - - this.closingBracketBlock = function(session, bracket, row, column, typeRe) { - var end = {row: row, column: column}; - var start = session.$findOpeningBracket(bracket, end); - - if (!start) - return; - - start.column++; - end.column--; - - return Range.fromPoints(start, end); - }; -}).call(FoldMode.prototype); - -}); - -ace.define('ace/lib/dom', ['require', 'exports', 'module' ], function(require, exports, module) { - - -if (typeof document == "undefined") - return; - -var XHTML_NS = "http://www.w3.org/1999/xhtml"; - -exports.getDocumentHead = function(doc) { - if (!doc) - doc = document; - return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; -} - -exports.createElement = function(tag, ns) { - return document.createElementNS ? - document.createElementNS(ns || XHTML_NS, tag) : - document.createElement(tag); -}; - -exports.hasCssClass = function(el, name) { - var classes = el.className.split(/\s+/g); - return classes.indexOf(name) !== -1; -}; -exports.addCssClass = function(el, name) { - if (!exports.hasCssClass(el, name)) { - el.className += " " + name; - } -}; -exports.removeCssClass = function(el, name) { - var classes = el.className.split(/\s+/g); - while (true) { - var index = classes.indexOf(name); - if (index == -1) { - break; - } - classes.splice(index, 1); - } - el.className = classes.join(" "); -}; - -exports.toggleCssClass = function(el, name) { - var classes = el.className.split(/\s+/g), add = true; - while (true) { - var index = classes.indexOf(name); - if (index == -1) { - break; - } - add = false; - classes.splice(index, 1); - } - if(add) - classes.push(name); - - el.className = classes.join(" "); - return add; -}; -exports.setCssClass = function(node, className, include) { - if (include) { - exports.addCssClass(node, className); - } else { - exports.removeCssClass(node, className); - } -}; - -exports.hasCssString = function(id, doc) { - var index = 0, sheets; - doc = doc || document; - - if (doc.createStyleSheet && (sheets = doc.styleSheets)) { - while (index < sheets.length) - if (sheets[index++].owningElement.id === id) return true; - } else if ((sheets = doc.getElementsByTagName("style"))) { - while (index < sheets.length) - if (sheets[index++].id === id) return true; - } - - return false; -}; - -exports.importCssString = function importCssString(cssText, id, doc) { - doc = doc || document; - if (id && exports.hasCssString(id, doc)) - return null; - - var style; - - if (doc.createStyleSheet) { - style = doc.createStyleSheet(); - style.cssText = cssText; - if (id) - style.owningElement.id = id; - } else { - style = doc.createElementNS - ? doc.createElementNS(XHTML_NS, "style") - : doc.createElement("style"); - - style.appendChild(doc.createTextNode(cssText)); - if (id) - style.id = id; - - exports.getDocumentHead(doc).appendChild(style); - } -}; - -exports.importCssStylsheet = function(uri, doc) { - if (doc.createStyleSheet) { - doc.createStyleSheet(uri); - } else { - var link = exports.createElement('link'); - link.rel = 'stylesheet'; - link.href = uri; - - exports.getDocumentHead(doc).appendChild(link); - } -}; - -exports.getInnerWidth = function(element) { - return ( - parseInt(exports.computedStyle(element, "paddingLeft"), 10) + - parseInt(exports.computedStyle(element, "paddingRight"), 10) + - element.clientWidth - ); -}; - -exports.getInnerHeight = function(element) { - return ( - parseInt(exports.computedStyle(element, "paddingTop"), 10) + - parseInt(exports.computedStyle(element, "paddingBottom"), 10) + - element.clientHeight - ); -}; - -if (window.pageYOffset !== undefined) { - exports.getPageScrollTop = function() { - return window.pageYOffset; - }; - - exports.getPageScrollLeft = function() { - return window.pageXOffset; - }; -} -else { - exports.getPageScrollTop = function() { - return document.body.scrollTop; - }; - - exports.getPageScrollLeft = function() { - return document.body.scrollLeft; - }; -} - -if (window.getComputedStyle) - exports.computedStyle = function(element, style) { - if (style) - return (window.getComputedStyle(element, "") || {})[style] || ""; - return window.getComputedStyle(element, "") || {}; - }; -else - exports.computedStyle = function(element, style) { - if (style) - return element.currentStyle[style]; - return element.currentStyle; - }; - -exports.scrollbarWidth = function(document) { - var inner = exports.createElement("ace_inner"); - inner.style.width = "100%"; - inner.style.minWidth = "0px"; - inner.style.height = "200px"; - inner.style.display = "block"; - - var outer = exports.createElement("ace_outer"); - var style = outer.style; - - style.position = "absolute"; - style.left = "-10000px"; - style.overflow = "hidden"; - style.width = "200px"; - style.minWidth = "0px"; - style.height = "150px"; - style.display = "block"; - - outer.appendChild(inner); - - var body = document.documentElement; - body.appendChild(outer); - - var noScrollbar = inner.offsetWidth; - - style.overflow = "scroll"; - var withScrollbar = inner.offsetWidth; - - if (noScrollbar == withScrollbar) { - withScrollbar = outer.clientWidth; - } - - body.removeChild(outer); - - return noScrollbar-withScrollbar; -}; -exports.setInnerHtml = function(el, innerHtml) { - var element = el.cloneNode(false);//document.createElement("div"); - element.innerHTML = innerHtml; - el.parentNode.replaceChild(element, el); - return element; -}; - -if ("textContent" in document.documentElement) { - exports.setInnerText = function(el, innerText) { - el.textContent = innerText; - }; - - exports.getInnerText = function(el) { - return el.textContent; - }; -} -else { - exports.setInnerText = function(el, innerText) { - el.innerText = innerText; - }; - - exports.getInnerText = function(el) { - return el.innerText; - }; -} - -exports.getParentWindow = function(document) { - return document.defaultView || document.parentWindow; -}; - -}); - -ace.define('ace/theme/textmate', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - - -exports.isDark = false; -exports.cssClass = "ace-tm"; -exports.cssText = ".ace-tm .ace_gutter {\ -background: #f0f0f0;\ -color: #333;\ -}\ -.ace-tm .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8;\ -}\ -.ace-tm .ace_fold {\ -background-color: #6B72E6;\ -}\ -.ace-tm {\ -background-color: #FFFFFF;\ -color: black;\ -}\ -.ace-tm .ace_cursor {\ -color: black;\ -}\ -.ace-tm .ace_invisible {\ -color: rgb(191, 191, 191);\ -}\ -.ace-tm .ace_storage,\ -.ace-tm .ace_keyword {\ -color: blue;\ -}\ -.ace-tm .ace_constant {\ -color: rgb(197, 6, 11);\ -}\ -.ace-tm .ace_constant.ace_buildin {\ -color: rgb(88, 72, 246);\ -}\ -.ace-tm .ace_constant.ace_language {\ -color: rgb(88, 92, 246);\ -}\ -.ace-tm .ace_constant.ace_library {\ -color: rgb(6, 150, 14);\ -}\ -.ace-tm .ace_invalid {\ -background-color: rgba(255, 0, 0, 0.1);\ -color: red;\ -}\ -.ace-tm .ace_support.ace_function {\ -color: rgb(60, 76, 114);\ -}\ -.ace-tm .ace_support.ace_constant {\ -color: rgb(6, 150, 14);\ -}\ -.ace-tm .ace_support.ace_type,\ -.ace-tm .ace_support.ace_class {\ -color: rgb(109, 121, 222);\ -}\ -.ace-tm .ace_keyword.ace_operator {\ -color: rgb(104, 118, 135);\ -}\ -.ace-tm .ace_string {\ -color: rgb(3, 106, 7);\ -}\ -.ace-tm .ace_comment {\ -color: rgb(76, 136, 107);\ -}\ -.ace-tm .ace_comment.ace_doc {\ -color: rgb(0, 102, 255);\ -}\ -.ace-tm .ace_comment.ace_doc.ace_tag {\ -color: rgb(128, 159, 191);\ -}\ -.ace-tm .ace_constant.ace_numeric {\ -color: rgb(0, 0, 205);\ -}\ -.ace-tm .ace_variable {\ -color: rgb(49, 132, 149);\ -}\ -.ace-tm .ace_xml-pe {\ -color: rgb(104, 104, 91);\ -}\ -.ace-tm .ace_entity.ace_name.ace_function {\ -color: #0000A2;\ -}\ -.ace-tm .ace_heading {\ -color: rgb(12, 7, 255);\ -}\ -.ace-tm .ace_list {\ -color:rgb(185, 6, 144);\ -}\ -.ace-tm .ace_meta.ace_tag {\ -color:rgb(0, 22, 142);\ -}\ -.ace-tm .ace_string.ace_regex {\ -color: rgb(255, 0, 0)\ -}\ -.ace-tm .ace_marker-layer .ace_selection {\ -background: rgb(181, 213, 255);\ -}\ -.ace-tm.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px white;\ -border-radius: 2px;\ -}\ -.ace-tm .ace_marker-layer .ace_step {\ -background: rgb(252, 255, 0);\ -}\ -.ace-tm .ace_marker-layer .ace_stack {\ -background: rgb(164, 229, 101);\ -}\ -.ace-tm .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgb(192, 192, 192);\ -}\ -.ace-tm .ace_marker-layer .ace_active-line {\ -background: rgba(0, 0, 0, 0.07);\ -}\ -.ace-tm .ace_gutter-active-line {\ -background-color : #dcdcdc;\ -}\ -.ace-tm .ace_marker-layer .ace_selected-word {\ -background: rgb(250, 250, 255);\ -border: 1px solid rgb(200, 200, 250);\ -}\ -.ace-tm .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ -}\ -"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); - -ace.define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) { - -function Empty() {} - -if (!Function.prototype.bind) { - Function.prototype.bind = function bind(that) { // .length is 1 - var target = this; - if (typeof target != "function") { - throw new TypeError("Function.prototype.bind called on incompatible " + target); - } - var args = slice.call(arguments, 1); // for normal call - var bound = function () { - - if (this instanceof bound) { - - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - - } - - }; - if(target.prototype) { - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; -} -var call = Function.prototype.call; -var prototypeOfArray = Array.prototype; -var prototypeOfObject = Object.prototype; -var slice = prototypeOfArray.slice; -var _toString = call.bind(prototypeOfObject.toString); -var owns = call.bind(prototypeOfObject.hasOwnProperty); -var defineGetter; -var defineSetter; -var lookupGetter; -var lookupSetter; -var supportsAccessors; -if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { - defineGetter = call.bind(prototypeOfObject.__defineGetter__); - defineSetter = call.bind(prototypeOfObject.__defineSetter__); - lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); - lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); -} -if ([1,2].splice(0).length != 2) { - if(function() { // test IE < 9 to splice bug - see issue #138 - function makeArray(l) { - var a = new Array(l+2); - a[0] = a[1] = 0; - return a; - } - var array = [], lengthBefore; - - array.splice.apply(array, makeArray(20)); - array.splice.apply(array, makeArray(26)); - - lengthBefore = array.length; //46 - array.splice(5, 0, "XXX"); // add one element - - lengthBefore + 1 == array.length - - if (lengthBefore + 1 == array.length) { - return true;// has right splice implementation without bugs - } - }()) {//IE 6/7 - var array_splice = Array.prototype.splice; - Array.prototype.splice = function(start, deleteCount) { - if (!arguments.length) { - return []; - } else { - return array_splice.apply(this, [ - start === void 0 ? 0 : start, - deleteCount === void 0 ? (this.length - start) : deleteCount - ].concat(slice.call(arguments, 2))) - } - }; - } else {//IE8 - Array.prototype.splice = function(pos, removeCount){ - var length = this.length; - if (pos > 0) { - if (pos > length) - pos = length; - } else if (pos == void 0) { - pos = 0; - } else if (pos < 0) { - pos = Math.max(length + pos, 0); - } - - if (!(pos+removeCount < length)) - removeCount = length - pos; - - var removed = this.slice(pos, pos+removeCount); - var insert = slice.call(arguments, 2); - var add = insert.length; - if (pos === length) { - if (add) { - this.push.apply(this, insert); - } - } else { - var remove = Math.min(removeCount, length - pos); - var tailOldPos = pos + remove; - var tailNewPos = tailOldPos + add - remove; - var tailCount = length - tailOldPos; - var lengthAfterRemove = length - remove; - - if (tailNewPos < tailOldPos) { // case A - for (var i = 0; i < tailCount; ++i) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } else if (tailNewPos > tailOldPos) { // case B - for (i = tailCount; i--; ) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } // else, add == remove (nothing to do) - - if (add && pos === lengthAfterRemove) { - this.length = lengthAfterRemove; // truncate array - this.push.apply(this, insert); - } else { - this.length = lengthAfterRemove + add; // reserves space - for (i = 0; i < add; ++i) { - this[pos+i] = insert[i]; - } - } - } - return removed; - }; - } -} -if (!Array.isArray) { - Array.isArray = function isArray(obj) { - return _toString(obj) == "[object Array]"; - }; -} -var boxedString = Object("a"), - splitString = boxedString[0] != "a" || !(0 in boxedString); - -if (!Array.prototype.forEach) { - Array.prototype.forEach = function forEach(fun /*, thisp*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - thisp = arguments[1], - i = -1, - length = self.length >>> 0; - if (_toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - while (++i < length) { - if (i in self) { - fun.call(thisp, self[i], i, object); - } - } - }; -} -if (!Array.prototype.map) { - Array.prototype.map = function map(fun /*, thisp*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - result = Array(length), - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self) - result[i] = fun.call(thisp, self[i], i, object); - } - return result; - }; -} -if (!Array.prototype.filter) { - Array.prototype.filter = function filter(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - result = [], - value, - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self) { - value = self[i]; - if (fun.call(thisp, value, i, object)) { - result.push(value); - } - } - } - return result; - }; -} -if (!Array.prototype.every) { - Array.prototype.every = function every(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self && !fun.call(thisp, self[i], i, object)) { - return false; - } - } - return true; - }; -} -if (!Array.prototype.some) { - Array.prototype.some = function some(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self && fun.call(thisp, self[i], i, object)) { - return true; - } - } - return false; - }; -} -if (!Array.prototype.reduce) { - Array.prototype.reduce = function reduce(fun /*, initial*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - if (!length && arguments.length == 1) { - throw new TypeError("reduce of empty array with no initial value"); - } - - var i = 0; - var result; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i++]; - break; - } - if (++i >= length) { - throw new TypeError("reduce of empty array with no initial value"); - } - } while (true); - } - - for (; i < length; i++) { - if (i in self) { - result = fun.call(void 0, result, self[i], i, object); - } - } - - return result; - }; -} -if (!Array.prototype.reduceRight) { - Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - if (!length && arguments.length == 1) { - throw new TypeError("reduceRight of empty array with no initial value"); - } - - var result, i = length - 1; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i--]; - break; - } - if (--i < 0) { - throw new TypeError("reduceRight of empty array with no initial value"); - } - } while (true); - } - - do { - if (i in this) { - result = fun.call(void 0, result, self[i], i, object); - } - } while (i--); - - return result; - }; -} -if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { - Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - toObject(this), - length = self.length >>> 0; - - if (!length) { - return -1; - } - - var i = 0; - if (arguments.length > 1) { - i = toInteger(arguments[1]); - } - i = i >= 0 ? i : Math.max(0, length + i); - for (; i < length; i++) { - if (i in self && self[i] === sought) { - return i; - } - } - return -1; - }; -} -if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { - Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - toObject(this), - length = self.length >>> 0; - - if (!length) { - return -1; - } - var i = length - 1; - if (arguments.length > 1) { - i = Math.min(i, toInteger(arguments[1])); - } - i = i >= 0 ? i : length - Math.abs(i); - for (; i >= 0; i--) { - if (i in self && sought === self[i]) { - return i; - } - } - return -1; - }; -} -if (!Object.getPrototypeOf) { - Object.getPrototypeOf = function getPrototypeOf(object) { - return object.__proto__ || ( - object.constructor ? - object.constructor.prototype : - prototypeOfObject - ); - }; -} -if (!Object.getOwnPropertyDescriptor) { - var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + - "non-object: "; - Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { - if ((typeof object != "object" && typeof object != "function") || object === null) - throw new TypeError(ERR_NON_OBJECT + object); - if (!owns(object, property)) - return; - - var descriptor, getter, setter; - descriptor = { enumerable: true, configurable: true }; - if (supportsAccessors) { - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - - var getter = lookupGetter(object, property); - var setter = lookupSetter(object, property); - object.__proto__ = prototype; - - if (getter || setter) { - if (getter) descriptor.get = getter; - if (setter) descriptor.set = setter; - return descriptor; - } - } - descriptor.value = object[property]; - return descriptor; - }; -} -if (!Object.getOwnPropertyNames) { - Object.getOwnPropertyNames = function getOwnPropertyNames(object) { - return Object.keys(object); - }; -} -if (!Object.create) { - var createEmpty; - if (Object.prototype.__proto__ === null) { - createEmpty = function () { - return { "__proto__": null }; - }; - } else { - createEmpty = function () { - var empty = {}; - for (var i in empty) - empty[i] = null; - empty.constructor = - empty.hasOwnProperty = - empty.propertyIsEnumerable = - empty.isPrototypeOf = - empty.toLocaleString = - empty.toString = - empty.valueOf = - empty.__proto__ = null; - return empty; - } - } - - Object.create = function create(prototype, properties) { - var object; - if (prototype === null) { - object = createEmpty(); - } else { - if (typeof prototype != "object") - throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); - var Type = function () {}; - Type.prototype = prototype; - object = new Type(); - object.__proto__ = prototype; - } - if (properties !== void 0) - Object.defineProperties(object, properties); - return object; - }; -} - -function doesDefinePropertyWork(object) { - try { - Object.defineProperty(object, "sentinel", {}); - return "sentinel" in object; - } catch (exception) { - } -} -if (Object.defineProperty) { - var definePropertyWorksOnObject = doesDefinePropertyWork({}); - var definePropertyWorksOnDom = typeof document == "undefined" || - doesDefinePropertyWork(document.createElement("div")); - if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { - var definePropertyFallback = Object.defineProperty; - } -} - -if (!Object.defineProperty || definePropertyFallback) { - var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; - var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " - var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + - "on this javascript engine"; - - Object.defineProperty = function defineProperty(object, property, descriptor) { - if ((typeof object != "object" && typeof object != "function") || object === null) - throw new TypeError(ERR_NON_OBJECT_TARGET + object); - if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) - throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); - if (definePropertyFallback) { - try { - return definePropertyFallback.call(Object, object, property, descriptor); - } catch (exception) { - } - } - if (owns(descriptor, "value")) { - - if (supportsAccessors && (lookupGetter(object, property) || - lookupSetter(object, property))) - { - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - delete object[property]; - object[property] = descriptor.value; - object.__proto__ = prototype; - } else { - object[property] = descriptor.value; - } - } else { - if (!supportsAccessors) - throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); - if (owns(descriptor, "get")) - defineGetter(object, property, descriptor.get); - if (owns(descriptor, "set")) - defineSetter(object, property, descriptor.set); - } - - return object; - }; -} -if (!Object.defineProperties) { - Object.defineProperties = function defineProperties(object, properties) { - for (var property in properties) { - if (owns(properties, property)) - Object.defineProperty(object, property, properties[property]); - } - return object; - }; -} -if (!Object.seal) { - Object.seal = function seal(object) { - return object; - }; -} -if (!Object.freeze) { - Object.freeze = function freeze(object) { - return object; - }; -} -try { - Object.freeze(function () {}); -} catch (exception) { - Object.freeze = (function freeze(freezeObject) { - return function freeze(object) { - if (typeof object == "function") { - return object; - } else { - return freezeObject(object); - } - }; - })(Object.freeze); -} -if (!Object.preventExtensions) { - Object.preventExtensions = function preventExtensions(object) { - return object; - }; -} -if (!Object.isSealed) { - Object.isSealed = function isSealed(object) { - return false; - }; -} -if (!Object.isFrozen) { - Object.isFrozen = function isFrozen(object) { - return false; - }; -} -if (!Object.isExtensible) { - Object.isExtensible = function isExtensible(object) { - if (Object(object) === object) { - throw new TypeError(); // TODO message - } - var name = ''; - while (owns(object, name)) { - name += '?'; - } - object[name] = true; - var returnValue = owns(object, name); - delete object[name]; - return returnValue; - }; -} -if (!Object.keys) { - var hasDontEnumBug = true, - dontEnums = [ - "toString", - "toLocaleString", - "valueOf", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "constructor" - ], - dontEnumsLength = dontEnums.length; - - for (var key in {"toString": null}) { - hasDontEnumBug = false; - } - - Object.keys = function keys(object) { - - if ( - (typeof object != "object" && typeof object != "function") || - object === null - ) { - throw new TypeError("Object.keys called on a non-object"); - } - - var keys = []; - for (var name in object) { - if (owns(object, name)) { - keys.push(name); - } - } - - if (hasDontEnumBug) { - for (var i = 0, ii = dontEnumsLength; i < ii; i++) { - var dontEnum = dontEnums[i]; - if (owns(object, dontEnum)) { - keys.push(dontEnum); - } - } - } - return keys; - }; - -} -if (!Date.now) { - Date.now = function now() { - return new Date().getTime(); - }; -} -var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + - "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + - "\u2029\uFEFF"; -if (!String.prototype.trim || ws.trim()) { - ws = "[" + ws + "]"; - var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), - trimEndRegexp = new RegExp(ws + ws + "*$"); - String.prototype.trim = function trim() { - return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); - }; -} - -function toInteger(n) { - n = +n; - if (n !== n) { // isNaN - n = 0; - } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { - n = (n > 0 || -1) * Math.floor(Math.abs(n)); - } - return n; -} - -function isPrimitive(input) { - var type = typeof input; - return ( - input === null || - type === "undefined" || - type === "boolean" || - type === "number" || - type === "string" - ); -} - -function toPrimitive(input) { - var val, valueOf, toString; - if (isPrimitive(input)) { - return input; - } - valueOf = input.valueOf; - if (typeof valueOf === "function") { - val = valueOf.call(input); - if (isPrimitive(val)) { - return val; - } - } - toString = input.toString; - if (typeof toString === "function") { - val = toString.call(input); - if (isPrimitive(val)) { - return val; - } - } - throw new TypeError(); -} -var toObject = function (o) { - if (o == null) { // this matches both null and undefined - throw new TypeError("can't convert "+o+" to object"); - } - return Object(o); -}; - -}); - -ace.define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, exports, module) { - - var real = { - exec: RegExp.prototype.exec, - test: RegExp.prototype.test, - match: String.prototype.match, - replace: String.prototype.replace, - split: String.prototype.split - }, - compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups - compliantLastIndexIncrement = function () { - var x = /^/g; - real.test.call(x, ""); - return !x.lastIndex; - }(); - - if (compliantLastIndexIncrement && compliantExecNpcg) - return; - RegExp.prototype.exec = function (str) { - var match = real.exec.apply(this, arguments), - name, r2; - if ( typeof(str) == 'string' && match) { - if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { - r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", "")); - real.replace.call(str.slice(match.index), r2, function () { - for (var i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) - match[i] = undefined; - } - }); - } - if (this._xregexp && this._xregexp.captureNames) { - for (var i = 1; i < match.length; i++) { - name = this._xregexp.captureNames[i - 1]; - if (name) - match[name] = match[i]; - } - } - if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - } - return match; - }; - if (!compliantLastIndexIncrement) { - RegExp.prototype.test = function (str) { - var match = real.exec.call(this, str); - if (match && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - return !!match; - }; - } - - function getNativeFlags (regex) { - return (regex.global ? "g" : "") + - (regex.ignoreCase ? "i" : "") + - (regex.multiline ? "m" : "") + - (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 - (regex.sticky ? "y" : ""); - } - - function indexOf (array, item, from) { - if (Array.prototype.indexOf) // Use the native array method if available - return array.indexOf(item, from); - for (var i = from || 0; i < array.length; i++) { - if (array[i] === item) - return i; - } - return -1; - } - -}); - -ace.define('ace/ext/error_marker', ['require', 'exports', 'module' , 'ace/line_widgets', 'ace/lib/dom', 'ace/range'], function(require, exports, module) { - -var LineWidgets = require("ace/line_widgets").LineWidgets; -var dom = require("ace/lib/dom"); -var Range = require("ace/range").Range; - -function binarySearch(array, needle, comparator) { - var first = 0; - var last = array.length - 1; - - while (first <= last) { - var mid = (first + last) >> 1; - var c = comparator(needle, array[mid]); - if (c > 0) - first = mid + 1; - else if (c < 0) - last = mid - 1; - else - return mid; - } - return -(first + 1); -} - -function findAnnotations(session, row, dir) { - var annotations = session.getAnnotations().sort(Range.comparePoints); - if (!annotations.length) - return; - - var i = binarySearch(annotations, {row: row, column: -1}, Range.comparePoints); - if (i < 0) - i = -i - 1; - - if (i >= annotations.length - 1) - i = dir > 0 ? 0 : annotations.length - 1; - else if (i === 0 && dir < 0) - i = annotations.length - 1; - - var annotation = annotations[i]; - if (!annotation || !dir) - return; - - if (annotation.row === row) { - do { - annotation = annotations[i += dir]; - } while (annotation && annotation.row === row); - if (!annotation) - return annotations.slice(); - } - - - var matched = []; - row = annotation.row; - do { - matched[dir < 0 ? "unshift" : "push"](annotation); - annotation = annotations[i += dir]; - } while (annotation && annotation.row == row); - return matched.length && matched; -} - -exports.showErrorMarker = function(editor, dir) { - var session = editor.session; - if (!session.widgetManager) { - session.widgetManager = new LineWidgets(session); - session.widgetManager.attach(editor); - } - - var pos = editor.getCursorPosition(); - var row = pos.row; - var oldWidget = session.lineWidgets && session.lineWidgets[row]; - if (oldWidget) { - oldWidget.destroy(); - } else { - row -= dir; - } - var annotations = findAnnotations(session, row, dir); - var gutterAnno; - if (annotations) { - var annotation = annotations[0]; - pos.column = (annotation.pos && typeof annotation.column != "number" - ? annotation.pos.sc - : annotation.column) || 0; - pos.row = annotation.row; - gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row]; - } else if (oldWidget) { - return; - } else { - gutterAnno = { - text: ["Looks good!"], - className: "ace_ok" - }; - } - editor.session.unfold(pos.row); - editor.selection.moveToPosition(pos); - - var w = { - row: pos.row, - fixedWidth: true, - coverGutter: true, - el: dom.createElement("div") - }; - var el = w.el.appendChild(dom.createElement("div")); - var arrow = w.el.appendChild(dom.createElement("div")); - arrow.className = "error_widget_arrow " + gutterAnno.className; - - var left = editor.renderer.$cursorLayer - .getPixelPosition(pos).left; - arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px"; - - w.el.className = "error_widget_wrapper"; - el.className = "error_widget " + gutterAnno.className; - el.innerHTML = gutterAnno.text.join("
    "); - - el.appendChild(dom.createElement("div")); - - var kb = function(_, hashId, keyString) { - if (hashId === 0 && (keyString === "esc" || keyString === "return")) { - w.destroy(); - return {command: "null"}; - } - }; - - w.destroy = function() { - if (editor.$mouseHandler.isMousePressed) - return; - editor.keyBinding.removeKeyboardHandler(kb); - session.widgetManager.removeLineWidget(w); - editor.off("changeSelection", w.destroy); - editor.off("changeSession", w.destroy); - editor.off("mouseup", w.destroy); - editor.off("change", w.destroy); - }; - - editor.keyBinding.addKeyboardHandler(kb); - editor.on("changeSelection", w.destroy); - editor.on("changeSession", w.destroy); - editor.on("mouseup", w.destroy); - editor.on("change", w.destroy); - - editor.session.widgetManager.addLineWidget(w); - - w.el.onmousedown = editor.focus.bind(editor); - - editor.renderer.scrollCursorIntoView(null, 0.5, {bottom: w.el.offsetHeight}); -}; - - -dom.importCssString("\ - .error_widget_wrapper {\ - background: inherit;\ - color: inherit;\ - border:none\ - }\ - .error_widget {\ - border-top: solid 2px;\ - border-bottom: solid 2px;\ - margin: 5px 0;\ - padding: 10px 40px;\ - white-space: pre-wrap;\ - }\ - .error_widget.ace_error, .error_widget_arrow.ace_error{\ - border-color: #ff5a5a\ - }\ - .error_widget.ace_warning, .error_widget_arrow.ace_warning{\ - border-color: #F1D817\ - }\ - .error_widget.ace_info, .error_widget_arrow.ace_info{\ - border-color: #5a5a5a\ - }\ - .error_widget.ace_ok, .error_widget_arrow.ace_ok{\ - border-color: #5aaa5a\ - }\ - .error_widget_arrow {\ - position: absolute;\ - border: solid 5px;\ - border-top-color: transparent!important;\ - border-right-color: transparent!important;\ - border-left-color: transparent!important;\ - top: -5px;\ - }\ -", ""); - -});// vim:set ts=4 sts=4 sw=4 st: - -ace.define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/regexp', 'ace/lib/es5-shim'], function(require, exports, module) { - - -require("./regexp"); -require("./es5-shim"); - -}); - -ace.define('ace/line_widgets', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/range'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -var Range = require("./range").Range; - - -function LineWidgets(session) { - this.session = session; - this.session.widgetManager = this; - this.session.getRowLength = this.getRowLength; - this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; - this.updateOnChange = this.updateOnChange.bind(this); - this.renderWidgets = this.renderWidgets.bind(this); - this.measureWidgets = this.measureWidgets.bind(this); - this.session._changedWidgets = []; - this.detach = this.detach.bind(this); - - this.session.on("change", this.updateOnChange); -} - -(function() { - this.getRowLength = function(row) { - var h; - if (this.lineWidgets) - h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; - else - h = 0; - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1 + h; - } else { - return this.$wrapData[row].length + 1 + h; - } - }; - - this.$getWidgetScreenLength = function() { - var screenRows = 0; - this.lineWidgets.forEach(function(w){ - if (w && w.rowCount) - screenRows +=w.rowCount; - }); - return screenRows; - }; - - this.attach = function(editor) { - if (editor.widgetManager && editor.widgetManager != this) - editor.widgetManager.detach(); - - if (this.editor == editor) - return; - - this.detach(); - this.editor = editor; - - this.editor.on("changeSession", this.detach); - - editor.widgetManager = this; - - editor.setOption("enableLineWidgets", true); - editor.renderer.on("beforeRender", this.measureWidgets); - editor.renderer.on("afterRender", this.renderWidgets); - }; - this.detach = function(e) { - if (e && e.session == this.session) - return; // sometimes attach can be called before setSession - var editor = this.editor; - if (!editor) - return; - - editor.off("changeSession", this.detach); - - this.editor = null; - editor.widgetManager = null; - - editor.renderer.off("beforeRender", this.measureWidgets); - editor.renderer.off("afterRender", this.renderWidgets); - var lineWidgets = this.session.lineWidgets; - lineWidgets && lineWidgets.forEach(function(w) { - if (w && w.el && w.el.parentNode) { - w._inDocument = false; - w.el.parentNode.removeChild(w.el); - } - }); - }; - - this.updateOnChange = function(e) { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) return; - - var delta = e.data; - var range = delta.range; - var startRow = range.start.row; - var len = range.end.row - startRow; - - if (len === 0) { - } else if (delta.action == "removeText" || delta.action == "removeLines") { - var removed = lineWidgets.splice(startRow + 1, len); - removed.forEach(function(w) { - w && this.removeLineWidget(w); - }, this); - this.$updateRows(); - } else { - var args = new Array(len); - args.unshift(startRow, 0); - lineWidgets.splice.apply(lineWidgets, args); - this.$updateRows(); - } - }; - - this.$updateRows = function() { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) return; - var noWidgets = true; - lineWidgets.forEach(function(w, i) { - if (w) { - noWidgets = false; - w.row = i; - } - }); - if (noWidgets) - this.session.lineWidgets = null; - }; - - this.addLineWidget = function(w) { - if (!this.session.lineWidgets) - this.session.lineWidgets = new Array(this.session.getLength()); - - this.session.lineWidgets[w.row] = w; - - var renderer = this.editor.renderer; - if (w.html && !w.el) { - w.el = dom.createElement("div"); - w.el.innerHTML = w.html; - } - if (w.el) { - dom.addCssClass(w.el, "ace_lineWidgetContainer"); - w.el.style.position = "absolute"; - w.el.style.zIndex = 5; - renderer.container.appendChild(w.el); - w._inDocument = true; - } - - if (!w.coverGutter) { - w.el.style.zIndex = 3; - } - if (!w.pixelHeight) { - w.pixelHeight = w.el.offsetHeight; - } - if (w.rowCount == null) - w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; - - this.session._emit("changeFold", {data:{start:{row: w.row}}}); - - this.$updateRows(); - this.renderWidgets(null, renderer); - return w; - }; - - this.removeLineWidget = function(w) { - w._inDocument = false; - if (w.el && w.el.parentNode) - w.el.parentNode.removeChild(w.el); - if (w.editor && w.editor.destroy) try { - w.editor.destroy(); - } catch(e){} - if (this.session.lineWidgets) - this.session.lineWidgets[w.row] = undefined; - this.session._emit("changeFold", {data:{start:{row: w.row}}}); - this.$updateRows(); - }; - - this.onWidgetChanged = function(w) { - this.session._changedWidgets.push(w); - this.editor && this.editor.renderer.updateFull(); - }; - - this.measureWidgets = function(e, renderer) { - var changedWidgets = this.session._changedWidgets; - var config = renderer.layerConfig; - - if (!changedWidgets || !changedWidgets.length) return; - var min = Infinity; - for (var i = 0; i < changedWidgets.length; i++) { - var w = changedWidgets[i]; - if (!w._inDocument) { - w._inDocument = true; - renderer.container.appendChild(w.el); - } - - w.h = w.el.offsetHeight; - - if (!w.fixedWidth) { - w.w = w.el.offsetWidth; - w.screenWidth = Math.ceil(w.w / config.characterWidth); - } - - var rowCount = w.h / config.lineHeight; - if (w.coverLine) { - rowCount -= this.session.getRowLineCount(w.row); - if (rowCount < 0) - rowCount = 0; - } - if (w.rowCount != rowCount) { - w.rowCount = rowCount; - if (w.row < min) - min = w.row; - } - } - if (min != Infinity) { - this.session._emit("changeFold", {data:{start:{row: min}}}); - this.session.lineWidgetWidth = null; - } - this.session._changedWidgets = []; - }; - - this.renderWidgets = function(e, renderer) { - var config = renderer.layerConfig; - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) - return; - var first = Math.min(this.firstRow, config.firstRow); - var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); - - while (first > 0 && !lineWidgets[first]) - first--; - - this.firstRow = config.firstRow; - this.lastRow = config.lastRow; - - renderer.$cursorLayer.config = config; - for (var i = first; i <= last; i++) { - var w = lineWidgets[i]; - if (!w || !w.el) continue; - - if (!w._inDocument) { - w._inDocument = true; - renderer.container.appendChild(w.el); - } - var top = renderer.$cursorLayer.getPixelPosition({row: i, column:0}, true).top; - if (!w.coverLine) - top += config.lineHeight * this.session.getRowLineCount(w.row); - w.el.style.top = top - config.offset + "px"; - - var left = w.coverGutter ? 0 : renderer.gutterWidth; - if (!w.fixedWidth) - left -= renderer.scrollLeft; - w.el.style.left = left + "px"; - - if (w.fixedWidth) { - w.el.style.right = renderer.scrollBar.getWidth() + "px"; - } else { - w.el.style.right = ""; - } - } - }; - -}).call(LineWidgets.prototype); - - -exports.LineWidgets = LineWidgets; - -}); - -ace.define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var Range = require("./range").Range; -var Anchor = require("./anchor").Anchor; - -var Document = function(text) { - this.$lines = []; - if (text.length === 0) { - this.$lines = [""]; - } else if (Array.isArray(text)) { - this._insertLines(0, text); - } else { - this.insert({row: 0, column:0}, text); - } -}; - -(function() { - - oop.implement(this, EventEmitter); - this.setValue = function(text) { - var len = this.getLength(); - this.remove(new Range(0, 0, len, this.getLine(len-1).length)); - this.insert({row: 0, column:0}, text); - }; - this.getValue = function() { - return this.getAllLines().join(this.getNewLineCharacter()); - }; - this.createAnchor = function(row, column) { - return new Anchor(this, row, column); - }; - if ("aaa".split(/a/).length === 0) - this.$split = function(text) { - return text.replace(/\r\n|\r/g, "\n").split("\n"); - }; - else - this.$split = function(text) { - return text.split(/\r\n|\r|\n/); - }; - - - this.$detectNewLine = function(text) { - var match = text.match(/^.*?(\r\n|\r|\n)/m); - this.$autoNewLine = match ? match[1] : "\n"; - this._signal("changeNewLineMode"); - }; - this.getNewLineCharacter = function() { - switch (this.$newLineMode) { - case "windows": - return "\r\n"; - case "unix": - return "\n"; - default: - return this.$autoNewLine || "\n"; - } - }; - - this.$autoNewLine = ""; - this.$newLineMode = "auto"; - this.setNewLineMode = function(newLineMode) { - if (this.$newLineMode === newLineMode) - return; - - this.$newLineMode = newLineMode; - this._signal("changeNewLineMode"); - }; - this.getNewLineMode = function() { - return this.$newLineMode; - }; - this.isNewLine = function(text) { - return (text == "\r\n" || text == "\r" || text == "\n"); - }; - this.getLine = function(row) { - return this.$lines[row] || ""; - }; - this.getLines = function(firstRow, lastRow) { - return this.$lines.slice(firstRow, lastRow + 1); - }; - this.getAllLines = function() { - return this.getLines(0, this.getLength()); - }; - this.getLength = function() { - return this.$lines.length; - }; - this.getTextRange = function(range) { - if (range.start.row == range.end.row) { - return this.getLine(range.start.row) - .substring(range.start.column, range.end.column); - } - var lines = this.getLines(range.start.row, range.end.row); - lines[0] = (lines[0] || "").substring(range.start.column); - var l = lines.length - 1; - if (range.end.row - range.start.row == l) - lines[l] = lines[l].substring(0, range.end.column); - return lines.join(this.getNewLineCharacter()); - }; - - this.$clipPosition = function(position) { - var length = this.getLength(); - if (position.row >= length) { - position.row = Math.max(0, length - 1); - position.column = this.getLine(length-1).length; - } else if (position.row < 0) - position.row = 0; - return position; - }; - this.insert = function(position, text) { - if (!text || text.length === 0) - return position; - - position = this.$clipPosition(position); - if (this.getLength() <= 1) - this.$detectNewLine(text); - - var lines = this.$split(text); - var firstLine = lines.splice(0, 1)[0]; - var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; - - position = this.insertInLine(position, firstLine); - if (lastLine !== null) { - position = this.insertNewLine(position); // terminate first line - position = this._insertLines(position.row, lines); - position = this.insertInLine(position, lastLine || ""); - } - return position; - }; - this.insertLines = function(row, lines) { - if (row >= this.getLength()) - return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); - return this._insertLines(Math.max(row, 0), lines); - }; - this._insertLines = function(row, lines) { - if (lines.length == 0) - return {row: row, column: 0}; - while (lines.length > 0xF000) { - var end = this._insertLines(row, lines.slice(0, 0xF000)); - lines = lines.slice(0xF000); - row = end.row; - } - - var args = [row, 0]; - args.push.apply(args, lines); - this.$lines.splice.apply(this.$lines, args); - - var range = new Range(row, 0, row + lines.length, 0); - var delta = { - action: "insertLines", - range: range, - lines: lines - }; - this._signal("change", { data: delta }); - return range.end; - }; - this.insertNewLine = function(position) { - position = this.$clipPosition(position); - var line = this.$lines[position.row] || ""; - - this.$lines[position.row] = line.substring(0, position.column); - this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); - - var end = { - row : position.row + 1, - column : 0 - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: this.getNewLineCharacter() - }; - this._signal("change", { data: delta }); - - return end; - }; - this.insertInLine = function(position, text) { - if (text.length == 0) - return position; - - var line = this.$lines[position.row] || ""; - - this.$lines[position.row] = line.substring(0, position.column) + text - + line.substring(position.column); - - var end = { - row : position.row, - column : position.column + text.length - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: text - }; - this._signal("change", { data: delta }); - - return end; - }; - this.remove = function(range) { - if (!(range instanceof Range)) - range = Range.fromPoints(range.start, range.end); - range.start = this.$clipPosition(range.start); - range.end = this.$clipPosition(range.end); - - if (range.isEmpty()) - return range.start; - - var firstRow = range.start.row; - var lastRow = range.end.row; - - if (range.isMultiLine()) { - var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; - var lastFullRow = lastRow - 1; - - if (range.end.column > 0) - this.removeInLine(lastRow, 0, range.end.column); - - if (lastFullRow >= firstFullRow) - this._removeLines(firstFullRow, lastFullRow); - - if (firstFullRow != firstRow) { - this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); - this.removeNewLine(range.start.row); - } - } - else { - this.removeInLine(firstRow, range.start.column, range.end.column); - } - return range.start; - }; - this.removeInLine = function(row, startColumn, endColumn) { - if (startColumn == endColumn) - return; - - var range = new Range(row, startColumn, row, endColumn); - var line = this.getLine(row); - var removed = line.substring(startColumn, endColumn); - var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); - this.$lines.splice(row, 1, newLine); - - var delta = { - action: "removeText", - range: range, - text: removed - }; - this._signal("change", { data: delta }); - return range.start; - }; - this.removeLines = function(firstRow, lastRow) { - if (firstRow < 0 || lastRow >= this.getLength()) - return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); - return this._removeLines(firstRow, lastRow); - }; - - this._removeLines = function(firstRow, lastRow) { - var range = new Range(firstRow, 0, lastRow + 1, 0); - var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); - - var delta = { - action: "removeLines", - range: range, - nl: this.getNewLineCharacter(), - lines: removed - }; - this._signal("change", { data: delta }); - return removed; - }; - this.removeNewLine = function(row) { - var firstLine = this.getLine(row); - var secondLine = this.getLine(row+1); - - var range = new Range(row, firstLine.length, row+1, 0); - var line = firstLine + secondLine; - - this.$lines.splice(row, 2, line); - - var delta = { - action: "removeText", - range: range, - text: this.getNewLineCharacter() - }; - this._signal("change", { data: delta }); - }; - this.replace = function(range, text) { - if (!(range instanceof Range)) - range = Range.fromPoints(range.start, range.end); - if (text.length == 0 && range.isEmpty()) - return range.start; - if (text == this.getTextRange(range)) - return range.end; - - this.remove(range); - if (text) { - var end = this.insert(range.start, text); - } - else { - end = range.start; - } - - return end; - }; - this.applyDeltas = function(deltas) { - for (var i=0; i=0; i--) { - var delta = deltas[i]; - - var range = Range.fromPoints(delta.range.start, delta.range.end); - - if (delta.action == "insertLines") - this._removeLines(range.start.row, range.end.row - 1); - else if (delta.action == "insertText") - this.remove(range); - else if (delta.action == "removeLines") - this._insertLines(range.start.row, delta.lines); - else if (delta.action == "removeText") - this.insert(range.start, delta.text); - } - }; - this.indexToPosition = function(index, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - for (var i = startRow || 0, l = lines.length; i < l; i++) { - index -= lines[i].length + newlineLength; - if (index < 0) - return {row: i, column: index + lines[i].length + newlineLength}; - } - return {row: l-1, column: lines[l-1].length}; - }; - this.positionToIndex = function(pos, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - var index = 0; - var row = Math.min(pos.row, lines.length); - for (var i = startRow || 0; i < row; ++i) - index += lines[i].length + newlineLength; - - return index + pos.column; - }; - -}).call(Document.prototype); - -exports.Document = Document; -}); -; - (function() { - ace.require(["ace/ace"], function(a) { - a && a.config.init(true); - if (!window.ace) - window.ace = a; - for (var key in a) if (a.hasOwnProperty(key)) - ace[key] = a[key]; - }); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-chromevox.js b/util/build-sample-browser/player/vendor/ace/ext-chromevox.js deleted file mode 100644 index e95dbdba9f..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-chromevox.js +++ /dev/null @@ -1,542 +0,0 @@ -ace.define('ace/ext/chromevox', ['require', 'exports', 'module' , 'ace/editor', 'ace/config'], function(require, exports, module) { -var cvoxAce = {}; -cvoxAce.SpeechProperty; -cvoxAce.Cursor; -cvoxAce.Token; -cvoxAce.Annotation; -var CONSTANT_PROP = { - 'rate': 0.8, - 'pitch': 0.4, - 'volume': 0.9 -}; -var DEFAULT_PROP = { - 'rate': 1, - 'pitch': 0.5, - 'volume': 0.9 -}; -var ENTITY_PROP = { - 'rate': 0.8, - 'pitch': 0.8, - 'volume': 0.9 -}; -var KEYWORD_PROP = { - 'rate': 0.8, - 'pitch': 0.3, - 'volume': 0.9 -}; -var STORAGE_PROP = { - 'rate': 0.8, - 'pitch': 0.7, - 'volume': 0.9 -}; -var VARIABLE_PROP = { - 'rate': 0.8, - 'pitch': 0.8, - 'volume': 0.9 -}; -var DELETED_PROP = { - 'punctuationEcho': 'none', - 'relativePitch': -0.6 -}; -var ERROR_EARCON = 'ALERT_NONMODAL'; -var MODE_SWITCH_EARCON = 'ALERT_MODAL'; -var NO_MATCH_EARCON = 'INVALID_KEYPRESS'; -var INSERT_MODE_STATE = 'insertMode'; -var COMMAND_MODE_STATE = 'start'; - -var REPLACE_LIST = [ - { - substr: ';', - newSubstr: ' semicolon ' - }, - { - substr: ':', - newSubstr: ' colon ' - } -]; -var Command = { - SPEAK_ANNOT: 'annots', - SPEAK_ALL_ANNOTS: 'all_annots', - TOGGLE_LOCATION: 'toggle_location', - SPEAK_MODE: 'mode', - SPEAK_ROW_COL: 'row_col', - TOGGLE_DISPLACEMENT: 'toggle_displacement', - FOCUS_TEXT: 'focus_text' -}; -var KEY_PREFIX = 'CONTROL + SHIFT '; -cvoxAce.editor = null; -var lastCursor = null; -var annotTable = {}; -var shouldSpeakRowLocation = false; -var shouldSpeakDisplacement = false; -var changed = false; -var vimState = null; -var keyCodeToShortcutMap = {}; -var cmdToShortcutMap = {}; -var getKeyShortcutString = function(keyCode) { - return KEY_PREFIX + String.fromCharCode(keyCode); -}; -var isVimMode = function() { - var keyboardHandler = cvoxAce.editor.keyBinding.getKeyboardHandler(); - return keyboardHandler.$id === 'ace/keyboard/vim'; -}; -var getCurrentToken = function(cursor) { - return cvoxAce.editor.getSession().getTokenAt(cursor.row, cursor.column + 1); -}; -var getCurrentLine = function(cursor) { - return cvoxAce.editor.getSession().getLine(cursor.row); -}; -var onRowChange = function(currCursor) { - if (annotTable[currCursor.row]) { - cvox.Api.playEarcon(ERROR_EARCON); - } - if (shouldSpeakRowLocation) { - cvox.Api.stop(); - speakChar(currCursor); - speakTokenQueue(getCurrentToken(currCursor)); - speakLine(currCursor.row, 1); - } else { - speakLine(currCursor.row, 0); - } -}; -var isWord = function(cursor) { - var line = getCurrentLine(cursor); - var lineSuffix = line.substr(cursor.column - 1); - if (cursor.column === 0) { - lineSuffix = ' ' + line; - } - var firstWordRegExp = /^\W(\w+)/; - var words = firstWordRegExp.exec(lineSuffix); - return words !== null; -}; -var rules = { - 'constant': { - prop: CONSTANT_PROP - }, - 'entity': { - prop: ENTITY_PROP - }, - 'keyword': { - prop: KEYWORD_PROP - }, - 'storage': { - prop: STORAGE_PROP - }, - 'variable': { - prop: VARIABLE_PROP - }, - 'meta': { - prop: DEFAULT_PROP, - replace: [ - { - substr: '', - newSubstr: ' close tag ' - }, - { - substr: '<', - newSubstr: ' tag start ' - }, - { - substr: '>', - newSubstr: ' tag end ' - } - ] - } -}; -var DEFAULT_RULE = { - prop: DEFAULT_RULE -}; -var expand = function(value, replaceRules) { - var newValue = value; - for (var i = 0; i < replaceRules.length; i++) { - var replaceRule = replaceRules[i]; - var regexp = new RegExp(replaceRule.substr, 'g'); - newValue = newValue.replace(regexp, replaceRule.newSubstr); - } - return newValue; -}; -var mergeTokens = function(tokens, start, end) { - var newToken = {}; - newToken.value = ''; - newToken.type = tokens[start].type; - for (var j = start; j < end; j++) { - newToken.value += tokens[j].value; - } - return newToken; -}; -var mergeLikeTokens = function(tokens) { - if (tokens.length <= 1) { - return tokens; - } - var newTokens = []; - var lastLikeIndex = 0; - for (var i = 1; i < tokens.length; i++) { - var lastLikeToken = tokens[lastLikeIndex]; - var currToken = tokens[i]; - if (getTokenRule(lastLikeToken) !== getTokenRule(currToken)) { - newTokens.push(mergeTokens(tokens, lastLikeIndex, i)); - lastLikeIndex = i; - } - } - newTokens.push(mergeTokens(tokens, lastLikeIndex, tokens.length)); - return newTokens; -}; -var isRowWhiteSpace = function(row) { - var line = cvoxAce.editor.getSession().getLine(row); - var whiteSpaceRegexp = /^\s*$/; - return whiteSpaceRegexp.exec(line) !== null; -}; -var speakLine = function(row, queue) { - var tokens = cvoxAce.editor.getSession().getTokens(row); - if (tokens.length === 0 || isRowWhiteSpace(row)) { - cvox.Api.playEarcon('EDITABLE_TEXT'); - return; - } - tokens = mergeLikeTokens(tokens); - var firstToken = tokens[0]; - tokens = tokens.filter(function(token) { - return token !== firstToken; - }); - speakToken_(firstToken, queue); - tokens.forEach(speakTokenQueue); -}; -var speakTokenFlush = function(token) { - speakToken_(token, 0); -}; -var speakTokenQueue = function(token) { - speakToken_(token, 1); -}; -var getTokenRule = function(token) { - if (!token || !token.type) { - return; - } - var split = token.type.split('.'); - if (split.length === 0) { - return; - } - var type = split[0]; - var rule = rules[type]; - if (!rule) { - return DEFAULT_RULE; - } - return rule; -}; -var speakToken_ = function(token, queue) { - var rule = getTokenRule(token); - var value = expand(token.value, REPLACE_LIST); - if (rule.replace) { - value = expand(value, rule.replace); - } - cvox.Api.speak(value, queue, rule.prop); -}; -var speakChar = function(cursor) { - var line = getCurrentLine(cursor); - cvox.Api.speak(line[cursor.column], 1); -}; -var speakDisplacement = function(lastCursor, currCursor) { - var line = getCurrentLine(currCursor); - var displace = line.substring(lastCursor.column, currCursor.column); - displace = displace.replace(/ /g, ' space '); - cvox.Api.speak(displace); -}; -var speakCharOrWordOrLine = function(lastCursor, currCursor) { - if (Math.abs(lastCursor.column - currCursor.column) !== 1) { - var currLineLength = getCurrentLine(currCursor).length; - if (currCursor.column === 0 || currCursor.column === currLineLength) { - speakLine(currCursor.row, 0); - return; - } - if (isWord(currCursor)) { - cvox.Api.stop(); - speakTokenQueue(getCurrentToken(currCursor)); - return; - } - } - speakChar(currCursor); -}; -var onColumnChange = function(lastCursor, currCursor) { - if (!cvoxAce.editor.selection.isEmpty()) { - speakDisplacement(lastCursor, currCursor); - cvox.Api.speak('selected', 1); - } - else if (shouldSpeakDisplacement) { - speakDisplacement(lastCursor, currCursor); - } else { - speakCharOrWordOrLine(lastCursor, currCursor); - } -}; -var onCursorChange = function(evt) { - if (changed) { - changed = false; - return; - } - var currCursor = cvoxAce.editor.selection.getCursor(); - if (currCursor.row !== lastCursor.row) { - onRowChange(currCursor); - } else { - onColumnChange(lastCursor, currCursor); - } - lastCursor = currCursor; -}; -var onSelectionChange = function(evt) { - if (cvoxAce.editor.selection.isEmpty()) { - cvox.Api.speak('unselected'); - } -}; -var onChange = function(evt) { - var data = evt.data; - switch (data.action) { - case 'removeText': - cvox.Api.speak(data.text, 0, DELETED_PROP); - changed = true; - break; - case 'insertText': - cvox.Api.speak(data.text, 0); - changed = true; - break; - } -}; -var isNewAnnotation = function(annot) { - var row = annot.row; - var col = annot.column; - return !annotTable[row] || !annotTable[row][col]; -}; -var populateAnnotations = function(annotations) { - annotTable = {}; - for (var i = 0; i < annotations.length; i++) { - var annotation = annotations[i]; - var row = annotation.row; - var col = annotation.column; - if (!annotTable[row]) { - annotTable[row] = {}; - } - annotTable[row][col] = annotation; - } -}; -var onAnnotationChange = function(evt) { - var annotations = cvoxAce.editor.getSession().getAnnotations(); - var newAnnotations = annotations.filter(isNewAnnotation); - if (newAnnotations.length > 0) { - cvox.Api.playEarcon(ERROR_EARCON); - } - populateAnnotations(annotations); -}; -var speakAnnot = function(annot) { - var annotText = annot.type + ' ' + annot.text + ' on ' + - rowColToString(annot.row, annot.column); - annotText = annotText.replace(';', 'semicolon'); - cvox.Api.speak(annotText, 1); -}; -var speakAnnotsByRow = function(row) { - var annots = annotTable[row]; - for (var col in annots) { - speakAnnot(annots[col]); - } -}; -var rowColToString = function(row, col) { - return 'row ' + (row + 1) + ' column ' + (col + 1); -}; -var speakCurrRowAndCol = function() { - cvox.Api.speak(rowColToString(lastCursor.row, lastCursor.column)); -}; -var speakAllAnnots = function() { - for (var row in annotTable) { - speakAnnotsByRow(row); - } -}; -var speakMode = function() { - if (!isVimMode()) { - return; - } - switch (cvoxAce.editor.keyBinding.$data.state) { - case INSERT_MODE_STATE: - cvox.Api.speak('Insert mode'); - break; - case COMMAND_MODE_STATE: - cvox.Api.speak('Command mode'); - break; - } -}; -var toggleSpeakRowLocation = function() { - shouldSpeakRowLocation = !shouldSpeakRowLocation; - if (shouldSpeakRowLocation) { - cvox.Api.speak('Speak location on row change enabled.'); - } else { - cvox.Api.speak('Speak location on row change disabled.'); - } -}; -var toggleSpeakDisplacement = function() { - shouldSpeakDisplacement = !shouldSpeakDisplacement; - if (shouldSpeakDisplacement) { - cvox.Api.speak('Speak displacement on column changes.'); - } else { - cvox.Api.speak('Speak current character or word on column changes.'); - } -}; -var onKeyDown = function(evt) { - if (evt.ctrlKey && evt.shiftKey) { - var shortcut = keyCodeToShortcutMap[evt.keyCode]; - if (shortcut) { - shortcut.func(); - } - } -}; -var onChangeStatus = function(evt, editor) { - if (!isVimMode()) { - return; - } - var state = editor.keyBinding.$data.state; - if (state === vimState) { - return; - } - switch (state) { - case INSERT_MODE_STATE: - cvox.Api.playEarcon(MODE_SWITCH_EARCON); - cvox.Api.setKeyEcho(true); - break; - case COMMAND_MODE_STATE: - cvox.Api.playEarcon(MODE_SWITCH_EARCON); - cvox.Api.setKeyEcho(false); - break; - } - vimState = state; -}; -var contextMenuHandler = function(evt) { - var cmd = evt.detail['customCommand']; - var shortcut = cmdToShortcutMap[cmd]; - if (shortcut) { - shortcut.func(); - cvoxAce.editor.focus(); - } -}; -var initContextMenu = function() { - var ACTIONS = SHORTCUTS.map(function(shortcut) { - return { - desc: shortcut.desc + getKeyShortcutString(shortcut.keyCode), - cmd: shortcut.cmd - }; - }); - var body = document.querySelector('body'); - body.setAttribute('contextMenuActions', JSON.stringify(ACTIONS)); - body.addEventListener('ATCustomEvent', contextMenuHandler, true); -}; -var onFindSearchbox = function(evt) { - if (evt.match) { - speakLine(lastCursor.row, 0); - } else { - cvox.Api.playEarcon(NO_MATCH_EARCON); - } -}; -var focus = function() { - cvoxAce.editor.focus(); -}; -var SHORTCUTS = [ - { - keyCode: 49, - func: function() { - speakAnnotsByRow(lastCursor.row); - }, - cmd: Command.SPEAK_ANNOT, - desc: 'Speak annotations on line' - }, - { - keyCode: 50, - func: speakAllAnnots, - cmd: Command.SPEAK_ALL_ANNOTS, - desc: 'Speak all annotations' - }, - { - keyCode: 51, - func: speakMode, - cmd: Command.SPEAK_MODE, - desc: 'Speak Vim mode' - }, - { - keyCode: 52, - func: toggleSpeakRowLocation, - cmd: Command.TOGGLE_LOCATION, - desc: 'Toggle speak row location' - }, - { - keyCode: 53, - func: speakCurrRowAndCol, - cmd: Command.SPEAK_ROW_COL, - desc: 'Speak row and column' - }, - { - keyCode: 54, - func: toggleSpeakDisplacement, - cmd: Command.TOGGLE_DISPLACEMENT, - desc: 'Toggle speak displacement' - }, - { - keyCode: 55, - func: focus, - cmd: Command.FOCUS_TEXT, - desc: 'Focus text' - } -]; -var onFocus = function() { - cvoxAce.editor = editor; - editor.getSession().selection.on('changeCursor', onCursorChange); - editor.getSession().selection.on('changeSelection', onSelectionChange); - editor.getSession().on('change', onChange); - editor.getSession().on('changeAnnotation', onAnnotationChange); - editor.on('changeStatus', onChangeStatus); - editor.on('findSearchBox', onFindSearchbox); - editor.container.addEventListener('keydown', onKeyDown); - - lastCursor = editor.selection.getCursor(); -}; -var init = function(editor) { - onFocus(); - SHORTCUTS.forEach(function(shortcut) { - keyCodeToShortcutMap[shortcut.keyCode] = shortcut; - cmdToShortcutMap[shortcut.cmd] = shortcut; - }); - - editor.on('focus', onFocus); - if (isVimMode()) { - cvox.Api.setKeyEcho(false); - } - initContextMenu(); -}; -function cvoxApiExists() { - return (typeof(cvox) !== 'undefined') && cvox && cvox.Api; -} -var tries = 0; -var MAX_TRIES = 15; -function watchForCvoxLoad(editor) { - if (cvoxApiExists()) { - init(editor); - } else { - tries++; - if (tries >= MAX_TRIES) { - return; - } - window.setTimeout(watchForCvoxLoad, 500, editor); - } -} - -var Editor = require('../editor').Editor; -require('../config').defineOptions(Editor.prototype, 'editor', { - enableChromevoxEnhancements: { - set: function(val) { - if (val) { - watchForCvoxLoad(this); - } - }, - value: true // turn it on by default or check for window.cvox - } -}); - -}); -; - (function() { - ace.require(["ace/ext/chromevox"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-elastic_tabstops_lite.js b/util/build-sample-browser/player/vendor/ace/ext-elastic_tabstops_lite.js deleted file mode 100644 index 72408476fe..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-elastic_tabstops_lite.js +++ /dev/null @@ -1,305 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/elastic_tabstops_lite', ['require', 'exports', 'module' , 'ace/editor', 'ace/config'], function(require, exports, module) { - - -var ElasticTabstopsLite = function(editor) { - this.$editor = editor; - var self = this; - var changedRows = []; - var recordChanges = false; - this.onAfterExec = function() { - recordChanges = false; - self.processRows(changedRows); - changedRows = []; - }; - this.onExec = function() { - recordChanges = true; - }; - this.onChange = function(e) { - var range = e.data.range - if (recordChanges) { - if (changedRows.indexOf(range.start.row) == -1) - changedRows.push(range.start.row); - if (range.end.row != range.start.row) - changedRows.push(range.end.row); - } - }; -}; - -(function() { - this.processRows = function(rows) { - this.$inChange = true; - var checkedRows = []; - - for (var r = 0, rowCount = rows.length; r < rowCount; r++) { - var row = rows[r]; - - if (checkedRows.indexOf(row) > -1) - continue; - - var cellWidthObj = this.$findCellWidthsForBlock(row); - var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths); - var rowIndex = cellWidthObj.firstRow; - - for (var w = 0, l = cellWidths.length; w < l; w++) { - var widths = cellWidths[w]; - checkedRows.push(rowIndex); - this.$adjustRow(rowIndex, widths); - rowIndex++; - } - } - this.$inChange = false; - }; - - this.$findCellWidthsForBlock = function(row) { - var cellWidths = [], widths; - var rowIter = row; - while (rowIter >= 0) { - widths = this.$cellWidthsForRow(rowIter); - if (widths.length == 0) - break; - - cellWidths.unshift(widths); - rowIter--; - } - var firstRow = rowIter + 1; - rowIter = row; - var numRows = this.$editor.session.getLength(); - - while (rowIter < numRows - 1) { - rowIter++; - - widths = this.$cellWidthsForRow(rowIter); - if (widths.length == 0) - break; - - cellWidths.push(widths); - } - - return { cellWidths: cellWidths, firstRow: firstRow }; - }; - - this.$cellWidthsForRow = function(row) { - var selectionColumns = this.$selectionColumnsForRow(row); - - var tabs = [-1].concat(this.$tabsForRow(row)); - var widths = tabs.map(function(el) { return 0; } ).slice(1); - var line = this.$editor.session.getLine(row); - - for (var i = 0, len = tabs.length - 1; i < len; i++) { - var leftEdge = tabs[i]+1; - var rightEdge = tabs[i+1]; - - var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge); - var cell = line.substring(leftEdge, rightEdge); - widths[i] = Math.max(cell.replace(/\s+$/g,'').length, rightmostSelection - leftEdge); - } - - return widths; - }; - - this.$selectionColumnsForRow = function(row) { - var selections = [], cursor = this.$editor.getCursorPosition(); - if (this.$editor.session.getSelection().isEmpty()) { - if (row == cursor.row) - selections.push(cursor.column); - } - - return selections; - }; - - this.$setBlockCellWidthsToMax = function(cellWidths) { - var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth; - var columnInfo = this.$izip_longest(cellWidths); - - for (var c = 0, l = columnInfo.length; c < l; c++) { - var column = columnInfo[c]; - if (!column.push) { - console.error(column); - continue; - } - column.push(NaN); - - for (var r = 0, s = column.length; r < s; r++) { - var width = column[r]; - if (startingNewBlock) { - blockStartRow = r; - maxWidth = 0; - startingNewBlock = false; - } - if (isNaN(width)) { - blockEndRow = r; - - for (var j = blockStartRow; j < blockEndRow; j++) { - cellWidths[j][c] = maxWidth; - } - startingNewBlock = true; - } - - maxWidth = Math.max(maxWidth, width); - } - } - - return cellWidths; - }; - - this.$rightmostSelectionInCell = function(selectionColumns, cellRightEdge) { - var rightmost = 0; - - if (selectionColumns.length) { - var lengths = []; - for (var s = 0, length = selectionColumns.length; s < length; s++) { - if (selectionColumns[s] <= cellRightEdge) - lengths.push(s); - else - lengths.push(0); - } - rightmost = Math.max.apply(Math, lengths); - } - - return rightmost; - }; - - this.$tabsForRow = function(row) { - var rowTabs = [], line = this.$editor.session.getLine(row), - re = /\t/g, match; - - while ((match = re.exec(line)) != null) { - rowTabs.push(match.index); - } - - return rowTabs; - }; - - this.$adjustRow = function(row, widths) { - var rowTabs = this.$tabsForRow(row); - - if (rowTabs.length == 0) - return; - - var bias = 0, location = -1; - var expandedSet = this.$izip(widths, rowTabs); - - for (var i = 0, l = expandedSet.length; i < l; i++) { - var w = expandedSet[i][0], it = expandedSet[i][1]; - location += 1 + w; - it += bias; - var difference = location - it; - - if (difference == 0) - continue; - - var partialLine = this.$editor.session.getLine(row).substr(0, it ); - var strippedPartialLine = partialLine.replace(/\s*$/g, ""); - var ispaces = partialLine.length - strippedPartialLine.length; - - if (difference > 0) { - this.$editor.session.getDocument().insertInLine({row: row, column: it + 1}, Array(difference + 1).join(" ") + "\t"); - this.$editor.session.getDocument().removeInLine(row, it, it + 1); - - bias += difference; - } - - if (difference < 0 && ispaces >= -difference) { - this.$editor.session.getDocument().removeInLine(row, it + difference, it); - bias += difference; - } - } - }; - this.$izip_longest = function(iterables) { - if (!iterables[0]) - return []; - var longest = iterables[0].length; - var iterablesLength = iterables.length; - - for (var i = 1; i < iterablesLength; i++) { - var iLength = iterables[i].length; - if (iLength > longest) - longest = iLength; - } - - var expandedSet = []; - - for (var l = 0; l < longest; l++) { - var set = []; - for (var i = 0; i < iterablesLength; i++) { - if (iterables[i][l] === "") - set.push(NaN); - else - set.push(iterables[i][l]); - } - - expandedSet.push(set); - } - - - return expandedSet; - }; - this.$izip = function(widths, tabs) { - var size = widths.length >= tabs.length ? tabs.length : widths.length; - - var expandedSet = []; - for (var i = 0; i < size; i++) { - var set = [ widths[i], tabs[i] ]; - expandedSet.push(set); - } - return expandedSet; - }; - -}).call(ElasticTabstopsLite.prototype); - -exports.ElasticTabstopsLite = ElasticTabstopsLite; - -var Editor = require("../editor").Editor; -require("../config").defineOptions(Editor.prototype, "editor", { - useElasticTabstops: { - set: function(val) { - if (val) { - if (!this.elasticTabstops) - this.elasticTabstops = new ElasticTabstopsLite(this); - this.commands.on("afterExec", this.elasticTabstops.onAfterExec); - this.commands.on("exec", this.elasticTabstops.onExec); - this.on("change", this.elasticTabstops.onChange); - } else if (this.elasticTabstops) { - this.commands.removeListener("afterExec", this.elasticTabstops.onAfterExec); - this.commands.removeListener("exec", this.elasticTabstops.onExec); - this.removeListener("change", this.elasticTabstops.onChange); - } - } - } -}); - -});; - (function() { - ace.require(["ace/ext/elastic_tabstops_lite"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-emmet.js b/util/build-sample-browser/player/vendor/ace/ext-emmet.js deleted file mode 100644 index 68cfba043c..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-emmet.js +++ /dev/null @@ -1,1114 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/emmet', ['require', 'exports', 'module' , 'ace/keyboard/hash_handler', 'ace/editor', 'ace/snippets', 'ace/range', 'ace/config'], function(require, exports, module) { - -var HashHandler = require("ace/keyboard/hash_handler").HashHandler; -var Editor = require("ace/editor").Editor; -var snippetManager = require("ace/snippets").snippetManager; -var Range = require("ace/range").Range; -var emmet; - -Editor.prototype.indexToPosition = function(index) { - return this.session.doc.indexToPosition(index); -}; - -Editor.prototype.positionToIndex = function(pos) { - return this.session.doc.positionToIndex(pos); -}; -function AceEmmetEditor() {} - -AceEmmetEditor.prototype = { - setupContext: function(editor) { - this.ace = editor; - this.indentation = editor.session.getTabString(); - if (!emmet) - emmet = window.emmet; - emmet.require("resources").setVariable("indentation", this.indentation); - this.$syntax = null; - this.$syntax = this.getSyntax(); - }, - getSelectionRange: function() { - var range = this.ace.getSelectionRange(); - return { - start: this.ace.positionToIndex(range.start), - end: this.ace.positionToIndex(range.end) - }; - }, - createSelection: function(start, end) { - this.ace.selection.setRange({ - start: this.ace.indexToPosition(start), - end: this.ace.indexToPosition(end) - }); - }, - getCurrentLineRange: function() { - var row = this.ace.getCursorPosition().row; - var lineLength = this.ace.session.getLine(row).length; - var index = this.ace.positionToIndex({row: row, column: 0}); - return { - start: index, - end: index + lineLength - }; - }, - getCaretPos: function(){ - var pos = this.ace.getCursorPosition(); - return this.ace.positionToIndex(pos); - }, - setCaretPos: function(index){ - var pos = this.ace.indexToPosition(index); - this.ace.selection.moveToPosition(pos); - }, - getCurrentLine: function() { - var row = this.ace.getCursorPosition().row; - return this.ace.session.getLine(row); - }, - replaceContent: function(value, start, end, noIndent) { - if (end == null) - end = start == null ? this.getContent().length : start; - if (start == null) - start = 0; - - var editor = this.ace; - var range = Range.fromPoints(editor.indexToPosition(start), editor.indexToPosition(end)); - editor.session.remove(range); - - range.end = range.start; - - value = this.$updateTabstops(value); - snippetManager.insertSnippet(editor, value) - }, - getContent: function(){ - return this.ace.getValue(); - }, - getSyntax: function() { - if (this.$syntax) - return this.$syntax; - var syntax = this.ace.session.$modeId.split("/").pop(); - if (syntax == "html" || syntax == "php") { - var cursor = this.ace.getCursorPosition(); - var state = this.ace.session.getState(cursor.row); - if (typeof state != "string") - state = state[0]; - if (state) { - state = state.split("-"); - if (state.length > 1) - syntax = state[0]; - else if (syntax == "php") - syntax = "html"; - } - } - return syntax; - }, - getProfileName: function() { - switch(this.getSyntax()) { - case "css": return "css"; - case "xml": - case "xsl": - return "xml"; - case "html": - var profile = emmet.require("resources").getVariable("profile"); - if (!profile) - profile = this.ace.session.getLines(0,2).join("").search(/]+XHTML/i) != -1 ? "xhtml": "html"; - return profile; - } - return "xhtml"; - }, - prompt: function(title) { - return prompt(title); - }, - getSelection: function() { - return this.ace.session.getTextRange(); - }, - getFilePath: function() { - return ""; - }, - $updateTabstops: function(value) { - var base = 1000; - var zeroBase = 0; - var lastZero = null; - var range = emmet.require('range'); - var ts = emmet.require('tabStops'); - var settings = emmet.require('resources').getVocabulary("user"); - var tabstopOptions = { - tabstop: function(data) { - var group = parseInt(data.group, 10); - var isZero = group === 0; - if (isZero) - group = ++zeroBase; - else - group += base; - - var placeholder = data.placeholder; - if (placeholder) { - placeholder = ts.processText(placeholder, tabstopOptions); - } - - var result = '${' + group + (placeholder ? ':' + placeholder : '') + '}'; - - if (isZero) { - lastZero = range.create(data.start, result); - } - - return result - }, - escape: function(ch) { - if (ch == '$') return '\\$'; - if (ch == '\\') return '\\\\'; - return ch; - } - }; - - value = ts.processText(value, tabstopOptions); - - if (settings.variables['insert_final_tabstop'] && !/\$\{0\}$/.test(value)) { - value += '${0}'; - } else if (lastZero) { - value = emmet.require('utils').replaceSubstring(value, '${0}', lastZero); - } - - return value; - } -}; - - -var keymap = { - expand_abbreviation: {"mac": "ctrl+alt+e", "win": "alt+e"}, - match_pair_outward: {"mac": "ctrl+d", "win": "ctrl+,"}, - match_pair_inward: {"mac": "ctrl+j", "win": "ctrl+shift+0"}, - matching_pair: {"mac": "ctrl+alt+j", "win": "alt+j"}, - next_edit_point: "alt+right", - prev_edit_point: "alt+left", - toggle_comment: {"mac": "command+/", "win": "ctrl+/"}, - split_join_tag: {"mac": "shift+command+'", "win": "shift+ctrl+`"}, - remove_tag: {"mac": "command+'", "win": "shift+ctrl+;"}, - evaluate_math_expression: {"mac": "shift+command+y", "win": "shift+ctrl+y"}, - increment_number_by_1: "ctrl+up", - decrement_number_by_1: "ctrl+down", - increment_number_by_01: "alt+up", - decrement_number_by_01: "alt+down", - increment_number_by_10: {"mac": "alt+command+up", "win": "shift+alt+up"}, - decrement_number_by_10: {"mac": "alt+command+down", "win": "shift+alt+down"}, - select_next_item: {"mac": "shift+command+.", "win": "shift+ctrl+."}, - select_previous_item: {"mac": "shift+command+,", "win": "shift+ctrl+,"}, - reflect_css_value: {"mac": "shift+command+r", "win": "shift+ctrl+r"}, - - encode_decode_data_url: {"mac": "shift+ctrl+d", "win": "ctrl+'"}, - expand_abbreviation_with_tab: "Tab", - wrap_with_abbreviation: {"mac": "shift+ctrl+a", "win": "shift+ctrl+a"} -}; - -var editorProxy = new AceEmmetEditor(); -exports.commands = new HashHandler(); -exports.runEmmetCommand = function(editor) { - editorProxy.setupContext(editor); - if (editorProxy.getSyntax() == "php") - return false; - var actions = emmet.require("actions"); - - if (this.action == "expand_abbreviation_with_tab") { - if (!editor.selection.isEmpty()) - return false; - } - - if (this.action == "wrap_with_abbreviation") { - return setTimeout(function() { - actions.run("wrap_with_abbreviation", editorProxy); - }, 0); - } - - try { - var result = actions.run(this.action, editorProxy); - } catch(e) { - editor._signal("changeStatus", typeof e == "string" ? e : e.message); - console.log(e); - } - return result; -}; - -for (var command in keymap) { - exports.commands.addCommand({ - name: "emmet:" + command, - action: command, - bindKey: keymap[command], - exec: exports.runEmmetCommand, - multiSelectAction: "forEach" - }); -} - -var onChangeMode = function(e, target) { - var editor = target; - if (!editor) - return; - var modeId = editor.session.$modeId; - var enabled = modeId && /css|less|scss|sass|stylus|html|php/.test(modeId); - if (e.enableEmmet === false) - enabled = false; - if (enabled) - editor.keyBinding.addKeyboardHandler(exports.commands); - else - editor.keyBinding.removeKeyboardHandler(exports.commands); -}; - - -exports.AceEmmetEditor = AceEmmetEditor; -require("ace/config").defineOptions(Editor.prototype, "editor", { - enableEmmet: { - set: function(val) { - this[val ? "on" : "removeListener"]("changeMode", onChangeMode); - onChangeMode({enableEmmet: !!val}, this); - }, - value: true - } -}); - - -exports.setCore = function(e) {emmet = e;}; -}); - -ace.define('ace/snippets', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/range', 'ace/keyboard/hash_handler', 'ace/tokenizer', 'ace/lib/dom'], function(require, exports, module) { - -var lang = require("./lib/lang") -var Range = require("./range").Range -var HashHandler = require("./keyboard/hash_handler").HashHandler; -var Tokenizer = require("./tokenizer").Tokenizer; -var comparePoints = Range.comparePoints; - -var SnippetManager = function() { - this.snippetMap = {}; - this.snippetNameMap = {}; -}; - -(function() { - this.getTokenizer = function() { - function TabstopToken(str, _, stack) { - str = str.substr(1); - if (/^\d+$/.test(str) && !stack.inFormatString) - return [{tabstopId: parseInt(str, 10)}]; - return [{text: str}] - } - function escape(ch) { - return "(?:[^\\\\" + ch + "]|\\\\.)"; - } - SnippetManager.$tokenizer = new Tokenizer({ - start: [ - {regex: /:/, onMatch: function(val, state, stack) { - if (stack.length && stack[0].expectIf) { - stack[0].expectIf = false; - stack[0].elseBranch = stack[0]; - return [stack[0]]; - } - return ":"; - }}, - {regex: /\\./, onMatch: function(val, state, stack) { - var ch = val[1]; - if (ch == "}" && stack.length) { - val = ch; - }else if ("`$\\".indexOf(ch) != -1) { - val = ch; - } else if (stack.inFormatString) { - if (ch == "n") - val = "\n"; - else if (ch == "t") - val = "\n"; - else if ("ulULE".indexOf(ch) != -1) { - val = {changeCase: ch, local: ch > "a"}; - } - } - - return [val]; - }}, - {regex: /}/, onMatch: function(val, state, stack) { - return [stack.length ? stack.shift() : val]; - }}, - {regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken}, - {regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(str, state, stack) { - var t = TabstopToken(str.substr(1), state, stack); - stack.unshift(t[0]); - return t; - }, next: "snippetVar"}, - {regex: /\n/, token: "newline", merge: false} - ], - snippetVar: [ - {regex: "\\|" + escape("\\|") + "*\\|", onMatch: function(val, state, stack) { - stack[0].choices = val.slice(1, -1).split(","); - }, next: "start"}, - {regex: "/(" + escape("/") + "+)/(?:(" + escape("/") + "*)/)(\\w*):?", - onMatch: function(val, state, stack) { - var ts = stack[0]; - ts.fmtString = val; - - val = this.splitRegex.exec(val); - ts.guard = val[1]; - ts.fmt = val[2]; - ts.flag = val[3]; - return ""; - }, next: "start"}, - {regex: "`" + escape("`") + "*`", onMatch: function(val, state, stack) { - stack[0].code = val.splice(1, -1); - return ""; - }, next: "start"}, - {regex: "\\?", onMatch: function(val, state, stack) { - if (stack[0]) - stack[0].expectIf = true; - }, next: "start"}, - {regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start"} - ], - formatString: [ - {regex: "/(" + escape("/") + "+)/", token: "regex"}, - {regex: "", onMatch: function(val, state, stack) { - stack.inFormatString = true; - }, next: "start"} - ] - }); - SnippetManager.prototype.getTokenizer = function() { - return SnippetManager.$tokenizer; - } - return SnippetManager.$tokenizer; - }; - - this.tokenizeTmSnippet = function(str, startState) { - return this.getTokenizer().getLineTokens(str, startState).tokens.map(function(x) { - return x.value || x; - }); - }; - - this.$getDefaultValue = function(editor, name) { - if (/^[A-Z]\d+$/.test(name)) { - var i = name.substr(1); - return (this.variables[name[0] + "__"] || {})[i]; - } - if (/^\d+$/.test(name)) { - return (this.variables.__ || {})[name]; - } - name = name.replace(/^TM_/, ""); - - if (!editor) - return; - var s = editor.session; - switch(name) { - case "CURRENT_WORD": - var r = s.getWordRange(); - case "SELECTION": - case "SELECTED_TEXT": - return s.getTextRange(r); - case "CURRENT_LINE": - return s.getLine(editor.getCursorPosition().row); - case "PREV_LINE": // not possible in textmate - return s.getLine(editor.getCursorPosition().row - 1); - case "LINE_INDEX": - return editor.getCursorPosition().column; - case "LINE_NUMBER": - return editor.getCursorPosition().row + 1; - case "SOFT_TABS": - return s.getUseSoftTabs() ? "YES" : "NO"; - case "TAB_SIZE": - return s.getTabSize(); - case "FILENAME": - case "FILEPATH": - return ""; - case "FULLNAME": - return "Ace"; - } - }; - this.variables = {}; - this.getVariableValue = function(editor, varName) { - if (this.variables.hasOwnProperty(varName)) - return this.variables[varName](editor, varName) || ""; - return this.$getDefaultValue(editor, varName) || ""; - }; - this.tmStrFormat = function(str, ch, editor) { - var flag = ch.flag || ""; - var re = ch.guard; - re = new RegExp(re, flag.replace(/[^gi]/, "")); - var fmtTokens = this.tokenizeTmSnippet(ch.fmt, "formatString"); - var _self = this; - var formatted = str.replace(re, function() { - _self.variables.__ = arguments; - var fmtParts = _self.resolveVariables(fmtTokens, editor); - var gChangeCase = "E"; - for (var i = 0; i < fmtParts.length; i++) { - var ch = fmtParts[i]; - if (typeof ch == "object") { - fmtParts[i] = ""; - if (ch.changeCase && ch.local) { - var next = fmtParts[i + 1]; - if (next && typeof next == "string") { - if (ch.changeCase == "u") - fmtParts[i] = next[0].toUpperCase(); - else - fmtParts[i] = next[0].toLowerCase(); - fmtParts[i + 1] = next.substr(1); - } - } else if (ch.changeCase) { - gChangeCase = ch.changeCase; - } - } else if (gChangeCase == "U") { - fmtParts[i] = ch.toUpperCase(); - } else if (gChangeCase == "L") { - fmtParts[i] = ch.toLowerCase(); - } - } - return fmtParts.join(""); - }); - this.variables.__ = null; - return formatted; - }; - - this.resolveVariables = function(snippet, editor) { - var result = []; - for (var i = 0; i < snippet.length; i++) { - var ch = snippet[i]; - if (typeof ch == "string") { - result.push(ch); - } else if (typeof ch != "object") { - continue; - } else if (ch.skip) { - gotoNext(ch); - } else if (ch.processed < i) { - continue; - } else if (ch.text) { - var value = this.getVariableValue(editor, ch.text); - if (value && ch.fmtString) - value = this.tmStrFormat(value, ch); - ch.processed = i; - if (ch.expectIf == null) { - if (value) { - result.push(value); - gotoNext(ch); - } - } else { - if (value) { - ch.skip = ch.elseBranch; - } else - gotoNext(ch); - } - } else if (ch.tabstopId != null) { - result.push(ch); - } else if (ch.changeCase != null) { - result.push(ch); - } - } - function gotoNext(ch) { - var i1 = snippet.indexOf(ch, i + 1); - if (i1 != -1) - i = i1; - } - return result; - }; - - this.insertSnippet = function(editor, snippetText) { - var cursor = editor.getCursorPosition(); - var line = editor.session.getLine(cursor.row); - var indentString = line.match(/^\s*/)[0]; - var tabString = editor.session.getTabString(); - - var tokens = this.tokenizeTmSnippet(snippetText); - tokens = this.resolveVariables(tokens, editor); - tokens = tokens.map(function(x) { - if (x == "\n") - return x + indentString; - if (typeof x == "string") - return x.replace(/\t/g, tabString); - return x; - }); - var tabstops = []; - tokens.forEach(function(p, i) { - if (typeof p != "object") - return; - var id = p.tabstopId; - var ts = tabstops[id]; - if (!ts) { - ts = tabstops[id] = []; - ts.index = id; - ts.value = ""; - } - if (ts.indexOf(p) !== -1) - return; - ts.push(p); - var i1 = tokens.indexOf(p, i + 1); - if (i1 === -1) - return; - - var value = tokens.slice(i + 1, i1); - var isNested = value.some(function(t) {return typeof t === "object"}); - if (isNested && !ts.value) { - ts.value = value; - } else if (value.length && (!ts.value || typeof ts.value !== "string")) { - ts.value = value.join(""); - } - }); - tabstops.forEach(function(ts) {ts.length = 0}); - var expanding = {}; - function copyValue(val) { - var copy = [] - for (var i = 0; i < val.length; i++) { - var p = val[i]; - if (typeof p == "object") { - if (expanding[p.tabstopId]) - continue; - var j = val.lastIndexOf(p, i - 1); - p = copy[j] || {tabstopId: p.tabstopId}; - } - copy[i] = p; - } - return copy; - } - for (var i = 0; i < tokens.length; i++) { - var p = tokens[i]; - if (typeof p != "object") - continue; - var id = p.tabstopId; - var i1 = tokens.indexOf(p, i + 1); - if (expanding[id]) { - if (expanding[id] === p) - expanding[id] = null; - continue; - } - - var ts = tabstops[id]; - var arg = typeof ts.value == "string" ? [ts.value] : copyValue(ts.value); - arg.unshift(i + 1, Math.max(0, i1 - i)); - arg.push(p); - expanding[id] = p; - tokens.splice.apply(tokens, arg); - - if (ts.indexOf(p) === -1) - ts.push(p); - }; - var row = 0, column = 0; - var text = ""; - tokens.forEach(function(t) { - if (typeof t === "string") { - if (t[0] === "\n"){ - column = t.length - 1; - row ++; - } else - column += t.length; - text += t; - } else { - if (!t.start) - t.start = {row: row, column: column}; - else - t.end = {row: row, column: column}; - } - }); - var range = editor.getSelectionRange(); - var end = editor.session.replace(range, text); - - var tabstopManager = new TabstopManager(editor); - tabstopManager.addTabstops(tabstops, range.start, end); - tabstopManager.tabNext(); - }; - - this.$getScope = function(editor) { - var scope = editor.session.$mode.$id || ""; - scope = scope.split("/").pop(); - if (scope === "html" || scope === "php") { - if (scope === "php") - scope = "html"; - var c = editor.getCursorPosition() - var state = editor.session.getState(c.row); - if (typeof state === "object") { - state = state[0]; - } - if (state.substring) { - if (state.substring(0, 3) == "js-") - scope = "javascript"; - else if (state.substring(0, 4) == "css-") - scope = "css"; - else if (state.substring(0, 4) == "php-") - scope = "php"; - } - } - - return scope; - }; - - this.getActiveScopes = function(editor) { - var scope = this.$getScope(editor); - var scopes = [scope]; - var snippetMap = this.snippetMap; - if (snippetMap[scope] && snippetMap[scope].includeScopes) { - scopes.push.apply(scopes, snippetMap[scope].includeScopes); - } - scopes.push("_"); - return scopes; - }; - - this.expandWithTab = function(editor) { - var cursor = editor.getCursorPosition(); - var line = editor.session.getLine(cursor.row); - var before = line.substring(0, cursor.column); - var after = line.substr(cursor.column); - - var snippetMap = this.snippetMap; - var snippet; - this.getActiveScopes(editor).some(function(scope) { - var snippets = snippetMap[scope]; - if (snippets) - snippet = this.findMatchingSnippet(snippets, before, after); - return !!snippet; - }, this); - if (!snippet) - return false; - - editor.session.doc.removeInLine(cursor.row, - cursor.column - snippet.replaceBefore.length, - cursor.column + snippet.replaceAfter.length - ); - - this.variables.M__ = snippet.matchBefore; - this.variables.T__ = snippet.matchAfter; - this.insertSnippet(editor, snippet.content); - - this.variables.M__ = this.variables.T__ = null; - return true; - }; - - this.findMatchingSnippet = function(snippetList, before, after) { - for (var i = snippetList.length; i--;) { - var s = snippetList[i]; - if (s.startRe && !s.startRe.test(before)) - continue; - if (s.endRe && !s.endRe.test(after)) - continue; - if (!s.startRe && !s.endRe) - continue; - - s.matchBefore = s.startRe ? s.startRe.exec(before) : [""]; - s.matchAfter = s.endRe ? s.endRe.exec(after) : [""]; - s.replaceBefore = s.triggerRe ? s.triggerRe.exec(before)[0] : ""; - s.replaceAfter = s.endTriggerRe ? s.endTriggerRe.exec(after)[0] : ""; - return s; - } - }; - - this.snippetMap = {}; - this.snippetNameMap = {}; - this.register = function(snippets, scope) { - var snippetMap = this.snippetMap; - var snippetNameMap = this.snippetNameMap; - var self = this; - function wrapRegexp(src) { - if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src)) - src = "(?:" + src + ")" - - return src || ""; - } - function guardedRegexp(re, guard, opening) { - re = wrapRegexp(re); - guard = wrapRegexp(guard); - if (opening) { - re = guard + re; - if (re && re[re.length - 1] != "$") - re = re + "$"; - } else { - re = re + guard; - if (re && re[0] != "^") - re = "^" + re; - } - return new RegExp(re); - } - - function addSnippet(s) { - if (!s.scope) - s.scope = scope || "_"; - scope = s.scope - if (!snippetMap[scope]) { - snippetMap[scope] = []; - snippetNameMap[scope] = {}; - } - - var map = snippetNameMap[scope]; - if (s.name) { - var old = map[s.name]; - if (old) - self.unregister(old); - map[s.name] = s; - } - snippetMap[scope].push(s); - - if (s.tabTrigger && !s.trigger) { - if (!s.guard && /^\w/.test(s.tabTrigger)) - s.guard = "\\b"; - s.trigger = lang.escapeRegExp(s.tabTrigger); - } - - s.startRe = guardedRegexp(s.trigger, s.guard, true); - s.triggerRe = new RegExp(s.trigger, "", true); - - s.endRe = guardedRegexp(s.endTrigger, s.endGuard, true); - s.endTriggerRe = new RegExp(s.endTrigger, "", true); - }; - - if (snippets.content) - addSnippet(snippets); - else if (Array.isArray(snippets)) - snippets.forEach(addSnippet); - }; - this.unregister = function(snippets, scope) { - var snippetMap = this.snippetMap; - var snippetNameMap = this.snippetNameMap; - - function removeSnippet(s) { - var nameMap = snippetNameMap[s.scope||scope]; - if (nameMap && nameMap[s.name]) { - delete nameMap[s.name]; - var map = snippetMap[s.scope||scope]; - var i = map && map.indexOf(s); - if (i >= 0) - map.splice(i, 1); - } - } - if (snippets.content) - removeSnippet(snippets); - else if (Array.isArray(snippets)) - snippets.forEach(removeSnippet); - }; - this.parseSnippetFile = function(str) { - str = str.replace(/\r/g, ""); - var list = [], snippet = {}; - var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm; - var m; - while (m = re.exec(str)) { - if (m[1]) { - try { - snippet = JSON.parse(m[1]) - list.push(snippet); - } catch (e) {} - } if (m[4]) { - snippet.content = m[4].replace(/^\t/gm, ""); - list.push(snippet); - snippet = {}; - } else { - var key = m[2], val = m[3]; - if (key == "regex") { - var guardRe = /\/((?:[^\/\\]|\\.)*)|$/g; - snippet.guard = guardRe.exec(val)[1]; - snippet.trigger = guardRe.exec(val)[1]; - snippet.endTrigger = guardRe.exec(val)[1]; - snippet.endGuard = guardRe.exec(val)[1]; - } else if (key == "snippet") { - snippet.tabTrigger = val.match(/^\S*/)[0]; - if (!snippet.name) - snippet.name = val; - } else { - snippet[key] = val; - } - } - } - return list; - }; - this.getSnippetByName = function(name, editor) { - var snippetMap = this.snippetNameMap; - var snippet; - this.getActiveScopes(editor).some(function(scope) { - var snippets = snippetMap[scope]; - if (snippets) - snippet = snippets[name]; - return !!snippet; - }, this); - return snippet; - }; - -}).call(SnippetManager.prototype); - - -var TabstopManager = function(editor) { - if (editor.tabstopManager) - return editor.tabstopManager; - editor.tabstopManager = this; - this.$onChange = this.onChange.bind(this); - this.$onChangeSelection = lang.delayedCall(this.onChangeSelection.bind(this)).schedule; - this.$onChangeSession = this.onChangeSession.bind(this); - this.$onAfterExec = this.onAfterExec.bind(this); - this.attach(editor); -}; -(function() { - this.attach = function(editor) { - this.index = -1; - this.ranges = []; - this.tabstops = []; - this.selectedTabstop = null; - - this.editor = editor; - this.editor.on("change", this.$onChange); - this.editor.on("changeSelection", this.$onChangeSelection); - this.editor.on("changeSession", this.$onChangeSession); - this.editor.commands.on("afterExec", this.$onAfterExec); - this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); - }; - this.detach = function() { - this.tabstops.forEach(this.removeTabstopMarkers, this); - this.ranges = null; - this.tabstops = null; - this.selectedTabstop = null; - this.editor.removeListener("change", this.$onChange); - this.editor.removeListener("changeSelection", this.$onChangeSelection); - this.editor.removeListener("changeSession", this.$onChangeSession); - this.editor.commands.removeListener("afterExec", this.$onAfterExec); - this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); - this.editor.tabstopManager = null; - this.editor = null; - }; - - this.onChange = function(e) { - var changeRange = e.data.range; - var isRemove = e.data.action[0] == "r"; - var start = changeRange.start; - var end = changeRange.end; - var startRow = start.row; - var endRow = end.row; - var lineDif = endRow - startRow; - var colDiff = end.column - start.column; - - if (isRemove) { - lineDif = -lineDif; - colDiff = -colDiff; - } - if (!this.$inChange && isRemove) { - var ts = this.selectedTabstop; - var changedOutside = !ts.some(function(r) { - return comparePoints(r.start, start) <= 0 && comparePoints(r.end, end) >= 0; - }); - if (changedOutside) - return this.detach(); - } - var ranges = this.ranges; - for (var i = 0; i < ranges.length; i++) { - var r = ranges[i]; - if (r.end.row < start.row) - continue; - - if (comparePoints(start, r.start) < 0 && comparePoints(end, r.end) > 0) { - this.removeRange(r); - i--; - continue; - } - - if (r.start.row == startRow && r.start.column > start.column) - r.start.column += colDiff; - if (r.end.row == startRow && r.end.column >= start.column) - r.end.column += colDiff; - if (r.start.row >= startRow) - r.start.row += lineDif; - if (r.end.row >= startRow) - r.end.row += lineDif; - - if (comparePoints(r.start, r.end) > 0) - this.removeRange(r); - } - if (!ranges.length) - this.detach(); - }; - this.updateLinkedFields = function() { - var ts = this.selectedTabstop; - if (!ts.hasLinkedRanges) - return; - this.$inChange = true; - var session = this.editor.session; - var text = session.getTextRange(ts.firstNonLinked); - for (var i = ts.length; i--;) { - var range = ts[i]; - if (!range.linked) - continue; - var fmt = exports.snippetManager.tmStrFormat(text, range.original) - session.replace(range, fmt); - } - this.$inChange = false; - }; - this.onAfterExec = function(e) { - if (e.command && !e.command.readOnly) - this.updateLinkedFields(); - }; - this.onChangeSelection = function() { - if (!this.editor) - return - var lead = this.editor.selection.lead; - var anchor = this.editor.selection.anchor; - var isEmpty = this.editor.selection.isEmpty(); - for (var i = this.ranges.length; i--;) { - if (this.ranges[i].linked) - continue; - var containsLead = this.ranges[i].contains(lead.row, lead.column); - var containsAnchor = isEmpty || this.ranges[i].contains(anchor.row, anchor.column); - if (containsLead && containsAnchor) - return; - } - this.detach(); - }; - this.onChangeSession = function() { - this.detach(); - }; - this.tabNext = function(dir) { - var max = this.tabstops.length - 1; - var index = this.index + (dir || 1); - index = Math.min(Math.max(index, 0), max); - this.selectTabstop(index); - if (index == max) - this.detach(); - }; - this.selectTabstop = function(index) { - var ts = this.tabstops[this.index]; - if (ts) - this.addTabstopMarkers(ts); - this.index = index; - ts = this.tabstops[this.index]; - if (!ts || !ts.length) - return; - - this.selectedTabstop = ts; - if (!this.editor.inVirtualSelectionMode) { - var sel = this.editor.multiSelect; - sel.toSingleRange(ts.firstNonLinked.clone()); - for (var i = ts.length; i--;) { - if (ts.hasLinkedRanges && ts[i].linked) - continue; - sel.addRange(ts[i].clone(), true); - } - } else { - this.editor.selection.setRange(ts.firstNonLinked); - } - - this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); - }; - this.addTabstops = function(tabstops, start, end) { - if (!tabstops[0]) { - var p = Range.fromPoints(end, end); - moveRelative(p.start, start); - moveRelative(p.end, start); - tabstops[0] = [p]; - tabstops[0].index = 0; - } - - var i = this.index; - var arg = [i, 0]; - var ranges = this.ranges; - var editor = this.editor; - tabstops.forEach(function(ts) { - for (var i = ts.length; i--;) { - var p = ts[i]; - var range = Range.fromPoints(p.start, p.end || p.start); - movePoint(range.start, start); - movePoint(range.end, start); - range.original = p; - range.tabstop = ts; - ranges.push(range); - ts[i] = range; - if (p.fmtString) { - range.linked = true; - ts.hasLinkedRanges = true; - } else if (!ts.firstNonLinked) - ts.firstNonLinked = range; - } - if (!ts.firstNonLinked) - ts.hasLinkedRanges = false; - arg.push(ts); - this.addTabstopMarkers(ts); - }, this); - arg.push(arg.splice(2, 1)[0]); - this.tabstops.splice.apply(this.tabstops, arg); - }; - - this.addTabstopMarkers = function(ts) { - var session = this.editor.session; - ts.forEach(function(range) { - if (!range.markerId) - range.markerId = session.addMarker(range, "ace_snippet-marker", "text"); - }); - }; - this.removeTabstopMarkers = function(ts) { - var session = this.editor.session; - ts.forEach(function(range) { - session.removeMarker(range.markerId); - range.markerId = null; - }); - }; - this.removeRange = function(range) { - var i = range.tabstop.indexOf(range); - range.tabstop.splice(i, 1); - i = this.ranges.indexOf(range); - this.ranges.splice(i, 1); - this.editor.session.removeMarker(range.markerId); - }; - - this.keyboardHandler = new HashHandler(); - this.keyboardHandler.bindKeys({ - "Tab": function(ed) { - if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) { - return; - } - - ed.tabstopManager.tabNext(1); - }, - "Shift-Tab": function(ed) { - ed.tabstopManager.tabNext(-1); - }, - "Esc": function(ed) { - ed.tabstopManager.detach(); - }, - "Return": function(ed) { - return false; - } - }); -}).call(TabstopManager.prototype); - - -var movePoint = function(point, diff) { - if (point.row == 0) - point.column += diff.column; - point.row += diff.row; -}; - -var moveRelative = function(point, start) { - if (point.row == start.row) - point.column -= start.column; - point.row -= start.row; -}; - - -require("./lib/dom").importCssString("\ -.ace_snippet-marker {\ - -moz-box-sizing: border-box;\ - box-sizing: border-box;\ - background: rgba(194, 193, 208, 0.09);\ - border: 1px dotted rgba(211, 208, 235, 0.62);\ - position: absolute;\ -}"); - -exports.snippetManager = new SnippetManager(); - - -}); -; - (function() { - ace.require(["ace/ext/emmet"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-error_marker.js b/util/build-sample-browser/player/vendor/ace/ext-error_marker.js deleted file mode 100644 index dfefa20ab8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-error_marker.js +++ /dev/null @@ -1,5 +0,0 @@ -; - (function() { - ace.require(["ace/ext/error_marker"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-keybinding_menu.js b/util/build-sample-browser/player/vendor/ace/ext-keybinding_menu.js deleted file mode 100644 index d81db01855..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-keybinding_menu.js +++ /dev/null @@ -1,211 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/keybinding_menu', ['require', 'exports', 'module' , 'ace/editor', 'ace/ext/menu_tools/overlay_page', 'ace/ext/menu_tools/get_editor_keyboard_shortcuts'], function(require, exports, module) { - - var Editor = require("ace/editor").Editor; - function showKeyboardShortcuts (editor) { - if(!document.getElementById('kbshortcutmenu')) { - var overlayPage = require('./menu_tools/overlay_page').overlayPage; - var getEditorKeybordShortcuts = require('./menu_tools/get_editor_keyboard_shortcuts').getEditorKeybordShortcuts; - var kb = getEditorKeybordShortcuts(editor); - var el = document.createElement('div'); - var commands = kb.reduce(function(previous, current) { - return previous + '
    ' - + current.command + ' : ' - + '' + current.key + '
    '; - }, ''); - - el.id = 'kbshortcutmenu'; - el.innerHTML = '

    Keyboard Shortcuts

    ' + commands + '
    '; - overlayPage(editor, el, '0', '0', '0', null); - } - }; - module.exports.init = function(editor) { - Editor.prototype.showKeyboardShortcuts = function() { - showKeyboardShortcuts(this); - }; - editor.commands.addCommands([{ - name: "showKeyboardShortcuts", - bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"}, - exec: function(editor, line) { - editor.showKeyboardShortcuts(); - } - }]); - }; - -}); - -ace.define('ace/ext/menu_tools/overlay_page', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -var dom = require("../../lib/dom"); -var cssText = "#ace_settingsmenu, #kbshortcutmenu {\ -background-color: #F7F7F7;\ -color: black;\ -box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\ -padding: 1em 0.5em 2em 1em;\ -overflow: auto;\ -position: absolute;\ -margin: 0;\ -bottom: 0;\ -right: 0;\ -top: 0;\ -z-index: 9991;\ -cursor: default;\ -}\ -.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\ -box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\ -background-color: rgba(255, 255, 255, 0.6);\ -color: black;\ -}\ -.ace_optionsMenuEntry:hover {\ -background-color: rgba(100, 100, 100, 0.1);\ --webkit-transition: all 0.5s;\ -transition: all 0.3s\ -}\ -.ace_closeButton {\ -background: rgba(245, 146, 146, 0.5);\ -border: 1px solid #F48A8A;\ -border-radius: 50%;\ -padding: 7px;\ -position: absolute;\ -right: -8px;\ -top: -8px;\ -z-index: 1000;\ -}\ -.ace_closeButton{\ -background: rgba(245, 146, 146, 0.9);\ -}\ -.ace_optionsMenuKey {\ -color: darkslateblue;\ -font-weight: bold;\ -}\ -.ace_optionsMenuCommand {\ -color: darkcyan;\ -font-weight: normal;\ -}"; -dom.importCssString(cssText); -module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) { - top = top ? 'top: ' + top + ';' : ''; - bottom = bottom ? 'bottom: ' + bottom + ';' : ''; - right = right ? 'right: ' + right + ';' : ''; - left = left ? 'left: ' + left + ';' : ''; - - var closer = document.createElement('div'); - var contentContainer = document.createElement('div'); - - function documentEscListener(e) { - if (e.keyCode === 27) { - closer.click(); - } - } - - closer.style.cssText = 'margin: 0; padding: 0; ' + - 'position: fixed; top:0; bottom:0; left:0; right:0;' + - 'z-index: 9990; ' + - 'background-color: rgba(0, 0, 0, 0.3);'; - closer.addEventListener('click', function() { - document.removeEventListener('keydown', documentEscListener); - closer.parentNode.removeChild(closer); - editor.focus(); - closer = null; - }); - document.addEventListener('keydown', documentEscListener); - - contentContainer.style.cssText = top + right + bottom + left; - contentContainer.addEventListener('click', function(e) { - e.stopPropagation(); - }); - - var wrapper = dom.createElement("div"); - wrapper.style.position = "relative"; - - var closeButton = dom.createElement("div"); - closeButton.className = "ace_closeButton"; - closeButton.addEventListener('click', function() { - closer.click(); - }); - - wrapper.appendChild(closeButton); - contentContainer.appendChild(wrapper); - - contentContainer.appendChild(contentElement); - closer.appendChild(contentContainer); - document.body.appendChild(closer); - editor.blur(); -}; - -}); - -ace.define('ace/ext/menu_tools/get_editor_keyboard_shortcuts', ['require', 'exports', 'module' , 'ace/lib/keys'], function(require, exports, module) { - -var keys = require("../../lib/keys"); -module.exports.getEditorKeybordShortcuts = function(editor) { - var KEY_MODS = keys.KEY_MODS; - var keybindings = []; - var commandMap = {}; - editor.keyBinding.$handlers.forEach(function(handler) { - var ckb = handler.commandKeyBinding; - for (var i in ckb) { - var modifier = parseInt(i); - if (modifier == -1) { - modifier = ""; - } else if(isNaN(modifier)) { - modifier = i; - } else { - modifier = "" + - (modifier & KEY_MODS.command ? "Cmd-" : "") + - (modifier & KEY_MODS.ctrl ? "Ctrl-" : "") + - (modifier & KEY_MODS.alt ? "Alt-" : "") + - (modifier & KEY_MODS.shift ? "Shift-" : ""); - } - for (var key in ckb[i]) { - var command = ckb[i][key] - if (typeof command != "string") - command = command.name - if (commandMap[command]) { - commandMap[command].key += "|" + modifier + key; - } else { - commandMap[command] = {key: modifier+key, command: command}; - keybindings.push(commandMap[command]); - } - } - } - }); - return keybindings; -}; - -});; - (function() { - ace.require(["ace/ext/keybinding_menu"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-language_tools.js b/util/build-sample-browser/player/vendor/ace/ext-language_tools.js deleted file mode 100644 index ffafc7ada3..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-language_tools.js +++ /dev/null @@ -1,1669 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/language_tools', ['require', 'exports', 'module' , 'ace/snippets', 'ace/autocomplete', 'ace/config', 'ace/autocomplete/text_completer', 'ace/editor'], function(require, exports, module) { - - -var snippetManager = require("../snippets").snippetManager; -var Autocomplete = require("../autocomplete").Autocomplete; -var config = require("../config"); - -var textCompleter = require("../autocomplete/text_completer"); -var keyWordCompleter = { - getCompletions: function(editor, session, pos, prefix, callback) { - var state = editor.session.getState(pos.row); - var completions = session.$mode.getCompletions(state, session, pos, prefix); - callback(null, completions); - } -}; - -var snippetCompleter = { - getCompletions: function(editor, session, pos, prefix, callback) { - var snippetMap = snippetManager.snippetMap; - var completions = []; - snippetManager.getActiveScopes(editor).forEach(function(scope) { - var snippets = snippetMap[scope] || []; - for (var i = snippets.length; i--;) { - var s = snippets[i]; - var caption = s.name || s.tabTrigger; - if (!caption) - continue; - completions.push({ - caption: caption, - snippet: s.content, - meta: s.tabTrigger && !s.name ? s.tabTrigger + "\u21E5 " : "snippet" - }); - } - }, this); - callback(null, completions); - } -}; - -var completers = [snippetCompleter, textCompleter, keyWordCompleter]; -exports.addCompleter = function(completer) { - completers.push(completer); -}; - -var expandSnippet = { - name: "expandSnippet", - exec: function(editor) { - var success = snippetManager.expandWithTab(editor); - if (!success) - editor.execCommand("indent"); - }, - bindKey: "tab" -}; - -var onChangeMode = function(e, editor) { - loadSnippetsForMode(editor.session.$mode); -}; - -var loadSnippetsForMode = function(mode) { - var id = mode.$id; - if (!snippetManager.files) - snippetManager.files = {}; - loadSnippetFile(id); - if (mode.modes) - mode.modes.forEach(loadSnippetsForMode); -}; - -var loadSnippetFile = function(id) { - if (!id || snippetManager.files[id]) - return; - var snippetFilePath = id.replace("mode", "snippets"); - snippetManager.files[id] = {}; - config.loadModule(snippetFilePath, function(m) { - if (m) { - snippetManager.files[id] = m; - m.snippets = snippetManager.parseSnippetFile(m.snippetText); - snippetManager.register(m.snippets, m.scope); - if (m.includeScopes) { - snippetManager.snippetMap[m.scope].includeScopes = m.includeScopes; - m.includeScopes.forEach(function(x) { - loadSnippetFile("ace/mode/" + x); - }); - } - } - }); -}; - -var Editor = require("../editor").Editor; -require("../config").defineOptions(Editor.prototype, "editor", { - enableBasicAutocompletion: { - set: function(val) { - if (val) { - this.completers = completers; - this.commands.addCommand(Autocomplete.startCommand); - } else { - this.commands.removeCommand(Autocomplete.startCommand); - } - }, - value: false - }, - enableSnippets: { - set: function(val) { - if (val) { - this.commands.addCommand(expandSnippet); - this.on("changeMode", onChangeMode); - onChangeMode(null, this); - } else { - this.commands.removeCommand(expandSnippet); - this.off("changeMode", onChangeMode); - } - }, - value: false - } -}); - -}); - -ace.define('ace/snippets', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/range', 'ace/keyboard/hash_handler', 'ace/tokenizer', 'ace/lib/dom'], function(require, exports, module) { - -var lang = require("./lib/lang") -var Range = require("./range").Range -var HashHandler = require("./keyboard/hash_handler").HashHandler; -var Tokenizer = require("./tokenizer").Tokenizer; -var comparePoints = Range.comparePoints; - -var SnippetManager = function() { - this.snippetMap = {}; - this.snippetNameMap = {}; -}; - -(function() { - this.getTokenizer = function() { - function TabstopToken(str, _, stack) { - str = str.substr(1); - if (/^\d+$/.test(str) && !stack.inFormatString) - return [{tabstopId: parseInt(str, 10)}]; - return [{text: str}] - } - function escape(ch) { - return "(?:[^\\\\" + ch + "]|\\\\.)"; - } - SnippetManager.$tokenizer = new Tokenizer({ - start: [ - {regex: /:/, onMatch: function(val, state, stack) { - if (stack.length && stack[0].expectIf) { - stack[0].expectIf = false; - stack[0].elseBranch = stack[0]; - return [stack[0]]; - } - return ":"; - }}, - {regex: /\\./, onMatch: function(val, state, stack) { - var ch = val[1]; - if (ch == "}" && stack.length) { - val = ch; - }else if ("`$\\".indexOf(ch) != -1) { - val = ch; - } else if (stack.inFormatString) { - if (ch == "n") - val = "\n"; - else if (ch == "t") - val = "\n"; - else if ("ulULE".indexOf(ch) != -1) { - val = {changeCase: ch, local: ch > "a"}; - } - } - - return [val]; - }}, - {regex: /}/, onMatch: function(val, state, stack) { - return [stack.length ? stack.shift() : val]; - }}, - {regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken}, - {regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(str, state, stack) { - var t = TabstopToken(str.substr(1), state, stack); - stack.unshift(t[0]); - return t; - }, next: "snippetVar"}, - {regex: /\n/, token: "newline", merge: false} - ], - snippetVar: [ - {regex: "\\|" + escape("\\|") + "*\\|", onMatch: function(val, state, stack) { - stack[0].choices = val.slice(1, -1).split(","); - }, next: "start"}, - {regex: "/(" + escape("/") + "+)/(?:(" + escape("/") + "*)/)(\\w*):?", - onMatch: function(val, state, stack) { - var ts = stack[0]; - ts.fmtString = val; - - val = this.splitRegex.exec(val); - ts.guard = val[1]; - ts.fmt = val[2]; - ts.flag = val[3]; - return ""; - }, next: "start"}, - {regex: "`" + escape("`") + "*`", onMatch: function(val, state, stack) { - stack[0].code = val.splice(1, -1); - return ""; - }, next: "start"}, - {regex: "\\?", onMatch: function(val, state, stack) { - if (stack[0]) - stack[0].expectIf = true; - }, next: "start"}, - {regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start"} - ], - formatString: [ - {regex: "/(" + escape("/") + "+)/", token: "regex"}, - {regex: "", onMatch: function(val, state, stack) { - stack.inFormatString = true; - }, next: "start"} - ] - }); - SnippetManager.prototype.getTokenizer = function() { - return SnippetManager.$tokenizer; - } - return SnippetManager.$tokenizer; - }; - - this.tokenizeTmSnippet = function(str, startState) { - return this.getTokenizer().getLineTokens(str, startState).tokens.map(function(x) { - return x.value || x; - }); - }; - - this.$getDefaultValue = function(editor, name) { - if (/^[A-Z]\d+$/.test(name)) { - var i = name.substr(1); - return (this.variables[name[0] + "__"] || {})[i]; - } - if (/^\d+$/.test(name)) { - return (this.variables.__ || {})[name]; - } - name = name.replace(/^TM_/, ""); - - if (!editor) - return; - var s = editor.session; - switch(name) { - case "CURRENT_WORD": - var r = s.getWordRange(); - case "SELECTION": - case "SELECTED_TEXT": - return s.getTextRange(r); - case "CURRENT_LINE": - return s.getLine(editor.getCursorPosition().row); - case "PREV_LINE": // not possible in textmate - return s.getLine(editor.getCursorPosition().row - 1); - case "LINE_INDEX": - return editor.getCursorPosition().column; - case "LINE_NUMBER": - return editor.getCursorPosition().row + 1; - case "SOFT_TABS": - return s.getUseSoftTabs() ? "YES" : "NO"; - case "TAB_SIZE": - return s.getTabSize(); - case "FILENAME": - case "FILEPATH": - return ""; - case "FULLNAME": - return "Ace"; - } - }; - this.variables = {}; - this.getVariableValue = function(editor, varName) { - if (this.variables.hasOwnProperty(varName)) - return this.variables[varName](editor, varName) || ""; - return this.$getDefaultValue(editor, varName) || ""; - }; - this.tmStrFormat = function(str, ch, editor) { - var flag = ch.flag || ""; - var re = ch.guard; - re = new RegExp(re, flag.replace(/[^gi]/, "")); - var fmtTokens = this.tokenizeTmSnippet(ch.fmt, "formatString"); - var _self = this; - var formatted = str.replace(re, function() { - _self.variables.__ = arguments; - var fmtParts = _self.resolveVariables(fmtTokens, editor); - var gChangeCase = "E"; - for (var i = 0; i < fmtParts.length; i++) { - var ch = fmtParts[i]; - if (typeof ch == "object") { - fmtParts[i] = ""; - if (ch.changeCase && ch.local) { - var next = fmtParts[i + 1]; - if (next && typeof next == "string") { - if (ch.changeCase == "u") - fmtParts[i] = next[0].toUpperCase(); - else - fmtParts[i] = next[0].toLowerCase(); - fmtParts[i + 1] = next.substr(1); - } - } else if (ch.changeCase) { - gChangeCase = ch.changeCase; - } - } else if (gChangeCase == "U") { - fmtParts[i] = ch.toUpperCase(); - } else if (gChangeCase == "L") { - fmtParts[i] = ch.toLowerCase(); - } - } - return fmtParts.join(""); - }); - this.variables.__ = null; - return formatted; - }; - - this.resolveVariables = function(snippet, editor) { - var result = []; - for (var i = 0; i < snippet.length; i++) { - var ch = snippet[i]; - if (typeof ch == "string") { - result.push(ch); - } else if (typeof ch != "object") { - continue; - } else if (ch.skip) { - gotoNext(ch); - } else if (ch.processed < i) { - continue; - } else if (ch.text) { - var value = this.getVariableValue(editor, ch.text); - if (value && ch.fmtString) - value = this.tmStrFormat(value, ch); - ch.processed = i; - if (ch.expectIf == null) { - if (value) { - result.push(value); - gotoNext(ch); - } - } else { - if (value) { - ch.skip = ch.elseBranch; - } else - gotoNext(ch); - } - } else if (ch.tabstopId != null) { - result.push(ch); - } else if (ch.changeCase != null) { - result.push(ch); - } - } - function gotoNext(ch) { - var i1 = snippet.indexOf(ch, i + 1); - if (i1 != -1) - i = i1; - } - return result; - }; - - this.insertSnippet = function(editor, snippetText) { - var cursor = editor.getCursorPosition(); - var line = editor.session.getLine(cursor.row); - var indentString = line.match(/^\s*/)[0]; - var tabString = editor.session.getTabString(); - - var tokens = this.tokenizeTmSnippet(snippetText); - tokens = this.resolveVariables(tokens, editor); - tokens = tokens.map(function(x) { - if (x == "\n") - return x + indentString; - if (typeof x == "string") - return x.replace(/\t/g, tabString); - return x; - }); - var tabstops = []; - tokens.forEach(function(p, i) { - if (typeof p != "object") - return; - var id = p.tabstopId; - var ts = tabstops[id]; - if (!ts) { - ts = tabstops[id] = []; - ts.index = id; - ts.value = ""; - } - if (ts.indexOf(p) !== -1) - return; - ts.push(p); - var i1 = tokens.indexOf(p, i + 1); - if (i1 === -1) - return; - - var value = tokens.slice(i + 1, i1); - var isNested = value.some(function(t) {return typeof t === "object"}); - if (isNested && !ts.value) { - ts.value = value; - } else if (value.length && (!ts.value || typeof ts.value !== "string")) { - ts.value = value.join(""); - } - }); - tabstops.forEach(function(ts) {ts.length = 0}); - var expanding = {}; - function copyValue(val) { - var copy = [] - for (var i = 0; i < val.length; i++) { - var p = val[i]; - if (typeof p == "object") { - if (expanding[p.tabstopId]) - continue; - var j = val.lastIndexOf(p, i - 1); - p = copy[j] || {tabstopId: p.tabstopId}; - } - copy[i] = p; - } - return copy; - } - for (var i = 0; i < tokens.length; i++) { - var p = tokens[i]; - if (typeof p != "object") - continue; - var id = p.tabstopId; - var i1 = tokens.indexOf(p, i + 1); - if (expanding[id]) { - if (expanding[id] === p) - expanding[id] = null; - continue; - } - - var ts = tabstops[id]; - var arg = typeof ts.value == "string" ? [ts.value] : copyValue(ts.value); - arg.unshift(i + 1, Math.max(0, i1 - i)); - arg.push(p); - expanding[id] = p; - tokens.splice.apply(tokens, arg); - - if (ts.indexOf(p) === -1) - ts.push(p); - }; - var row = 0, column = 0; - var text = ""; - tokens.forEach(function(t) { - if (typeof t === "string") { - if (t[0] === "\n"){ - column = t.length - 1; - row ++; - } else - column += t.length; - text += t; - } else { - if (!t.start) - t.start = {row: row, column: column}; - else - t.end = {row: row, column: column}; - } - }); - var range = editor.getSelectionRange(); - var end = editor.session.replace(range, text); - - var tabstopManager = new TabstopManager(editor); - tabstopManager.addTabstops(tabstops, range.start, end); - tabstopManager.tabNext(); - }; - - this.$getScope = function(editor) { - var scope = editor.session.$mode.$id || ""; - scope = scope.split("/").pop(); - if (scope === "html" || scope === "php") { - if (scope === "php") - scope = "html"; - var c = editor.getCursorPosition() - var state = editor.session.getState(c.row); - if (typeof state === "object") { - state = state[0]; - } - if (state.substring) { - if (state.substring(0, 3) == "js-") - scope = "javascript"; - else if (state.substring(0, 4) == "css-") - scope = "css"; - else if (state.substring(0, 4) == "php-") - scope = "php"; - } - } - - return scope; - }; - - this.getActiveScopes = function(editor) { - var scope = this.$getScope(editor); - var scopes = [scope]; - var snippetMap = this.snippetMap; - if (snippetMap[scope] && snippetMap[scope].includeScopes) { - scopes.push.apply(scopes, snippetMap[scope].includeScopes); - } - scopes.push("_"); - return scopes; - }; - - this.expandWithTab = function(editor) { - var cursor = editor.getCursorPosition(); - var line = editor.session.getLine(cursor.row); - var before = line.substring(0, cursor.column); - var after = line.substr(cursor.column); - - var snippetMap = this.snippetMap; - var snippet; - this.getActiveScopes(editor).some(function(scope) { - var snippets = snippetMap[scope]; - if (snippets) - snippet = this.findMatchingSnippet(snippets, before, after); - return !!snippet; - }, this); - if (!snippet) - return false; - - editor.session.doc.removeInLine(cursor.row, - cursor.column - snippet.replaceBefore.length, - cursor.column + snippet.replaceAfter.length - ); - - this.variables.M__ = snippet.matchBefore; - this.variables.T__ = snippet.matchAfter; - this.insertSnippet(editor, snippet.content); - - this.variables.M__ = this.variables.T__ = null; - return true; - }; - - this.findMatchingSnippet = function(snippetList, before, after) { - for (var i = snippetList.length; i--;) { - var s = snippetList[i]; - if (s.startRe && !s.startRe.test(before)) - continue; - if (s.endRe && !s.endRe.test(after)) - continue; - if (!s.startRe && !s.endRe) - continue; - - s.matchBefore = s.startRe ? s.startRe.exec(before) : [""]; - s.matchAfter = s.endRe ? s.endRe.exec(after) : [""]; - s.replaceBefore = s.triggerRe ? s.triggerRe.exec(before)[0] : ""; - s.replaceAfter = s.endTriggerRe ? s.endTriggerRe.exec(after)[0] : ""; - return s; - } - }; - - this.snippetMap = {}; - this.snippetNameMap = {}; - this.register = function(snippets, scope) { - var snippetMap = this.snippetMap; - var snippetNameMap = this.snippetNameMap; - var self = this; - function wrapRegexp(src) { - if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src)) - src = "(?:" + src + ")" - - return src || ""; - } - function guardedRegexp(re, guard, opening) { - re = wrapRegexp(re); - guard = wrapRegexp(guard); - if (opening) { - re = guard + re; - if (re && re[re.length - 1] != "$") - re = re + "$"; - } else { - re = re + guard; - if (re && re[0] != "^") - re = "^" + re; - } - return new RegExp(re); - } - - function addSnippet(s) { - if (!s.scope) - s.scope = scope || "_"; - scope = s.scope - if (!snippetMap[scope]) { - snippetMap[scope] = []; - snippetNameMap[scope] = {}; - } - - var map = snippetNameMap[scope]; - if (s.name) { - var old = map[s.name]; - if (old) - self.unregister(old); - map[s.name] = s; - } - snippetMap[scope].push(s); - - if (s.tabTrigger && !s.trigger) { - if (!s.guard && /^\w/.test(s.tabTrigger)) - s.guard = "\\b"; - s.trigger = lang.escapeRegExp(s.tabTrigger); - } - - s.startRe = guardedRegexp(s.trigger, s.guard, true); - s.triggerRe = new RegExp(s.trigger, "", true); - - s.endRe = guardedRegexp(s.endTrigger, s.endGuard, true); - s.endTriggerRe = new RegExp(s.endTrigger, "", true); - }; - - if (snippets.content) - addSnippet(snippets); - else if (Array.isArray(snippets)) - snippets.forEach(addSnippet); - }; - this.unregister = function(snippets, scope) { - var snippetMap = this.snippetMap; - var snippetNameMap = this.snippetNameMap; - - function removeSnippet(s) { - var nameMap = snippetNameMap[s.scope||scope]; - if (nameMap && nameMap[s.name]) { - delete nameMap[s.name]; - var map = snippetMap[s.scope||scope]; - var i = map && map.indexOf(s); - if (i >= 0) - map.splice(i, 1); - } - } - if (snippets.content) - removeSnippet(snippets); - else if (Array.isArray(snippets)) - snippets.forEach(removeSnippet); - }; - this.parseSnippetFile = function(str) { - str = str.replace(/\r/g, ""); - var list = [], snippet = {}; - var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm; - var m; - while (m = re.exec(str)) { - if (m[1]) { - try { - snippet = JSON.parse(m[1]) - list.push(snippet); - } catch (e) {} - } if (m[4]) { - snippet.content = m[4].replace(/^\t/gm, ""); - list.push(snippet); - snippet = {}; - } else { - var key = m[2], val = m[3]; - if (key == "regex") { - var guardRe = /\/((?:[^\/\\]|\\.)*)|$/g; - snippet.guard = guardRe.exec(val)[1]; - snippet.trigger = guardRe.exec(val)[1]; - snippet.endTrigger = guardRe.exec(val)[1]; - snippet.endGuard = guardRe.exec(val)[1]; - } else if (key == "snippet") { - snippet.tabTrigger = val.match(/^\S*/)[0]; - if (!snippet.name) - snippet.name = val; - } else { - snippet[key] = val; - } - } - } - return list; - }; - this.getSnippetByName = function(name, editor) { - var snippetMap = this.snippetNameMap; - var snippet; - this.getActiveScopes(editor).some(function(scope) { - var snippets = snippetMap[scope]; - if (snippets) - snippet = snippets[name]; - return !!snippet; - }, this); - return snippet; - }; - -}).call(SnippetManager.prototype); - - -var TabstopManager = function(editor) { - if (editor.tabstopManager) - return editor.tabstopManager; - editor.tabstopManager = this; - this.$onChange = this.onChange.bind(this); - this.$onChangeSelection = lang.delayedCall(this.onChangeSelection.bind(this)).schedule; - this.$onChangeSession = this.onChangeSession.bind(this); - this.$onAfterExec = this.onAfterExec.bind(this); - this.attach(editor); -}; -(function() { - this.attach = function(editor) { - this.index = -1; - this.ranges = []; - this.tabstops = []; - this.selectedTabstop = null; - - this.editor = editor; - this.editor.on("change", this.$onChange); - this.editor.on("changeSelection", this.$onChangeSelection); - this.editor.on("changeSession", this.$onChangeSession); - this.editor.commands.on("afterExec", this.$onAfterExec); - this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); - }; - this.detach = function() { - this.tabstops.forEach(this.removeTabstopMarkers, this); - this.ranges = null; - this.tabstops = null; - this.selectedTabstop = null; - this.editor.removeListener("change", this.$onChange); - this.editor.removeListener("changeSelection", this.$onChangeSelection); - this.editor.removeListener("changeSession", this.$onChangeSession); - this.editor.commands.removeListener("afterExec", this.$onAfterExec); - this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); - this.editor.tabstopManager = null; - this.editor = null; - }; - - this.onChange = function(e) { - var changeRange = e.data.range; - var isRemove = e.data.action[0] == "r"; - var start = changeRange.start; - var end = changeRange.end; - var startRow = start.row; - var endRow = end.row; - var lineDif = endRow - startRow; - var colDiff = end.column - start.column; - - if (isRemove) { - lineDif = -lineDif; - colDiff = -colDiff; - } - if (!this.$inChange && isRemove) { - var ts = this.selectedTabstop; - var changedOutside = !ts.some(function(r) { - return comparePoints(r.start, start) <= 0 && comparePoints(r.end, end) >= 0; - }); - if (changedOutside) - return this.detach(); - } - var ranges = this.ranges; - for (var i = 0; i < ranges.length; i++) { - var r = ranges[i]; - if (r.end.row < start.row) - continue; - - if (comparePoints(start, r.start) < 0 && comparePoints(end, r.end) > 0) { - this.removeRange(r); - i--; - continue; - } - - if (r.start.row == startRow && r.start.column > start.column) - r.start.column += colDiff; - if (r.end.row == startRow && r.end.column >= start.column) - r.end.column += colDiff; - if (r.start.row >= startRow) - r.start.row += lineDif; - if (r.end.row >= startRow) - r.end.row += lineDif; - - if (comparePoints(r.start, r.end) > 0) - this.removeRange(r); - } - if (!ranges.length) - this.detach(); - }; - this.updateLinkedFields = function() { - var ts = this.selectedTabstop; - if (!ts.hasLinkedRanges) - return; - this.$inChange = true; - var session = this.editor.session; - var text = session.getTextRange(ts.firstNonLinked); - for (var i = ts.length; i--;) { - var range = ts[i]; - if (!range.linked) - continue; - var fmt = exports.snippetManager.tmStrFormat(text, range.original) - session.replace(range, fmt); - } - this.$inChange = false; - }; - this.onAfterExec = function(e) { - if (e.command && !e.command.readOnly) - this.updateLinkedFields(); - }; - this.onChangeSelection = function() { - if (!this.editor) - return - var lead = this.editor.selection.lead; - var anchor = this.editor.selection.anchor; - var isEmpty = this.editor.selection.isEmpty(); - for (var i = this.ranges.length; i--;) { - if (this.ranges[i].linked) - continue; - var containsLead = this.ranges[i].contains(lead.row, lead.column); - var containsAnchor = isEmpty || this.ranges[i].contains(anchor.row, anchor.column); - if (containsLead && containsAnchor) - return; - } - this.detach(); - }; - this.onChangeSession = function() { - this.detach(); - }; - this.tabNext = function(dir) { - var max = this.tabstops.length - 1; - var index = this.index + (dir || 1); - index = Math.min(Math.max(index, 0), max); - this.selectTabstop(index); - if (index == max) - this.detach(); - }; - this.selectTabstop = function(index) { - var ts = this.tabstops[this.index]; - if (ts) - this.addTabstopMarkers(ts); - this.index = index; - ts = this.tabstops[this.index]; - if (!ts || !ts.length) - return; - - this.selectedTabstop = ts; - if (!this.editor.inVirtualSelectionMode) { - var sel = this.editor.multiSelect; - sel.toSingleRange(ts.firstNonLinked.clone()); - for (var i = ts.length; i--;) { - if (ts.hasLinkedRanges && ts[i].linked) - continue; - sel.addRange(ts[i].clone(), true); - } - } else { - this.editor.selection.setRange(ts.firstNonLinked); - } - - this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); - }; - this.addTabstops = function(tabstops, start, end) { - if (!tabstops[0]) { - var p = Range.fromPoints(end, end); - moveRelative(p.start, start); - moveRelative(p.end, start); - tabstops[0] = [p]; - tabstops[0].index = 0; - } - - var i = this.index; - var arg = [i, 0]; - var ranges = this.ranges; - var editor = this.editor; - tabstops.forEach(function(ts) { - for (var i = ts.length; i--;) { - var p = ts[i]; - var range = Range.fromPoints(p.start, p.end || p.start); - movePoint(range.start, start); - movePoint(range.end, start); - range.original = p; - range.tabstop = ts; - ranges.push(range); - ts[i] = range; - if (p.fmtString) { - range.linked = true; - ts.hasLinkedRanges = true; - } else if (!ts.firstNonLinked) - ts.firstNonLinked = range; - } - if (!ts.firstNonLinked) - ts.hasLinkedRanges = false; - arg.push(ts); - this.addTabstopMarkers(ts); - }, this); - arg.push(arg.splice(2, 1)[0]); - this.tabstops.splice.apply(this.tabstops, arg); - }; - - this.addTabstopMarkers = function(ts) { - var session = this.editor.session; - ts.forEach(function(range) { - if (!range.markerId) - range.markerId = session.addMarker(range, "ace_snippet-marker", "text"); - }); - }; - this.removeTabstopMarkers = function(ts) { - var session = this.editor.session; - ts.forEach(function(range) { - session.removeMarker(range.markerId); - range.markerId = null; - }); - }; - this.removeRange = function(range) { - var i = range.tabstop.indexOf(range); - range.tabstop.splice(i, 1); - i = this.ranges.indexOf(range); - this.ranges.splice(i, 1); - this.editor.session.removeMarker(range.markerId); - }; - - this.keyboardHandler = new HashHandler(); - this.keyboardHandler.bindKeys({ - "Tab": function(ed) { - if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) { - return; - } - - ed.tabstopManager.tabNext(1); - }, - "Shift-Tab": function(ed) { - ed.tabstopManager.tabNext(-1); - }, - "Esc": function(ed) { - ed.tabstopManager.detach(); - }, - "Return": function(ed) { - return false; - } - }); -}).call(TabstopManager.prototype); - - -var movePoint = function(point, diff) { - if (point.row == 0) - point.column += diff.column; - point.row += diff.row; -}; - -var moveRelative = function(point, start) { - if (point.row == start.row) - point.column -= start.column; - point.row -= start.row; -}; - - -require("./lib/dom").importCssString("\ -.ace_snippet-marker {\ - -moz-box-sizing: border-box;\ - box-sizing: border-box;\ - background: rgba(194, 193, 208, 0.09);\ - border: 1px dotted rgba(211, 208, 235, 0.62);\ - position: absolute;\ -}"); - -exports.snippetManager = new SnippetManager(); - - -}); - -ace.define('ace/autocomplete', ['require', 'exports', 'module' , 'ace/keyboard/hash_handler', 'ace/autocomplete/popup', 'ace/autocomplete/util', 'ace/lib/event', 'ace/lib/lang', 'ace/snippets'], function(require, exports, module) { - - -var HashHandler = require("./keyboard/hash_handler").HashHandler; -var AcePopup = require("./autocomplete/popup").AcePopup; -var util = require("./autocomplete/util"); -var event = require("./lib/event"); -var lang = require("./lib/lang"); -var snippetManager = require("./snippets").snippetManager; - -var Autocomplete = function() { - this.autoInsert = true; - this.keyboardHandler = new HashHandler(); - this.keyboardHandler.bindKeys(this.commands); - - this.blurListener = this.blurListener.bind(this); - this.changeListener = this.changeListener.bind(this); - this.mousedownListener = this.mousedownListener.bind(this); - this.mousewheelListener = this.mousewheelListener.bind(this); - - this.changeTimer = lang.delayedCall(function() { - this.updateCompletions(true); - }.bind(this)) -}; - -(function() { - this.$init = function() { - this.popup = new AcePopup(document.body || document.documentElement); - this.popup.on("click", function(e) { - this.insertMatch(); - e.stop(); - }.bind(this)); - }; - - this.openPopup = function(editor, prefix, keepPopupPosition) { - if (!this.popup) - this.$init(); - - this.popup.setData(this.completions.filtered); - - var renderer = editor.renderer; - if (!keepPopupPosition) { - this.popup.setRow(0); - this.popup.setFontSize(editor.getFontSize()); - - var lineHeight = renderer.layerConfig.lineHeight; - - var pos = renderer.$cursorLayer.getPixelPosition(this.base, true); - pos.left -= this.popup.getTextLeftOffset(); - - var rect = editor.container.getBoundingClientRect(); - pos.top += rect.top - renderer.layerConfig.offset; - pos.left += rect.left - editor.renderer.scrollLeft; - pos.left += renderer.$gutterLayer.gutterWidth; - - this.popup.show(pos, lineHeight); - } - }; - - this.detach = function() { - this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); - this.editor.off("changeSelection", this.changeListener); - this.editor.off("blur", this.blurListener); - this.editor.off("mousedown", this.mousedownListener); - this.editor.off("mousewheel", this.mousewheelListener); - this.changeTimer.cancel(); - - if (this.popup) - this.popup.hide(); - - this.activated = false; - this.completions = this.base = null; - }; - - this.changeListener = function(e) { - var cursor = this.editor.selection.lead; - if (cursor.row != this.base.row || cursor.column < this.base.column) { - this.detach(); - } - if (this.activated) - this.changeTimer.schedule(); - else - this.detach(); - }; - - this.blurListener = function() { - if (document.activeElement != this.editor.textInput.getElement()) - this.detach(); - }; - - this.mousedownListener = function(e) { - this.detach(); - }; - - this.mousewheelListener = function(e) { - this.detach(); - }; - - this.goTo = function(where) { - var row = this.popup.getRow(); - var max = this.popup.session.getLength() - 1; - - switch(where) { - case "up": row = row < 0 ? max : row - 1; break; - case "down": row = row >= max ? -1 : row + 1; break; - case "start": row = 0; break; - case "end": row = max; break; - } - - this.popup.setRow(row); - }; - - this.insertMatch = function(data) { - if (!data) - data = this.popup.getData(this.popup.getRow()); - if (!data) - return false; - if (data.completer && data.completer.insertMatch) { - data.completer.insertMatch(this.editor); - } else { - if (this.completions.filterText) { - var ranges = this.editor.selection.getAllRanges(); - for (var i = 0, range; range = ranges[i]; i++) { - range.start.column -= this.completions.filterText.length; - this.editor.session.remove(range); - } - } - if (data.snippet) - snippetManager.insertSnippet(this.editor, data.snippet); - else - this.editor.execCommand("insertstring", data.value || data); - } - this.detach(); - }; - - this.commands = { - "Up": function(editor) { editor.completer.goTo("up"); }, - "Down": function(editor) { editor.completer.goTo("down"); }, - "Ctrl-Up|Ctrl-Home": function(editor) { editor.completer.goTo("start"); }, - "Ctrl-Down|Ctrl-End": function(editor) { editor.completer.goTo("end"); }, - - "Esc": function(editor) { editor.completer.detach(); }, - "Space": function(editor) { editor.completer.detach(); editor.insert(" ");}, - "Return": function(editor) { editor.completer.insertMatch(); }, - "Shift-Return": function(editor) { editor.completer.insertMatch(true); }, - "Tab": function(editor) { editor.completer.insertMatch(); }, - - "PageUp": function(editor) { editor.completer.popup.gotoPageUp(); }, - "PageDown": function(editor) { editor.completer.popup.gotoPageDown(); } - }; - - this.gatherCompletions = function(editor, callback) { - var session = editor.getSession(); - var pos = editor.getCursorPosition(); - - var line = session.getLine(pos.row); - var prefix = util.retrievePrecedingIdentifier(line, pos.column); - - this.base = editor.getCursorPosition(); - this.base.column -= prefix.length; - - var matches = []; - util.parForEach(editor.completers, function(completer, next) { - completer.getCompletions(editor, session, pos, prefix, function(err, results) { - if (!err) - matches = matches.concat(results); - next(); - }); - }, function() { - callback(null, { - prefix: prefix, - matches: matches - }); - }); - return true; - }; - - this.showPopup = function(editor) { - if (this.editor) - this.detach(); - - this.activated = true; - - this.editor = editor; - if (editor.completer != this) { - if (editor.completer) - editor.completer.detach(); - editor.completer = this; - } - - editor.keyBinding.addKeyboardHandler(this.keyboardHandler); - editor.on("changeSelection", this.changeListener); - editor.on("blur", this.blurListener); - editor.on("mousedown", this.mousedownListener); - editor.on("mousewheel", this.mousewheelListener); - - this.updateCompletions(); - }; - - this.updateCompletions = function(keepPopupPosition) { - if (keepPopupPosition && this.base && this.completions) { - var pos = this.editor.getCursorPosition(); - var prefix = this.editor.session.getTextRange({start: this.base, end: pos}); - if (prefix == this.completions.filterText) - return; - this.completions.setFilter(prefix); - if (!this.completions.filtered.length) - return this.detach(); - this.openPopup(this.editor, prefix, keepPopupPosition); - return; - } - this.gatherCompletions(this.editor, function(err, results) { - var matches = results && results.matches; - if (!matches || !matches.length) - return this.detach(); - - this.completions = new FilteredList(matches); - this.completions.setFilter(results.prefix); - var filtered = this.completions.filtered; - if (!filtered.length) - return this.detach(); - if (this.autoInsert && filtered.length == 1) - return this.insertMatch(filtered[0]); - this.openPopup(this.editor, results.prefix, keepPopupPosition); - }.bind(this)); - }; - - this.cancelContextMenu = function() { - var stop = function(e) { - this.editor.off("nativecontextmenu", stop); - if (e && e.domEvent) - event.stopEvent(e.domEvent); - }.bind(this); - setTimeout(stop, 10); - this.editor.on("nativecontextmenu", stop); - }; - -}).call(Autocomplete.prototype); - -Autocomplete.startCommand = { - name: "startAutocomplete", - exec: function(editor) { - if (!editor.completer) - editor.completer = new Autocomplete(); - editor.completer.showPopup(editor); - editor.completer.cancelContextMenu(); - }, - bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" -}; - -var FilteredList = function(array, filterText, mutateData) { - this.all = array; - this.filtered = array; - this.filterText = filterText || ""; -}; -(function(){ - this.setFilter = function(str) { - if (str.length > this.filterText && str.lastIndexOf(this.filterText, 0) === 0) - var matches = this.filtered; - else - var matches = this.all; - - this.filterText = str; - matches = this.filterCompletions(matches, this.filterText); - matches = matches.sort(function(a, b) { - return b.exactMatch - a.exactMatch || b.score - a.score; - }); - var prev = null; - matches = matches.filter(function(item){ - var caption = item.value || item.caption || item.snippet; - if (caption === prev) return false; - prev = caption; - return true; - }); - - this.filtered = matches; - }; - this.filterCompletions = function(items, needle) { - var results = []; - var upper = needle.toUpperCase(); - var lower = needle.toLowerCase(); - loop: for (var i = 0, item; item = items[i]; i++) { - var caption = item.value || item.caption || item.snippet; - if (!caption) continue; - var lastIndex = -1; - var matchMask = 0; - var penalty = 0; - var index, distance; - for (var j = 0; j < needle.length; j++) { - var i1 = caption.indexOf(lower[j], lastIndex + 1); - var i2 = caption.indexOf(upper[j], lastIndex + 1); - index = (i1 >= 0) ? ((i2 < 0 || i1 < i2) ? i1 : i2) : i2; - if (index < 0) - continue loop; - distance = index - lastIndex - 1; - if (distance > 0) { - if (lastIndex === -1) - penalty += 10; - penalty += distance; - } - matchMask = matchMask | (1 << index); - lastIndex = index; - } - item.matchMask = matchMask; - item.exactMatch = penalty ? 0 : 1; - item.score = (item.score || 0) - penalty; - results.push(item); - } - return results; - }; -}).call(FilteredList.prototype); - -exports.Autocomplete = Autocomplete; -exports.FilteredList = FilteredList; - -}); - -ace.define('ace/autocomplete/popup', ['require', 'exports', 'module' , 'ace/edit_session', 'ace/virtual_renderer', 'ace/editor', 'ace/range', 'ace/lib/event', 'ace/lib/lang', 'ace/lib/dom'], function(require, exports, module) { - - -var EditSession = require("../edit_session").EditSession; -var Renderer = require("../virtual_renderer").VirtualRenderer; -var Editor = require("../editor").Editor; -var Range = require("../range").Range; -var event = require("../lib/event"); -var lang = require("../lib/lang"); -var dom = require("../lib/dom"); - -var $singleLineEditor = function(el) { - var renderer = new Renderer(el); - - renderer.$maxLines = 4; - - var editor = new Editor(renderer); - - editor.setHighlightActiveLine(false); - editor.setShowPrintMargin(false); - editor.renderer.setShowGutter(false); - editor.renderer.setHighlightGutterLine(false); - - editor.$mouseHandler.$focusWaitTimout = 0; - - return editor; -}; - -var AcePopup = function(parentNode) { - var el = dom.createElement("div"); - var popup = new $singleLineEditor(el); - - if (parentNode) - parentNode.appendChild(el); - el.style.display = "none"; - popup.renderer.content.style.cursor = "default"; - popup.renderer.setStyle("ace_autocomplete"); - - popup.setOption("displayIndentGuides", false); - - var noop = function(){}; - - popup.focus = noop; - popup.$isFocused = true; - - popup.renderer.$cursorLayer.restartTimer = noop; - popup.renderer.$cursorLayer.element.style.opacity = 0; - - popup.renderer.$maxLines = 8; - popup.renderer.$keepTextAreaAtCursor = false; - - popup.setHighlightActiveLine(false); - popup.session.highlight(""); - popup.session.$searchHighlight.clazz = "ace_highlight-marker"; - - popup.on("mousedown", function(e) { - var pos = e.getDocumentPosition(); - popup.selection.moveToPosition(pos); - selectionMarker.start.row = selectionMarker.end.row = pos.row; - e.stop(); - }); - - var lastMouseEvent; - var hoverMarker = new Range(-1,0,-1,Infinity); - var selectionMarker = new Range(-1,0,-1,Infinity); - selectionMarker.id = popup.session.addMarker(selectionMarker, "ace_active-line", "fullLine"); - popup.setSelectOnHover = function(val) { - if (!val) { - hoverMarker.id = popup.session.addMarker(hoverMarker, "ace_line-hover", "fullLine"); - } else if (hoverMarker.id) { - popup.session.removeMarker(hoverMarker.id); - hoverMarker.id = null; - } - } - popup.setSelectOnHover(false); - popup.on("mousemove", function(e) { - if (!lastMouseEvent) { - lastMouseEvent = e; - return; - } - if (lastMouseEvent.x == e.x && lastMouseEvent.y == e.y) { - return; - } - lastMouseEvent = e; - lastMouseEvent.scrollTop = popup.renderer.scrollTop; - var row = lastMouseEvent.getDocumentPosition().row; - if (hoverMarker.start.row != row) { - if (!hoverMarker.id) - popup.setRow(row); - setHoverMarker(row); - } - }); - popup.renderer.on("beforeRender", function() { - if (lastMouseEvent && hoverMarker.start.row != -1) { - lastMouseEvent.$pos = null; - var row = lastMouseEvent.getDocumentPosition().row; - if (!hoverMarker.id) - popup.setRow(row); - setHoverMarker(row, true); - } - }); - popup.renderer.on("afterRender", function() { - var row = popup.getRow(); - var t = popup.renderer.$textLayer; - var selected = t.element.childNodes[row - t.config.firstRow]; - if (selected == t.selectedNode) - return; - if (t.selectedNode) - dom.removeCssClass(t.selectedNode, "ace_selected"); - t.selectedNode = selected; - if (selected) - dom.addCssClass(selected, "ace_selected"); - }); - var hideHoverMarker = function() { setHoverMarker(-1) }; - var setHoverMarker = function(row, suppressRedraw) { - if (row !== hoverMarker.start.row) { - hoverMarker.start.row = hoverMarker.end.row = row; - if (!suppressRedraw) - popup.session._emit("changeBackMarker"); - popup._emit("changeHoverMarker"); - } - }; - popup.getHoveredRow = function() { - return hoverMarker.start.row; - }; - - event.addListener(popup.container, "mouseout", hideHoverMarker); - popup.on("hide", hideHoverMarker); - popup.on("changeSelection", hideHoverMarker); - - popup.session.doc.getLength = function() { - return popup.data.length; - }; - popup.session.doc.getLine = function(i) { - var data = popup.data[i]; - if (typeof data == "string") - return data; - return (data && data.value) || ""; - }; - - var bgTokenizer = popup.session.bgTokenizer; - bgTokenizer.$tokenizeRow = function(i) { - var data = popup.data[i]; - var tokens = []; - if (!data) - return tokens; - if (typeof data == "string") - data = {value: data}; - if (!data.caption) - data.caption = data.value; - - var last = -1; - var flag, c; - for (var i = 0; i < data.caption.length; i++) { - c = data.caption[i]; - flag = data.matchMask & (1 << i) ? 1 : 0; - if (last !== flag) { - tokens.push({type: data.className || "" + ( flag ? "completion-highlight" : ""), value: c}); - last = flag; - } else { - tokens[tokens.length - 1].value += c; - } - } - - if (data.meta) { - var maxW = popup.renderer.$size.scrollerWidth / popup.renderer.layerConfig.characterWidth; - if (data.meta.length + data.caption.length < maxW - 2) - tokens.push({type: "rightAlignedText", value: data.meta}); - } - return tokens; - }; - bgTokenizer.$updateOnChange = noop; - bgTokenizer.start = noop; - - popup.session.$computeWidth = function() { - return this.screenWidth = 0; - } - popup.isOpen = false; - popup.isTopdown = false; - - popup.data = []; - popup.setData = function(list) { - popup.data = list || []; - popup.setValue(lang.stringRepeat("\n", list.length), -1); - popup.setRow(0); - }; - popup.getData = function(row) { - return popup.data[row]; - }; - - popup.getRow = function() { - return selectionMarker.start.row; - }; - popup.setRow = function(line) { - line = Math.max(-1, Math.min(this.data.length, line)); - if (selectionMarker.start.row != line) { - popup.selection.clearSelection(); - selectionMarker.start.row = selectionMarker.end.row = line || 0; - popup.session._emit("changeBackMarker"); - popup.moveCursorTo(line || 0, 0); - if (popup.isOpen) - popup._signal("select"); - } - }; - - popup.on("changeSelection", function() { - if (popup.isOpen) - popup.setRow(popup.selection.lead.row); - }); - - popup.hide = function() { - this.container.style.display = "none"; - this._signal("hide"); - popup.isOpen = false; - }; - popup.show = function(pos, lineHeight, topdownOnly) { - var el = this.container; - var screenHeight = window.innerHeight; - var screenWidth = window.innerWidth; - var renderer = this.renderer; - var maxH = renderer.$maxLines * lineHeight * 1.4; - var top = pos.top + this.$borderSize; - if (top + maxH > screenHeight - lineHeight && !topdownOnly) { - el.style.top = ""; - el.style.bottom = screenHeight - top + "px"; - popup.isTopdown = false; - } else { - top += lineHeight; - el.style.top = top + "px"; - el.style.bottom = ""; - popup.isTopdown = true; - } - - el.style.display = ""; - this.renderer.$textLayer.checkForSizeChanges(); - - var left = pos.left; - if (left + el.offsetWidth > screenWidth) - left = screenWidth - el.offsetWidth; - - el.style.left = left + "px"; - - this._signal("show"); - lastMouseEvent = null; - popup.isOpen = true; - }; - - popup.getTextLeftOffset = function() { - return this.$borderSize + this.renderer.$padding + this.$imageSize; - }; - - popup.$imageSize = 0; - popup.$borderSize = 1; - - return popup; -}; - -dom.importCssString("\ -.ace_autocomplete.ace-tm .ace_marker-layer .ace_active-line {\ - background-color: #CAD6FA;\ - z-index: 1;\ -}\ -.ace_autocomplete.ace-tm .ace_line-hover {\ - border: 1px solid #abbffe;\ - margin-top: -1px;\ - background: rgba(233,233,253,0.4);\ -}\ -.ace_autocomplete .ace_line-hover {\ - position: absolute;\ - z-index: 2;\ -}\ -.ace_rightAlignedText {\ - color: gray;\ - display: inline-block;\ - position: absolute;\ - right: 4px;\ - text-align: right;\ - z-index: -1;\ -}\ -.ace_autocomplete .ace_completion-highlight{\ - color: #000;\ - text-shadow: 0 0 0.01em;\ -}\ -.ace_autocomplete {\ - width: 280px;\ - z-index: 200000;\ - background: #fbfbfb;\ - color: #444;\ - border: 1px lightgray solid;\ - position: fixed;\ - box-shadow: 2px 3px 5px rgba(0,0,0,.2);\ - line-height: 1.4;\ -}"); - -exports.AcePopup = AcePopup; - -}); - -ace.define('ace/autocomplete/util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.parForEach = function(array, fn, callback) { - var completed = 0; - var arLength = array.length; - if (arLength === 0) - callback(); - for (var i = 0; i < arLength; i++) { - fn(array[i], function(result, err) { - completed++; - if (completed === arLength) - callback(result, err); - }); - } -} - -var ID_REGEX = /[a-zA-Z_0-9\$-]/; - -exports.retrievePrecedingIdentifier = function(text, pos, regex) { - regex = regex || ID_REGEX; - var buf = []; - for (var i = pos-1; i >= 0; i--) { - if (regex.test(text[i])) - buf.push(text[i]); - else - break; - } - return buf.reverse().join(""); -} - -exports.retrieveFollowingIdentifier = function(text, pos, regex) { - regex = regex || ID_REGEX; - var buf = []; - for (var i = pos; i < text.length; i++) { - if (regex.test(text[i])) - buf.push(text[i]); - else - break; - } - return buf; -} - -}); - -ace.define('ace/autocomplete/text_completer', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - var Range = require("ace/range").Range; - - var splitRegex = /[^a-zA-Z_0-9\$\-]+/; - - function getWordIndex(doc, pos) { - var textBefore = doc.getTextRange(Range.fromPoints({row: 0, column:0}, pos)); - return textBefore.split(splitRegex).length - 1; - } - function wordDistance(doc, pos) { - var prefixPos = getWordIndex(doc, pos); - var words = doc.getValue().split(splitRegex); - var wordScores = Object.create(null); - - var currentWord = words[prefixPos]; - - words.forEach(function(word, idx) { - if (!word || word === currentWord) return; - - var distance = Math.abs(prefixPos - idx); - var score = words.length - distance; - if (wordScores[word]) { - wordScores[word] = Math.max(score, wordScores[word]); - } else { - wordScores[word] = score; - } - }); - return wordScores; - } - - exports.getCompletions = function(editor, session, pos, prefix, callback) { - var wordScore = wordDistance(session, pos, prefix); - var wordList = Object.keys(wordScore); - callback(null, wordList.map(function(word) { - return { - name: word, - value: word, - score: wordScore[word], - meta: "local" - }; - })); - }; -});; - (function() { - ace.require(["ace/ext/language_tools"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-modelist.js b/util/build-sample-browser/player/vendor/ace/ext-modelist.js deleted file mode 100644 index 516f4a63e5..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-modelist.js +++ /dev/null @@ -1,176 +0,0 @@ -ace.define('ace/ext/modelist', ['require', 'exports', 'module' ], function(require, exports, module) { - - -var modes = []; -function getModeForPath(path) { - var mode = modesByName.text; - var fileName = path.split(/[\/\\]/).pop(); - for (var i = 0; i < modes.length; i++) { - if (modes[i].supportsFile(fileName)) { - mode = modes[i]; - break; - } - } - return mode; -} - -var Mode = function(name, caption, extensions) { - this.name = name; - this.caption = caption; - this.mode = "ace/mode/" + name; - this.extensions = extensions; - if (/\^/.test(extensions)) { - var re = extensions.replace(/\|(\^)?/g, function(a, b){ - return "$|" + (b ? "^" : "^.*\\."); - }) + "$"; - } else { - var re = "^.*\\.(" + extensions + ")$"; - } - - this.extRe = new RegExp(re, "gi"); -}; - -Mode.prototype.supportsFile = function(filename) { - return filename.match(this.extRe); -}; -var supportedModes = { - ABAP: ["abap"], - ActionScript:["as"], - ADA: ["ada|adb"], - Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], - AsciiDoc: ["asciidoc"], - Assembly_x86:["asm"], - AutoHotKey: ["ahk"], - BatchFile: ["bat|cmd"], - C9Search: ["c9search_results"], - C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp"], - Cirru: ["cirru|cr"], - Clojure: ["clj"], - Cobol: ["CBL|COB"], - coffee: ["coffee|cf|cson|^Cakefile"], - ColdFusion: ["cfm"], - CSharp: ["cs"], - CSS: ["css"], - Curly: ["curly"], - D: ["d|di"], - Dart: ["dart"], - Diff: ["diff|patch"], - Dot: ["dot"], - Erlang: ["erl|hrl"], - EJS: ["ejs"], - Forth: ["frt|fs|ldr"], - FTL: ["ftl"], - Gherkin: ["feature"], - Glsl: ["glsl|frag|vert"], - golang: ["go"], - Groovy: ["groovy"], - HAML: ["haml"], - Handlebars: ["hbs|handlebars|tpl|mustache"], - Haskell: ["hs"], - haXe: ["hx"], - HTML: ["html|htm|xhtml"], - HTML_Ruby: ["erb|rhtml|html.erb"], - INI: ["ini|conf|cfg|prefs"], - Jack: ["jack"], - Jade: ["jade"], - Java: ["java"], - JavaScript: ["js|jsm"], - JSON: ["json"], - JSONiq: ["jq"], - JSP: ["jsp"], - JSX: ["jsx"], - Julia: ["jl"], - LaTeX: ["tex|latex|ltx|bib"], - LESS: ["less"], - Liquid: ["liquid"], - Lisp: ["lisp"], - LiveScript: ["ls"], - LogiQL: ["logic|lql"], - LSL: ["lsl"], - Lua: ["lua"], - LuaPage: ["lp"], - Lucene: ["lucene"], - Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], - MATLAB: ["matlab"], - Markdown: ["md|markdown"], - MEL: ["mel"], - MySQL: ["mysql"], - MUSHCode: ["mc|mush"], - Nix: ["nix"], - ObjectiveC: ["m|mm"], - OCaml: ["ml|mli"], - Pascal: ["pas|p"], - Perl: ["pl|pm"], - pgSQL: ["pgsql"], - PHP: ["php|phtml"], - Powershell: ["ps1"], - Prolog: ["plg|prolog"], - Properties: ["properties"], - Protobuf: ["proto"], - Python: ["py"], - R: ["r"], - RDoc: ["Rd"], - RHTML: ["Rhtml"], - Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], - Rust: ["rs"], - SASS: ["sass"], - SCAD: ["scad"], - Scala: ["scala"], - Smarty: ["smarty|tpl"], - Scheme: ["scm|rkt"], - SCSS: ["scss"], - SH: ["sh|bash|^.bashrc"], - SJS: ["sjs"], - Space: ["space"], - snippets: ["snippets"], - Soy_Template:["soy"], - SQL: ["sql"], - Stylus: ["styl|stylus"], - SVG: ["svg"], - Tcl: ["tcl"], - Tex: ["tex"], - Text: ["txt"], - Textile: ["textile"], - Toml: ["toml"], - Twig: ["twig"], - Typescript: ["ts|typescript|str"], - VBScript: ["vbs"], - Velocity: ["vm"], - Verilog: ["v|vh|sv|svh"], - XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], - XQuery: ["xq"], - YAML: ["yaml|yml"] -}; - -var nameOverrides = { - ObjectiveC: "Objective-C", - CSharp: "C#", - golang: "Go", - C_Cpp: "C/C++", - coffee: "CoffeeScript", - HTML_Ruby: "HTML (Ruby)", - FTL: "FreeMarker" -}; -var modesByName = {}; -for (var name in supportedModes) { - var data = supportedModes[name]; - var displayName = (nameOverrides[name] || name).replace(/_/g, " "); - var filename = name.toLowerCase(); - var mode = new Mode(filename, displayName, data[0]); - modesByName[filename] = mode; - modes.push(mode); -} - -module.exports = { - getModeForPath: getModeForPath, - modes: modes, - modesByName: modesByName -}; - -}); - -; - (function() { - ace.require(["ace/ext/modelist"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-old_ie.js b/util/build-sample-browser/player/vendor/ace/ext-old_ie.js deleted file mode 100644 index 69d4cb4f55..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-old_ie.js +++ /dev/null @@ -1,505 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/old_ie', ['require', 'exports', 'module' , 'ace/lib/useragent', 'ace/tokenizer', 'ace/ext/searchbox'], function(require, exports, module) { - -var MAX_TOKEN_COUNT = 1000; -var useragent = require("../lib/useragent"); -var TokenizerModule = require("../tokenizer"); - -function patch(obj, name, regexp, replacement) { - eval("obj['" + name + "']=" + obj[name].toString().replace( - regexp, replacement - )); -} - -if (useragent.isIE && useragent.isIE < 10 && window.top.document.compatMode === "BackCompat") - useragent.isOldIE = true; - -if (typeof document != "undefined" && !document.documentElement.querySelector) { - useragent.isOldIE = true; - var qs = function(el, selector) { - if (selector.charAt(0) == ".") { - var classNeme = selector.slice(1); - } else { - var m = selector.match(/(\w+)=(\w+)/); - var attr = m && m[1]; - var attrVal = m && m[2]; - } - for (var i = 0; i < el.all.length; i++) { - var ch = el.all[i]; - if (classNeme) { - if (ch.className.indexOf(classNeme) != -1) - return ch; - } else if (attr) { - if (ch.getAttribute(attr) == attrVal) - return ch; - } - } - }; - var sb = require("./searchbox").SearchBox.prototype; - patch( - sb, "$initElements", - /([^\s=]*).querySelector\((".*?")\)/g, - "qs($1, $2)" - ); -} - -var compliantExecNpcg = /()??/.exec("")[1] === undefined; -if (compliantExecNpcg) - return; -var proto = TokenizerModule.Tokenizer.prototype; -TokenizerModule.Tokenizer_orig = TokenizerModule.Tokenizer; -proto.getLineTokens_orig = proto.getLineTokens; - -patch( - TokenizerModule, "Tokenizer", - "ruleRegExps.push(adjustedregex);\n", - function(m) { - return m + '\ - if (state[i].next && RegExp(adjustedregex).test(""))\n\ - rule._qre = RegExp(adjustedregex, "g");\n\ - '; - } -); -TokenizerModule.Tokenizer.prototype = proto; -patch( - proto, "getLineTokens", - /if \(match\[i \+ 1\] === undefined\)\s*continue;/, - "if (!match[i + 1]) {\n\ - if (value)continue;\n\ - var qre = state[mapping[i]]._qre;\n\ - if (!qre) continue;\n\ - qre.lastIndex = lastIndex;\n\ - if (!qre.exec(line) || qre.lastIndex != lastIndex)\n\ - continue;\n\ - }" -); - -useragent.isOldIE = true; - -}); - -ace.define('ace/ext/searchbox', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/event', 'ace/keyboard/hash_handler', 'ace/lib/keys'], function(require, exports, module) { - - -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var event = require("../lib/event"); -var searchboxCss = "\ -/* ------------------------------------------------------------------------------------------\ -* Editor Search Form\ -* --------------------------------------------------------------------------------------- */\ -.ace_search {\ -background-color: #ddd;\ -border: 1px solid #cbcbcb;\ -border-top: 0 none;\ -max-width: 297px;\ -overflow: hidden;\ -margin: 0;\ -padding: 4px;\ -padding-right: 6px;\ -padding-bottom: 0;\ -position: absolute;\ -top: 0px;\ -z-index: 99;\ -white-space: normal;\ -}\ -.ace_search.left {\ -border-left: 0 none;\ -border-radius: 0px 0px 5px 0px;\ -left: 0;\ -}\ -.ace_search.right {\ -border-radius: 0px 0px 0px 5px;\ -border-right: 0 none;\ -right: 0;\ -}\ -.ace_search_form, .ace_replace_form {\ -border-radius: 3px;\ -border: 1px solid #cbcbcb;\ -float: left;\ -margin-bottom: 4px;\ -overflow: hidden;\ -}\ -.ace_search_form.ace_nomatch {\ -outline: 1px solid red;\ -}\ -.ace_search_field {\ -background-color: white;\ -border-right: 1px solid #cbcbcb;\ -border: 0 none;\ --webkit-box-sizing: border-box;\ --moz-box-sizing: border-box;\ -box-sizing: border-box;\ -display: block;\ -float: left;\ -height: 22px;\ -outline: 0;\ -padding: 0 7px;\ -width: 214px;\ -margin: 0;\ -}\ -.ace_searchbtn,\ -.ace_replacebtn {\ -background: #fff;\ -border: 0 none;\ -border-left: 1px solid #dcdcdc;\ -cursor: pointer;\ -display: block;\ -float: left;\ -height: 22px;\ -margin: 0;\ -padding: 0;\ -position: relative;\ -}\ -.ace_searchbtn:last-child,\ -.ace_replacebtn:last-child {\ -border-top-right-radius: 3px;\ -border-bottom-right-radius: 3px;\ -}\ -.ace_searchbtn:disabled {\ -background: none;\ -cursor: default;\ -}\ -.ace_searchbtn {\ -background-position: 50% 50%;\ -background-repeat: no-repeat;\ -width: 27px;\ -}\ -.ace_searchbtn.prev {\ -background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); \ -}\ -.ace_searchbtn.next {\ -background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); \ -}\ -.ace_searchbtn_close {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\ -border-radius: 50%;\ -border: 0 none;\ -color: #656565;\ -cursor: pointer;\ -display: block;\ -float: right;\ -font-family: Arial;\ -font-size: 16px;\ -height: 14px;\ -line-height: 16px;\ -margin: 5px 1px 9px 5px;\ -padding: 0;\ -text-align: center;\ -width: 14px;\ -}\ -.ace_searchbtn_close:hover {\ -background-color: #656565;\ -background-position: 50% 100%;\ -color: white;\ -}\ -.ace_replacebtn.prev {\ -width: 54px\ -}\ -.ace_replacebtn.next {\ -width: 27px\ -}\ -.ace_button {\ -margin-left: 2px;\ -cursor: pointer;\ --webkit-user-select: none;\ --moz-user-select: none;\ --o-user-select: none;\ --ms-user-select: none;\ -user-select: none;\ -overflow: hidden;\ -opacity: 0.7;\ -border: 1px solid rgba(100,100,100,0.23);\ -padding: 1px;\ --moz-box-sizing: border-box;\ -box-sizing: border-box;\ -color: black;\ -}\ -.ace_button:hover {\ -background-color: #eee;\ -opacity:1;\ -}\ -.ace_button:active {\ -background-color: #ddd;\ -}\ -.ace_button.checked {\ -border-color: #3399ff;\ -opacity:1;\ -}\ -.ace_search_options{\ -margin-bottom: 3px;\ -text-align: right;\ --webkit-user-select: none;\ --moz-user-select: none;\ --o-user-select: none;\ --ms-user-select: none;\ -user-select: none;\ -}"; -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var keyUtil = require("../lib/keys"); - -dom.importCssString(searchboxCss, "ace_searchbox"); - -var html = ''.replace(/>\s+/g, ">"); - -var SearchBox = function(editor, range, showReplaceForm) { - var div = dom.createElement("div"); - div.innerHTML = html; - this.element = div.firstChild; - - this.$init(); - this.setEditor(editor); -}; - -(function() { - this.setEditor = function(editor) { - editor.searchBox = this; - editor.container.appendChild(this.element); - this.editor = editor; - }; - - this.$initElements = function(sb) { - this.searchBox = sb.querySelector(".ace_search_form"); - this.replaceBox = sb.querySelector(".ace_replace_form"); - this.searchOptions = sb.querySelector(".ace_search_options"); - this.regExpOption = sb.querySelector("[action=toggleRegexpMode]"); - this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]"); - this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]"); - this.searchInput = this.searchBox.querySelector(".ace_search_field"); - this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); - }; - - this.$init = function() { - var sb = this.element; - - this.$initElements(sb); - - var _this = this; - event.addListener(sb, "mousedown", function(e) { - setTimeout(function(){ - _this.activeInput.focus(); - }, 0); - event.stopPropagation(e); - }); - event.addListener(sb, "click", function(e) { - var t = e.target || e.srcElement; - var action = t.getAttribute("action"); - if (action && _this[action]) - _this[action](); - else if (_this.$searchBarKb.commands[action]) - _this.$searchBarKb.commands[action].exec(_this); - event.stopPropagation(e); - }); - - event.addCommandKeyListener(sb, function(e, hashId, keyCode) { - var keyString = keyUtil.keyCodeToString(keyCode); - var command = _this.$searchBarKb.findKeyCommand(hashId, keyString); - if (command && command.exec) { - command.exec(_this); - event.stopEvent(e); - } - }); - - this.$onChange = lang.delayedCall(function() { - _this.find(false, false); - }); - - event.addListener(this.searchInput, "input", function() { - _this.$onChange.schedule(20); - }); - event.addListener(this.searchInput, "focus", function() { - _this.activeInput = _this.searchInput; - _this.searchInput.value && _this.highlight(); - }); - event.addListener(this.replaceInput, "focus", function() { - _this.activeInput = _this.replaceInput; - _this.searchInput.value && _this.highlight(); - }); - }; - this.$closeSearchBarKb = new HashHandler([{ - bindKey: "Esc", - name: "closeSearchBar", - exec: function(editor) { - editor.searchBox.hide(); - } - }]); - this.$searchBarKb = new HashHandler(); - this.$searchBarKb.bindKeys({ - "Ctrl-f|Command-f|Ctrl-H|Command-Option-F": function(sb) { - var isReplace = sb.isReplace = !sb.isReplace; - sb.replaceBox.style.display = isReplace ? "" : "none"; - sb[isReplace ? "replaceInput" : "searchInput"].focus(); - }, - "Ctrl-G|Command-G": function(sb) { - sb.findNext(); - }, - "Ctrl-Shift-G|Command-Shift-G": function(sb) { - sb.findPrev(); - }, - "esc": function(sb) { - setTimeout(function() { sb.hide();}); - }, - "Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findNext(); - }, - "Shift-Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findPrev(); - }, - "Tab": function(sb) { - (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus(); - } - }); - - this.$searchBarKb.addCommands([{ - name: "toggleRegexpMode", - bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"}, - exec: function(sb) { - sb.regExpOption.checked = !sb.regExpOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleCaseSensitive", - bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"}, - exec: function(sb) { - sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleWholeWords", - bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"}, - exec: function(sb) { - sb.wholeWordOption.checked = !sb.wholeWordOption.checked; - sb.$syncOptions(); - } - }]); - - this.$syncOptions = function() { - dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked); - dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked); - dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked); - this.find(false, false); - }; - - this.highlight = function(re) { - this.editor.session.highlight(re || this.editor.$search.$options.re); - this.editor.renderer.updateBackMarkers() - }; - this.find = function(skipCurrent, backwards) { - var range = this.editor.find(this.searchInput.value, { - skipCurrent: skipCurrent, - backwards: backwards, - wrap: true, - regExp: this.regExpOption.checked, - caseSensitive: this.caseSensitiveOption.checked, - wholeWord: this.wholeWordOption.checked - }); - var noMatch = !range && this.searchInput.value; - dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); - this.editor._emit("findSearchBox", { match: !noMatch }); - this.highlight(); - }; - this.findNext = function() { - this.find(true, false); - }; - this.findPrev = function() { - this.find(true, true); - }; - this.replace = function() { - if (!this.editor.getReadOnly()) - this.editor.replace(this.replaceInput.value); - }; - this.replaceAndFindNext = function() { - if (!this.editor.getReadOnly()) { - this.editor.replace(this.replaceInput.value); - this.findNext() - } - }; - this.replaceAll = function() { - if (!this.editor.getReadOnly()) - this.editor.replaceAll(this.replaceInput.value); - }; - - this.hide = function() { - this.element.style.display = "none"; - this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); - this.editor.focus(); - }; - this.show = function(value, isReplace) { - this.element.style.display = ""; - this.replaceBox.style.display = isReplace ? "" : "none"; - - this.isReplace = isReplace; - - if (value) - this.searchInput.value = value; - this.searchInput.focus(); - this.searchInput.select(); - - this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); - }; - -}).call(SearchBox.prototype); - -exports.SearchBox = SearchBox; - -exports.Search = function(editor, isReplace) { - var sb = editor.searchBox || new SearchBox(editor); - sb.show(editor.session.getTextRange(), isReplace); -}; - -}); -; - (function() { - ace.require(["ace/ext/old_ie"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-searchbox.js b/util/build-sample-browser/player/vendor/ace/ext-searchbox.js deleted file mode 100644 index c19124b0f1..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-searchbox.js +++ /dev/null @@ -1,426 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/searchbox', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/event', 'ace/keyboard/hash_handler', 'ace/lib/keys'], function(require, exports, module) { - - -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var event = require("../lib/event"); -var searchboxCss = "\ -/* ------------------------------------------------------------------------------------------\ -* Editor Search Form\ -* --------------------------------------------------------------------------------------- */\ -.ace_search {\ -background-color: #ddd;\ -border: 1px solid #cbcbcb;\ -border-top: 0 none;\ -max-width: 297px;\ -overflow: hidden;\ -margin: 0;\ -padding: 4px;\ -padding-right: 6px;\ -padding-bottom: 0;\ -position: absolute;\ -top: 0px;\ -z-index: 99;\ -white-space: normal;\ -}\ -.ace_search.left {\ -border-left: 0 none;\ -border-radius: 0px 0px 5px 0px;\ -left: 0;\ -}\ -.ace_search.right {\ -border-radius: 0px 0px 0px 5px;\ -border-right: 0 none;\ -right: 0;\ -}\ -.ace_search_form, .ace_replace_form {\ -border-radius: 3px;\ -border: 1px solid #cbcbcb;\ -float: left;\ -margin-bottom: 4px;\ -overflow: hidden;\ -}\ -.ace_search_form.ace_nomatch {\ -outline: 1px solid red;\ -}\ -.ace_search_field {\ -background-color: white;\ -border-right: 1px solid #cbcbcb;\ -border: 0 none;\ --webkit-box-sizing: border-box;\ --moz-box-sizing: border-box;\ -box-sizing: border-box;\ -display: block;\ -float: left;\ -height: 22px;\ -outline: 0;\ -padding: 0 7px;\ -width: 214px;\ -margin: 0;\ -}\ -.ace_searchbtn,\ -.ace_replacebtn {\ -background: #fff;\ -border: 0 none;\ -border-left: 1px solid #dcdcdc;\ -cursor: pointer;\ -display: block;\ -float: left;\ -height: 22px;\ -margin: 0;\ -padding: 0;\ -position: relative;\ -}\ -.ace_searchbtn:last-child,\ -.ace_replacebtn:last-child {\ -border-top-right-radius: 3px;\ -border-bottom-right-radius: 3px;\ -}\ -.ace_searchbtn:disabled {\ -background: none;\ -cursor: default;\ -}\ -.ace_searchbtn {\ -background-position: 50% 50%;\ -background-repeat: no-repeat;\ -width: 27px;\ -}\ -.ace_searchbtn.prev {\ -background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); \ -}\ -.ace_searchbtn.next {\ -background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); \ -}\ -.ace_searchbtn_close {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\ -border-radius: 50%;\ -border: 0 none;\ -color: #656565;\ -cursor: pointer;\ -display: block;\ -float: right;\ -font-family: Arial;\ -font-size: 16px;\ -height: 14px;\ -line-height: 16px;\ -margin: 5px 1px 9px 5px;\ -padding: 0;\ -text-align: center;\ -width: 14px;\ -}\ -.ace_searchbtn_close:hover {\ -background-color: #656565;\ -background-position: 50% 100%;\ -color: white;\ -}\ -.ace_replacebtn.prev {\ -width: 54px\ -}\ -.ace_replacebtn.next {\ -width: 27px\ -}\ -.ace_button {\ -margin-left: 2px;\ -cursor: pointer;\ --webkit-user-select: none;\ --moz-user-select: none;\ --o-user-select: none;\ --ms-user-select: none;\ -user-select: none;\ -overflow: hidden;\ -opacity: 0.7;\ -border: 1px solid rgba(100,100,100,0.23);\ -padding: 1px;\ --moz-box-sizing: border-box;\ -box-sizing: border-box;\ -color: black;\ -}\ -.ace_button:hover {\ -background-color: #eee;\ -opacity:1;\ -}\ -.ace_button:active {\ -background-color: #ddd;\ -}\ -.ace_button.checked {\ -border-color: #3399ff;\ -opacity:1;\ -}\ -.ace_search_options{\ -margin-bottom: 3px;\ -text-align: right;\ --webkit-user-select: none;\ --moz-user-select: none;\ --o-user-select: none;\ --ms-user-select: none;\ -user-select: none;\ -}"; -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var keyUtil = require("../lib/keys"); - -dom.importCssString(searchboxCss, "ace_searchbox"); - -var html = ''.replace(/>\s+/g, ">"); - -var SearchBox = function(editor, range, showReplaceForm) { - var div = dom.createElement("div"); - div.innerHTML = html; - this.element = div.firstChild; - - this.$init(); - this.setEditor(editor); -}; - -(function() { - this.setEditor = function(editor) { - editor.searchBox = this; - editor.container.appendChild(this.element); - this.editor = editor; - }; - - this.$initElements = function(sb) { - this.searchBox = sb.querySelector(".ace_search_form"); - this.replaceBox = sb.querySelector(".ace_replace_form"); - this.searchOptions = sb.querySelector(".ace_search_options"); - this.regExpOption = sb.querySelector("[action=toggleRegexpMode]"); - this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]"); - this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]"); - this.searchInput = this.searchBox.querySelector(".ace_search_field"); - this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); - }; - - this.$init = function() { - var sb = this.element; - - this.$initElements(sb); - - var _this = this; - event.addListener(sb, "mousedown", function(e) { - setTimeout(function(){ - _this.activeInput.focus(); - }, 0); - event.stopPropagation(e); - }); - event.addListener(sb, "click", function(e) { - var t = e.target || e.srcElement; - var action = t.getAttribute("action"); - if (action && _this[action]) - _this[action](); - else if (_this.$searchBarKb.commands[action]) - _this.$searchBarKb.commands[action].exec(_this); - event.stopPropagation(e); - }); - - event.addCommandKeyListener(sb, function(e, hashId, keyCode) { - var keyString = keyUtil.keyCodeToString(keyCode); - var command = _this.$searchBarKb.findKeyCommand(hashId, keyString); - if (command && command.exec) { - command.exec(_this); - event.stopEvent(e); - } - }); - - this.$onChange = lang.delayedCall(function() { - _this.find(false, false); - }); - - event.addListener(this.searchInput, "input", function() { - _this.$onChange.schedule(20); - }); - event.addListener(this.searchInput, "focus", function() { - _this.activeInput = _this.searchInput; - _this.searchInput.value && _this.highlight(); - }); - event.addListener(this.replaceInput, "focus", function() { - _this.activeInput = _this.replaceInput; - _this.searchInput.value && _this.highlight(); - }); - }; - this.$closeSearchBarKb = new HashHandler([{ - bindKey: "Esc", - name: "closeSearchBar", - exec: function(editor) { - editor.searchBox.hide(); - } - }]); - this.$searchBarKb = new HashHandler(); - this.$searchBarKb.bindKeys({ - "Ctrl-f|Command-f|Ctrl-H|Command-Option-F": function(sb) { - var isReplace = sb.isReplace = !sb.isReplace; - sb.replaceBox.style.display = isReplace ? "" : "none"; - sb[isReplace ? "replaceInput" : "searchInput"].focus(); - }, - "Ctrl-G|Command-G": function(sb) { - sb.findNext(); - }, - "Ctrl-Shift-G|Command-Shift-G": function(sb) { - sb.findPrev(); - }, - "esc": function(sb) { - setTimeout(function() { sb.hide();}); - }, - "Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findNext(); - }, - "Shift-Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findPrev(); - }, - "Tab": function(sb) { - (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus(); - } - }); - - this.$searchBarKb.addCommands([{ - name: "toggleRegexpMode", - bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"}, - exec: function(sb) { - sb.regExpOption.checked = !sb.regExpOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleCaseSensitive", - bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"}, - exec: function(sb) { - sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleWholeWords", - bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"}, - exec: function(sb) { - sb.wholeWordOption.checked = !sb.wholeWordOption.checked; - sb.$syncOptions(); - } - }]); - - this.$syncOptions = function() { - dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked); - dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked); - dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked); - this.find(false, false); - }; - - this.highlight = function(re) { - this.editor.session.highlight(re || this.editor.$search.$options.re); - this.editor.renderer.updateBackMarkers() - }; - this.find = function(skipCurrent, backwards) { - var range = this.editor.find(this.searchInput.value, { - skipCurrent: skipCurrent, - backwards: backwards, - wrap: true, - regExp: this.regExpOption.checked, - caseSensitive: this.caseSensitiveOption.checked, - wholeWord: this.wholeWordOption.checked - }); - var noMatch = !range && this.searchInput.value; - dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); - this.editor._emit("findSearchBox", { match: !noMatch }); - this.highlight(); - }; - this.findNext = function() { - this.find(true, false); - }; - this.findPrev = function() { - this.find(true, true); - }; - this.replace = function() { - if (!this.editor.getReadOnly()) - this.editor.replace(this.replaceInput.value); - }; - this.replaceAndFindNext = function() { - if (!this.editor.getReadOnly()) { - this.editor.replace(this.replaceInput.value); - this.findNext() - } - }; - this.replaceAll = function() { - if (!this.editor.getReadOnly()) - this.editor.replaceAll(this.replaceInput.value); - }; - - this.hide = function() { - this.element.style.display = "none"; - this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); - this.editor.focus(); - }; - this.show = function(value, isReplace) { - this.element.style.display = ""; - this.replaceBox.style.display = isReplace ? "" : "none"; - - this.isReplace = isReplace; - - if (value) - this.searchInput.value = value; - this.searchInput.focus(); - this.searchInput.select(); - - this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); - }; - -}).call(SearchBox.prototype); - -exports.SearchBox = SearchBox; - -exports.Search = function(editor, isReplace) { - var sb = editor.searchBox || new SearchBox(editor); - sb.show(editor.session.getTextRange(), isReplace); -}; - -}); -; - (function() { - ace.require(["ace/ext/searchbox"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-settings_menu.js b/util/build-sample-browser/player/vendor/ace/ext-settings_menu.js deleted file mode 100644 index 5c4950a83e..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-settings_menu.js +++ /dev/null @@ -1,639 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/settings_menu', ['require', 'exports', 'module' , 'ace/ext/menu_tools/generate_settings_menu', 'ace/ext/menu_tools/overlay_page', 'ace/editor'], function(require, exports, module) { - -var generateSettingsMenu = require('./menu_tools/generate_settings_menu').generateSettingsMenu; -var overlayPage = require('./menu_tools/overlay_page').overlayPage; -function showSettingsMenu(editor) { - var sm = document.getElementById('ace_settingsmenu'); - if (!sm) - overlayPage(editor, generateSettingsMenu(editor), '0', '0', '0'); -} -module.exports.init = function(editor) { - var Editor = require("ace/editor").Editor; - Editor.prototype.showSettingsMenu = function() { - showSettingsMenu(this); - }; -}; -}); - -ace.define('ace/ext/menu_tools/generate_settings_menu', ['require', 'exports', 'module' , 'ace/ext/menu_tools/element_generator', 'ace/ext/menu_tools/add_editor_menu_options', 'ace/ext/menu_tools/get_set_functions'], function(require, exports, module) { - -var egen = require('./element_generator'); -var addEditorMenuOptions = require('./add_editor_menu_options').addEditorMenuOptions; -var getSetFunctions = require('./get_set_functions').getSetFunctions; -module.exports.generateSettingsMenu = function generateSettingsMenu (editor) { - var elements = []; - function cleanupElementsList() { - elements.sort(function(a, b) { - var x = a.getAttribute('contains'); - var y = b.getAttribute('contains'); - return x.localeCompare(y); - }); - } - function wrapElements() { - var topmenu = document.createElement('div'); - topmenu.setAttribute('id', 'ace_settingsmenu'); - elements.forEach(function(element) { - topmenu.appendChild(element); - }); - return topmenu; - } - function createNewEntry(obj, clss, item, val) { - var el; - var div = document.createElement('div'); - div.setAttribute('contains', item); - div.setAttribute('class', 'ace_optionsMenuEntry'); - div.setAttribute('style', 'clear: both;'); - - div.appendChild(egen.createLabel( - item.replace(/^set/, '').replace(/([A-Z])/g, ' $1').trim(), - item - )); - - if (Array.isArray(val)) { - el = egen.createSelection(item, val, clss); - el.addEventListener('change', function(e) { - try{ - editor.menuOptions[e.target.id].forEach(function(x) { - if(x.textContent !== e.target.textContent) { - delete x.selected; - } - }); - obj[e.target.id](e.target.value); - } catch (err) { - throw new Error(err); - } - }); - } else if(typeof val === 'boolean') { - el = egen.createCheckbox(item, val, clss); - el.addEventListener('change', function(e) { - try{ - obj[e.target.id](!!e.target.checked); - } catch (err) { - throw new Error(err); - } - }); - } else { - el = egen.createInput(item, val, clss); - el.addEventListener('change', function(e) { - try{ - if(e.target.value === 'true') { - obj[e.target.id](true); - } else if(e.target.value === 'false') { - obj[e.target.id](false); - } else { - obj[e.target.id](e.target.value); - } - } catch (err) { - throw new Error(err); - } - }); - } - el.style.cssText = 'float:right;'; - div.appendChild(el); - return div; - } - function makeDropdown(item, esr, clss, fn) { - var val = editor.menuOptions[item]; - var currentVal = esr[fn](); - if (typeof currentVal == 'object') - currentVal = currentVal.$id; - val.forEach(function(valuex) { - if (valuex.value === currentVal) - valuex.selected = 'selected'; - }); - return createNewEntry(esr, clss, item, val); - } - function handleSet(setObj) { - var item = setObj.functionName; - var esr = setObj.parentObj; - var clss = setObj.parentName; - var val; - var fn = item.replace(/^set/, 'get'); - if(editor.menuOptions[item] !== undefined) { - elements.push(makeDropdown(item, esr, clss, fn)); - } else if(typeof esr[fn] === 'function') { - try { - val = esr[fn](); - if(typeof val === 'object') { - val = val.$id; - } - elements.push( - createNewEntry(esr, clss, item, val) - ); - } catch (e) { - } - } - } - addEditorMenuOptions(editor); - getSetFunctions(editor).forEach(function(setObj) { - handleSet(setObj); - }); - cleanupElementsList(); - return wrapElements(); -}; - -}); - -ace.define('ace/ext/menu_tools/element_generator', ['require', 'exports', 'module' ], function(require, exports, module) { -module.exports.createOption = function createOption (obj) { - var attribute; - var el = document.createElement('option'); - for(attribute in obj) { - if(obj.hasOwnProperty(attribute)) { - if(attribute === 'selected') { - el.setAttribute(attribute, obj[attribute]); - } else { - el[attribute] = obj[attribute]; - } - } - } - return el; -}; -module.exports.createCheckbox = function createCheckbox (id, checked, clss) { - var el = document.createElement('input'); - el.setAttribute('type', 'checkbox'); - el.setAttribute('id', id); - el.setAttribute('name', id); - el.setAttribute('value', checked); - el.setAttribute('class', clss); - if(checked) { - el.setAttribute('checked', 'checked'); - } - return el; -}; -module.exports.createInput = function createInput (id, value, clss) { - var el = document.createElement('input'); - el.setAttribute('type', 'text'); - el.setAttribute('id', id); - el.setAttribute('name', id); - el.setAttribute('value', value); - el.setAttribute('class', clss); - return el; -}; -module.exports.createLabel = function createLabel (text, labelFor) { - var el = document.createElement('label'); - el.setAttribute('for', labelFor); - el.textContent = text; - return el; -}; -module.exports.createSelection = function createSelection (id, values, clss) { - var el = document.createElement('select'); - el.setAttribute('id', id); - el.setAttribute('name', id); - el.setAttribute('class', clss); - values.forEach(function(item) { - el.appendChild(module.exports.createOption(item)); - }); - return el; -}; - -}); - -ace.define('ace/ext/menu_tools/add_editor_menu_options', ['require', 'exports', 'module' , 'ace/ext/modelist', 'ace/ext/themelist'], function(require, exports, module) { -module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) { - var modelist = require('../modelist'); - var themelist = require('../themelist'); - editor.menuOptions = { - "setNewLineMode" : [{ - "textContent" : "unix", - "value" : "unix" - }, { - "textContent" : "windows", - "value" : "windows" - }, { - "textContent" : "auto", - "value" : "auto" - }], - "setTheme" : [], - "setMode" : [], - "setKeyboardHandler": [{ - "textContent" : "ace", - "value" : "" - }, { - "textContent" : "vim", - "value" : "ace/keyboard/vim" - }, { - "textContent" : "emacs", - "value" : "ace/keyboard/emacs" - }] - }; - - editor.menuOptions.setTheme = themelist.themes.map(function(theme) { - return { - 'textContent' : theme.caption, - 'value' : theme.theme - }; - }); - - editor.menuOptions.setMode = modelist.modes.map(function(mode) { - return { - 'textContent' : mode.name, - 'value' : mode.mode - }; - }); -}; - - -}); -ace.define('ace/ext/modelist', ['require', 'exports', 'module' ], function(require, exports, module) { - - -var modes = []; -function getModeForPath(path) { - var mode = modesByName.text; - var fileName = path.split(/[\/\\]/).pop(); - for (var i = 0; i < modes.length; i++) { - if (modes[i].supportsFile(fileName)) { - mode = modes[i]; - break; - } - } - return mode; -} - -var Mode = function(name, caption, extensions) { - this.name = name; - this.caption = caption; - this.mode = "ace/mode/" + name; - this.extensions = extensions; - if (/\^/.test(extensions)) { - var re = extensions.replace(/\|(\^)?/g, function(a, b){ - return "$|" + (b ? "^" : "^.*\\."); - }) + "$"; - } else { - var re = "^.*\\.(" + extensions + ")$"; - } - - this.extRe = new RegExp(re, "gi"); -}; - -Mode.prototype.supportsFile = function(filename) { - return filename.match(this.extRe); -}; -var supportedModes = { - ABAP: ["abap"], - ActionScript:["as"], - ADA: ["ada|adb"], - Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], - AsciiDoc: ["asciidoc"], - Assembly_x86:["asm"], - AutoHotKey: ["ahk"], - BatchFile: ["bat|cmd"], - C9Search: ["c9search_results"], - C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp"], - Cirru: ["cirru|cr"], - Clojure: ["clj"], - Cobol: ["CBL|COB"], - coffee: ["coffee|cf|cson|^Cakefile"], - ColdFusion: ["cfm"], - CSharp: ["cs"], - CSS: ["css"], - Curly: ["curly"], - D: ["d|di"], - Dart: ["dart"], - Diff: ["diff|patch"], - Dot: ["dot"], - Erlang: ["erl|hrl"], - EJS: ["ejs"], - Forth: ["frt|fs|ldr"], - FTL: ["ftl"], - Gherkin: ["feature"], - Glsl: ["glsl|frag|vert"], - golang: ["go"], - Groovy: ["groovy"], - HAML: ["haml"], - Handlebars: ["hbs|handlebars|tpl|mustache"], - Haskell: ["hs"], - haXe: ["hx"], - HTML: ["html|htm|xhtml"], - HTML_Ruby: ["erb|rhtml|html.erb"], - INI: ["ini|conf|cfg|prefs"], - Jack: ["jack"], - Jade: ["jade"], - Java: ["java"], - JavaScript: ["js|jsm"], - JSON: ["json"], - JSONiq: ["jq"], - JSP: ["jsp"], - JSX: ["jsx"], - Julia: ["jl"], - LaTeX: ["tex|latex|ltx|bib"], - LESS: ["less"], - Liquid: ["liquid"], - Lisp: ["lisp"], - LiveScript: ["ls"], - LogiQL: ["logic|lql"], - LSL: ["lsl"], - Lua: ["lua"], - LuaPage: ["lp"], - Lucene: ["lucene"], - Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], - MATLAB: ["matlab"], - Markdown: ["md|markdown"], - MEL: ["mel"], - MySQL: ["mysql"], - MUSHCode: ["mc|mush"], - Nix: ["nix"], - ObjectiveC: ["m|mm"], - OCaml: ["ml|mli"], - Pascal: ["pas|p"], - Perl: ["pl|pm"], - pgSQL: ["pgsql"], - PHP: ["php|phtml"], - Powershell: ["ps1"], - Prolog: ["plg|prolog"], - Properties: ["properties"], - Protobuf: ["proto"], - Python: ["py"], - R: ["r"], - RDoc: ["Rd"], - RHTML: ["Rhtml"], - Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], - Rust: ["rs"], - SASS: ["sass"], - SCAD: ["scad"], - Scala: ["scala"], - Smarty: ["smarty|tpl"], - Scheme: ["scm|rkt"], - SCSS: ["scss"], - SH: ["sh|bash|^.bashrc"], - SJS: ["sjs"], - Space: ["space"], - snippets: ["snippets"], - Soy_Template:["soy"], - SQL: ["sql"], - Stylus: ["styl|stylus"], - SVG: ["svg"], - Tcl: ["tcl"], - Tex: ["tex"], - Text: ["txt"], - Textile: ["textile"], - Toml: ["toml"], - Twig: ["twig"], - Typescript: ["ts|typescript|str"], - VBScript: ["vbs"], - Velocity: ["vm"], - Verilog: ["v|vh|sv|svh"], - XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], - XQuery: ["xq"], - YAML: ["yaml|yml"] -}; - -var nameOverrides = { - ObjectiveC: "Objective-C", - CSharp: "C#", - golang: "Go", - C_Cpp: "C/C++", - coffee: "CoffeeScript", - HTML_Ruby: "HTML (Ruby)", - FTL: "FreeMarker" -}; -var modesByName = {}; -for (var name in supportedModes) { - var data = supportedModes[name]; - var displayName = (nameOverrides[name] || name).replace(/_/g, " "); - var filename = name.toLowerCase(); - var mode = new Mode(filename, displayName, data[0]); - modesByName[filename] = mode; - modes.push(mode); -} - -module.exports = { - getModeForPath: getModeForPath, - modes: modes, - modesByName: modesByName -}; - -}); - -ace.define('ace/ext/themelist', ['require', 'exports', 'module' ], function(require, exports, module) { - - -var themeData = [ - ["Chrome" ], - ["Clouds" ], - ["Crimson Editor" ], - ["Dawn" ], - ["Dreamweaver" ], - ["Eclipse" ], - ["GitHub" ], - ["Solarized Light"], - ["TextMate" ], - ["Tomorrow" ], - ["XCode" ], - ["Kuroir"], - ["KatzenMilch"], - ["Ambiance" ,"ambiance" , "dark"], - ["Chaos" ,"chaos" , "dark"], - ["Clouds Midnight" ,"clouds_midnight" , "dark"], - ["Cobalt" ,"cobalt" , "dark"], - ["idle Fingers" ,"idle_fingers" , "dark"], - ["krTheme" ,"kr_theme" , "dark"], - ["Merbivore" ,"merbivore" , "dark"], - ["Merbivore Soft" ,"merbivore_soft" , "dark"], - ["Mono Industrial" ,"mono_industrial" , "dark"], - ["Monokai" ,"monokai" , "dark"], - ["Pastel on dark" ,"pastel_on_dark" , "dark"], - ["Solarized Dark" ,"solarized_dark" , "dark"], - ["Terminal" ,"terminal" , "dark"], - ["Tomorrow Night" ,"tomorrow_night" , "dark"], - ["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"], - ["Tomorrow Night Bright","tomorrow_night_bright" , "dark"], - ["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"], - ["Twilight" ,"twilight" , "dark"], - ["Vibrant Ink" ,"vibrant_ink" , "dark"] -]; - - -exports.themesByName = {}; -exports.themes = themeData.map(function(data) { - var name = data[1] || data[0].replace(/ /g, "_").toLowerCase(); - var theme = { - caption: data[0], - theme: "ace/theme/" + name, - isDark: data[2] == "dark", - name: name - }; - exports.themesByName[name] = theme; - return theme; -}); - -}); - -ace.define('ace/ext/menu_tools/get_set_functions', ['require', 'exports', 'module' ], function(require, exports, module) { -module.exports.getSetFunctions = function getSetFunctions (editor) { - var out = []; - var my = { - 'editor' : editor, - 'session' : editor.session, - 'renderer' : editor.renderer - }; - var opts = []; - var skip = [ - 'setOption', - 'setUndoManager', - 'setDocument', - 'setValue', - 'setBreakpoints', - 'setScrollTop', - 'setScrollLeft', - 'setSelectionStyle', - 'setWrapLimitRange' - ]; - ['renderer', 'session', 'editor'].forEach(function(esra) { - var esr = my[esra]; - var clss = esra; - for(var fn in esr) { - if(skip.indexOf(fn) === -1) { - if(/^set/.test(fn) && opts.indexOf(fn) === -1) { - opts.push(fn); - out.push({ - 'functionName' : fn, - 'parentObj' : esr, - 'parentName' : clss - }); - } - } - } - }); - return out; -}; - -}); - -ace.define('ace/ext/menu_tools/overlay_page', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -var dom = require("../../lib/dom"); -var cssText = "#ace_settingsmenu, #kbshortcutmenu {\ -background-color: #F7F7F7;\ -color: black;\ -box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\ -padding: 1em 0.5em 2em 1em;\ -overflow: auto;\ -position: absolute;\ -margin: 0;\ -bottom: 0;\ -right: 0;\ -top: 0;\ -z-index: 9991;\ -cursor: default;\ -}\ -.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\ -box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\ -background-color: rgba(255, 255, 255, 0.6);\ -color: black;\ -}\ -.ace_optionsMenuEntry:hover {\ -background-color: rgba(100, 100, 100, 0.1);\ --webkit-transition: all 0.5s;\ -transition: all 0.3s\ -}\ -.ace_closeButton {\ -background: rgba(245, 146, 146, 0.5);\ -border: 1px solid #F48A8A;\ -border-radius: 50%;\ -padding: 7px;\ -position: absolute;\ -right: -8px;\ -top: -8px;\ -z-index: 1000;\ -}\ -.ace_closeButton{\ -background: rgba(245, 146, 146, 0.9);\ -}\ -.ace_optionsMenuKey {\ -color: darkslateblue;\ -font-weight: bold;\ -}\ -.ace_optionsMenuCommand {\ -color: darkcyan;\ -font-weight: normal;\ -}"; -dom.importCssString(cssText); -module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) { - top = top ? 'top: ' + top + ';' : ''; - bottom = bottom ? 'bottom: ' + bottom + ';' : ''; - right = right ? 'right: ' + right + ';' : ''; - left = left ? 'left: ' + left + ';' : ''; - - var closer = document.createElement('div'); - var contentContainer = document.createElement('div'); - - function documentEscListener(e) { - if (e.keyCode === 27) { - closer.click(); - } - } - - closer.style.cssText = 'margin: 0; padding: 0; ' + - 'position: fixed; top:0; bottom:0; left:0; right:0;' + - 'z-index: 9990; ' + - 'background-color: rgba(0, 0, 0, 0.3);'; - closer.addEventListener('click', function() { - document.removeEventListener('keydown', documentEscListener); - closer.parentNode.removeChild(closer); - editor.focus(); - closer = null; - }); - document.addEventListener('keydown', documentEscListener); - - contentContainer.style.cssText = top + right + bottom + left; - contentContainer.addEventListener('click', function(e) { - e.stopPropagation(); - }); - - var wrapper = dom.createElement("div"); - wrapper.style.position = "relative"; - - var closeButton = dom.createElement("div"); - closeButton.className = "ace_closeButton"; - closeButton.addEventListener('click', function() { - closer.click(); - }); - - wrapper.appendChild(closeButton); - contentContainer.appendChild(wrapper); - - contentContainer.appendChild(contentElement); - closer.appendChild(contentContainer); - document.body.appendChild(closer); - editor.blur(); -}; - -});; - (function() { - ace.require(["ace/ext/settings_menu"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-spellcheck.js b/util/build-sample-browser/player/vendor/ace/ext-spellcheck.js deleted file mode 100644 index ba5ebae775..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-spellcheck.js +++ /dev/null @@ -1,73 +0,0 @@ -ace.define('ace/ext/spellcheck', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/editor', 'ace/config'], function(require, exports, module) { - -var event = require("../lib/event"); - -exports.contextMenuHandler = function(e){ - var host = e.target; - var text = host.textInput.getElement(); - if (!host.selection.isEmpty()) - return; - var c = host.getCursorPosition(); - var r = host.session.getWordRange(c.row, c.column); - var w = host.session.getTextRange(r); - - host.session.tokenRe.lastIndex = 0; - if (!host.session.tokenRe.test(w)) - return; - var PLACEHOLDER = "\x01\x01"; - var value = w + " " + PLACEHOLDER; - text.value = value; - text.setSelectionRange(w.length, w.length + 1); - text.setSelectionRange(0, 0); - text.setSelectionRange(0, w.length); - - var afterKeydown = false; - event.addListener(text, "keydown", function onKeydown() { - event.removeListener(text, "keydown", onKeydown); - afterKeydown = true; - }); - - host.textInput.setInputHandler(function(newVal) { - console.log(newVal , value, text.selectionStart, text.selectionEnd) - if (newVal == value) - return ''; - if (newVal.lastIndexOf(value, 0) === 0) - return newVal.slice(value.length); - if (newVal.substr(text.selectionEnd) == value) - return newVal.slice(0, -value.length); - if (newVal.slice(-2) == PLACEHOLDER) { - var val = newVal.slice(0, -2); - if (val.slice(-1) == " ") { - if (afterKeydown) - return val.substring(0, text.selectionEnd); - val = val.slice(0, -1); - host.session.replace(r, val); - return ""; - } - } - - return newVal; - }); -}; -var Editor = require("../editor").Editor; -require("../config").defineOptions(Editor.prototype, "editor", { - spellcheck: { - set: function(val) { - var text = this.textInput.getElement(); - text.spellcheck = !!val; - if (!val) - this.removeListener("nativecontextmenu", exports.contextMenuHandler); - else - this.on("nativecontextmenu", exports.contextMenuHandler); - }, - value: true - } -}); - -}); - -; - (function() { - ace.require(["ace/ext/spellcheck"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-split.js b/util/build-sample-browser/player/vendor/ace/ext-split.js deleted file mode 100644 index b1e63a5f88..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-split.js +++ /dev/null @@ -1,276 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/split', ['require', 'exports', 'module' , 'ace/split'], function(require, exports, module) { -module.exports = require("../split"); - -}); - -ace.define('ace/split', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/lib/event_emitter', 'ace/editor', 'ace/virtual_renderer', 'ace/edit_session'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var lang = require("./lib/lang"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - -var Editor = require("./editor").Editor; -var Renderer = require("./virtual_renderer").VirtualRenderer; -var EditSession = require("./edit_session").EditSession; - - -var Split = function(container, theme, splits) { - this.BELOW = 1; - this.BESIDE = 0; - - this.$container = container; - this.$theme = theme; - this.$splits = 0; - this.$editorCSS = ""; - this.$editors = []; - this.$orientation = this.BESIDE; - - this.setSplits(splits || 1); - this.$cEditor = this.$editors[0]; - - - this.on("focus", function(editor) { - this.$cEditor = editor; - }.bind(this)); -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.$createEditor = function() { - var el = document.createElement("div"); - el.className = this.$editorCSS; - el.style.cssText = "position: absolute; top:0px; bottom:0px"; - this.$container.appendChild(el); - var editor = new Editor(new Renderer(el, this.$theme)); - - editor.on("focus", function() { - this._emit("focus", editor); - }.bind(this)); - - this.$editors.push(editor); - editor.setFontSize(this.$fontSize); - return editor; - }; - - this.setSplits = function(splits) { - var editor; - if (splits < 1) { - throw "The number of splits have to be > 0!"; - } - - if (splits == this.$splits) { - return; - } else if (splits > this.$splits) { - while (this.$splits < this.$editors.length && this.$splits < splits) { - editor = this.$editors[this.$splits]; - this.$container.appendChild(editor.container); - editor.setFontSize(this.$fontSize); - this.$splits ++; - } - while (this.$splits < splits) { - this.$createEditor(); - this.$splits ++; - } - } else { - while (this.$splits > splits) { - editor = this.$editors[this.$splits - 1]; - this.$container.removeChild(editor.container); - this.$splits --; - } - } - this.resize(); - }; - this.getSplits = function() { - return this.$splits; - }; - this.getEditor = function(idx) { - return this.$editors[idx]; - }; - this.getCurrentEditor = function() { - return this.$cEditor; - }; - this.focus = function() { - this.$cEditor.focus(); - }; - this.blur = function() { - this.$cEditor.blur(); - }; - this.setTheme = function(theme) { - this.$editors.forEach(function(editor) { - editor.setTheme(theme); - }); - }; - this.setKeyboardHandler = function(keybinding) { - this.$editors.forEach(function(editor) { - editor.setKeyboardHandler(keybinding); - }); - }; - this.forEach = function(callback, scope) { - this.$editors.forEach(callback, scope); - }; - - - this.$fontSize = ""; - this.setFontSize = function(size) { - this.$fontSize = size; - this.forEach(function(editor) { - editor.setFontSize(size); - }); - }; - - this.$cloneSession = function(session) { - var s = new EditSession(session.getDocument(), session.getMode()); - - var undoManager = session.getUndoManager(); - if (undoManager) { - var undoManagerProxy = new UndoManagerProxy(undoManager, s); - s.setUndoManager(undoManagerProxy); - } - s.$informUndoManager = lang.delayedCall(function() { s.$deltas = []; }); - s.setTabSize(session.getTabSize()); - s.setUseSoftTabs(session.getUseSoftTabs()); - s.setOverwrite(session.getOverwrite()); - s.setBreakpoints(session.getBreakpoints()); - s.setUseWrapMode(session.getUseWrapMode()); - s.setUseWorker(session.getUseWorker()); - s.setWrapLimitRange(session.$wrapLimitRange.min, - session.$wrapLimitRange.max); - s.$foldData = session.$cloneFoldData(); - - return s; - }; - this.setSession = function(session, idx) { - var editor; - if (idx == null) { - editor = this.$cEditor; - } else { - editor = this.$editors[idx]; - } - var isUsed = this.$editors.some(function(editor) { - return editor.session === session; - }); - - if (isUsed) { - session = this.$cloneSession(session); - } - editor.setSession(session); - return session; - }; - this.getOrientation = function() { - return this.$orientation; - }; - this.setOrientation = function(orientation) { - if (this.$orientation == orientation) { - return; - } - this.$orientation = orientation; - this.resize(); - }; - this.resize = function() { - var width = this.$container.clientWidth; - var height = this.$container.clientHeight; - var editor; - - if (this.$orientation == this.BESIDE) { - var editorWidth = width / this.$splits; - for (var i = 0; i < this.$splits; i++) { - editor = this.$editors[i]; - editor.container.style.width = editorWidth + "px"; - editor.container.style.top = "0px"; - editor.container.style.left = i * editorWidth + "px"; - editor.container.style.height = height + "px"; - editor.resize(); - } - } else { - var editorHeight = height / this.$splits; - for (var i = 0; i < this.$splits; i++) { - editor = this.$editors[i]; - editor.container.style.width = width + "px"; - editor.container.style.top = i * editorHeight + "px"; - editor.container.style.left = "0px"; - editor.container.style.height = editorHeight + "px"; - editor.resize(); - } - } - }; - -}).call(Split.prototype); - - -function UndoManagerProxy(undoManager, session) { - this.$u = undoManager; - this.$doc = session; -} - -(function() { - this.execute = function(options) { - this.$u.execute(options); - }; - - this.undo = function() { - var selectionRange = this.$u.undo(true); - if (selectionRange) { - this.$doc.selection.setSelectionRange(selectionRange); - } - }; - - this.redo = function() { - var selectionRange = this.$u.redo(true); - if (selectionRange) { - this.$doc.selection.setSelectionRange(selectionRange); - } - }; - - this.reset = function() { - this.$u.reset(); - }; - - this.hasUndo = function() { - return this.$u.hasUndo(); - }; - - this.hasRedo = function() { - return this.$u.hasRedo(); - }; -}).call(UndoManagerProxy.prototype); - -exports.Split = Split; -}); -; - (function() { - ace.require(["ace/ext/split"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-static_highlight.js b/util/build-sample-browser/player/vendor/ace/ext-static_highlight.js deleted file mode 100644 index 3057a2b866..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-static_highlight.js +++ /dev/null @@ -1,183 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/static_highlight', ['require', 'exports', 'module' , 'ace/edit_session', 'ace/layer/text', 'ace/config', 'ace/lib/dom'], function(require, exports, module) { - - -var EditSession = require("../edit_session").EditSession; -var TextLayer = require("../layer/text").Text; -var baseStyles = ".ace_static_highlight {\ -font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\ -font-size: 12px;\ -}\ -.ace_static_highlight .ace_gutter {\ -width: 25px !important;\ -display: block;\ -float: left;\ -text-align: right;\ -padding: 0 3px 0 0;\ -margin-right: 3px;\ -position: static !important;\ -}\ -.ace_static_highlight .ace_line { clear: both; }\ -.ace_static_highlight .ace_gutter-cell {\ --moz-user-select: -moz-none;\ --khtml-user-select: none;\ --webkit-user-select: none;\ -user-select: none;\ -}\ -.ace_static_highlight .ace_gutter-cell:before {\ -content: counter(ace_line, decimal);\ -counter-increment: ace_line;\ -}\ -.ace_static_highlight {\ -counter-reset: ace_line;\ -}\ -"; -var config = require("../config"); -var dom = require("../lib/dom"); - - -var highlight = function(el, opts, callback) { - var m = el.className.match(/lang-(\w+)/); - var mode = opts.mode || m && ("ace/mode/" + m[1]); - if (!mode) - return false; - var theme = opts.theme || "ace/theme/textmate"; - - var data = ""; - var nodes = []; - - if (el.firstElementChild) { - var textLen = 0; - for (var i = 0; i < el.childNodes.length; i++) { - var ch = el.childNodes[i]; - if (ch.nodeType == 3) { - textLen += ch.data.length; - data += ch.data; - } else { - nodes.push(textLen, ch); - } - } - } else { - data = dom.getInnerText(el); - if (opts.trim) - data = data.trim(); - } - - highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) { - dom.importCssString(highlighted.css, "ace_highlight"); - el.innerHTML = highlighted.html; - var container = el.firstChild.firstChild; - for (var i = 0; i < nodes.length; i += 2) { - var pos = highlighted.session.doc.indexToPosition(nodes[i]); - var node = nodes[i + 1]; - var lineEl = container.children[pos.row]; - lineEl && lineEl.appendChild(node); - } - callback && callback(); - }); -}; - -highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) { - var waiting = 0; - var modeCache = EditSession.prototype.$modes; - if (typeof theme == "string") { - waiting++; - config.loadModule(['theme', theme], function(m) { - theme = m; - --waiting || done(); - }); - } - - if (typeof mode == "string") { - waiting++; - config.loadModule(['mode', mode], function(m) { - if (!modeCache[mode]) modeCache[mode] = new m.Mode(); - mode = modeCache[mode]; - --waiting || done(); - }); - } - function done() { - var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter); - return callback ? callback(result) : result; - } - return waiting || done(); -}; - -highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) { - lineStart = parseInt(lineStart || 1, 10); - - var session = new EditSession(""); - session.setUseWorker(false); - session.setMode(mode); - - var textLayer = new TextLayer(document.createElement("div")); - textLayer.setSession(session); - textLayer.config = { - characterWidth: 10, - lineHeight: 20 - }; - - session.setValue(input); - - var stringBuilder = []; - var length = session.getLength(); - - for(var ix = 0; ix < length; ix++) { - stringBuilder.push("
    "); - if (!disableGutter) - stringBuilder.push("" + /*(ix + lineStart) + */ ""); - textLayer.$renderLine(stringBuilder, ix, true, false); - stringBuilder.push("\n
    "); - } - var html = "
    " + - "
    " + - stringBuilder.join("") + - "
    " + - "
    "; - - textLayer.destroy(); - - return { - css: baseStyles + theme.cssText, - html: html, - session: session - }; -}; - -module.exports = highlight; -module.exports.highlight =highlight; -}); -; - (function() { - ace.require(["ace/ext/static_highlight"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-statusbar.js b/util/build-sample-browser/player/vendor/ace/ext-statusbar.js deleted file mode 100644 index f55922e7be..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-statusbar.js +++ /dev/null @@ -1,51 +0,0 @@ -ace.define('ace/ext/statusbar', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/lang'], function(require, exports, module) { -var dom = require("ace/lib/dom"); -var lang = require("ace/lib/lang"); - -var StatusBar = function(editor, parentNode) { - this.element = dom.createElement("div"); - this.element.className = "ace_status-indicator"; - this.element.style.cssText = "display: inline-block;"; - parentNode.appendChild(this.element); - - var statusUpdate = lang.delayedCall(function(){ - this.updateStatus(editor) - }.bind(this)); - editor.on("changeStatus", function() { - statusUpdate.schedule(100); - }); - editor.on("changeSelection", function() { - statusUpdate.schedule(100); - }); -}; - -(function(){ - this.updateStatus = function(editor) { - var status = []; - function add(str, separator) { - str && status.push(str, separator || "|"); - } - - if (editor.$vimModeHandler) - add(editor.$vimModeHandler.getStatusText()); - else if (editor.commands.recording) - add("REC"); - - var c = editor.selection.lead; - add(c.row + ":" + c.column, " "); - if (!editor.selection.isEmpty()) { - var r = editor.getSelectionRange(); - add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")"); - } - status.pop(); - this.element.textContent = status.join(""); - }; -}).call(StatusBar.prototype); - -exports.StatusBar = StatusBar; - -});; - (function() { - ace.require(["ace/ext/statusbar"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-textarea.js b/util/build-sample-browser/player/vendor/ace/ext-textarea.js deleted file mode 100644 index 91891735a3..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-textarea.js +++ /dev/null @@ -1,483 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/textarea', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/lib/useragent', 'ace/lib/net', 'ace/ace', 'ace/theme/textmate', 'ace/mode/text'], function(require, exports, module) { - - -var event = require("../lib/event"); -var UA = require("../lib/useragent"); -var net = require("../lib/net"); -var ace = require("../ace"); - -require("../theme/textmate"); - -module.exports = exports = ace; -var getCSSProperty = function(element, container, property) { - var ret = element.style[property]; - - if (!ret) { - if (window.getComputedStyle) { - ret = window.getComputedStyle(element, '').getPropertyValue(property); - } else { - ret = element.currentStyle[property]; - } - } - - if (!ret || ret == 'auto' || ret == 'intrinsic') { - ret = container.style[property]; - } - return ret; -}; - -function applyStyles(elm, styles) { - for (var style in styles) { - elm.style[style] = styles[style]; - } -} - -function setupContainer(element, getValue) { - if (element.type != 'textarea') { - throw new Error("Textarea required!"); - } - - var parentNode = element.parentNode; - var container = document.createElement('div'); - var resizeEvent = function() { - var style = 'position:relative;'; - [ - 'margin-top', 'margin-left', 'margin-right', 'margin-bottom' - ].forEach(function(item) { - style += item + ':' + - getCSSProperty(element, container, item) + ';'; - }); - var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px"); - var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px"); - style += 'height:' + height + ';width:' + width + ';'; - style += 'display:inline-block;'; - container.setAttribute('style', style); - }; - event.addListener(window, 'resize', resizeEvent); - resizeEvent(); - parentNode.insertBefore(container, element.nextSibling); - while (parentNode !== document) { - if (parentNode.tagName.toUpperCase() === 'FORM') { - var oldSumit = parentNode.onsubmit; - parentNode.onsubmit = function(evt) { - element.value = getValue(); - if (oldSumit) { - oldSumit.call(this, evt); - } - }; - break; - } - parentNode = parentNode.parentNode; - } - return container; -} - -exports.transformTextarea = function(element, loader) { - var session; - var container = setupContainer(element, function() { - return session.getValue(); - }); - element.style.display = 'none'; - container.style.background = 'white'; - var editorDiv = document.createElement("div"); - applyStyles(editorDiv, { - top: "0px", - left: "0px", - right: "0px", - bottom: "0px", - border: "1px solid gray", - position: "absolute" - }); - container.appendChild(editorDiv); - - var settingOpener = document.createElement("div"); - applyStyles(settingOpener, { - position: "absolute", - right: "0px", - bottom: "0px", - background: "red", - cursor: "nw-resize", - borderStyle: "solid", - borderWidth: "9px 8px 10px 9px", - width: "2px", - borderColor: "lightblue gray gray lightblue", - zIndex: 101 - }); - - var settingDiv = document.createElement("div"); - var settingDivStyles = { - top: "0px", - left: "20%", - right: "0px", - bottom: "0px", - position: "absolute", - padding: "5px", - zIndex: 100, - color: "white", - display: "none", - overflow: "auto", - fontSize: "14px", - boxShadow: "-5px 2px 3px gray" - }; - if (!UA.isOldIE) { - settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)"; - } else { - settingDivStyles.backgroundColor = "#333"; - } - - applyStyles(settingDiv, settingDivStyles); - container.appendChild(settingDiv); - var options = {}; - - var editor = ace.edit(editorDiv); - session = editor.getSession(); - - session.setValue(element.value || element.innerHTML); - editor.focus(); - container.appendChild(settingOpener); - setupApi(editor, editorDiv, settingDiv, ace, options, loader); - setupSettingPanel(settingDiv, settingOpener, editor, options); - - var state = ""; - event.addListener(settingOpener, "mousemove", function(e) { - var rect = this.getBoundingClientRect(); - var x = e.clientX - rect.left, y = e.clientY - rect.top; - if (x + y < (rect.width + rect.height)/2) { - this.style.cursor = "pointer"; - state = "toggle"; - } else { - state = "resize"; - this.style.cursor = "nw-resize"; - } - }); - - event.addListener(settingOpener, "mousedown", function(e) { - if (state == "toggle") { - editor.setDisplaySettings(); - return; - } - container.style.zIndex = 100000; - var rect = container.getBoundingClientRect(); - var startX = rect.width + rect.left - e.clientX; - var startY = rect.height + rect.top - e.clientY; - event.capture(settingOpener, function(e) { - container.style.width = e.clientX - rect.left + startX + "px"; - container.style.height = e.clientY - rect.top + startY + "px"; - editor.resize(); - }, function() {}); - }); - - return editor; -}; - -function load(url, module, callback) { - net.loadScript(url, function() { - require([module], callback); - }); -} - -function setupApi(editor, editorDiv, settingDiv, ace, options, loader) { - var session = editor.getSession(); - var renderer = editor.renderer; - loader = loader || load; - - function toBool(value) { - return value === "true" || value == true; - } - - editor.setDisplaySettings = function(display) { - if (display == null) - display = settingDiv.style.display == "none"; - if (display) { - settingDiv.style.display = "block"; - settingDiv.hideButton.focus(); - editor.on("focus", function onFocus() { - editor.removeListener("focus", onFocus); - settingDiv.style.display = "none"; - }); - } else { - editor.focus(); - } - }; - - editor.$setOption = editor.setOption; - editor.setOption = function(key, value) { - if (options[key] == value) return; - - switch (key) { - case "mode": - if (value != "text") { - loader("mode-" + value + ".js", "ace/mode/" + value, function() { - var aceMode = require("../mode/" + value).Mode; - session.setMode(new aceMode()); - }); - } else { - session.setMode(new (require("../mode/text").Mode)); - } - break; - - case "theme": - if (value != "textmate") { - loader("theme-" + value + ".js", "ace/theme/" + value, function() { - editor.setTheme("ace/theme/" + value); - }); - } else { - editor.setTheme("ace/theme/textmate"); - } - break; - - case "fontSize": - editorDiv.style.fontSize = value; - break; - - case "keybindings": - switch (value) { - case "vim": - editor.setKeyboardHandler("ace/keyboard/vim"); - break; - case "emacs": - editor.setKeyboardHandler("ace/keyboard/emacs"); - break; - default: - editor.setKeyboardHandler(null); - } - break; - - case "softWrap": - switch (value) { - case "off": - session.setUseWrapMode(false); - renderer.setPrintMarginColumn(80); - break; - case "40": - session.setUseWrapMode(true); - session.setWrapLimitRange(40, 40); - renderer.setPrintMarginColumn(40); - break; - case "80": - session.setUseWrapMode(true); - session.setWrapLimitRange(80, 80); - renderer.setPrintMarginColumn(80); - break; - case "free": - session.setUseWrapMode(true); - session.setWrapLimitRange(null, null); - renderer.setPrintMarginColumn(80); - break; - } - break; - - default: - editor.$setOption(key, toBool(value)); - } - - options[key] = value; - }; - - editor.getOption = function(key) { - return options[key]; - }; - - editor.getOptions = function() { - return options; - }; - - editor.setOptions(exports.options); - - return editor; -} - -function setupSettingPanel(settingDiv, settingOpener, editor, options) { - var BOOL = null; - - var desc = { - mode: "Mode:", - gutter: "Display Gutter:", - theme: "Theme:", - fontSize: "Font Size:", - softWrap: "Soft Wrap:", - keybindings: "Keyboard", - showPrintMargin: "Show Print Margin:", - useSoftTabs: "Use Soft Tabs:", - showInvisibles: "Show Invisibles" - }; - - var optionValues = { - mode: { - text: "Plain", - javascript: "JavaScript", - xml: "XML", - html: "HTML", - css: "CSS", - scss: "SCSS", - python: "Python", - php: "PHP", - java: "Java", - ruby: "Ruby", - c_cpp: "C/C++", - coffee: "CoffeeScript", - json: "json", - perl: "Perl", - clojure: "Clojure", - ocaml: "OCaml", - csharp: "C#", - haxe: "haXe", - svg: "SVG", - textile: "Textile", - groovy: "Groovy", - liquid: "Liquid", - Scala: "Scala" - }, - theme: { - clouds: "Clouds", - clouds_midnight: "Clouds Midnight", - cobalt: "Cobalt", - crimson_editor: "Crimson Editor", - dawn: "Dawn", - eclipse: "Eclipse", - idle_fingers: "Idle Fingers", - kr_theme: "Kr Theme", - merbivore: "Merbivore", - merbivore_soft: "Merbivore Soft", - mono_industrial: "Mono Industrial", - monokai: "Monokai", - pastel_on_dark: "Pastel On Dark", - solarized_dark: "Solarized Dark", - solarized_light: "Solarized Light", - textmate: "Textmate", - twilight: "Twilight", - vibrant_ink: "Vibrant Ink" - }, - gutter: BOOL, - fontSize: { - "10px": "10px", - "11px": "11px", - "12px": "12px", - "14px": "14px", - "16px": "16px" - }, - softWrap: { - off: "Off", - 40: "40", - 80: "80", - free: "Free" - }, - keybindings: { - ace: "ace", - vim: "vim", - emacs: "emacs" - }, - showPrintMargin: BOOL, - useSoftTabs: BOOL, - showInvisibles: BOOL - }; - - var table = []; - table.push("
    "); - - function renderOption(builder, option, obj, cValue) { - if (!obj) { - builder.push( - "" - ); - return; - } - builder.push(""); - } - - for (var option in options) { - table.push(""); - table.push(""); - } - table.push("
    SettingValue
    ", desc[option], ""); - renderOption(table, option, optionValues[option], options[option]); - table.push("
    "); - settingDiv.innerHTML = table.join(""); - - var onChange = function(e) { - var select = e.currentTarget; - editor.setOption(select.title, select.value); - }; - var onClick = function(e) { - var cb = e.currentTarget; - editor.setOption(cb.title, cb.checked); - }; - var selects = settingDiv.getElementsByTagName("select"); - for (var i = 0; i < selects.length; i++) - selects[i].onchange = onChange; - var cbs = settingDiv.getElementsByTagName("input"); - for (var i = 0; i < cbs.length; i++) - cbs[i].onclick = onClick; - - - var button = document.createElement("input"); - button.type = "button"; - button.value = "Hide"; - event.addListener(button, "click", function() { - editor.setDisplaySettings(false); - }); - settingDiv.appendChild(button); - settingDiv.hideButton = button; -} -exports.options = { - mode: "text", - theme: "textmate", - gutter: "false", - fontSize: "12px", - softWrap: "off", - keybindings: "ace", - showPrintMargin: "false", - useSoftTabs: "true", - showInvisibles: "false" -}; - -}); -; - (function() { - ace.require(["ace/ext/textarea"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-themelist.js b/util/build-sample-browser/player/vendor/ace/ext-themelist.js deleted file mode 100644 index a97b9a2de9..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-themelist.js +++ /dev/null @@ -1,91 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/themelist', ['require', 'exports', 'module' ], function(require, exports, module) { - - -var themeData = [ - ["Chrome" ], - ["Clouds" ], - ["Crimson Editor" ], - ["Dawn" ], - ["Dreamweaver" ], - ["Eclipse" ], - ["GitHub" ], - ["Solarized Light"], - ["TextMate" ], - ["Tomorrow" ], - ["XCode" ], - ["Kuroir"], - ["KatzenMilch"], - ["Ambiance" ,"ambiance" , "dark"], - ["Chaos" ,"chaos" , "dark"], - ["Clouds Midnight" ,"clouds_midnight" , "dark"], - ["Cobalt" ,"cobalt" , "dark"], - ["idle Fingers" ,"idle_fingers" , "dark"], - ["krTheme" ,"kr_theme" , "dark"], - ["Merbivore" ,"merbivore" , "dark"], - ["Merbivore Soft" ,"merbivore_soft" , "dark"], - ["Mono Industrial" ,"mono_industrial" , "dark"], - ["Monokai" ,"monokai" , "dark"], - ["Pastel on dark" ,"pastel_on_dark" , "dark"], - ["Solarized Dark" ,"solarized_dark" , "dark"], - ["Terminal" ,"terminal" , "dark"], - ["Tomorrow Night" ,"tomorrow_night" , "dark"], - ["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"], - ["Tomorrow Night Bright","tomorrow_night_bright" , "dark"], - ["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"], - ["Twilight" ,"twilight" , "dark"], - ["Vibrant Ink" ,"vibrant_ink" , "dark"] -]; - - -exports.themesByName = {}; -exports.themes = themeData.map(function(data) { - var name = data[1] || data[0].replace(/ /g, "_").toLowerCase(); - var theme = { - caption: data[0], - theme: "ace/theme/" + name, - isDark: data[2] == "dark", - name: name - }; - exports.themesByName[name] = theme; - return theme; -}); - -}); - -; - (function() { - ace.require(["ace/ext/themelist"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/ext-whitespace.js b/util/build-sample-browser/player/vendor/ace/ext-whitespace.js deleted file mode 100644 index 02952ce517..0000000000 --- a/util/build-sample-browser/player/vendor/ace/ext-whitespace.js +++ /dev/null @@ -1,214 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/ext/whitespace', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) { - - -var lang = require("../lib/lang"); -exports.$detectIndentation = function(lines, fallback) { - var stats = []; - var changes = []; - var tabIndents = 0; - var prevSpaces = 0; - var max = Math.min(lines.length, 1000); - for (var i = 0; i < max; i++) { - var line = lines[i]; - if (!/^\s*[^*+\-\s]/.test(line)) - continue; - - var tabs = line.match(/^\t*/)[0].length; - if (line[0] == "\t") - tabIndents++; - - var spaces = line.match(/^ */)[0].length; - if (spaces && line[spaces] != "\t") { - var diff = spaces - prevSpaces; - if (diff > 0 && !(prevSpaces%diff) && !(spaces%diff)) - changes[diff] = (changes[diff] || 0) + 1; - - stats[spaces] = (stats[spaces] || 0) + 1; - } - prevSpaces = spaces; - while (i < max && line[line.length - 1] == "\\") - line = lines[i++]; - } - - if (!stats.length) - return; - - function getScore(indent) { - var score = 0; - for (var i = indent; i < stats.length; i += indent) - score += stats[i] || 0; - return score; - } - - var changesTotal = changes.reduce(function(a,b){return a+b}, 0); - - var first = {score: 0, length: 0}; - var spaceIndents = 0; - for (var i = 1; i < 12; i++) { - if (i == 1) { - spaceIndents = getScore(i); - var score = 1; - } else - var score = getScore(i) / spaceIndents; - - if (changes[i]) { - score += changes[i] / changesTotal; - } - - if (score > first.score) - first = {score: score, length: i}; - } - - if (first.score && first.score > 1.4) - var tabLength = first.length; - - if (tabIndents > spaceIndents + 1) - return {ch: "\t", length: tabLength}; - - if (spaceIndents + 1 > tabIndents) - return {ch: " ", length: tabLength}; -}; - -exports.detectIndentation = function(session) { - var lines = session.getLines(0, 1000); - var indent = exports.$detectIndentation(lines) || {}; - - if (indent.ch) - session.setUseSoftTabs(indent.ch == " "); - - if (indent.length) - session.setTabSize(indent.length); - return indent; -}; - -exports.trimTrailingSpace = function(session, trimEmpty) { - var doc = session.getDocument(); - var lines = doc.getAllLines(); - - var min = trimEmpty ? -1 : 0; - - for (var i = 0, l=lines.length; i < l; i++) { - var line = lines[i]; - var index = line.search(/\s+$/); - - if (index > min) - doc.removeInLine(i, index, line.length); - } -}; - -exports.convertIndentation = function(session, ch, len) { - var oldCh = session.getTabString()[0]; - var oldLen = session.getTabSize(); - if (!len) len = oldLen; - if (!ch) ch = oldCh; - - var tab = ch == "\t" ? ch: lang.stringRepeat(ch, len); - - var doc = session.doc; - var lines = doc.getAllLines(); - - var cache = {}; - var spaceCache = {}; - for (var i = 0, l=lines.length; i < l; i++) { - var line = lines[i]; - var match = line.match(/^\s*/)[0]; - if (match) { - var w = session.$getStringScreenWidth(match)[0]; - var tabCount = Math.floor(w/oldLen); - var reminder = w%oldLen; - var toInsert = cache[tabCount] || (cache[tabCount] = lang.stringRepeat(tab, tabCount)); - toInsert += spaceCache[reminder] || (spaceCache[reminder] = lang.stringRepeat(" ", reminder)); - - if (toInsert != match) { - doc.removeInLine(i, 0, match.length); - doc.insertInLine({row: i, column: 0}, toInsert); - } - } - } - session.setTabSize(len); - session.setUseSoftTabs(ch == " "); -}; - -exports.$parseStringArg = function(text) { - var indent = {}; - if (/t/.test(text)) - indent.ch = "\t"; - else if (/s/.test(text)) - indent.ch = " "; - var m = text.match(/\d+/); - if (m) - indent.length = parseInt(m[0], 10); - return indent; -}; - -exports.$parseArg = function(arg) { - if (!arg) - return {}; - if (typeof arg == "string") - return exports.$parseStringArg(arg); - if (typeof arg.text == "string") - return exports.$parseStringArg(arg.text); - return arg; -}; - -exports.commands = [{ - name: "detectIndentation", - exec: function(editor) { - exports.detectIndentation(editor.session); - } -}, { - name: "trimTrailingSpace", - exec: function(editor) { - exports.trimTrailingSpace(editor.session); - } -}, { - name: "convertIndentation", - exec: function(editor, arg) { - var indent = exports.$parseArg(arg); - exports.convertIndentation(editor.session, indent.ch, indent.length); - } -}, { - name: "setIndentation", - exec: function(editor, arg) { - var indent = exports.$parseArg(arg); - indent.length && editor.session.setTabSize(indent.length); - indent.ch && editor.session.setUseSoftTabs(indent.ch == " "); - } -}]; - -}); -; - (function() { - ace.require(["ace/ext/whitespace"], function() {}); - })(); - \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/keybinding-emacs.js b/util/build-sample-browser/player/vendor/ace/keybinding-emacs.js deleted file mode 100644 index 39cccf56ea..0000000000 --- a/util/build-sample-browser/player/vendor/ace/keybinding-emacs.js +++ /dev/null @@ -1,1058 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/keyboard/emacs', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/incremental_search', 'ace/commands/incremental_search_commands', 'ace/keyboard/hash_handler', 'ace/lib/keys'], function(require, exports, module) { - - -var dom = require("../lib/dom"); -require("../incremental_search"); -var iSearchCommandModule = require("../commands/incremental_search_commands"); - - -var screenToTextBlockCoordinates = function(x, y) { - var canvasPos = this.scroller.getBoundingClientRect(); - - var col = Math.floor( - (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth - ); - var row = Math.floor( - (y + this.scrollTop - canvasPos.top) / this.lineHeight - ); - - return this.session.screenToDocumentPosition(row, col); -}; - -var HashHandler = require("./hash_handler").HashHandler; -exports.handler = new HashHandler(); - -exports.handler.isEmacs = true; -exports.handler.$id = "ace/keyboard/emacs"; - -var initialized = false; -var $formerLongWords; -var $formerLineStart; - -exports.handler.attach = function(editor) { - if (!initialized) { - initialized = true; - dom.importCssString('\ - .emacs-mode .ace_cursor{\ - border: 2px rgba(50,250,50,0.8) solid!important;\ - -moz-box-sizing: border-box!important;\ - -webkit-box-sizing: border-box!important;\ - box-sizing: border-box!important;\ - background-color: rgba(0,250,0,0.9);\ - opacity: 0.5;\ - }\ - .emacs-mode .ace_hidden-cursors .ace_cursor{\ - opacity: 1;\ - background-color: transparent;\ - }\ - .emacs-mode .ace_overwrite-cursors .ace_cursor {\ - opacity: 1;\ - background-color: transparent;\ - border-width: 0 0 2px 2px !important;\ - }\ - .emacs-mode .ace_text-layer {\ - z-index: 4\ - }\ - .emacs-mode .ace_cursor-layer {\ - z-index: 2\ - }', 'emacsMode' - ); - } - $formerLongWords = editor.session.$selectLongWords; - editor.session.$selectLongWords = true; - $formerLineStart = editor.session.$useEmacsStyleLineStart; - editor.session.$useEmacsStyleLineStart = true; - - editor.session.$emacsMark = null; // the active mark - editor.session.$emacsMarkRing = editor.session.$emacsMarkRing || []; - - editor.emacsMark = function() { - return this.session.$emacsMark; - }; - - editor.setEmacsMark = function(p) { - this.session.$emacsMark = p; - }; - - editor.pushEmacsMark = function(p, activate) { - var prevMark = this.session.$emacsMark; - if (prevMark) - this.session.$emacsMarkRing.push(prevMark); - if (!p || activate) this.setEmacsMark(p); - else this.session.$emacsMarkRing.push(p); - }; - - editor.popEmacsMark = function() { - var mark = this.emacsMark(); - if (mark) { this.setEmacsMark(null); return mark; } - return this.session.$emacsMarkRing.pop(); - }; - - editor.getLastEmacsMark = function(p) { - return this.session.$emacsMark || this.session.$emacsMarkRing.slice(-1)[0]; - }; - - editor.on("click", $resetMarkMode); - editor.on("changeSession", $kbSessionChange); - editor.renderer.screenToTextCoordinates = screenToTextBlockCoordinates; - editor.setStyle("emacs-mode"); - editor.commands.addCommands(commands); - exports.handler.platform = editor.commands.platform; - editor.$emacsModeHandler = this; - editor.addEventListener('copy', this.onCopy); - editor.addEventListener('paste', this.onPaste); -}; - -exports.handler.detach = function(editor) { - delete editor.renderer.screenToTextCoordinates; - editor.session.$selectLongWords = $formerLongWords; - editor.session.$useEmacsStyleLineStart = $formerLineStart; - editor.removeEventListener("click", $resetMarkMode); - editor.removeEventListener("changeSession", $kbSessionChange); - editor.unsetStyle("emacs-mode"); - editor.commands.removeCommands(commands); - editor.removeEventListener('copy', this.onCopy); - editor.removeEventListener('paste', this.onPaste); -}; - -var $kbSessionChange = function(e) { - if (e.oldSession) { - e.oldSession.$selectLongWords = $formerLongWords; - e.oldSession.$useEmacsStyleLineStart = $formerLineStart; - } - - $formerLongWords = e.session.$selectLongWords; - e.session.$selectLongWords = true; - $formerLineStart = e.session.$useEmacsStyleLineStart; - e.session.$useEmacsStyleLineStart = true; - - if (!e.session.hasOwnProperty('$emacsMark')) - e.session.$emacsMark = null; - if (!e.session.hasOwnProperty('$emacsMarkRing')) - e.session.$emacsMarkRing = []; -}; - -var $resetMarkMode = function(e) { - e.editor.session.$emacsMark = null; -}; - -var keys = require("../lib/keys").KEY_MODS; -var eMods = {C: "ctrl", S: "shift", M: "alt", CMD: "command"}; -var combinations = ["C-S-M-CMD", - "S-M-CMD", "C-M-CMD", "C-S-CMD", "C-S-M", - "M-CMD", "S-CMD", "S-M", "C-CMD", "C-M", "C-S", - "CMD", "M", "S", "C"]; -combinations.forEach(function(c) { - var hashId = 0; - c.split("-").forEach(function(c) { - hashId = hashId | keys[eMods[c]]; - }); - eMods[hashId] = c.toLowerCase() + "-"; -}); - -exports.handler.onCopy = function(e, editor) { - if (editor.$handlesEmacsOnCopy) return; - editor.$handlesEmacsOnCopy = true; - exports.handler.commands.killRingSave.exec(editor); - delete editor.$handlesEmacsOnCopy; -}; - -exports.handler.onPaste = function(e, editor) { - editor.pushEmacsMark(editor.getCursorPosition()); -}; - -exports.handler.bindKey = function(key, command) { - if (!key) - return; - - var ckb = this.commandKeyBinding; - key.split("|").forEach(function(keyPart) { - keyPart = keyPart.toLowerCase(); - ckb[keyPart] = command; - var keyParts = keyPart.split(" ").slice(0,-1); - keyParts.reduce(function(keyMapKeys, keyPart, i) { - var prefix = keyMapKeys[i-1] ? keyMapKeys[i-1] + ' ' : ''; - return keyMapKeys.concat([prefix + keyPart]); - }, []).forEach(function(keyPart) { - if (!ckb[keyPart]) ckb[keyPart] = "null"; - }); - }, this); -}; - -exports.handler.handleKeyboard = function(data, hashId, key, keyCode) { - var editor = data.editor; - if (hashId == -1) { - editor.pushEmacsMark(); - if (data.count) { - var str = new Array(data.count + 1).join(key); - data.count = null; - return {command: "insertstring", args: str}; - } - } - - if (key == "\x00") return undefined; - - var modifier = eMods[hashId]; - if (modifier == "c-" || data.universalArgument) { - var prevCount = String(data.count || 0); - var count = parseInt(key[key.length - 1]); - if (typeof count === 'number' && !isNaN(count)) { - data.count = parseInt(prevCount + count); - return {command: "null"}; - } else if (data.universalArgument) { - data.count = 4; - } - } - data.universalArgument = false; - if (modifier) key = modifier + key; - if (data.keyChain) key = data.keyChain += " " + key; - var command = this.commandKeyBinding[key]; - data.keyChain = command == "null" ? key : ""; - if (!command) return undefined; - if (command === "null") return {command: "null"}; - - if (command === "universalArgument") { - data.universalArgument = true; - return {command: "null"}; - } - var args; - if (typeof command !== "string") { - args = command.args; - if (command.command) command = command.command; - if (command === "goorselect") { - command = editor.emacsMark() ? args[1] : args[0]; - args = null; - } - } - - if (typeof command === "string") { - if (command === "insertstring" || - command === "splitline" || - command === "togglecomment") { - editor.pushEmacsMark(); - } - command = this.commands[command] || editor.commands.commands[command]; - if (!command) return undefined; - } - - if (!command.readonly && !command.isYank) - data.lastCommand = null; - - if (data.count) { - var count = data.count; - data.count = 0; - if (!command || !command.handlesCount) { - return { - args: args, - command: { - exec: function(editor, args) { - for (var i = 0; i < count; i++) - command.exec(editor, args); - } - } - }; - } else { - if (!args) args = {}; - if (typeof args === 'object') args.count = count; - } - } - - return {command: command, args: args}; -}; - -exports.emacsKeys = { - "Up|C-p" : {command: "goorselect", args: ["golineup","selectup"]}, - "Down|C-n" : {command: "goorselect", args: ["golinedown","selectdown"]}, - "Left|C-b" : {command: "goorselect", args: ["gotoleft","selectleft"]}, - "Right|C-f" : {command: "goorselect", args: ["gotoright","selectright"]}, - "C-Left|M-b" : {command: "goorselect", args: ["gotowordleft","selectwordleft"]}, - "C-Right|M-f" : {command: "goorselect", args: ["gotowordright","selectwordright"]}, - "Home|C-a" : {command: "goorselect", args: ["gotolinestart","selecttolinestart"]}, - "End|C-e" : {command: "goorselect", args: ["gotolineend","selecttolineend"]}, - "C-Home|S-M-,": {command: "goorselect", args: ["gotostart","selecttostart"]}, - "C-End|S-M-." : {command: "goorselect", args: ["gotoend","selecttoend"]}, - "S-Up|S-C-p" : "selectup", - "S-Down|S-C-n" : "selectdown", - "S-Left|S-C-b" : "selectleft", - "S-Right|S-C-f" : "selectright", - "S-C-Left|S-M-b" : "selectwordleft", - "S-C-Right|S-M-f" : "selectwordright", - "S-Home|S-C-a" : "selecttolinestart", - "S-End|S-C-e" : "selecttolineend", - "S-C-Home" : "selecttostart", - "S-C-End" : "selecttoend", - - "C-l" : "recenterTopBottom", - "M-s" : "centerselection", - "M-g": "gotoline", - "C-x C-p": "selectall", - "C-Down": {command: "goorselect", args: ["gotopagedown","selectpagedown"]}, - "C-Up": {command: "goorselect", args: ["gotopageup","selectpageup"]}, - "PageDown|C-v": {command: "goorselect", args: ["gotopagedown","selectpagedown"]}, - "PageUp|M-v": {command: "goorselect", args: ["gotopageup","selectpageup"]}, - "S-C-Down": "selectpagedown", - "S-C-Up": "selectpageup", - - "C-s": "iSearch", - "C-r": "iSearchBackwards", - - "M-C-s": "findnext", - "M-C-r": "findprevious", - "S-M-5": "replace", - "Backspace": "backspace", - "Delete|C-d": "del", - "Return|C-m": {command: "insertstring", args: "\n"}, // "newline" - "C-o": "splitline", - - "M-d|C-Delete": {command: "killWord", args: "right"}, - "C-Backspace|M-Backspace|M-Delete": {command: "killWord", args: "left"}, - "C-k": "killLine", - - "C-y|S-Delete": "yank", - "M-y": "yankRotate", - "C-g": "keyboardQuit", - - "C-w": "killRegion", - "M-w": "killRingSave", - "C-Space": "setMark", - "C-x C-x": "exchangePointAndMark", - - "C-t": "transposeletters", - "M-u": "touppercase", // Doesn't work - "M-l": "tolowercase", - "M-/": "autocomplete", // Doesn't work - "C-u": "universalArgument", - - "M-;": "togglecomment", - - "C-/|C-x u|S-C--|C-z": "undo", - "S-C-/|S-C-x u|C--|S-C-z": "redo", //infinite undo? - "C-x r": "selectRectangularRegion", - "M-x": {command: "focusCommandLine", args: "M-x "} -}; - - -exports.handler.bindKeys(exports.emacsKeys); - -exports.handler.addCommands({ - recenterTopBottom: function(editor) { - var renderer = editor.renderer; - var pos = renderer.$cursorLayer.getPixelPosition(); - var h = renderer.$size.scrollerHeight - renderer.lineHeight; - var scrollTop = renderer.scrollTop; - if (Math.abs(pos.top - scrollTop) < 2) { - scrollTop = pos.top - h; - } else if (Math.abs(pos.top - scrollTop - h * 0.5) < 2) { - scrollTop = pos.top; - } else { - scrollTop = pos.top - h * 0.5; - } - editor.session.setScrollTop(scrollTop); - }, - selectRectangularRegion: function(editor) { - editor.multiSelect.toggleBlockSelection(); - }, - setMark: { - exec: function(editor, args) { - if (args && args.count) { - var mark = editor.popEmacsMark(); - mark && editor.selection.moveCursorToPosition(mark); - return; - } - - var mark = editor.emacsMark(), - transientMarkModeActive = true; - if (transientMarkModeActive && (mark || !editor.selection.isEmpty())) { - editor.pushEmacsMark(); - editor.clearSelection(); - return; - } - - if (mark) { - var cp = editor.getCursorPosition(); - if (editor.selection.isEmpty() && - mark.row == cp.row && mark.column == cp.column) { - editor.pushEmacsMark(); - return; - } - } - mark = editor.getCursorPosition(); - editor.setEmacsMark(mark); - editor.selection.setSelectionAnchor(mark.row, mark.column); - }, - readonly: true, - handlesCount: true, - multiSelectAction: "forEach" - }, - exchangePointAndMark: { - exec: function(editor, args) { - var sel = editor.selection; - if (args.count) { - var pos = editor.getCursorPosition(); - sel.clearSelection(); - sel.moveCursorToPosition(editor.popEmacsMark()); - editor.pushEmacsMark(pos); - return; - } - var lastMark = editor.getLastEmacsMark(); - var range = sel.getRange(); - if (range.isEmpty()) { - sel.selectToPosition(lastMark); - return; - } - sel.setSelectionRange(range, !sel.isBackwards()); - }, - readonly: true, - handlesCount: true, - multiSelectAction: "forEach" - }, - killWord: { - exec: function(editor, dir) { - editor.clearSelection(); - if (dir == "left") - editor.selection.selectWordLeft(); - else - editor.selection.selectWordRight(); - - var range = editor.getSelectionRange(); - var text = editor.session.getTextRange(range); - exports.killRing.add(text); - - editor.session.remove(range); - editor.clearSelection(); - }, - multiSelectAction: "forEach" - }, - killLine: function(editor) { - editor.pushEmacsMark(null); - var pos = editor.getCursorPosition(); - if (pos.column === 0 && - editor.session.doc.getLine(pos.row).length === 0) { - editor.selection.selectLine(); - } else { - editor.clearSelection(); - editor.selection.selectLineEnd(); - } - var range = editor.getSelectionRange(); - var text = editor.session.getTextRange(range); - exports.killRing.add(text); - - editor.session.remove(range); - editor.clearSelection(); - }, - yank: function(editor) { - editor.onPaste(exports.killRing.get() || ''); - editor.keyBinding.$data.lastCommand = "yank"; - }, - yankRotate: function(editor) { - if (editor.keyBinding.$data.lastCommand != "yank") - return; - editor.undo(); - editor.onPaste(exports.killRing.rotate()); - editor.keyBinding.$data.lastCommand = "yank"; - }, - killRegion: { - exec: function(editor) { - exports.killRing.add(editor.getCopyText()); - editor.commands.byName.cut.exec(editor); - }, - readonly: true, - multiSelectAction: "forEach" - }, - killRingSave: { - exec: function(editor) { - exports.killRing.add(editor.getCopyText()); - setTimeout(function() { - var sel = editor.selection, - range = sel.getRange(); - editor.pushEmacsMark(sel.isBackwards() ? range.end : range.start); - sel.clearSelection(); - }, 0); - }, - readonly: true - }, - keyboardQuit: function(editor) { - editor.selection.clearSelection(); - editor.setEmacsMark(null); - }, - focusCommandLine: function(editor, arg) { - if (editor.showCommandLine) - editor.showCommandLine(arg); - } -}); - -exports.handler.addCommands(iSearchCommandModule.iSearchStartCommands); - -var commands = exports.handler.commands; -commands.yank.isYank = true; -commands.yankRotate.isYank = true; - -exports.killRing = { - $data: [], - add: function(str) { - str && this.$data.push(str); - if (this.$data.length > 30) - this.$data.shift(); - }, - get: function(n) { - n = n || 1; - return this.$data.slice(this.$data.length-n, this.$data.length).reverse().join('\n'); - }, - pop: function() { - if (this.$data.length > 1) - this.$data.pop(); - return this.get(); - }, - rotate: function() { - this.$data.unshift(this.$data.pop()); - return this.get(); - } -}; - -}); - -ace.define('ace/incremental_search', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/search', 'ace/search_highlight', 'ace/commands/incremental_search_commands', 'ace/lib/dom', 'ace/commands/command_manager', 'ace/editor', 'ace/config'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var Range = require("./range").Range; -var Search = require("./search").Search; -var SearchHighlight = require("./search_highlight").SearchHighlight; -var iSearchCommandModule = require("./commands/incremental_search_commands"); -var ISearchKbd = iSearchCommandModule.IncrementalSearchKeyboardHandler; -function IncrementalSearch() { - this.$options = {wrap: false, skipCurrent: false}; - this.$keyboardHandler = new ISearchKbd(this); -} - -oop.inherits(IncrementalSearch, Search); - -;(function() { - - this.activate = function(ed, backwards) { - this.$editor = ed; - this.$startPos = this.$currentPos = ed.getCursorPosition(); - this.$options.needle = ''; - this.$options.backwards = backwards; - ed.keyBinding.addKeyboardHandler(this.$keyboardHandler); - this.$mousedownHandler = ed.addEventListener('mousedown', this.onMouseDown.bind(this)); - this.selectionFix(ed); - this.statusMessage(true); - } - - this.deactivate = function(reset) { - this.cancelSearch(reset); - this.$editor.keyBinding.removeKeyboardHandler(this.$keyboardHandler); - if (this.$mousedownHandler) { - this.$editor.removeEventListener('mousedown', this.$mousedownHandler); - delete this.$mousedownHandler; - } - this.message(''); - } - - this.selectionFix = function(editor) { - if (editor.selection.isEmpty() && !editor.session.$emacsMark) { - editor.clearSelection(); - } - } - - this.highlight = function(regexp) { - var sess = this.$editor.session, - hl = sess.$isearchHighlight = sess.$isearchHighlight || sess.addDynamicMarker( - new SearchHighlight(null, "ace_isearch-result", "text")); - hl.setRegexp(regexp); - sess._emit("changeBackMarker"); // force highlight layer redraw - } - - this.cancelSearch = function(reset) { - var e = this.$editor; - this.$prevNeedle = this.$options.needle; - this.$options.needle = ''; - if (reset) { - e.moveCursorToPosition(this.$startPos); - this.$currentPos = this.$startPos; - } else { - e.pushEmacsMark && e.pushEmacsMark(this.$startPos, false); - } - this.highlight(null); - return Range.fromPoints(this.$currentPos, this.$currentPos); - } - - this.highlightAndFindWithNeedle = function(moveToNext, needleUpdateFunc) { - if (!this.$editor) return null; - var options = this.$options; - if (needleUpdateFunc) { - options.needle = needleUpdateFunc.call(this, options.needle || '') || ''; - } - if (options.needle.length === 0) { - this.statusMessage(true); - return this.cancelSearch(true); - }; - options.start = this.$currentPos; - var session = this.$editor.session, - found = this.find(session); - if (found) { - if (options.backwards) found = Range.fromPoints(found.end, found.start); - this.$editor.moveCursorToPosition(found.end); - if (moveToNext) this.$currentPos = found.end; - this.highlight(options.re) - } - - this.statusMessage(found); - - return found; - } - - this.addChar = function(c) { - return this.highlightAndFindWithNeedle(false, function(needle) { - return needle + c; - }); - } - - this.removeChar = function(c) { - return this.highlightAndFindWithNeedle(false, function(needle) { - return needle.length > 0 ? needle.substring(0, needle.length-1) : needle; - }); - } - - this.next = function(options) { - options = options || {}; - this.$options.backwards = !!options.backwards; - this.$currentPos = this.$editor.getCursorPosition(); - return this.highlightAndFindWithNeedle(true, function(needle) { - return options.useCurrentOrPrevSearch && needle.length === 0 ? - this.$prevNeedle || '' : needle; - }); - } - - this.onMouseDown = function(evt) { - this.deactivate(); - return true; - } - - this.statusMessage = function(found) { - var options = this.$options, msg = ''; - msg += options.backwards ? 'reverse-' : ''; - msg += 'isearch: ' + options.needle; - msg += found ? '' : ' (not found)'; - this.message(msg); - } - - this.message = function(msg) { - if (this.$editor.showCommandLine) { - this.$editor.showCommandLine(msg); - this.$editor.focus(); - } else { - console.log(msg); - } - } - -}).call(IncrementalSearch.prototype); - - -exports.IncrementalSearch = IncrementalSearch; - -var dom = require('./lib/dom'); -dom.importCssString && dom.importCssString("\ -.ace_marker-layer .ace_isearch-result {\ - position: absolute;\ - z-index: 6;\ - -moz-box-sizing: border-box;\ - -webkit-box-sizing: border-box;\ - box-sizing: border-box;\ -}\ -div.ace_isearch-result {\ - border-radius: 4px;\ - background-color: rgba(255, 200, 0, 0.5);\ - box-shadow: 0 0 4px rgb(255, 200, 0);\ -}\ -.ace_dark div.ace_isearch-result {\ - background-color: rgb(100, 110, 160);\ - box-shadow: 0 0 4px rgb(80, 90, 140);\ -}", "incremental-search-highlighting"); -var commands = require("./commands/command_manager"); -(function() { - this.setupIncrementalSearch = function(editor, val) { - if (this.usesIncrementalSearch == val) return; - this.usesIncrementalSearch = val; - var iSearchCommands = iSearchCommandModule.iSearchStartCommands; - var method = val ? 'addCommands' : 'removeCommands'; - this[method](iSearchCommands); - }; -}).call(commands.CommandManager.prototype); -var Editor = require("./editor").Editor; -require("./config").defineOptions(Editor.prototype, "editor", { - useIncrementalSearch: { - set: function(val) { - this.keyBinding.$handlers.forEach(function(handler) { - if (handler.setupIncrementalSearch) { - handler.setupIncrementalSearch(this, val); - } - }); - this._emit('incrementalSearchSettingChanged', {isEnabled: val}); - } - } -}); - -}); - -ace.define('ace/commands/incremental_search_commands', ['require', 'exports', 'module' , 'ace/config', 'ace/lib/oop', 'ace/keyboard/hash_handler', 'ace/commands/occur_commands'], function(require, exports, module) { - -var config = require("../config"); -var oop = require("../lib/oop"); -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var occurStartCommand = require("./occur_commands").occurStartCommand; -exports.iSearchStartCommands = [{ - name: "iSearch", - bindKey: {win: "Ctrl-F", mac: "Command-F"}, - exec: function(editor, options) { - config.loadModule(["core", "ace/incremental_search"], function(e) { - var iSearch = e.iSearch = e.iSearch || new e.IncrementalSearch(); - iSearch.activate(editor, options.backwards); - if (options.jumpToFirstMatch) iSearch.next(options); - }); - }, - readOnly: true -}, { - name: "iSearchBackwards", - exec: function(editor, jumpToNext) { editor.execCommand('iSearch', {backwards: true}); }, - readOnly: true -}, { - name: "iSearchAndGo", - bindKey: {win: "Ctrl-K", mac: "Command-G"}, - exec: function(editor, jumpToNext) { editor.execCommand('iSearch', {jumpToFirstMatch: true, useCurrentOrPrevSearch: true}); }, - readOnly: true -}, { - name: "iSearchBackwardsAndGo", - bindKey: {win: "Ctrl-Shift-K", mac: "Command-Shift-G"}, - exec: function(editor) { editor.execCommand('iSearch', {jumpToFirstMatch: true, backwards: true, useCurrentOrPrevSearch: true}); }, - readOnly: true -}]; -exports.iSearchCommands = [{ - name: "restartSearch", - bindKey: {win: "Ctrl-F", mac: "Command-F"}, - exec: function(iSearch) { - iSearch.cancelSearch(true); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "searchForward", - bindKey: {win: "Ctrl-S|Ctrl-K", mac: "Ctrl-S|Command-G"}, - exec: function(iSearch, options) { - options.useCurrentOrPrevSearch = true; - iSearch.next(options); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "searchBackward", - bindKey: {win: "Ctrl-R|Ctrl-Shift-K", mac: "Ctrl-R|Command-Shift-G"}, - exec: function(iSearch, options) { - options.useCurrentOrPrevSearch = true; - options.backwards = true; - iSearch.next(options); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "extendSearchTerm", - exec: function(iSearch, string) { - iSearch.addChar(string); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "extendSearchTermSpace", - bindKey: "space", - exec: function(iSearch) { iSearch.addChar(' '); }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "shrinkSearchTerm", - bindKey: "backspace", - exec: function(iSearch) { - iSearch.removeChar(); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: 'confirmSearch', - bindKey: 'return', - exec: function(iSearch) { iSearch.deactivate(); }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: 'cancelSearch', - bindKey: 'esc|Ctrl-G', - exec: function(iSearch) { iSearch.deactivate(true); }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: 'occurisearch', - bindKey: 'Ctrl-O', - exec: function(iSearch) { - var options = oop.mixin({}, iSearch.$options); - iSearch.deactivate(); - occurStartCommand.exec(iSearch.$editor, options); - }, - readOnly: true, - isIncrementalSearchCommand: true -}]; - -function IncrementalSearchKeyboardHandler(iSearch) { - this.$iSearch = iSearch; -} - -oop.inherits(IncrementalSearchKeyboardHandler, HashHandler); - -;(function() { - - this.attach = function(editor) { - var iSearch = this.$iSearch; - HashHandler.call(this, exports.iSearchCommands, editor.commands.platform); - this.$commandExecHandler = editor.commands.addEventListener('exec', function(e) { - if (!e.command.isIncrementalSearchCommand) return undefined; - e.stopPropagation(); - e.preventDefault(); - return e.command.exec(iSearch, e.args || {}); - }); - } - - this.detach = function(editor) { - if (!this.$commandExecHandler) return; - editor.commands.removeEventListener('exec', this.$commandExecHandler); - delete this.$commandExecHandler; - } - - var handleKeyboard$super = this.handleKeyboard; - this.handleKeyboard = function(data, hashId, key, keyCode) { - var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode); - if (cmd.command) { return cmd; } - if (hashId == -1) { - var extendCmd = this.commands.extendSearchTerm; - if (extendCmd) { return {command: extendCmd, args: key}; } - } - return {command: "null", passEvent: hashId == 0 || hashId == 4}; - } - -}).call(IncrementalSearchKeyboardHandler.prototype); - - -exports.IncrementalSearchKeyboardHandler = IncrementalSearchKeyboardHandler; - -}); - -ace.define('ace/commands/occur_commands', ['require', 'exports', 'module' , 'ace/config', 'ace/occur', 'ace/keyboard/hash_handler', 'ace/lib/oop'], function(require, exports, module) { - -var config = require("../config"), - Occur = require("../occur").Occur; -var occurStartCommand = { - name: "occur", - exec: function(editor, options) { - var alreadyInOccur = !!editor.session.$occur; - var occurSessionActive = new Occur().enter(editor, options); - if (occurSessionActive && !alreadyInOccur) - OccurKeyboardHandler.installIn(editor); - }, - readOnly: true -}; - -var occurCommands = [{ - name: "occurexit", - bindKey: 'esc|Ctrl-G', - exec: function(editor) { - var occur = editor.session.$occur; - if (!occur) return; - occur.exit(editor, {}); - if (!editor.session.$occur) OccurKeyboardHandler.uninstallFrom(editor); - }, - readOnly: true -}, { - name: "occuraccept", - bindKey: 'enter', - exec: function(editor) { - var occur = editor.session.$occur; - if (!occur) return; - occur.exit(editor, {translatePosition: true}); - if (!editor.session.$occur) OccurKeyboardHandler.uninstallFrom(editor); - }, - readOnly: true -}]; - -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var oop = require("../lib/oop"); - - -function OccurKeyboardHandler() {} - -oop.inherits(OccurKeyboardHandler, HashHandler); - -;(function() { - - this.isOccurHandler = true; - - this.attach = function(editor) { - HashHandler.call(this, occurCommands, editor.commands.platform); - this.$editor = editor; - } - - var handleKeyboard$super = this.handleKeyboard; - this.handleKeyboard = function(data, hashId, key, keyCode) { - var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode); - return (cmd && cmd.command) ? cmd : undefined; - } - -}).call(OccurKeyboardHandler.prototype); - -OccurKeyboardHandler.installIn = function(editor) { - var handler = new this(); - editor.keyBinding.addKeyboardHandler(handler); - editor.commands.addCommands(occurCommands); -} - -OccurKeyboardHandler.uninstallFrom = function(editor) { - editor.commands.removeCommands(occurCommands); - var handler = editor.getKeyboardHandler(); - if (handler.isOccurHandler) - editor.keyBinding.removeKeyboardHandler(handler); -} - -exports.occurStartCommand = occurStartCommand; - -}); - -ace.define('ace/occur', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/search', 'ace/edit_session', 'ace/search_highlight', 'ace/lib/dom'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var Range = require("./range").Range; -var Search = require("./search").Search; -var EditSession = require("./edit_session").EditSession; -var SearchHighlight = require("./search_highlight").SearchHighlight; -function Occur() {} - -oop.inherits(Occur, Search); - -(function() { - this.enter = function(editor, options) { - if (!options.needle) return false; - var pos = editor.getCursorPosition(); - this.displayOccurContent(editor, options); - var translatedPos = this.originalToOccurPosition(editor.session, pos); - editor.moveCursorToPosition(translatedPos); - return true; - } - this.exit = function(editor, options) { - var pos = options.translatePosition && editor.getCursorPosition(); - var translatedPos = pos && this.occurToOriginalPosition(editor.session, pos); - this.displayOriginalContent(editor); - if (translatedPos) - editor.moveCursorToPosition(translatedPos); - return true; - } - - this.highlight = function(sess, regexp) { - var hl = sess.$occurHighlight = sess.$occurHighlight || sess.addDynamicMarker( - new SearchHighlight(null, "ace_occur-highlight", "text")); - hl.setRegexp(regexp); - sess._emit("changeBackMarker"); // force highlight layer redraw - } - - this.displayOccurContent = function(editor, options) { - this.$originalSession = editor.session; - var found = this.matchingLines(editor.session, options); - var lines = found.map(function(foundLine) { return foundLine.content; }); - var occurSession = new EditSession(lines.join('\n')); - occurSession.$occur = this; - occurSession.$occurMatchingLines = found; - editor.setSession(occurSession); - this.highlight(occurSession, options.re); - occurSession._emit('changeBackMarker'); - } - - this.displayOriginalContent = function(editor) { - editor.setSession(this.$originalSession); - } - this.originalToOccurPosition = function(session, pos) { - var lines = session.$occurMatchingLines; - var nullPos = {row: 0, column: 0}; - if (!lines) return nullPos; - for (var i = 0; i < lines.length; i++) { - if (lines[i].row === pos.row) - return {row: i, column: pos.column}; - } - return nullPos; - } - this.occurToOriginalPosition = function(session, pos) { - var lines = session.$occurMatchingLines; - if (!lines || !lines[pos.row]) - return pos; - return {row: lines[pos.row].row, column: pos.column}; - } - - this.matchingLines = function(session, options) { - options = oop.mixin({}, options); - if (!session || !options.needle) return []; - var search = new Search(); - search.set(options); - return search.findAll(session).reduce(function(lines, range) { - var row = range.start.row; - var last = lines[lines.length-1]; - return last && last.row === row ? - lines : - lines.concat({row: row, content: session.getLine(row)}); - }, []); - } - -}).call(Occur.prototype); - -var dom = require('./lib/dom'); -dom.importCssString(".ace_occur-highlight {\n\ - border-radius: 4px;\n\ - background-color: rgba(87, 255, 8, 0.25);\n\ - position: absolute;\n\ - z-index: 4;\n\ - -moz-box-sizing: border-box;\n\ - -webkit-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - box-shadow: 0 0 4px rgb(91, 255, 50);\n\ -}\n\ -.ace_dark .ace_occur-highlight {\n\ - background-color: rgb(80, 140, 85);\n\ - box-shadow: 0 0 4px rgb(60, 120, 70);\n\ -}\n", "incremental-occur-highlighting"); - -exports.Occur = Occur; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/keybinding-vim.js b/util/build-sample-browser/player/vendor/ace/keybinding-vim.js deleted file mode 100644 index 5edc3354aa..0000000000 --- a/util/build-sample-browser/player/vendor/ace/keybinding-vim.js +++ /dev/null @@ -1,1762 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/keyboard/vim', ['require', 'exports', 'module' , 'ace/keyboard/vim/commands', 'ace/keyboard/vim/maps/util', 'ace/lib/useragent'], function(require, exports, module) { - - -var cmds = require("./vim/commands"); -var coreCommands = cmds.coreCommands; -var util = require("./vim/maps/util"); -var useragent = require("../lib/useragent"); - -var startCommands = { - "i": { - command: coreCommands.start - }, - "I": { - command: coreCommands.startBeginning - }, - "a": { - command: coreCommands.append - }, - "A": { - command: coreCommands.appendEnd - }, - "ctrl-f": { - command: "gotopagedown" - }, - "ctrl-b": { - command: "gotopageup" - } -}; - -exports.handler = { - $id: "ace/keyboard/vim", - handleMacRepeat: function(data, hashId, key) { - if (hashId == -1) { - data.inputChar = key; - data.lastEvent = "input"; - } else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) { - if (data.lastEvent == "input") { - data.lastEvent = "input1"; - } else if (data.lastEvent == "input1") { - return true; - } - } else { - data.$lastHash = hashId; - data.$lastKey = key; - data.lastEvent = "keypress"; - } - }, - updateMacCompositionHandlers: function(editor, enable) { - var onCompositionUpdateOverride = function(text) { - if (util.currentMode !== "insert") { - var el = this.textInput.getElement(); - el.blur(); - el.focus(); - el.value = text; - } else { - this.onCompositionUpdateOrig(text); - } - }; - var onCompositionStartOverride = function(text) { - if (util.currentMode === "insert") { - this.onCompositionStartOrig(text); - } - }; - if (enable) { - if (!editor.onCompositionUpdateOrig) { - editor.onCompositionUpdateOrig = editor.onCompositionUpdate; - editor.onCompositionUpdate = onCompositionUpdateOverride; - editor.onCompositionStartOrig = editor.onCompositionStart; - editor.onCompositionStart = onCompositionStartOverride; - } - } else { - if (editor.onCompositionUpdateOrig) { - editor.onCompositionUpdate = editor.onCompositionUpdateOrig; - editor.onCompositionUpdateOrig = null; - editor.onCompositionStart = editor.onCompositionStartOrig; - editor.onCompositionStartOrig = null; - } - } - }, - - handleKeyboard: function(data, hashId, key, keyCode, e) { - if (hashId !== 0 && (!key || keyCode == -1)) - return null; - - var editor = data.editor; - - if (hashId == 1) - key = "ctrl-" + key; - if (key == "ctrl-c") { - if (!useragent.isMac && editor.getCopyText()) { - editor.once("copy", function() { - if (data.state == "start") - coreCommands.stop.exec(editor); - else - editor.selection.clearSelection(); - }); - return {command: "null", passEvent: true}; - } - return {command: coreCommands.stop}; - } else if ((key == "esc" && hashId === 0) || key == "ctrl-[") { - return {command: coreCommands.stop}; - } else if (data.state == "start") { - if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) { - hashId = -1; - key = data.inputChar; - } - - if (hashId == -1 || hashId == 1 || hashId === 0 && key.length > 1) { - if (cmds.inputBuffer.idle && startCommands[key]) - return startCommands[key]; - var isHandled = cmds.inputBuffer.push(editor, key); - return {command: "null", passEvent: !isHandled}; - } // if no modifier || shift: wait for input. - else if (key.length == 1 && (hashId === 0 || hashId == 4)) { - return {command: "null", passEvent: true}; - } else if (key == "esc" && hashId === 0) { - return {command: coreCommands.stop}; - } - } else { - if (key == "ctrl-w") { - return {command: "removewordleft"}; - } - } - }, - - attach: function(editor) { - editor.on("click", exports.onCursorMove); - if (util.currentMode !== "insert") - cmds.coreCommands.stop.exec(editor); - editor.$vimModeHandler = this; - - this.updateMacCompositionHandlers(editor, true); - }, - - detach: function(editor) { - editor.removeListener("click", exports.onCursorMove); - util.noMode(editor); - util.currentMode = "normal"; - this.updateMacCompositionHandlers(editor, false); - }, - - actions: cmds.actions, - getStatusText: function() { - if (util.currentMode == "insert") - return "INSERT"; - if (util.onVisualMode) - return (util.onVisualLineMode ? "VISUAL LINE " : "VISUAL ") + cmds.inputBuffer.status; - return cmds.inputBuffer.status; - } -}; - - -exports.onCursorMove = function(e) { - cmds.onCursorMove(e.editor, e); - exports.onCursorMove.scheduled = false; -}; - -}); - -ace.define('ace/keyboard/vim/commands', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/keyboard/vim/maps/util', 'ace/keyboard/vim/maps/motions', 'ace/keyboard/vim/maps/operators', 'ace/keyboard/vim/maps/aliases', 'ace/keyboard/vim/registers'], function(require, exports, module) { - -"never use strict"; - -var lang = require("../../lib/lang"); -var util = require("./maps/util"); -var motions = require("./maps/motions"); -var operators = require("./maps/operators"); -var alias = require("./maps/aliases"); -var registers = require("./registers"); - -var NUMBER = 1; -var OPERATOR = 2; -var MOTION = 3; -var ACTION = 4; -var HMARGIN = 8; // Minimum amount of line separation between margins; - -var repeat = function repeat(fn, count, args) { - while (0 < count--) - fn.apply(this, args); -}; - -var ensureScrollMargin = function(editor) { - var renderer = editor.renderer; - var pos = renderer.$cursorLayer.getPixelPosition(); - - var top = pos.top; - - var margin = HMARGIN * renderer.layerConfig.lineHeight; - if (2 * margin > renderer.$size.scrollerHeight) - margin = renderer.$size.scrollerHeight / 2; - - if (renderer.scrollTop > top - margin) { - renderer.session.setScrollTop(top - margin); - } - - if (renderer.scrollTop + renderer.$size.scrollerHeight < top + margin + renderer.lineHeight) { - renderer.session.setScrollTop(top + margin + renderer.lineHeight - renderer.$size.scrollerHeight); - } -}; - -var actions = exports.actions = { - "z": { - param: true, - fn: function(editor, range, count, param) { - switch (param) { - case "z": - editor.renderer.alignCursor(null, 0.5); - break; - case "t": - editor.renderer.alignCursor(null, 0); - break; - case "b": - editor.renderer.alignCursor(null, 1); - break; - case "c": - editor.session.onFoldWidgetClick(range.start.row, {domEvent:{target :{}}}); - break; - case "o": - editor.session.onFoldWidgetClick(range.start.row, {domEvent:{target :{}}}); - break; - case "C": - editor.session.foldAll(); - break; - case "O": - editor.session.unfold(); - break; - } - } - }, - "r": { - param: true, - fn: function(editor, range, count, param) { - if (param && param.length) { - if (param.length > 1) - param = param == "return" ? "\n" : param == "tab" ? "\t" : param; - repeat(function() { editor.insert(param); }, count || 1); - editor.navigateLeft(); - } - } - }, - "R": { - fn: function(editor, range, count, param) { - util.insertMode(editor); - editor.setOverwrite(true); - } - }, - "~": { - fn: function(editor, range, count) { - repeat(function() { - var range = editor.selection.getRange(); - if (range.isEmpty()) - range.end.column++; - var text = editor.session.getTextRange(range); - var toggled = text.toUpperCase(); - if (toggled == text) - editor.navigateRight(); - else - editor.session.replace(range, toggled); - }, count || 1); - } - }, - "*": { - fn: function(editor, range, count, param) { - editor.selection.selectWord(); - editor.findNext(); - ensureScrollMargin(editor); - var r = editor.selection.getRange(); - editor.selection.setSelectionRange(r, true); - } - }, - "#": { - fn: function(editor, range, count, param) { - editor.selection.selectWord(); - editor.findPrevious(); - ensureScrollMargin(editor); - var r = editor.selection.getRange(); - editor.selection.setSelectionRange(r, true); - } - }, - "m": { - param: true, - fn: function(editor, range, count, param) { - var s = editor.session; - var markers = s.vimMarkers || (s.vimMarkers = {}); - var c = editor.getCursorPosition(); - if (!markers[param]) { - markers[param] = editor.session.doc.createAnchor(c); - } - markers[param].setPosition(c.row, c.column, true); - } - }, - "n": { - fn: function(editor, range, count, param) { - var options = editor.getLastSearchOptions(); - options.backwards = false; - - editor.selection.moveCursorRight(); - editor.selection.clearSelection(); - editor.findNext(options); - - ensureScrollMargin(editor); - var r = editor.selection.getRange(); - r.end.row = r.start.row; - r.end.column = r.start.column; - editor.selection.setSelectionRange(r, true); - } - }, - "N": { - fn: function(editor, range, count, param) { - var options = editor.getLastSearchOptions(); - options.backwards = true; - - editor.findPrevious(options); - ensureScrollMargin(editor); - var r = editor.selection.getRange(); - r.end.row = r.start.row; - r.end.column = r.start.column; - editor.selection.setSelectionRange(r, true); - } - }, - "v": { - fn: function(editor, range, count, param) { - editor.selection.selectRight(); - util.visualMode(editor, false); - }, - acceptsMotion: true - }, - "V": { - fn: function(editor, range, count, param) { - var row = editor.getCursorPosition().row; - editor.selection.moveTo(row, 0); - editor.selection.selectLineEnd(); - editor.selection.visualLineStart = row; - - util.visualMode(editor, true); - }, - acceptsMotion: true - }, - "Y": { - fn: function(editor, range, count, param) { - util.copyLine(editor); - } - }, - "p": { - fn: function(editor, range, count, param) { - var defaultReg = registers._default; - - editor.setOverwrite(false); - if (defaultReg.isLine) { - var pos = editor.getCursorPosition(); - pos.column = editor.session.getLine(pos.row).length; - var text = lang.stringRepeat("\n" + defaultReg.text, count || 1); - editor.session.insert(pos, text); - editor.moveCursorTo(pos.row + 1, 0); - } - else { - editor.navigateRight(); - editor.insert(lang.stringRepeat(defaultReg.text, count || 1)); - editor.navigateLeft(); - } - editor.setOverwrite(true); - editor.selection.clearSelection(); - } - }, - "P": { - fn: function(editor, range, count, param) { - var defaultReg = registers._default; - editor.setOverwrite(false); - - if (defaultReg.isLine) { - var pos = editor.getCursorPosition(); - pos.column = 0; - var text = lang.stringRepeat(defaultReg.text + "\n", count || 1); - editor.session.insert(pos, text); - editor.moveCursorToPosition(pos); - } - else { - editor.insert(lang.stringRepeat(defaultReg.text, count || 1)); - } - editor.setOverwrite(true); - editor.selection.clearSelection(); - } - }, - "J": { - fn: function(editor, range, count, param) { - var session = editor.session; - range = editor.getSelectionRange(); - var pos = {row: range.start.row, column: range.start.column}; - count = count || range.end.row - range.start.row; - var maxRow = Math.min(pos.row + (count || 1), session.getLength() - 1); - - range.start.column = session.getLine(pos.row).length; - range.end.column = session.getLine(maxRow).length; - range.end.row = maxRow; - - var text = ""; - for (var i = pos.row; i < maxRow; i++) { - var nextLine = session.getLine(i + 1); - text += " " + /^\s*(.*)$/.exec(nextLine)[1] || ""; - } - - session.replace(range, text); - editor.moveCursorTo(pos.row, pos.column); - } - }, - "u": { - fn: function(editor, range, count, param) { - count = parseInt(count || 1, 10); - for (var i = 0; i < count; i++) { - editor.undo(); - } - editor.selection.clearSelection(); - } - }, - "ctrl-r": { - fn: function(editor, range, count, param) { - count = parseInt(count || 1, 10); - for (var i = 0; i < count; i++) { - editor.redo(); - } - editor.selection.clearSelection(); - } - }, - ":": { - fn: function(editor, range, count, param) { - var val = ":"; - if (count > 1) - val = ".,.+" + count + val; - if (editor.showCommandLine) - editor.showCommandLine(val); - } - }, - "/": { - fn: function(editor, range, count, param) { - if (editor.showCommandLine) - editor.showCommandLine("/"); - } - }, - "?": { - fn: function(editor, range, count, param) { - if (editor.showCommandLine) - editor.showCommandLine("?"); - } - }, - ".": { - fn: function(editor, range, count, param) { - util.onInsertReplaySequence = inputBuffer.lastInsertCommands; - var previous = inputBuffer.previous; - if (previous) // If there is a previous action - inputBuffer.exec(editor, previous.action, previous.param); - } - }, - "ctrl-x": { - fn: function(editor, range, count, param) { - editor.modifyNumber(-(count || 1)); - } - }, - "ctrl-a": { - fn: function(editor, range, count, param) { - editor.modifyNumber(count || 1); - } - } -}; - -var inputBuffer = exports.inputBuffer = { - accepting: [NUMBER, OPERATOR, MOTION, ACTION], - currentCmd: null, - currentCount: "", - status: "", - operator: null, - motion: null, - - lastInsertCommands: [], - - push: function(editor, ch, keyId) { - var status = this.status; - var isKeyHandled = true; - this.idle = false; - var wObj = this.waitingForParam; - if (/^numpad\d+$/i.test(ch)) - ch = ch.substr(6); - - if (wObj) { - this.exec(editor, wObj, ch); - } - else if (!(ch === "0" && !this.currentCount.length) && - (/^\d+$/.test(ch) && this.isAccepting(NUMBER))) { - this.currentCount += ch; - this.currentCmd = NUMBER; - this.accepting = [NUMBER, OPERATOR, MOTION, ACTION]; - } - else if (!this.operator && this.isAccepting(OPERATOR) && operators[ch]) { - this.operator = { - ch: ch, - count: this.getCount() - }; - this.currentCmd = OPERATOR; - this.accepting = [NUMBER, MOTION, ACTION]; - this.exec(editor, { operator: this.operator }); - } - else if (motions[ch] && this.isAccepting(MOTION)) { - this.currentCmd = MOTION; - - var ctx = { - operator: this.operator, - motion: { - ch: ch, - count: this.getCount() - } - }; - - if (motions[ch].param) - this.waitForParam(ctx); - else - this.exec(editor, ctx); - } - else if (alias[ch] && this.isAccepting(MOTION)) { - alias[ch].operator.count = this.getCount(); - this.exec(editor, alias[ch]); - } - else if (actions[ch] && this.isAccepting(ACTION)) { - var actionObj = { - action: { - fn: actions[ch].fn, - count: this.getCount() - } - }; - - if (actions[ch].param) { - this.waitForParam(actionObj); - } - else { - this.exec(editor, actionObj); - } - - if (actions[ch].acceptsMotion) - this.idle = false; - } - else if (this.operator) { - this.operator.count = this.getCount(); - this.exec(editor, { operator: this.operator }, ch); - } - else { - isKeyHandled = ch.length == 1; - this.reset(); - } - - if (this.waitingForParam || this.motion || this.operator) { - this.status += ch; - } else if (this.currentCount) { - this.status = this.currentCount; - } else if (this.status) { - this.status = ""; - } - if (this.status != status) - editor._emit("changeStatus"); - return isKeyHandled; - }, - - waitForParam: function(cmd) { - this.waitingForParam = cmd; - }, - - getCount: function() { - var count = this.currentCount; - this.currentCount = ""; - return count && parseInt(count, 10); - }, - - exec: function(editor, action, param) { - var m = action.motion; - var o = action.operator; - var a = action.action; - - if (!param) - param = action.param; - - if (o) { - this.previous = { - action: action, - param: param - }; - } - - if (o && !editor.selection.isEmpty()) { - if (operators[o.ch].selFn) { - operators[o.ch].selFn(editor, editor.getSelectionRange(), o.count, param); - this.reset(); - } - return; - } - else if (!m && !a && o && param) { - operators[o.ch].fn(editor, null, o.count, param); - this.reset(); - } - else if (m) { - var run = function(fn) { - if (fn && typeof fn === "function") { // There should always be a motion - if (m.count && !motionObj.handlesCount) - repeat(fn, m.count, [editor, null, m.count, param]); - else - fn(editor, null, m.count, param); - } - }; - - var motionObj = motions[m.ch]; - var selectable = motionObj.sel; - - if (!o) { - if ((util.onVisualMode || util.onVisualLineMode) && selectable) - run(motionObj.sel); - else - run(motionObj.nav); - } - else if (selectable) { - repeat(function() { - run(motionObj.sel); - operators[o.ch].fn(editor, editor.getSelectionRange(), o.count, param); - }, o.count || 1); - } - this.reset(); - } - else if (a) { - a.fn(editor, editor.getSelectionRange(), a.count, param); - this.reset(); - } - handleCursorMove(editor); - }, - - isAccepting: function(type) { - return this.accepting.indexOf(type) !== -1; - }, - - reset: function() { - this.operator = null; - this.motion = null; - this.currentCount = ""; - this.status = ""; - this.accepting = [NUMBER, OPERATOR, MOTION, ACTION]; - this.idle = true; - this.waitingForParam = null; - } -}; - -function setPreviousCommand(fn) { - inputBuffer.previous = { action: { action: { fn: fn } } }; -} - -exports.coreCommands = { - start: { - exec: function start(editor) { - util.insertMode(editor); - setPreviousCommand(start); - } - }, - startBeginning: { - exec: function startBeginning(editor) { - editor.navigateLineStart(); - util.insertMode(editor); - setPreviousCommand(startBeginning); - } - }, - stop: { - exec: function stop(editor) { - inputBuffer.reset(); - util.onVisualMode = false; - util.onVisualLineMode = false; - inputBuffer.lastInsertCommands = util.normalMode(editor); - } - }, - append: { - exec: function append(editor) { - var pos = editor.getCursorPosition(); - var lineLen = editor.session.getLine(pos.row).length; - if (lineLen) - editor.navigateRight(); - util.insertMode(editor); - setPreviousCommand(append); - } - }, - appendEnd: { - exec: function appendEnd(editor) { - editor.navigateLineEnd(); - util.insertMode(editor); - setPreviousCommand(appendEnd); - } - } -}; - -var handleCursorMove = exports.onCursorMove = function(editor, e) { - if (util.currentMode === 'insert' || handleCursorMove.running) - return; - else if(!editor.selection.isEmpty()) { - handleCursorMove.running = true; - if (util.onVisualLineMode) { - var originRow = editor.selection.visualLineStart; - var cursorRow = editor.getCursorPosition().row; - if(originRow <= cursorRow) { - var endLine = editor.session.getLine(cursorRow); - editor.selection.moveTo(originRow, 0); - editor.selection.selectTo(cursorRow, endLine.length); - } else { - var endLine = editor.session.getLine(originRow); - editor.selection.moveTo(originRow, endLine.length); - editor.selection.selectTo(cursorRow, 0); - } - } - handleCursorMove.running = false; - return; - } - else { - if (e && (util.onVisualLineMode || util.onVisualMode)) { - editor.selection.clearSelection(); - util.normalMode(editor); - } - - handleCursorMove.running = true; - var pos = editor.getCursorPosition(); - var lineLen = editor.session.getLine(pos.row).length; - - if (lineLen && pos.column === lineLen) - editor.navigateLeft(); - handleCursorMove.running = false; - } -}; -}); -ace.define('ace/keyboard/vim/maps/util', ['require', 'exports', 'module' , 'ace/keyboard/vim/registers', 'ace/lib/dom'], function(require, exports, module) { -var registers = require("../registers"); - -var dom = require("../../../lib/dom"); -dom.importCssString('.insert-mode .ace_cursor{\ - border-left: 2px solid #333333;\ -}\ -.ace_dark.insert-mode .ace_cursor{\ - border-left: 2px solid #eeeeee;\ -}\ -.normal-mode .ace_cursor{\ - border: 0!important;\ - background-color: red;\ - opacity: 0.5;\ -}', 'vimMode'); - -module.exports = { - onVisualMode: false, - onVisualLineMode: false, - currentMode: 'normal', - noMode: function(editor) { - editor.unsetStyle('insert-mode'); - editor.unsetStyle('normal-mode'); - if (editor.commands.recording) - editor.commands.toggleRecording(editor); - editor.setOverwrite(false); - }, - insertMode: function(editor) { - this.currentMode = 'insert'; - editor.setStyle('insert-mode'); - editor.unsetStyle('normal-mode'); - - editor.setOverwrite(false); - editor.keyBinding.$data.buffer = ""; - editor.keyBinding.$data.state = "insertMode"; - this.onVisualMode = false; - this.onVisualLineMode = false; - if(this.onInsertReplaySequence) { - editor.commands.macro = this.onInsertReplaySequence; - editor.commands.replay(editor); - this.onInsertReplaySequence = null; - this.normalMode(editor); - } else { - editor._emit("changeStatus"); - if(!editor.commands.recording) - editor.commands.toggleRecording(editor); - } - }, - normalMode: function(editor) { - this.currentMode = 'normal'; - - editor.unsetStyle('insert-mode'); - editor.setStyle('normal-mode'); - editor.clearSelection(); - - var pos; - if (!editor.getOverwrite()) { - pos = editor.getCursorPosition(); - if (pos.column > 0) - editor.navigateLeft(); - } - - editor.setOverwrite(true); - editor.keyBinding.$data.buffer = ""; - editor.keyBinding.$data.state = "start"; - this.onVisualMode = false; - this.onVisualLineMode = false; - editor._emit("changeStatus"); - if (editor.commands.recording) { - editor.commands.toggleRecording(editor); - return editor.commands.macro; - } - else { - return []; - } - }, - visualMode: function(editor, lineMode) { - if ( - (this.onVisualLineMode && lineMode) - || (this.onVisualMode && !lineMode) - ) { - this.normalMode(editor); - return; - } - - editor.setStyle('insert-mode'); - editor.unsetStyle('normal-mode'); - - editor._emit("changeStatus"); - if (lineMode) { - this.onVisualLineMode = true; - } else { - this.onVisualMode = true; - this.onVisualLineMode = false; - } - }, - getRightNthChar: function(editor, cursor, ch, n) { - var line = editor.getSession().getLine(cursor.row); - var matches = line.substr(cursor.column + 1).split(ch); - - return n < matches.length ? matches.slice(0, n).join(ch).length : null; - }, - getLeftNthChar: function(editor, cursor, ch, n) { - var line = editor.getSession().getLine(cursor.row); - var matches = line.substr(0, cursor.column).split(ch); - - return n < matches.length ? matches.slice(-1 * n).join(ch).length : null; - }, - toRealChar: function(ch) { - if (ch.length === 1) - return ch; - - if (/^shift-./.test(ch)) - return ch[ch.length - 1].toUpperCase(); - else - return ""; - }, - copyLine: function(editor) { - var pos = editor.getCursorPosition(); - editor.selection.moveTo(pos.row, pos.column); - editor.selection.selectLine(); - registers._default.isLine = true; - registers._default.text = editor.getCopyText().replace(/\n$/, ""); - editor.selection.moveTo(pos.row, pos.column); - } -}; -}); - -ace.define('ace/keyboard/vim/registers', ['require', 'exports', 'module' ], function(require, exports, module) { - -"never use strict"; - -module.exports = { - _default: { - text: "", - isLine: false - } -}; - -}); - - -ace.define('ace/keyboard/vim/maps/motions', ['require', 'exports', 'module' , 'ace/keyboard/vim/maps/util', 'ace/search', 'ace/range'], function(require, exports, module) { - - -var util = require("./util"); - -var keepScrollPosition = function(editor, fn) { - var scrollTopRow = editor.renderer.getScrollTopRow(); - var initialRow = editor.getCursorPosition().row; - var diff = initialRow - scrollTopRow; - fn && fn.call(editor); - editor.renderer.scrollToRow(editor.getCursorPosition().row - diff); -}; - -function Motion(m) { - if (typeof m == "function") { - var getPos = m; - m = this; - } else { - var getPos = m.getPos; - } - m.nav = function(editor, range, count, param) { - var a = getPos(editor, range, count, param, false); - if (!a) - return; - editor.selection.moveTo(a.row, a.column); - }; - m.sel = function(editor, range, count, param) { - var a = getPos(editor, range, count, param, true); - if (!a) - return; - editor.selection.selectTo(a.row, a.column); - }; - return m; -} - -var nonWordRe = /[\s.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/; -var wordSeparatorRe = /[.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/; -var whiteRe = /\s/; -var StringStream = function(editor, cursor) { - var sel = editor.selection; - this.range = sel.getRange(); - cursor = cursor || sel.selectionLead; - this.row = cursor.row; - this.col = cursor.column; - var line = editor.session.getLine(this.row); - var maxRow = editor.session.getLength(); - this.ch = line[this.col] || '\n'; - this.skippedLines = 0; - - this.next = function() { - this.ch = line[++this.col] || this.handleNewLine(1); - return this.ch; - }; - this.prev = function() { - this.ch = line[--this.col] || this.handleNewLine(-1); - return this.ch; - }; - this.peek = function(dir) { - var ch = line[this.col + dir]; - if (ch) - return ch; - if (dir == -1) - return '\n'; - if (this.col == line.length - 1) - return '\n'; - return editor.session.getLine(this.row + 1)[0] || '\n'; - }; - - this.handleNewLine = function(dir) { - if (dir == 1){ - if (this.col == line.length) - return '\n'; - if (this.row == maxRow - 1) - return ''; - this.col = 0; - this.row ++; - line = editor.session.getLine(this.row); - this.skippedLines++; - return line[0] || '\n'; - } - if (dir == -1) { - if (this.row === 0) - return ''; - this.row --; - line = editor.session.getLine(this.row); - this.col = line.length; - this.skippedLines--; - return '\n'; - } - }; - this.debug = function() { - console.log(line.substring(0, this.col)+'|'+this.ch+'\''+this.col+'\''+line.substr(this.col+1)); - }; -}; - -var Search = require("../../../search").Search; -var search = new Search(); - -function find(editor, needle, dir) { - search.$options.needle = needle; - search.$options.backwards = dir == -1; - return search.find(editor.session); -} - -var Range = require("../../../range").Range; - -var LAST_SEARCH_MOTION = {}; - -module.exports = { - "w": new Motion(function(editor) { - var str = new StringStream(editor); - - if (str.ch && wordSeparatorRe.test(str.ch)) { - while (str.ch && wordSeparatorRe.test(str.ch)) - str.next(); - } else { - while (str.ch && !nonWordRe.test(str.ch)) - str.next(); - } - while (str.ch && whiteRe.test(str.ch) && str.skippedLines < 2) - str.next(); - - str.skippedLines == 2 && str.prev(); - return {column: str.col, row: str.row}; - }), - "W": new Motion(function(editor) { - var str = new StringStream(editor); - while(str.ch && !(whiteRe.test(str.ch) && !whiteRe.test(str.peek(1))) && str.skippedLines < 2) - str.next(); - if (str.skippedLines == 2) - str.prev(); - else - str.next(); - - return {column: str.col, row: str.row}; - }), - "b": new Motion(function(editor) { - var str = new StringStream(editor); - - str.prev(); - while (str.ch && whiteRe.test(str.ch) && str.skippedLines > -2) - str.prev(); - - if (str.ch && wordSeparatorRe.test(str.ch)) { - while (str.ch && wordSeparatorRe.test(str.ch)) - str.prev(); - } else { - while (str.ch && !nonWordRe.test(str.ch)) - str.prev(); - } - str.ch && str.next(); - return {column: str.col, row: str.row}; - }), - "B": new Motion(function(editor) { - var str = new StringStream(editor); - str.prev(); - while(str.ch && !(!whiteRe.test(str.ch) && whiteRe.test(str.peek(-1))) && str.skippedLines > -2) - str.prev(); - - if (str.skippedLines == -2) - str.next(); - - return {column: str.col, row: str.row}; - }), - "e": new Motion(function(editor) { - var str = new StringStream(editor); - - str.next(); - while (str.ch && whiteRe.test(str.ch)) - str.next(); - - if (str.ch && wordSeparatorRe.test(str.ch)) { - while (str.ch && wordSeparatorRe.test(str.ch)) - str.next(); - } else { - while (str.ch && !nonWordRe.test(str.ch)) - str.next(); - } - str.ch && str.prev(); - return {column: str.col, row: str.row}; - }), - "E": new Motion(function(editor) { - var str = new StringStream(editor); - str.next(); - while(str.ch && !(!whiteRe.test(str.ch) && whiteRe.test(str.peek(1)))) - str.next(); - - return {column: str.col, row: str.row}; - }), - - "l": { - nav: function(editor) { - var pos = editor.getCursorPosition(); - var col = pos.column; - var lineLen = editor.session.getLine(pos.row).length; - if (lineLen && col !== lineLen) - editor.navigateRight(); - }, - sel: function(editor) { - var pos = editor.getCursorPosition(); - var col = pos.column; - var lineLen = editor.session.getLine(pos.row).length; - if (lineLen && col !== lineLen) //In selection mode you can select the newline - editor.selection.selectRight(); - } - }, - "h": { - nav: function(editor) { - var pos = editor.getCursorPosition(); - if (pos.column > 0) - editor.navigateLeft(); - }, - sel: function(editor) { - var pos = editor.getCursorPosition(); - if (pos.column > 0) - editor.selection.selectLeft(); - } - }, - "H": { - nav: function(editor) { - var row = editor.renderer.getScrollTopRow(); - editor.moveCursorTo(row); - }, - sel: function(editor) { - var row = editor.renderer.getScrollTopRow(); - editor.selection.selectTo(row); - } - }, - "M": { - nav: function(editor) { - var topRow = editor.renderer.getScrollTopRow(); - var bottomRow = editor.renderer.getScrollBottomRow(); - var row = topRow + ((bottomRow - topRow) / 2); - editor.moveCursorTo(row); - }, - sel: function(editor) { - var topRow = editor.renderer.getScrollTopRow(); - var bottomRow = editor.renderer.getScrollBottomRow(); - var row = topRow + ((bottomRow - topRow) / 2); - editor.selection.selectTo(row); - } - }, - "L": { - nav: function(editor) { - var row = editor.renderer.getScrollBottomRow(); - editor.moveCursorTo(row); - }, - sel: function(editor) { - var row = editor.renderer.getScrollBottomRow(); - editor.selection.selectTo(row); - } - }, - "k": { - nav: function(editor) { - editor.navigateUp(); - }, - sel: function(editor) { - editor.selection.selectUp(); - } - }, - "j": { - nav: function(editor) { - editor.navigateDown(); - }, - sel: function(editor) { - editor.selection.selectDown(); - } - }, - - "i": { - param: true, - sel: function(editor, range, count, param) { - switch (param) { - case "w": - editor.selection.selectWord(); - break; - case "W": - editor.selection.selectAWord(); - break; - case "(": - case "{": - case "[": - var cursor = editor.getCursorPosition(); - var end = editor.session.$findClosingBracket(param, cursor, /paren/); - if (!end) - return; - var start = editor.session.$findOpeningBracket(editor.session.$brackets[param], cursor, /paren/); - if (!start) - return; - start.column ++; - editor.selection.setSelectionRange(Range.fromPoints(start, end)); - break; - case "'": - case '"': - case "/": - var end = find(editor, param, 1); - if (!end) - return; - var start = find(editor, param, -1); - if (!start) - return; - editor.selection.setSelectionRange(Range.fromPoints(start.end, end.start)); - break; - } - } - }, - "a": { - param: true, - sel: function(editor, range, count, param) { - switch (param) { - case "w": - editor.selection.selectAWord(); - break; - case "W": - editor.selection.selectAWord(); - break; - case "(": - case "{": - case "[": - var cursor = editor.getCursorPosition(); - var end = editor.session.$findClosingBracket(param, cursor, /paren/); - if (!end) - return; - var start = editor.session.$findOpeningBracket(editor.session.$brackets[param], cursor, /paren/); - if (!start) - return; - end.column ++; - editor.selection.setSelectionRange(Range.fromPoints(start, end)); - break; - case "'": - case "\"": - case "/": - var end = find(editor, param, 1); - if (!end) - return; - var start = find(editor, param, -1); - if (!start) - return; - end.column ++; - editor.selection.setSelectionRange(Range.fromPoints(start.start, end.end)); - break; - } - } - }, - - "f": new Motion({ - param: true, - handlesCount: true, - getPos: function(editor, range, count, param, isSel, isRepeat) { - if (!isRepeat) - LAST_SEARCH_MOTION = {ch: "f", param: param}; - var cursor = editor.getCursorPosition(); - var column = util.getRightNthChar(editor, cursor, param, count || 1); - - if (typeof column === "number") { - cursor.column += column + (isSel ? 2 : 1); - return cursor; - } - } - }), - "F": new Motion({ - param: true, - handlesCount: true, - getPos: function(editor, range, count, param, isSel, isRepeat) { - if (!isRepeat) - LAST_SEARCH_MOTION = {ch: "F", param: param}; - var cursor = editor.getCursorPosition(); - var column = util.getLeftNthChar(editor, cursor, param, count || 1); - - if (typeof column === "number") { - cursor.column -= column + 1; - return cursor; - } - } - }), - "t": new Motion({ - param: true, - handlesCount: true, - getPos: function(editor, range, count, param, isSel, isRepeat) { - if (!isRepeat) - LAST_SEARCH_MOTION = {ch: "t", param: param}; - var cursor = editor.getCursorPosition(); - var column = util.getRightNthChar(editor, cursor, param, count || 1); - - if (isRepeat && column == 0 && !(count > 1)) - var column = util.getRightNthChar(editor, cursor, param, 2); - - if (typeof column === "number") { - cursor.column += column + (isSel ? 1 : 0); - return cursor; - } - } - }), - "T": new Motion({ - param: true, - handlesCount: true, - getPos: function(editor, range, count, param, isSel, isRepeat) { - if (!isRepeat) - LAST_SEARCH_MOTION = {ch: "T", param: param}; - var cursor = editor.getCursorPosition(); - var column = util.getLeftNthChar(editor, cursor, param, count || 1); - - if (isRepeat && column == 0 && !(count > 1)) - var column = util.getLeftNthChar(editor, cursor, param, 2); - - if (typeof column === "number") { - cursor.column -= column; - return cursor; - } - } - }), - ";": new Motion({ - handlesCount: true, - getPos: function(editor, range, count, param, isSel) { - var ch = LAST_SEARCH_MOTION.ch; - if (!ch) - return; - return module.exports[ch].getPos( - editor, range, count, LAST_SEARCH_MOTION.param, isSel, true - ); - } - }), - ",": new Motion({ - handlesCount: true, - getPos: function(editor, range, count, param, isSel) { - var ch = LAST_SEARCH_MOTION.ch; - if (!ch) - return; - var up = ch.toUpperCase(); - ch = ch === up ? ch.toLowerCase() : up; - - return module.exports[ch].getPos( - editor, range, count, LAST_SEARCH_MOTION.param, isSel, true - ); - } - }), - - "^": { - nav: function(editor) { - editor.navigateLineStart(); - }, - sel: function(editor) { - editor.selection.selectLineStart(); - } - }, - "$": { - handlesCount: true, - nav: function(editor, range, count, param) { - if (count > 1) { - editor.navigateDown(count-1); - } - editor.navigateLineEnd(); - }, - sel: function(editor, range, count, param) { - if (count > 1) { - editor.selection.moveCursorBy(count-1, 0); - } - editor.selection.selectLineEnd(); - } - }, - "0": new Motion(function(ed) { - return {row: ed.selection.lead.row, column: 0}; - }), - "G": { - nav: function(editor, range, count, param) { - if (!count && count !== 0) { // Stupid JS - count = editor.session.getLength(); - } - editor.gotoLine(count); - }, - sel: function(editor, range, count, param) { - if (!count && count !== 0) { // Stupid JS - count = editor.session.getLength(); - } - editor.selection.selectTo(count, 0); - } - }, - "g": { - param: true, - nav: function(editor, range, count, param) { - switch(param) { - case "m": - console.log("Middle line"); - break; - case "e": - console.log("End of prev word"); - break; - case "g": - editor.gotoLine(count || 0); - case "u": - editor.gotoLine(count || 0); - case "U": - editor.gotoLine(count || 0); - } - }, - sel: function(editor, range, count, param) { - switch(param) { - case "m": - console.log("Middle line"); - break; - case "e": - console.log("End of prev word"); - break; - case "g": - editor.selection.selectTo(count || 0, 0); - } - } - }, - "o": { - nav: function(editor, range, count, param) { - count = count || 1; - var content = ""; - while (0 < count--) - content += "\n"; - - if (content.length) { - editor.navigateLineEnd() - editor.insert(content); - util.insertMode(editor); - } - } - }, - "O": { - nav: function(editor, range, count, param) { - var row = editor.getCursorPosition().row; - count = count || 1; - var content = ""; - while (0 < count--) - content += "\n"; - - if (content.length) { - if(row > 0) { - editor.navigateUp(); - editor.navigateLineEnd() - editor.insert(content); - } else { - editor.session.insert({row: 0, column: 0}, content); - editor.navigateUp(); - } - util.insertMode(editor); - } - } - }, - "%": new Motion(function(editor){ - var brRe = /[\[\]{}()]/g; - var cursor = editor.getCursorPosition(); - var ch = editor.session.getLine(cursor.row)[cursor.column]; - if (!brRe.test(ch)) { - var range = find(editor, brRe); - if (!range) - return; - cursor = range.start; - } - var match = editor.session.findMatchingBracket({ - row: cursor.row, - column: cursor.column + 1 - }); - - return match; - }), - "{": new Motion(function(ed) { - var session = ed.session; - var row = session.selection.lead.row; - while(row > 0 && !/\S/.test(session.getLine(row))) - row--; - while(/\S/.test(session.getLine(row))) - row--; - return {column: 0, row: row}; - }), - "}": new Motion(function(ed) { - var session = ed.session; - var l = session.getLength(); - var row = session.selection.lead.row; - while(row < l && !/\S/.test(session.getLine(row))) - row++; - while(/\S/.test(session.getLine(row))) - row++; - return {column: 0, row: row}; - }), - "ctrl-d": { - nav: function(editor, range, count, param) { - editor.selection.clearSelection(); - keepScrollPosition(editor, editor.gotoPageDown); - }, - sel: function(editor, range, count, param) { - keepScrollPosition(editor, editor.selectPageDown); - } - }, - "ctrl-u": { - nav: function(editor, range, count, param) { - editor.selection.clearSelection(); - keepScrollPosition(editor, editor.gotoPageUp); - }, - sel: function(editor, range, count, param) { - keepScrollPosition(editor, editor.selectPageUp); - } - }, - "`": new Motion({ - param: true, - handlesCount: true, - getPos: function(editor, range, count, param, isSel) { - var s = editor.session; - var marker = s.vimMarkers && s.vimMarkers[param]; - if (marker) { - return marker.getPosition(); - } - } - }), - "'": new Motion({ - param: true, - handlesCount: true, - getPos: function(editor, range, count, param, isSel) { - var s = editor.session; - var marker = s.vimMarkers && s.vimMarkers[param]; - if (marker) { - var pos = marker.getPosition(); - var line = editor.session.getLine(pos.row); - pos.column = line.search(/\S/); - if (pos.column == -1) - pos.column = line.length; - return pos; - } - } - }) -}; - -module.exports.backspace = module.exports.left = module.exports.h; -module.exports.space = module.exports['return'] = module.exports.right = module.exports.l; -module.exports.up = module.exports.k; -module.exports.down = module.exports.j; -module.exports.pagedown = module.exports["ctrl-d"]; -module.exports.pageup = module.exports["ctrl-u"]; -module.exports.home = module.exports["0"]; -module.exports.end = module.exports["$"]; - -}); - -ace.define('ace/keyboard/vim/maps/operators', ['require', 'exports', 'module' , 'ace/keyboard/vim/maps/util', 'ace/keyboard/vim/registers'], function(require, exports, module) { - - - -var util = require("./util"); -var registers = require("../registers"); - -module.exports = { - "d": { - selFn: function(editor, range, count, param) { - registers._default.text = editor.getCopyText(); - registers._default.isLine = util.onVisualLineMode; - if(util.onVisualLineMode) - editor.removeLines(); - else - editor.session.remove(range); - util.normalMode(editor); - }, - fn: function(editor, range, count, param) { - count = count || 1; - switch (param) { - case "d": - registers._default.text = ""; - registers._default.isLine = true; - for (var i = 0; i < count; i++) { - editor.selection.selectLine(); - registers._default.text += editor.getCopyText(); - var selRange = editor.getSelectionRange(); - if (!selRange.isMultiLine()) { - var row = selRange.start.row - 1; - var col = editor.session.getLine(row).length - selRange.setStart(row, col); - editor.session.remove(selRange); - editor.selection.clearSelection(); - break; - } - editor.session.remove(selRange); - editor.selection.clearSelection(); - } - registers._default.text = registers._default.text.replace(/\n$/, ""); - break; - default: - if (range) { - editor.selection.setSelectionRange(range); - registers._default.text = editor.getCopyText(); - registers._default.isLine = false; - editor.session.remove(range); - editor.selection.clearSelection(); - } - } - } - }, - "c": { - selFn: function(editor, range, count, param) { - editor.session.remove(range); - util.insertMode(editor); - }, - fn: function(editor, range, count, param) { - count = count || 1; - switch (param) { - case "c": - for (var i = 0; i < count; i++) { - editor.removeLines(); - util.insertMode(editor); - } - - break; - default: - if (range) { - editor.session.remove(range); - util.insertMode(editor); - } - } - } - }, - "y": { - selFn: function(editor, range, count, param) { - registers._default.text = editor.getCopyText(); - registers._default.isLine = util.onVisualLineMode; - editor.selection.clearSelection(); - util.normalMode(editor); - }, - fn: function(editor, range, count, param) { - count = count || 1; - switch (param) { - case "y": - var pos = editor.getCursorPosition(); - editor.selection.selectLine(); - for (var i = 0; i < count - 1; i++) { - editor.selection.moveCursorDown(); - } - registers._default.text = editor.getCopyText().replace(/\n$/, ""); - editor.selection.clearSelection(); - registers._default.isLine = true; - editor.moveCursorToPosition(pos); - break; - default: - if (range) { - var pos = editor.getCursorPosition(); - editor.selection.setSelectionRange(range); - registers._default.text = editor.getCopyText(); - registers._default.isLine = false; - editor.selection.clearSelection(); - editor.moveCursorTo(pos.row, pos.column); - } - } - } - }, - ">": { - selFn: function(editor, range, count, param) { - count = count || 1; - for (var i = 0; i < count; i++) { - editor.indent(); - } - util.normalMode(editor); - }, - fn: function(editor, range, count, param) { - count = parseInt(count || 1, 10); - switch (param) { - case ">": - var pos = editor.getCursorPosition(); - editor.selection.selectLine(); - for (var i = 0; i < count - 1; i++) { - editor.selection.moveCursorDown(); - } - editor.indent(); - editor.selection.clearSelection(); - editor.moveCursorToPosition(pos); - editor.navigateLineEnd(); - editor.navigateLineStart(); - break; - } - } - }, - "<": { - selFn: function(editor, range, count, param) { - count = count || 1; - for (var i = 0; i < count; i++) { - editor.blockOutdent(); - } - util.normalMode(editor); - }, - fn: function(editor, range, count, param) { - count = count || 1; - switch (param) { - case "<": - var pos = editor.getCursorPosition(); - editor.selection.selectLine(); - for (var i = 0; i < count - 1; i++) { - editor.selection.moveCursorDown(); - } - editor.blockOutdent(); - editor.selection.clearSelection(); - editor.moveCursorToPosition(pos); - editor.navigateLineEnd(); - editor.navigateLineStart(); - break; - } - } - } -}; -}); - -"use strict" - -ace.define('ace/keyboard/vim/maps/aliases', ['require', 'exports', 'module' ], function(require, exports, module) { -module.exports = { - "x": { - operator: { - ch: "d", - count: 1 - }, - motion: { - ch: "l", - count: 1 - } - }, - "X": { - operator: { - ch: "d", - count: 1 - }, - motion: { - ch: "h", - count: 1 - } - }, - "D": { - operator: { - ch: "d", - count: 1 - }, - motion: { - ch: "$", - count: 1 - } - }, - "C": { - operator: { - ch: "c", - count: 1 - }, - motion: { - ch: "$", - count: 1 - } - }, - "s": { - operator: { - ch: "c", - count: 1 - }, - motion: { - ch: "l", - count: 1 - } - }, - "S": { - operator: { - ch: "c", - count: 1 - }, - param: "c" - } -}; -}); - diff --git a/util/build-sample-browser/player/vendor/ace/mode-abap.js b/util/build-sample-browser/player/vendor/ace/mode-abap.js deleted file mode 100644 index 3c52cd5857..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-abap.js +++ /dev/null @@ -1,261 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/abap', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/abap_highlight_rules', 'ace/mode/folding/coffee', 'ace/range', 'ace/mode/text', 'ace/lib/oop'], function(require, exports, module) { - - -var Tokenizer = require("../tokenizer").Tokenizer; -var Rules = require("./abap_highlight_rules").AbapHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; -var Range = require("../range").Range; -var TextMode = require("./text").Mode; -var oop = require("../lib/oop"); - -function Mode() { - this.HighlightRules = Rules; - this.foldingRules = new FoldMode(); -} - -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - return indent; - }; - - this.toggleCommentLines = function(state, doc, startRow, endRow){ - var range = new Range(0, 0, 0, 0); - for (var i = startRow; i <= endRow; ++i) { - var line = doc.getLine(i); - if (hereComment.test(line)) - continue; - - if (commentLine.test(line)) - line = line.replace(commentLine, '$1'); - else - line = line.replace(indentation, '$&#'); - - range.end.row = range.start.row = i; - range.end.column = line.length + 1; - doc.replace(range, line); - } - }; - - this.$id = "ace/mode/abap"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/abap_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AbapHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": - "ADD ALIAS ALIASES ASSERT ASSIGN ASSIGNING AT BACK" + - " CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY" + - " DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO" + - " ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT" + - " FETCH FIELDS FORM FORMAT FREE FROM FUNCTION" + - " GENERATE GET" + - " HIDE" + - " IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION" + - " LEAVE LIKE LINE LOAD LOCAL LOOP" + - " MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY" + - " ON OVERLAY OPTIONAL OTHERS" + - " PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT" + - " RAISE RANGES READ RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK" + - " SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS" + - " TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES" + - " UNASSIGN ULINE UNPACK UPDATE" + - " WHEN WHILE WINDOW WRITE" + - " OCCURS STRUCTURE OBJECT PROPERTY" + - " CASTING APPEND RAISING VALUE COLOR" + - " CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT" + - " ID NUMBER FOR TITLE OUTPUT" + - " WITH EXIT USING" + - " INTO WHERE GROUP BY HAVING ORDER BY SINGLE" + - " APPENDING CORRESPONDING FIELDS OF TABLE" + - " LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING" + - " EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN", - "constant.language": - "TRUE FALSE NULL SPACE", - "support.type": - "c n i p f d t x string xstring decfloat16 decfloat34", - "keyword.operator": - "abs sign ceil floor trunc frac acos asin atan cos sin tan" + - " abapOperator cosh sinh tanh exp log log10 sqrt" + - " strlen xstrlen charlen numofchar dbmaxlen lines" - }, "text", true, " "); - - var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|"+ - "EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|"+ - "END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|"+ - "RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|"+ - "WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|"+ - "(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)"+ - "(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|"+ - "LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|"+ - "CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|"+ - "FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|"+ - "NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|"+ - "START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|"+ - "TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|"+ - "IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)"; - - this.$rules = { - "start" : [ - {token : "string", regex : "`", next : "string"}, - {token : "string", regex : "'", next : "qstring"}, - {token : "doc.comment", regex : /^\*.+/}, - {token : "comment", regex : /".+$/}, - {token : "invalid", regex: "\\.{2,}"}, - {token : "keyword.operator", regex: /\W[\-+\%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/}, - {token : "paren.lparen", regex : "[\\[({]"}, - {token : "paren.rparen", regex : "[\\])}]"}, - {token : "constant.numeric", regex: "[+-]?\\d+\\b"}, - {token : "variable.parameter", regex : /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/}, - {token : "keyword", regex : compoundKeywords}, - {token : "variable.parameter", regex : /\w+-\w+(?:-\w+)*/}, - {token : keywordMapper, regex : "\\b\\w+\\b"}, - {caseInsensitive: true} - ], - "qstring" : [ - {token : "constant.language.escape", regex : "''"}, - {token : "string", regex : "'", next : "start"}, - {defaultToken : "string"} - ], - "string" : [ - {token : "constant.language.escape", regex : "``"}, - {token : "string", regex : "`", next : "start"}, - {defaultToken : "string"} - ] - } -}; -oop.inherits(AbapHighlightRules, TextHighlightRules); - -exports.AbapHighlightRules = AbapHighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-actionscript.js b/util/build-sample-browser/player/vendor/ace/mode-actionscript.js deleted file mode 100644 index 17c0f12bf0..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-actionscript.js +++ /dev/null @@ -1,257 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/actionscript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/actionscript_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ActionScriptHighlightRules = require("./actionscript_highlight_rules").ActionScriptHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ActionScriptHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/actionscript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/actionscript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ActionScriptHighlightRules = function() { - - this.$rules = { start: - [ { token: 'support.class.actionscript.2', - regex: '\\b(?:R(?:ecordset|DBMSResolver|adioButton(?:Group)?)|X(?:ML(?:Socket|Node|Connector)?|UpdateResolverDataHolder)|M(?:M(?:Save|Execute)|icrophoneMicrophone|o(?:use|vieClip(?:Loader)?)|e(?:nu(?:Bar)?|dia(?:Controller|Display|Playback))|ath)|B(?:yName|inding|utton)|S(?:haredObject|ystem|crollPane|t(?:yleSheet|age|ream)|ound|e(?:ndEvent|rviceObject)|OAPCall|lide)|N(?:umericStepper|et(?:stream|S(?:tream|ervices)|Connection|Debug(?:Config)?))|C(?:heckBox|o(?:ntextMenu(?:Item)?|okie|lor|m(?:ponentMixins|boBox))|ustomActions|lient|amera)|T(?:ypedValue|ext(?:Snapshot|Input|F(?:ield|ormat)|Area)|ree|AB)|Object|D(?:ownload|elta(?:Item|Packet)?|at(?:e(?:Chooser|Field)?|a(?:G(?:lue|rid)|Set|Type)))|U(?:RL|TC|IScrollBar)|P(?:opUpManager|endingCall|r(?:intJob|o(?:duct|gressBar)))|E(?:ndPoint|rror)|Video|Key|F(?:RadioButton|GridColumn|MessageBox|BarChart|S(?:croll(?:Bar|Pane)|tyleFormat|plitView)|orm|C(?:heckbox|omboBox|alendar)|unction|T(?:icker|ooltip(?:Lite)?|ree(?:Node)?)|IconButton|D(?:ataGrid|raggablePane)|P(?:ieChart|ushButton|ro(?:gressBar|mptBox))|L(?:i(?:stBox|neChart)|oadingBox)|AdvancedMessageBox)|W(?:indow|SDLURL|ebService(?:Connector)?)|L(?:ist|o(?:calConnection|ad(?:er|Vars)|g)|a(?:unch|bel))|A(?:sBroadcaster|cc(?:ordion|essibility)|S(?:Set(?:Native|PropFlags)|N(?:ew|ative)|C(?:onstructor|lamp(?:2)?)|InstanceOf)|pplication|lert|rray))\\b' }, - { token: 'support.function.actionscript.2', - regex: '\\b(?:s(?:h(?:ift|ow(?:GridLines|Menu|Border|Settings|Headers|ColumnHeaders|Today|Preferences)?|ad(?:ow|ePane))|c(?:hema|ale(?:X|Mode|Y|Content)|r(?:oll(?:Track|Drag)?|een(?:Resolution|Color|DPI)))|t(?:yleSheet|op(?:Drag|A(?:nimation|llSounds|gent))?|epSize|a(?:tus|rt(?:Drag|A(?:nimation|gent))?))|i(?:n|ze|lence(?:TimeOut|Level))|o(?:ngname|urce|rt(?:Items(?:By)?|On(?:HeaderRelease)?|able(?:Columns)?)?)|u(?:ppressInvalidCalls|bstr(?:ing)?)|p(?:li(?:ce|t)|aceCol(?:umnsEqually|lumnsEqually))|e(?:nd(?:DefaultPushButtonEvent|AndLoad)?|curity|t(?:R(?:GB|o(?:otNode|w(?:Height|Count))|esizable(?:Columns)?|a(?:nge|te))|G(?:ain|roupName)|X(?:AxisTitle)?|M(?:i(?:n(?:imum|utes)|lliseconds)|o(?:nth(?:Names)?|tionLevel|de)|ultilineMode|e(?:ssage|nu(?:ItemEnabled(?:At)?|EnabledAt)|dia)|a(?:sk|ximum))|B(?:u(?:tton(?:s|Width)|fferTime)|a(?:seTabIndex|ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Target|P(?:osition|roperties)|barState|Location)|t(?:yle(?:Property)?|opOnFocus|at(?:us|e))|i(?:ze|lenceLevel)|ort(?:able(?:Columns)?|Function)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)?|Style|Color|ed(?:Node(?:s)?|Cell|I(?:nd(?:ices|ex)|tem(?:s)?))?|able))|kin|m(?:oothness|allScroll))|H(?:ighlight(?:s|Color)|Scroll|o(?:urs|rizontal)|eader(?:Symbol|Height|Text|Property|Format|Width|Location)?|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:ode(?:Properties|ExpansionHandler)|ewTextFormat)|C(?:h(?:ildNodes|a(?:ngeHandler|rt(?:Title|EventHandler)))|o(?:ntent(?:Size)?|okie|lumns)|ell(?:Symbol|Data)|l(?:i(?:ckHandler|pboard)|oseHandler)|redentials)|T(?:ype(?:dVaule)?|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:out(?:Handler)?)?)|oggle|extFormat|ransform)|I(?:s(?:Branch|Open)|n(?:terval|putProperty)|con(?:SymbolName)?|te(?:rator|m(?:ByKey|Symbol)))|Orientation|D(?:i(?:splay(?:Range|Graphics|Mode|Clip|Text|edMonth)|rection)|uration|e(?:pth(?:Below|To|Above)|fault(?:GatewayURL|Mappings|NodeIconSymbolName)|l(?:iveryMode|ay)|bug(?:ID)?)|a(?:yOfWeekNames|t(?:e(?:Filter)?|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Provider|All(?:Height|Property|Format|Width))?))|ra(?:wConnectors|gContent))|U(?:se(?:Shadow|HandCursor|EchoSuppression|rInput|Fade)|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear))|P(?:osition|ercentComplete|an(?:e(?:M(?:inimumSize|aximumSize)|Size|Title))?|ro(?:pert(?:y(?:Data)?|iesAt)|gress))|E(?:nabled|dit(?:Handler|able)|xpand(?:NodeTrigger|erSymbolName))|V(?:Scroll|olume|alue(?:Source)?)|KeyFrameInterval|Quality|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|ocus|ullYear|ps|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:opback|adTarget)|a(?:rgeScroll|bel(?:Source|Placement)?))|A(?:s(?:Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:e(?:State(?:Handler)?|Handler)|ateHandler)|utoH(?:ideScrollBar|eight)))?|paratorBefore|ek|lect(?:ion(?:Disabled|Unfocused)?|ed(?:Node(?:s)?|Child|I(?:nd(?:ices|ex)|tem(?:s)?)|Dat(?:e|a))?|able(?:Ranges)?)|rver(?:String)?)|kip|qrt|wapDepths|lice|aveToSharedObj|moothing)|h(?:scroll(?:Policy)?|tml(?:Text)?|i(?:t(?:Test(?:TextNearPos)?|Area)|de(?:BuiltInItems|Child)?|ghlight(?:2D|3D)?)|orizontal|e(?:ight|ader(?:Re(?:nderer|lease)|Height|Text))|P(?:osition|ageScrollSize)|a(?:s(?:childNodes|MP3|S(?:creen(?:Broadcast|Playback)|treaming(?:Video|Audio)|ort)|Next|OwnProperty|Pr(?:inting|evious)|EmbeddedVideo|VideoEncoder|A(?:ccesibility|udio(?:Encoder)?))|ndlerName)|LineScrollSize)|ye(?:sLabel|ar)|n(?:o(?:t|de(?:Name|Close|Type|Open|Value)|Label)|u(?:llValue|mChild(?:S(?:creens|lides)|ren|Forms))|e(?:w(?:Item|line|Value|LocationDialog)|xt(?:S(?:cene|ibling|lide)|TabIndex|Value|Frame)?)?|ame(?:s)?)|c(?:h(?:ildNodes|eck|a(?:nge(?:sPending)?|r(?:CodeAt|At))|r)|o(?:s|n(?:st(?:ant|ructor)|nect|c(?:urrency|at)|t(?:ent(?:Type|Path)?|ains|rol(?:Placement|lerPolicy))|denseWhite|version)|py|l(?:or|umn(?:Stretch|Name(?:s)?|Count))|m(?:p(?:onent|lete)|ment))|u(?:stomItems|ePoint(?:s)?|r(?:veTo|Value|rent(?:Slide|ChildSlide|Item|F(?:ocused(?:S(?:creen|lide)|Form)|ps))))|e(?:il|ll(?:Renderer|Press|Edit|Focus(?:In|Out)))|l(?:i(?:ck|ents)|o(?:se(?:Button|Pane)?|ne(?:Node)?)|ear(?:S(?:haredObjects|treams)|Timeout|Interval)?)|a(?:ncelLabel|tch|p(?:tion|abilities)|l(?:cFields|l(?:e(?:e|r))?))|reate(?:GatewayConnection|Menu|Se(?:rver|gment)|C(?:hild(?:AtDepth)?|l(?:ient|ass(?:ChildAtDepth|Object(?:AtDepth)?))|all)|Text(?:Node|Field)|Item|Object(?:AtDepth)?|PopUp|E(?:lement|mptyMovieClip)))|t(?:h(?:is|row)|ype(?:of|Name)?|i(?:tle(?:StyleDeclaration)?|me(?:out)?)|o(?:talTime|String|olTipText|p|UpperCase|ggle(?:HighQuality)?|Lo(?:caleString|werCase))|e(?:st|llTarget|xt(?:RightMargin|Bold|S(?:ize|elected)|Height|Color|I(?:ndent|talic)|Disabled|Underline|F(?:ield|ont)|Width|LeftMargin|Align)?)|a(?:n|rget(?:Path)?|b(?:Stops|Children|Index|Enabled|leName))|r(?:y|igger|ac(?:e|k(?:AsMenu)?)))|i(?:s(?:Running|Branch|NaN|Con(?:soleOpen|nected)|Toggled|Installed|Open|D(?:own|ebugger)|P(?:urchased|ro(?:totypeOf|pertyEnumerable))|Empty|F(?:inite|ullyPopulated)|Local|Active)|n(?:s(?:tall|ertBefore)|cludeDeltaPacketInfo|t|it(?:ialize|Component|Pod|A(?:pplication|gent))?|de(?:nt|terminate|x(?:InParent(?:Slide|Form)?|Of)?)|put|validate|finity|LocalInternetCache)?|con(?:F(?:ield|unction))?|t(?:e(?:ratorScrolled|m(?:s|RollO(?:ut|ver)|ClassName))|alic)|d3|p|fFrameLoaded|gnore(?:Case|White))|o(?:s|n(?:R(?:ollO(?:ut|ver)|e(?:s(?:ize|ult)|l(?:ease(?:Outside)?|aseOutside)))|XML|Mouse(?:Move|Down|Up|Wheel)|S(?:ync|croller|tatus|oundComplete|e(?:tFocus|lect(?:edItem)?))|N(?:oticeEvent|etworkChange)|C(?:hanged|onnect|l(?:ipEvent|ose))|ID3|D(?:isconnect|eactivate|ata|ragO(?:ut|ver))|Un(?:install|load)|P(?:aymentResult|ress)|EnterFrame|K(?:illFocus|ey(?:Down|Up))|Fault|Lo(?:ad|g)|A(?:ctiv(?:ity|ate)|ppSt(?:op|art)))?|pe(?:n|ration)|verLayChildren|kLabel|ldValue|r(?:d)?)|d(?:i(?:s(?:connect|play(?:Normal|ed(?:Month|Year)|Full)|able(?:Shader|d(?:Ranges|Days)|CloseBox|Events))|rection)|o(?:cTypeDecl|tall|Decoding|main|LazyDecoding)|u(?:plicateMovieClip|ration)|e(?:stroy(?:ChildAt|Object)|code|fault(?:PushButton(?:Enabled)?|KeydownHandler)?|l(?:ta(?:Packet(?:Changed)?)?|ete(?:PopUp|All)?)|blocking)|a(?:shBoardSave|yNames|ta(?:Provider)?|rkshadow)|r(?:opdown(?:Width)?|a(?:w|gO(?:ut|ver))))|u(?:se(?:Sort|HandCursor|Codepage|EchoSuppression)|n(?:shift|install|derline|escape|format|watch|lo(?:ck|ad(?:Movie(?:Num)?)?))|pdate(?:Results|Mode|I(?:nputProperties|tem(?:ByIndex)?)|P(?:acket|roperties)|View|AfterEvent)|rl)|join|p(?:ixelAspectRatio|o(?:sition|p|w)|u(?:sh|rge|blish)|ercen(?:tComplete|Loaded)|lay(?:head(?:Change|Time)|ing|Hidden|erType)?|a(?:ssword|use|r(?:se(?:XML|CSS|Int|Float)|ent(?:Node|Is(?:S(?:creen|lide)|Form))|ams))|r(?:int(?:Num|AsBitmap(?:Num)?)?|o(?:to(?:type)?|pert(?:y|ies)|gress)|e(?:ss|v(?:ious(?:S(?:ibling|lide)|Value)?|Scene|Frame)|ferred(?:Height|Width))))|e(?:scape|n(?:code(?:r)?|ter(?:Frame)?|dFill|able(?:Shader|d|CloseBox|Events))|dit(?:able|Field|LocationDialog)|v(?:ent|al(?:uate)?)|q|x(?:tended|p|ec(?:ute)?|actSettings)|m(?:phasized(?:StyleDeclaration)?|bedFonts))|v(?:i(?:sible|ewPod)|ScrollPolicy|o(?:id|lume)|ersion|P(?:osition|ageScrollSize)|a(?:l(?:idat(?:ionError|e(?:Property|ActivationKey)?)|ue(?:Of)?)|riable)|LineScrollSize)|k(?:ind|ey(?:Down|Up|Press|FrameInterval))|q(?:sort|uality)|f(?:scommand|i(?:n(?:d(?:Text|First|Last)?|ally)|eldInfo|lter(?:ed|Func)?|rst(?:Slide|Child|DayOfWeek|VisibleNode)?)|o(?:nt|cus(?:In|edCell|Out|Enabled)|r(?:egroundDisabled|mat(?:ter)?))|unctionName|ps|l(?:oor|ush)|ace|romCharCode)|w(?:i(?:th|dth)|ordWrap|atch|riteAccess)|l(?:t|i(?:st(?:Owner)?|ne(?:Style|To))|o(?:c(?:k|a(?:t(?:ion|eByld)|l(?:ToGlobal|FileReadDisable)))|opback|ad(?:Movie(?:Num)?|S(?:crollContent|ound)|ed|Variables(?:Num)?|Application)?|g(?:Changes)?)|e(?:ngth|ft(?:Margin)?|ading)?|a(?:st(?:Slide|Child|Index(?:Of)?)?|nguage|b(?:el(?:Placement|F(?:ield|unction))?|leField)))|a(?:s(?:scociate(?:Controller|Display)|in|pectRatio|function)|nd|c(?:ceptConnection|tiv(?:ityLevel|ePlayControl)|os)|t(?:t(?:ach(?:Movie|Sound|Video|Audio)|ributes)|an(?:2)?)|dd(?:header|RequestHeader|Menu(?:Item(?:At)?|At)?|Sort|Header|No(?:tice|de(?:At)?)|C(?:olumn(?:At)?|uePoint)|T(?:oLocalInternetCache|reeNode(?:At)?)|I(?:con|tem(?:s(?:At)?|At)?)|DeltaItem|P(?:od|age|roperty)|EventListener|View|FieldInfo|Listener|Animation)?|uto(?:Size|Play|KeyNav|Load)|pp(?:endChild|ly(?:Changes|Updates)?)|vHardwareDisable|fterLoaded|l(?:ternateRowColors|ign|l(?:ow(?:InsecureDomain|Domain)|Transitions(?:InDone|OutDone))|bum)|r(?:tist|row|g(?:uments|List))|gent|bs)|r(?:ight(?:Margin)?|o(?:ot(?:S(?:creen|lide)|Form)|und|w(?:Height|Count)|llO(?:ut|ver))|e(?:s(?:yncDepth|t(?:orePane|artAnimation|rict)|iz(?:e|able(?:Columns)?)|olveDelta|ult(?:s)?|ponse)|c(?:o(?:ncile(?:Results|Updates)|rd)|eive(?:Video|Audio))|draw|jectConnection|place(?:Sel|ItemAt|AllItems)?|ve(?:al(?:Child)?|rse)|quest(?:SizeChange|Payment)?|f(?:errer|resh(?:ScrollContent|Destinations|Pane|FromSources)?)|lease(?:Outside)?|ad(?:Only|Access)|gister(?:SkinElement|C(?:olor(?:Style|Name)|lass)|InheritingStyle|Proxy)|move(?:Range|M(?:ovieClip|enu(?:Item(?:At)?|At))|Background|Sort|No(?:tice|de(?:sAt|At)?)|C(?:olum(?:nAt|At)|uePoints)|T(?:extField|reeNode(?:At)?)|Item(?:At)?|Pod|EventListener|FromLocalInternetCache|Listener|All(?:C(?:olumns|uePoints)|Items)?))|a(?:ndom|te|dioDot))|g(?:t|oto(?:Slide|NextSlide|PreviousSlide|FirstSlide|LastSlide|And(?:Stop|Play))|e(?:nre|t(?:R(?:GB|o(?:otNode|wCount)|e(?:sizable|mote))|X(?:AxisTitle)?|M(?:i(?:n(?:imum(?:Size)?|utes)|lliseconds)|onth(?:Names)?|ultilineMode|e(?:ssage|nu(?:ItemAt|EnabledAt|At))|aximum(?:Size)?)|B(?:ytes(?:Total|Loaded)|ounds|utton(?:s|Width)|eginIndex|a(?:ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Position|barState|Location)|t(?:yle(?:Names)?|opOnFocus|ate)|ize|o(?:urce|rtState)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)|Style|ed(?:Node(?:s)?|Cell|Text|I(?:nd(?:ices|ex)|tem(?:s)?))?)|rvice)|moothness|WFVersion)|H(?:ighlight(?:s|Color)|ours|e(?:ight|ader(?:Height|Text|Property|Format|Width|Location)?)|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:o(?:tices|de(?:DisplayedAt|At))|um(?:Children|berAvailable)|e(?:wTextFormat|xtHighestDepth))|C(?:h(?:ild(?:S(?:creen|lide)|Nodes|Form|At)|artTitle)|o(?:n(?:tent|figInfo)|okie|de|unt|lumn(?:Names|Count|Index|At))|uePoint|ellIndex|loseHandler|a(?:ll|retIndex))|T(?:ypedValue|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:stamp|zoneOffset|out(?:State|Handler)|r)?)|oggle|ext(?:Extent|Format)?|r(?:ee(?:NodeAt|Length)|ans(?:form|actionId)))|I(?:s(?:Branch|Open)|n(?:stanceAtDepth|d(?:icesByKey|exByKey))|con(?:SymbolName)?|te(?:rator|m(?:sByKey|By(?:Name|Key)|id|ID|At))|d)|O(?:utput(?:Parameter(?:s|ByName)?|Value(?:s)?)|peration|ri(?:entation|ginalCellData))|D(?:i(?:s(?:play(?:Range|Mode|Clip|Index|edMonth)|kUsage)|rection)|uration|e(?:pth|faultNodeIconSymbolName|l(?:taPacket|ay)|bug(?:Config|ID)?)|a(?:y(?:OfWeekNames)?|t(?:e|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Label|All(?:Height|Property|Format|Width))?))|rawConnectors)|U(?:se(?:Shadow|HandCursor|rInput|Fade)|RL|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear))|P(?:o(?:sition|ds)|ercentComplete|a(?:n(?:e(?:M(?:inimums|aximums)|Height|Title|Width))?|rentNode)|r(?:operty(?:Name|Data)?|efer(?:ences|red(?:Height|Width))))|E(?:n(?:dIndex|abled)|ditingData|x(?:panderSymbolName|andNodeTrigger))|V(?:iewed(?:Pods|Applications)|olume|ersion|alue(?:Source)?)|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|o(?:ntList|cus)|ullYear|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:cal|adTarget)|ength|a(?:stTabIndex|bel(?:Source)?))|A(?:s(?:cii|Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:eState(?:Handler)?|ateHandler)|utoH(?:ideScrollBar|eight)|llItems|gent))?)?|lobal(?:StyleFormat|ToLocal)?|ain|roupName)|x(?:updatePackety|mlDecl)?|m(?:y(?:MethodName|Call)|in(?:imum)?|o(?:nthNames|tion(?:TimeOut|Level)|de(?:lChanged)?|use(?:Move|O(?:ut|ver)|Down(?:Somewhere|Outside)?|Up(?:Somewhere)?|WheelEnabled)|ve(?:To)?)|u(?:ted|lti(?:pleS(?:imultaneousAllowed|elections)|line))|e(?:ssage|nu(?:Show|Hide)?|th(?:od)?|diaType)|a(?:nufacturer|tch|x(?:scroll|hscroll|imum|HPosition|Chars|VPosition)?)|b(?:substring|chr|ord|length))|b(?:ytes(?:Total|Loaded)|indFormat(?:Strings|Function)|o(?:ttom(?:Scroll)?|ld|rder(?:Color)?)|u(?:tton(?:Height|Width)|iltInItems|ffer(?:Time|Length)|llet)|e(?:foreApplyUpdates|gin(?:GradientFill|Fill))|lockIndent|a(?:ndwidth|ckground(?:Style|Color|Disabled)?)|roadcastMessage)|onHTTPStatus)\\b' }, - { token: 'support.constant.actionscript.2', - regex: '\\b(?:__proto__|__resolve|_accProps|_alpha|_changed|_currentframe|_droptarget|_flash|_focusrect|_framesloaded|_global|_height|_highquality|_level|_listeners|_lockroot|_name|_parent|_quality|_root|_rotation|_soundbuftime|_target|_totalframes|_url|_visible|_width|_x|_xmouse|_xscale|_y|_ymouse|_yscale)\\b' }, - { token: 'keyword.control.actionscript.2', - regex: '\\b(?:dynamic|extends|import|implements|interface|public|private|new|static|super|var|for|in|break|continue|while|do|return|if|else|case|switch)\\b' }, - { token: 'storage.type.actionscript.2', - regex: '\\b(?:Boolean|Number|String|Void)\\b' }, - { token: 'constant.language.actionscript.2', - regex: '\\b(?:null|undefined|true|false)\\b' }, - { token: 'constant.numeric.actionscript.2', - regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' }, - { token: 'punctuation.definition.string.begin.actionscript.2', - regex: '"', - push: - [ { token: 'punctuation.definition.string.end.actionscript.2', - regex: '"', - next: 'pop' }, - { token: 'constant.character.escape.actionscript.2', - regex: '\\\\.' }, - { defaultToken: 'string.quoted.double.actionscript.2' } ] }, - { token: 'punctuation.definition.string.begin.actionscript.2', - regex: '\'', - push: - [ { token: 'punctuation.definition.string.end.actionscript.2', - regex: '\'', - next: 'pop' }, - { token: 'constant.character.escape.actionscript.2', - regex: '\\\\.' }, - { defaultToken: 'string.quoted.single.actionscript.2' } ] }, - { token: 'support.constant.actionscript.2', - regex: '\\b(?:BACKSPACE|CAPSLOCK|CONTROL|DELETEKEY|DOWN|END|ENTER|HOME|INSERT|LEFT|LN10|LN2|LOG10E|LOG2E|MAX_VALUE|MIN_VALUE|NEGATIVE_INFINITY|NaN|PGDN|PGUP|PI|POSITIVE_INFINITY|RIGHT|SPACE|SQRT1_2|SQRT2|UP)\\b' }, - { token: 'punctuation.definition.comment.actionscript.2', - regex: '/\\*', - push: - [ { token: 'punctuation.definition.comment.actionscript.2', - regex: '\\*/', - next: 'pop' }, - { defaultToken: 'comment.block.actionscript.2' } ] }, - { token: 'punctuation.definition.comment.actionscript.2', - regex: '//.*$', - push_: - [ { token: 'comment.line.double-slash.actionscript.2', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-slash.actionscript.2' } ] }, - { token: 'keyword.operator.actionscript.2', - regex: '\\binstanceof\\b' }, - { token: 'keyword.operator.symbolic.actionscript.2', - regex: '[-!%&*+=/?:]' }, - { token: - [ 'meta.preprocessor.actionscript.2', - 'punctuation.definition.preprocessor.actionscript.2', - 'meta.preprocessor.actionscript.2' ], - regex: '^([ \\t]*)(#)([a-zA-Z]+)' }, - { token: - [ 'storage.type.function.actionscript.2', - 'meta.function.actionscript.2', - 'entity.name.function.actionscript.2', - 'meta.function.actionscript.2', - 'punctuation.definition.parameters.begin.actionscript.2' ], - regex: '\\b(function)(\\s+)([a-zA-Z_]\\w*)(\\s*)(\\()', - push: - [ { token: 'punctuation.definition.parameters.end.actionscript.2', - regex: '\\)', - next: 'pop' }, - { token: 'variable.parameter.function.actionscript.2', - regex: '[^,)$]+' }, - { defaultToken: 'meta.function.actionscript.2' } ] }, - { token: - [ 'storage.type.class.actionscript.2', - 'meta.class.actionscript.2', - 'entity.name.type.class.actionscript.2', - 'meta.class.actionscript.2', - 'storage.modifier.extends.actionscript.2', - 'meta.class.actionscript.2', - 'entity.other.inherited-class.actionscript.2' ], - regex: '\\b(class)(\\s+)([a-zA-Z_](?:\\w|\\.)*)(?:(\\s+)(extends)(\\s+)([a-zA-Z_](?:\\w|\\.)*))?' } ] } - - this.normalizeRules(); -}; - -ActionScriptHighlightRules.metaData = { fileTypes: [ 'as' ], - keyEquivalent: '^~A', - name: 'ActionScript', - scopeName: 'source.actionscript.2' } - - -oop.inherits(ActionScriptHighlightRules, TextHighlightRules); - -exports.ActionScriptHighlightRules = ActionScriptHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-ada.js b/util/build-sample-browser/player/vendor/ace/mode-ada.js deleted file mode 100644 index 7b50f0b937..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-ada.js +++ /dev/null @@ -1,118 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/ada', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ada_highlight_rules', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = AdaHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - - this.$id = "ace/mode/ada"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/ada_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AdaHighlightRules = function() { -var keywords = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|" + -"access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|" + -"array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|" + -"body|private|then|if|procedure|type|case|in|protected|constant|interface|until|" + -"|is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor"; - - var builtinConstants = ( - "true|false|null" - ); - - var builtinFunctions = ( - "count|min|max|avg|sum|rank|now|coalesce|main" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "keyword": keywords, - "constant.language": builtinConstants - }, "identifier", true); - - this.$rules = { - "start" : [ { - token : "comment", - regex : "--.*$" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "string", // ' string - regex : "'.*?'" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } ] - }; -}; - -oop.inherits(AdaHighlightRules, TextHighlightRules); - -exports.AdaHighlightRules = AdaHighlightRules; -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/mode-apache_conf.js b/util/build-sample-browser/player/vendor/ace/mode-apache_conf.js deleted file mode 100644 index 204819ee22..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-apache_conf.js +++ /dev/null @@ -1,346 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/apache_conf', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/apache_conf_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ApacheConfHighlightRules = require("./apache_conf_highlight_rules").ApacheConfHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ApacheConfHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "#"; - this.$id = "ace/mode/apache_conf"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/apache_conf_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ApacheConfHighlightRules = function() { - - this.$rules = { start: - [ { token: - [ 'punctuation.definition.comment.apacheconf', - 'comment.line.hash.ini', - 'comment.line.hash.ini' ], - regex: '^((?:\\s)*)(#)(.*$)' }, - { token: - [ 'punctuation.definition.tag.apacheconf', - 'entity.tag.apacheconf', - 'text', - 'string.value.apacheconf', - 'punctuation.definition.tag.apacheconf' ], - regex: '(<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(?:(\\s)(.+?))?(>)' }, - { token: - [ 'punctuation.definition.tag.apacheconf', - 'entity.tag.apacheconf', - 'punctuation.definition.tag.apacheconf' ], - regex: '()' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'string.regexp.apacheconf', 'text', - 'string.replacement.apacheconf', 'text' ], - regex: '(Rewrite(?:Rule|Cond))(\\s+)(.+?)(\\s+)(.+?)($|\\s)' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'entity.status.apacheconf', 'text', - 'string.regexp.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(RedirectMatch)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'entity.status.apacheconf', 'text', - 'string.path.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(Redirect)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'string.regexp.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(ScriptAliasMatch|AliasMatch)(\\s+)(.+?)(\\s+)(?:(.+?)(\\s))?' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'string.path.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(RedirectPermanent|RedirectTemp|ScriptAlias|Alias)(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, - { token: 'keyword.core.apacheconf', - regex: '\\b(?:AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|TimeOut|TraceEnable|UseCanonicalName)\\b' }, - { token: 'keyword.mpm.apacheconf', - regex: '\\b(?:AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\\b' }, - { token: 'keyword.access.apacheconf', - regex: '\\b(?:Allow|Deny|Order)\\b' }, - { token: 'keyword.actions.apacheconf', - regex: '\\b(?:Action|Script)\\b' }, - { token: 'keyword.alias.apacheconf', - regex: '\\b(?:Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\\b' }, - { token: 'keyword.auth.apacheconf', - regex: '\\b(?:AuthAuthoritative|AuthGroupFile|AuthUserFile)\\b' }, - { token: 'keyword.auth_anon.apacheconf', - regex: '\\b(?:Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\\b' }, - { token: 'keyword.auth_dbm.apacheconf', - regex: '\\b(?:AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\\b' }, - { token: 'keyword.auth_digest.apacheconf', - regex: '\\b(?:AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)\\b' }, - { token: 'keyword.auth_ldap.apacheconf', - regex: '\\b(?:AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\\b' }, - { token: 'keyword.autoindex.apacheconf', - regex: '\\b(?:AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|ReadmeName)\\b' }, - { token: 'keyword.cache.apacheconf', - regex: '\\b(?:CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\\b' }, - { token: 'keyword.cern_meta.apacheconf', - regex: '\\b(?:MetaDir|MetaFiles|MetaSuffix)\\b' }, - { token: 'keyword.cgi.apacheconf', - regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength)\\b' }, - { token: 'keyword.cgid.apacheconf', - regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\\b' }, - { token: 'keyword.charset_lite.apacheconf', - regex: '\\b(?:CharsetDefault|CharsetOptions|CharsetSourceEnc)\\b' }, - { token: 'keyword.dav.apacheconf', - regex: '\\b(?:Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\\b' }, - { token: 'keyword.deflate.apacheconf', - regex: '\\b(?:DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\\b' }, - { token: 'keyword.dir.apacheconf', - regex: '\\b(?:DirectoryIndex|DirectorySlash)\\b' }, - { token: 'keyword.disk_cache.apacheconf', - regex: '\\b(?:CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\\b' }, - { token: 'keyword.dumpio.apacheconf', - regex: '\\b(?:DumpIOInput|DumpIOOutput)\\b' }, - { token: 'keyword.env.apacheconf', - regex: '\\b(?:PassEnv|SetEnv|UnsetEnv)\\b' }, - { token: 'keyword.expires.apacheconf', - regex: '\\b(?:ExpiresActive|ExpiresByType|ExpiresDefault)\\b' }, - { token: 'keyword.ext_filter.apacheconf', - regex: '\\b(?:ExtFilterDefine|ExtFilterOptions)\\b' }, - { token: 'keyword.file_cache.apacheconf', - regex: '\\b(?:CacheFile|MMapFile)\\b' }, - { token: 'keyword.headers.apacheconf', - regex: '\\b(?:Header|RequestHeader)\\b' }, - { token: 'keyword.imap.apacheconf', - regex: '\\b(?:ImapBase|ImapDefault|ImapMenu)\\b' }, - { token: 'keyword.include.apacheconf', - regex: '\\b(?:SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\\b' }, - { token: 'keyword.isapi.apacheconf', - regex: '\\b(?:ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\\b' }, - { token: 'keyword.ldap.apacheconf', - regex: '\\b(?:LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\\b' }, - { token: 'keyword.log.apacheconf', - regex: '\\b(?:BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\\b' }, - { token: 'keyword.mem_cache.apacheconf', - regex: '\\b(?:MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\\b' }, - { token: 'keyword.mime.apacheconf', - regex: '\\b(?:AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\\b' }, - { token: 'keyword.misc.apacheconf', - regex: '\\b(?:ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\\b' }, - { token: 'keyword.negotiation.apacheconf', - regex: '\\b(?:CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\\b' }, - { token: 'keyword.nw_ssl.apacheconf', - regex: '\\b(?:NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\\b' }, - { token: 'keyword.proxy.apacheconf', - regex: '\\b(?:AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\\b' }, - { token: 'keyword.rewrite.apacheconf', - regex: '\\b(?:RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\\b' }, - { token: 'keyword.setenvif.apacheconf', - regex: '\\b(?:BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\\b' }, - { token: 'keyword.so.apacheconf', - regex: '\\b(?:LoadFile|LoadModule)\\b' }, - { token: 'keyword.ssl.apacheconf', - regex: '\\b(?:SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth)\\b' }, - { token: 'keyword.usertrack.apacheconf', - regex: '\\b(?:CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\\b' }, - { token: 'keyword.vhost_alias.apacheconf', - regex: '\\b(?:VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\\b' }, - { token: - [ 'keyword.php.apacheconf', - 'text', - 'entity.property.apacheconf', - 'text', - 'string.value.apacheconf', - 'text' ], - regex: '\\b(php_value|php_flag)\\b(?:(\\s+)(.+?)(?:(\\s+)(.+?))?)?(\\s)' }, - { token: - [ 'punctuation.variable.apacheconf', - 'variable.env.apacheconf', - 'variable.misc.apacheconf', - 'punctuation.variable.apacheconf' ], - regex: '(%\\{)(?:(HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\\})' }, - { token: [ 'entity.mime-type.apacheconf', 'text' ], - regex: '\\b((?:text|image|application|video|audio)/.+?)(\\s)' }, - { token: 'entity.helper.apacheconf', - regex: '\\b(?:from|unset|set|on|off)\\b', - caseInsensitive: true }, - { token: 'constant.integer.apacheconf', regex: '\\b\\d+\\b' }, - { token: - [ 'text', - 'punctuation.definition.flag.apacheconf', - 'string.flag.apacheconf', - 'punctuation.definition.flag.apacheconf', - 'text' ], - regex: '(\\s)(\\[)(.*?)(\\])(\\s)' } ] } - - this.normalizeRules(); -}; - -ApacheConfHighlightRules.metaData = { fileTypes: - [ 'conf', - 'CONF', - 'htaccess', - 'HTACCESS', - 'htgroups', - 'HTGROUPS', - 'htpasswd', - 'HTPASSWD', - '.htaccess', - '.HTACCESS', - '.htgroups', - '.HTGROUPS', - '.htpasswd', - '.HTPASSWD' ], - name: 'Apache Conf', - scopeName: 'source.apacheconf' } - - -oop.inherits(ApacheConfHighlightRules, TextHighlightRules); - -exports.ApacheConfHighlightRules = ApacheConfHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-asciidoc.js b/util/build-sample-browser/player/vendor/ace/mode-asciidoc.js deleted file mode 100644 index 7a2ce4eeac..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-asciidoc.js +++ /dev/null @@ -1,373 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/asciidoc', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/asciidoc_highlight_rules', 'ace/mode/folding/asciidoc'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighlightRules; -var AsciidocFoldMode = require("./folding/asciidoc").FoldMode; - -var Mode = function() { - this.HighlightRules = AsciidocHighlightRules; - - this.foldingRules = new AsciidocFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.type = "text"; - this.getNextLineIndent = function(state, line, tab) { - if (state == "listblock") { - var match = /^((?:.+)?)([-+*][ ]+)/.exec(line); - if (match) { - return new Array(match[1].length + 1).join(" ") + match[2]; - } else { - return ""; - } - } else { - return this.$getIndent(line); - } - }; - this.$id = "ace/mode/asciidoc"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/asciidoc_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AsciidocHighlightRules = function() { - var identifierRe = "[a-zA-Z\u00a1-\uffff]+\\b"; - - this.$rules = { - "start": [ - {token: "empty", regex: /$/}, - {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, - {token: "literal", regex: /^-{4,}\s*$/, next: "literalBlock"}, - {token: "string", regex: /^\+{4,}\s*$/, next: "passthroughBlock"}, - {token: "keyword", regex: /^={4,}\s*$/}, - {token: "text", regex: /^\s*$/}, - {token: "empty", regex: "", next: "dissallowDelimitedBlock"} - ], - - "dissallowDelimitedBlock": [ - {include: "paragraphEnd"}, - {token: "comment", regex: '^//.+$'}, - {token: "keyword", regex: "^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):"}, - - {include: "listStart"}, - {token: "literal", regex: /^\s+.+$/, next: "indentedBlock"}, - {token: "empty", regex: "", next: "text"} - ], - - "paragraphEnd": [ - {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "commentBlock"}, - {token: "tableBlock", regex: /^\s*[|!]=+\s*$/, next: "tableBlock"}, - {token: "keyword", regex: /^(?:--|''')\s*$/, next: "start"}, - {token: "option", regex: /^\[.*\]\s*$/, next: "start"}, - {token: "pageBreak", regex: /^>{3,}$/, next: "start"}, - {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, - {token: "titleUnderline", regex: /^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/, next: "start"}, - {token: "singleLineTitle", regex: /^={1,5}\s+\S.*$/, next: "start"}, - - {token: "otherBlock", regex: /^(?:\*{2,}|_{2,})\s*$/, next: "start"}, - {token: "optionalTitle", regex: /^\.[^.\s].+$/, next: "start"} - ], - - "listStart": [ - {token: "keyword", regex: /^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/, next: "listText"}, - {token: "meta.tag", regex: /^.+(?::{2,4}|;;)(?: |$)/, next: "listText"}, - {token: "support.function.list.callout", regex: /^(?:<\d+>|\d+>|>) /, next: "text"}, - {token: "keyword", regex: /^\+\s*$/, next: "start"} - ], - - "text": [ - {token: ["link", "variable.language"], regex: /((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/}, - {token: "link", regex: /(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/}, - {token: "link", regex: /\b[\w\.\/\-]+@[\w\.\/\-]+\b/}, - {include: "macros"}, - {include: "paragraphEnd"}, - {token: "literal", regex:/\+{3,}/, next:"smallPassthrough"}, - {token: "escape", regex: /\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/}, - {token: "escape", regex: /\\[_*'`+#]|\\{2}[_*'`+#]{2}/}, - {token: "keyword", regex: /\s\+$/}, - {token: "text", regex: identifierRe}, - {token: ["keyword", "string", "keyword"], - regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/}, - {token: "keyword", regex: /<<[\w\d\-$]+,?|>>/}, - {token: "constant.character", regex: /\({2,3}.*?\){2,3}/}, - {token: "keyword", regex: /\[\[.+?\]\]/}, - {token: "support", regex: /^\[{3}[\w\d =\-]+\]{3}/}, - - {include: "quotes"}, - {token: "empty", regex: /^\s*$/, next: "start"} - ], - - "listText": [ - {include: "listStart"}, - {include: "text"} - ], - - "indentedBlock": [ - {token: "literal", regex: /^[\s\w].+$/, next: "indentedBlock"}, - {token: "literal", regex: "", next: "start"} - ], - - "listingBlock": [ - {token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "constant.numeric", regex: '<\\d+>'}, - {token: "literal", regex: '[^<]+'}, - {token: "literal", regex: '<'} - ], - "literalBlock": [ - {token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "constant.numeric", regex: '<\\d+>'}, - {token: "literal", regex: '[^<]+'}, - {token: "literal", regex: '<'} - ], - "passthroughBlock": [ - {token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: identifierRe + "|\\d+"}, - {include: "macros"}, - {token: "literal", regex: "."} - ], - - "smallPassthrough": [ - {token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: identifierRe + "|\\d+"}, - {include: "macros"} - ], - - "commentBlock": [ - {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "doc.comment", regex: '^.*$'} - ], - "tableBlock": [ - {token: "tableBlock", regex: /^\s*\|={3,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "innerTableBlock"}, - {token: "tableBlock", regex: /\|/}, - {include: "text", noEscape: true} - ], - "innerTableBlock": [ - {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "tableBlock"}, - {token: "tableBlock", regex: /^\s*|={3,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "tableBlock", regex: /\!/} - ], - "macros": [ - {token: "macro", regex: /{[\w\-$]+}/}, - {token: ["text", "string", "text", "constant.character", "text"], regex: /({)([\w\-$]+)(:)?(.+)?(})/}, - {token: ["text", "markup.list.macro", "keyword", "string"], regex: /(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/}, - {token: ["markup.list.macro", "keyword", "string"], regex: /([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/}, - {token: ["markup.list.macro", "keyword"], regex: /([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/}, - {token: "keyword", regex: /^:.+?:(?= |$)/} - ], - - "quotes": [ - {token: "string.italic", regex: /__[^_\s].*?__/}, - {token: "string.italic", regex: quoteRule("_")}, - - {token: "keyword.bold", regex: /\*\*[^*\s].*?\*\*/}, - {token: "keyword.bold", regex: quoteRule("\\*")}, - - {token: "literal", regex: quoteRule("\\+")}, - {token: "literal", regex: /\+\+[^+\s].*?\+\+/}, - {token: "literal", regex: /\$\$.+?\$\$/}, - {token: "literal", regex: quoteRule("`")}, - - {token: "keyword", regex: quoteRule("^")}, - {token: "keyword", regex: quoteRule("~")}, - {token: "keyword", regex: /##?/}, - {token: "keyword", regex: /(?:\B|^)``|\b''/} - ] - - }; - - function quoteRule(ch) { - var prefix = /\w/.test(ch) ? "\\b" : "(?:\\B|^)"; - return prefix + ch + "[^" + ch + "].*?" + ch + "(?![\\w*])"; - } - - var tokenMap = { - macro: "constant.character", - tableBlock: "doc.comment", - titleUnderline: "markup.heading", - singleLineTitle: "markup.heading", - pageBreak: "string", - option: "string.regexp", - otherBlock: "markup.list", - literal: "support.function", - optionalTitle: "constant.numeric", - escape: "constant.language.escape", - link: "markup.underline.list" - }; - - for (var state in this.$rules) { - var stateRules = this.$rules[state]; - for (var i = stateRules.length; i--; ) { - var rule = stateRules[i]; - if (rule.include || typeof rule == "string") { - var args = [i, 1].concat(this.$rules[rule.include || rule]); - if (rule.noEscape) { - args = args.filter(function(x) { - return !x.next; - }); - } - stateRules.splice.apply(stateRules, args); - } else if (rule.token in tokenMap) { - rule.token = tokenMap[rule.token]; - } - } - } -}; -oop.inherits(AsciidocHighlightRules, TextHighlightRules); - -exports.AsciidocHighlightRules = AsciidocHighlightRules; -}); - -ace.define('ace/mode/folding/asciidoc', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - this.foldingStartMarker = /^(?:\|={10,}|[\.\/=\-~^+]{4,}\s*$|={1,5} )/; - this.singleLineHeadingRe = /^={1,5}(?=\s+\S)/; - - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - if (!this.foldingStartMarker.test(line)) - return "" - - if (line[0] == "=") { - if (this.singleLineHeadingRe.test(line)) - return "start"; - if (session.getLine(row - 1).length != session.getLine(row).length) - return ""; - return "start"; - } - if (session.bgTokenizer.getState(row) == "dissallowDelimitedBlock") - return "end"; - return "start"; - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var line = session.getLine(row); - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - if (!line.match(this.foldingStartMarker)) - return; - - var token; - function getTokenType(row) { - token = session.getTokens(row)[0]; - return token && token.type; - } - - var levels = ["=","-","~","^","+"]; - var heading = "markup.heading"; - var singleLineHeadingRe = this.singleLineHeadingRe; - function getLevel() { - var match = token.value.match(singleLineHeadingRe); - if (match) - return match[0].length; - var level = levels.indexOf(token.value[0]) + 1; - if (level == 1) { - if (session.getLine(row - 1).length != session.getLine(row).length) - return Infinity; - } - return level; - } - - if (getTokenType(row) == heading) { - var startHeadingLevel = getLevel(); - while (++row < maxRow) { - if (getTokenType(row) != heading) - continue; - var level = getLevel(); - if (level <= startHeadingLevel) - break; - } - - var isSingleLineHeading = token && token.value.match(this.singleLineHeadingRe); - endRow = isSingleLineHeading ? row - 1 : row - 2; - - if (endRow > startRow) { - while (endRow > startRow && (!getTokenType(endRow) || token.value[0] == "[")) - endRow--; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - } else { - var state = session.bgTokenizer.getState(row); - if (state == "dissallowDelimitedBlock") { - while (row -- > 0) { - if (session.bgTokenizer.getState(row).lastIndexOf("Block") == -1) - break; - } - endRow = row + 1; - if (endRow < startRow) { - var endColumn = session.getLine(row).length; - return new Range(endRow, 5, startRow, startColumn - 5); - } - } else { - while (++row < maxRow) { - if (session.bgTokenizer.getState(row) == "dissallowDelimitedBlock") - break; - } - endRow = row; - if (endRow > startRow) { - var endColumn = session.getLine(row).length; - return new Range(startRow, 5, endRow, endColumn - 5); - } - } - } - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-assembly_x86.js b/util/build-sample-browser/player/vendor/ace/mode-assembly_x86.js deleted file mode 100644 index de54c13ab2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-assembly_x86.js +++ /dev/null @@ -1,217 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/assembly_x86', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/assembly_x86_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var AssemblyX86HighlightRules = require("./assembly_x86_highlight_rules").AssemblyX86HighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = AssemblyX86HighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ";"; - this.$id = "ace/mode/assembly_x86"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/assembly_x86_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AssemblyX86HighlightRules = function() { - - this.$rules = { start: - [ { token: 'keyword.control.assembly', - regex: '\\b(?:aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invplg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswbpaddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vtestps|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(?:n?e|n?z)?|call|j(?:mp|n?e|ge?|ae?|le?|be?|n?o|n?z))\\b', - caseInsensitive: true }, - { token: 'variable.parameter.register.assembly', - regex: '\\b(?:CS|DS|ES|FS|GS|SS|RAX|EAX|RBX|EBX|RCX|ECX|RDX|EDX|RCX|RIP|EIP|IP|RSP|ESP|SP|RSI|ESI|SI|RDI|EDI|DI|RFLAGS|EFLAGS|FLAGS|R8-15|(?:Y|X)MM(?:[0-9]|10|11|12|13|14|15)|(?:A|B|C|D)(?:X|H|L)|CR(?:[0-4]|DR(?:[0-7]|TR6|TR7|EFER)))\\b', - caseInsensitive: true }, - { token: 'constant.character.decimal.assembly', - regex: '\\b[0-9]+\\b' }, - { token: 'constant.character.hexadecimal.assembly', - regex: '\\b0x[A-F0-9]+\\b', - caseInsensitive: true }, - { token: 'constant.character.hexadecimal.assembly', - regex: '\\b[A-F0-9]+h\\b', - caseInsensitive: true }, - { token: 'string.assembly', regex: /'([^\\']|\\.)*'/ }, - { token: 'string.assembly', regex: /"([^\\"]|\\.)*"/ }, - { token: 'support.function.directive.assembly', - regex: '^\\[', - push: - [ { token: 'support.function.directive.assembly', - regex: '\\]$', - next: 'pop' }, - { defaultToken: 'support.function.directive.assembly' } ] }, - { token: - [ 'support.function.directive.assembly', - 'support.function.directive.assembly', - 'entity.name.function.assembly' ], - regex: '(^struc)( )([_a-zA-Z][_a-zA-Z0-9]*)' }, - { token: 'support.function.directive.assembly', - regex: '^endstruc\\b' }, - { token: - [ 'support.function.directive.assembly', - 'entity.name.function.assembly', - 'support.function.directive.assembly', - 'constant.character.assembly' ], - regex: '^(%macro )([_a-zA-Z][_a-zA-Z0-9]*)( )([0-9]+)' }, - { token: 'support.function.directive.assembly', - regex: '^%endmacro' }, - { token: - [ 'text', - 'support.function.directive.assembly', - 'text', - 'entity.name.function.assembly' ], - regex: '(\\s*)(%define|%xdefine|%idefine|%undef|%assign|%defstr|%strcat|%strlen|%substr|%00|%0|%rotate|%rep|%endrep|%include|\\$\\$|\\$|%unmacro|%if|%elif|%else|%endif|%(?:el)?ifdef|%(?:el)?ifmacro|%(?:el)?ifctx|%(?:el)?ifidn|%(?:el)?ifidni|%(?:el)?ifid|%(?:el)?ifnum|%(?:el)?ifstr|%(?:el)?iftoken|%(?:el)?ifempty|%(?:el)?ifenv|%pathsearch|%depend|%use|%push|%pop|%repl|%arg|%stacksize|%local|%error|%warning|%fatal|%line|%!|%comment|%endcomment|__NASM_VERSION_ID__|__NASM_VER__|__FILE__|__LINE__|__BITS__|__OUTPUT_FORMAT__|__DATE__|__TIME__|__DATE_NUM__|_TIME__NUM__|__UTC_DATE__|__UTC_TIME__|__UTC_DATE_NUM__|__UTC_TIME_NUM__|__POSIX_TIME__|__PASS__|ISTRUC|AT|IEND|BITS 16|BITS 32|BITS 64|USE16|USE32|__SECT__|ABSOLUTE|EXTERN|GLOBAL|COMMON|CPU|FLOAT)\\b( ?)((?:[_a-zA-Z][_a-zA-Z0-9]*)?)', - caseInsensitive: true }, - { token: 'support.function.directive.assembly', - regex: '\\b(?:d[bwdqtoy]|res[bwdqto]|equ|times|align|alignb|sectalign|section|ptr|byte|word|dword|qword|incbin)\\b', - caseInsensitive: true }, - { token: 'entity.name.function.assembly', regex: '^\\s*%%[\\w.]+?:$' }, - { token: 'entity.name.function.assembly', regex: '^\\s*%\\$[\\w.]+?:$' }, - { token: 'entity.name.function.assembly', regex: '^[\\w.]+?:' }, - { token: 'entity.name.function.assembly', regex: '^[\\w.]+?\\b' }, - { token: 'comment.assembly', regex: ';.*$' } ] - } - - this.normalizeRules(); -}; - -AssemblyX86HighlightRules.metaData = { fileTypes: [ 'asm' ], - name: 'Assembly x86', - scopeName: 'source.assembly' } - - -oop.inherits(AssemblyX86HighlightRules, TextHighlightRules); - -exports.AssemblyX86HighlightRules = AssemblyX86HighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-autohotkey.js b/util/build-sample-browser/player/vendor/ace/mode-autohotkey.js deleted file mode 100644 index 56334b2180..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-autohotkey.js +++ /dev/null @@ -1,225 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/autohotkey', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/autohotkey_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var AutoHotKeyHighlightRules = require("./autohotkey_highlight_rules").AutoHotKeyHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = AutoHotKeyHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "/\\*"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/autohotkey"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/autohotkey_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AutoHotKeyHighlightRules = function() { - var autoItKeywords = 'And|ByRef|Case|Const|ContinueCase|ContinueLoop|Default|Dim|Do|Else|ElseIf|EndFunc|EndIf|EndSelect|EndSwitch|EndWith|Enum|Exit|ExitLoop|False|For|Func|Global|If|In|Local|Next|Not|Or|ReDim|Return|Select|Step|Switch|Then|To|True|Until|WEnd|While|With|' + - 'Abs|ACos|AdlibDisable|AdlibEnable|Asc|AscW|ASin|Assign|ATan|AutoItSetOption|AutoItWinGetTitle|AutoItWinSetTitle|Beep|Binary|BinaryLen|BinaryMid|BinaryToString|BitAND|BitNOT|BitOR|BitRotate|BitShift|BitXOR|BlockInput|Break|Call|CDTray|Ceiling|Chr|ChrW|ClipGet|ClipPut|ConsoleRead|ConsoleWrite|ConsoleWriteError|ControlClick|ControlCommand|ControlDisable|ControlEnable|ControlFocus|ControlGetFocus|ControlGetHandle|ControlGetPos|ControlGetText|ControlHide|ControlListView|ControlMove|ControlSend|ControlSetText|ControlShow|ControlTreeView|Cos|Dec|DirCopy|DirCreate|DirGetSize|DirMove|DirRemove|DllCall|DllCallbackFree|DllCallbackGetPtr|DllCallbackRegister|DllClose|DllOpen|DllStructCreate|DllStructGetData|DllStructGetPtr|DllStructGetSize|DllStructSetData|DriveGetDrive|DriveGetFileSystem|DriveGetLabel|DriveGetSerial|DriveGetType|DriveMapAdd|DriveMapDel|DriveMapGet|DriveSetLabel|DriveSpaceFree|DriveSpaceTotal|DriveStatus|EnvGet|EnvSet|EnvUpdate|Eval|Execute|Exp|FileChangeDir|FileClose|FileCopy|FileCreateNTFSLink|FileCreateShortcut|FileDelete|FileExists|FileFindFirstFile|FileFindNextFile|FileGetAttrib|FileGetLongName|FileGetShortcut|FileGetShortName|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileOpen|FileOpenDialog|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileSaveDialog|FileSelectFolder|FileSetAttrib|FileSetTime|FileWrite|FileWriteLine|Floor|FtpSetProxy|GUICreate|GUICtrlCreateAvi|GUICtrlCreateButton|GUICtrlCreateCheckbox|GUICtrlCreateCombo|GUICtrlCreateContextMenu|GUICtrlCreateDate|GUICtrlCreateDummy|GUICtrlCreateEdit|GUICtrlCreateGraphic|GUICtrlCreateGroup|GUICtrlCreateIcon|GUICtrlCreateInput|GUICtrlCreateLabel|GUICtrlCreateList|GUICtrlCreateListView|GUICtrlCreateListViewItem|GUICtrlCreateMenu|GUICtrlCreateMenuItem|GUICtrlCreateMonthCal|GUICtrlCreateObj|GUICtrlCreatePic|GUICtrlCreateProgress|GUICtrlCreateRadio|GUICtrlCreateSlider|GUICtrlCreateTab|GUICtrlCreateTabItem|GUICtrlCreateTreeView|GUICtrlCreateTreeViewItem|GUICtrlCreateUpdown|GUICtrlDelete|GUICtrlGetHandle|GUICtrlGetState|GUICtrlRead|GUICtrlRecvMsg|GUICtrlRegisterListViewSort|GUICtrlSendMsg|GUICtrlSendToDummy|GUICtrlSetBkColor|GUICtrlSetColor|GUICtrlSetCursor|GUICtrlSetData|GUICtrlSetFont|GUICtrlSetDefColor|GUICtrlSetDefBkColor|GUICtrlSetGraphic|GUICtrlSetImage|GUICtrlSetLimit|GUICtrlSetOnEvent|GUICtrlSetPos|GUICtrlSetResizing|GUICtrlSetState|GUICtrlSetStyle|GUICtrlSetTip|GUIDelete|GUIGetCursorInfo|GUIGetMsg|GUIGetStyle|GUIRegisterMsg|GUISetAccelerators()|GUISetBkColor|GUISetCoord|GUISetCursor|GUISetFont|GUISetHelp|GUISetIcon|GUISetOnEvent|GUISetState|GUISetStyle|GUIStartGroup|GUISwitch|Hex|HotKeySet|HttpSetProxy|HWnd|InetGet|InetGetSize|IniDelete|IniRead|IniReadSection|IniReadSectionNames|IniRenameSection|IniWrite|IniWriteSection|InputBox|Int|IsAdmin|IsArray|IsBinary|IsBool|IsDeclared|IsDllStruct|IsFloat|IsHWnd|IsInt|IsKeyword|IsNumber|IsObj|IsPtr|IsString|Log|MemGetStats|Mod|MouseClick|MouseClickDrag|MouseDown|MouseGetCursor|MouseGetPos|MouseMove|MouseUp|MouseWheel|MsgBox|Number|ObjCreate|ObjEvent|ObjGet|ObjName|Opt|Ping|PixelChecksum|PixelGetColor|PixelSearch|PluginClose|PluginOpen|ProcessClose|ProcessExists|ProcessGetStats|ProcessList|ProcessSetPriority|ProcessWait|ProcessWaitClose|ProgressOff|ProgressOn|ProgressSet|Ptr|Random|RegDelete|RegEnumKey|RegEnumVal|RegRead|RegWrite|Round|Run|RunAs|RunAsWait|RunWait|Send|SendKeepActive|SetError|SetExtended|ShellExecute|ShellExecuteWait|Shutdown|Sin|Sleep|SoundPlay|SoundSetWaveVolume|SplashImageOn|SplashOff|SplashTextOn|Sqrt|SRandom|StatusbarGetText|StderrRead|StdinWrite|StdioClose|StdoutRead|String|StringAddCR|StringCompare|StringFormat|StringInStr|StringIsAlNum|StringIsAlpha|StringIsASCII|StringIsDigit|StringIsFloat|StringIsInt|StringIsLower|StringIsSpace|StringIsUpper|StringIsXDigit|StringLeft|StringLen|StringLower|StringMid|StringRegExp|StringRegExpReplace|StringReplace|StringRight|StringSplit|StringStripCR|StringStripWS|StringToBinary|StringTrimLeft|StringTrimRight|StringUpper|Tan|TCPAccept|TCPCloseSocket|TCPConnect|TCPListen|TCPNameToIP|TCPRecv|TCPSend|TCPShutdown|TCPStartup|TimerDiff|TimerInit|ToolTip|TrayCreateItem|TrayCreateMenu|TrayGetMsg|TrayItemDelete|TrayItemGetHandle|TrayItemGetState|TrayItemGetText|TrayItemSetOnEvent|TrayItemSetState|TrayItemSetText|TraySetClick|TraySetIcon|TraySetOnEvent|TraySetPauseIcon|TraySetState|TraySetToolTip|TrayTip|UBound|UDPBind|UDPCloseSocket|UDPOpen|UDPRecv|UDPSend|UDPShutdown|UDPStartup|VarGetType|WinActivate|WinActive|WinClose|WinExists|WinFlash|WinGetCaretPos|WinGetClassList|WinGetClientSize|WinGetHandle|WinGetPos|WinGetProcess|WinGetState|WinGetText|WinGetTitle|WinKill|WinList|WinMenuSelectItem|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinSetOnTop|WinSetState|WinSetTitle|WinSetTrans|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive|' + - 'ArrayAdd|ArrayBinarySearch|ArrayConcatenate|ArrayDelete|ArrayDisplay|ArrayFindAll|ArrayInsert|ArrayMax|ArrayMaxIndex|ArrayMin|ArrayMinIndex|ArrayPop|ArrayPush|ArrayReverse|ArraySearch|ArraySort|ArraySwap|ArrayToClip|ArrayToString|ArrayTrim|ChooseColor|ChooseFont|ClipBoard_ChangeChain|ClipBoard_Close|ClipBoard_CountFormats|ClipBoard_Empty|ClipBoard_EnumFormats|ClipBoard_FormatStr|ClipBoard_GetData|ClipBoard_GetDataEx|ClipBoard_GetFormatName|ClipBoard_GetOpenWindow|ClipBoard_GetOwner|ClipBoard_GetPriorityFormat|ClipBoard_GetSequenceNumber|ClipBoard_GetViewer|ClipBoard_IsFormatAvailable|ClipBoard_Open|ClipBoard_RegisterFormat|ClipBoard_SetData|ClipBoard_SetDataEx|ClipBoard_SetViewer|ClipPutFile|ColorConvertHSLtoRGB|ColorConvertRGBtoHSL|ColorGetBlue|ColorGetGreen|ColorGetRed|Date_Time_CompareFileTime|Date_Time_DOSDateTimeToArray|Date_Time_DOSDateTimeToFileTime|Date_Time_DOSDateTimeToStr|Date_Time_DOSDateToArray|Date_Time_DOSDateToStr|Date_Time_DOSTimeToArray|Date_Time_DOSTimeToStr|Date_Time_EncodeFileTime|Date_Time_EncodeSystemTime|Date_Time_FileTimeToArray|Date_Time_FileTimeToDOSDateTime|Date_Time_FileTimeToLocalFileTime|Date_Time_FileTimeToStr|Date_Time_FileTimeToSystemTime|Date_Time_GetFileTime|Date_Time_GetLocalTime|Date_Time_GetSystemTime|Date_Time_GetSystemTimeAdjustment|Date_Time_GetSystemTimeAsFileTime|Date_Time_GetSystemTimes|Date_Time_GetTickCount|Date_Time_GetTimeZoneInformation|Date_Time_LocalFileTimeToFileTime|Date_Time_SetFileTime|Date_Time_SetLocalTime|Date_Time_SetSystemTime|Date_Time_SetSystemTimeAdjustment|Date_Time_SetTimeZoneInformation|Date_Time_SystemTimeToArray|Date_Time_SystemTimeToDateStr|Date_Time_SystemTimeToDateTimeStr|Date_Time_SystemTimeToFileTime|Date_Time_SystemTimeToTimeStr|Date_Time_SystemTimeToTzSpecificLocalTime|Date_Time_TzSpecificLocalTimeToSystemTime|DateAdd|DateDayOfWeek|DateDaysInMonth|DateDiff|DateIsLeapYear|DateIsValid|DateTimeFormat|DateTimeSplit|DateToDayOfWeek|DateToDayOfWeekISO|DateToDayValue|DateToMonth|DayValueToDate|DebugBugReportEnv|DebugOut|DebugSetup|Degree|EventLog__Backup|EventLog__Clear|EventLog__Close|EventLog__Count|EventLog__DeregisterSource|EventLog__Full|EventLog__Notify|EventLog__Oldest|EventLog__Open|EventLog__OpenBackup|EventLog__Read|EventLog__RegisterSource|EventLog__Report|FileCountLines|FileCreate|FileListToArray|FilePrint|FileReadToArray|FileWriteFromArray|FileWriteLog|FileWriteToLine|GDIPlus_ArrowCapCreate|GDIPlus_ArrowCapDispose|GDIPlus_ArrowCapGetFillState|GDIPlus_ArrowCapGetHeight|GDIPlus_ArrowCapGetMiddleInset|GDIPlus_ArrowCapGetWidth|GDIPlus_ArrowCapSetFillState|GDIPlus_ArrowCapSetHeight|GDIPlus_ArrowCapSetMiddleInset|GDIPlus_ArrowCapSetWidth|GDIPlus_BitmapCloneArea|GDIPlus_BitmapCreateFromFile|GDIPlus_BitmapCreateFromGraphics|GDIPlus_BitmapCreateFromHBITMAP|GDIPlus_BitmapCreateHBITMAPFromBitmap|GDIPlus_BitmapDispose|GDIPlus_BitmapLockBits|GDIPlus_BitmapUnlockBits|GDIPlus_BrushClone|GDIPlus_BrushCreateSolid|GDIPlus_BrushDispose|GDIPlus_BrushGetType|GDIPlus_CustomLineCapDispose|GDIPlus_Decoders|GDIPlus_DecodersGetCount|GDIPlus_DecodersGetSize|GDIPlus_Encoders|GDIPlus_EncodersGetCLSID|GDIPlus_EncodersGetCount|GDIPlus_EncodersGetParamList|GDIPlus_EncodersGetParamListSize|GDIPlus_EncodersGetSize|GDIPlus_FontCreate|GDIPlus_FontDispose|GDIPlus_FontFamilyCreate|GDIPlus_FontFamilyDispose|GDIPlus_GraphicsClear|GDIPlus_GraphicsCreateFromHDC|GDIPlus_GraphicsCreateFromHWND|GDIPlus_GraphicsDispose|GDIPlus_GraphicsDrawArc|GDIPlus_GraphicsDrawBezier|GDIPlus_GraphicsDrawClosedCurve|GDIPlus_GraphicsDrawCurve|GDIPlus_GraphicsDrawEllipse|GDIPlus_GraphicsDrawImage|GDIPlus_GraphicsDrawImageRect|GDIPlus_GraphicsDrawImageRectRect|GDIPlus_GraphicsDrawLine|GDIPlus_GraphicsDrawPie|GDIPlus_GraphicsDrawPolygon|GDIPlus_GraphicsDrawRect|GDIPlus_GraphicsDrawString|GDIPlus_GraphicsDrawStringEx|GDIPlus_GraphicsFillClosedCurve|GDIPlus_GraphicsFillEllipse|GDIPlus_GraphicsFillPie|GDIPlus_GraphicsFillRect|GDIPlus_GraphicsGetDC|GDIPlus_GraphicsGetSmoothingMode|GDIPlus_GraphicsMeasureString|GDIPlus_GraphicsReleaseDC|GDIPlus_GraphicsSetSmoothingMode|GDIPlus_GraphicsSetTransform|GDIPlus_ImageDispose|GDIPlus_ImageGetGraphicsContext|GDIPlus_ImageGetHeight|GDIPlus_ImageGetWidth|GDIPlus_ImageLoadFromFile|GDIPlus_ImageSaveToFile|GDIPlus_ImageSaveToFileEx|GDIPlus_MatrixCreate|GDIPlus_MatrixDispose|GDIPlus_MatrixRotate|GDIPlus_ParamAdd|GDIPlus_ParamInit|GDIPlus_PenCreate|GDIPlus_PenDispose|GDIPlus_PenGetAlignment|GDIPlus_PenGetColor|GDIPlus_PenGetCustomEndCap|GDIPlus_PenGetDashCap|GDIPlus_PenGetDashStyle|GDIPlus_PenGetEndCap|GDIPlus_PenGetWidth|GDIPlus_PenSetAlignment|GDIPlus_PenSetColor|GDIPlus_PenSetCustomEndCap|GDIPlus_PenSetDashCap|GDIPlus_PenSetDashStyle|GDIPlus_PenSetEndCap|GDIPlus_PenSetWidth|GDIPlus_RectFCreate|GDIPlus_Shutdown|GDIPlus_Startup|GDIPlus_StringFormatCreate|GDIPlus_StringFormatDispose|GetIP|GUICtrlAVI_Close|GUICtrlAVI_Create|GUICtrlAVI_Destroy|GUICtrlAVI_Open|GUICtrlAVI_OpenEx|GUICtrlAVI_Play|GUICtrlAVI_Seek|GUICtrlAVI_Show|GUICtrlAVI_Stop|GUICtrlButton_Click|GUICtrlButton_Create|GUICtrlButton_Destroy|GUICtrlButton_Enable|GUICtrlButton_GetCheck|GUICtrlButton_GetFocus|GUICtrlButton_GetIdealSize|GUICtrlButton_GetImage|GUICtrlButton_GetImageList|GUICtrlButton_GetState|GUICtrlButton_GetText|GUICtrlButton_GetTextMargin|GUICtrlButton_SetCheck|GUICtrlButton_SetFocus|GUICtrlButton_SetImage|GUICtrlButton_SetImageList|GUICtrlButton_SetSize|GUICtrlButton_SetState|GUICtrlButton_SetStyle|GUICtrlButton_SetText|GUICtrlButton_SetTextMargin|GUICtrlButton_Show|GUICtrlComboBox_AddDir|GUICtrlComboBox_AddString|GUICtrlComboBox_AutoComplete|GUICtrlComboBox_BeginUpdate|GUICtrlComboBox_Create|GUICtrlComboBox_DeleteString|GUICtrlComboBox_Destroy|GUICtrlComboBox_EndUpdate|GUICtrlComboBox_FindString|GUICtrlComboBox_FindStringExact|GUICtrlComboBox_GetComboBoxInfo|GUICtrlComboBox_GetCount|GUICtrlComboBox_GetCurSel|GUICtrlComboBox_GetDroppedControlRect|GUICtrlComboBox_GetDroppedControlRectEx|GUICtrlComboBox_GetDroppedState|GUICtrlComboBox_GetDroppedWidth|GUICtrlComboBox_GetEditSel|GUICtrlComboBox_GetEditText|GUICtrlComboBox_GetExtendedUI|GUICtrlComboBox_GetHorizontalExtent|GUICtrlComboBox_GetItemHeight|GUICtrlComboBox_GetLBText|GUICtrlComboBox_GetLBTextLen|GUICtrlComboBox_GetList|GUICtrlComboBox_GetListArray|GUICtrlComboBox_GetLocale|GUICtrlComboBox_GetLocaleCountry|GUICtrlComboBox_GetLocaleLang|GUICtrlComboBox_GetLocalePrimLang|GUICtrlComboBox_GetLocaleSubLang|GUICtrlComboBox_GetMinVisible|GUICtrlComboBox_GetTopIndex|GUICtrlComboBox_InitStorage|GUICtrlComboBox_InsertString|GUICtrlComboBox_LimitText|GUICtrlComboBox_ReplaceEditSel|GUICtrlComboBox_ResetContent|GUICtrlComboBox_SelectString|GUICtrlComboBox_SetCurSel|GUICtrlComboBox_SetDroppedWidth|GUICtrlComboBox_SetEditSel|GUICtrlComboBox_SetEditText|GUICtrlComboBox_SetExtendedUI|GUICtrlComboBox_SetHorizontalExtent|GUICtrlComboBox_SetItemHeight|GUICtrlComboBox_SetMinVisible|GUICtrlComboBox_SetTopIndex|GUICtrlComboBox_ShowDropDown|GUICtrlComboBoxEx_AddDir|GUICtrlComboBoxEx_AddString|GUICtrlComboBoxEx_BeginUpdate|GUICtrlComboBoxEx_Create|GUICtrlComboBoxEx_CreateSolidBitMap|GUICtrlComboBoxEx_DeleteString|GUICtrlComboBoxEx_Destroy|GUICtrlComboBoxEx_EndUpdate|GUICtrlComboBoxEx_FindStringExact|GUICtrlComboBoxEx_GetComboBoxInfo|GUICtrlComboBoxEx_GetComboControl|GUICtrlComboBoxEx_GetCount|GUICtrlComboBoxEx_GetCurSel|GUICtrlComboBoxEx_GetDroppedControlRect|GUICtrlComboBoxEx_GetDroppedControlRectEx|GUICtrlComboBoxEx_GetDroppedState|GUICtrlComboBoxEx_GetDroppedWidth|GUICtrlComboBoxEx_GetEditControl|GUICtrlComboBoxEx_GetEditSel|GUICtrlComboBoxEx_GetEditText|GUICtrlComboBoxEx_GetExtendedStyle|GUICtrlComboBoxEx_GetExtendedUI|GUICtrlComboBoxEx_GetImageList|GUICtrlComboBoxEx_GetItem|GUICtrlComboBoxEx_GetItemEx|GUICtrlComboBoxEx_GetItemHeight|GUICtrlComboBoxEx_GetItemImage|GUICtrlComboBoxEx_GetItemIndent|GUICtrlComboBoxEx_GetItemOverlayImage|GUICtrlComboBoxEx_GetItemParam|GUICtrlComboBoxEx_GetItemSelectedImage|GUICtrlComboBoxEx_GetItemText|GUICtrlComboBoxEx_GetItemTextLen|GUICtrlComboBoxEx_GetList|GUICtrlComboBoxEx_GetListArray|GUICtrlComboBoxEx_GetLocale|GUICtrlComboBoxEx_GetLocaleCountry|GUICtrlComboBoxEx_GetLocaleLang|GUICtrlComboBoxEx_GetLocalePrimLang|GUICtrlComboBoxEx_GetLocaleSubLang|GUICtrlComboBoxEx_GetMinVisible|GUICtrlComboBoxEx_GetTopIndex|GUICtrlComboBoxEx_InitStorage|GUICtrlComboBoxEx_InsertString|GUICtrlComboBoxEx_LimitText|GUICtrlComboBoxEx_ReplaceEditSel|GUICtrlComboBoxEx_ResetContent|GUICtrlComboBoxEx_SetCurSel|GUICtrlComboBoxEx_SetDroppedWidth|GUICtrlComboBoxEx_SetEditSel|GUICtrlComboBoxEx_SetEditText|GUICtrlComboBoxEx_SetExtendedStyle|GUICtrlComboBoxEx_SetExtendedUI|GUICtrlComboBoxEx_SetImageList|GUICtrlComboBoxEx_SetItem|GUICtrlComboBoxEx_SetItemEx|GUICtrlComboBoxEx_SetItemHeight|GUICtrlComboBoxEx_SetItemImage|GUICtrlComboBoxEx_SetItemIndent|GUICtrlComboBoxEx_SetItemOverlayImage|GUICtrlComboBoxEx_SetItemParam|GUICtrlComboBoxEx_SetItemSelectedImage|GUICtrlComboBoxEx_SetMinVisible|GUICtrlComboBoxEx_SetTopIndex|GUICtrlComboBoxEx_ShowDropDown|GUICtrlDTP_Create|GUICtrlDTP_Destroy|GUICtrlDTP_GetMCColor|GUICtrlDTP_GetMCFont|GUICtrlDTP_GetMonthCal|GUICtrlDTP_GetRange|GUICtrlDTP_GetRangeEx|GUICtrlDTP_GetSystemTime|GUICtrlDTP_GetSystemTimeEx|GUICtrlDTP_SetFormat|GUICtrlDTP_SetMCColor|GUICtrlDTP_SetMCFont|GUICtrlDTP_SetRange|GUICtrlDTP_SetRangeEx|GUICtrlDTP_SetSystemTime|GUICtrlDTP_SetSystemTimeEx|GUICtrlEdit_AppendText|GUICtrlEdit_BeginUpdate|GUICtrlEdit_CanUndo|GUICtrlEdit_CharFromPos|GUICtrlEdit_Create|GUICtrlEdit_Destroy|GUICtrlEdit_EmptyUndoBuffer|GUICtrlEdit_EndUpdate|GUICtrlEdit_Find|GUICtrlEdit_FmtLines|GUICtrlEdit_GetFirstVisibleLine|GUICtrlEdit_GetLimitText|GUICtrlEdit_GetLine|GUICtrlEdit_GetLineCount|GUICtrlEdit_GetMargins|GUICtrlEdit_GetModify|GUICtrlEdit_GetPasswordChar|GUICtrlEdit_GetRECT|GUICtrlEdit_GetRECTEx|GUICtrlEdit_GetSel|GUICtrlEdit_GetText|GUICtrlEdit_GetTextLen|GUICtrlEdit_HideBalloonTip|GUICtrlEdit_InsertText|GUICtrlEdit_LineFromChar|GUICtrlEdit_LineIndex|GUICtrlEdit_LineLength|GUICtrlEdit_LineScroll|GUICtrlEdit_PosFromChar|GUICtrlEdit_ReplaceSel|GUICtrlEdit_Scroll|GUICtrlEdit_SetLimitText|GUICtrlEdit_SetMargins|GUICtrlEdit_SetModify|GUICtrlEdit_SetPasswordChar|GUICtrlEdit_SetReadOnly|GUICtrlEdit_SetRECT|GUICtrlEdit_SetRECTEx|GUICtrlEdit_SetRECTNP|GUICtrlEdit_SetRectNPEx|GUICtrlEdit_SetSel|GUICtrlEdit_SetTabStops|GUICtrlEdit_SetText|GUICtrlEdit_ShowBalloonTip|GUICtrlEdit_Undo|GUICtrlHeader_AddItem|GUICtrlHeader_ClearFilter|GUICtrlHeader_ClearFilterAll|GUICtrlHeader_Create|GUICtrlHeader_CreateDragImage|GUICtrlHeader_DeleteItem|GUICtrlHeader_Destroy|GUICtrlHeader_EditFilter|GUICtrlHeader_GetBitmapMargin|GUICtrlHeader_GetImageList|GUICtrlHeader_GetItem|GUICtrlHeader_GetItemAlign|GUICtrlHeader_GetItemBitmap|GUICtrlHeader_GetItemCount|GUICtrlHeader_GetItemDisplay|GUICtrlHeader_GetItemFlags|GUICtrlHeader_GetItemFormat|GUICtrlHeader_GetItemImage|GUICtrlHeader_GetItemOrder|GUICtrlHeader_GetItemParam|GUICtrlHeader_GetItemRect|GUICtrlHeader_GetItemRectEx|GUICtrlHeader_GetItemText|GUICtrlHeader_GetItemWidth|GUICtrlHeader_GetOrderArray|GUICtrlHeader_GetUnicodeFormat|GUICtrlHeader_HitTest|GUICtrlHeader_InsertItem|GUICtrlHeader_Layout|GUICtrlHeader_OrderToIndex|GUICtrlHeader_SetBitmapMargin|GUICtrlHeader_SetFilterChangeTimeout|GUICtrlHeader_SetHotDivider|GUICtrlHeader_SetImageList|GUICtrlHeader_SetItem|GUICtrlHeader_SetItemAlign|GUICtrlHeader_SetItemBitmap|GUICtrlHeader_SetItemDisplay|GUICtrlHeader_SetItemFlags|GUICtrlHeader_SetItemFormat|GUICtrlHeader_SetItemImage|GUICtrlHeader_SetItemOrder|GUICtrlHeader_SetItemParam|GUICtrlHeader_SetItemText|GUICtrlHeader_SetItemWidth|GUICtrlHeader_SetOrderArray|GUICtrlHeader_SetUnicodeFormat|GUICtrlIpAddress_ClearAddress|GUICtrlIpAddress_Create|GUICtrlIpAddress_Destroy|GUICtrlIpAddress_Get|GUICtrlIpAddress_GetArray|GUICtrlIpAddress_GetEx|GUICtrlIpAddress_IsBlank|GUICtrlIpAddress_Set|GUICtrlIpAddress_SetArray|GUICtrlIpAddress_SetEx|GUICtrlIpAddress_SetFocus|GUICtrlIpAddress_SetFont|GUICtrlIpAddress_SetRange|GUICtrlIpAddress_ShowHide|GUICtrlListBox_AddFile|GUICtrlListBox_AddString|GUICtrlListBox_BeginUpdate|GUICtrlListBox_Create|GUICtrlListBox_DeleteString|GUICtrlListBox_Destroy|GUICtrlListBox_Dir|GUICtrlListBox_EndUpdate|GUICtrlListBox_FindInText|GUICtrlListBox_FindString|GUICtrlListBox_GetAnchorIndex|GUICtrlListBox_GetCaretIndex|GUICtrlListBox_GetCount|GUICtrlListBox_GetCurSel|GUICtrlListBox_GetHorizontalExtent|GUICtrlListBox_GetItemData|GUICtrlListBox_GetItemHeight|GUICtrlListBox_GetItemRect|GUICtrlListBox_GetItemRectEx|GUICtrlListBox_GetListBoxInfo|GUICtrlListBox_GetLocale|GUICtrlListBox_GetLocaleCountry|GUICtrlListBox_GetLocaleLang|GUICtrlListBox_GetLocalePrimLang|GUICtrlListBox_GetLocaleSubLang|GUICtrlListBox_GetSel|GUICtrlListBox_GetSelCount|GUICtrlListBox_GetSelItems|GUICtrlListBox_GetSelItemsText|GUICtrlListBox_GetText|GUICtrlListBox_GetTextLen|GUICtrlListBox_GetTopIndex|GUICtrlListBox_InitStorage|GUICtrlListBox_InsertString|GUICtrlListBox_ItemFromPoint|GUICtrlListBox_ReplaceString|GUICtrlListBox_ResetContent|GUICtrlListBox_SelectString|GUICtrlListBox_SelItemRange|GUICtrlListBox_SelItemRangeEx|GUICtrlListBox_SetAnchorIndex|GUICtrlListBox_SetCaretIndex|GUICtrlListBox_SetColumnWidth|GUICtrlListBox_SetCurSel|GUICtrlListBox_SetHorizontalExtent|GUICtrlListBox_SetItemData|GUICtrlListBox_SetItemHeight|GUICtrlListBox_SetLocale|GUICtrlListBox_SetSel|GUICtrlListBox_SetTabStops|GUICtrlListBox_SetTopIndex|GUICtrlListBox_Sort|GUICtrlListBox_SwapString|GUICtrlListBox_UpdateHScroll|GUICtrlListView_AddArray|GUICtrlListView_AddColumn|GUICtrlListView_AddItem|GUICtrlListView_AddSubItem|GUICtrlListView_ApproximateViewHeight|GUICtrlListView_ApproximateViewRect|GUICtrlListView_ApproximateViewWidth|GUICtrlListView_Arrange|GUICtrlListView_BeginUpdate|GUICtrlListView_CancelEditLabel|GUICtrlListView_ClickItem|GUICtrlListView_CopyItems|GUICtrlListView_Create|GUICtrlListView_CreateDragImage|GUICtrlListView_CreateSolidBitMap|GUICtrlListView_DeleteAllItems|GUICtrlListView_DeleteColumn|GUICtrlListView_DeleteItem|GUICtrlListView_DeleteItemsSelected|GUICtrlListView_Destroy|GUICtrlListView_DrawDragImage|GUICtrlListView_EditLabel|GUICtrlListView_EnableGroupView|GUICtrlListView_EndUpdate|GUICtrlListView_EnsureVisible|GUICtrlListView_FindInText|GUICtrlListView_FindItem|GUICtrlListView_FindNearest|GUICtrlListView_FindParam|GUICtrlListView_FindText|GUICtrlListView_GetBkColor|GUICtrlListView_GetBkImage|GUICtrlListView_GetCallbackMask|GUICtrlListView_GetColumn|GUICtrlListView_GetColumnCount|GUICtrlListView_GetColumnOrder|GUICtrlListView_GetColumnOrderArray|GUICtrlListView_GetColumnWidth|GUICtrlListView_GetCounterPage|GUICtrlListView_GetEditControl|GUICtrlListView_GetExtendedListViewStyle|GUICtrlListView_GetGroupInfo|GUICtrlListView_GetGroupViewEnabled|GUICtrlListView_GetHeader|GUICtrlListView_GetHotCursor|GUICtrlListView_GetHotItem|GUICtrlListView_GetHoverTime|GUICtrlListView_GetImageList|GUICtrlListView_GetISearchString|GUICtrlListView_GetItem|GUICtrlListView_GetItemChecked|GUICtrlListView_GetItemCount|GUICtrlListView_GetItemCut|GUICtrlListView_GetItemDropHilited|GUICtrlListView_GetItemEx|GUICtrlListView_GetItemFocused|GUICtrlListView_GetItemGroupID|GUICtrlListView_GetItemImage|GUICtrlListView_GetItemIndent|GUICtrlListView_GetItemParam|GUICtrlListView_GetItemPosition|GUICtrlListView_GetItemPositionX|GUICtrlListView_GetItemPositionY|GUICtrlListView_GetItemRect|GUICtrlListView_GetItemRectEx|GUICtrlListView_GetItemSelected|GUICtrlListView_GetItemSpacing|GUICtrlListView_GetItemSpacingX|GUICtrlListView_GetItemSpacingY|GUICtrlListView_GetItemState|GUICtrlListView_GetItemStateImage|GUICtrlListView_GetItemText|GUICtrlListView_GetItemTextArray|GUICtrlListView_GetItemTextString|GUICtrlListView_GetNextItem|GUICtrlListView_GetNumberOfWorkAreas|GUICtrlListView_GetOrigin|GUICtrlListView_GetOriginX|GUICtrlListView_GetOriginY|GUICtrlListView_GetOutlineColor|GUICtrlListView_GetSelectedColumn|GUICtrlListView_GetSelectedCount|GUICtrlListView_GetSelectedIndices|GUICtrlListView_GetSelectionMark|GUICtrlListView_GetStringWidth|GUICtrlListView_GetSubItemRect|GUICtrlListView_GetTextBkColor|GUICtrlListView_GetTextColor|GUICtrlListView_GetToolTips|GUICtrlListView_GetTopIndex|GUICtrlListView_GetUnicodeFormat|GUICtrlListView_GetView|GUICtrlListView_GetViewDetails|GUICtrlListView_GetViewLarge|GUICtrlListView_GetViewList|GUICtrlListView_GetViewRect|GUICtrlListView_GetViewSmall|GUICtrlListView_GetViewTile|GUICtrlListView_HideColumn|GUICtrlListView_HitTest|GUICtrlListView_InsertColumn|GUICtrlListView_InsertGroup|GUICtrlListView_InsertItem|GUICtrlListView_JustifyColumn|GUICtrlListView_MapIDToIndex|GUICtrlListView_MapIndexToID|GUICtrlListView_RedrawItems|GUICtrlListView_RegisterSortCallBack|GUICtrlListView_RemoveAllGroups|GUICtrlListView_RemoveGroup|GUICtrlListView_Scroll|GUICtrlListView_SetBkColor|GUICtrlListView_SetBkImage|GUICtrlListView_SetCallBackMask|GUICtrlListView_SetColumn|GUICtrlListView_SetColumnOrder|GUICtrlListView_SetColumnOrderArray|GUICtrlListView_SetColumnWidth|GUICtrlListView_SetExtendedListViewStyle|GUICtrlListView_SetGroupInfo|GUICtrlListView_SetHotItem|GUICtrlListView_SetHoverTime|GUICtrlListView_SetIconSpacing|GUICtrlListView_SetImageList|GUICtrlListView_SetItem|GUICtrlListView_SetItemChecked|GUICtrlListView_SetItemCount|GUICtrlListView_SetItemCut|GUICtrlListView_SetItemDropHilited|GUICtrlListView_SetItemEx|GUICtrlListView_SetItemFocused|GUICtrlListView_SetItemGroupID|GUICtrlListView_SetItemImage|GUICtrlListView_SetItemIndent|GUICtrlListView_SetItemParam|GUICtrlListView_SetItemPosition|GUICtrlListView_SetItemPosition32|GUICtrlListView_SetItemSelected|GUICtrlListView_SetItemState|GUICtrlListView_SetItemStateImage|GUICtrlListView_SetItemText|GUICtrlListView_SetOutlineColor|GUICtrlListView_SetSelectedColumn|GUICtrlListView_SetSelectionMark|GUICtrlListView_SetTextBkColor|GUICtrlListView_SetTextColor|GUICtrlListView_SetToolTips|GUICtrlListView_SetUnicodeFormat|GUICtrlListView_SetView|GUICtrlListView_SetWorkAreas|GUICtrlListView_SimpleSort|GUICtrlListView_SortItems|GUICtrlListView_SubItemHitTest|GUICtrlListView_UnRegisterSortCallBack|GUICtrlMenu_AddMenuItem|GUICtrlMenu_AppendMenu|GUICtrlMenu_CheckMenuItem|GUICtrlMenu_CheckRadioItem|GUICtrlMenu_CreateMenu|GUICtrlMenu_CreatePopup|GUICtrlMenu_DeleteMenu|GUICtrlMenu_DestroyMenu|GUICtrlMenu_DrawMenuBar|GUICtrlMenu_EnableMenuItem|GUICtrlMenu_FindItem|GUICtrlMenu_FindParent|GUICtrlMenu_GetItemBmp|GUICtrlMenu_GetItemBmpChecked|GUICtrlMenu_GetItemBmpUnchecked|GUICtrlMenu_GetItemChecked|GUICtrlMenu_GetItemCount|GUICtrlMenu_GetItemData|GUICtrlMenu_GetItemDefault|GUICtrlMenu_GetItemDisabled|GUICtrlMenu_GetItemEnabled|GUICtrlMenu_GetItemGrayed|GUICtrlMenu_GetItemHighlighted|GUICtrlMenu_GetItemID|GUICtrlMenu_GetItemInfo|GUICtrlMenu_GetItemRect|GUICtrlMenu_GetItemRectEx|GUICtrlMenu_GetItemState|GUICtrlMenu_GetItemStateEx|GUICtrlMenu_GetItemSubMenu|GUICtrlMenu_GetItemText|GUICtrlMenu_GetItemType|GUICtrlMenu_GetMenu|GUICtrlMenu_GetMenuBackground|GUICtrlMenu_GetMenuBarInfo|GUICtrlMenu_GetMenuContextHelpID|GUICtrlMenu_GetMenuData|GUICtrlMenu_GetMenuDefaultItem|GUICtrlMenu_GetMenuHeight|GUICtrlMenu_GetMenuInfo|GUICtrlMenu_GetMenuStyle|GUICtrlMenu_GetSystemMenu|GUICtrlMenu_InsertMenuItem|GUICtrlMenu_InsertMenuItemEx|GUICtrlMenu_IsMenu|GUICtrlMenu_LoadMenu|GUICtrlMenu_MapAccelerator|GUICtrlMenu_MenuItemFromPoint|GUICtrlMenu_RemoveMenu|GUICtrlMenu_SetItemBitmaps|GUICtrlMenu_SetItemBmp|GUICtrlMenu_SetItemBmpChecked|GUICtrlMenu_SetItemBmpUnchecked|GUICtrlMenu_SetItemChecked|GUICtrlMenu_SetItemData|GUICtrlMenu_SetItemDefault|GUICtrlMenu_SetItemDisabled|GUICtrlMenu_SetItemEnabled|GUICtrlMenu_SetItemGrayed|GUICtrlMenu_SetItemHighlighted|GUICtrlMenu_SetItemID|GUICtrlMenu_SetItemInfo|GUICtrlMenu_SetItemState|GUICtrlMenu_SetItemSubMenu|GUICtrlMenu_SetItemText|GUICtrlMenu_SetItemType|GUICtrlMenu_SetMenu|GUICtrlMenu_SetMenuBackground|GUICtrlMenu_SetMenuContextHelpID|GUICtrlMenu_SetMenuData|GUICtrlMenu_SetMenuDefaultItem|GUICtrlMenu_SetMenuHeight|GUICtrlMenu_SetMenuInfo|GUICtrlMenu_SetMenuStyle|GUICtrlMenu_TrackPopupMenu|GUICtrlMonthCal_Create|GUICtrlMonthCal_Destroy|GUICtrlMonthCal_GetColor|GUICtrlMonthCal_GetColorArray|GUICtrlMonthCal_GetCurSel|GUICtrlMonthCal_GetCurSelStr|GUICtrlMonthCal_GetFirstDOW|GUICtrlMonthCal_GetFirstDOWStr|GUICtrlMonthCal_GetMaxSelCount|GUICtrlMonthCal_GetMaxTodayWidth|GUICtrlMonthCal_GetMinReqHeight|GUICtrlMonthCal_GetMinReqRect|GUICtrlMonthCal_GetMinReqRectArray|GUICtrlMonthCal_GetMinReqWidth|GUICtrlMonthCal_GetMonthDelta|GUICtrlMonthCal_GetMonthRange|GUICtrlMonthCal_GetMonthRangeMax|GUICtrlMonthCal_GetMonthRangeMaxStr|GUICtrlMonthCal_GetMonthRangeMin|GUICtrlMonthCal_GetMonthRangeMinStr|GUICtrlMonthCal_GetMonthRangeSpan|GUICtrlMonthCal_GetRange|GUICtrlMonthCal_GetRangeMax|GUICtrlMonthCal_GetRangeMaxStr|GUICtrlMonthCal_GetRangeMin|GUICtrlMonthCal_GetRangeMinStr|GUICtrlMonthCal_GetSelRange|GUICtrlMonthCal_GetSelRangeMax|GUICtrlMonthCal_GetSelRangeMaxStr|GUICtrlMonthCal_GetSelRangeMin|GUICtrlMonthCal_GetSelRangeMinStr|GUICtrlMonthCal_GetToday|GUICtrlMonthCal_GetTodayStr|GUICtrlMonthCal_GetUnicodeFormat|GUICtrlMonthCal_HitTest|GUICtrlMonthCal_SetColor|GUICtrlMonthCal_SetCurSel|GUICtrlMonthCal_SetDayState|GUICtrlMonthCal_SetFirstDOW|GUICtrlMonthCal_SetMaxSelCount|GUICtrlMonthCal_SetMonthDelta|GUICtrlMonthCal_SetRange|GUICtrlMonthCal_SetSelRange|GUICtrlMonthCal_SetToday|GUICtrlMonthCal_SetUnicodeFormat|GUICtrlRebar_AddBand|GUICtrlRebar_AddToolBarBand|GUICtrlRebar_BeginDrag|GUICtrlRebar_Create|GUICtrlRebar_DeleteBand|GUICtrlRebar_Destroy|GUICtrlRebar_DragMove|GUICtrlRebar_EndDrag|GUICtrlRebar_GetBandBackColor|GUICtrlRebar_GetBandBorders|GUICtrlRebar_GetBandBordersEx|GUICtrlRebar_GetBandChildHandle|GUICtrlRebar_GetBandChildSize|GUICtrlRebar_GetBandCount|GUICtrlRebar_GetBandForeColor|GUICtrlRebar_GetBandHeaderSize|GUICtrlRebar_GetBandID|GUICtrlRebar_GetBandIdealSize|GUICtrlRebar_GetBandLength|GUICtrlRebar_GetBandLParam|GUICtrlRebar_GetBandMargins|GUICtrlRebar_GetBandMarginsEx|GUICtrlRebar_GetBandRect|GUICtrlRebar_GetBandRectEx|GUICtrlRebar_GetBandStyle|GUICtrlRebar_GetBandStyleBreak|GUICtrlRebar_GetBandStyleChildEdge|GUICtrlRebar_GetBandStyleFixedBMP|GUICtrlRebar_GetBandStyleFixedSize|GUICtrlRebar_GetBandStyleGripperAlways|GUICtrlRebar_GetBandStyleHidden|GUICtrlRebar_GetBandStyleHideTitle|GUICtrlRebar_GetBandStyleNoGripper|GUICtrlRebar_GetBandStyleTopAlign|GUICtrlRebar_GetBandStyleUseChevron|GUICtrlRebar_GetBandStyleVariableHeight|GUICtrlRebar_GetBandText|GUICtrlRebar_GetBarHeight|GUICtrlRebar_GetBKColor|GUICtrlRebar_GetColorScheme|GUICtrlRebar_GetRowCount|GUICtrlRebar_GetRowHeight|GUICtrlRebar_GetTextColor|GUICtrlRebar_GetToolTips|GUICtrlRebar_GetUnicodeFormat|GUICtrlRebar_HitTest|GUICtrlRebar_IDToIndex|GUICtrlRebar_MaximizeBand|GUICtrlRebar_MinimizeBand|GUICtrlRebar_MoveBand|GUICtrlRebar_SetBandBackColor|GUICtrlRebar_SetBandForeColor|GUICtrlRebar_SetBandHeaderSize|GUICtrlRebar_SetBandID|GUICtrlRebar_SetBandIdealSize|GUICtrlRebar_SetBandLength|GUICtrlRebar_SetBandLParam|GUICtrlRebar_SetBandStyle|GUICtrlRebar_SetBandStyleBreak|GUICtrlRebar_SetBandStyleChildEdge|GUICtrlRebar_SetBandStyleFixedBMP|GUICtrlRebar_SetBandStyleFixedSize|GUICtrlRebar_SetBandStyleGripperAlways|GUICtrlRebar_SetBandStyleHidden|GUICtrlRebar_SetBandStyleHideTitle|GUICtrlRebar_SetBandStyleNoGripper|GUICtrlRebar_SetBandStyleTopAlign|GUICtrlRebar_SetBandStyleUseChevron|GUICtrlRebar_SetBandStyleVariableHeight|GUICtrlRebar_SetBandText|GUICtrlRebar_SetBKColor|GUICtrlRebar_SetColorScheme|GUICtrlRebar_SetTextColor|GUICtrlRebar_SetToolTips|GUICtrlRebar_SetUnicodeFormat|GUICtrlRebar_ShowBand|GUICtrlSlider_ClearSel|GUICtrlSlider_ClearTics|GUICtrlSlider_Create|GUICtrlSlider_Destroy|GUICtrlSlider_GetBuddy|GUICtrlSlider_GetChannelRect|GUICtrlSlider_GetLineSize|GUICtrlSlider_GetNumTics|GUICtrlSlider_GetPageSize|GUICtrlSlider_GetPos|GUICtrlSlider_GetPTics|GUICtrlSlider_GetRange|GUICtrlSlider_GetRangeMax|GUICtrlSlider_GetRangeMin|GUICtrlSlider_GetSel|GUICtrlSlider_GetSelEnd|GUICtrlSlider_GetSelStart|GUICtrlSlider_GetThumbLength|GUICtrlSlider_GetThumbRect|GUICtrlSlider_GetThumbRectEx|GUICtrlSlider_GetTic|GUICtrlSlider_GetTicPos|GUICtrlSlider_GetToolTips|GUICtrlSlider_GetUnicodeFormat|GUICtrlSlider_SetBuddy|GUICtrlSlider_SetLineSize|GUICtrlSlider_SetPageSize|GUICtrlSlider_SetPos|GUICtrlSlider_SetRange|GUICtrlSlider_SetRangeMax|GUICtrlSlider_SetRangeMin|GUICtrlSlider_SetSel|GUICtrlSlider_SetSelEnd|GUICtrlSlider_SetSelStart|GUICtrlSlider_SetThumbLength|GUICtrlSlider_SetTic|GUICtrlSlider_SetTicFreq|GUICtrlSlider_SetTipSide|GUICtrlSlider_SetToolTips|GUICtrlSlider_SetUnicodeFormat|GUICtrlStatusBar_Create|GUICtrlStatusBar_Destroy|GUICtrlStatusBar_EmbedControl|GUICtrlStatusBar_GetBorders|GUICtrlStatusBar_GetBordersHorz|GUICtrlStatusBar_GetBordersRect|GUICtrlStatusBar_GetBordersVert|GUICtrlStatusBar_GetCount|GUICtrlStatusBar_GetHeight|GUICtrlStatusBar_GetIcon|GUICtrlStatusBar_GetParts|GUICtrlStatusBar_GetRect|GUICtrlStatusBar_GetRectEx|GUICtrlStatusBar_GetText|GUICtrlStatusBar_GetTextFlags|GUICtrlStatusBar_GetTextLength|GUICtrlStatusBar_GetTextLengthEx|GUICtrlStatusBar_GetTipText|GUICtrlStatusBar_GetUnicodeFormat|GUICtrlStatusBar_GetWidth|GUICtrlStatusBar_IsSimple|GUICtrlStatusBar_Resize|GUICtrlStatusBar_SetBkColor|GUICtrlStatusBar_SetIcon|GUICtrlStatusBar_SetMinHeight|GUICtrlStatusBar_SetParts|GUICtrlStatusBar_SetSimple|GUICtrlStatusBar_SetText|GUICtrlStatusBar_SetTipText|GUICtrlStatusBar_SetUnicodeFormat|GUICtrlStatusBar_ShowHide|GUICtrlTab_Create|GUICtrlTab_DeleteAllItems|GUICtrlTab_DeleteItem|GUICtrlTab_DeselectAll|GUICtrlTab_Destroy|GUICtrlTab_FindTab|GUICtrlTab_GetCurFocus|GUICtrlTab_GetCurSel|GUICtrlTab_GetDisplayRect|GUICtrlTab_GetDisplayRectEx|GUICtrlTab_GetExtendedStyle|GUICtrlTab_GetImageList|GUICtrlTab_GetItem|GUICtrlTab_GetItemCount|GUICtrlTab_GetItemImage|GUICtrlTab_GetItemParam|GUICtrlTab_GetItemRect|GUICtrlTab_GetItemRectEx|GUICtrlTab_GetItemState|GUICtrlTab_GetItemText|GUICtrlTab_GetRowCount|GUICtrlTab_GetToolTips|GUICtrlTab_GetUnicodeFormat|GUICtrlTab_HighlightItem|GUICtrlTab_HitTest|GUICtrlTab_InsertItem|GUICtrlTab_RemoveImage|GUICtrlTab_SetCurFocus|GUICtrlTab_SetCurSel|GUICtrlTab_SetExtendedStyle|GUICtrlTab_SetImageList|GUICtrlTab_SetItem|GUICtrlTab_SetItemImage|GUICtrlTab_SetItemParam|GUICtrlTab_SetItemSize|GUICtrlTab_SetItemState|GUICtrlTab_SetItemText|GUICtrlTab_SetMinTabWidth|GUICtrlTab_SetPadding|GUICtrlTab_SetToolTips|GUICtrlTab_SetUnicodeFormat|GUICtrlToolbar_AddBitmap|GUICtrlToolbar_AddButton|GUICtrlToolbar_AddButtonSep|GUICtrlToolbar_AddString|GUICtrlToolbar_ButtonCount|GUICtrlToolbar_CheckButton|GUICtrlToolbar_ClickAccel|GUICtrlToolbar_ClickButton|GUICtrlToolbar_ClickIndex|GUICtrlToolbar_CommandToIndex|GUICtrlToolbar_Create|GUICtrlToolbar_Customize|GUICtrlToolbar_DeleteButton|GUICtrlToolbar_Destroy|GUICtrlToolbar_EnableButton|GUICtrlToolbar_FindToolbar|GUICtrlToolbar_GetAnchorHighlight|GUICtrlToolbar_GetBitmapFlags|GUICtrlToolbar_GetButtonBitmap|GUICtrlToolbar_GetButtonInfo|GUICtrlToolbar_GetButtonInfoEx|GUICtrlToolbar_GetButtonParam|GUICtrlToolbar_GetButtonRect|GUICtrlToolbar_GetButtonRectEx|GUICtrlToolbar_GetButtonSize|GUICtrlToolbar_GetButtonState|GUICtrlToolbar_GetButtonStyle|GUICtrlToolbar_GetButtonText|GUICtrlToolbar_GetColorScheme|GUICtrlToolbar_GetDisabledImageList|GUICtrlToolbar_GetExtendedStyle|GUICtrlToolbar_GetHotImageList|GUICtrlToolbar_GetHotItem|GUICtrlToolbar_GetImageList|GUICtrlToolbar_GetInsertMark|GUICtrlToolbar_GetInsertMarkColor|GUICtrlToolbar_GetMaxSize|GUICtrlToolbar_GetMetrics|GUICtrlToolbar_GetPadding|GUICtrlToolbar_GetRows|GUICtrlToolbar_GetString|GUICtrlToolbar_GetStyle|GUICtrlToolbar_GetStyleAltDrag|GUICtrlToolbar_GetStyleCustomErase|GUICtrlToolbar_GetStyleFlat|GUICtrlToolbar_GetStyleList|GUICtrlToolbar_GetStyleRegisterDrop|GUICtrlToolbar_GetStyleToolTips|GUICtrlToolbar_GetStyleTransparent|GUICtrlToolbar_GetStyleWrapable|GUICtrlToolbar_GetTextRows|GUICtrlToolbar_GetToolTips|GUICtrlToolbar_GetUnicodeFormat|GUICtrlToolbar_HideButton|GUICtrlToolbar_HighlightButton|GUICtrlToolbar_HitTest|GUICtrlToolbar_IndexToCommand|GUICtrlToolbar_InsertButton|GUICtrlToolbar_InsertMarkHitTest|GUICtrlToolbar_IsButtonChecked|GUICtrlToolbar_IsButtonEnabled|GUICtrlToolbar_IsButtonHidden|GUICtrlToolbar_IsButtonHighlighted|GUICtrlToolbar_IsButtonIndeterminate|GUICtrlToolbar_IsButtonPressed|GUICtrlToolbar_LoadBitmap|GUICtrlToolbar_LoadImages|GUICtrlToolbar_MapAccelerator|GUICtrlToolbar_MoveButton|GUICtrlToolbar_PressButton|GUICtrlToolbar_SetAnchorHighlight|GUICtrlToolbar_SetBitmapSize|GUICtrlToolbar_SetButtonBitMap|GUICtrlToolbar_SetButtonInfo|GUICtrlToolbar_SetButtonInfoEx|GUICtrlToolbar_SetButtonParam|GUICtrlToolbar_SetButtonSize|GUICtrlToolbar_SetButtonState|GUICtrlToolbar_SetButtonStyle|GUICtrlToolbar_SetButtonText|GUICtrlToolbar_SetButtonWidth|GUICtrlToolbar_SetCmdID|GUICtrlToolbar_SetColorScheme|GUICtrlToolbar_SetDisabledImageList|GUICtrlToolbar_SetDrawTextFlags|GUICtrlToolbar_SetExtendedStyle|GUICtrlToolbar_SetHotImageList|GUICtrlToolbar_SetHotItem|GUICtrlToolbar_SetImageList|GUICtrlToolbar_SetIndent|GUICtrlToolbar_SetIndeterminate|GUICtrlToolbar_SetInsertMark|GUICtrlToolbar_SetInsertMarkColor|GUICtrlToolbar_SetMaxTextRows|GUICtrlToolbar_SetMetrics|GUICtrlToolbar_SetPadding|GUICtrlToolbar_SetParent|GUICtrlToolbar_SetRows|GUICtrlToolbar_SetStyle|GUICtrlToolbar_SetStyleAltDrag|GUICtrlToolbar_SetStyleCustomErase|GUICtrlToolbar_SetStyleFlat|GUICtrlToolbar_SetStyleList|GUICtrlToolbar_SetStyleRegisterDrop|GUICtrlToolbar_SetStyleToolTips|GUICtrlToolbar_SetStyleTransparent|GUICtrlToolbar_SetStyleWrapable|GUICtrlToolbar_SetToolTips|GUICtrlToolbar_SetUnicodeFormat|GUICtrlToolbar_SetWindowTheme|GUICtrlTreeView_Add|GUICtrlTreeView_AddChild|GUICtrlTreeView_AddChildFirst|GUICtrlTreeView_AddFirst|GUICtrlTreeView_BeginUpdate|GUICtrlTreeView_ClickItem|GUICtrlTreeView_Create|GUICtrlTreeView_CreateDragImage|GUICtrlTreeView_CreateSolidBitMap|GUICtrlTreeView_Delete|GUICtrlTreeView_DeleteAll|GUICtrlTreeView_DeleteChildren|GUICtrlTreeView_Destroy|GUICtrlTreeView_DisplayRect|GUICtrlTreeView_DisplayRectEx|GUICtrlTreeView_EditText|GUICtrlTreeView_EndEdit|GUICtrlTreeView_EndUpdate|GUICtrlTreeView_EnsureVisible|GUICtrlTreeView_Expand|GUICtrlTreeView_ExpandedOnce|GUICtrlTreeView_FindItem|GUICtrlTreeView_FindItemEx|GUICtrlTreeView_GetBkColor|GUICtrlTreeView_GetBold|GUICtrlTreeView_GetChecked|GUICtrlTreeView_GetChildCount|GUICtrlTreeView_GetChildren|GUICtrlTreeView_GetCount|GUICtrlTreeView_GetCut|GUICtrlTreeView_GetDropTarget|GUICtrlTreeView_GetEditControl|GUICtrlTreeView_GetExpanded|GUICtrlTreeView_GetFirstChild|GUICtrlTreeView_GetFirstItem|GUICtrlTreeView_GetFirstVisible|GUICtrlTreeView_GetFocused|GUICtrlTreeView_GetHeight|GUICtrlTreeView_GetImageIndex|GUICtrlTreeView_GetImageListIconHandle|GUICtrlTreeView_GetIndent|GUICtrlTreeView_GetInsertMarkColor|GUICtrlTreeView_GetISearchString|GUICtrlTreeView_GetItemByIndex|GUICtrlTreeView_GetItemHandle|GUICtrlTreeView_GetItemParam|GUICtrlTreeView_GetLastChild|GUICtrlTreeView_GetLineColor|GUICtrlTreeView_GetNext|GUICtrlTreeView_GetNextChild|GUICtrlTreeView_GetNextSibling|GUICtrlTreeView_GetNextVisible|GUICtrlTreeView_GetNormalImageList|GUICtrlTreeView_GetParentHandle|GUICtrlTreeView_GetParentParam|GUICtrlTreeView_GetPrev|GUICtrlTreeView_GetPrevChild|GUICtrlTreeView_GetPrevSibling|GUICtrlTreeView_GetPrevVisible|GUICtrlTreeView_GetScrollTime|GUICtrlTreeView_GetSelected|GUICtrlTreeView_GetSelectedImageIndex|GUICtrlTreeView_GetSelection|GUICtrlTreeView_GetSiblingCount|GUICtrlTreeView_GetState|GUICtrlTreeView_GetStateImageIndex|GUICtrlTreeView_GetStateImageList|GUICtrlTreeView_GetText|GUICtrlTreeView_GetTextColor|GUICtrlTreeView_GetToolTips|GUICtrlTreeView_GetTree|GUICtrlTreeView_GetUnicodeFormat|GUICtrlTreeView_GetVisible|GUICtrlTreeView_GetVisibleCount|GUICtrlTreeView_HitTest|GUICtrlTreeView_HitTestEx|GUICtrlTreeView_HitTestItem|GUICtrlTreeView_Index|GUICtrlTreeView_InsertItem|GUICtrlTreeView_IsFirstItem|GUICtrlTreeView_IsParent|GUICtrlTreeView_Level|GUICtrlTreeView_SelectItem|GUICtrlTreeView_SelectItemByIndex|GUICtrlTreeView_SetBkColor|GUICtrlTreeView_SetBold|GUICtrlTreeView_SetChecked|GUICtrlTreeView_SetCheckedByIndex|GUICtrlTreeView_SetChildren|GUICtrlTreeView_SetCut|GUICtrlTreeView_SetDropTarget|GUICtrlTreeView_SetFocused|GUICtrlTreeView_SetHeight|GUICtrlTreeView_SetIcon|GUICtrlTreeView_SetImageIndex|GUICtrlTreeView_SetIndent|GUICtrlTreeView_SetInsertMark|GUICtrlTreeView_SetInsertMarkColor|GUICtrlTreeView_SetItemHeight|GUICtrlTreeView_SetItemParam|GUICtrlTreeView_SetLineColor|GUICtrlTreeView_SetNormalImageList|GUICtrlTreeView_SetScrollTime|GUICtrlTreeView_SetSelected|GUICtrlTreeView_SetSelectedImageIndex|GUICtrlTreeView_SetState|GUICtrlTreeView_SetStateImageIndex|GUICtrlTreeView_SetStateImageList|GUICtrlTreeView_SetText|GUICtrlTreeView_SetTextColor|GUICtrlTreeView_SetToolTips|GUICtrlTreeView_SetUnicodeFormat|GUICtrlTreeView_Sort|GUIImageList_Add|GUIImageList_AddBitmap|GUIImageList_AddIcon|GUIImageList_AddMasked|GUIImageList_BeginDrag|GUIImageList_Copy|GUIImageList_Create|GUIImageList_Destroy|GUIImageList_DestroyIcon|GUIImageList_DragEnter|GUIImageList_DragLeave|GUIImageList_DragMove|GUIImageList_Draw|GUIImageList_DrawEx|GUIImageList_Duplicate|GUIImageList_EndDrag|GUIImageList_GetBkColor|GUIImageList_GetIcon|GUIImageList_GetIconHeight|GUIImageList_GetIconSize|GUIImageList_GetIconSizeEx|GUIImageList_GetIconWidth|GUIImageList_GetImageCount|GUIImageList_GetImageInfoEx|GUIImageList_Remove|GUIImageList_ReplaceIcon|GUIImageList_SetBkColor|GUIImageList_SetIconSize|GUIImageList_SetImageCount|GUIImageList_Swap|GUIScrollBars_EnableScrollBar|GUIScrollBars_GetScrollBarInfoEx|GUIScrollBars_GetScrollBarRect|GUIScrollBars_GetScrollBarRGState|GUIScrollBars_GetScrollBarXYLineButton|GUIScrollBars_GetScrollBarXYThumbBottom|GUIScrollBars_GetScrollBarXYThumbTop|GUIScrollBars_GetScrollInfo|GUIScrollBars_GetScrollInfoEx|GUIScrollBars_GetScrollInfoMax|GUIScrollBars_GetScrollInfoMin|GUIScrollBars_GetScrollInfoPage|GUIScrollBars_GetScrollInfoPos|GUIScrollBars_GetScrollInfoTrackPos|GUIScrollBars_GetScrollPos|GUIScrollBars_GetScrollRange|GUIScrollBars_Init|GUIScrollBars_ScrollWindow|GUIScrollBars_SetScrollInfo|GUIScrollBars_SetScrollInfoMax|GUIScrollBars_SetScrollInfoMin|GUIScrollBars_SetScrollInfoPage|GUIScrollBars_SetScrollInfoPos|GUIScrollBars_SetScrollRange|GUIScrollBars_ShowScrollBar|GUIToolTip_Activate|GUIToolTip_AddTool|GUIToolTip_AdjustRect|GUIToolTip_BitsToTTF|GUIToolTip_Create|GUIToolTip_DelTool|GUIToolTip_Destroy|GUIToolTip_EnumTools|GUIToolTip_GetBubbleHeight|GUIToolTip_GetBubbleSize|GUIToolTip_GetBubbleWidth|GUIToolTip_GetCurrentTool|GUIToolTip_GetDelayTime|GUIToolTip_GetMargin|GUIToolTip_GetMarginEx|GUIToolTip_GetMaxTipWidth|GUIToolTip_GetText|GUIToolTip_GetTipBkColor|GUIToolTip_GetTipTextColor|GUIToolTip_GetTitleBitMap|GUIToolTip_GetTitleText|GUIToolTip_GetToolCount|GUIToolTip_GetToolInfo|GUIToolTip_HitTest|GUIToolTip_NewToolRect|GUIToolTip_Pop|GUIToolTip_PopUp|GUIToolTip_SetDelayTime|GUIToolTip_SetMargin|GUIToolTip_SetMaxTipWidth|GUIToolTip_SetTipBkColor|GUIToolTip_SetTipTextColor|GUIToolTip_SetTitle|GUIToolTip_SetToolInfo|GUIToolTip_SetWindowTheme|GUIToolTip_ToolExists|GUIToolTip_ToolToArray|GUIToolTip_TrackActivate|GUIToolTip_TrackPosition|GUIToolTip_TTFToBits|GUIToolTip_Update|GUIToolTip_UpdateTipText|HexToString|IE_Example|IE_Introduction|IE_VersionInfo|IEAction|IEAttach|IEBodyReadHTML|IEBodyReadText|IEBodyWriteHTML|IECreate|IECreateEmbedded|IEDocGetObj|IEDocInsertHTML|IEDocInsertText|IEDocReadHTML|IEDocWriteHTML|IEErrorHandlerDeRegister|IEErrorHandlerRegister|IEErrorNotify|IEFormElementCheckBoxSelect|IEFormElementGetCollection|IEFormElementGetObjByName|IEFormElementGetValue|IEFormElementOptionSelect|IEFormElementRadioSelect|IEFormElementSetValue|IEFormGetCollection|IEFormGetObjByName|IEFormImageClick|IEFormReset|IEFormSubmit|IEFrameGetCollection|IEFrameGetObjByName|IEGetObjById|IEGetObjByName|IEHeadInsertEventScript|IEImgClick|IEImgGetCollection|IEIsFrameSet|IELinkClickByIndex|IELinkClickByText|IELinkGetCollection|IELoadWait|IELoadWaitTimeout|IENavigate|IEPropertyGet|IEPropertySet|IEQuit|IETableGetCollection|IETableWriteToArray|IETagNameAllGetCollection|IETagNameGetCollection|Iif|INetExplorerCapable|INetGetSource|INetMail|INetSmtpMail|IsPressed|MathCheckDiv|Max|MemGlobalAlloc|MemGlobalFree|MemGlobalLock|MemGlobalSize|MemGlobalUnlock|MemMoveMemory|MemMsgBox|MemShowError|MemVirtualAlloc|MemVirtualAllocEx|MemVirtualFree|MemVirtualFreeEx|Min|MouseTrap|NamedPipes_CallNamedPipe|NamedPipes_ConnectNamedPipe|NamedPipes_CreateNamedPipe|NamedPipes_CreatePipe|NamedPipes_DisconnectNamedPipe|NamedPipes_GetNamedPipeHandleState|NamedPipes_GetNamedPipeInfo|NamedPipes_PeekNamedPipe|NamedPipes_SetNamedPipeHandleState|NamedPipes_TransactNamedPipe|NamedPipes_WaitNamedPipe|Net_Share_ConnectionEnum|Net_Share_FileClose|Net_Share_FileEnum|Net_Share_FileGetInfo|Net_Share_PermStr|Net_Share_ResourceStr|Net_Share_SessionDel|Net_Share_SessionEnum|Net_Share_SessionGetInfo|Net_Share_ShareAdd|Net_Share_ShareCheck|Net_Share_ShareDel|Net_Share_ShareEnum|Net_Share_ShareGetInfo|Net_Share_ShareSetInfo|Net_Share_StatisticsGetSvr|Net_Share_StatisticsGetWrk|Now|NowCalc|NowCalcDate|NowDate|NowTime|PathFull|PathMake|PathSplit|ProcessGetName|ProcessGetPriority|Radian|ReplaceStringInFile|RunDOS|ScreenCapture_Capture|ScreenCapture_CaptureWnd|ScreenCapture_SaveImage|ScreenCapture_SetBMPFormat|ScreenCapture_SetJPGQuality|ScreenCapture_SetTIFColorDepth|ScreenCapture_SetTIFCompression|Security__AdjustTokenPrivileges|Security__GetAccountSid|Security__GetLengthSid|Security__GetTokenInformation|Security__ImpersonateSelf|Security__IsValidSid|Security__LookupAccountName|Security__LookupAccountSid|Security__LookupPrivilegeValue|Security__OpenProcessToken|Security__OpenThreadToken|Security__OpenThreadTokenEx|Security__SetPrivilege|Security__SidToStringSid|Security__SidTypeStr|Security__StringSidToSid|SendMessage|SendMessageA|SetDate|SetTime|Singleton|SoundClose|SoundLength|SoundOpen|SoundPause|SoundPlay|SoundPos|SoundResume|SoundSeek|SoundStatus|SoundStop|SQLite_Changes|SQLite_Close|SQLite_Display2DResult|SQLite_Encode|SQLite_ErrCode|SQLite_ErrMsg|SQLite_Escape|SQLite_Exec|SQLite_FetchData|SQLite_FetchNames|SQLite_GetTable|SQLite_GetTable2d|SQLite_LastInsertRowID|SQLite_LibVersion|SQLite_Open|SQLite_Query|SQLite_QueryFinalize|SQLite_QueryReset|SQLite_QuerySingleRow|SQLite_SaveMode|SQLite_SetTimeout|SQLite_Shutdown|SQLite_SQLiteExe|SQLite_Startup|SQLite_TotalChanges|StringAddComma|StringBetween|StringEncrypt|StringInsert|StringProper|StringRepeat|StringReverse|StringSplit|StringToHex|TCPIpToName|TempFile|TicksToTime|Timer_Diff|Timer_GetTimerID|Timer_Init|Timer_KillAllTimers|Timer_KillTimer|Timer_SetTimer|TimeToTicks|VersionCompare|viClose|viExecCommand|viFindGpib|viGpibBusReset|viGTL|viOpen|viSetAttribute|viSetTimeout|WeekNumberISO|WinAPI_AttachConsole|WinAPI_AttachThreadInput|WinAPI_Beep|WinAPI_BitBlt|WinAPI_CallNextHookEx|WinAPI_Check|WinAPI_ClientToScreen|WinAPI_CloseHandle|WinAPI_CommDlgExtendedError|WinAPI_CopyIcon|WinAPI_CreateBitmap|WinAPI_CreateCompatibleBitmap|WinAPI_CreateCompatibleDC|WinAPI_CreateEvent|WinAPI_CreateFile|WinAPI_CreateFont|WinAPI_CreateFontIndirect|WinAPI_CreateProcess|WinAPI_CreateSolidBitmap|WinAPI_CreateSolidBrush|WinAPI_CreateWindowEx|WinAPI_DefWindowProc|WinAPI_DeleteDC|WinAPI_DeleteObject|WinAPI_DestroyIcon|WinAPI_DestroyWindow|WinAPI_DrawEdge|WinAPI_DrawFrameControl|WinAPI_DrawIcon|WinAPI_DrawIconEx|WinAPI_DrawText|WinAPI_EnableWindow|WinAPI_EnumDisplayDevices|WinAPI_EnumWindows|WinAPI_EnumWindowsPopup|WinAPI_EnumWindowsTop|WinAPI_ExpandEnvironmentStrings|WinAPI_ExtractIconEx|WinAPI_FatalAppExit|WinAPI_FillRect|WinAPI_FindExecutable|WinAPI_FindWindow|WinAPI_FlashWindow|WinAPI_FlashWindowEx|WinAPI_FloatToInt|WinAPI_FlushFileBuffers|WinAPI_FormatMessage|WinAPI_FrameRect|WinAPI_FreeLibrary|WinAPI_GetAncestor|WinAPI_GetAsyncKeyState|WinAPI_GetClassName|WinAPI_GetClientHeight|WinAPI_GetClientRect|WinAPI_GetClientWidth|WinAPI_GetCurrentProcess|WinAPI_GetCurrentProcessID|WinAPI_GetCurrentThread|WinAPI_GetCurrentThreadId|WinAPI_GetCursorInfo|WinAPI_GetDC|WinAPI_GetDesktopWindow|WinAPI_GetDeviceCaps|WinAPI_GetDIBits|WinAPI_GetDlgCtrlID|WinAPI_GetDlgItem|WinAPI_GetFileSizeEx|WinAPI_GetFocus|WinAPI_GetForegroundWindow|WinAPI_GetIconInfo|WinAPI_GetLastError|WinAPI_GetLastErrorMessage|WinAPI_GetModuleHandle|WinAPI_GetMousePos|WinAPI_GetMousePosX|WinAPI_GetMousePosY|WinAPI_GetObject|WinAPI_GetOpenFileName|WinAPI_GetOverlappedResult|WinAPI_GetParent|WinAPI_GetProcessAffinityMask|WinAPI_GetSaveFileName|WinAPI_GetStdHandle|WinAPI_GetStockObject|WinAPI_GetSysColor|WinAPI_GetSysColorBrush|WinAPI_GetSystemMetrics|WinAPI_GetTextExtentPoint32|WinAPI_GetWindow|WinAPI_GetWindowDC|WinAPI_GetWindowHeight|WinAPI_GetWindowLong|WinAPI_GetWindowRect|WinAPI_GetWindowText|WinAPI_GetWindowThreadProcessId|WinAPI_GetWindowWidth|WinAPI_GetXYFromPoint|WinAPI_GlobalMemStatus|WinAPI_GUIDFromString|WinAPI_GUIDFromStringEx|WinAPI_HiWord|WinAPI_InProcess|WinAPI_IntToFloat|WinAPI_InvalidateRect|WinAPI_IsClassName|WinAPI_IsWindow|WinAPI_IsWindowVisible|WinAPI_LoadBitmap|WinAPI_LoadImage|WinAPI_LoadLibrary|WinAPI_LoadLibraryEx|WinAPI_LoadShell32Icon|WinAPI_LoadString|WinAPI_LocalFree|WinAPI_LoWord|WinAPI_MakeDWord|WinAPI_MAKELANGID|WinAPI_MAKELCID|WinAPI_MakeLong|WinAPI_MessageBeep|WinAPI_Mouse_Event|WinAPI_MoveWindow|WinAPI_MsgBox|WinAPI_MulDiv|WinAPI_MultiByteToWideChar|WinAPI_MultiByteToWideCharEx|WinAPI_OpenProcess|WinAPI_PointFromRect|WinAPI_PostMessage|WinAPI_PrimaryLangId|WinAPI_PtInRect|WinAPI_ReadFile|WinAPI_ReadProcessMemory|WinAPI_RectIsEmpty|WinAPI_RedrawWindow|WinAPI_RegisterWindowMessage|WinAPI_ReleaseCapture|WinAPI_ReleaseDC|WinAPI_ScreenToClient|WinAPI_SelectObject|WinAPI_SetBkColor|WinAPI_SetCapture|WinAPI_SetCursor|WinAPI_SetDefaultPrinter|WinAPI_SetDIBits|WinAPI_SetEvent|WinAPI_SetFocus|WinAPI_SetFont|WinAPI_SetHandleInformation|WinAPI_SetLastError|WinAPI_SetParent|WinAPI_SetProcessAffinityMask|WinAPI_SetSysColors|WinAPI_SetTextColor|WinAPI_SetWindowLong|WinAPI_SetWindowPos|WinAPI_SetWindowsHookEx|WinAPI_SetWindowText|WinAPI_ShowCursor|WinAPI_ShowError|WinAPI_ShowMsg|WinAPI_ShowWindow|WinAPI_StringFromGUID|WinAPI_SubLangId|WinAPI_SystemParametersInfo|WinAPI_TwipsPerPixelX|WinAPI_TwipsPerPixelY|WinAPI_UnhookWindowsHookEx|WinAPI_UpdateLayeredWindow|WinAPI_UpdateWindow|WinAPI_ValidateClassName|WinAPI_WaitForInputIdle|WinAPI_WaitForMultipleObjects|WinAPI_WaitForSingleObject|WinAPI_WideCharToMultiByte|WinAPI_WindowFromPoint|WinAPI_WriteConsole|WinAPI_WriteFile|WinAPI_WriteProcessMemory|WinNet_AddConnection|WinNet_AddConnection2|WinNet_AddConnection3|WinNet_CancelConnection|WinNet_CancelConnection2|WinNet_CloseEnum|WinNet_ConnectionDialog|WinNet_ConnectionDialog1|WinNet_DisconnectDialog|WinNet_DisconnectDialog1|WinNet_EnumResource|WinNet_GetConnection|WinNet_GetConnectionPerformance|WinNet_GetLastError|WinNet_GetNetworkInformation|WinNet_GetProviderName|WinNet_GetResourceInformation|WinNet_GetResourceParent|WinNet_GetUniversalName|WinNet_GetUser|WinNet_OpenEnum|WinNet_RestoreConnection|WinNet_UseConnection|Word_VersionInfo|WordAttach|WordCreate|WordDocAdd|WordDocAddLink|WordDocAddPicture|WordDocClose|WordDocFindReplace|WordDocGetCollection|WordDocLinkGetCollection|WordDocOpen|WordDocPrint|WordDocPropertyGet|WordDocPropertySet|WordDocSave|WordDocSaveAs|WordErrorHandlerDeRegister|WordErrorHandlerRegister|WordErrorNotify|WordMacroRun|WordPropertyGet|WordPropertySet|WordQuit|' + - 'ce|comments-end|comments-start|cs|include|include-once|NoTrayIcon|RequireAdmin|' + - 'AutoIt3Wrapper_Au3Check_Parameters|AutoIt3Wrapper_Au3Check_Stop_OnWarning|AutoIt3Wrapper_Change2CUI|AutoIt3Wrapper_Compression|AutoIt3Wrapper_cvsWrapper_Parameters|AutoIt3Wrapper_Icon|AutoIt3Wrapper_Outfile|AutoIt3Wrapper_Outfile_Type|AutoIt3Wrapper_Plugin_Funcs|AutoIt3Wrapper_Res_Comment|AutoIt3Wrapper_Res_Description|AutoIt3Wrapper_Res_Field|AutoIt3Wrapper_Res_File_Add|AutoIt3Wrapper_Res_Fileversion|AutoIt3Wrapper_Res_FileVersion_AutoIncrement|AutoIt3Wrapper_Res_Icon_Add|AutoIt3Wrapper_Res_Language|AutoIt3Wrapper_Res_LegalCopyright|AutoIt3Wrapper_res_requestedExecutionLevel|AutoIt3Wrapper_Res_SaveSource|AutoIt3Wrapper_Run_After|AutoIt3Wrapper_Run_Au3check|AutoIt3Wrapper_Run_Before|AutoIt3Wrapper_Run_cvsWrapper|AutoIt3Wrapper_Run_Debug_Mode|AutoIt3Wrapper_Run_Obfuscator|AutoIt3Wrapper_Run_Tidy|AutoIt3Wrapper_Tidy_Stop_OnError|AutoIt3Wrapper_UseAnsi|AutoIt3Wrapper_UseUpx|AutoIt3Wrapper_UseX64|AutoIt3Wrapper_Version|EndRegion|forceref|Obfuscator_Ignore_Funcs|Obfuscator_Ignore_Variables|Obfuscator_Parameters|Region|Tidy_Parameters' - var atKeywords = 'AppDataCommonDir|AppDataDir|AutoItExe|AutoItPID|AutoItUnicode|AutoItVersion|AutoItX64|COM_EventObj|CommonFilesDir|Compiled|ComputerName|ComSpec|CR|CRLF|DesktopCommonDir|DesktopDepth|DesktopDir|DesktopHeight|DesktopRefresh|DesktopWidth|DocumentsCommonDir|error|exitCode|exitMethod|extended|FavoritesCommonDir|FavoritesDir|GUI_CtrlHandle|GUI_CtrlId|GUI_DragFile|GUI_DragId|GUI_DropId|GUI_WinHandle|HomeDrive|HomePath|HomeShare|HotKeyPressed|HOUR|InetGetActive|InetGetBytesRead|IPAddress1|IPAddress2|IPAddress3|IPAddress4|KBLayout|LF|LogonDNSDomain|LogonDomain|LogonServer|MDAY|MIN|MON|MyDocumentsDir|NumParams|OSBuild|OSLang|OSServicePack|OSTYPE|OSVersion|ProcessorArch|ProgramFilesDir|ProgramsCommonDir|ProgramsDir|ScriptDir|ScriptFullPath|ScriptLineNumber|ScriptName|SEC|StartMenuCommonDir|StartMenuDir|StartupCommonDir|StartupDir|SW_DISABLE|SW_ENABLE|SW_HIDE|SW_LOCK|SW_MAXIMIZE|SW_MINIMIZE|SW_RESTORE|SW_SHOW|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWMINNOACTIVE|SW_SHOWNA|SW_SHOWNOACTIVATE|SW_SHOWNORMAL|SW_UNLOCK|SystemDir|TAB|TempDir|TRAY_ID|TrayIconFlashing|TrayIconVisible|UserName|UserProfileDir|WDAY|WindowsDir|WorkingDir|YDAY|YEAR' - - this.$rules = { start: - [ { token: 'comment.line.ahk', regex: '(?:^| );.*$' }, - { token: 'comment.block.ahk', - regex: '/\\*', push: - [ { token: 'comment.block.ahk', regex: '\\*/', next: 'pop' }, - { defaultToken: 'comment.block.ahk' } ] }, - { token: 'doc.comment.ahk', - regex: '#cs', push: - [ { token: 'doc.comment.ahk', regex: '#ce', next: 'pop' }, - { defaultToken: 'doc.comment.ahk' } ] }, - { token: 'keyword.command.ahk', - regex: '(?:\\b|^)(?:allowsamelinecomments|clipboardtimeout|commentflag|errorstdout|escapechar|hotkeyinterval|hotkeymodifiertimeout|hotstring|include|includeagain|installkeybdhook|installmousehook|keyhistory|ltrim|maxhotkeysperinterval|maxmem|maxthreads|maxthreadsbuffer|maxthreadsperhotkey|noenv|notrayicon|persistent|singleinstance|usehook|winactivateforce|autotrim|blockinput|click|clipwait|continue|control|controlclick|controlfocus|controlget|controlgetfocus|controlgetpos|controlgettext|controlmove|controlsend|controlsendraw|controlsettext|coordmode|critical|detecthiddentext|detecthiddenwindows|drive|driveget|drivespacefree|edit|endrepeat|envadd|envdiv|envget|envmult|envset|envsub|envupdate|exit|exitapp|fileappend|filecopy|filecopydir|filecreatedir|filecreateshortcut|filedelete|filegetattrib|filegetshortcut|filegetsize|filegettime|filegetversion|fileinstall|filemove|filemovedir|fileread|filereadline|filerecycle|filerecycleempty|fileremovedir|fileselectfile|fileselectfolder|filesetattrib|filesettime|formattime|getkeystate|gosub|goto|groupactivate|groupadd|groupclose|groupdeactivate|gui|guicontrol|guicontrolget|hideautoitwin|hotkey|ifequal|ifexist|ifgreater|ifgreaterorequal|ifinstring|ifless|iflessorequal|ifmsgbox|ifnotequal|ifnotexist|ifnotinstring|ifwinactive|ifwinexist|ifwinnotactive|ifwinnotexist|imagesearch|inidelete|iniread|iniwrite|input|inputbox|keyhistory|keywait|listhotkeys|listlines|listvars|menu|mouseclick|mouseclickdrag|mousegetpos|mousemove|msgbox|onexit|outputdebug|pause|pixelgetcolor|pixelsearch|postmessage|process|progress|random|regdelete|regread|regwrite|reload|repeat|run|runas|runwait|send|sendevent|sendinput|sendmode|sendplay|sendmessage|sendraw|setbatchlines|setcapslockstate|setcontroldelay|setdefaultmousespeed|setenv|setformat|setkeydelay|setmousedelay|setnumlockstate|setscrolllockstate|setstorecapslockmode|settimer|settitlematchmode|setwindelay|setworkingdir|shutdown|sleep|sort|soundbeep|soundget|soundgetwavevolume|soundplay|soundset|soundsetwavevolume|splashimage|splashtextoff|splashtexton|splitpath|statusbargettext|statusbarwait|stringcasesense|stringgetpos|stringleft|stringlen|stringlower|stringmid|stringreplace|stringright|stringsplit|stringtrimleft|stringtrimright|stringupper|suspend|sysget|thread|tooltip|transform|traytip|urldownloadtofile|while|winactivate|winactivatebottom|winclose|winget|wingetactivestats|wingetactivetitle|wingetclass|wingetpos|wingettext|wingettitle|winhide|winkill|winmaximize|winmenuselectitem|winminimize|winminimizeall|winminimizeallundo|winmove|winrestore|winset|winsettitle|winshow|winwait|winwaitactive|winwaitclose|winwaitnotactive)\\b', - caseInsensitive: true }, - { token: 'keyword.control.ahk', - regex: '(?:\\b|^)(?:if|else|return|loop|break|for|while|global|local|byref)\\b', - caseInsensitive: true }, - { token: 'support.function.ahk', - regex: '(?:\\b|^)(?:abs|acos|asc|asin|atan|ceil|chr|cos|dllcall|exp|fileexist|floor|getkeystate|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist)\\b', - caseInsensitive: true }, - { token: 'variable.predefined.ahk', - regex: '(?:\\b|^)(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\\b', - caseInsensitive: true }, - { token: 'support.constant.ahk', - regex: '(?:\\b|^)(?:shift|lshift|rshift|alt|lalt|ralt|control|lcontrol|rcontrol|ctrl|lctrl|rctrl|lwin|rwin|appskey|altdown|altup|shiftdown|shiftup|ctrldown|ctrlup|lwindown|lwinup|rwindown|rwinup|lbutton|rbutton|mbutton|wheelup|wheelleft|wheelright|wheeldown|xbutton1|xbutton2|joy1|joy2|joy3|joy4|joy5|joy6|joy7|joy8|joy9|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy30|joy31|joy32|joyx|joyy|joyz|joyr|joyu|joyv|joypov|joyname|joybuttons|joyaxes|joyinfo|space|tab|enter|escape|esc|backspace|bs|delete|del|insert|ins|pgup|pgdn|home|end|up|down|left|right|printscreen|ctrlbreak|pause|scrolllock|capslock|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadmult|numpadadd|numpadsub|numpaddiv|numpaddot|numpaddel|numpadins|numpadclear|numpadup|numpaddown|numpadleft|numpadright|numpadhome|numpadend|numpadpgup|numpadpgdn|numpadenter|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|browser_back|browser_forward|browser_refresh|browser_stop|browser_search|browser_favorites|browser_home|volume_mute|volume_down|volume_up|media_next|media_prev|media_stop|media_play_pause|launch_mail|launch_media|launch_app1|launch_app2)\\b', - caseInsensitive: true }, - { token: 'variable.parameter', - regex: '(?:\\b|^)(?:pixel|mouse|screen|relative|rgb|ltrim|rtrim|join|low|belownormal|normal|abovenormal|high|realtime|ahk_id|ahk_pid|ahk_class|ahk_group|between|contains|in|is|integer|float|integerfast|floatfast|number|digit|xdigit|alpha|upper|lower|alnum|time|date|not|or|and|alwaysontop|topmost|top|bottom|transparent|transcolor|redraw|region|id|idlast|processname|minmax|controllist|count|list|capacity|statuscd|eject|lock|unlock|label|filesystem|label|setlabel|serial|type|status|static|seconds|minutes|hours|days|read|parse|logoff|close|error|single|tray|add|rename|check|uncheck|togglecheck|enable|disable|toggleenable|default|nodefault|standard|nostandard|color|delete|deleteall|icon|noicon|tip|click|show|mainwindow|nomainwindow|useerrorlevel|text|picture|pic|groupbox|button|checkbox|radio|dropdownlist|ddl|combobox|listbox|listview|datetime|monthcal|updown|slider|tab|tab2|statusbar|treeview|iconsmall|tile|report|sortdesc|nosort|nosorthdr|grid|hdr|autosize|range|xm|ym|ys|xs|xp|yp|font|resize|owner|submit|nohide|minimize|maximize|restore|noactivate|na|cancel|destroy|center|margin|maxsize|minsize|owndialogs|guiescape|guiclose|guisize|guicontextmenu|guidropfiles|tabstop|section|altsubmit|wrap|hscroll|vscroll|border|top|bottom|buttons|expand|first|imagelist|lines|wantctrla|wantf2|vis|visfirst|number|uppercase|lowercase|limit|password|multi|wantreturn|group|background|bold|italic|strike|underline|norm|backgroundtrans|theme|caption|delimiter|minimizebox|maximizebox|sysmenu|toolwindow|flash|style|exstyle|check3|checked|checkedgray|readonly|password|hidden|left|right|center|notab|section|move|focus|hide|choose|choosestring|text|pos|enabled|disabled|visible|lastfound|lastfoundexist|alttab|shiftalttab|alttabmenu|alttabandmenu|alttabmenudismiss|notimers|interrupt|priority|waitclose|blind|raw|unicode|deref|pow|bitnot|bitand|bitor|bitxor|bitshiftleft|bitshiftright|yes|no|ok|cancel|abort|retry|ignore|tryagain|on|off|all|hkey_local_machine|hkey_users|hkey_current_user|hkey_classes_root|hkey_current_config|hklm|hku|hkcu|hkcr|hkcc|reg_sz|reg_expand_sz|reg_multi_sz|reg_dword|reg_qword|reg_binary|reg_link|reg_resource_list|reg_full_resource_descriptor|reg_resource_requirements_list|reg_dword_big_endian)\\b', - caseInsensitive: true }, - { keywordMap: {"constant.language": autoItKeywords}, regex: '\\w+\\b'}, - { keywordMap: {"variable.function": atKeywords}, regex: '@\\w+\\b'}, - { token : "constant.numeric", regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, - { token: 'keyword.operator.ahk', - regex: '=|==|<>|:=|<|>|\\*|\\/|\\+|:|\\?|\\-' }, - { token: 'punctuation.ahk', - regex: '#|`|::|,|\\{|\\}|\\(|\\)|\\%' }, - { token: - [ 'punctuation.quote.double', - 'string.quoted.ahk', - 'punctuation.quote.double' ], - regex: '(")((?:[^"]|"")*)(")' }, - { token: [ 'label.ahk', 'punctuation.definition.label.ahk' ], - regex: '^([^: ]+)(:)(?!:)' } ] } - - this.normalizeRules(); -}; - -AutoHotKeyHighlightRules.metaData = { name: 'AutoHotKey', - scopeName: 'source.ahk', - fileTypes: [ 'ahk' ], - foldingStartMarker: '^\\s*/\\*|^(?![^{]*?;|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|;|/\\*(?!.*?\\*/.*\\S))', - foldingStopMarker: '^\\s*\\*/|^\\s*\\}' } - - -oop.inherits(AutoHotKeyHighlightRules, TextHighlightRules); - -exports.AutoHotKeyHighlightRules = AutoHotKeyHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-batchfile.js b/util/build-sample-browser/player/vendor/ace/mode-batchfile.js deleted file mode 100644 index 7cc45296b1..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-batchfile.js +++ /dev/null @@ -1,213 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/batchfile', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/batchfile_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = BatchFileHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "::"; - this.blockComment = ""; - this.$id = "ace/mode/batchfile"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/batchfile_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var BatchFileHighlightRules = function() { - - this.$rules = { start: - [ { token: 'keyword.command.dosbatch', - regex: '\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b', - caseInsensitive: true }, - { token: 'keyword.control.statement.dosbatch', - regex: '\\b(?:goto|call|exit)\\b', - caseInsensitive: true }, - { token: 'keyword.control.conditional.if.dosbatch', - regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b', - caseInsensitive: true }, - { token: 'keyword.control.conditional.dosbatch', - regex: '\\b(?:if|else)\\b', - caseInsensitive: true }, - { token: 'keyword.control.repeat.dosbatch', - regex: '\\bfor\\b', - caseInsensitive: true }, - { token: 'keyword.operator.dosbatch', - regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' }, - { token: ['doc.comment', 'comment'], - regex: '(?:^|\\b)(rem)($|\\s.*$)', - caseInsensitive: true }, - { token: 'comment.line.colons.dosbatch', - regex: '::.*$' }, - { include: 'variable' }, - { token: 'punctuation.definition.string.begin.shell', - regex: '"', - push: [ - { token: 'punctuation.definition.string.end.shell', regex: '"', next: 'pop' }, - { include: 'variable' }, - { defaultToken: 'string.quoted.double.dosbatch' } ] }, - { token: 'keyword.operator.pipe.dosbatch', regex: '[|]' }, - { token: 'keyword.operator.redirect.shell', - regex: '&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>' } ], - variable: [ - { token: 'constant.numeric', regex: '%%\\w+|%[*\\d]|%\\w+%'}, - { token: 'constant.numeric', regex: '%~\\d+'}, - { token: ['markup.list', 'constant.other', 'markup.list'], - regex: '(%)(\\w+)(%?)' }]} - - this.normalizeRules(); -}; - -BatchFileHighlightRules.metaData = { name: 'Batch File', - scopeName: 'source.dosbatch', - fileTypes: [ 'bat' ] } - - -oop.inherits(BatchFileHighlightRules, TextHighlightRules); - -exports.BatchFileHighlightRules = BatchFileHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-c9search.js b/util/build-sample-browser/player/vendor/ace/mode-c9search.js deleted file mode 100644 index 3d554d14f8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-c9search.js +++ /dev/null @@ -1,308 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/c9search', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c9search_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/c9search'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var C9StyleFoldMode = require("./folding/c9search").FoldMode; - -var Mode = function() { - this.HighlightRules = C9SearchHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new C9StyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/c9search"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/c9search_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -function safeCreateRegexp(source, flag) { - try { - return new RegExp(source, flag); - } catch(e) {} -} - -var C9SearchHighlightRules = function() { - this.$rules = { - "start" : [ - { - tokenNames : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"], - regex : "(^\\s+[0-9]+)(:\\s)(.+)", - onMatch : function(val, state, stack) { - var values = this.splitRegex.exec(val); - var types = this.tokenNames; - var tokens = [{ - type: types[0], - value: values[1] - },{ - type: types[1], - value: values[2] - }]; - - var regex = stack[1]; - var str = values[3]; - - var m; - var last = 0; - if (regex && regex.exec) { - regex.lastIndex = 0; - while (m = regex.exec(str)) { - var skipped = str.substring(last, m.index); - last = regex.lastIndex; - if (skipped) - tokens.push({type: types[2], value: skipped}); - if (m[0]) - tokens.push({type: types[3], value: m[0]}); - else if (!skipped) - break; - } - } - if (last < str.length) - tokens.push({type: types[2], value: str.substr(last)}); - return tokens; - } - }, - { - token : ["string", "text"], // single line - regex : "(\\S.*)(:$)" - }, - { - regex : "Searching for .*$", - onMatch: function(val, state, stack) { - var parts = val.split("\x01"); - if (parts.length < 3) - return "text"; - - var options, search, replace; - - var i = 0; - var tokens = [{ - value: parts[i++] + "'", - type: "text" - }, { - value: search = parts[i++], - type: "text" // "c9searchresults.keyword" - }, { - value: "'" + parts[i++], - type: "text" - }]; - if (parts[2] !== " in") { - replace = parts[i]; - tokens.push({ - value: "'" + parts[i++] + "'", - type: "text" - }, { - value: parts[i++], - type: "text" - }); - } - tokens.push({ - value: " " + parts[i++] + " ", - type: "text" - }); - if (parts[i+1]) { - options = parts[i+1]; - tokens.push({ - value: "(" + parts[i+1] + ")", - type: "text" - }); - i += 1; - } else { - i -= 1; - } - while (i++ < parts.length) { - parts[i] && tokens.push({ - value: parts[i], - type: "text" - }); - } - - if (replace) { - search = replace; - options = ""; - } - - if (search) { - if (!/regex/.test(options)) - search = lang.escapeRegExp(search); - if (/whole/.test(options)) - search = "\\b" + search + "\\b"; - } - - var regex = search && safeCreateRegexp( - "(" + search + ")", - / sensitive/.test(options) ? "g" : "ig" - ); - if (regex) { - stack[0] = state; - stack[1] = regex; - } - - return tokens; - } - }, - { - regex : "\\d+", - token: "constant.numeric" - } - ] - }; -}; - -oop.inherits(C9SearchHighlightRules, TextHighlightRules); - -exports.C9SearchHighlightRules = C9SearchHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - - -ace.define('ace/mode/folding/c9search', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /^(\S.*\:|Searching for.*)$/; - this.foldingStopMarker = /^(\s+|Found.*)$/; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var lines = session.doc.getAllLines(row); - var line = lines[row]; - var level1 = /^(Found.*|Searching for.*)$/; - var level2 = /^(\S.*\:|\s*)$/; - var re = level1.test(line) ? level1 : level2; - - var startRow = row; - var endRow = row; - - if (this.foldingStartMarker.test(line)) { - for (var i = row + 1, l = session.getLength(); i < l; i++) { - if (re.test(lines[i])) - break; - } - endRow = i; - } - else if (this.foldingStopMarker.test(line)) { - for (var i = row - 1; i >= 0; i--) { - line = lines[i]; - if (re.test(line)) - break; - } - startRow = i; - } - if (startRow != endRow) { - var col = line.length; - if (re === level1) - col = line.search(/\(Found[^)]+\)$|$/); - return new Range(startRow, col, endRow, 0); - } - }; - -}).call(FoldMode.prototype); - -}); - diff --git a/util/build-sample-browser/player/vendor/ace/mode-c_cpp.js b/util/build-sample-browser/player/vendor/ace/mode-c_cpp.js deleted file mode 100644 index 1b5a74c3c9..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-c_cpp.js +++ /dev/null @@ -1,816 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/c_cpp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c_cpp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = c_cppHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/c_cpp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/c_cpp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" - -var c_cppHighlightRules = function() { - - var keywordControls = ( - "break|case|continue|default|do|else|for|goto|if|_Pragma|" + - "return|switch|while|catch|operator|try|throw|using" - ); - - var storageType = ( - "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + - "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + - "class|wchar_t|template" - ); - - var storageModifiers = ( - "const|extern|register|restrict|static|volatile|inline|private:|" + - "protected:|public:|friend|explicit|virtual|export|mutable|typename" - ); - - var keywordOperators = ( - "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + - "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" - ); - - var builtinConstants = ( - "NULL|true|false|TRUE|FALSE" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.control" : keywordControls, - "storage.type" : storageType, - "storage.modifier" : storageModifiers, - "keyword.operator" : keywordOperators, - "variable.language": "this", - "constant.language": builtinConstants - }, "identifier"); - - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "keyword", // pre-compiler directives - regex : "#\\s*(?:include|import|pragma|line|define|undef|if|ifdef|else|elif|ifndef)\\b", - next : "directive" - }, { - token : "keyword", // special case pre-compiler directive - regex : "(?:#\\s*endif)\\b" - }, { - token : "support.function.C99.c", - regex : cFunctions - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "directive" : [ - { - token : "constant.other.multiline", - regex : /\\/ - }, - { - token : "constant.other.multiline", - regex : /.*\\/ - }, - { - token : "constant.other", - regex : "\\s*<.+?>", - next : "start" - }, - { - token : "constant.other", // single line - regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', - next : "start" - }, - { - token : "constant.other", // single line - regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", - next : "start" - }, - { - token : "constant.other", - regex : /[^\\\/]+/, - next : "start" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(c_cppHighlightRules, TextHighlightRules); - -exports.c_cppHighlightRules = c_cppHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-cirru.js b/util/build-sample-browser/player/vendor/ace/mode-cirru.js deleted file mode 100644 index 7abc0d22ad..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-cirru.js +++ /dev/null @@ -1,233 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2014, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/cirru', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/cirru_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CirruHighlightRules = require("./cirru_highlight_rules").CirruHighlightRules; -var CoffeeFoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = CirruHighlightRules; - this.foldingRules = new CoffeeFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "--"; - this.$id = "ace/mode/cirru"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/cirru_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var CirruHighlightRules = function() { - this.$rules = { - start: [{ - token: 'constant.numeric', - regex: /[\d\.]+/ - }, { - token: 'comment.line.double-dash', - regex: /--/, - next: 'comment', - }, { - token: 'storage.modifier', - regex: /\(/, - }, { - token: 'storage.modifier', - regex: /\,/, - next: 'line', - }, { - token: 'support.function', - regex: /[^\(\)\"\s]+/, - next: 'line' - }, { - token: 'string.quoted.double', - regex: /"/, - next: 'string', - }, { - token: 'storage.modifier', - regex: /\)/, - }], - comment: [{ - token: 'comment.line.double-dash', - regex: /\ +[^\n]+/, - next: 'start', - }], - string: [{ - token: 'string.quoted.double', - regex: /"/, - next: 'line', - }, { - token: 'constant.character.escape', - regex: /\\/, - next: 'escape', - }, { - token: 'string.quoted.double', - regex: /[^\\\"]+/, - }], - escape: [{ - token: 'constant.character.escape', - regex: /./, - next: 'string', - }], - line: [{ - token: 'constant.numeric', - regex: /[\d\.]+/ - }, { - token: 'markup.raw', - regex: /^\s*/, - next: 'start', - }, { - token: 'storage.modifier', - regex: /\$/, - next: 'start', - }, { - token: 'variable.parameter', - regex: /[^\(\)\"\s]+/ - }, { - token: 'storage.modifier', - regex: /\(/, - next: 'start' - }, { - token: 'storage.modifier', - regex: /\)/, - }, { - token: 'markup.raw', - regex: /^\ */, - next: 'start', - }, { - token: 'string.quoted.double', - regex: /"/, - next: 'string', - }] - } - -}; - -oop.inherits(CirruHighlightRules, TextHighlightRules); - -exports.CirruHighlightRules = CirruHighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-clojure.js b/util/build-sample-browser/player/vendor/ace/mode-clojure.js deleted file mode 100644 index 78cfc88438..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-clojure.js +++ /dev/null @@ -1,300 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/clojure', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/clojure_highlight_rules', 'ace/mode/matching_parens_outdent', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ClojureHighlightRules = require("./clojure_highlight_rules").ClojureHighlightRules; -var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = ClojureHighlightRules; - this.$outdent = new MatchingParensOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ";"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/[\(\[]/); - if (match) { - indent += " "; - } - match = line.match(/[\)]/); - if (match) { - indent = ""; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/clojure"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/clojure_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - - -var ClojureHighlightRules = function() { - - var builtinFunctions = ( - '* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' + - '*command-line-args* *compile-files* *compile-path* *e *err* *file* ' + - '*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' + - '*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' + - '*read-eval* *source-path* *use-context-classloader* ' + - '*warn-on-reflection* + - -> ->> .. / < <= = ' + - '== > > >= >= accessor aclone ' + - 'add-classpath add-watch agent agent-errors aget alength alias all-ns ' + - 'alter alter-meta! alter-var-root amap ancestors and apply areduce ' + - 'array-map aset aset-boolean aset-byte aset-char aset-double aset-float ' + - 'aset-int aset-long aset-short assert assoc assoc! assoc-in associative? ' + - 'atom await await-for await1 bases bean bigdec bigint binding bit-and ' + - 'bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left ' + - 'bit-shift-right bit-test bit-xor boolean boolean-array booleans ' + - 'bound-fn bound-fn* butlast byte byte-array bytes cast char char-array ' + - 'char-escape-string char-name-string char? chars chunk chunk-append ' + - 'chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? ' + - 'class class? clear-agent-errors clojure-version coll? comment commute ' + - 'comp comparator compare compare-and-set! compile complement concat cond ' + - 'condp conj conj! cons constantly construct-proxy contains? count ' + - 'counted? create-ns create-struct cycle dec decimal? declare definline ' + - 'defmacro defmethod defmulti defn defn- defonce defstruct delay delay? ' + - 'deliver deref derive descendants destructure disj disj! dissoc dissoc! ' + - 'distinct distinct? doall doc dorun doseq dosync dotimes doto double ' + - 'double-array doubles drop drop-last drop-while empty empty? ensure ' + - 'enumeration-seq eval even? every? false? ffirst file-seq filter find ' + - 'find-doc find-ns find-var first float float-array float? floats flush ' + - 'fn fn? fnext for force format future future-call future-cancel ' + - 'future-cancelled? future-done? future? gen-class gen-interface gensym ' + - 'get get-in get-method get-proxy-class get-thread-bindings get-validator ' + - 'hash hash-map hash-set identical? identity if-let if-not ifn? import ' + - 'in-ns inc init-proxy instance? int int-array integer? interleave intern ' + - 'interpose into into-array ints io! isa? iterate iterator-seq juxt key ' + - 'keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list ' + - 'list* list? load load-file load-reader load-string loaded-libs locking ' + - 'long long-array longs loop macroexpand macroexpand-1 make-array ' + - 'make-hierarchy map map? mapcat max max-key memfn memoize merge ' + - 'merge-with meta method-sig methods min min-key mod name namespace neg? ' + - 'newline next nfirst nil? nnext not not-any? not-empty not-every? not= ' + - 'ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ' + - 'ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? ' + - 'or parents partial partition pcalls peek persistent! pmap pop pop! ' + - 'pop-thread-bindings pos? pr pr-str prefer-method prefers ' + - 'primitives-classnames print print-ctor print-doc print-dup print-method ' + - 'print-namespace-doc print-simple print-special-doc print-str printf ' + - 'println println-str prn prn-str promise proxy proxy-call-with-super ' + - 'proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot ' + - 'rand rand-int range ratio? rational? rationalize re-find re-groups ' + - 're-matcher re-matches re-pattern re-seq read read-line read-string ' + - 'reduce ref ref-history-count ref-max-history ref-min-history ref-set ' + - 'refer refer-clojure release-pending-sends rem remove remove-method ' + - 'remove-ns remove-watch repeat repeatedly replace replicate require ' + - 'reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq ' + - 'rsubseq second select-keys send send-off seq seq? seque sequence ' + - 'sequential? set set-validator! set? short short-array shorts ' + - 'shutdown-agents slurp some sort sort-by sorted-map sorted-map-by ' + - 'sorted-set sorted-set-by sorted? special-form-anchor special-symbol? ' + - 'split-at split-with str stream? string? struct struct-map subs subseq ' + - 'subvec supers swap! symbol symbol? sync syntax-symbol-anchor take ' + - 'take-last take-nth take-while test the-ns time to-array to-array-2d ' + - 'trampoline transient tree-seq true? type unchecked-add unchecked-dec ' + - 'unchecked-divide unchecked-inc unchecked-multiply unchecked-negate ' + - 'unchecked-remainder unchecked-subtract underive unquote ' + - 'unquote-splicing update-in update-proxy use val vals var-get var-set ' + - 'var? vary-meta vec vector vector? when when-first when-let when-not ' + - 'while with-bindings with-bindings* with-in-str with-loading-context ' + - 'with-local-vars with-meta with-open with-out-str with-precision xml-seq ' + - 'zero? zipmap' - ); - - var keywords = ('throw try var ' + - 'def do fn if let loop monitor-enter monitor-exit new quote recur set!' - ); - - var buildinConstants = ("true false nil"); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": buildinConstants, - "support.function": builtinFunctions - }, "identifier", false, " "); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : ";.*$" - }, { - token : "keyword", //parens - regex : "[\\(|\\)]" - }, { - token : "keyword", //lists - regex : "[\\'\\(]" - }, { - token : "keyword", //vectors - regex : "[\\[|\\]]" - }, { - token : "keyword", //sets and maps - regex : "[\\{|\\}|\\#\\{|\\#\\}]" - }, { - token : "keyword", // ampersands - regex : '[\\&]' - }, { - token : "keyword", // metadata - regex : '[\\#\\^\\{]' - }, { - token : "keyword", // anonymous fn syntactic sugar - regex : '[\\%]' - }, { - token : "keyword", // deref reader macro - regex : '[@]' - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language", - regex : '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]' - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b" - }, { - token : "string", // single line - regex : '"', - next: "string" - }, { - token : "constant", // symbol - regex : /:[^()\[\]{}'"\^%`,;\s]+/ - }, { - token : "string.regexp", //Regular Expressions - regex : '/#"(?:\\.|(?:\\\")|[^\""\n])*"/g' - } - - ], - "string" : [ - { - token : "constant.language.escape", - regex : "\\\\.|\\\\$" - }, { - token : "string", - regex : '[^"\\\\]+' - }, { - token : "string", - regex : '"', - next : "start" - } - ] - }; -}; - -oop.inherits(ClojureHighlightRules, TextHighlightRules); - -exports.ClojureHighlightRules = ClojureHighlightRules; -}); - -ace.define('ace/mode/matching_parens_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingParensOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\)/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\))/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - var match = line.match(/^(\s+)/); - if (match) { - return match[1]; - } - - return ""; - }; - -}).call(MatchingParensOutdent.prototype); - -exports.MatchingParensOutdent = MatchingParensOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-cobol.js b/util/build-sample-browser/player/vendor/ace/mode-cobol.js deleted file mode 100644 index 621472cbbb..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-cobol.js +++ /dev/null @@ -1,125 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/cobol', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/cobol_highlight_rules', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = CobolHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "*"; - - this.$id = "ace/mode/cobol"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/cobol_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var CobolHighlightRules = function() { -var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" + -"AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" + -"ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" + -"TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" + -"UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" + -"PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" + -"CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" + -"COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" + -"RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" + -"DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" + -"ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" + -"EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT"; - - var builtinConstants = ( - "true|false|null" - ); - - var builtinFunctions = ( - "count|min|max|avg|sum|rank|now|coalesce|main" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "keyword": keywords, - "constant.language": builtinConstants - }, "identifier", true); - - this.$rules = { - "start" : [ { - token : "comment", - regex : "\\*.*$" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "string", // ' string - regex : "'.*?'" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } ] - }; -}; - -oop.inherits(CobolHighlightRules, TextHighlightRules); - -exports.CobolHighlightRules = CobolHighlightRules; -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/mode-coffee.js b/util/build-sample-browser/player/vendor/ace/mode-coffee.js deleted file mode 100644 index c30c1d3e8d..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-coffee.js +++ /dev/null @@ -1,444 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/coffee', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/coffee_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/coffee', 'ace/range', 'ace/mode/text', 'ace/worker/worker_client', 'ace/lib/oop'], function(require, exports, module) { - - -var Tokenizer = require("../tokenizer").Tokenizer; -var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules; -var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var FoldMode = require("./folding/coffee").FoldMode; -var Range = require("../range").Range; -var TextMode = require("./text").Mode; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var oop = require("../lib/oop"); - -function Mode() { - this.HighlightRules = Rules; - this.$outdent = new Outdent(); - this.foldingRules = new FoldMode(); -} - -oop.inherits(Mode, TextMode); - -(function() { - - var indenter = /(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/; - var commentLine = /^(\s*)#/; - var hereComment = /^\s*###(?!#)/; - var indentation = /^\s*/; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - - if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') && - state === 'start' && indenter.test(line)) - indent += tab; - return indent; - }; - - this.toggleCommentLines = function(state, doc, startRow, endRow){ - console.log("toggle"); - var range = new Range(0, 0, 0, 0); - for (var i = startRow; i <= endRow; ++i) { - var line = doc.getLine(i); - if (hereComment.test(line)) - continue; - - if (commentLine.test(line)) - line = line.replace(commentLine, '$1'); - else - line = line.replace(indentation, '$&#'); - - range.end.row = range.start.row = i; - range.end.column = line.length + 1; - doc.replace(range, line); - } - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("error", function(e) { - session.setAnnotations([e.data]); - }); - - worker.on("ok", function(e) { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/coffee"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/coffee_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - - var oop = require("../lib/oop"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - oop.inherits(CoffeeHighlightRules, TextHighlightRules); - - function CoffeeHighlightRules() { - var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; - - var keywords = ( - "this|throw|then|try|typeof|super|switch|return|break|by|continue|" + - "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" + - "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" + - "or|on|unless|until|and|yes" - ); - - var langConstant = ( - "true|false|null|undefined|NaN|Infinity" - ); - - var illegal = ( - "case|const|default|function|var|void|with|enum|export|implements|" + - "interface|let|package|private|protected|public|static|yield|" + - "__hasProp|slice|bind|indexOf" - ); - - var supportClass = ( - "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + - "SyntaxError|TypeError|URIError|" + - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray" - ); - - var supportFunction = ( - "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + - "encodeURIComponent|decodeURI|decodeURIComponent|String|" - ); - - var variableLanguage = ( - "window|arguments|prototype|document" - ); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": langConstant, - "invalid.illegal": illegal, - "language.support.class": supportClass, - "language.support.function": supportFunction, - "variable.language": variableLanguage - }, "identifier"); - - var functionRule = { - token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], - regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source - }; - - var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; - - this.$rules = { - start : [ - { - token : "constant.numeric", - regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" - }, { - stateName: "qdoc", - token : "string", regex : "'''", next : [ - {token : "string", regex : "'''", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qqdoc", - token : "string", - regex : '"""', - next : [ - {token : "string", regex : '"""', next : "start"}, - {token : "paren.string", regex : '#{', push : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qstring", - token : "string", regex : "'", next : [ - {token : "string", regex : "'", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qqstring", - token : "string.start", regex : '"', next : [ - {token : "string.end", regex : '"', next : "start"}, - {token : "paren.string", regex : '#{', push : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "js", - token : "string", regex : "`", next : [ - {token : "string", regex : "`", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - regex: "[{}]", onMatch: function(val, state, stack) { - this.next = ""; - if (val == "{" && stack.length) { - stack.unshift("start", state); - return "paren"; - } - if (val == "}" && stack.length) { - stack.shift(); - this.next = stack.shift(); - if (this.next.indexOf("string") != -1) - return "paren.string"; - } - return "paren"; - } - }, { - token : "string.regex", - regex : "///", - next : "heregex" - }, { - token : "string.regex", - regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ - }, { - token : "comment", - regex : "###(?!#)", - next : "comment" - }, { - token : "comment", - regex : "#.*" - }, { - token : ["punctuation.operator", "text", "identifier"], - regex : "(\\.)(\\s*)(" + illegal + ")" - }, { - token : "punctuation.operator", - regex : "\\." - }, { - token : ["keyword", "text", "language.support.class", - "text", "keyword", "text", "language.support.class"], - regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?" - }, { - token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token), - regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex - }, - functionRule, - { - token : "variable", - regex : "@(?:" + identifier + ")?" - }, { - token: keywordMapper, - regex : identifier - }, { - token : "punctuation.operator", - regex : "\\,|\\." - }, { - token : "storage.type", - regex : "[\\-=]>" - }, { - token : "keyword.operator", - regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" - }, { - token : "paren.lparen", - regex : "[({[]" - }, { - token : "paren.rparen", - regex : "[\\]})]" - }, { - token : "text", - regex : "\\s+" - }], - - - heregex : [{ - token : "string.regex", - regex : '.*?///[imgy]{0,4}', - next : "start" - }, { - token : "comment.regex", - regex : "\\s+(?:#.*)?" - }, { - token : "string.regex", - regex : "\\S+" - }], - - comment : [{ - token : "comment", - regex : '###', - next : "start" - }, { - defaultToken : "comment" - }] - }; - this.normalizeRules(); - } - - exports.CoffeeHighlightRules = CoffeeHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-coldfusion.js b/util/build-sample-browser/player/vendor/ace/mode-coldfusion.js deleted file mode 100644 index 0029b31a89..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-coldfusion.js +++ /dev/null @@ -1,2052 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/coldfusion', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/coldfusion_highlight_rules', 'ace/mode/behaviour/coldfusion'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var XmlMode = require("./xml").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules; -var CfmlBehaviour = require("./behaviour/coldfusion").CfmlBehaviour; - -var Mode = function() { - XmlMode.call(this); - - this.HighlightRules = ColdfusionHighlightRules; - this.$behaviour = new CfmlBehaviour(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); -}; -oop.inherits(Mode, XmlMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.$id = "ace/mode/coldfusion"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == ' indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/coldfusion_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript_highlight_rules', 'ace/mode/html_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - -var ColdfusionHighlightRules = function() { - HtmlHighlightRules.call(this); - - this.embedTagRules(JavaScriptHighlightRules, "cfjs-", "cfscript"); - - this.normalizeRules(); -}; - -oop.inherits(ColdfusionHighlightRules, HtmlHighlightRules); - -exports.ColdfusionHighlightRules = ColdfusionHighlightRules; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; -var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; -var XmlFoldMode = require("./folding/xml").FoldMode; - -var Mode = function() { - this.HighlightRules = XmlHighlightRules; - this.$behaviour = new XmlBehaviour(); - this.foldingRules = new XmlFoldMode(); -}; - -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.$id = "ace/mode/xml"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/behaviour/coldfusion', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var hasType = true; - var typeList = token.type.split('.'); - var needleList = type.split('.'); - needleList.forEach(function(needle){ - if (typeList.indexOf(needle) == -1) { - hasType = false; - return false; - } - }); - return hasType; -} - -var CfmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'meta.tag.name') && /^cf+(abort|application|argument|associate|break|cache|collection|cookie|dbinfo|directory|dump|else|elseif|error|exchangecalendar|exchangeconnection|exchangecontact|exchangefilter|exchangetask|exit|feed|file|flush|ftp|header|htmlhead|httpparam|image|import|include|index|insert|invokeargument|location|log|mailparam|NTauthenticate|object|objectcache|param|pdfformparam|print|procparam|procresult|property|queryparam|registry|reportparam|rethrow|return|schedule|search|set|setting|throw|zipparam)$/gi.test(token.value)) - return; - if (hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(CfmlBehaviour, XmlBehaviour); - -exports.CfmlBehaviour = CfmlBehaviour; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-csharp.js b/util/build-sample-browser/player/vendor/ace/mode-csharp.js deleted file mode 100644 index 2aa7c0fdee..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-csharp.js +++ /dev/null @@ -1,801 +0,0 @@ -ace.define('ace/mode/csharp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/csharp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/csharp'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CSharpHighlightRules = require("./csharp_highlight_rules").CSharpHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/csharp").FoldMode; - -var Mode = function() { - this.HighlightRules = CSharpHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - - this.createWorker = function(session) { - return null; - }; - - this.$id = "ace/mode/csharp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/csharp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var CSharpHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": "abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic", - "constant.language": "null|true|false" - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", // character - regex : /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))'/ - }, { - token : "string", start : '"', end : '"|$', next: [ - {token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/}, - {token: "invalid", regex: /\\./} - ] - }, { - token : "string", start : '@"', end : '"', next:[ - {token: "constant.language.escape", regex: '""'} - ] - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "keyword", - regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); - this.normalizeRules(); -}; - -oop.inherits(CSharpHighlightRules, TextHighlightRules); - -exports.CSharpHighlightRules = CSharpHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/csharp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var CFoldMode = require("./cstyle").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, CFoldMode); - -(function() { - this.usingRe = /^\s*using \S/; - - this.getFoldWidgetRangeBase = this.getFoldWidgetRange; - this.getFoldWidgetBase = this.getFoldWidget; - - this.getFoldWidget = function(session, foldStyle, row) { - var fw = this.getFoldWidgetBase(session, foldStyle, row); - if (!fw) { - var line = session.getLine(row); - if (/^\s*#region\b/.test(line)) - return "start"; - var usingRe = this.usingRe; - if (usingRe.test(line)) { - var prev = session.getLine(row - 1); - var next = session.getLine(row + 1); - if (!usingRe.test(prev) && usingRe.test(next)) - return "start" - } - } - return fw; - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.getFoldWidgetRangeBase(session, foldStyle, row); - if (range) - return range; - - var line = session.getLine(row); - if (this.usingRe.test(line)) - return this.getUsingStatementBlock(session, line, row); - - if (/^\s*#region\b/.test(line)) - return this.getRegionBlock(session, line, row); - }; - - this.getUsingStatementBlock = function(session, line, row) { - var startColumn = line.match(this.usingRe)[0].length - 1; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - if (/^\s*$/.test(line)) - continue; - if (!this.usingRe.test(line)) - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - - this.getRegionBlock = function(session, line, row) { - var startColumn = line.search(/\s*$/); - var maxRow = session.getLength(); - var startRow = row; - - var re = /^\s*#(end)?region\b/ - var depth = 1 - while (++row < maxRow) { - line = session.getLine(row); - var m = re.exec(line); - if (!m) - continue; - if (m[1]) - depth--; - else - depth++; - - if (!depth) - break; - } - - var endRow = row; - if (endRow > startRow) { - var endColumn = line.search(/\S/); - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-css.js b/util/build-sample-browser/player/vendor/ace/mode-css.js deleted file mode 100644 index 66d78f18ce..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-css.js +++ /dev/null @@ -1,815 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-curly.js b/util/build-sample-browser/player/vendor/ace/mode-curly.js deleted file mode 100644 index dfb4f8c5c8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-curly.js +++ /dev/null @@ -1,2475 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Libo Cannici - * - * - * - * ***** END LICENSE BLOCK ***** */ -ace.define('ace/mode/curly', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/matching_brace_outdent', 'ace/mode/html_highlight_rules', 'ace/mode/folding/html', 'ace/mode/curly_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlMode = require("./html").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlFoldMode = require("./folding/html").FoldMode; -var CurlyHighlightRules = require("./curly_highlight_rules").CurlyHighlightRules; - -var Mode = function() { - HtmlMode.call(this); - this.HighlightRules = CurlyHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, HtmlMode); - -(function() { - this.$id = "ace/mode/curly"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/curly_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - - -var CurlyHighlightRules = function() { - HtmlHighlightRules.call(this); - - this.$rules["start"].unshift({ - token: "variable", - regex: "{{", - push: "curly-start" - }); - - this.$rules["curly-start"] = [{ - token: "variable", - regex: "}}", - next: "pop" - }]; - - this.normalizeRules(); -}; - -oop.inherits(CurlyHighlightRules, HtmlHighlightRules); - -exports.CurlyHighlightRules = CurlyHighlightRules; - -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-d.js b/util/build-sample-browser/player/vendor/ace/mode-d.js deleted file mode 100644 index 3b0c97ec86..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-d.js +++ /dev/null @@ -1,492 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/d', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/d_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var DHighlightRules = require("./d_highlight_rules").DHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = DHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "/\\+"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/d"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/d_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DHighlightRules = function() { - - var keywords = ( - "this|super|import|module|body|mixin|__traits|invariant|alias|asm|delete|"+ - "typeof|typeid|sizeof|cast|new|in|is|typedef|__vector|__parameters" - ); - - var keywordControls = ( - "break|case|continue|default|do|else|for|foreach|foreach_reverse|goto|if|" + - "return|switch|while|catch|try|throw|finally|version|assert|unittest|with" - ); - - var types = ( - "auto|bool|char|dchar|wchar|byte|ubyte|float|double|real|" + - "cfloat|creal|cdouble|cent|ifloat|ireal|idouble|" + - "int|long|short|void|uint|ulong|ushort|ucent|" + - "function|delegate|string|wstring|dstring|size_t|ptrdiff_t|hash_t|Object" - ); - - var modifiers = ( - "abstract|align|debug|deprecated|export|extern|const|final|in|inout|out|" + - "ref|immutable|lazy|nothrow|override|package|pragma|private|protected|" + - "public|pure|scope|shared|__gshared|synchronized|static|volatile" - ); - - var storages = ( - "class|struct|union|template|interface|enum|macro" - ); - - var stringEscapesSeq = { - token: "constant.language.escape", - regex: "\\\\(?:(?:x[0-9A-F]{2})|(?:[0-7]{1,3})|(?:['\"\\?0abfnrtv])|" + - "(?:u[0-9a-fA-F]{4})|(?:U[0-9a-fA-F]{8}))" - }; - - var builtinConstants = ( - "null|true|false|"+ - "__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__|"+ - "__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__" - ); - - var operators = ( - "/|/\\=|&|&\\=|&&|\\|\\|\\=|\\|\\||\\-|\\-\\=|\\-\\-|\\+|" + - "\\+\\=|\\+\\+|\\<|\\<\\=|\\<\\<|\\<\\<\\=|\\<\\>|\\<\\>\\=|\\>|\\>\\=|\\>\\>\\=|" + - "\\>\\>\\>\\=|\\>\\>|\\>\\>\\>|\\!|\\!\\=|\\!\\<\\>|\\!\\<\\>\\=|\\!\\<|\\!\\<\\=|" + - "\\!\\>|\\!\\>\\=|\\?|\\$|\\=|\\=\\=|\\*|\\*\\=|%|%\\=|" + - "\\^|\\^\\=|\\^\\^|\\^\\^\\=|~|~\\=|\\=\\>|#" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.modifier" : modifiers, - "keyword.control" : keywordControls, - "keyword.type" : types, - "keyword": keywords, - "keyword.storage": storages, - "punctation": "\\.|\\,|;|\\.\\.|\\.\\.\\.", - "keyword.operator" : operators, - "constant.language": builtinConstants - }, "identifier"); - - var identifierRe = "[a-zA-Z_\u00a1-\uffff][a-zA-Z\\d_\u00a1-\uffff]*\\b"; - - this.$rules = { - "start" : [ - { //-------------------------------------------------------- COMMENTS - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "star-comment" - }, { - token: "comment.shebang", - regex: "^\s*#!.*" - }, { - token : "comment", - regex : "\\/\\+", - next: "plus-comment" - }, { //-------------------------------------------------------- STRINGS - onMatch: function(value, currentState, state) { - state.unshift(this.next, value.substr(2)); - return "string"; - }, - regex: 'q"(?:[\\[\\(\\{\\<]+)', - next: 'operator-heredoc-string' - }, { - onMatch: function(value, currentState, state) { - state.unshift(this.next, value.substr(2)); - return "string"; - }, - regex: 'q"(?:[a-zA-Z_]+)$', - next: 'identifier-heredoc-string' - }, { - token : "string", // multi line string start - regex : '[xr]?"', - next : "quote-string" - }, { - token : "string", // multi line string start - regex : '[xr]?`', - next : "backtick-string" - }, { - token : "string", // single line - regex : "[xr]?['](?:(?:\\\\.)|(?:[^'\\\\]))*?['][cdw]?" - }, { //-------------------------------------------------------- RULES - token: ["keyword", "text", "paren.lparen"], - regex: /(asm)(\s*)({)/, - next: "d-asm" - }, { - token: ["keyword", "text", "paren.lparen", "constant.language"], - regex: "(__traits)(\\s*)(\\()("+identifierRe+")" - }, { // import|module abc - token: ["keyword", "text", "variable.module"], - regex: "(import|module)(\\s+)((?:"+identifierRe+"\\.?)*)" - }, { // storage Name - token: ["keyword.storage", "text", "entity.name.type"], - regex: "("+storages+")(\\s*)("+identifierRe+")" - }, { // alias|typedef foo bar; - token: ["keyword", "text", "variable.storage", "text"], - regex: "(alias|typedef)(\\s*)("+identifierRe+")(\\s*)" - }, { //-------------------------------------------------------- OTHERS - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F_]+(l|ul|u|f|F|L|U|UL)?\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d[\\d_]*(?:(?:\\.[\\d_]*)?(?:[eE][+-]?[\\d_]+)?)?(l|ul|u|f|F|L|U|UL)?\\b" - }, { - token: "entity.other.attribute-name", - regex: "@"+identifierRe - }, { - token : keywordMapper, - regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b" - }, { - token : "keyword.operator", - regex : operators - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\.|\\:" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "star-comment" : [ - { - token : "comment", // closing comment - regex : "\\*\\/", - next : "start" - }, { - defaultToken: 'comment' - } - ], - "plus-comment" : [ - { - token : "comment", // closing comment - regex : "\\+\\/", - next : "start" - }, { - defaultToken: 'comment' - } - ], - - "quote-string" : [ - stringEscapesSeq, - { - token : "string", - regex : '"[cdw]?', - next : "start" - }, { - defaultToken: 'string' - } - ], - - "backtick-string" : [ - stringEscapesSeq, - { - token : "string", - regex : '`[cdw]?', - next : "start" - }, { - defaultToken: 'string' - } - ], - - "operator-heredoc-string": [ - { - onMatch: function(value, currentState, state) { - value = value.substring(value.length-2, value.length-1); - var map = {'>':'<',']':'[',')':'(','}':'{'}; - if(Object.keys(map).indexOf(value) != -1) - value = map[value]; - if(value != state[1]) return "string"; - state.shift(); - state.shift(); - - return "string"; - }, - regex: '(?:[\\]\\)}>]+)"', - next: 'start' - }, { - token: 'string', - regex: '[^\\]\\)}>]+' - } - ], - - "identifier-heredoc-string": [ - { - onMatch: function(value, currentState, state) { - value = value.substring(0, value.length-1); - if(value != state[1]) return "string"; - state.shift(); - state.shift(); - - return "string"; - }, - regex: '^(?:[A-Za-z_][a-zA-Z0-9]+)"', - next: 'start' - }, { - token: 'string', - regex: '[^\\]\\)}>]+' - } - ], - - "d-asm": [ - { - token: "paren.rparen", - regex: "\\}", - next: "start" - }, { - token: 'keyword.instruction', - regex: '[a-zA-Z]+', - next: 'd-asm-instruction' - }, { - token: "text", - regex: "\\s+" - } - ], - 'd-asm-instruction': [ - { - token: 'constant.language', - regex: /AL|AH|AX|EAX|BL|BH|BX|EBX|CL|CH|CX|ECX|DL|DH|DX|EDX|BP|EBP|SP|ESP|DI|EDI|SI|ESI/i - }, { - token: 'identifier', - regex: '[a-zA-Z]+' - }, { - token: 'string', - regex: '".*"' - }, { - token: 'comment', - regex: '//.*$' - }, { - token: 'constant.numeric', - regex: '[0-9.xA-F]+' - }, { - token: 'punctuation.operator', - regex: '\\,' - }, { - token: 'punctuation.operator', - regex: ';', - next: 'd-asm' - }, { - token: 'text', - regex: '\\s+' - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -DHighlightRules.metaData = { - comment: 'D language', - fileTypes: [ 'd', 'di' ], - firstLineMatch: '^#!.*\\b[glr]?dmd\\b.', - foldingStartMarker: '(?x)/\\*\\*(?!\\*)|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))', - foldingStopMarker: '(? indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-dart.js b/util/build-sample-browser/player/vendor/ace/mode-dart.js deleted file mode 100644 index 04bab7c001..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-dart.js +++ /dev/null @@ -1,1023 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/dart', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/c_cpp', 'ace/tokenizer', 'ace/mode/dart_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var CMode = require("./c_cpp").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var DartHighlightRules = require("./dart_highlight_rules").DartHighlightRules; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - CMode.call(this); - this.HighlightRules = DartHighlightRules; - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, CMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/dart"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/c_cpp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c_cpp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = c_cppHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/c_cpp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/c_cpp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" - -var c_cppHighlightRules = function() { - - var keywordControls = ( - "break|case|continue|default|do|else|for|goto|if|_Pragma|" + - "return|switch|while|catch|operator|try|throw|using" - ); - - var storageType = ( - "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + - "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + - "class|wchar_t|template" - ); - - var storageModifiers = ( - "const|extern|register|restrict|static|volatile|inline|private:|" + - "protected:|public:|friend|explicit|virtual|export|mutable|typename" - ); - - var keywordOperators = ( - "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + - "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" - ); - - var builtinConstants = ( - "NULL|true|false|TRUE|FALSE" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.control" : keywordControls, - "storage.type" : storageType, - "storage.modifier" : storageModifiers, - "keyword.operator" : keywordOperators, - "variable.language": "this", - "constant.language": builtinConstants - }, "identifier"); - - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "keyword", // pre-compiler directives - regex : "#\\s*(?:include|import|pragma|line|define|undef|if|ifdef|else|elif|ifndef)\\b", - next : "directive" - }, { - token : "keyword", // special case pre-compiler directive - regex : "(?:#\\s*endif)\\b" - }, { - token : "support.function.C99.c", - regex : cFunctions - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "directive" : [ - { - token : "constant.other.multiline", - regex : /\\/ - }, - { - token : "constant.other.multiline", - regex : /.*\\/ - }, - { - token : "constant.other", - regex : "\\s*<.+?>", - next : "start" - }, - { - token : "constant.other", // single line - regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', - next : "start" - }, - { - token : "constant.other", // single line - regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", - next : "start" - }, - { - token : "constant.other", - regex : /[^\\\/]+/, - next : "start" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(c_cppHighlightRules, TextHighlightRules); - -exports.c_cppHighlightRules = c_cppHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - - -ace.define('ace/mode/dart_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DartHighlightRules = function() { - - var constantLanguage = "true|false|null"; - var variableLanguage = "this|super"; - var keywordControl = "try|catch|finally|throw|break|case|continue|default|do|else|for|if|in|return|switch|while|new"; - var keywordDeclaration = "abstract|class|extends|external|factory|implements|get|native|operator|set|typedef|with"; - var storageModifier = "static|final|const"; - var storageType = "void|bool|num|int|double|dynamic|var|String"; - - var keywordMapper = this.createKeywordMapper({ - "constant.language.dart": constantLanguage, - "variable.language.dart": variableLanguage, - "keyword.control.dart": keywordControl, - "keyword.declaration.dart": keywordDeclaration, - "storage.modifier.dart": storageModifier, - "storage.type.primitive.dart": storageType - }, "identifier"); - - var stringfill = { - token : "string", - regex : ".+" - }; - - this.$rules = - { - "start": [ - { - token : "comment", - regex : /\/\/.*$/ - }, - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, - { - token: ["meta.preprocessor.script.dart"], - regex: "^(#!.*)$" - }, - { - token: "keyword.other.import.dart", - regex: "(?:\\b)(?:library|import|part|of)(?:\\b)" - }, - { - token : ["keyword.other.import.dart", "text"], - regex : "(?:\\b)(prefix)(\\s*:)" - }, - { - regex: "\\bas\\b", - token: "keyword.cast.dart" - }, - { - regex: "\\?|:", - token: "keyword.control.ternary.dart" - }, - { - regex: "(?:\\b)(is\\!?)(?:\\b)", - token: ["keyword.operator.dart"] - }, - { - regex: "(<<|>>>?|~|\\^|\\||&)", - token: ["keyword.operator.bitwise.dart"] - }, - { - regex: "((?:&|\\^|\\||<<|>>>?)=)", - token: ["keyword.operator.assignment.bitwise.dart"] - }, - { - regex: "(===?|!==?|<=?|>=?)", - token: ["keyword.operator.comparison.dart"] - }, - { - regex: "((?:[+*/%-]|\\~)=)", - token: ["keyword.operator.assignment.arithmetic.dart"] - }, - { - regex: "=", - token: "keyword.operator.assignment.dart" - }, - { - token : "string", - regex : "'''", - next : "qdoc" - }, - { - token : "string", - regex : '"""', - next : "qqdoc" - }, - { - token : "string", - regex : "'", - next : "qstring" - }, - { - token : "string", - regex : '"', - next : "qqstring" - }, - { - regex: "(\\-\\-|\\+\\+)", - token: ["keyword.operator.increment-decrement.dart"] - }, - { - regex: "(\\-|\\+|\\*|\\/|\\~\\/|%)", - token: ["keyword.operator.arithmetic.dart"] - }, - { - regex: "(!|&&|\\|\\|)", - token: ["keyword.operator.logical.dart"] - }, - { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, - { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, - { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qdoc" : [ - { - token : "string", - regex : ".*?'''", - next : "start" - }, stringfill], - - "qqdoc" : [ - { - token : "string", - regex : '.*?"""', - next : "start" - }, stringfill], - - "qstring" : [ - { - token : "string", - regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'", - next : "start" - }, stringfill], - - "qqstring" : [ - { - token : "string", - regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', - next : "start" - }, stringfill] -} - -}; - -oop.inherits(DartHighlightRules, TextHighlightRules); - -exports.DartHighlightRules = DartHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-diff.js b/util/build-sample-browser/player/vendor/ace/mode-diff.js deleted file mode 100644 index 68fe07eea4..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-diff.js +++ /dev/null @@ -1,170 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/diff', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/diff_highlight_rules', 'ace/mode/folding/diff'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HighlightRules = require("./diff_highlight_rules").DiffHighlightRules; -var FoldMode = require("./folding/diff").FoldMode; - -var Mode = function() { - this.HighlightRules = HighlightRules; - this.foldingRules = new FoldMode(["diff", "index", "\\+{3}", "@@|\\*{5}"], "i"); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.$id = "ace/mode/diff"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/diff_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DiffHighlightRules = function() { - - this.$rules = { - "start" : [{ - regex: "^(?:\\*{15}|={67}|-{3}|\\+{3})$", - token: "punctuation.definition.separator.diff", - "name": "keyword" - }, { //diff.range.unified - regex: "^(@@)(\\s*.+?\\s*)(@@)(.*)$", - token: [ - "constant", - "constant.numeric", - "constant", - "comment.doc.tag" - ] - }, { //diff.range.normal - regex: "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$", - token: [ - "constant.numeric", - "punctuation.definition.range.diff", - "constant.function", - "constant.numeric", - "punctuation.definition.range.diff", - "invalid" - ], - "name": "meta." - }, { - regex: "^(\\-{3}|\\+{3}|\\*{3})( .+)$", - token: [ - "constant.numeric", - "meta.tag" - ] - }, { // added - regex: "^([!+>])(.*?)(\\s*)$", - token: [ - "support.constant", - "text", - "invalid" - ] - }, { // removed - regex: "^([<\\-])(.*?)(\\s*)$", - token: [ - "support.function", - "string", - "invalid" - ] - }, { - regex: "^(diff)(\\s+--\\w+)?(.+?)( .+)?$", - token: ["variable", "variable", "keyword", "variable"] - }, { - regex: "^Index.+$", - token: "variable" - }, { - regex: "^\\s+$", - token: "text" - }, { - regex: "\\s*$", - token: "invalid" - }, { - defaultToken: "invisible", - caseInsensitive: true - } - ] - }; -}; - -oop.inherits(DiffHighlightRules, TextHighlightRules); - -exports.DiffHighlightRules = DiffHighlightRules; -}); - -ace.define('ace/mode/folding/diff', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function(levels, flag) { - this.regExpList = levels; - this.flag = flag; - this.foldingStartMarker = RegExp("^(" + levels.join("|") + ")", this.flag); -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - this.getFoldWidgetRange = function(session, foldStyle, row) { - var line = session.getLine(row); - var start = {row: row, column: line.length}; - - var regList = this.regExpList; - for (var i = 1; i <= regList.length; i++) { - var re = RegExp("^(" + regList.slice(0, i).join("|") + ")", this.flag); - if (re.test(line)) - break; - } - - for (var l = session.getLength(); ++row < l; ) { - line = session.getLine(row); - if (re.test(line)) - break; - } - if (row == start.row + 1) - return; - return Range.fromPoints(start, {row: row - 1, column: line.length}); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-django.js b/util/build-sample-browser/player/vendor/ace/mode-django.js deleted file mode 100644 index 341fa9f67e..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-django.js +++ /dev/null @@ -1,2504 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/django', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var HtmlMode = require("./html").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DjangoHighlightRules = function(){ - this.$rules = { - 'start': [{ - token: "string", - regex: '".*?"' - }, { - token: "string", - regex: "'.*?'" - }, { - token: "constant", - regex: '[0-9]+' - }, { - token: "variable", - regex: "[-_a-zA-Z0-9:]+" - }], - 'comment': [{ - token : "comment.block", - merge: true, - regex : ".+?" - }], - 'tag': [{ - token: "entity.name.function", - regex: "[a-zA-Z][_a-zA-Z0-9]*", - next: "start" - }] - }; -}; - -oop.inherits(DjangoHighlightRules, TextHighlightRules) - -var DjangoHtmlHighlightRules = function() { - this.$rules = new HtmlHighlightRules().getRules(); - - for (var i in this.$rules) { - this.$rules[i].unshift({ - token: "comment.line", - regex: "\\{#.*?#\\}" - }, { - token: "comment.block", - regex: "\\{\\%\\s*comment\\s*\\%\\}", - merge: true, - next: "django-comment" - }, { - token: "constant.language", - regex: "\\{\\{", - next: "django-start" - }, { - token: "constant.language", - regex: "\\{\\%", - next: "django-tag" - }); - this.embedRules(DjangoHighlightRules, "django-", [{ - token: "comment.block", - regex: "\\{\\%\\s*endcomment\\s*\\%\\}", - merge: true, - next: "start" - }, { - token: "constant.language", - regex: "\\%\\}", - next: "start" - }, { - token: "constant.language", - regex: "\\}\\}", - next: "start" - }]); - } -}; - -oop.inherits(DjangoHtmlHighlightRules, HtmlHighlightRules); - -var Mode = function() { - HtmlMode.call(this); - this.HighlightRules = DjangoHtmlHighlightRules; -}; -oop.inherits(Mode, HtmlMode); - -(function() { - this.$id = "ace/mode/django"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(defaultMode, subModes) { - this.defaultMode = defaultMode; - this.subModes = subModes; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - - this.$getMode = function(state) { - if (typeof state != "string") - state = state[0]; - for (var key in this.subModes) { - if (state.indexOf(key) === 0) - return this.subModes[key]; - } - return null; - }; - - this.$tryMode = function(state, session, foldStyle, row) { - var mode = this.$getMode(state); - return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); - }; - - this.getFoldWidget = function(session, foldStyle, row) { - return ( - this.$tryMode(session.getState(row-1), session, foldStyle, row) || - this.$tryMode(session.getState(row), session, foldStyle, row) || - this.defaultMode.getFoldWidget(session, foldStyle, row) - ); - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var mode = this.$getMode(session.getState(row-1)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.$getMode(session.getState(row)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.defaultMode; - - return mode.getFoldWidgetRange(session, foldStyle, row); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-dot.js b/util/build-sample-browser/player/vendor/ace/mode-dot.js deleted file mode 100644 index 703fafd1bc..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-dot.js +++ /dev/null @@ -1,361 +0,0 @@ -ace.define('ace/mode/dot', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/matching_brace_outdent', 'ace/mode/dot_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var DotHighlightRules = require("./dot_highlight_rules").DotHighlightRules; -var DotFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = DotHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new DotFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ["//", "#"]; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/dot"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); -ace.define('ace/mode/dot_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/doc_comment_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; - -var DotHighlightRules = function() { - - var keywords = lang.arrayToMap( - ("strict|node|edge|graph|digraph|subgraph").split("|") - ); - - var attributes = lang.arrayToMap( - ("damping|k|url|area|arrowhead|arrowsize|arrowtail|aspect|bb|bgcolor|center|charset|clusterrank|color|colorscheme|comment|compound|concentrate|constraint|decorate|defaultdist|dim|dimen|dir|diredgeconstraints|distortion|dpi|edgeurl|edgehref|edgetarget|edgetooltip|epsilon|esep|fillcolor|fixedsize|fontcolor|fontname|fontnames|fontpath|fontsize|forcelabels|gradientangle|group|headurl|head_lp|headclip|headhref|headlabel|headport|headtarget|headtooltip|height|href|id|image|imagepath|imagescale|label|labelurl|label_scheme|labelangle|labeldistance|labelfloat|labelfontcolor|labelfontname|labelfontsize|labelhref|labeljust|labelloc|labeltarget|labeltooltip|landscape|layer|layerlistsep|layers|layerselect|layersep|layout|len|levels|levelsgap|lhead|lheight|lp|ltail|lwidth|margin|maxiter|mclimit|mindist|minlen|mode|model|mosek|nodesep|nojustify|normalize|nslimit|nslimit1|ordering|orientation|outputorder|overlap|overlap_scaling|pack|packmode|pad|page|pagedir|pencolor|penwidth|peripheries|pin|pos|quadtree|quantum|rank|rankdir|ranksep|ratio|rects|regular|remincross|repulsiveforce|resolution|root|rotate|rotation|samehead|sametail|samplepoints|scale|searchsize|sep|shape|shapefile|showboxes|sides|size|skew|smoothing|sortv|splines|start|style|stylesheet|tailurl|tail_lp|tailclip|tailhref|taillabel|tailport|tailtarget|tailtooltip|target|tooltip|truecolor|vertices|viewport|voro_margin|weight|width|xlabel|xlp|z").split("|") - ); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : /\/\/.*$/ - }, { - token : "comment", - regex : /#.*$/ - }, { - token : "comment", // multi line comment - merge : true, - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", - regex : /[+\-]?\d+(?:(?:\.\d*)?(?:[eE][+\-]?\d+)?)?\b/ - }, { - token : "keyword.operator", - regex : /\+|=|\->/ - }, { - token : "punctuation.operator", - regex : /,|;/ - }, { - token : "paren.lparen", - regex : /[\[{]/ - }, { - token : "paren.rparen", - regex : /[\]}]/ - }, { - token: "comment", - regex: /^#!.*$/ - }, { - token: function(value) { - if (keywords.hasOwnProperty(value.toLowerCase())) { - return "keyword"; - } - else if (attributes.hasOwnProperty(value.toLowerCase())) { - return "variable"; - } - else { - return "text"; - } - }, - regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - merge : true, - next : "start" - }, { - token : "comment", // comment spanning whole line - merge : true, - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '[^"\\\\]+', - merge : true - }, { - token : "string", - regex : "\\\\$", - next : "qqstring", - merge : true - }, { - token : "string", - regex : '"|$', - next : "start", - merge : true - } - ], - "qstring" : [ - { - token : "string", - regex : "[^'\\\\]+", - merge : true - }, { - token : "string", - regex : "\\\\$", - next : "qstring", - merge : true - }, { - token : "string", - regex : "'|$", - next : "start", - merge : true - } - ] - }; -}; - -oop.inherits(DotHighlightRules, TextHighlightRules); - -exports.DotHighlightRules = DotHighlightRules; - -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-ejs.js b/util/build-sample-browser/player/vendor/ace/mode-ejs.js deleted file mode 100644 index 1c3487fb51..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-ejs.js +++ /dev/null @@ -1,2869 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - - -ace.define('ace/mode/ejs', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/tokenizer', 'ace/mode/html', 'ace/mode/javascript', 'ace/mode/css', 'ace/mode/ruby'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; - -var EjsHighlightRules = function(start, end) { - HtmlHighlightRules.call(this); - - if (!start) - start = "(?:<%|<\\?|{{)"; - if (!end) - end = "(?:%>|\\?>|}})"; - - for (var i in this.$rules) { - this.$rules[i].unshift({ - token : "markup.list.meta.tag", - regex : start + "(?![>}])[-=]?", - push : "ejs-start" - }); - } - - this.embedRules(JavaScriptHighlightRules, "ejs-"); - - this.$rules["ejs-start"].unshift({ - token : "markup.list.meta.tag", - regex : "-?" + end, - next : "pop" - }, { - token: "comment", - regex: "//.*?" + end, - next: "pop" - }); - - this.$rules["ejs-no_regex"].unshift({ - token : "markup.list.meta.tag", - regex : "-?" + end, - next : "pop" - }, { - token: "comment", - regex: "//.*?" + end, - next: "pop" - }); - - this.normalizeRules(); -}; - - -oop.inherits(EjsHighlightRules, HtmlHighlightRules); - -exports.EjsHighlightRules = EjsHighlightRules; - - -var oop = require("../lib/oop"); -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlMode = require("./html").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var RubyMode = require("./ruby").Mode; - -var Mode = function() { - HtmlMode.call(this); - this.HighlightRules = EjsHighlightRules; - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode, - "ejs-": JavaScriptMode - }); -}; -oop.inherits(Mode, HtmlMode); - -(function() { - - this.$id = "ace/mode/ejs"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(defaultMode, subModes) { - this.defaultMode = defaultMode; - this.subModes = subModes; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - - this.$getMode = function(state) { - if (typeof state != "string") - state = state[0]; - for (var key in this.subModes) { - if (state.indexOf(key) === 0) - return this.subModes[key]; - } - return null; - }; - - this.$tryMode = function(state, session, foldStyle, row) { - var mode = this.$getMode(state); - return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); - }; - - this.getFoldWidget = function(session, foldStyle, row) { - return ( - this.$tryMode(session.getState(row-1), session, foldStyle, row) || - this.$tryMode(session.getState(row), session, foldStyle, row) || - this.defaultMode.getFoldWidget(session, foldStyle, row) - ); - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var mode = this.$getMode(session.getState(row-1)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.$getMode(session.getState(row)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.defaultMode; - - return mode.getFoldWidgetRange(session, foldStyle, row); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/ruby', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ruby_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = RubyHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - - this.lineCommentStart = "#"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/); - var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/); - var startingConditional = line.match(/^\s*(if|else)\s*/) - if (match || startingClassOrMethod || startingDoBlock || startingConditional) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return /^\s+end$/.test(line + input) || /^\s+}$/.test(line + input) || /^\s+else$/.test(line + input); - }; - - this.autoOutdent = function(state, doc, row) { - var indent = this.$getIndent(doc.getLine(row)); - var tab = doc.getTabString(); - if (indent.slice(-tab.length) == tab) - doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); - }; - - this.$id = "ace/mode/ruby"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/ruby_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var constantOtherSymbol = exports.constantOtherSymbol = { - token : "constant.other.symbol.ruby", // symbol - regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?" -}; - -var qString = exports.qString = { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" -}; - -var qqString = exports.qqString = { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' -}; - -var tString = exports.tString = { - token : "string", // backtick string - regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]" -}; - -var constantNumericHex = exports.constantNumericHex = { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b" -}; - -var constantNumericFloat = exports.constantNumericFloat = { - token : "constant.numeric", // float - regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b" -}; - -var RubyHighlightRules = function() { - - var builtinFunctions = ( - "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" + - "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + - "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" + - "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" + - "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" + - "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" + - "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" + - "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" + - "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" + - "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" + - "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" + - "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" + - "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" + - "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" + - "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" + - "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" + - "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" + - "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" + - "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" + - "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" + - "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" + - "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" + - "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" + - "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" + - "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" + - "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" + - "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" + - "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" + - "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" + - "has_many|has_one|belongs_to|has_and_belongs_to_many" - ); - - var keywords = ( - "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" + - "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + - "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield" - ); - - var buildinConstants = ( - "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" + - "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING" - ); - - var builtinVariables = ( - "\$DEBUG|\$defout|\$FILENAME|\$LOAD_PATH|\$SAFE|\$stdin|\$stdout|\$stderr|\$VERBOSE|" + - "$!|root_url|flash|session|cookies|params|request|response|logger|self" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": buildinConstants, - "variable.language": builtinVariables, - "support.function": builtinFunctions, - "invalid.deprecated": "debugger" // TODO is this a remnant from js mode? - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "#.*$" - }, { - token : "comment", // multi line comment - regex : "^=begin(?:$|\\s.*$)", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, - - qString, - qqString, - tString, - - { - token : "text", // namespaces aren't symbols - regex : "::" - }, { - token : "variable.instance", // instance variable - regex : "@{1,2}[a-zA-Z_\\d]+" - }, { - token : "support.class", // class name - regex : "[A-Z][a-zA-Z_\\d]+" - }, - - constantOtherSymbol, - constantNumericHex, - constantNumericFloat, - - { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "punctuation.separator.key-value", - regex : "=>" - }, { - stateName: "heredoc", - onMatch : function(value, currentState, stack) { - var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; - var tokens = value.split(this.splitRegex); - stack.push(next, tokens[3]); - return [ - {type:"constant", value: tokens[1]}, - {type:"string", value: tokens[2]}, - {type:"support.class", value: tokens[3]}, - {type:"string", value: tokens[4]} - ]; - }, - regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", - rules: { - heredoc: [{ - onMatch: function(value, currentState, stack) { - if (value === stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack[0] || "start"; - return "support.class"; - } - this.next = ""; - return "string"; - }, - regex: ".*$", - next: "start" - }], - indentedHeredoc: [{ - token: "string", - regex: "^ +" - }, { - onMatch: function(value, currentState, stack) { - if (value === stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack[0] || "start"; - return "support.class"; - } - this.next = ""; - return "string"; - }, - regex: ".*$", - next: "start" - }] - } - }, { - regex : "$", - token : "empty", - next : function(currentState, stack) { - if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") - return stack[0]; - return currentState; - } - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : "^=end(?:$|\\s.*$)", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; - - this.normalizeRules(); -}; - -oop.inherits(RubyHighlightRules, TextHighlightRules); - -exports.RubyHighlightRules = RubyHighlightRules; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-erlang.js b/util/build-sample-browser/player/vendor/ace/mode-erlang.js deleted file mode 100644 index 16571686b8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-erlang.js +++ /dev/null @@ -1,987 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/erlang', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/erlang_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ErlangHighlightRules = require("./erlang_highlight_rules").ErlangHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ErlangHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "%"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/erlang"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/erlang_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ErlangHighlightRules = function() { - - this.$rules = { start: - [ { include: '#module-directive' }, - { include: '#import-export-directive' }, - { include: '#behaviour-directive' }, - { include: '#record-directive' }, - { include: '#define-directive' }, - { include: '#macro-directive' }, - { include: '#directive' }, - { include: '#function' }, - { include: '#everything-else' } ], - '#atom': - [ { token: 'punctuation.definition.symbol.begin.erlang', - regex: '\'', - push: - [ { token: 'punctuation.definition.symbol.end.erlang', - regex: '\'', - next: 'pop' }, - { token: - [ 'punctuation.definition.escape.erlang', - 'constant.other.symbol.escape.erlang', - 'punctuation.definition.escape.erlang', - 'constant.other.symbol.escape.erlang', - 'constant.other.symbol.escape.erlang' ], - regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, - { token: 'invalid.illegal.atom.erlang', regex: '\\\\\\^?.?' }, - { defaultToken: 'constant.other.symbol.quoted.single.erlang' } ] }, - { token: 'constant.other.symbol.unquoted.erlang', - regex: '[a-z][a-zA-Z\\d@_]*' } ], - '#behaviour-directive': - [ { token: - [ 'meta.directive.behaviour.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.behaviour.erlang', - 'keyword.control.directive.behaviour.erlang', - 'meta.directive.behaviour.erlang', - 'punctuation.definition.parameters.begin.erlang', - 'meta.directive.behaviour.erlang', - 'entity.name.type.class.behaviour.definition.erlang', - 'meta.directive.behaviour.erlang', - 'punctuation.definition.parameters.end.erlang', - 'meta.directive.behaviour.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '^(\\s*)(-)(\\s*)(behaviour)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' } ], - '#binary': - [ { token: 'punctuation.definition.binary.begin.erlang', - regex: '<<', - push: - [ { token: 'punctuation.definition.binary.end.erlang', - regex: '>>', - next: 'pop' }, - { token: - [ 'punctuation.separator.binary.erlang', - 'punctuation.separator.value-size.erlang' ], - regex: '(,)|(:)' }, - { include: '#internal-type-specifiers' }, - { include: '#everything-else' }, - { defaultToken: 'meta.structure.binary.erlang' } ] } ], - '#character': - [ { token: - [ 'punctuation.definition.character.erlang', - 'punctuation.definition.escape.erlang', - 'constant.character.escape.erlang', - 'punctuation.definition.escape.erlang', - 'constant.character.escape.erlang', - 'constant.character.escape.erlang' ], - regex: '(\\$)(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, - { token: 'invalid.illegal.character.erlang', - regex: '\\$\\\\\\^?.?' }, - { token: - [ 'punctuation.definition.character.erlang', - 'constant.character.erlang' ], - regex: '(\\$)(\\S)' }, - { token: 'invalid.illegal.character.erlang', regex: '\\$.?' } ], - '#comment': - [ { token: 'punctuation.definition.comment.erlang', - regex: '%.*$', - push_: - [ { token: 'comment.line.percentage.erlang', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.percentage.erlang' } ] } ], - '#define-directive': - [ { token: - [ 'meta.directive.define.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.define.erlang', - 'keyword.control.directive.define.erlang', - 'meta.directive.define.erlang', - 'punctuation.definition.parameters.begin.erlang', - 'meta.directive.define.erlang', - 'entity.name.function.macro.definition.erlang', - 'meta.directive.define.erlang', - 'punctuation.separator.parameters.erlang' ], - regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(,)', - push: - [ { token: - [ 'punctuation.definition.parameters.end.erlang', - 'meta.directive.define.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '(\\))(\\s*)(\\.)', - next: 'pop' }, - { include: '#everything-else' }, - { defaultToken: 'meta.directive.define.erlang' } ] }, - { token: 'meta.directive.define.erlang', - regex: '(?=^\\s*-\\s*define\\s*\\(\\s*[a-zA-Z\\d@_]+\\s*\\()', - push: - [ { token: - [ 'punctuation.definition.parameters.end.erlang', - 'meta.directive.define.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '(\\))(\\s*)(\\.)', - next: 'pop' }, - { token: - [ 'text', - 'punctuation.section.directive.begin.erlang', - 'text', - 'keyword.control.directive.define.erlang', - 'text', - 'punctuation.definition.parameters.begin.erlang', - 'text', - 'entity.name.function.macro.definition.erlang', - 'text', - 'punctuation.definition.parameters.begin.erlang' ], - regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\()', - push: - [ { token: - [ 'punctuation.definition.parameters.end.erlang', - 'text', - 'punctuation.separator.parameters.erlang' ], - regex: '(\\))(\\s*)(,)', - next: 'pop' }, - { token: 'punctuation.separator.parameters.erlang', regex: ',' }, - { include: '#everything-else' } ] }, - { token: 'punctuation.separator.define.erlang', - regex: '\\|\\||\\||:|;|,|\\.|->' }, - { include: '#everything-else' }, - { defaultToken: 'meta.directive.define.erlang' } ] } ], - '#directive': - [ { token: - [ 'meta.directive.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.erlang', - 'keyword.control.directive.erlang', - 'meta.directive.erlang', - 'punctuation.definition.parameters.begin.erlang' ], - regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\(?)', - push: - [ { token: - [ 'punctuation.definition.parameters.end.erlang', - 'meta.directive.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '(\\)?)(\\s*)(\\.)', - next: 'pop' }, - { include: '#everything-else' }, - { defaultToken: 'meta.directive.erlang' } ] }, - { token: - [ 'meta.directive.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.erlang', - 'keyword.control.directive.erlang', - 'meta.directive.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\.)' } ], - '#everything-else': - [ { include: '#comment' }, - { include: '#record-usage' }, - { include: '#macro-usage' }, - { include: '#expression' }, - { include: '#keyword' }, - { include: '#textual-operator' }, - { include: '#function-call' }, - { include: '#tuple' }, - { include: '#list' }, - { include: '#binary' }, - { include: '#parenthesized-expression' }, - { include: '#character' }, - { include: '#number' }, - { include: '#atom' }, - { include: '#string' }, - { include: '#symbolic-operator' }, - { include: '#variable' } ], - '#expression': - [ { token: 'keyword.control.if.erlang', - regex: '\\bif\\b', - push: - [ { token: 'keyword.control.end.erlang', - regex: '\\bend\\b', - next: 'pop' }, - { include: '#internal-expression-punctuation' }, - { include: '#everything-else' }, - { defaultToken: 'meta.expression.if.erlang' } ] }, - { token: 'keyword.control.case.erlang', - regex: '\\bcase\\b', - push: - [ { token: 'keyword.control.end.erlang', - regex: '\\bend\\b', - next: 'pop' }, - { include: '#internal-expression-punctuation' }, - { include: '#everything-else' }, - { defaultToken: 'meta.expression.case.erlang' } ] }, - { token: 'keyword.control.receive.erlang', - regex: '\\breceive\\b', - push: - [ { token: 'keyword.control.end.erlang', - regex: '\\bend\\b', - next: 'pop' }, - { include: '#internal-expression-punctuation' }, - { include: '#everything-else' }, - { defaultToken: 'meta.expression.receive.erlang' } ] }, - { token: - [ 'keyword.control.fun.erlang', - 'text', - 'entity.name.type.class.module.erlang', - 'text', - 'punctuation.separator.module-function.erlang', - 'text', - 'entity.name.function.erlang', - 'text', - 'punctuation.separator.function-arity.erlang' ], - regex: '\\b(fun)(\\s*)(?:([a-z][a-zA-Z\\d@_]*)(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*)(\\s*)(/)' }, - { token: 'keyword.control.fun.erlang', - regex: '\\bfun\\b', - push: - [ { token: 'keyword.control.end.erlang', - regex: '\\bend\\b', - next: 'pop' }, - { token: 'text', - regex: '(?=\\()', - push: - [ { token: 'punctuation.separator.clauses.erlang', - regex: ';|(?=\\bend\\b)', - next: 'pop' }, - { include: '#internal-function-parts' } ] }, - { include: '#everything-else' }, - { defaultToken: 'meta.expression.fun.erlang' } ] }, - { token: 'keyword.control.try.erlang', - regex: '\\btry\\b', - push: - [ { token: 'keyword.control.end.erlang', - regex: '\\bend\\b', - next: 'pop' }, - { include: '#internal-expression-punctuation' }, - { include: '#everything-else' }, - { defaultToken: 'meta.expression.try.erlang' } ] }, - { token: 'keyword.control.begin.erlang', - regex: '\\bbegin\\b', - push: - [ { token: 'keyword.control.end.erlang', - regex: '\\bend\\b', - next: 'pop' }, - { include: '#internal-expression-punctuation' }, - { include: '#everything-else' }, - { defaultToken: 'meta.expression.begin.erlang' } ] }, - { token: 'keyword.control.query.erlang', - regex: '\\bquery\\b', - push: - [ { token: 'keyword.control.end.erlang', - regex: '\\bend\\b', - next: 'pop' }, - { include: '#everything-else' }, - { defaultToken: 'meta.expression.query.erlang' } ] } ], - '#function': - [ { token: - [ 'meta.function.erlang', - 'entity.name.function.definition.erlang', - 'meta.function.erlang' ], - regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()', - push: - [ { token: 'punctuation.terminator.function.erlang', - regex: '\\.', - next: 'pop' }, - { token: [ 'text', 'entity.name.function.erlang', 'text' ], - regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()' }, - { token: 'text', - regex: '(?=\\()', - push: - [ { token: 'punctuation.separator.clauses.erlang', - regex: ';|(?=\\.)', - next: 'pop' }, - { include: '#parenthesized-expression' }, - { include: '#internal-function-parts' } ] }, - { include: '#everything-else' }, - { defaultToken: 'meta.function.erlang' } ] } ], - '#function-call': - [ { token: 'meta.function-call.erlang', - regex: '(?=(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*(?:\\(|:\\s*(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*\\())', - push: - [ { token: 'punctuation.definition.parameters.end.erlang', - regex: '\\)', - next: 'pop' }, - { token: - [ 'entity.name.type.class.module.erlang', - 'text', - 'punctuation.separator.module-function.erlang', - 'text', - 'entity.name.function.guard.erlang', - 'text', - 'punctuation.definition.parameters.begin.erlang' ], - regex: '(?:(erlang)(\\s*)(:)(\\s*))?(is_atom|is_binary|is_constant|is_float|is_function|is_integer|is_list|is_number|is_pid|is_port|is_reference|is_tuple|is_record|abs|element|hd|length|node|round|self|size|tl|trunc)(\\s*)(\\()', - push: - [ { token: 'text', regex: '(?=\\))', next: 'pop' }, - { token: 'punctuation.separator.parameters.erlang', regex: ',' }, - { include: '#everything-else' } ] }, - { token: - [ 'entity.name.type.class.module.erlang', - 'text', - 'punctuation.separator.module-function.erlang', - 'text', - 'entity.name.function.erlang', - 'text', - 'punctuation.definition.parameters.begin.erlang' ], - regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\()', - push: - [ { token: 'text', regex: '(?=\\))', next: 'pop' }, - { token: 'punctuation.separator.parameters.erlang', regex: ',' }, - { include: '#everything-else' } ] }, - { defaultToken: 'meta.function-call.erlang' } ] } ], - '#import-export-directive': - [ { token: - [ 'meta.directive.import.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.import.erlang', - 'keyword.control.directive.import.erlang', - 'meta.directive.import.erlang', - 'punctuation.definition.parameters.begin.erlang', - 'meta.directive.import.erlang', - 'entity.name.type.class.module.erlang', - 'meta.directive.import.erlang', - 'punctuation.separator.parameters.erlang' ], - regex: '^(\\s*)(-)(\\s*)(import)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)', - push: - [ { token: - [ 'punctuation.definition.parameters.end.erlang', - 'meta.directive.import.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '(\\))(\\s*)(\\.)', - next: 'pop' }, - { include: '#internal-function-list' }, - { defaultToken: 'meta.directive.import.erlang' } ] }, - { token: - [ 'meta.directive.export.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.export.erlang', - 'keyword.control.directive.export.erlang', - 'meta.directive.export.erlang', - 'punctuation.definition.parameters.begin.erlang' ], - regex: '^(\\s*)(-)(\\s*)(export)(\\s*)(\\()', - push: - [ { token: - [ 'punctuation.definition.parameters.end.erlang', - 'meta.directive.export.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '(\\))(\\s*)(\\.)', - next: 'pop' }, - { include: '#internal-function-list' }, - { defaultToken: 'meta.directive.export.erlang' } ] } ], - '#internal-expression-punctuation': - [ { token: - [ 'punctuation.separator.clause-head-body.erlang', - 'punctuation.separator.clauses.erlang', - 'punctuation.separator.expressions.erlang' ], - regex: '(->)|(;)|(,)' } ], - '#internal-function-list': - [ { token: 'punctuation.definition.list.begin.erlang', - regex: '\\[', - push: - [ { token: 'punctuation.definition.list.end.erlang', - regex: '\\]', - next: 'pop' }, - { token: - [ 'entity.name.function.erlang', - 'text', - 'punctuation.separator.function-arity.erlang' ], - regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(/)', - push: - [ { token: 'punctuation.separator.list.erlang', - regex: ',|(?=\\])', - next: 'pop' }, - { include: '#everything-else' } ] }, - { include: '#everything-else' }, - { defaultToken: 'meta.structure.list.function.erlang' } ] } ], - '#internal-function-parts': - [ { token: 'text', - regex: '(?=\\()', - push: - [ { token: 'punctuation.separator.clause-head-body.erlang', - regex: '->', - next: 'pop' }, - { token: 'punctuation.definition.parameters.begin.erlang', - regex: '\\(', - push: - [ { token: 'punctuation.definition.parameters.end.erlang', - regex: '\\)', - next: 'pop' }, - { token: 'punctuation.separator.parameters.erlang', regex: ',' }, - { include: '#everything-else' } ] }, - { token: 'punctuation.separator.guards.erlang', regex: ',|;' }, - { include: '#everything-else' } ] }, - { token: 'punctuation.separator.expressions.erlang', - regex: ',' }, - { include: '#everything-else' } ], - '#internal-record-body': - [ { token: 'punctuation.definition.class.record.begin.erlang', - regex: '\\{', - push: - [ { token: 'meta.structure.record.erlang', - regex: '(?=\\})', - next: 'pop' }, - { token: - [ 'variable.other.field.erlang', - 'variable.language.omitted.field.erlang', - 'text', - 'keyword.operator.assignment.erlang' ], - regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')|(_))(\\s*)(=|::)', - push: - [ { token: 'punctuation.separator.class.record.erlang', - regex: ',|(?=\\})', - next: 'pop' }, - { include: '#everything-else' } ] }, - { token: - [ 'variable.other.field.erlang', - 'text', - 'punctuation.separator.class.record.erlang' ], - regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)((?:,)?)' }, - { include: '#everything-else' }, - { defaultToken: 'meta.structure.record.erlang' } ] } ], - '#internal-type-specifiers': - [ { token: 'punctuation.separator.value-type.erlang', - regex: '/', - push: - [ { token: 'text', regex: '(?=,|:|>>)', next: 'pop' }, - { token: - [ 'storage.type.erlang', - 'storage.modifier.signedness.erlang', - 'storage.modifier.endianness.erlang', - 'storage.modifier.unit.erlang', - 'punctuation.separator.type-specifiers.erlang' ], - regex: '(integer|float|binary|bytes|bitstring|bits)|(signed|unsigned)|(big|little|native)|(unit)|(-)' } ] } ], - '#keyword': - [ { token: 'keyword.control.erlang', - regex: '\\b(?:after|begin|case|catch|cond|end|fun|if|let|of|query|try|receive|when)\\b' } ], - '#list': - [ { token: 'punctuation.definition.list.begin.erlang', - regex: '\\[', - push: - [ { token: 'punctuation.definition.list.end.erlang', - regex: '\\]', - next: 'pop' }, - { token: 'punctuation.separator.list.erlang', - regex: '\\||\\|\\||,' }, - { include: '#everything-else' }, - { defaultToken: 'meta.structure.list.erlang' } ] } ], - '#macro-directive': - [ { token: - [ 'meta.directive.ifdef.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.ifdef.erlang', - 'keyword.control.directive.ifdef.erlang', - 'meta.directive.ifdef.erlang', - 'punctuation.definition.parameters.begin.erlang', - 'meta.directive.ifdef.erlang', - 'entity.name.function.macro.erlang', - 'meta.directive.ifdef.erlang', - 'punctuation.definition.parameters.end.erlang', - 'meta.directive.ifdef.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '^(\\s*)(-)(\\s*)(ifdef)(\\s*)(\\()(\\s*)([a-zA-z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' }, - { token: - [ 'meta.directive.ifndef.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.ifndef.erlang', - 'keyword.control.directive.ifndef.erlang', - 'meta.directive.ifndef.erlang', - 'punctuation.definition.parameters.begin.erlang', - 'meta.directive.ifndef.erlang', - 'entity.name.function.macro.erlang', - 'meta.directive.ifndef.erlang', - 'punctuation.definition.parameters.end.erlang', - 'meta.directive.ifndef.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '^(\\s*)(-)(\\s*)(ifndef)(\\s*)(\\()(\\s*)([a-zA-z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' }, - { token: - [ 'meta.directive.undef.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.undef.erlang', - 'keyword.control.directive.undef.erlang', - 'meta.directive.undef.erlang', - 'punctuation.definition.parameters.begin.erlang', - 'meta.directive.undef.erlang', - 'entity.name.function.macro.erlang', - 'meta.directive.undef.erlang', - 'punctuation.definition.parameters.end.erlang', - 'meta.directive.undef.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '^(\\s*)(-)(\\s*)(undef)(\\s*)(\\()(\\s*)([a-zA-z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' } ], - '#macro-usage': - [ { token: - [ 'keyword.operator.macro.erlang', - 'meta.macro-usage.erlang', - 'entity.name.function.macro.erlang' ], - regex: '(\\?\\??)(\\s*)([a-zA-Z\\d@_]+)' } ], - '#module-directive': - [ { token: - [ 'meta.directive.module.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.module.erlang', - 'keyword.control.directive.module.erlang', - 'meta.directive.module.erlang', - 'punctuation.definition.parameters.begin.erlang', - 'meta.directive.module.erlang', - 'entity.name.type.class.module.definition.erlang', - 'meta.directive.module.erlang', - 'punctuation.definition.parameters.end.erlang', - 'meta.directive.module.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '^(\\s*)(-)(\\s*)(module)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' } ], - '#number': - [ { token: 'text', - regex: '(?=\\d)', - push: - [ { token: 'text', regex: '(?!\\d)', next: 'pop' }, - { token: - [ 'constant.numeric.float.erlang', - 'punctuation.separator.integer-float.erlang', - 'constant.numeric.float.erlang', - 'punctuation.separator.float-exponent.erlang' ], - regex: '(\\d+)(\\.)(\\d+)((?:[eE][\\+\\-]?\\d+)?)' }, - { token: - [ 'constant.numeric.integer.binary.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.binary.erlang' ], - regex: '(2)(#)([0-1]+)' }, - { token: - [ 'constant.numeric.integer.base-3.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-3.erlang' ], - regex: '(3)(#)([0-2]+)' }, - { token: - [ 'constant.numeric.integer.base-4.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-4.erlang' ], - regex: '(4)(#)([0-3]+)' }, - { token: - [ 'constant.numeric.integer.base-5.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-5.erlang' ], - regex: '(5)(#)([0-4]+)' }, - { token: - [ 'constant.numeric.integer.base-6.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-6.erlang' ], - regex: '(6)(#)([0-5]+)' }, - { token: - [ 'constant.numeric.integer.base-7.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-7.erlang' ], - regex: '(7)(#)([0-6]+)' }, - { token: - [ 'constant.numeric.integer.octal.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.octal.erlang' ], - regex: '(8)(#)([0-7]+)' }, - { token: - [ 'constant.numeric.integer.base-9.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-9.erlang' ], - regex: '(9)(#)([0-8]+)' }, - { token: - [ 'constant.numeric.integer.decimal.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.decimal.erlang' ], - regex: '(10)(#)(\\d+)' }, - { token: - [ 'constant.numeric.integer.base-11.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-11.erlang' ], - regex: '(11)(#)([\\daA]+)' }, - { token: - [ 'constant.numeric.integer.base-12.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-12.erlang' ], - regex: '(12)(#)([\\da-bA-B]+)' }, - { token: - [ 'constant.numeric.integer.base-13.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-13.erlang' ], - regex: '(13)(#)([\\da-cA-C]+)' }, - { token: - [ 'constant.numeric.integer.base-14.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-14.erlang' ], - regex: '(14)(#)([\\da-dA-D]+)' }, - { token: - [ 'constant.numeric.integer.base-15.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-15.erlang' ], - regex: '(15)(#)([\\da-eA-E]+)' }, - { token: - [ 'constant.numeric.integer.hexadecimal.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.hexadecimal.erlang' ], - regex: '(16)(#)([\\da-fA-F]+)' }, - { token: - [ 'constant.numeric.integer.base-17.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-17.erlang' ], - regex: '(17)(#)([\\da-gA-G]+)' }, - { token: - [ 'constant.numeric.integer.base-18.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-18.erlang' ], - regex: '(18)(#)([\\da-hA-H]+)' }, - { token: - [ 'constant.numeric.integer.base-19.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-19.erlang' ], - regex: '(19)(#)([\\da-iA-I]+)' }, - { token: - [ 'constant.numeric.integer.base-20.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-20.erlang' ], - regex: '(20)(#)([\\da-jA-J]+)' }, - { token: - [ 'constant.numeric.integer.base-21.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-21.erlang' ], - regex: '(21)(#)([\\da-kA-K]+)' }, - { token: - [ 'constant.numeric.integer.base-22.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-22.erlang' ], - regex: '(22)(#)([\\da-lA-L]+)' }, - { token: - [ 'constant.numeric.integer.base-23.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-23.erlang' ], - regex: '(23)(#)([\\da-mA-M]+)' }, - { token: - [ 'constant.numeric.integer.base-24.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-24.erlang' ], - regex: '(24)(#)([\\da-nA-N]+)' }, - { token: - [ 'constant.numeric.integer.base-25.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-25.erlang' ], - regex: '(25)(#)([\\da-oA-O]+)' }, - { token: - [ 'constant.numeric.integer.base-26.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-26.erlang' ], - regex: '(26)(#)([\\da-pA-P]+)' }, - { token: - [ 'constant.numeric.integer.base-27.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-27.erlang' ], - regex: '(27)(#)([\\da-qA-Q]+)' }, - { token: - [ 'constant.numeric.integer.base-28.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-28.erlang' ], - regex: '(28)(#)([\\da-rA-R]+)' }, - { token: - [ 'constant.numeric.integer.base-29.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-29.erlang' ], - regex: '(29)(#)([\\da-sA-S]+)' }, - { token: - [ 'constant.numeric.integer.base-30.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-30.erlang' ], - regex: '(30)(#)([\\da-tA-T]+)' }, - { token: - [ 'constant.numeric.integer.base-31.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-31.erlang' ], - regex: '(31)(#)([\\da-uA-U]+)' }, - { token: - [ 'constant.numeric.integer.base-32.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-32.erlang' ], - regex: '(32)(#)([\\da-vA-V]+)' }, - { token: - [ 'constant.numeric.integer.base-33.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-33.erlang' ], - regex: '(33)(#)([\\da-wA-W]+)' }, - { token: - [ 'constant.numeric.integer.base-34.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-34.erlang' ], - regex: '(34)(#)([\\da-xA-X]+)' }, - { token: - [ 'constant.numeric.integer.base-35.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-35.erlang' ], - regex: '(35)(#)([\\da-yA-Y]+)' }, - { token: - [ 'constant.numeric.integer.base-36.erlang', - 'punctuation.separator.base-integer.erlang', - 'constant.numeric.integer.base-36.erlang' ], - regex: '(36)(#)([\\da-zA-Z]+)' }, - { token: 'invalid.illegal.integer.erlang', - regex: '\\d+#[\\da-zA-Z]+' }, - { token: 'constant.numeric.integer.decimal.erlang', - regex: '\\d+' } ] } ], - '#parenthesized-expression': - [ { token: 'punctuation.section.expression.begin.erlang', - regex: '\\(', - push: - [ { token: 'punctuation.section.expression.end.erlang', - regex: '\\)', - next: 'pop' }, - { include: '#everything-else' }, - { defaultToken: 'meta.expression.parenthesized' } ] } ], - '#record-directive': - [ { token: - [ 'meta.directive.record.erlang', - 'punctuation.section.directive.begin.erlang', - 'meta.directive.record.erlang', - 'keyword.control.directive.import.erlang', - 'meta.directive.record.erlang', - 'punctuation.definition.parameters.begin.erlang', - 'meta.directive.record.erlang', - 'entity.name.type.class.record.definition.erlang', - 'meta.directive.record.erlang', - 'punctuation.separator.parameters.erlang' ], - regex: '^(\\s*)(-)(\\s*)(record)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)', - push: - [ { token: - [ 'punctuation.definition.class.record.end.erlang', - 'meta.directive.record.erlang', - 'punctuation.definition.parameters.end.erlang', - 'meta.directive.record.erlang', - 'punctuation.section.directive.end.erlang' ], - regex: '(\\})(\\s*)(\\))(\\s*)(\\.)', - next: 'pop' }, - { include: '#internal-record-body' }, - { defaultToken: 'meta.directive.record.erlang' } ] } ], - '#record-usage': - [ { token: - [ 'keyword.operator.record.erlang', - 'meta.record-usage.erlang', - 'entity.name.type.class.record.erlang', - 'meta.record-usage.erlang', - 'punctuation.separator.record-field.erlang', - 'meta.record-usage.erlang', - 'variable.other.field.erlang' ], - regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\.)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')' }, - { token: - [ 'keyword.operator.record.erlang', - 'meta.record-usage.erlang', - 'entity.name.type.class.record.erlang' ], - regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')', - push: - [ { token: 'punctuation.definition.class.record.end.erlang', - regex: '\\}', - next: 'pop' }, - { include: '#internal-record-body' }, - { defaultToken: 'meta.record-usage.erlang' } ] } ], - '#string': - [ { token: 'punctuation.definition.string.begin.erlang', - regex: '"', - push: - [ { token: 'punctuation.definition.string.end.erlang', - regex: '"', - next: 'pop' }, - { token: - [ 'punctuation.definition.escape.erlang', - 'constant.character.escape.erlang', - 'punctuation.definition.escape.erlang', - 'constant.character.escape.erlang', - 'constant.character.escape.erlang' ], - regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, - { token: 'invalid.illegal.string.erlang', regex: '\\\\\\^?.?' }, - { token: - [ 'punctuation.definition.placeholder.erlang', - 'punctuation.separator.placeholder-parts.erlang', - 'constant.other.placeholder.erlang', - 'punctuation.separator.placeholder-parts.erlang', - 'punctuation.separator.placeholder-parts.erlang', - 'constant.other.placeholder.erlang', - 'punctuation.separator.placeholder-parts.erlang', - 'punctuation.separator.placeholder-parts.erlang', - 'punctuation.separator.placeholder-parts.erlang', - 'constant.other.placeholder.erlang', - 'constant.other.placeholder.erlang' ], - regex: '(~)(?:((?:\\-)?)(\\d+)|(\\*))?(?:(\\.)(?:(\\d+)|(\\*)))?(?:(\\.)(?:(\\*)|(.)))?([~cfegswpWPBX#bx\\+ni])' }, - { token: - [ 'punctuation.definition.placeholder.erlang', - 'punctuation.separator.placeholder-parts.erlang', - 'constant.other.placeholder.erlang', - 'constant.other.placeholder.erlang' ], - regex: '(~)((?:\\*)?)((?:\\d+)?)([~du\\-#fsacl])' }, - { token: 'invalid.illegal.string.erlang', regex: '~.?' }, - { defaultToken: 'string.quoted.double.erlang' } ] } ], - '#symbolic-operator': - [ { token: 'keyword.operator.symbolic.erlang', - regex: '\\+\\+|\\+|--|-|\\*|/=|/|=/=|=:=|==|=<|=|<-|<|>=|>|!|::' } ], - '#textual-operator': - [ { token: 'keyword.operator.textual.erlang', - regex: '\\b(?:andalso|band|and|bxor|xor|bor|orelse|or|bnot|not|bsl|bsr|div|rem)\\b' } ], - '#tuple': - [ { token: 'punctuation.definition.tuple.begin.erlang', - regex: '\\{', - push: - [ { token: 'punctuation.definition.tuple.end.erlang', - regex: '\\}', - next: 'pop' }, - { token: 'punctuation.separator.tuple.erlang', regex: ',' }, - { include: '#everything-else' }, - { defaultToken: 'meta.structure.tuple.erlang' } ] } ], - '#variable': - [ { token: [ 'variable.other.erlang', 'variable.language.omitted.erlang' ], - regex: '(_[a-zA-Z\\d@_]+|[A-Z][a-zA-Z\\d@_]*)|(_)' } ] } - - this.normalizeRules(); -}; - -ErlangHighlightRules.metaData = { comment: 'The recognition of function definitions and compiler directives (such as module, record and macro definitions) requires that each of the aforementioned constructs must be the first string inside a line (except for whitespace). Also, the function/module/record/macro names must be given unquoted. -- desp', - fileTypes: [ 'erl', 'hrl' ], - keyEquivalent: '^~E', - name: 'Erlang', - scopeName: 'source.erlang' } - - -oop.inherits(ErlangHighlightRules, TextHighlightRules); - -exports.ErlangHighlightRules = ErlangHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-forth.js b/util/build-sample-browser/player/vendor/ace/mode-forth.js deleted file mode 100644 index 2b7508eff2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-forth.js +++ /dev/null @@ -1,280 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/forth', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/forth_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ForthHighlightRules = require("./forth_highlight_rules").ForthHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ForthHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "(?<=^|\\s)\\.?\\( [^)]*\\)"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/forth"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/forth_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ForthHighlightRules = function() { - - this.$rules = { start: [ { include: '#forth' } ], - '#comment': - [ { token: 'comment.line.double-dash.forth', - regex: '(?:^|\\s)--\\s.*$', - comment: 'line comments for iForth' }, - { token: 'comment.line.backslash.forth', - regex: '(?:^|\\s)\\\\[\\s\\S]*$', - comment: 'ANSI line comment' }, - { token: 'comment.line.backslash-g.forth', - regex: '(?:^|\\s)\\\\[Gg] .*$', - comment: 'gForth line comment' }, - { token: 'comment.block.forth', - regex: '(?:^|\\s)\\(\\*(?=\\s|$)', - push: - [ { token: 'comment.block.forth', - regex: '(?:^|\\s)\\*\\)(?=\\s|$)', - next: 'pop' }, - { defaultToken: 'comment.block.forth' } ], - comment: 'multiline comments for iForth' }, - { token: 'comment.block.documentation.forth', - regex: '\\bDOC\\b', - caseInsensitive: true, - push: - [ { token: 'comment.block.documentation.forth', - regex: '\\bENDDOC\\b', - caseInsensitive: true, - next: 'pop' }, - { defaultToken: 'comment.block.documentation.forth' } ], - comment: 'documentation comments for iForth' }, - { token: 'comment.line.parentheses.forth', - regex: '(?:^|\\s)\\.?\\( [^)]*\\)', - comment: 'ANSI line comment' } ], - '#constant': - [ { token: 'constant.language.forth', - regex: '(?:^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s|$)', - caseInsensitive: true}, - { token: 'constant.numeric.forth', - regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)'}, - { token: 'constant.character.forth', - regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)'}], - '#forth': - [ { include: '#constant' }, - { include: '#comment' }, - { include: '#string' }, - { include: '#word' }, - { include: '#variable' }, - { include: '#storage' }, - { include: '#word-def' } ], - '#storage': - [ { token: 'storage.type.forth', - regex: '(?:^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s|$)', - caseInsensitive: true}], - '#string': - [ { token: 'string.quoted.double.forth', - regex: '(ABORT" |BREAK" |\\." |C" |0"|S\\\\?" )([^"]+")', - caseInsensitive: true}, - { token: 'string.unquoted.forth', - regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\S+(?=\\s|$)', - caseInsensitive: true}], - '#variable': - [ { token: 'variable.language.forth', - regex: '\\b(?:I|J)\\b', - caseInsensitive: true } ], - '#word': - [ { token: 'keyword.control.immediate.forth', - regex: '(?:^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s|$)', - caseInsensitive: true}, - { token: 'keyword.other.immediate.forth', - regex: '(?:^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s|$)', - caseInsensitive: true}, - { token: 'keyword.control.compile-only.forth', - regex: '(?:^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s|$)', - caseInsensitive: true}, - { token: 'keyword.other.compile-only.forth', - regex: '(?:^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s|$)', - caseInsensitive: true}, - { token: 'keyword.other.non-immediate.forth', - regex: '(?:^|\\s)(?:\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s|$)', - caseInsensitive: true}, - { token: 'keyword.other.warning.forth', - regex: '(?:^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s|$)', - caseInsensitive: true}], - '#word-def': - [ { token: - [ 'keyword.other.compile-only.forth', - 'keyword.other.compile-only.forth', - 'meta.block.forth', - 'entity.name.function.forth' ], - regex: '(:NONAME)|(^:|\\s:)(\\s)(\\S+)(?=\\s|$)', - caseInsensitive: true, - push: - [ { token: 'keyword.other.compile-only.forth', - regex: ';(?:CODE)?', - caseInsensitive: true, - next: 'pop' }, - { include: '#constant' }, - { include: '#comment' }, - { include: '#string' }, - { include: '#word' }, - { include: '#variable' }, - { include: '#storage' }, - { defaultToken: 'meta.block.forth' } ] } ] } - - this.normalizeRules(); -}; - -ForthHighlightRules.metaData = { fileTypes: [ 'frt', 'fs', 'ldr' ], - foldingStartMarker: '/\\*\\*|\\{\\s*$', - foldingStopMarker: '\\*\\*/|^\\s*\\}', - keyEquivalent: '^~F', - name: 'Forth', - scopeName: 'source.forth' } - - -oop.inherits(ForthHighlightRules, TextHighlightRules); - -exports.ForthHighlightRules = ForthHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-ftl.js b/util/build-sample-browser/player/vendor/ace/mode-ftl.js deleted file mode 100644 index 6e6d85cfb7..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-ftl.js +++ /dev/null @@ -1,1061 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/ftl', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ftl_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var FtlHighlightRules = require("./ftl_highlight_rules").FtlHighlightRules; - -var Mode = function() { - this.HighlightRules = FtlHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.$id = "ace/mode/ftl"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/ftl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var FtlLangHighlightRules = function () { - - var stringBuiltIns = "\\?|substring|cap_first|uncap_first|capitalize|chop_linebreak|date|time|datetime|" - + "ends_with|html|groups|index_of|j_string|js_string|json_string|last_index_of|length|lower_case|" - + "left_pad|right_pad|contains|matches|number|replace|rtf|url|split|starts_with|string|trim|" - + "upper_case|word_list|xhtml|xml"; - var numberBuiltIns = "c|round|floor|ceiling"; - var dateBuiltIns = "iso_[a-z_]+"; - var seqBuiltIns = "first|last|seq_contains|seq_index_of|seq_last_index_of|reverse|size|sort|sort_by|chunk"; - var hashBuiltIns = "keys|values"; - var xmlBuiltIns = "children|parent|root|ancestors|node_name|node_type|node_namespace"; - var expertBuiltIns = "byte|double|float|int|long|short|number_to_date|number_to_time|number_to_datetime|" - + "eval|has_content|interpret|is_[a-z_]+|namespacenew"; - var allBuiltIns = stringBuiltIns + numberBuiltIns + dateBuiltIns + seqBuiltIns + hashBuiltIns - + xmlBuiltIns + expertBuiltIns; - - var deprecatedBuiltIns = "default|exists|if_exists|web_safe"; - - var variables = "data_model|error|globals|lang|locale|locals|main|namespace|node|current_node|" - + "now|output_encoding|template_name|url_escaping_charset|vars|version"; - - var operators = "gt|gte|lt|lte|as|in|using"; - - var reserved = "true|false"; - - var attributes = "encoding|parse|locale|number_format|date_format|time_format|datetime_format|time_zone|" - + "url_escaping_charset|classic_compatible|strip_whitespace|strip_text|strict_syntax|ns_prefixes|" - + "attributes"; - - this.$rules = { - "start" : [{ - token : "constant.character.entity", - regex : /&[^;]+;/ - }, { - token : "support.function", - regex : "\\?("+allBuiltIns+")" - }, { - token : "support.function.deprecated", - regex : "\\?("+deprecatedBuiltIns+")" - }, { - token : "language.variable", - regex : "\\.(?:"+variables+")" - }, { - token : "constant.language", - regex : "\\b("+reserved+")\\b" - }, { - token : "keyword.operator", - regex : "\\b(?:"+operators+")\\b" - }, { - token : "entity.other.attribute-name", - regex : attributes - }, { - token : "string", // - regex : /['"]/, - next : "qstring" - }, { - token : function(value) { - if (value.match("^[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?$")) { - return "constant.numeric"; - } else { - return "variable"; - } - }, - regex : /[\w.+\-]+/ - }, { - token : "keyword.operator", - regex : "!|\\.|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - }], - - "qstring" : [{ - token : "constant.character.escape", - regex : '\\\\[nrtvef\\\\"$]' - }, { - token : "string", - regex : /['"]/, - next : "start" - }, { - defaultToken : "string" - }] - }; -}; - -oop.inherits(FtlLangHighlightRules, TextHighlightRules); - -var FtlHighlightRules = function() { - HtmlHighlightRules.call(this); - - var directives = "assign|attempt|break|case|compress|default|elseif|else|escape|fallback|function|flush|" - + "ftl|global|if|import|include|list|local|lt|macro|nested|noescape|noparse|nt|recover|recurse|return|rt|" - + "setting|stop|switch|t|visit"; - - var startRules = [ - { - token : "comment", - regex : "<#--", - next : "ftl-dcomment" - }, { - token : "string.interpolated", - regex : "\\${", - push : "ftl-start" - }, { - token : "keyword.function", - regex : "", - next : "pop" - }, { - token : "string.interpolated", - regex : "}", - next : "pop" - } - ]; - - for (var key in this.$rules) - this.$rules[key].unshift.apply(this.$rules[key], startRules); - - this.embedRules(FtlLangHighlightRules, "ftl-", endRules, ["start"]); - - this.addRules({ - "ftl-dcomment" : [{ - token : "comment", - regex : ".*?-->", - next : "pop" - }, { - token : "comment", - regex : ".+" - }] - }); - - this.normalizeRules(); -}; - -oop.inherits(FtlHighlightRules, HtmlHighlightRules); - -exports.FtlHighlightRules = FtlHighlightRules; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-gherkin.js b/util/build-sample-browser/player/vendor/ace/mode-gherkin.js deleted file mode 100644 index 85f8c3b2d1..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-gherkin.js +++ /dev/null @@ -1,160 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2014, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/gherkin', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/gherkin_highlight_rules'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var GherkinHighlightRules = require("./gherkin_highlight_rules").GherkinHighlightRules; - -var Mode = function() { - this.HighlightRules = GherkinHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "#"; - this.$id = "ace/mode/gherkin"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var space2 = " "; - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - console.log(state) - - if(line.match("[ ]*\\|")) { - indent += "| "; - } - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - - if (state == "start") { - if (line.match("Scenario:|Feature:|Scenario\ Outline:|Background:")) { - indent += space2; - } else if(line.match("(Given|Then).+(:)$|Examples:")) { - indent += space2; - } else if(line.match("\\*.+")) { - indent += "* "; - } - } - - - return indent; - }; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/gherkin_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"; - -var GherkinHighlightRules = function() { - this.$rules = { - start : [{ - token: 'constant.numeric', - regex: "(?:(?:[1-9]\\d*)|(?:0))" - }, { - token : "comment", - regex : "#.*$" - }, { - token : "keyword", - regex : "Feature:|Background:|Scenario:|Scenario\ Outline:|Examples:|Given|When|Then|And|But|\\*", - }, { - token : "string", // multi line """ string start - regex : '"{3}', - next : "qqstring3" - }, { - token : "string", // " string - regex : '"', - next : "qqstring" - }, { - token : "comment", - regex : "@[A-Za-z0-9]+", - next : "start" - }, { - token : "comment", - regex : "<.+>" - }, { - token : "comment", - regex : "\\| ", - next : "table-item" - }, { - token : "comment", - regex : "\\|$", - next : "start" - }], - "qqstring3" : [ { - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", // multi line """ string end - regex : '"{3}', - next : "start" - }, { - defaultToken : "string" - }], - "qqstring" : [{ - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "start" - }, { - defaultToken: "string" - }], - "table-item" : [{ - token : "string", - regex : "[A-Za-z0-9 ]*", - next : "start" - }], - }; - -} - -oop.inherits(GherkinHighlightRules, TextHighlightRules); - -exports.GherkinHighlightRules = GherkinHighlightRules; -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/mode-glsl.js b/util/build-sample-browser/player/vendor/ace/mode-glsl.js deleted file mode 100644 index 3066bd0e83..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-glsl.js +++ /dev/null @@ -1,894 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/glsl', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/c_cpp', 'ace/tokenizer', 'ace/mode/glsl_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var CMode = require("./c_cpp").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var glslHighlightRules = require("./glsl_highlight_rules").glslHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = glslHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, CMode); - -(function() { - this.$id = "ace/mode/glsl"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/c_cpp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c_cpp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = c_cppHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/c_cpp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/c_cpp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" - -var c_cppHighlightRules = function() { - - var keywordControls = ( - "break|case|continue|default|do|else|for|goto|if|_Pragma|" + - "return|switch|while|catch|operator|try|throw|using" - ); - - var storageType = ( - "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + - "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + - "class|wchar_t|template" - ); - - var storageModifiers = ( - "const|extern|register|restrict|static|volatile|inline|private:|" + - "protected:|public:|friend|explicit|virtual|export|mutable|typename" - ); - - var keywordOperators = ( - "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + - "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" - ); - - var builtinConstants = ( - "NULL|true|false|TRUE|FALSE" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.control" : keywordControls, - "storage.type" : storageType, - "storage.modifier" : storageModifiers, - "keyword.operator" : keywordOperators, - "variable.language": "this", - "constant.language": builtinConstants - }, "identifier"); - - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "keyword", // pre-compiler directives - regex : "#\\s*(?:include|import|pragma|line|define|undef|if|ifdef|else|elif|ifndef)\\b", - next : "directive" - }, { - token : "keyword", // special case pre-compiler directive - regex : "(?:#\\s*endif)\\b" - }, { - token : "support.function.C99.c", - regex : cFunctions - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "directive" : [ - { - token : "constant.other.multiline", - regex : /\\/ - }, - { - token : "constant.other.multiline", - regex : /.*\\/ - }, - { - token : "constant.other", - regex : "\\s*<.+?>", - next : "start" - }, - { - token : "constant.other", // single line - regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', - next : "start" - }, - { - token : "constant.other", // single line - regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", - next : "start" - }, - { - token : "constant.other", - regex : /[^\\\/]+/, - next : "start" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(c_cppHighlightRules, TextHighlightRules); - -exports.c_cppHighlightRules = c_cppHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/glsl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/c_cpp_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; - -var glslHighlightRules = function() { - - var keywords = ( - "attribute|const|uniform|varying|break|continue|do|for|while|" + - "if|else|in|out|inout|float|int|void|bool|true|false|" + - "lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|" + - "mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|" + - "samplerCube|struct" - ); - - var buildinConstants = ( - "radians|degrees|sin|cos|tan|asin|acos|atan|pow|" + - "exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|" + - "min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|" + - "normalize|faceforward|reflect|refract|matrixCompMult|lessThan|" + - "lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|" + - "not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|" + - "texture2DProjLod|textureCube|textureCubeLod|" + - "gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|" + - "gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|" + - "gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|" + - "gl_DepthRangeParameters|gl_DepthRange|" + - "gl_Position|gl_PointSize|" + - "gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData" - ); - - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": keywords, - "constant.language": buildinConstants - }, "identifier"); - - this.$rules = new c_cppHighlightRules().$rules; - this.$rules.start.forEach(function(rule) { - if (typeof rule.token == "function") - rule.token = keywordMapper; - }) -}; - -oop.inherits(glslHighlightRules, c_cppHighlightRules); - -exports.glslHighlightRules = glslHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-golang.js b/util/build-sample-browser/player/vendor/ace/mode-golang.js deleted file mode 100644 index 271e6392d2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-golang.js +++ /dev/null @@ -1,704 +0,0 @@ -ace.define('ace/mode/golang', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/golang_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var GolangHighlightRules = require("./golang_highlight_rules").GolangHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = GolangHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - };//end getNextLineIndent - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/golang"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/golang_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - var oop = require("../lib/oop"); - var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - var GolangHighlightRules = function() { - var keywords = ( - "else|break|case|return|goto|if|const|select|" + - "continue|struct|default|switch|for|range|" + - "func|import|package|chan|defer|fallthrough|go|interface|map|range|" + - "select|type|var" - ); - var builtinTypes = ( - "string|uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|" + - "float64|complex64|complex128|byte|rune|uint|int|uintptr|bool|error" - ); - var builtinFunctions = ( - "make|close|new|panic|recover" - ); - var builtinConstants = ("nil|true|false|iota"); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": builtinConstants, - "support.function": builtinFunctions, - "support.type": builtinTypes - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : '[`](?:[^`]*)[`]' - }, { - token : "string", // multi line string start - merge : true, - regex : '[`](?:[^`]*)$', - next : "bqstring" - }, { - token : "constant.numeric", // rune - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))[']" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token: "invalid", - regex: "\\s+$" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "bqstring" : [ - { - token : "string", - regex : '(?:[^`]*)`', - next : "start" - }, { - token : "string", - regex : '.+' - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); - }; - oop.inherits(GolangHighlightRules, TextHighlightRules); - - exports.GolangHighlightRules = GolangHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-groovy.js b/util/build-sample-browser/player/vendor/ace/mode-groovy.js deleted file mode 100644 index 3bc8d0a9fb..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-groovy.js +++ /dev/null @@ -1,1125 +0,0 @@ -ace.define('ace/mode/groovy', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/groovy_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var JavaScriptMode = require("./javascript").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRules; - -var Mode = function() { - JavaScriptMode.call(this); - this.HighlightRules = GroovyHighlightRules; -}; -oop.inherits(Mode, JavaScriptMode); - -(function() { - - this.createWorker = function(session) { - return null; - }; - - this.$id = "ace/mode/groovy"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); -ace.define('ace/mode/groovy_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var GroovyHighlightRules = function() { - - var keywords = ( - "assert|with|abstract|continue|for|new|switch|" + - "assert|default|goto|package|synchronized|" + - "boolean|do|if|private|this|" + - "break|double|implements|protected|throw|" + - "byte|else|import|public|throws|" + - "case|enum|instanceof|return|transient|" + - "catch|extends|int|short|try|" + - "char|final|interface|static|void|" + - "class|finally|long|strictfp|volatile|" + - "def|float|native|super|while" - ); - - var buildinConstants = ( - "null|Infinity|NaN|undefined" - ); - - var langClasses = ( - "AbstractMethodError|AssertionError|ClassCircularityError|"+ - "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ - "ExceptionInInitializerError|IllegalAccessError|"+ - "IllegalThreadStateException|InstantiationError|InternalError|"+ - "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ - "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ - "SuppressWarnings|TypeNotPresentException|UnknownError|"+ - "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ - "InstantiationException|IndexOutOfBoundsException|"+ - "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ - "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ - "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ - "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ - "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ - "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ - "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ - "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ - "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ - "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ - "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ - "ArrayStoreException|ClassCastException|LinkageError|"+ - "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ - "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ - "Cloneable|Class|CharSequence|Comparable|String|Object" - ); - - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": keywords, - "support.function": langClasses, - "constant.language": buildinConstants - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", - regex : '"""', - next : "qqstring" - }, { - token : "string", - regex : "'''", - next : "qstring" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\?:|\\?\\.|\\*\\.|<=>|=~|==~|\\.@|\\*\\.@|\\.&|as|in|is|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/ - }, { - token : "constant.language.escape", - regex : /\$[\w\d]+/ - }, { - token : "constant.language.escape", - regex : /\$\{[^"\}]+\}?/ - }, { - token : "string", - regex : '"{3,5}', - next : "start" - }, { - token : "string", - regex : '.+?' - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/ - }, { - token : "string", - regex : "'{3,5}", - next : "start" - }, { - token : "string", - regex : ".+?" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(GroovyHighlightRules, TextHighlightRules); - -exports.GroovyHighlightRules = GroovyHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-haml.js b/util/build-sample-browser/player/vendor/ace/mode-haml.js deleted file mode 100644 index 8d4a2f0f90..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-haml.js +++ /dev/null @@ -1,498 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Garen J. Torikian < gjtorikian AT gmail DOT com > - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/haml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/haml_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HamlHighlightRules = require("./haml_highlight_rules").HamlHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = HamlHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ["//", "#"]; - - this.$id = "ace/mode/haml"; -}).call(Mode.prototype); - -exports.Mode = Mode; -});ace.define('ace/mode/haml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/ruby_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var RubyExports = require("./ruby_highlight_rules"); -var RubyHighlightRules = RubyExports.RubyHighlightRules; - -var HamlHighlightRules = function() { - - this.$rules = - { - "start": [ - { - token : "punctuation.section.comment", - regex : /^\s*\/.*/ - }, - { - token : "punctuation.section.comment", - regex : /^\s*#.*/ - }, - { - token: "string.quoted.double", - regex: "==.+?==" - }, - { - token: "keyword.other.doctype", - regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" - }, - RubyExports.qString, - RubyExports.qqString, - RubyExports.tString, - { - token: ["entity.name.tag.haml"], - regex: /^\s*%[\w:]+/, - next: "tag_single" - }, - { - token: [ "meta.escape.haml" ], - regex: "^\\s*\\\\." - }, - RubyExports.constantNumericHex, - RubyExports.constantNumericFloat, - - RubyExports.constantOtherSymbol, - { - token: "text", - regex: "=|-|~", - next: "embedded_ruby" - } - ], - "tag_single": [ - { - token: "entity.other.attribute-name.class.haml", - regex: "\\.[\\w-]+" - }, - { - token: "entity.other.attribute-name.id.haml", - regex: "#[\\w-]+" - }, - { - token: "punctuation.section", - regex: "\\{", - next: "section" - }, - - RubyExports.constantOtherSymbol, - - { - token: "text", - regex: /\s/, - next: "start" - }, - { - token: "empty", - regex: "$|(?!\\.|#|\\{|\\[|=|-|~|\\/)", - next: "start" - } - ], - "section": [ - RubyExports.constantOtherSymbol, - - RubyExports.qString, - RubyExports.qqString, - RubyExports.tString, - - RubyExports.constantNumericHex, - RubyExports.constantNumericFloat, - { - token: "punctuation.section", - regex: "\\}", - next: "start" - } - ], - "embedded_ruby": [ - RubyExports.constantNumericHex, - RubyExports.constantNumericFloat, - { - token : "support.class", // class name - regex : "[A-Z][a-zA-Z_\\d]+" - }, - { - token : new RubyHighlightRules().getKeywords(), - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, - { - token : ["keyword", "text", "text"], - regex : "(?:do|\\{)(?: \\|[^|]+\\|)?$", - next : "start" - }, - { - token : ["text"], - regex : "^$", - next : "start" - }, - { - token : ["text"], - regex : "^(?!.*\\|\\s*$)", - next : "start" - } - ] -} - -}; - -oop.inherits(HamlHighlightRules, TextHighlightRules); - -exports.HamlHighlightRules = HamlHighlightRules; -}); - -ace.define('ace/mode/ruby_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var constantOtherSymbol = exports.constantOtherSymbol = { - token : "constant.other.symbol.ruby", // symbol - regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?" -}; - -var qString = exports.qString = { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" -}; - -var qqString = exports.qqString = { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' -}; - -var tString = exports.tString = { - token : "string", // backtick string - regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]" -}; - -var constantNumericHex = exports.constantNumericHex = { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b" -}; - -var constantNumericFloat = exports.constantNumericFloat = { - token : "constant.numeric", // float - regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b" -}; - -var RubyHighlightRules = function() { - - var builtinFunctions = ( - "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" + - "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + - "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" + - "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" + - "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" + - "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" + - "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" + - "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" + - "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" + - "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" + - "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" + - "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" + - "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" + - "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" + - "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" + - "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" + - "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" + - "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" + - "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" + - "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" + - "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" + - "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" + - "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" + - "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" + - "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" + - "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" + - "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" + - "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" + - "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" + - "has_many|has_one|belongs_to|has_and_belongs_to_many" - ); - - var keywords = ( - "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" + - "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + - "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield" - ); - - var buildinConstants = ( - "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" + - "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING" - ); - - var builtinVariables = ( - "\$DEBUG|\$defout|\$FILENAME|\$LOAD_PATH|\$SAFE|\$stdin|\$stdout|\$stderr|\$VERBOSE|" + - "$!|root_url|flash|session|cookies|params|request|response|logger|self" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": buildinConstants, - "variable.language": builtinVariables, - "support.function": builtinFunctions, - "invalid.deprecated": "debugger" // TODO is this a remnant from js mode? - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "#.*$" - }, { - token : "comment", // multi line comment - regex : "^=begin(?:$|\\s.*$)", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, - - qString, - qqString, - tString, - - { - token : "text", // namespaces aren't symbols - regex : "::" - }, { - token : "variable.instance", // instance variable - regex : "@{1,2}[a-zA-Z_\\d]+" - }, { - token : "support.class", // class name - regex : "[A-Z][a-zA-Z_\\d]+" - }, - - constantOtherSymbol, - constantNumericHex, - constantNumericFloat, - - { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "punctuation.separator.key-value", - regex : "=>" - }, { - stateName: "heredoc", - onMatch : function(value, currentState, stack) { - var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; - var tokens = value.split(this.splitRegex); - stack.push(next, tokens[3]); - return [ - {type:"constant", value: tokens[1]}, - {type:"string", value: tokens[2]}, - {type:"support.class", value: tokens[3]}, - {type:"string", value: tokens[4]} - ]; - }, - regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", - rules: { - heredoc: [{ - onMatch: function(value, currentState, stack) { - if (value === stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack[0] || "start"; - return "support.class"; - } - this.next = ""; - return "string"; - }, - regex: ".*$", - next: "start" - }], - indentedHeredoc: [{ - token: "string", - regex: "^ +" - }, { - onMatch: function(value, currentState, stack) { - if (value === stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack[0] || "start"; - return "support.class"; - } - this.next = ""; - return "string"; - }, - regex: ".*$", - next: "start" - }] - } - }, { - regex : "$", - token : "empty", - next : function(currentState, stack) { - if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") - return stack[0]; - return currentState; - } - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : "^=end(?:$|\\s.*$)", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; - - this.normalizeRules(); -}; - -oop.inherits(RubyHighlightRules, TextHighlightRules); - -exports.RubyHighlightRules = RubyHighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-handlebars.js b/util/build-sample-browser/player/vendor/ace/mode-handlebars.js deleted file mode 100644 index 74089ed769..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-handlebars.js +++ /dev/null @@ -1,2485 +0,0 @@ -/* global define */ - -ace.define('ace/mode/handlebars', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/handlebars_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlMode = require("./html").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HandlebarsHighlightRules = require("./handlebars_highlight_rules").HandlebarsHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; - -var Mode = function() { - HtmlMode.call(this); - this.HighlightRules = HandlebarsHighlightRules; - this.$behaviour = new HtmlBehaviour(); - - - this.foldingRules = new HtmlFoldMode(); -}; - -oop.inherits(Mode, HtmlMode); - -(function() { - - this.$id = "ace/mode/handlebars"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/handlebars_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/xml_util'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var xmlUtil = require("./xml_util"); -function pop2(currentState, stack) { - stack.splice(0, 3); - return stack.shift() || "start"; -} -var HandlebarsHighlightRules = function() { - HtmlHighlightRules.call(this); - var hbs = { - regex : "(?={{)", - push : "handlebars" - } - for (var key in this.$rules) { - this.$rules[key].unshift(hbs); - } - this.$rules.handlebars = [{ - token : "comment.start", - regex : "{{!--", - push : [{ - token : "comment.end", - regex : "--}}", - next : pop2 - }, { - defaultToken : "comment" - }] - }, { - token : "comment.start", - regex : "{{!", - push : [{ - token : "comment.end", - regex : "}}", - next : pop2 - }, { - defaultToken : "comment" - }] - }, { - token : "storage.type.start", // begin section - regex : "{{[#\\^/&]?", - push : [{ - token : "storage.type.end", - regex : "}}", - next : pop2 - }, { - token : "variable.parameter", - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" - }] - }, { - token : "support.function", // unescaped variable - regex : "{{{", - push : [{ - token : "support.function", - regex : "}}}", - next : pop2 - }, { - token : "variable.parameter", - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" - }] - }]; - - this.normalizeRules(); -}; - -oop.inherits(HandlebarsHighlightRules, HtmlHighlightRules); - -exports.HandlebarsHighlightRules = HandlebarsHighlightRules; -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-haskell.js b/util/build-sample-browser/player/vendor/ace/mode-haskell.js deleted file mode 100644 index a81e71e8a2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-haskell.js +++ /dev/null @@ -1,362 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/haskell', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/haskell_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HaskellHighlightRules = require("./haskell_highlight_rules").HaskellHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = HaskellHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "--"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/haskell"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/haskell_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var HaskellHighlightRules = function() { - - this.$rules = { start: - [ { token: - [ 'punctuation.definition.entity.haskell', - 'keyword.operator.function.infix.haskell', - 'punctuation.definition.entity.haskell' ], - regex: '(`)([a-zA-Z_\']*?)(`)', - comment: 'In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]).' }, - { token: 'constant.language.unit.haskell', regex: '\\(\\)' }, - { token: 'constant.language.empty-list.haskell', - regex: '\\[\\]' }, - { token: 'keyword.other.haskell', - regex: 'module', - push: - [ { token: 'keyword.other.haskell', regex: 'where', next: 'pop' }, - { include: '#module_name' }, - { include: '#module_exports' }, - { token: 'invalid', regex: '[a-z]+' }, - { defaultToken: 'meta.declaration.module.haskell' } ] }, - { token: 'keyword.other.haskell', - regex: '\\bclass\\b', - push: - [ { token: 'keyword.other.haskell', - regex: '\\bwhere\\b', - next: 'pop' }, - { token: 'support.class.prelude.haskell', - regex: '\\b(?:Monad|Functor|Eq|Ord|Read|Show|Num|(?:Frac|Ra)tional|Enum|Bounded|Real(?:Frac|Float)?|Integral|Floating)\\b' }, - { token: 'entity.other.inherited-class.haskell', - regex: '[A-Z][A-Za-z_\']*' }, - { token: 'variable.other.generic-type.haskell', - regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' }, - { defaultToken: 'meta.declaration.class.haskell' } ] }, - { token: 'keyword.other.haskell', - regex: '\\binstance\\b', - push: - [ { token: 'keyword.other.haskell', - regex: '\\bwhere\\b|$', - next: 'pop' }, - { include: '#type_signature' }, - { defaultToken: 'meta.declaration.instance.haskell' } ] }, - { token: 'keyword.other.haskell', - regex: 'import', - push: - [ { token: 'meta.import.haskell', regex: '$|;', next: 'pop' }, - { token: 'keyword.other.haskell', regex: 'qualified|as|hiding' }, - { include: '#module_name' }, - { include: '#module_exports' }, - { defaultToken: 'meta.import.haskell' } ] }, - { token: [ 'keyword.other.haskell', 'meta.deriving.haskell' ], - regex: '(deriving)(\\s*\\()', - push: - [ { token: 'meta.deriving.haskell', regex: '\\)', next: 'pop' }, - { token: 'entity.other.inherited-class.haskell', - regex: '\\b[A-Z][a-zA-Z_\']*' }, - { defaultToken: 'meta.deriving.haskell' } ] }, - { token: 'keyword.other.haskell', - regex: '\\b(?:deriving|where|data|type|case|of|let|in|newtype|default)\\b' }, - { token: 'keyword.operator.haskell', regex: '\\binfix[lr]?\\b' }, - { token: 'keyword.control.haskell', - regex: '\\b(?:do|if|then|else)\\b' }, - { token: 'constant.numeric.float.haskell', - regex: '\\b(?:[0-9]+\\.[0-9]+(?:[eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b', - comment: 'Floats are always decimal' }, - { token: 'constant.numeric.haskell', - regex: '\\b(?:[0-9]+|0(?:[xX][0-9a-fA-F]+|[oO][0-7]+))\\b' }, - { token: - [ 'meta.preprocessor.c', - 'punctuation.definition.preprocessor.c', - 'meta.preprocessor.c' ], - regex: '^(\\s*)(#)(\\s*\\w+)', - comment: 'In addition to Haskell\'s "native" syntax, GHC permits the C preprocessor to be run on a source file.' }, - { include: '#pragma' }, - { token: 'punctuation.definition.string.begin.haskell', - regex: '"', - push: - [ { token: 'punctuation.definition.string.end.haskell', - regex: '"', - next: 'pop' }, - { token: 'constant.character.escape.haskell', - regex: '\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&])' }, - { token: 'constant.character.escape.octal.haskell', - regex: '\\\\o[0-7]+|\\\\x[0-9A-Fa-f]+|\\\\[0-9]+' }, - { token: 'constant.character.escape.control.haskell', - regex: '\\^[A-Z@\\[\\]\\\\\\^_]' }, - { defaultToken: 'string.quoted.double.haskell' } ] }, - { token: - [ 'punctuation.definition.string.begin.haskell', - 'string.quoted.single.haskell', - 'constant.character.escape.haskell', - 'constant.character.escape.octal.haskell', - 'constant.character.escape.hexadecimal.haskell', - 'constant.character.escape.control.haskell', - 'punctuation.definition.string.end.haskell' ], - regex: '(\')(?:([\\ -\\[\\]-~])|(\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_]))(\')' }, - { token: - [ 'meta.function.type-declaration.haskell', - 'entity.name.function.haskell', - 'meta.function.type-declaration.haskell', - 'keyword.other.double-colon.haskell' ], - regex: '^(\\s*)([a-z_][a-zA-Z0-9_\']*|\\([|!%$+\\-.,=]+\\))(\\s*)(::)', - push: - [ { token: 'meta.function.type-declaration.haskell', - regex: '$', - next: 'pop' }, - { include: '#type_signature' }, - { defaultToken: 'meta.function.type-declaration.haskell' } ] }, - { token: 'support.constant.haskell', - regex: '\\b(?:Just|Nothing|Left|Right|True|False|LT|EQ|GT|\\(\\)|\\[\\])\\b' }, - { token: 'constant.other.haskell', regex: '\\b[A-Z]\\w*\\b' }, - { include: '#comments' }, - { token: 'support.function.prelude.haskell', - regex: '\\b(?:abs|acos|acosh|all|and|any|appendFile|applyM|asTypeOf|asin|asinh|atan|atan2|atanh|break|catch|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showList|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\\b' }, - { include: '#infix_op' }, - { token: 'keyword.operator.haskell', - regex: '[|!%$?~+:\\-.=\\\\]+', - comment: 'In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.' }, - { token: 'punctuation.separator.comma.haskell', regex: ',' } ], - '#block_comment': - [ { token: 'punctuation.definition.comment.haskell', - regex: '\\{-(?!#)', - push: - [ { include: '#block_comment' }, - { token: 'punctuation.definition.comment.haskell', - regex: '-\\}', - next: 'pop' }, - { defaultToken: 'comment.block.haskell' } ] } ], - '#comments': - [ { token: 'punctuation.definition.comment.haskell', - regex: '--.*', - push_: - [ { token: 'comment.line.double-dash.haskell', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-dash.haskell' } ] }, - { include: '#block_comment' } ], - '#infix_op': - [ { token: 'entity.name.function.infix.haskell', - regex: '\\([|!%$+:\\-.=]+\\)|\\(,+\\)' } ], - '#module_exports': - [ { token: 'meta.declaration.exports.haskell', - regex: '\\(', - push: - [ { token: 'meta.declaration.exports.haskell', - regex: '\\)', - next: 'pop' }, - { token: 'entity.name.function.haskell', - regex: '\\b[a-z][a-zA-Z_\']*' }, - { token: 'storage.type.haskell', regex: '\\b[A-Z][A-Za-z_\']*' }, - { token: 'punctuation.separator.comma.haskell', regex: ',' }, - { include: '#infix_op' }, - { token: 'meta.other.unknown.haskell', - regex: '\\(.*?\\)', - comment: 'So named because I don\'t know what to call this.' }, - { defaultToken: 'meta.declaration.exports.haskell' } ] } ], - '#module_name': - [ { token: 'support.other.module.haskell', - regex: '[A-Z][A-Za-z._\']*' } ], - '#pragma': - [ { token: 'meta.preprocessor.haskell', - regex: '\\{-#', - push: - [ { token: 'meta.preprocessor.haskell', - regex: '#-\\}', - next: 'pop' }, - { token: 'keyword.other.preprocessor.haskell', - regex: '\\b(?:LANGUAGE|UNPACK|INLINE)\\b' }, - { defaultToken: 'meta.preprocessor.haskell' } ] } ], - '#type_signature': - [ { token: - [ 'meta.class-constraint.haskell', - 'entity.other.inherited-class.haskell', - 'meta.class-constraint.haskell', - 'variable.other.generic-type.haskell', - 'meta.class-constraint.haskell', - 'keyword.other.big-arrow.haskell' ], - regex: '(\\(\\s*)([A-Z][A-Za-z]*)(\\s+)([a-z][A-Za-z_\']*)(\\)\\s*)(=>)' }, - { include: '#pragma' }, - { token: 'keyword.other.arrow.haskell', regex: '->' }, - { token: 'keyword.other.big-arrow.haskell', regex: '=>' }, - { token: 'support.type.prelude.haskell', - regex: '\\b(?:Int(?:eger)?|Maybe|Either|Bool|Float|Double|Char|String|Ordering|ShowS|ReadS|FilePath|IO(?:Error)?)\\b' }, - { token: 'variable.other.generic-type.haskell', - regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' }, - { token: 'storage.type.haskell', - regex: '\\b[A-Z][a-zA-Z0-9_\']*\\b' }, - { token: 'support.constant.unit.haskell', regex: '\\(\\)' }, - { include: '#comments' } ] } - - this.normalizeRules(); -}; - -HaskellHighlightRules.metaData = { fileTypes: [ 'hs' ], - keyEquivalent: '^~H', - name: 'Haskell', - scopeName: 'source.haskell' } - - -oop.inherits(HaskellHighlightRules, TextHighlightRules); - -exports.HaskellHighlightRules = HaskellHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-haxe.js b/util/build-sample-browser/player/vendor/ace/mode-haxe.js deleted file mode 100644 index 705e849c11..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-haxe.js +++ /dev/null @@ -1,687 +0,0 @@ -ace.define('ace/mode/haxe', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/haxe_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HaxeHighlightRules = require("./haxe_highlight_rules").HaxeHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = HaxeHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/haxe"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/haxe_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); - -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var HaxeHighlightRules = function() { - - var keywords = ( - "break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std" - ); - - var buildinConstants = ( - "null|true|false" - ); - - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": keywords, - "constant.language": buildinConstants - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({<]" - }, { - token : "paren.rparen", - regex : "[\\])}>]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(HaxeHighlightRules, TextHighlightRules); - -exports.HaxeHighlightRules = HaxeHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-html.js b/util/build-sample-browser/player/vendor/ace/mode-html.js deleted file mode 100644 index e86dc866d0..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-html.js +++ /dev/null @@ -1,2413 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-html_completions.js b/util/build-sample-browser/player/vendor/ace/mode-html_completions.js deleted file mode 100644 index bcac214fd5..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-html_completions.js +++ /dev/null @@ -1,309 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-html_ruby.js b/util/build-sample-browser/player/vendor/ace/mode-html_ruby.js deleted file mode 100644 index 7d60fed7b4..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-html_ruby.js +++ /dev/null @@ -1,2874 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - - -ace.define('ace/mode/html_ruby', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/tokenizer', 'ace/mode/html_ruby_highlight_rules', 'ace/mode/html', 'ace/mode/javascript', 'ace/mode/css', 'ace/mode/ruby'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlRubyHighlightRules = require("./html_ruby_highlight_rules").HtmlRubyHighlightRules; -var HtmlMode = require("./html").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var RubyMode = require("./ruby").Mode; - -var Mode = function() { - HtmlMode.call(this); - this.HighlightRules = HtmlRubyHighlightRules; - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode, - "ruby-": RubyMode - }); -}; -oop.inherits(Mode, HtmlMode); - -(function() { - - this.$id = "ace/mode/html_ruby"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/ruby_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var constantOtherSymbol = exports.constantOtherSymbol = { - token : "constant.other.symbol.ruby", // symbol - regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?" -}; - -var qString = exports.qString = { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" -}; - -var qqString = exports.qqString = { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' -}; - -var tString = exports.tString = { - token : "string", // backtick string - regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]" -}; - -var constantNumericHex = exports.constantNumericHex = { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b" -}; - -var constantNumericFloat = exports.constantNumericFloat = { - token : "constant.numeric", // float - regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b" -}; - -var RubyHighlightRules = function() { - - var builtinFunctions = ( - "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" + - "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + - "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" + - "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" + - "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" + - "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" + - "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" + - "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" + - "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" + - "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" + - "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" + - "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" + - "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" + - "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" + - "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" + - "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" + - "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" + - "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" + - "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" + - "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" + - "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" + - "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" + - "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" + - "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" + - "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" + - "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" + - "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" + - "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" + - "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" + - "has_many|has_one|belongs_to|has_and_belongs_to_many" - ); - - var keywords = ( - "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" + - "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + - "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield" - ); - - var buildinConstants = ( - "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" + - "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING" - ); - - var builtinVariables = ( - "\$DEBUG|\$defout|\$FILENAME|\$LOAD_PATH|\$SAFE|\$stdin|\$stdout|\$stderr|\$VERBOSE|" + - "$!|root_url|flash|session|cookies|params|request|response|logger|self" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": buildinConstants, - "variable.language": builtinVariables, - "support.function": builtinFunctions, - "invalid.deprecated": "debugger" // TODO is this a remnant from js mode? - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "#.*$" - }, { - token : "comment", // multi line comment - regex : "^=begin(?:$|\\s.*$)", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, - - qString, - qqString, - tString, - - { - token : "text", // namespaces aren't symbols - regex : "::" - }, { - token : "variable.instance", // instance variable - regex : "@{1,2}[a-zA-Z_\\d]+" - }, { - token : "support.class", // class name - regex : "[A-Z][a-zA-Z_\\d]+" - }, - - constantOtherSymbol, - constantNumericHex, - constantNumericFloat, - - { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "punctuation.separator.key-value", - regex : "=>" - }, { - stateName: "heredoc", - onMatch : function(value, currentState, stack) { - var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; - var tokens = value.split(this.splitRegex); - stack.push(next, tokens[3]); - return [ - {type:"constant", value: tokens[1]}, - {type:"string", value: tokens[2]}, - {type:"support.class", value: tokens[3]}, - {type:"string", value: tokens[4]} - ]; - }, - regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", - rules: { - heredoc: [{ - onMatch: function(value, currentState, stack) { - if (value === stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack[0] || "start"; - return "support.class"; - } - this.next = ""; - return "string"; - }, - regex: ".*$", - next: "start" - }], - indentedHeredoc: [{ - token: "string", - regex: "^ +" - }, { - onMatch: function(value, currentState, stack) { - if (value === stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack[0] || "start"; - return "support.class"; - } - this.next = ""; - return "string"; - }, - regex: ".*$", - next: "start" - }] - } - }, { - regex : "$", - token : "empty", - next : function(currentState, stack) { - if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") - return stack[0]; - return currentState; - } - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : "^=end(?:$|\\s.*$)", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; - - this.normalizeRules(); -}; - -oop.inherits(RubyHighlightRules, TextHighlightRules); - -exports.RubyHighlightRules = RubyHighlightRules; -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/folding/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var MixedFoldMode = require("./mixed").FoldMode; -var XmlFoldMode = require("./xml").FoldMode; -var CStyleFoldMode = require("./cstyle").FoldMode; - -var FoldMode = exports.FoldMode = function() { - MixedFoldMode.call(this, new XmlFoldMode({ - "area": 1, - "base": 1, - "br": 1, - "col": 1, - "command": 1, - "embed": 1, - "hr": 1, - "img": 1, - "input": 1, - "keygen": 1, - "link": 1, - "meta": 1, - "param": 1, - "source": 1, - "track": 1, - "wbr": 1, - "li": 1, - "dt": 1, - "dd": 1, - "p": 1, - "rt": 1, - "rp": 1, - "optgroup": 1, - "option": 1, - "colgroup": 1, - "td": 1, - "th": 1 - }), { - "js-": new CStyleFoldMode(), - "css-": new CStyleFoldMode() - }); -}; - -oop.inherits(FoldMode, MixedFoldMode); - -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(defaultMode, subModes) { - this.defaultMode = defaultMode; - this.subModes = subModes; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - - this.$getMode = function(state) { - if (typeof state != "string") - state = state[0]; - for (var key in this.subModes) { - if (state.indexOf(key) === 0) - return this.subModes[key]; - } - return null; - }; - - this.$tryMode = function(state, session, foldStyle, row) { - var mode = this.$getMode(state); - return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); - }; - - this.getFoldWidget = function(session, foldStyle, row) { - return ( - this.$tryMode(session.getState(row-1), session, foldStyle, row) || - this.$tryMode(session.getState(row), session, foldStyle, row) || - this.defaultMode.getFoldWidget(session, foldStyle, row) - ); - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var mode = this.$getMode(session.getState(row-1)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.$getMode(session.getState(row)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.defaultMode; - - return mode.getFoldWidgetRange(session, foldStyle, row); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/ruby', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ruby_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = RubyHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - - this.lineCommentStart = "#"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/); - var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/); - var startingConditional = line.match(/^\s*(if|else)\s*/) - if (match || startingClassOrMethod || startingDoBlock || startingConditional) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return /^\s+end$/.test(line + input) || /^\s+}$/.test(line + input) || /^\s+else$/.test(line + input); - }; - - this.autoOutdent = function(state, doc, row) { - var indent = this.$getIndent(doc.getLine(row)); - var tab = doc.getTabString(); - if (indent.slice(-tab.length) == tab) - doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); - }; - - this.$id = "ace/mode/ruby"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/html_ruby_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/ruby_highlight_rules'], function(require, exports, module) { - - - var oop = require("../lib/oop"); - var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; - - var HtmlRubyHighlightRules = function() { - HtmlHighlightRules.call(this); - - var startRules = [ - { - regex: "<%%|%%>", - token: "constant.language.escape" - }, { - token : "comment.start.erb", - regex : "<%#", - push : [{ - token : "comment.end.erb", - regex: "%>", - next: "pop", - defaultToken:"comment" - }] - }, { - token : "support.ruby_tag", - regex : "<%+(?!>)[-=]?", - push : "ruby-start" - } - ]; - - var endRules = [ - { - token : "support.ruby_tag", - regex : "%>", - next : "pop" - }, { - token: "comment", - regex: "#(?:[^%]|%[^>])*" - } - ]; - - for (var key in this.$rules) - this.$rules[key].unshift.apply(this.$rules[key], startRules); - - this.embedRules(RubyHighlightRules, "ruby-", endRules, ["start"]); - - this.normalizeRules(); - }; - - - oop.inherits(HtmlRubyHighlightRules, HtmlHighlightRules); - - exports.HtmlRubyHighlightRules = HtmlRubyHighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-ini.js b/util/build-sample-browser/player/vendor/ace/mode-ini.js deleted file mode 100644 index e1493cbb02..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-ini.js +++ /dev/null @@ -1,185 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/ini', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ini_highlight_rules', 'ace/mode/folding/ini'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var IniHighlightRules = require("./ini_highlight_rules").IniHighlightRules; -var FoldMode = require("./folding/ini").FoldMode; - -var Mode = function() { - this.HighlightRules = IniHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ";"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/ini"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/ini_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var escapeRe = "\\\\(?:[\\\\0abtrn;#=:]|x[a-fA-F\\d]{4})"; - -var IniHighlightRules = function() { - this.$rules = { - start: [{ - token: 'punctuation.definition.comment.ini', - regex: '#.*', - push_: [{ - token: 'comment.line.number-sign.ini', - regex: '$|^', - next: 'pop' - }, { - defaultToken: 'comment.line.number-sign.ini' - }] - }, { - token: 'punctuation.definition.comment.ini', - regex: ';.*', - push_: [{ - token: 'comment.line.semicolon.ini', - regex: '$|^', - next: 'pop' - }, { - defaultToken: 'comment.line.semicolon.ini' - }] - }, { - token: ['keyword.other.definition.ini', 'text', 'punctuation.separator.key-value.ini'], - regex: '\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)' - }, { - token: ['punctuation.definition.entity.ini', 'constant.section.group-title.ini', 'punctuation.definition.entity.ini'], - regex: '^(\\[)(.*?)(\\])' - }, { - token: 'punctuation.definition.string.begin.ini', - regex: "'", - push: [{ - token: 'punctuation.definition.string.end.ini', - regex: "'", - next: 'pop' - }, { - token: "constant.language.escape", - regex: escapeRe - }, { - defaultToken: 'string.quoted.single.ini' - }] - }, { - token: 'punctuation.definition.string.begin.ini', - regex: '"', - push: [{ - token: "constant.language.escape", - regex: escapeRe - }, { - token: 'punctuation.definition.string.end.ini', - regex: '"', - next: 'pop' - }, { - defaultToken: 'string.quoted.double.ini' - }] - }] - }; - - this.normalizeRules(); -}; - -IniHighlightRules.metaData = { - fileTypes: ['ini', 'conf'], - keyEquivalent: '^~I', - name: 'Ini', - scopeName: 'source.ini' -}; - - -oop.inherits(IniHighlightRules, TextHighlightRules); - -exports.IniHighlightRules = IniHighlightRules; -}); - -ace.define('ace/mode/folding/ini', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function() { -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /^\s*\[([^\])]*)]\s*(?:$|[;#])/; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var re = this.foldingStartMarker; - var line = session.getLine(row); - - var m = line.match(re); - - if (!m) return; - - var startName = m[1] + "."; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - if (/^\s*$/.test(line)) - continue; - m = line.match(re); - if (m && m[1].lastIndexOf(startName, 0) !== 0) - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-jack.js b/util/build-sample-browser/player/vendor/ace/mode-jack.js deleted file mode 100644 index dbde96e45d..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-jack.js +++ /dev/null @@ -1,683 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/jack', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jack_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HighlightRules = require("./jack_highlight_rules").JackHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = HighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - - this.$id = "ace/mode/jack"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/jack_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JackHighlightRules = function() { - this.$rules = { - "start" : [ - { - token : "string", - regex : '"', - next : "string2" - }, { - token : "string", - regex : "'", - next : "string1" - }, { - token : "constant.numeric", // hex - regex: "-?0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "(?:0|[-+]?[1-9][0-9]*)\\b" - }, { - token : "constant.binary", - regex : "<[0-9A-Fa-f][0-9A-Fa-f](\\s+[0-9A-Fa-f][0-9A-Fa-f])*>" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : "constant.language.null", - regex : "null\\b" - }, { - token : "storage.type", - regex: "(?:Integer|Boolean|Null|String|Buffer|Tuple|List|Object|Function|Coroutine|Form)\\b" - }, { - token : "keyword", - regex : "(?:return|abort|vars|for|delete|in|is|escape|exec|split|and|if|elif|else|while)\\b" - }, { - token : "language.builtin", - regex : "(?:lines|source|parse|read-stream|interval|substr|parseint|write|print|range|rand|inspect|bind|i-values|i-pairs|i-map|i-filter|i-chunk|i-all\\?|i-any\\?|i-collect|i-zip|i-merge|i-each)\\b" - }, { - token : "comment", - regex : "--.*$" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "storage.form", - regex : "@[a-z]+" - }, { - token : "constant.other.symbol", - regex : ':+[a-zA-Z_]([-]?[a-zA-Z0-9_])*[?!]?' - }, { - token : "variable", - regex : '[a-zA-Z_]([-]?[a-zA-Z0-9_])*[?!]?' - }, { - token : "keyword.operator", - regex : "\\|\\||\\^\\^|&&|!=|==|<=|<|>=|>|\\+|-|\\*|\\/|\\^|\\%|\\#|\\!" - }, { - token : "text", - regex : "\\s+" - } - ], - "string1" : [ - { - token : "constant.language.escape", - regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|['"\\\/bfnrt])/ - }, { - token : "string", - regex : "[^'\\\\]+" - }, { - token : "string", - regex : "'", - next : "start" - }, { - token : "string", - regex : "", - next : "start" - } - ], - "string2" : [ - { - token : "constant.language.escape", - regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|['"\\\/bfnrt])/ - }, { - token : "string", - regex : '[^"\\\\]+' - }, { - token : "string", - regex : '"', - next : "start" - }, { - token : "string", - regex : "", - next : "start" - } - ] - }; - -}; - -oop.inherits(JackHighlightRules, TextHighlightRules); - -exports.JackHighlightRules = JackHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-jade.js b/util/build-sample-browser/player/vendor/ace/mode-jade.js deleted file mode 100644 index 20d8ce2b96..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-jade.js +++ /dev/null @@ -1,2081 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Garen J. Torikian - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/jade', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jade_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = JadeHighlightRules; - - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.$id = "ace/mode/jade"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/markdown_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules', 'ace/mode/html_highlight_rules', 'ace/mode/css_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; - -var escaped = function(ch) { - return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*"; -} - -function github_embed(tag, prefix) { - return { // Github style block - token : "support.function", - regex : "^```" + tag + "\\s*$", - push : prefix + "start" - }; -} - -var MarkdownHighlightRules = function() { - HtmlHighlightRules.call(this); - - this.$rules["start"].unshift({ - token : "empty_line", - regex : '^$', - next: "allowBlock" - }, { // h1 - token: "markup.heading.1", - regex: "^=+(?=\\s*$)" - }, { // h2 - token: "markup.heading.2", - regex: "^\\-+(?=\\s*$)" - }, { - token : function(value) { - return "markup.heading." + value.length; - }, - regex : /^#{1,6}(?=\s*[^ #]|\s+#.)/, - next : "header" - }, - github_embed("(?:javascript|js)", "jscode-"), - github_embed("xml", "xmlcode-"), - github_embed("html", "htmlcode-"), - github_embed("css", "csscode-"), - { // Github style block - token : "support.function", - regex : "^```\\s*\\S*(?:{.*?\\})?\\s*$", - next : "githubblock" - }, { // block quote - token : "string.blockquote", - regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", - next : "blockquote" - }, { // HR * - _ - token : "constant", - regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$", - next: "allowBlock" - }, { // list - token : "markup.list", - regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", - next : "listblock-start" - }, { - include : "basic" - }); - - this.addRules({ - "basic" : [{ - token : "constant.language.escape", - regex : /\\[\\`*_{}\[\]()#+\-.!]/ - }, { // code span ` - token : "support.function", - regex : "(`+)(.*?[^`])(\\1)" - }, { // reference - token : ["text", "constant", "text", "url", "string", "text"], - regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" - }, { // link by reference - token : ["text", "string", "text", "constant", "text"], - regex : "(\\[)(" + escaped("]") + ")(\\]\s*\\[)("+ escaped("]") + ")(\\])" - }, { // link by url - token : ["text", "string", "text", "markup.underline", "string", "text"], - regex : "(\\[)(" + // [ - escaped("]") + // link text - ")(\\]\\()"+ // ]( - '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href - '(\\s*"' + escaped('"') + '"\\s*)?' + // "title" - "(\\))" // ) - }, { // strong ** __ - token : "string.strong", - regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" - }, { // emphasis * _ - token : "string.emphasis", - regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" - }, { // - token : ["text", "url", "text"], - regex : "(<)("+ - "(?:https?|ftp|dict):[^'\">\\s]+"+ - "|"+ - "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+ - ")(>)" - }], - "allowBlock": [ - {token : "support.function", regex : "^ {4}.+", next : "allowBlock"}, - {token : "empty", regex : "", next : "start"} - ], - - "header" : [{ - regex: "$", - next : "start" - }, { - include: "basic" - }, { - defaultToken : "heading" - } ], - - "listblock-start" : [{ - token : "support.variable", - regex : /(?:\[[ x]\])?/, - next : "listblock" - }], - - "listblock" : [ { // Lists only escape on completely blank lines. - token : "empty_line", - regex : "^$", - next : "start" - }, { // list - token : "markup.list", - regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", - next : "listblock-start" - }, { - include : "basic", noEscape: true - }, { - defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly - } ], - - "blockquote" : [ { // BLockquotes only escape on blank lines. - token : "empty_line", - regex : "^\\s*$", - next : "start" - }, { // block quote - token : "string.blockquote", - regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", - next : "blockquote" - }, { - include : "basic", noEscape: true - }, { - defaultToken : "string.blockquote" - } ], - - "githubblock" : [ { - token : "support.function", - regex : "^```", - next : "start" - }, { - token : "support.function", - regex : ".+" - } ] - }); - - this.embedRules(JavaScriptHighlightRules, "jscode-", [{ - token : "support.function", - regex : "^```", - next : "pop" - }]); - - this.embedRules(HtmlHighlightRules, "htmlcode-", [{ - token : "support.function", - regex : "^```", - next : "pop" - }]); - - this.embedRules(CssHighlightRules, "csscode-", [{ - token : "support.function", - regex : "^```", - next : "pop" - }]); - - this.embedRules(XmlHighlightRules, "xmlcode-", [{ - token : "support.function", - regex : "^```", - next : "pop" - }]); - - this.normalizeRules(); -}; -oop.inherits(MarkdownHighlightRules, TextHighlightRules); - -exports.MarkdownHighlightRules = MarkdownHighlightRules; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/scss_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ScssHighlightRules = function() { - - var properties = lang.arrayToMap( (function () { - - var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); - - var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + - "background-size|binding|border-bottom-colors|border-left-colors|" + - "border-right-colors|border-top-colors|border-end|border-end-color|" + - "border-end-style|border-end-width|border-image|border-start|" + - "border-start-color|border-start-style|border-start-width|box-align|" + - "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + - "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + - "column-rule-width|column-rule-style|column-rule-color|float-edge|" + - "font-feature-settings|font-language-override|force-broken-image-icon|" + - "image-region|margin-end|margin-start|opacity|outline|outline-color|" + - "outline-offset|outline-radius|outline-radius-bottomleft|" + - "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + - "outline-style|outline-width|padding-end|padding-start|stack-sizing|" + - "tab-size|text-blink|text-decoration-color|text-decoration-line|" + - "text-decoration-style|transform|transform-origin|transition|" + - "transition-delay|transition-duration|transition-property|" + - "transition-timing-function|user-focus|user-input|user-modify|user-select|" + - "window-shadow|border-radius").split("|"); - - var properties = ("azimuth|background-attachment|background-color|background-image|" + - "background-position|background-repeat|background|border-bottom-color|" + - "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + - "border-color|border-left-color|border-left-style|border-left-width|" + - "border-left|border-right-color|border-right-style|border-right-width|" + - "border-right|border-spacing|border-style|border-top-color|" + - "border-top-style|border-top-width|border-top|border-width|border|bottom|" + - "box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + - "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + - "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + - "font-stretch|font-style|font-variant|font-weight|font|height|left|" + - "letter-spacing|line-height|list-style-image|list-style-position|" + - "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + - "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + - "min-width|opacity|orphans|outline-color|" + - "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + - "padding-left|padding-right|padding-top|padding|page-break-after|" + - "page-break-before|page-break-inside|page|pause-after|pause-before|" + - "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + - "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + - "stress|table-layout|text-align|text-decoration|text-indent|" + - "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + - "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + - "z-index").split("|"); - var ret = []; - for (var i=0, ln=browserPrefix.length; i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - }, { - caseInsensitive: true - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ] - }; -}; - -oop.inherits(ScssHighlightRules, TextHighlightRules); - -exports.ScssHighlightRules = ScssHighlightRules; - -}); - -ace.define('ace/mode/less_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LessHighlightRules = function() { - - var properties = lang.arrayToMap( (function () { - - var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); - - var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + - "background-size|binding|border-bottom-colors|border-left-colors|" + - "border-right-colors|border-top-colors|border-end|border-end-color|" + - "border-end-style|border-end-width|border-image|border-start|" + - "border-start-color|border-start-style|border-start-width|box-align|" + - "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + - "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + - "column-rule-width|column-rule-style|column-rule-color|float-edge|" + - "font-feature-settings|font-language-override|force-broken-image-icon|" + - "image-region|margin-end|margin-start|opacity|outline|outline-color|" + - "outline-offset|outline-radius|outline-radius-bottomleft|" + - "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + - "outline-style|outline-width|padding-end|padding-start|stack-sizing|" + - "tab-size|text-blink|text-decoration-color|text-decoration-line|" + - "text-decoration-style|transform|transform-origin|transition|" + - "transition-delay|transition-duration|transition-property|" + - "transition-timing-function|user-focus|user-input|user-modify|user-select|" + - "window-shadow|border-radius").split("|"); - - var properties = ("azimuth|background-attachment|background-color|background-image|" + - "background-position|background-repeat|background|border-bottom-color|" + - "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + - "border-color|border-left-color|border-left-style|border-left-width|" + - "border-left|border-right-color|border-right-style|border-right-width|" + - "border-right|border-spacing|border-style|border-top-color|" + - "border-top-style|border-top-width|border-top|border-width|border|" + - "bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + - "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + - "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + - "font-stretch|font-style|font-variant|font-weight|font|height|left|" + - "letter-spacing|line-height|list-style-image|list-style-position|" + - "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + - "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + - "min-width|opacity|orphans|outline-color|" + - "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + - "padding-left|padding-right|padding-top|padding|page-break-after|" + - "page-break-before|page-break-inside|page|pause-after|pause-before|" + - "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + - "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + - "stress|table-layout|text-align|text-decoration|text-indent|" + - "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + - "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + - "z-index").split("|"); - var ret = []; - for (var i=0, ln=browserPrefix.length; i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - }, { - caseInsensitive: true - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; -}; - -oop.inherits(LessHighlightRules, TextHighlightRules); - -exports.LessHighlightRules = LessHighlightRules; - -}); - -ace.define('ace/mode/coffee_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - - var oop = require("../lib/oop"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - oop.inherits(CoffeeHighlightRules, TextHighlightRules); - - function CoffeeHighlightRules() { - var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; - - var keywords = ( - "this|throw|then|try|typeof|super|switch|return|break|by|continue|" + - "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" + - "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" + - "or|on|unless|until|and|yes" - ); - - var langConstant = ( - "true|false|null|undefined|NaN|Infinity" - ); - - var illegal = ( - "case|const|default|function|var|void|with|enum|export|implements|" + - "interface|let|package|private|protected|public|static|yield|" + - "__hasProp|slice|bind|indexOf" - ); - - var supportClass = ( - "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + - "SyntaxError|TypeError|URIError|" + - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray" - ); - - var supportFunction = ( - "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + - "encodeURIComponent|decodeURI|decodeURIComponent|String|" - ); - - var variableLanguage = ( - "window|arguments|prototype|document" - ); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": langConstant, - "invalid.illegal": illegal, - "language.support.class": supportClass, - "language.support.function": supportFunction, - "variable.language": variableLanguage - }, "identifier"); - - var functionRule = { - token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], - regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source - }; - - var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; - - this.$rules = { - start : [ - { - token : "constant.numeric", - regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" - }, { - stateName: "qdoc", - token : "string", regex : "'''", next : [ - {token : "string", regex : "'''", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qqdoc", - token : "string", - regex : '"""', - next : [ - {token : "string", regex : '"""', next : "start"}, - {token : "paren.string", regex : '#{', push : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qstring", - token : "string", regex : "'", next : [ - {token : "string", regex : "'", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qqstring", - token : "string.start", regex : '"', next : [ - {token : "string.end", regex : '"', next : "start"}, - {token : "paren.string", regex : '#{', push : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "js", - token : "string", regex : "`", next : [ - {token : "string", regex : "`", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - regex: "[{}]", onMatch: function(val, state, stack) { - this.next = ""; - if (val == "{" && stack.length) { - stack.unshift("start", state); - return "paren"; - } - if (val == "}" && stack.length) { - stack.shift(); - this.next = stack.shift(); - if (this.next.indexOf("string") != -1) - return "paren.string"; - } - return "paren"; - } - }, { - token : "string.regex", - regex : "///", - next : "heregex" - }, { - token : "string.regex", - regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ - }, { - token : "comment", - regex : "###(?!#)", - next : "comment" - }, { - token : "comment", - regex : "#.*" - }, { - token : ["punctuation.operator", "text", "identifier"], - regex : "(\\.)(\\s*)(" + illegal + ")" - }, { - token : "punctuation.operator", - regex : "\\." - }, { - token : ["keyword", "text", "language.support.class", - "text", "keyword", "text", "language.support.class"], - regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?" - }, { - token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token), - regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex - }, - functionRule, - { - token : "variable", - regex : "@(?:" + identifier + ")?" - }, { - token: keywordMapper, - regex : identifier - }, { - token : "punctuation.operator", - regex : "\\,|\\." - }, { - token : "storage.type", - regex : "[\\-=]>" - }, { - token : "keyword.operator", - regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" - }, { - token : "paren.lparen", - regex : "[({[]" - }, { - token : "paren.rparen", - regex : "[\\]})]" - }, { - token : "text", - regex : "\\s+" - }], - - - heregex : [{ - token : "string.regex", - regex : '.*?///[imgy]{0,4}', - next : "start" - }, { - token : "comment.regex", - regex : "\\s+(?:#.*)?" - }, { - token : "string.regex", - regex : "\\S+" - }], - - comment : [{ - token : "comment", - regex : '###', - next : "start" - }, { - defaultToken : "comment" - }] - }; - this.normalizeRules(); - } - - exports.CoffeeHighlightRules = CoffeeHighlightRules; -}); - -ace.define('ace/mode/jade_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/markdown_highlight_rules', 'ace/mode/scss_highlight_rules', 'ace/mode/less_highlight_rules', 'ace/mode/coffee_highlight_rules', 'ace/mode/javascript_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules; -var SassHighlightRules = require("./scss_highlight_rules").ScssHighlightRules; -var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules; -var CoffeeHighlightRules = require("./coffee_highlight_rules").CoffeeHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; - -function mixin_embed(tag, prefix) { - return { - token : "entity.name.function.jade", - regex : "^\\s*\\:" + tag, - next : prefix + "start" - }; -} - -var JadeHighlightRules = function() { - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = - { - "start": [ - { - token: "keyword.control.import.include.jade", - regex: "\\s*\\binclude\\b" - }, - { - token: "keyword.other.doctype.jade", - regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" - }, - { - token : "punctuation.section.comment", - regex : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)" - }, - { - onMatch: function(value, currentState, stack) { - stack.unshift(this.next, value.length - 2, currentState); - return "comment"; - }, - regex: /^\s*\/\//, - next: "comment_block" - }, - mixin_embed("markdown", "markdown-"), - mixin_embed("sass", "sass-"), - mixin_embed("less", "less-"), - mixin_embed("coffee", "coffee-"), - { - token: [ "storage.type.function.jade", - "entity.name.function.jade", - "punctuation.definition.parameters.begin.jade", - "variable.parameter.function.jade", - "punctuation.definition.parameters.end.jade" - ], - regex: "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))" - }, - { - token: [ "storage.type.function.jade", "entity.name.function.jade"], - regex: "^(\\s*mixin)( [\\w\\-]+)" - }, - { - token: "source.js.embedded.jade", - regex: "^\\s*(?:-|=|!=)", - next: "js-start" - }, - { - token: "string.interpolated.jade", - regex: "[#!]\\{[^\\}]+\\}" - }, - { - token: "meta.tag.any.jade", - regex: /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/, - next: "tag_single" - }, - { - token: "suport.type.attribute.id.jade", - regex: "#\\w+" - }, - { - token: "suport.type.attribute.class.jade", - regex: "\\.\\w+" - }, - { - token: "punctuation", - regex: "\\s*(?:\\()", - next: "tag_attributes" - } - ], - "comment_block": [ - {regex: /^\s*/, onMatch: function(value, currentState, stack) { - if (value.length <= stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); - return "text"; - } else { - this.next = ""; - return "comment"; - } - }, next: "start"}, - {defaultToken: "comment"} - ], - "tag_single": [ - { - token: "entity.other.attribute-name.class.jade", - regex: "\\.[\\w-]+" - }, - { - token: "entity.other.attribute-name.id.jade", - regex: "#[\\w-]+" - }, - { - token: ["text", "punctuation"], - regex: "($)|((?!\\.|#|=|-))", - next: "start" - } - ], - "tag_attributes": [ - { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, - { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, - { - token: "entity.other.attribute-name.jade", - regex: "\\b[a-zA-Z\\-:]+" - }, - { - token: ["entity.other.attribute-name.jade", "punctuation"], - regex: "\\b([a-zA-Z:\\.-]+)(=)", - next: "attribute_strings" - }, - { - token: "punctuation", - regex: "\\)", - next: "start" - } - ], - "attribute_strings": [ - { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, - { - token : "string", - regex : '"(?=.)', - next : "qqstring" - } - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : '[^"\\\\]+' - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "tag_attributes" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "[^'\\\\]+" - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "tag_attributes" - } - ] -}; - - this.embedRules(JavaScriptHighlightRules, "js-", [{ - token: "text", - regex: ".$", - next: "start" - }]); -}; - -oop.inherits(JadeHighlightRules, TextHighlightRules); - -exports.JadeHighlightRules = JadeHighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-java.js b/util/build-sample-browser/player/vendor/ace/mode-java.js deleted file mode 100644 index 50c14cb42b..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-java.js +++ /dev/null @@ -1,1083 +0,0 @@ -ace.define('ace/mode/java', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/java_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var JavaScriptMode = require("./javascript").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules; - -var Mode = function() { - JavaScriptMode.call(this); - this.HighlightRules = JavaHighlightRules; -}; -oop.inherits(Mode, JavaScriptMode); - -(function() { - - this.createWorker = function(session) { - return null; - }; - - this.$id = "ace/mode/java"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); -ace.define('ace/mode/java_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaHighlightRules = function() { - var keywords = ( - "abstract|continue|for|new|switch|" + - "assert|default|goto|package|synchronized|" + - "boolean|do|if|private|this|" + - "break|double|implements|protected|throw|" + - "byte|else|import|public|throws|" + - "case|enum|instanceof|return|transient|" + - "catch|extends|int|short|try|" + - "char|final|interface|static|void|" + - "class|finally|long|strictfp|volatile|" + - "const|float|native|super|while" - ); - - var buildinConstants = ("null|Infinity|NaN|undefined"); - - - var langClasses = ( - "AbstractMethodError|AssertionError|ClassCircularityError|"+ - "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ - "ExceptionInInitializerError|IllegalAccessError|"+ - "IllegalThreadStateException|InstantiationError|InternalError|"+ - "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ - "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ - "SuppressWarnings|TypeNotPresentException|UnknownError|"+ - "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ - "InstantiationException|IndexOutOfBoundsException|"+ - "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ - "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ - "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ - "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ - "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ - "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ - "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ - "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ - "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ - "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ - "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ - "ArrayStoreException|ClassCastException|LinkageError|"+ - "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ - "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ - "Cloneable|Class|CharSequence|Comparable|String|Object" - ); - - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": keywords, - "constant.language": buildinConstants, - "support.function": langClasses - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(JavaHighlightRules, TextHighlightRules); - -exports.JavaHighlightRules = JavaHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-javascript.js b/util/build-sample-browser/player/vendor/ace/mode-javascript.js deleted file mode 100644 index 5963d232ec..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-javascript.js +++ /dev/null @@ -1,963 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-json.js b/util/build-sample-browser/player/vendor/ace/mode-json.js deleted file mode 100644 index bfeabaa0a2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-json.js +++ /dev/null @@ -1,655 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HighlightRules = require("./json_highlight_rules").JsonHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function() { - this.HighlightRules = HighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("error", function(e) { - session.setAnnotations([e.data]); - }); - - worker.on("ok", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - - this.$id = "ace/mode/json"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/json_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JsonHighlightRules = function() { - this.$rules = { - "start" : [ - { - token : "variable", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' - }, { - token : "string", // single line - regex : '"', - next : "string" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : "invalid.illegal", // single quoted strings are not allowed - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "invalid.illegal", // comments are not allowed - regex : "\\/\\/.*$" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "string" : [ - { - token : "constant.language.escape", - regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ - }, { - token : "string", - regex : '[^"\\\\]+' - }, { - token : "string", - regex : '"', - next : "start" - }, { - token : "string", - regex : "", - next : "start" - } - ] - }; - -}; - -oop.inherits(JsonHighlightRules, TextHighlightRules); - -exports.JsonHighlightRules = JsonHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-jsoniq.js b/util/build-sample-browser/player/vendor/ace/mode-jsoniq.js deleted file mode 100644 index ea1174e671..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-jsoniq.js +++ /dev/null @@ -1,2791 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ -ace.define('ace/mode/jsoniq', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/xquery/JSONiqLexer', 'ace/range', 'ace/mode/behaviour/xquery', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JSONiqLexer = require("./xquery/JSONiqLexer").JSONiqLexer; -var Range = require("../range").Range; -var XQueryBehaviour = require("./behaviour/xquery").XQueryBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - - -var Mode = function() { - this.$tokenizer = new JSONiqLexer(); - this.$behaviour = new XQueryBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; - -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var match = line.match(/\s*(?:then|else|return|[{\(]|<\w+>)\s*$/); - if (match) - indent += tab; - return indent; - }; - - this.checkOutdent = function(state, line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*[\}\)]/.test(input); - }; - - this.autoOutdent = function(state, doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*[\}\)])/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - var i, line; - var outdent = true; - var re = /^\s*\(:(.*):\)/; - - for (i=startRow; i<= endRow; i++) { - if (!re.test(doc.getLine(i))) { - outdent = false; - break; - } - } - - var range = new Range(0, 0, 0, 0); - for (i=startRow; i<= endRow; i++) { - line = doc.getLine(i); - range.start.row = i; - range.end.row = i; - range.end.column = line.length; - - doc.replace(range, outdent ? line.match(re)[1] : "(:" + line + ":)"); - } - }; - this.$id = "ace/mode/jsoniq"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/xquery/JSONiqLexer', ['require', 'exports', 'module' , 'ace/mode/xquery/JSONiqTokenizer'], function(require, exports, module) { - - var JSONiqTokenizer = require("./JSONiqTokenizer").JSONiqTokenizer; - - var TokenHandler = function(code) { - - var input = code; - - this.tokens = []; - - this.reset = function(code) { - input = input; - this.tokens = []; - }; - - this.startNonterminal = function(name, begin) {}; - - this.endNonterminal = function(name, end) {}; - - this.terminal = function(name, begin, end) { - this.tokens.push({ - name: name, - value: input.substring(begin, end) - }); - }; - - this.whitespace = function(begin, end) { - this.tokens.push({ - name: "WS", - value: input.substring(begin, end) - }); - }; - }; - var keys = "NaN|after|allowing|ancestor|ancestor-or-self|and|append|array|as|ascending|at|attribute|base-uri|before|boundary-space|break|by|case|cast|castable|catch|child|collation|comment|constraint|construction|contains|context|continue|copy|copy-namespaces|count|decimal-format|decimal-separator|declare|default|delete|descendant|descendant-or-self|descending|digit|div|document|document-node|element|else|empty|empty-sequence|encoding|end|eq|every|except|exit|external|false|first|following|following-sibling|for|from|ft-option|function|ge|greatest|group|grouping-separator|gt|idiv|if|import|in|index|infinity|insert|instance|integrity|intersect|into|is|item|json|json-item|jsoniq|last|lax|le|least|let|loop|lt|minus-sign|mod|modify|module|namespace|namespace-node|ne|next|node|nodes|not|null|object|of|only|option|or|order|ordered|ordering|paragraphs|parent|pattern-separator|per-mille|percent|preceding|preceding-sibling|previous|processing-instruction|rename|replace|return|returning|revalidation|satisfies|schema|schema-attribute|schema-element|score|select|self|sentences|sliding|some|stable|start|strict|switch|text|then|times|to|treat|true|try|tumbling|type|typeswitch|union|unordered|updating|validate|value|variable|version|when|where|while|window|with|words|xquery|zero-digit".split("|"); - var keywords = keys.map( - function(val) { return { name: "'" + val + "'", token: "keyword" }; } - ); - - var ncnames = keys.map( - function(val) { return { name: "'" + val + "'", token: "text", next: function(stack){ stack.pop(); } }; } - ); - - var cdata = "constant.language"; - var number = "constant"; - var xmlcomment = "comment"; - var pi = "xml-pe"; - var pragma = "constant.buildin"; - - var Rules = { - start: [ - { name: "'(#'", token: pragma, next: function(stack){ stack.push("Pragma"); } }, - { name: "'(:'", token: "comment", next: function(stack){ stack.push("Comment"); } }, - { name: "'(:~'", token: "comment.doc", next: function(stack){ stack.push("CommentDoc"); } }, - { name: "''", token: xmlcomment, next: function(stack){ stack.pop(); } } - ], - CData: [ - { name: "CDataSectionContents", token: cdata }, - { name: "']]>'", token: cdata, next: function(stack){ stack.pop(); } } - ], - PI: [ - { name: "DirPIContents", token: pi }, - { name: "'?'", token: pi }, - { name: "'?>'", token: pi, next: function(stack){ stack.pop(); } } - ], - AposString: [ - { name: "''''", token: "string", next: function(stack){ stack.pop(); } }, - { name: "PredefinedEntityRef", token: "constant.language.escape" }, - { name: "CharRef", token: "constant.language.escape" }, - { name: "EscapeApos", token: "constant.language.escape" }, - { name: "AposChar", token: "string" } - ], - QuotString: [ - { name: "'\"'", token: "string", next: function(stack){ stack.pop(); } }, - { name: "PredefinedEntityRef", token: "constant.language.escape" }, - { name: "CharRef", token: "constant.language.escape" }, - { name: "EscapeQuot", token: "constant.language.escape" }, - { name: "QuotChar", token: "string" } - ] - }; - -exports.JSONiqLexer = function() { - - this.tokens = []; - - this.getLineTokens = function(line, state, row) { - state = (state === "start" || !state) ? '["start"]' : state; - var stack = JSON.parse(state); - var h = new TokenHandler(line); - var tokenizer = new JSONiqTokenizer(line, h); - var tokens = []; - - while(true) { - var currentState = stack[stack.length - 1]; - try { - - h.tokens = []; - tokenizer["parse_" + currentState](); - var info = null; - - if(h.tokens.length > 1 && h.tokens[0].name === "WS") { - tokens.push({ - type: "text", - value: h.tokens[0].value - }); - h.tokens.splice(0, 1); - } - - var token = h.tokens[0]; - var rules = Rules[currentState]; - for(var k = 0; k < rules.length; k++) { - var rule = Rules[currentState][k]; - if((typeof(rule.name) === "function" && rule.name(token)) || rule.name === token.name) { - info = rule; - break; - } - } - - if(token.name === "EOF") { break; } - if(token.value === "") { throw "Encountered empty string lexical rule."; } - - tokens.push({ - type: info === null ? "text" : (typeof(info.token) === "function" ? info.token(token.value) : info.token), - value: token.value - }); - - if(info && info.next) { - info.next(stack); - } - - } catch(e) { - if(e instanceof tokenizer.ParseException) { - var index = 0; - for(var i=0; i < tokens.length; i++) { - index += tokens[i].value.length; - } - tokens.push({ type: "text", value: line.substring(index) }); - return { - tokens: tokens, - state: JSON.stringify(["start"]) - }; - } else { - throw e; - } - } - } - - - if(this.tokens[row] !== undefined) { - var cachedLine = this.lines[row]; - var begin = sharedStart([line, cachedLine]); - var diff = cachedLine.length - line.length; - var idx = 0; - var col = 0; - for(var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - for(var j = 0; j < this.tokens[row].length; j++) { - var semanticToken = this.tokens[row][j]; - if( - ((col + token.value.length) <= begin.length && semanticToken.sc === col && semanticToken.ec === (col + token.value.length)) || - (semanticToken.sc === (col + diff) && semanticToken.ec === (col + token.value.length + diff)) - ) { - idx = i; - tokens[i].type = semanticToken.type; - } - } - col += token.value.length; - } - } - - return { - tokens: tokens, - state: JSON.stringify(stack) - }; - }; - - function sharedStart(A) { - var tem1, tem2, s, A = A.slice(0).sort(); - tem1 = A[0]; - s = tem1.length; - tem2 = A.pop(); - while(s && tem2.indexOf(tem1) == -1) { - tem1 = tem1.substring(0, --s); - } - return tem1; - } -}; -}); - - ace.define('ace/mode/xquery/JSONiqTokenizer', ['require', 'exports', 'module' ], function(require, exports, module) { - var JSONiqTokenizer = exports.JSONiqTokenizer = function JSONiqTokenizer(string, parsingEventHandler) - { - init(string, parsingEventHandler); - var self = this; - - this.ParseException = function(b, e, s, o, x) - { - var - begin = b, - end = e, - state = s, - offending = o, - expected = x; - - this.getBegin = function() {return begin;}; - this.getEnd = function() {return end;}; - this.getState = function() {return state;}; - this.getExpected = function() {return expected;}; - this.getOffending = function() {return offending;}; - - this.getMessage = function() - { - return offending < 0 ? "lexical analysis failed" : "syntax error"; - }; - }; - - function init(string, parsingEventHandler) - { - eventHandler = parsingEventHandler; - input = string; - size = string.length; - reset(0, 0, 0); - } - - this.getInput = function() - { - return input; - }; - - function reset(l, b, e) - { - b0 = b; e0 = b; - l1 = l; b1 = b; e1 = e; - end = e; - eventHandler.reset(input); - } - - this.getOffendingToken = function(e) - { - var o = e.getOffending(); - return o >= 0 ? JSONiqTokenizer.TOKEN[o] : null; - }; - - this.getExpectedTokenSet = function(e) - { - var expected; - if (e.getExpected() < 0) - { - expected = JSONiqTokenizer.getTokenSet(- e.getState()); - } - else - { - expected = [JSONiqTokenizer.TOKEN[e.getExpected()]]; - } - return expected; - }; - - this.getErrorMessage = function(e) - { - var tokenSet = this.getExpectedTokenSet(e); - var found = this.getOffendingToken(e); - var prefix = input.substring(0, e.getBegin()); - var lines = prefix.split("\n"); - var line = lines.length; - var column = lines[line - 1].length + 1; - var size = e.getEnd() - e.getBegin(); - return e.getMessage() - + (found == null ? "" : ", found " + found) - + "\nwhile expecting " - + (tokenSet.length == 1 ? tokenSet[0] : ("[" + tokenSet.join(", ") + "]")) - + "\n" - + (size == 0 || found != null ? "" : "after successfully scanning " + size + " characters beginning ") - + "at line " + line + ", column " + column + ":\n..." - + input.substring(e.getBegin(), Math.min(input.length, e.getBegin() + 64)) - + "..."; - }; - - this.parse_start = function() - { - eventHandler.startNonterminal("start", e0); - lookahead1W(14); // ModuleDecl | Annotation | OptionDecl | Operator | Variable | Tag | AttrTest | - switch (l1) - { - case 55: // '' | '=' | '>' - switch (l1) - { - case 58: // '>' - shift(58); // '>' - break; - case 50: // '/>' - shift(50); // '/>' - break; - case 27: // QName - shift(27); // QName - break; - case 57: // '=' - shift(57); // '=' - break; - case 35: // '"' - shift(35); // '"' - break; - case 38: // "'" - shift(38); // "'" - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("StartTag", e0); - }; - - this.parse_TagContent = function() - { - eventHandler.startNonterminal("TagContent", e0); - lookahead1(11); // Tag | EndTag | PredefinedEntityRef | ElementContentChar | CharRef | EOF | - switch (l1) - { - case 23: // ElementContentChar - shift(23); // ElementContentChar - break; - case 6: // Tag - shift(6); // Tag - break; - case 7: // EndTag - shift(7); // EndTag - break; - case 55: // '' - switch (l1) - { - case 11: // CDataSectionContents - shift(11); // CDataSectionContents - break; - case 64: // ']]>' - shift(64); // ']]>' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("CData", e0); - }; - - this.parse_XMLComment = function() - { - eventHandler.startNonterminal("XMLComment", e0); - lookahead1(0); // DirCommentContents | EOF | '-->' - switch (l1) - { - case 9: // DirCommentContents - shift(9); // DirCommentContents - break; - case 47: // '-->' - shift(47); // '-->' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("XMLComment", e0); - }; - - this.parse_PI = function() - { - eventHandler.startNonterminal("PI", e0); - lookahead1(3); // DirPIContents | EOF | '?' | '?>' - switch (l1) - { - case 10: // DirPIContents - shift(10); // DirPIContents - break; - case 59: // '?' - shift(59); // '?' - break; - case 60: // '?>' - shift(60); // '?>' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("PI", e0); - }; - - this.parse_Pragma = function() - { - eventHandler.startNonterminal("Pragma", e0); - lookahead1(2); // PragmaContents | EOF | '#' | '#)' - switch (l1) - { - case 8: // PragmaContents - shift(8); // PragmaContents - break; - case 36: // '#' - shift(36); // '#' - break; - case 37: // '#)' - shift(37); // '#)' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("Pragma", e0); - }; - - this.parse_Comment = function() - { - eventHandler.startNonterminal("Comment", e0); - lookahead1(4); // CommentContents | EOF | '(:' | ':)' - switch (l1) - { - case 52: // ':)' - shift(52); // ':)' - break; - case 41: // '(:' - shift(41); // '(:' - break; - case 30: // CommentContents - shift(30); // CommentContents - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("Comment", e0); - }; - - this.parse_CommentDoc = function() - { - eventHandler.startNonterminal("CommentDoc", e0); - lookahead1(5); // DocTag | DocCommentContents | EOF | '(:' | ':)' - switch (l1) - { - case 31: // DocTag - shift(31); // DocTag - break; - case 32: // DocCommentContents - shift(32); // DocCommentContents - break; - case 52: // ':)' - shift(52); // ':)' - break; - case 41: // '(:' - shift(41); // '(:' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("CommentDoc", e0); - }; - - this.parse_QuotString = function() - { - eventHandler.startNonterminal("QuotString", e0); - lookahead1(6); // PredefinedEntityRef | EscapeQuot | QuotChar | CharRef | EOF | '"' - switch (l1) - { - case 18: // PredefinedEntityRef - shift(18); // PredefinedEntityRef - break; - case 29: // CharRef - shift(29); // CharRef - break; - case 19: // EscapeQuot - shift(19); // EscapeQuot - break; - case 21: // QuotChar - shift(21); // QuotChar - break; - case 35: // '"' - shift(35); // '"' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("QuotString", e0); - }; - - this.parse_AposString = function() - { - eventHandler.startNonterminal("AposString", e0); - lookahead1(7); // PredefinedEntityRef | EscapeApos | AposChar | CharRef | EOF | "'" - switch (l1) - { - case 18: // PredefinedEntityRef - shift(18); // PredefinedEntityRef - break; - case 29: // CharRef - shift(29); // CharRef - break; - case 20: // EscapeApos - shift(20); // EscapeApos - break; - case 22: // AposChar - shift(22); // AposChar - break; - case 38: // "'" - shift(38); // "'" - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("AposString", e0); - }; - - this.parse_Prefix = function() - { - eventHandler.startNonterminal("Prefix", e0); - lookahead1W(13); // NCName^Token | S^WS | 'after' | 'allowing' | 'ancestor' | 'ancestor-or-self' | - whitespace(); - parse_NCName(); - eventHandler.endNonterminal("Prefix", e0); - }; - - this.parse__EQName = function() - { - eventHandler.startNonterminal("_EQName", e0); - lookahead1W(12); // EQName^Token | S^WS | 'after' | 'allowing' | 'ancestor' | 'ancestor-or-self' | - whitespace(); - parse_EQName(); - eventHandler.endNonterminal("_EQName", e0); - }; - - function parse_EQName() - { - eventHandler.startNonterminal("EQName", e0); - switch (l1) - { - case 77: // 'attribute' - shift(77); // 'attribute' - break; - case 91: // 'comment' - shift(91); // 'comment' - break; - case 115: // 'document-node' - shift(115); // 'document-node' - break; - case 116: // 'element' - shift(116); // 'element' - break; - case 119: // 'empty-sequence' - shift(119); // 'empty-sequence' - break; - case 140: // 'function' - shift(140); // 'function' - break; - case 147: // 'if' - shift(147); // 'if' - break; - case 160: // 'item' - shift(160); // 'item' - break; - case 180: // 'namespace-node' - shift(180); // 'namespace-node' - break; - case 186: // 'node' - shift(186); // 'node' - break; - case 211: // 'processing-instruction' - shift(211); // 'processing-instruction' - break; - case 221: // 'schema-attribute' - shift(221); // 'schema-attribute' - break; - case 222: // 'schema-element' - shift(222); // 'schema-element' - break; - case 238: // 'switch' - shift(238); // 'switch' - break; - case 239: // 'text' - shift(239); // 'text' - break; - case 248: // 'typeswitch' - shift(248); // 'typeswitch' - break; - default: - parse_FunctionName(); - } - eventHandler.endNonterminal("EQName", e0); - } - - function parse_FunctionName() - { - eventHandler.startNonterminal("FunctionName", e0); - switch (l1) - { - case 14: // EQName^Token - shift(14); // EQName^Token - break; - case 65: // 'after' - shift(65); // 'after' - break; - case 68: // 'ancestor' - shift(68); // 'ancestor' - break; - case 69: // 'ancestor-or-self' - shift(69); // 'ancestor-or-self' - break; - case 70: // 'and' - shift(70); // 'and' - break; - case 74: // 'as' - shift(74); // 'as' - break; - case 75: // 'ascending' - shift(75); // 'ascending' - break; - case 79: // 'before' - shift(79); // 'before' - break; - case 83: // 'case' - shift(83); // 'case' - break; - case 84: // 'cast' - shift(84); // 'cast' - break; - case 85: // 'castable' - shift(85); // 'castable' - break; - case 88: // 'child' - shift(88); // 'child' - break; - case 89: // 'collation' - shift(89); // 'collation' - break; - case 98: // 'copy' - shift(98); // 'copy' - break; - case 100: // 'count' - shift(100); // 'count' - break; - case 103: // 'declare' - shift(103); // 'declare' - break; - case 104: // 'default' - shift(104); // 'default' - break; - case 105: // 'delete' - shift(105); // 'delete' - break; - case 106: // 'descendant' - shift(106); // 'descendant' - break; - case 107: // 'descendant-or-self' - shift(107); // 'descendant-or-self' - break; - case 108: // 'descending' - shift(108); // 'descending' - break; - case 113: // 'div' - shift(113); // 'div' - break; - case 114: // 'document' - shift(114); // 'document' - break; - case 117: // 'else' - shift(117); // 'else' - break; - case 118: // 'empty' - shift(118); // 'empty' - break; - case 121: // 'end' - shift(121); // 'end' - break; - case 123: // 'eq' - shift(123); // 'eq' - break; - case 124: // 'every' - shift(124); // 'every' - break; - case 126: // 'except' - shift(126); // 'except' - break; - case 129: // 'first' - shift(129); // 'first' - break; - case 130: // 'following' - shift(130); // 'following' - break; - case 131: // 'following-sibling' - shift(131); // 'following-sibling' - break; - case 132: // 'for' - shift(132); // 'for' - break; - case 141: // 'ge' - shift(141); // 'ge' - break; - case 143: // 'group' - shift(143); // 'group' - break; - case 145: // 'gt' - shift(145); // 'gt' - break; - case 146: // 'idiv' - shift(146); // 'idiv' - break; - case 148: // 'import' - shift(148); // 'import' - break; - case 154: // 'insert' - shift(154); // 'insert' - break; - case 155: // 'instance' - shift(155); // 'instance' - break; - case 157: // 'intersect' - shift(157); // 'intersect' - break; - case 158: // 'into' - shift(158); // 'into' - break; - case 159: // 'is' - shift(159); // 'is' - break; - case 165: // 'last' - shift(165); // 'last' - break; - case 167: // 'le' - shift(167); // 'le' - break; - case 169: // 'let' - shift(169); // 'let' - break; - case 173: // 'lt' - shift(173); // 'lt' - break; - case 175: // 'mod' - shift(175); // 'mod' - break; - case 176: // 'modify' - shift(176); // 'modify' - break; - case 177: // 'module' - shift(177); // 'module' - break; - case 179: // 'namespace' - shift(179); // 'namespace' - break; - case 181: // 'ne' - shift(181); // 'ne' - break; - case 193: // 'only' - shift(193); // 'only' - break; - case 195: // 'or' - shift(195); // 'or' - break; - case 196: // 'order' - shift(196); // 'order' - break; - case 197: // 'ordered' - shift(197); // 'ordered' - break; - case 201: // 'parent' - shift(201); // 'parent' - break; - case 207: // 'preceding' - shift(207); // 'preceding' - break; - case 208: // 'preceding-sibling' - shift(208); // 'preceding-sibling' - break; - case 213: // 'rename' - shift(213); // 'rename' - break; - case 214: // 'replace' - shift(214); // 'replace' - break; - case 215: // 'return' - shift(215); // 'return' - break; - case 219: // 'satisfies' - shift(219); // 'satisfies' - break; - case 224: // 'self' - shift(224); // 'self' - break; - case 230: // 'some' - shift(230); // 'some' - break; - case 231: // 'stable' - shift(231); // 'stable' - break; - case 232: // 'start' - shift(232); // 'start' - break; - case 243: // 'to' - shift(243); // 'to' - break; - case 244: // 'treat' - shift(244); // 'treat' - break; - case 245: // 'try' - shift(245); // 'try' - break; - case 249: // 'union' - shift(249); // 'union' - break; - case 251: // 'unordered' - shift(251); // 'unordered' - break; - case 255: // 'validate' - shift(255); // 'validate' - break; - case 261: // 'where' - shift(261); // 'where' - break; - case 265: // 'with' - shift(265); // 'with' - break; - case 269: // 'xquery' - shift(269); // 'xquery' - break; - case 67: // 'allowing' - shift(67); // 'allowing' - break; - case 76: // 'at' - shift(76); // 'at' - break; - case 78: // 'base-uri' - shift(78); // 'base-uri' - break; - case 80: // 'boundary-space' - shift(80); // 'boundary-space' - break; - case 81: // 'break' - shift(81); // 'break' - break; - case 86: // 'catch' - shift(86); // 'catch' - break; - case 93: // 'construction' - shift(93); // 'construction' - break; - case 96: // 'context' - shift(96); // 'context' - break; - case 97: // 'continue' - shift(97); // 'continue' - break; - case 99: // 'copy-namespaces' - shift(99); // 'copy-namespaces' - break; - case 101: // 'decimal-format' - shift(101); // 'decimal-format' - break; - case 120: // 'encoding' - shift(120); // 'encoding' - break; - case 127: // 'exit' - shift(127); // 'exit' - break; - case 128: // 'external' - shift(128); // 'external' - break; - case 136: // 'ft-option' - shift(136); // 'ft-option' - break; - case 149: // 'in' - shift(149); // 'in' - break; - case 150: // 'index' - shift(150); // 'index' - break; - case 156: // 'integrity' - shift(156); // 'integrity' - break; - case 166: // 'lax' - shift(166); // 'lax' - break; - case 187: // 'nodes' - shift(187); // 'nodes' - break; - case 194: // 'option' - shift(194); // 'option' - break; - case 198: // 'ordering' - shift(198); // 'ordering' - break; - case 217: // 'revalidation' - shift(217); // 'revalidation' - break; - case 220: // 'schema' - shift(220); // 'schema' - break; - case 223: // 'score' - shift(223); // 'score' - break; - case 229: // 'sliding' - shift(229); // 'sliding' - break; - case 235: // 'strict' - shift(235); // 'strict' - break; - case 246: // 'tumbling' - shift(246); // 'tumbling' - break; - case 247: // 'type' - shift(247); // 'type' - break; - case 252: // 'updating' - shift(252); // 'updating' - break; - case 256: // 'value' - shift(256); // 'value' - break; - case 257: // 'variable' - shift(257); // 'variable' - break; - case 258: // 'version' - shift(258); // 'version' - break; - case 262: // 'while' - shift(262); // 'while' - break; - case 92: // 'constraint' - shift(92); // 'constraint' - break; - case 171: // 'loop' - shift(171); // 'loop' - break; - default: - shift(216); // 'returning' - } - eventHandler.endNonterminal("FunctionName", e0); - } - - function parse_NCName() - { - eventHandler.startNonterminal("NCName", e0); - switch (l1) - { - case 26: // NCName^Token - shift(26); // NCName^Token - break; - case 65: // 'after' - shift(65); // 'after' - break; - case 70: // 'and' - shift(70); // 'and' - break; - case 74: // 'as' - shift(74); // 'as' - break; - case 75: // 'ascending' - shift(75); // 'ascending' - break; - case 79: // 'before' - shift(79); // 'before' - break; - case 83: // 'case' - shift(83); // 'case' - break; - case 84: // 'cast' - shift(84); // 'cast' - break; - case 85: // 'castable' - shift(85); // 'castable' - break; - case 89: // 'collation' - shift(89); // 'collation' - break; - case 100: // 'count' - shift(100); // 'count' - break; - case 104: // 'default' - shift(104); // 'default' - break; - case 108: // 'descending' - shift(108); // 'descending' - break; - case 113: // 'div' - shift(113); // 'div' - break; - case 117: // 'else' - shift(117); // 'else' - break; - case 118: // 'empty' - shift(118); // 'empty' - break; - case 121: // 'end' - shift(121); // 'end' - break; - case 123: // 'eq' - shift(123); // 'eq' - break; - case 126: // 'except' - shift(126); // 'except' - break; - case 132: // 'for' - shift(132); // 'for' - break; - case 141: // 'ge' - shift(141); // 'ge' - break; - case 143: // 'group' - shift(143); // 'group' - break; - case 145: // 'gt' - shift(145); // 'gt' - break; - case 146: // 'idiv' - shift(146); // 'idiv' - break; - case 155: // 'instance' - shift(155); // 'instance' - break; - case 157: // 'intersect' - shift(157); // 'intersect' - break; - case 158: // 'into' - shift(158); // 'into' - break; - case 159: // 'is' - shift(159); // 'is' - break; - case 167: // 'le' - shift(167); // 'le' - break; - case 169: // 'let' - shift(169); // 'let' - break; - case 173: // 'lt' - shift(173); // 'lt' - break; - case 175: // 'mod' - shift(175); // 'mod' - break; - case 176: // 'modify' - shift(176); // 'modify' - break; - case 181: // 'ne' - shift(181); // 'ne' - break; - case 193: // 'only' - shift(193); // 'only' - break; - case 195: // 'or' - shift(195); // 'or' - break; - case 196: // 'order' - shift(196); // 'order' - break; - case 215: // 'return' - shift(215); // 'return' - break; - case 219: // 'satisfies' - shift(219); // 'satisfies' - break; - case 231: // 'stable' - shift(231); // 'stable' - break; - case 232: // 'start' - shift(232); // 'start' - break; - case 243: // 'to' - shift(243); // 'to' - break; - case 244: // 'treat' - shift(244); // 'treat' - break; - case 249: // 'union' - shift(249); // 'union' - break; - case 261: // 'where' - shift(261); // 'where' - break; - case 265: // 'with' - shift(265); // 'with' - break; - case 68: // 'ancestor' - shift(68); // 'ancestor' - break; - case 69: // 'ancestor-or-self' - shift(69); // 'ancestor-or-self' - break; - case 77: // 'attribute' - shift(77); // 'attribute' - break; - case 88: // 'child' - shift(88); // 'child' - break; - case 91: // 'comment' - shift(91); // 'comment' - break; - case 98: // 'copy' - shift(98); // 'copy' - break; - case 103: // 'declare' - shift(103); // 'declare' - break; - case 105: // 'delete' - shift(105); // 'delete' - break; - case 106: // 'descendant' - shift(106); // 'descendant' - break; - case 107: // 'descendant-or-self' - shift(107); // 'descendant-or-self' - break; - case 114: // 'document' - shift(114); // 'document' - break; - case 115: // 'document-node' - shift(115); // 'document-node' - break; - case 116: // 'element' - shift(116); // 'element' - break; - case 119: // 'empty-sequence' - shift(119); // 'empty-sequence' - break; - case 124: // 'every' - shift(124); // 'every' - break; - case 129: // 'first' - shift(129); // 'first' - break; - case 130: // 'following' - shift(130); // 'following' - break; - case 131: // 'following-sibling' - shift(131); // 'following-sibling' - break; - case 140: // 'function' - shift(140); // 'function' - break; - case 147: // 'if' - shift(147); // 'if' - break; - case 148: // 'import' - shift(148); // 'import' - break; - case 154: // 'insert' - shift(154); // 'insert' - break; - case 160: // 'item' - shift(160); // 'item' - break; - case 165: // 'last' - shift(165); // 'last' - break; - case 177: // 'module' - shift(177); // 'module' - break; - case 179: // 'namespace' - shift(179); // 'namespace' - break; - case 180: // 'namespace-node' - shift(180); // 'namespace-node' - break; - case 186: // 'node' - shift(186); // 'node' - break; - case 197: // 'ordered' - shift(197); // 'ordered' - break; - case 201: // 'parent' - shift(201); // 'parent' - break; - case 207: // 'preceding' - shift(207); // 'preceding' - break; - case 208: // 'preceding-sibling' - shift(208); // 'preceding-sibling' - break; - case 211: // 'processing-instruction' - shift(211); // 'processing-instruction' - break; - case 213: // 'rename' - shift(213); // 'rename' - break; - case 214: // 'replace' - shift(214); // 'replace' - break; - case 221: // 'schema-attribute' - shift(221); // 'schema-attribute' - break; - case 222: // 'schema-element' - shift(222); // 'schema-element' - break; - case 224: // 'self' - shift(224); // 'self' - break; - case 230: // 'some' - shift(230); // 'some' - break; - case 238: // 'switch' - shift(238); // 'switch' - break; - case 239: // 'text' - shift(239); // 'text' - break; - case 245: // 'try' - shift(245); // 'try' - break; - case 248: // 'typeswitch' - shift(248); // 'typeswitch' - break; - case 251: // 'unordered' - shift(251); // 'unordered' - break; - case 255: // 'validate' - shift(255); // 'validate' - break; - case 257: // 'variable' - shift(257); // 'variable' - break; - case 269: // 'xquery' - shift(269); // 'xquery' - break; - case 67: // 'allowing' - shift(67); // 'allowing' - break; - case 76: // 'at' - shift(76); // 'at' - break; - case 78: // 'base-uri' - shift(78); // 'base-uri' - break; - case 80: // 'boundary-space' - shift(80); // 'boundary-space' - break; - case 81: // 'break' - shift(81); // 'break' - break; - case 86: // 'catch' - shift(86); // 'catch' - break; - case 93: // 'construction' - shift(93); // 'construction' - break; - case 96: // 'context' - shift(96); // 'context' - break; - case 97: // 'continue' - shift(97); // 'continue' - break; - case 99: // 'copy-namespaces' - shift(99); // 'copy-namespaces' - break; - case 101: // 'decimal-format' - shift(101); // 'decimal-format' - break; - case 120: // 'encoding' - shift(120); // 'encoding' - break; - case 127: // 'exit' - shift(127); // 'exit' - break; - case 128: // 'external' - shift(128); // 'external' - break; - case 136: // 'ft-option' - shift(136); // 'ft-option' - break; - case 149: // 'in' - shift(149); // 'in' - break; - case 150: // 'index' - shift(150); // 'index' - break; - case 156: // 'integrity' - shift(156); // 'integrity' - break; - case 166: // 'lax' - shift(166); // 'lax' - break; - case 187: // 'nodes' - shift(187); // 'nodes' - break; - case 194: // 'option' - shift(194); // 'option' - break; - case 198: // 'ordering' - shift(198); // 'ordering' - break; - case 217: // 'revalidation' - shift(217); // 'revalidation' - break; - case 220: // 'schema' - shift(220); // 'schema' - break; - case 223: // 'score' - shift(223); // 'score' - break; - case 229: // 'sliding' - shift(229); // 'sliding' - break; - case 235: // 'strict' - shift(235); // 'strict' - break; - case 246: // 'tumbling' - shift(246); // 'tumbling' - break; - case 247: // 'type' - shift(247); // 'type' - break; - case 252: // 'updating' - shift(252); // 'updating' - break; - case 256: // 'value' - shift(256); // 'value' - break; - case 258: // 'version' - shift(258); // 'version' - break; - case 262: // 'while' - shift(262); // 'while' - break; - case 92: // 'constraint' - shift(92); // 'constraint' - break; - case 171: // 'loop' - shift(171); // 'loop' - break; - default: - shift(216); // 'returning' - } - eventHandler.endNonterminal("NCName", e0); - } - - function shift(t) - { - if (l1 == t) - { - whitespace(); - eventHandler.terminal(JSONiqTokenizer.TOKEN[l1], b1, e1 > size ? size : e1); - b0 = b1; e0 = e1; l1 = 0; - } - else - { - error(b1, e1, 0, l1, t); - } - } - - function whitespace() - { - if (e0 != b1) - { - b0 = e0; - e0 = b1; - eventHandler.whitespace(b0, e0); - } - } - - function matchW(set) - { - var code; - for (;;) - { - code = match(set); - if (code != 28) // S^WS - { - break; - } - } - return code; - } - - function lookahead1W(set) - { - if (l1 == 0) - { - l1 = matchW(set); - b1 = begin; - e1 = end; - } - } - - function lookahead1(set) - { - if (l1 == 0) - { - l1 = match(set); - b1 = begin; - e1 = end; - } - } - - function error(b, e, s, l, t) - { - throw new self.ParseException(b, e, s, l, t); - } - - var lk, b0, e0; - var l1, b1, e1; - var eventHandler; - - var input; - var size; - var begin; - var end; - - function match(tokenSetId) - { - var nonbmp = false; - begin = end; - var current = end; - var result = JSONiqTokenizer.INITIAL[tokenSetId]; - var state = 0; - - for (var code = result & 4095; code != 0; ) - { - var charclass; - var c0 = current < size ? input.charCodeAt(current) : 0; - ++current; - if (c0 < 0x80) - { - charclass = JSONiqTokenizer.MAP0[c0]; - } - else if (c0 < 0xd800) - { - var c1 = c0 >> 4; - charclass = JSONiqTokenizer.MAP1[(c0 & 15) + JSONiqTokenizer.MAP1[(c1 & 31) + JSONiqTokenizer.MAP1[c1 >> 5]]]; - } - else - { - if (c0 < 0xdc00) - { - var c1 = current < size ? input.charCodeAt(current) : 0; - if (c1 >= 0xdc00 && c1 < 0xe000) - { - ++current; - c0 = ((c0 & 0x3ff) << 10) + (c1 & 0x3ff) + 0x10000; - nonbmp = true; - } - } - var lo = 0, hi = 5; - for (var m = 3; ; m = (hi + lo) >> 1) - { - if (JSONiqTokenizer.MAP2[m] > c0) hi = m - 1; - else if (JSONiqTokenizer.MAP2[6 + m] < c0) lo = m + 1; - else {charclass = JSONiqTokenizer.MAP2[12 + m]; break;} - if (lo > hi) {charclass = 0; break;} - } - } - - state = code; - var i0 = (charclass << 12) + code - 1; - code = JSONiqTokenizer.TRANSITION[(i0 & 15) + JSONiqTokenizer.TRANSITION[i0 >> 4]]; - - if (code > 4095) - { - result = code; - code &= 4095; - end = current; - } - } - - result >>= 12; - if (result == 0) - { - end = current - 1; - var c1 = end < size ? input.charCodeAt(end) : 0; - if (c1 >= 0xdc00 && c1 < 0xe000) --end; - return error(begin, end, state, -1, -1); - } - - if (nonbmp) - { - for (var i = result >> 9; i > 0; --i) - { - --end; - var c1 = end < size ? input.charCodeAt(end) : 0; - if (c1 >= 0xdc00 && c1 < 0xe000) --end; - } - } - else - { - end -= result >> 9; - } - - return (result & 511) - 1; - } -} - -JSONiqTokenizer.getTokenSet = function(tokenSetId) -{ - var set = []; - var s = tokenSetId < 0 ? - tokenSetId : INITIAL[tokenSetId] & 4095; - for (var i = 0; i < 276; i += 32) - { - var j = i; - var i0 = (i >> 5) * 2062 + s - 1; - var i1 = i0 >> 2; - var i2 = i1 >> 2; - var f = JSONiqTokenizer.EXPECTED[(i0 & 3) + JSONiqTokenizer.EXPECTED[(i1 & 3) + JSONiqTokenizer.EXPECTED[(i2 & 3) + JSONiqTokenizer.EXPECTED[i2 >> 2]]]]; - for ( ; f != 0; f >>>= 1, ++j) - { - if ((f & 1) != 0) - { - set.push(JSONiqTokenizer.TOKEN[j]); - } - } - } - return set; -}; - -JSONiqTokenizer.MAP0 = -[ 66, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, 33, 31, 31, 31, 31, 31, 31, 34, 35, 36, 35, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 31, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 31, 61, 62, 63, 64, 35 -]; - -JSONiqTokenizer.MAP1 = -[ 108, 124, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 156, 181, 181, 181, 181, 181, 214, 215, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 247, 261, 277, 293, 309, 347, 363, 379, 416, 416, 416, 408, 331, 323, 331, 323, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 433, 433, 433, 433, 433, 433, 433, 316, 331, 331, 331, 331, 331, 331, 331, 331, 394, 416, 416, 417, 415, 416, 416, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 330, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 416, 66, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 35, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, 33, 31, 31, 31, 31, 31, 31, 34, 35, 36, 35, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 31, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 31, 61, 62, 63, 64, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 31, 31, 35, 35, 35, 35, 35, 35, 35, 65, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65 -]; - -JSONiqTokenizer.MAP2 = -[ 57344, 63744, 64976, 65008, 65536, 983040, 63743, 64975, 65007, 65533, 983039, 1114111, 35, 31, 35, 31, 31, 35 -]; - -JSONiqTokenizer.INITIAL = -[ 1, 2, 36867, 45060, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -]; - -JSONiqTokenizer.TRANSITION = -[ 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22874, 18847, 17152, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 17365, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 17470, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 18199, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 17890, 17922, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18065, 36544, 18632, 18081, 18098, 18114, 18159, 18185, 18215, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17756, 18816, 18429, 18445, 18143, 17393, 18500, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 18590, 21686, 17152, 19027, 19252, 17687, 19027, 28677, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 17365, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 17470, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 18199, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 17890, 17922, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18065, 36544, 18632, 18081, 18098, 18114, 18159, 18185, 18215, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17756, 18816, 18429, 18445, 18143, 17393, 18500, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 20083, 18847, 18648, 19027, 19252, 21242, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 18774, 18789, 18805, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 18832, 22889, 18925, 19027, 19252, 17569, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18956, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 19073, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 18972, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21818, 18847, 19006, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21671, 18847, 19006, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22395, 20098, 18731, 19027, 19252, 17687, 19027, 17173, 23525, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 18129, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 20746, 19130, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 19043, 18847, 18620, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 19100, 22410, 19006, 19027, 19252, 17687, 19027, 19084, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21967, 21982, 19006, 19027, 19252, 17687, 19027, 18701, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22380, 18847, 19006, 19027, 19252, 30659, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 19157, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 19299, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 19191, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21758, 18847, 19006, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 19237, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21626, 18847, 19006, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 19268, 19284, 19326, 18482, 27869, 30509, 24384, 31417, 23323, 18482, 19370, 18482, 18484, 27202, 19389, 27202, 27202, 19411, 24384, 34295, 24384, 24384, 25485, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 28530, 19459, 24384, 24384, 24384, 24384, 24017, 18036, 24041, 18482, 18482, 18482, 18484, 19487, 27202, 27202, 27202, 27202, 19503, 35523, 19539, 24384, 24384, 24384, 19647, 18482, 35623, 18482, 18482, 23052, 27202, 19557, 27202, 27202, 30764, 23993, 24384, 19579, 24384, 24384, 26758, 18482, 18482, 19346, 27867, 27202, 27202, 19599, 17590, 23998, 24384, 24384, 19619, 25683, 18482, 18482, 28511, 27202, 27203, 23997, 19639, 19887, 28419, 18902, 18483, 19663, 27202, 24325, 35844, 19887, 30991, 19713, 19395, 19736, 22259, 19754, 22073, 19770, 35154, 19795, 19816, 19836, 19859, 25794, 34248, 24116, 19720, 19875, 30988, 23482, 30981, 28304, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21743, 18847, 19006, 19027, 19252, 17431, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22365, 18847, 19907, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21641, 18847, 19326, 18482, 27869, 30544, 24384, 29176, 21442, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 19935, 24384, 24384, 24384, 24384, 32316, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 28530, 19965, 24384, 24384, 24384, 24384, 31473, 18475, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19988, 24384, 24384, 24384, 24384, 24384, 33654, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 29523, 29939, 24384, 24384, 24384, 24384, 26114, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 20017, 22934, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 35771, 20047, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 20068, 19058, 20158, 20367, 20884, 17944, 20276, 20853, 25651, 20604, 20460, 20185, 20209, 17189, 17208, 17281, 17675, 20232, 20273, 20295, 20338, 22456, 20777, 20600, 21329, 20635, 20365, 20937, 21207, 17292, 17421, 21157, 17192, 21217, 22425, 20279, 25549, 22436, 20276, 20383, 18983, 20421, 20446, 21317, 21051, 20476, 20322, 20663, 20490, 17543, 17559, 17585, 22463, 20540, 19523, 20246, 20556, 20257, 20430, 20585, 20620, 20193, 20651, 17661, 18368, 17703, 17730, 17772, 19513, 20679, 20692, 22446, 21027, 21097, 18990, 21111, 20708, 20736, 17744, 17795, 17874, 17590, 25536, 20349, 20762, 20812, 20169, 20828, 21376, 17714, 17976, 18021, 18560, 20844, 20569, 25560, 20869, 20900, 18114, 18159, 20916, 20953, 21013, 21043, 21067, 18281, 21083, 18574, 21127, 21143, 21181, 20515, 20930, 20883, 20504, 21197, 21233, 21258, 20524, 20216, 17405, 21270, 21286, 21302, 20720, 20310, 21345, 21361, 21392, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21952, 18847, 19006, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 21427, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 21479, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 36500, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 28667, 21921, 17617, 36472, 18265, 17237, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 21550, 21509, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 21535, 30636, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21773, 18847, 21587, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21611, 18847, 19006, 19027, 19252, 18169, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21728, 19115, 21878, 19027, 19252, 17687, 19027, 19310, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 17379, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 21906, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 18322, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21937, 18605, 19006, 19027, 19252, 22018, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21656, 21833, 19006, 19027, 19252, 17687, 19027, 21519, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 18482, 27869, 25325, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 30621, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 31473, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 32253, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 21406, 24384, 24384, 24384, 24384, 26114, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 22171, 22934, 24384, 24384, 24384, 22228, 18482, 18482, 27202, 27202, 35771, 20047, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 18482, 27869, 25325, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 30621, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 31473, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 31154, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 21406, 24384, 24384, 24384, 24384, 26114, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 22171, 22934, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 35771, 20047, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 18482, 27869, 25325, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 31644, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 31473, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 31154, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 21406, 24384, 24384, 24384, 24384, 26114, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 22171, 22934, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 35771, 20047, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 18482, 27869, 25325, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 30621, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 33557, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 31154, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 21406, 24384, 24384, 24384, 24384, 26114, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 22171, 22934, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 35771, 20047, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 18482, 27869, 34068, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22245, 24384, 24384, 24384, 24384, 30621, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 31473, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 31154, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 21406, 24384, 24384, 24384, 24384, 26114, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 22171, 22934, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 35771, 20047, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 18482, 27869, 25325, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 18877, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 24017, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 19647, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 23993, 24384, 24384, 24384, 24384, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22290, 18847, 22034, 18482, 27869, 34957, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 18877, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 24017, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 19647, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 23993, 24384, 24384, 24384, 24384, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 18482, 27869, 25325, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 18877, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 24017, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 19647, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 23993, 24384, 24384, 24384, 24384, 34436, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22320, 18847, 19006, 19027, 19252, 17687, 19027, 17173, 27077, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 19919, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21803, 18847, 19006, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22275, 22479, 19006, 19027, 19252, 17687, 19027, 19141, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 22510, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22574, 18847, 22954, 22970, 27597, 22986, 23002, 23033, 22062, 18482, 18482, 18482, 23049, 27202, 27202, 27202, 23068, 22096, 24384, 24384, 24384, 23088, 31359, 31082, 19693, 18482, 28112, 28225, 19443, 35045, 27202, 27202, 23108, 23139, 23155, 23178, 24384, 24384, 23212, 35330, 31659, 23228, 18482, 23256, 23274, 27795, 26712, 23293, 35214, 34879, 33340, 23312, 18235, 23359, 32708, 23949, 24384, 23380, 35255, 23429, 18482, 33884, 23408, 23448, 27202, 27202, 23498, 23518, 21406, 23541, 24384, 24384, 23570, 26114, 23601, 23623, 18482, 33444, 23651, 32875, 27202, 22171, 18862, 23702, 36589, 24384, 18481, 23731, 32601, 27202, 23750, 23768, 20047, 32969, 24367, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 23784, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 28217, 31795, 23804, 26925, 34916, 23831, 26501, 25793, 23859, 23895, 23482, 30981, 22080, 19438, 27956, 19678, 29812, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22589, 18847, 22034, 18482, 27869, 25325, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 30621, 18482, 18482, 18482, 18482, 28902, 25794, 27202, 27202, 27202, 34019, 23914, 22148, 24384, 24384, 24384, 28393, 23930, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 31154, 26591, 18482, 18482, 18482, 31585, 23965, 27202, 27202, 27202, 23986, 22185, 24014, 24384, 24384, 24384, 24033, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 22171, 22934, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 35771, 20047, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 26504, 24057, 24107, 24132, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22604, 18847, 22034, 19697, 27869, 24166, 24384, 24182, 24198, 26600, 18482, 18482, 18484, 24233, 24249, 27202, 27202, 22096, 24268, 24284, 24384, 24384, 30621, 19800, 35427, 35999, 32609, 18482, 25794, 24303, 28959, 23752, 27202, 35010, 22148, 24341, 32040, 26837, 24383, 31473, 31659, 18482, 18482, 18482, 24784, 18484, 27202, 27202, 27202, 27202, 24401, 19503, 24384, 24384, 24384, 24384, 20134, 31154, 18482, 18482, 18482, 27845, 23052, 27202, 27202, 33502, 27202, 30764, 21406, 24384, 24384, 22938, 24384, 26114, 18482, 36246, 18482, 27867, 27202, 24423, 27202, 22171, 22934, 24384, 24442, 24384, 36762, 28438, 18482, 34466, 34508, 35771, 24461, 24385, 24477, 25677, 18482, 36220, 27202, 27202, 24498, 30954, 23715, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 24521, 30990, 27868, 34251, 30090, 23343, 24546, 19856, 25793, 19779, 30988, 23482, 26152, 22080, 19438, 29824, 24562, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22619, 18847, 22034, 25767, 22132, 25325, 23162, 29176, 24597, 24091, 23607, 24656, 26122, 24680, 24426, 24696, 28551, 22096, 24731, 24445, 24747, 23364, 30621, 18482, 18482, 18482, 18482, 24781, 25794, 27202, 27202, 27202, 34210, 35010, 22148, 24384, 24384, 24384, 33259, 31473, 22525, 24087, 24213, 18482, 18482, 34908, 24800, 30419, 27202, 27202, 32418, 19503, 29781, 35065, 24384, 24384, 19891, 31154, 24835, 18482, 18482, 24854, 29214, 27202, 27202, 32006, 27202, 30764, 35344, 24384, 24384, 31544, 24384, 26114, 33098, 27814, 27002, 27867, 34668, 25625, 24871, 22171, 22934, 19214, 34531, 24889, 18481, 18482, 18482, 27202, 27202, 35771, 20047, 24385, 19887, 25677, 18482, 33615, 27202, 27202, 24907, 24930, 23554, 30991, 18484, 27202, 31802, 22199, 19466, 23052, 23296, 19847, 30877, 31015, 24955, 19859, 24983, 34248, 30871, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 24999, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22634, 18847, 25024, 25040, 31293, 25056, 25072, 25088, 22062, 34734, 24217, 36253, 34808, 32637, 25104, 23072, 32848, 22245, 36623, 25120, 30679, 27356, 30621, 25136, 26455, 25174, 25208, 22540, 23240, 25224, 25240, 25256, 25306, 25341, 25357, 25418, 25446, 25470, 26739, 25522, 31659, 23635, 25576, 27398, 25593, 28592, 25945, 25617, 27202, 32546, 27295, 25641, 25850, 25667, 24384, 34758, 25699, 25716, 22552, 27787, 30221, 25756, 25789, 25810, 25828, 28333, 28988, 30764, 21493, 33405, 25848, 25866, 25904, 26114, 31227, 26677, 30167, 27867, 25941, 25961, 27202, 22171, 22934, 25977, 25997, 24384, 23394, 27775, 25740, 25270, 26013, 26048, 26064, 26104, 26138, 26178, 26211, 26230, 26247, 30500, 26380, 26282, 28388, 30991, 33711, 27202, 33645, 26324, 36716, 26353, 26374, 35300, 30990, 26396, 26415, 30927, 26358, 33832, 26442, 26471, 26487, 26520, 23482, 33146, 26539, 26555, 27956, 31266, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22649, 18847, 26576, 26189, 26616, 25325, 26643, 29176, 22062, 26669, 18482, 18482, 18484, 26693, 27202, 27202, 27202, 22096, 26728, 24384, 24384, 24384, 30621, 18482, 18482, 18482, 18482, 26782, 25794, 27202, 27202, 27202, 26258, 35010, 22148, 24384, 24384, 24384, 21571, 31473, 31659, 18482, 18482, 33949, 18482, 18484, 27202, 27202, 25812, 27202, 27202, 19503, 24384, 24384, 24384, 26800, 24384, 31154, 18482, 18482, 18482, 35570, 23052, 27202, 27202, 27202, 26817, 30764, 21406, 24384, 24384, 24384, 26836, 26114, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 22171, 22934, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 35771, 20047, 24385, 19887, 25677, 31882, 18483, 35699, 27202, 19738, 26853, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 26913, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 24967, 31061, 19438, 26953, 27663, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22664, 18847, 26990, 18482, 27869, 25325, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 23017, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 27024, 24384, 24384, 24384, 24384, 24017, 31659, 18482, 18482, 27047, 18482, 18484, 27202, 27202, 27331, 27202, 27202, 27066, 24384, 24384, 29025, 24384, 24384, 19647, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 23993, 24384, 24384, 24384, 24384, 26758, 18482, 18482, 33957, 27867, 27202, 27202, 27093, 17590, 23998, 24384, 24384, 27114, 27135, 36322, 27153, 27201, 27219, 28359, 18229, 34780, 34405, 27235, 35972, 27268, 27293, 27311, 36040, 33984, 20980, 31851, 21453, 30535, 27347, 32520, 27372, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 26337, 30118, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 27397, 27414, 27436, 27452, 27473, 22062, 18482, 18482, 30171, 18484, 27202, 27202, 27982, 27202, 22096, 24384, 24384, 25700, 24384, 18877, 18482, 18482, 18482, 18482, 18482, 34013, 27202, 27202, 27202, 27202, 29731, 22148, 24384, 24384, 24384, 24384, 27119, 31659, 27489, 18482, 18482, 18482, 18484, 27185, 27202, 27202, 27202, 27202, 19503, 27457, 24384, 24384, 24384, 24384, 19647, 18482, 18482, 18482, 27050, 23052, 27202, 27202, 27202, 32469, 30764, 23993, 24384, 24384, 24384, 34982, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 20796, 27202, 29362, 22110, 33940, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22679, 18847, 22034, 27508, 27528, 27553, 35182, 27569, 22062, 29693, 26300, 23258, 27585, 24715, 27613, 27202, 27648, 22096, 36597, 27698, 24384, 27733, 18877, 18482, 27811, 18482, 27830, 22046, 27865, 32194, 27202, 25158, 27885, 27913, 22148, 29458, 24384, 29977, 34392, 26750, 27763, 26889, 18482, 18482, 27252, 29886, 27929, 27202, 27202, 27202, 27981, 27998, 28024, 28045, 24384, 24384, 28062, 28081, 28128, 25506, 28145, 26088, 28160, 27202, 28173, 24640, 28189, 30764, 31496, 24384, 28205, 34154, 36166, 24939, 28241, 28259, 28283, 21463, 33034, 28320, 28349, 17590, 20967, 23092, 28375, 28409, 28095, 28435, 28454, 28474, 28509, 28527, 20001, 33682, 25879, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30272, 28267, 28546, 28567, 19425, 28583, 23052, 23296, 19847, 19471, 28608, 28653, 31075, 25794, 34248, 19856, 25793, 19779, 29644, 35950, 30318, 22080, 19438, 27956, 23123, 28693, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 18482, 27869, 25325, 24384, 29176, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 18877, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 24017, 22494, 18482, 18482, 18482, 18482, 18484, 25283, 27202, 27202, 27202, 27202, 19503, 29397, 24384, 24384, 24384, 24384, 19647, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 23993, 24384, 24384, 24384, 24384, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22694, 18847, 28740, 28775, 28810, 28834, 28850, 28873, 28889, 24142, 28936, 31945, 36329, 25290, 28954, 27632, 28975, 29004, 24505, 29020, 25454, 29041, 23017, 27512, 29083, 29103, 30721, 18482, 23478, 29123, 24819, 27202, 29148, 28920, 27024, 29166, 23196, 24384, 29192, 35529, 31659, 18482, 18482, 25601, 32589, 29211, 27202, 27202, 31434, 30700, 29230, 27066, 24384, 24384, 24384, 29255, 29306, 19647, 18482, 33383, 18482, 18482, 23052, 27202, 29333, 27202, 27202, 30764, 23993, 35925, 24384, 24384, 24384, 27717, 36123, 18482, 18482, 29350, 29413, 27202, 35642, 17590, 21411, 29432, 24384, 25981, 18481, 33866, 18482, 27202, 26967, 27203, 23997, 32729, 19887, 25677, 18482, 26897, 27202, 27202, 29451, 23870, 24354, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 31737, 19859, 25794, 34248, 19856, 29474, 29539, 29283, 29581, 29637, 22080, 32533, 29501, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22709, 18847, 22034, 29660, 29512, 25325, 33242, 29176, 29682, 27245, 18482, 29709, 33286, 26974, 27202, 29725, 29747, 22096, 19221, 24384, 32702, 29772, 18877, 26784, 33892, 28458, 18482, 18482, 25794, 29797, 27202, 29840, 27202, 35010, 22148, 35817, 24384, 29859, 24384, 24017, 36756, 25192, 18482, 18482, 29879, 18484, 27202, 29902, 27202, 26032, 27202, 29925, 24384, 29960, 24384, 33594, 24384, 19647, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 29239, 29993, 24384, 24384, 24384, 24384, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 31665, 18482, 18482, 19603, 27202, 27203, 23997, 30013, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19949, 19466, 36661, 19563, 19847, 30029, 30128, 30062, 19859, 25794, 30078, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 30106, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22724, 18847, 30152, 30187, 30237, 30288, 30304, 30344, 22062, 35616, 32797, 25773, 18484, 29909, 34096, 26820, 27202, 22096, 24914, 23189, 29195, 24384, 18877, 34444, 30360, 18482, 18482, 18482, 23413, 24707, 27202, 27202, 27202, 35010, 30378, 34990, 24384, 24384, 24384, 24017, 29554, 18482, 18482, 27137, 18482, 31281, 30394, 27202, 27202, 30413, 30566, 19503, 30435, 24384, 24384, 29969, 35678, 19647, 28759, 30455, 35459, 35606, 23052, 28724, 30490, 30525, 30560, 30764, 23993, 20123, 30582, 30606, 30675, 26291, 33426, 28938, 27682, 30695, 23675, 33466, 28493, 17590, 23944, 20405, 34338, 20997, 32331, 26308, 30716, 30737, 24315, 30756, 21563, 36372, 30787, 26653, 24611, 33177, 32448, 30814, 31804, 25430, 25917, 26523, 18484, 28818, 31802, 29269, 19466, 28297, 34240, 23815, 26076, 30842, 30858, 32115, 30893, 30915, 32757, 25793, 30943, 30988, 23482, 30981, 30970, 31007, 27956, 19678, 29489, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22739, 18847, 31031, 31047, 32397, 31098, 31114, 31170, 22062, 18482, 29565, 35577, 36725, 27202, 33216, 31186, 24407, 22096, 24384, 20142, 31202, 34301, 27748, 31218, 33388, 27166, 18482, 29087, 27277, 27202, 31251, 31309, 27202, 31328, 31344, 24384, 31375, 31391, 24384, 31410, 31659, 18482, 36130, 32801, 18482, 18484, 27202, 27202, 31433, 31450, 27202, 19503, 24384, 24384, 31470, 33588, 24384, 32977, 18482, 18482, 18482, 18482, 30038, 27202, 27202, 27202, 27202, 31489, 32244, 24384, 24384, 24384, 24384, 31512, 18482, 28755, 18482, 24634, 35732, 27202, 27202, 28637, 31538, 35788, 24384, 24384, 19337, 31986, 18482, 33208, 25316, 27203, 29997, 29863, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 31560, 19887, 31601, 32369, 33316, 30136, 31629, 19972, 31681, 31726, 31753, 31781, 30046, 31820, 31847, 25794, 34282, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 31867, 30252, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22754, 18847, 22034, 18909, 30474, 31902, 24287, 31918, 31934, 32767, 35262, 27008, 29621, 34103, 19820, 29416, 33323, 22096, 27031, 30439, 29435, 28857, 29596, 18482, 18482, 18482, 31961, 18482, 25794, 27202, 27202, 35038, 27202, 35010, 22148, 24384, 24384, 29389, 24384, 24017, 31979, 18482, 26937, 18482, 18482, 18484, 27202, 31454, 32002, 27202, 27202, 32022, 24384, 33015, 32056, 24384, 24384, 33690, 18482, 18482, 33119, 18482, 23052, 27202, 27202, 27624, 27202, 29756, 32078, 24384, 24384, 34332, 24384, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 36691, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 31710, 22155, 33181, 24252, 32103, 30990, 27868, 34251, 19859, 25794, 34248, 30265, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 32138, 32166, 32186, 30826, 33252, 29067, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 23585, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 32210, 24384, 24384, 24384, 24384, 24017, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 32233, 24384, 24384, 24384, 24384, 24384, 19647, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 23993, 24384, 24384, 24384, 24384, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 33857, 18483, 36057, 27202, 19738, 35289, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22769, 18847, 32269, 31613, 34604, 32285, 32301, 32351, 22062, 18482, 32367, 19354, 32385, 27202, 32413, 27098, 32434, 22096, 24384, 32485, 20052, 32506, 18877, 25396, 23734, 18482, 18482, 32562, 32625, 27202, 32653, 27202, 23664, 32673, 32689, 24384, 32724, 24384, 25888, 32745, 34706, 18482, 27381, 32783, 24577, 24838, 32817, 24873, 32838, 32864, 27202, 32899, 32934, 24384, 32957, 29317, 24384, 30798, 26214, 27678, 33875, 18482, 23052, 36352, 27202, 32993, 27202, 30764, 23993, 32087, 24384, 33013, 24384, 35853, 18482, 18482, 30362, 27965, 27202, 27202, 33754, 17590, 20112, 24384, 24384, 34576, 20792, 18482, 18482, 33031, 27202, 27203, 36159, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 34554, 24150, 33050, 33080, 33114, 27868, 34251, 23843, 26560, 31696, 19856, 25793, 19779, 30988, 23482, 30981, 33135, 22123, 27956, 23463, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22784, 18847, 33162, 28106, 33197, 25325, 33232, 29176, 22062, 33275, 35433, 18482, 18484, 33302, 26399, 33339, 27202, 22096, 33356, 28065, 33404, 24384, 18877, 22229, 18482, 33421, 18482, 18482, 33442, 33460, 24811, 27202, 27202, 26627, 22148, 24758, 35190, 24384, 24384, 25925, 29611, 18482, 18482, 29290, 25186, 33482, 33501, 27202, 27202, 33518, 36276, 19503, 33554, 24384, 24384, 33573, 32490, 19647, 18482, 18482, 31235, 33610, 23052, 27202, 27202, 33631, 27202, 30764, 23993, 24384, 24384, 33670, 24384, 26862, 27492, 18482, 33706, 27867, 32883, 34639, 27202, 17590, 32036, 24765, 23788, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 33727, 36097, 19887, 25677, 18482, 23334, 27202, 29150, 19738, 23870, 35357, 30328, 18484, 33748, 34675, 33770, 19466, 34050, 33824, 31831, 30990, 27868, 34251, 33848, 28913, 33908, 19856, 30469, 33973, 25385, 36033, 34000, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22799, 18847, 34035, 32576, 34084, 34119, 34135, 34170, 34186, 32150, 36005, 31522, 31886, 34202, 34226, 34267, 29334, 34317, 34354, 34378, 34421, 26801, 18877, 26195, 29666, 25402, 18482, 35091, 25794, 34460, 34482, 34504, 25832, 35010, 22148, 34524, 34547, 34570, 19623, 24017, 36654, 35111, 24664, 18482, 32335, 34592, 31312, 34620, 34636, 27202, 34655, 34691, 28046, 34750, 34774, 24384, 33785, 19647, 34796, 32170, 34844, 24581, 33485, 26704, 34828, 34860, 35493, 29132, 36704, 33800, 35368, 32941, 34146, 26758, 34895, 18482, 18482, 34932, 34948, 27202, 32997, 17590, 29944, 34973, 24384, 36296, 25500, 30202, 35875, 35006, 35026, 26266, 20396, 31146, 35061, 35081, 35127, 24623, 28484, 27897, 19738, 35143, 35170, 26162, 28794, 35206, 35230, 33064, 35245, 23052, 23296, 29054, 30990, 27868, 34251, 19859, 25794, 34248, 24530, 25147, 35278, 31765, 35316, 33370, 22080, 19438, 27956, 24072, 28623, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22814, 18847, 22034, 34720, 34059, 35384, 20989, 35400, 35416, 35449, 18482, 18482, 23432, 35475, 27202, 27202, 27202, 35509, 31127, 24384, 24384, 24384, 35545, 18482, 26871, 35101, 35593, 24855, 25794, 30397, 23502, 26024, 35639, 35658, 22148, 19541, 19583, 30590, 35674, 27709, 35560, 29107, 18482, 18482, 18482, 18484, 27202, 35694, 27202, 27202, 27202, 35715, 24384, 36580, 24384, 24384, 24384, 19647, 30215, 18482, 18482, 18482, 23052, 35731, 27202, 27202, 27202, 27537, 22904, 24384, 24384, 24384, 24384, 23879, 35748, 18482, 18482, 25008, 35770, 27202, 27202, 17590, 20031, 35787, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 23898, 18484, 34488, 31802, 25371, 19466, 23052, 23296, 26426, 30990, 27868, 34251, 19859, 25794, 35804, 19856, 27178, 35833, 33092, 23482, 30981, 22080, 22212, 28705, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22829, 18847, 22034, 35869, 28716, 25325, 31137, 29176, 22062, 26766, 18482, 22558, 18484, 23970, 27202, 29843, 27202, 22096, 33732, 24384, 31394, 24384, 18877, 18482, 18482, 26880, 18482, 18482, 25794, 27202, 30740, 27202, 27202, 35010, 22148, 24384, 24891, 24384, 24384, 24017, 31659, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 19647, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 23993, 24384, 24384, 24384, 24384, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22844, 18847, 22034, 27849, 27869, 35891, 24384, 35907, 22062, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 22096, 24384, 24384, 24384, 24384, 18877, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 24017, 31575, 18482, 18482, 18482, 18482, 26231, 27202, 27202, 27202, 27202, 27202, 19503, 35923, 24384, 24384, 24384, 24384, 19647, 18482, 28129, 18482, 18482, 35941, 27202, 32822, 27202, 32657, 30764, 23993, 24384, 32217, 24384, 32062, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22859, 18847, 22034, 35966, 34820, 25325, 33931, 29176, 35988, 18482, 23277, 18482, 36021, 27202, 27202, 36056, 36073, 22096, 24384, 24384, 36096, 33921, 18877, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 35010, 22148, 24384, 24384, 24384, 24384, 24017, 36113, 18482, 25577, 18482, 18482, 18484, 27202, 27202, 27324, 27202, 27202, 36146, 24384, 24384, 34362, 24384, 24384, 19647, 28243, 18482, 18482, 18482, 23052, 30899, 27202, 27202, 27202, 23686, 23993, 33808, 24384, 24384, 24384, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22305, 18847, 22034, 19373, 27869, 36182, 24384, 36198, 22062, 18482, 18482, 18482, 18049, 27202, 27202, 27202, 35485, 22096, 24384, 24384, 24384, 29371, 18877, 18482, 36214, 18482, 28788, 18482, 25794, 34872, 27202, 27420, 27202, 35010, 22148, 29380, 24384, 24482, 24384, 24017, 31659, 18482, 36236, 18482, 18482, 18484, 27202, 36080, 27202, 27202, 27202, 19503, 24384, 28029, 24384, 24384, 24384, 19647, 18482, 18482, 32122, 18482, 35754, 27202, 27202, 36269, 27202, 33531, 23993, 24384, 24384, 36292, 24384, 36312, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 25730, 18482, 18482, 36345, 27202, 27203, 19203, 24385, 19887, 25677, 31963, 18483, 27202, 32462, 19738, 23870, 36368, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22350, 18847, 36388, 19027, 19252, 17687, 36433, 17173, 17595, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 36452, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 17682, 21701, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22335, 18847, 19006, 19027, 19252, 17687, 19027, 21712, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17991, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21788, 18847, 36488, 19027, 19252, 17687, 19027, 17173, 17779, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17810, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21165, 21997, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21803, 18847, 19006, 19027, 19252, 17687, 19027, 17173, 30771, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 36516, 17308, 17327, 17346, 18937, 18460, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 21217, 21848, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21803, 18847, 19326, 18482, 27869, 30764, 24384, 29176, 28008, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 36566, 24384, 24384, 24384, 24384, 22919, 18482, 18482, 18482, 18482, 18482, 25794, 27202, 27202, 27202, 27202, 28530, 36613, 24384, 24384, 24384, 24384, 24017, 18892, 18482, 18482, 18482, 18482, 18484, 27202, 27202, 27202, 27202, 27202, 19503, 24384, 24384, 24384, 24384, 24384, 19647, 18482, 18482, 18482, 18482, 23052, 27202, 27202, 27202, 27202, 30764, 23993, 24384, 24384, 24384, 24384, 26758, 18482, 18482, 18482, 27867, 27202, 27202, 27202, 17590, 23998, 24384, 24384, 24384, 18481, 18482, 18482, 27202, 27202, 27203, 23997, 24385, 19887, 25677, 18482, 18483, 27202, 27202, 19738, 23870, 19887, 30991, 18484, 27202, 31802, 19425, 19466, 23052, 23296, 19847, 30990, 27868, 34251, 19859, 25794, 34248, 19856, 25793, 19779, 30988, 23482, 30981, 22080, 19438, 27956, 19678, 27944, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 36639, 36677, 18731, 19027, 19252, 17687, 19027, 17454, 17595, 36436, 17330, 17349, 18940, 17189, 17208, 17281, 17675, 17223, 17308, 17327, 17346, 18937, 36741, 21855, 18660, 18676, 19025, 17265, 22008, 17292, 17421, 21157, 17192, 17682, 21701, 17311, 18669, 19018, 19027, 17447, 32909, 17497, 17520, 17251, 36410, 17824, 20322, 20663, 20490, 17543, 17559, 17585, 21862, 17504, 17527, 17258, 36417, 21890, 21915, 17611, 36466, 18259, 17633, 17661, 18368, 17703, 17730, 17772, 33538, 21921, 17617, 36472, 18265, 36530, 17477, 19171, 17902, 17934, 17744, 17795, 17874, 17590, 21595, 17481, 19175, 17906, 18742, 17960, 36550, 17714, 17976, 18021, 18738, 18692, 18413, 18632, 18081, 18098, 18114, 18159, 18185, 18717, 18094, 18251, 18292, 18281, 18308, 18005, 18338, 18354, 18384, 17849, 36402, 19251, 17838, 17163, 30650, 18400, 17858, 32918, 17645, 18816, 18429, 18445, 18530, 17393, 18758, 18516, 18546, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 0, 94242, 0, 118820, 0, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2482176, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 2207744, 2404352, 2412544, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3104768, 2605056, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2678784, 2207744, 2695168, 2207744, 2703360, 2207744, 2711552, 2752512, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 3170304, 3174400, 2158592, 0, 139, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 2748416, 2756608, 2777088, 2801664, 2158592, 2158592, 2158592, 2863104, 2891776, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3104768, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2785280, 2207744, 2809856, 2207744, 2207744, 2842624, 2207744, 2207744, 2207744, 2899968, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2564096, 2207744, 2207744, 2207744, 2158592, 2404352, 2412544, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2564096, 2158592, 2158592, 2605056, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2678784, 2158592, 2695168, 2158592, 2703360, 2158592, 2711552, 2752512, 2158592, 2158592, 2785280, 2158592, 2158592, 2785280, 2158592, 2809856, 2158592, 2158592, 2842624, 2158592, 2158592, 2158592, 2899968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 641, 0, 2158592, 0, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 32768, 0, 2158592, 0, 2158592, 2158592, 2158592, 2383872, 2158592, 2158592, 2158592, 2158592, 3006464, 2383872, 2207744, 2207744, 2207744, 2207744, 2158877, 2158877, 2158877, 2158877, 0, 0, 0, 2158877, 2572573, 2158877, 2158877, 0, 2207744, 2207744, 2596864, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2641920, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162968, 0, 0, 3104768, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2146304, 2146304, 2224128, 2224128, 2232320, 2232320, 2232320, 641, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2531328, 2158592, 2158592, 2158592, 2158592, 2158592, 2617344, 2158592, 2158592, 2158592, 2158592, 2441216, 2445312, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2502656, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2580480, 2158592, 2158592, 2158592, 2158592, 2621440, 2158592, 2580480, 2158592, 2158592, 2158592, 2158592, 2621440, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2699264, 2158592, 2158592, 2158592, 2158592, 2158592, 2748416, 2756608, 2777088, 2801664, 2207744, 2863104, 2891776, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3018752, 2207744, 3043328, 2207744, 2207744, 2207744, 2207744, 3080192, 2207744, 2207744, 3112960, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 167936, 0, 0, 2162688, 0, 0, 2207744, 2207744, 2207744, 3186688, 2207744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2404352, 2412544, 2158592, 2510848, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2584576, 2158592, 2609152, 2158592, 2158592, 2629632, 2158592, 2158592, 2158592, 2686976, 2158592, 2715648, 2158592, 2158592, 3121152, 2158592, 2158592, 2158592, 3149824, 2158592, 2158592, 3170304, 3174400, 2158592, 2367488, 2207744, 2207744, 2207744, 2207744, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2572288, 2158592, 2158592, 0, 2207744, 2207744, 2207744, 2433024, 2207744, 2453504, 2461696, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2510848, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3096576, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 0, 0, 2715648, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2867200, 2207744, 2904064, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2473984, 2207744, 2207744, 2494464, 2207744, 2207744, 2207744, 2523136, 2207744, 2207744, 2207744, 2207744, 3014656, 2207744, 2207744, 3051520, 2207744, 2207744, 3100672, 2207744, 2207744, 3121152, 2207744, 2207744, 2207744, 2207744, 2207744, 2531328, 2207744, 2207744, 2207744, 2207744, 2207744, 2617344, 2207744, 2207744, 2207744, 2207744, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2572288, 2158592, 2158592, 1508, 2207744, 3149824, 2207744, 2207744, 3170304, 3174400, 2207744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 2158592, 2158592, 2158592, 2404352, 2412544, 2707456, 2732032, 2207744, 2207744, 2207744, 2822144, 2826240, 2207744, 2895872, 2207744, 2207744, 2924544, 2207744, 2207744, 2973696, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 285, 2158592, 2158592, 3112960, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 2207744, 2207744, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 0, 0, 2535424, 2543616, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 2990080, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2572288, 2981888, 2207744, 2207744, 3002368, 2207744, 3047424, 3063808, 3076096, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3203072, 2708960, 2732032, 2158592, 2158592, 2158592, 2822144, 2827748, 2158592, 2895872, 2158592, 2158592, 2924544, 2158592, 2158592, 2973696, 2158592, 2981888, 2158592, 2158592, 3002368, 2158592, 3047424, 3063808, 3076096, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3203072, 2981888, 2158592, 2158592, 3003876, 2158592, 3047424, 3063808, 3076096, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3203072, 2207744, 2207744, 2207744, 2207744, 2207744, 2424832, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 172310, 279, 0, 2162688, 0, 0, 2523136, 2527232, 2158592, 2158592, 2576384, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2908160, 2527232, 2207744, 2207744, 2576384, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2908160, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 286, 2158592, 2158592, 0, 0, 2158592, 2158592, 2158592, 2158592, 2633728, 2658304, 0, 0, 2740224, 2744320, 0, 2834432, 2207744, 2207744, 2977792, 2207744, 2207744, 2207744, 2207744, 3039232, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3158016, 0, 0, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 933, 45, 45, 45, 45, 442, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 2494464, 2158592, 2158592, 2158592, 2524757, 2527232, 2158592, 2158592, 2576384, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 1504, 2158592, 2498560, 2158592, 2158592, 2158592, 2158592, 2568192, 2158592, 2592768, 2625536, 2158592, 2158592, 2674688, 2736128, 2158592, 2158592, 0, 2158592, 2912256, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3108864, 2158592, 2158592, 3133440, 3145728, 3153920, 2375680, 2379776, 2207744, 2207744, 2420736, 2207744, 2449408, 2207744, 2207744, 2207744, 2498560, 2207744, 2207744, 2207744, 2207744, 2568192, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 551, 2158592, 2158592, 2158592, 2158592, 2207744, 2506752, 2207744, 2207744, 2207744, 2207744, 2207744, 2158592, 2506752, 0, 2020, 2158592, 2592768, 2625536, 2207744, 2207744, 2674688, 2736128, 2207744, 2207744, 2207744, 2912256, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 20480, 0, 0, 0, 0, 0, 2162688, 20480, 0, 2207744, 3108864, 2207744, 2207744, 3133440, 3145728, 3153920, 2375680, 2379776, 2158592, 2158592, 2420736, 2158592, 2449408, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 641, 0, 0, 0, 0, 0, 0, 2367488, 2158592, 2498560, 2158592, 2158592, 1621, 2158592, 2158592, 2568192, 2158592, 2592768, 2625536, 2158592, 2158592, 2674688, 0, 0, 0, 0, 0, 1608, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1107, 97, 97, 1110, 97, 97, 3133440, 3145728, 3153920, 2158592, 2408448, 2416640, 2158592, 2465792, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3014656, 2158592, 2158592, 3051520, 2158592, 2158592, 3100672, 2158592, 2158592, 3121152, 2158592, 2158592, 2158592, 3149824, 2416640, 2207744, 2465792, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2633728, 2658304, 2740224, 2744320, 2834432, 2949120, 2158592, 2985984, 2158592, 2998272, 2158592, 2158592, 2158592, 3129344, 2207744, 2408448, 2949120, 2207744, 2985984, 2207744, 2998272, 2207744, 2207744, 2207744, 3129344, 2158592, 2408448, 2416640, 2158592, 2465792, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 32768, 0, 0, 0, 0, 0, 0, 2367488, 2949120, 2158592, 2985984, 2158592, 2998272, 2158592, 2158592, 2158592, 3129344, 2158592, 2158592, 2478080, 2158592, 2158592, 2158592, 2535424, 2543616, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3117056, 2207744, 2207744, 2478080, 2207744, 2207744, 2207744, 2207744, 2207744, 2584576, 2207744, 2609152, 2207744, 2207744, 2629632, 2207744, 2207744, 2207744, 2686976, 2207744, 2207744, 2535424, 2543616, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3117056, 2158592, 2158592, 2478080, 2207744, 2207744, 2990080, 2207744, 2207744, 2158592, 2158592, 2482176, 2158592, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 0, 2158592, 2908160, 2158592, 2158592, 2158592, 2977792, 2158592, 2158592, 2158592, 2158592, 3039232, 2158592, 2158592, 3010560, 2207744, 2428928, 2207744, 2514944, 2207744, 2588672, 2207744, 2838528, 2207744, 2207744, 2207744, 3010560, 2158592, 2428928, 2158592, 2514944, 0, 0, 2158592, 2588672, 2158592, 0, 2838528, 2158592, 2158592, 2158592, 3010560, 2158592, 2506752, 2158592, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 0, 29315, 922, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 3006464, 2383872, 0, 2020, 2158592, 2158592, 2158592, 2158592, 3006464, 2158592, 2637824, 2953216, 2158592, 2207744, 2637824, 2953216, 2207744, 0, 0, 2158592, 2637824, 2953216, 2158592, 2539520, 2158592, 2539520, 2207744, 0, 0, 2539520, 2158592, 2158592, 2158592, 2158592, 2207744, 2506752, 2207744, 2207744, 2207744, 2207744, 2207744, 2158592, 2506752, 0, 0, 2158592, 2207744, 0, 2158592, 2158592, 2207744, 0, 2158592, 2158592, 2207744, 0, 2158592, 2965504, 2965504, 2965504, 0, 0, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2474269, 2158877, 2158877, 0, 0, 2158877, 2158877, 2158877, 2158877, 2634013, 2658589, 0, 0, 2740509, 2744605, 0, 2834717, 40976, 18, 36884, 45078, 24, 28, 90143, 94242, 118820, 102439, 106538, 98347, 118820, 118820, 118820, 40976, 18, 18, 36884, 0, 0, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 86016, 0, 0, 2211840, 102439, 0, 0, 0, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 3158016, 0, 2375680, 2379776, 2158592, 2158592, 2420736, 2158592, 2449408, 2158592, 2158592, 0, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 135, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2564096, 2158592, 2158592, 2158592, 2158592, 2158592, 2596864, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2641920, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2781184, 2793472, 2494464, 2158592, 2158592, 2158592, 2523136, 2527232, 2158592, 2158592, 2576384, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 0, 27, 27, 0, 2158592, 2498560, 2158592, 2158592, 0, 2158592, 2158592, 2568192, 2158592, 2592768, 2625536, 2158592, 2158592, 2674688, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2473984, 2158592, 2158592, 2494464, 2158592, 2158592, 2158592, 3006464, 2383872, 0, 0, 2158592, 2158592, 2158592, 2158592, 3006464, 2158592, 2637824, 2953216, 2158592, 2207744, 2637824, 2953216, 40976, 18, 36884, 45078, 24, 27, 147488, 94242, 147456, 147488, 106538, 98347, 0, 0, 147456, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 0, 81920, 0, 94242, 0, 0, 0, 2211840, 0, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2428928, 2158592, 2514944, 2158592, 2588672, 2158592, 2838528, 2158592, 2158592, 40976, 18, 151573, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 0, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 1315, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1487, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 0, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1663, 45, 45, 45, 45, 45, 45, 45, 45, 45, 183, 45, 45, 45, 45, 201, 45, 130, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3096576, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2207744, 2158592, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 644, 2207744, 2207744, 2207744, 3186688, 2207744, 0, 1080, 0, 1084, 0, 1088, 0, 0, 0, 0, 0, 0, 0, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2531466, 2158730, 2158730, 2158730, 2158730, 2158730, 2617482, 0, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2781184, 2793472, 2158592, 2818048, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 40976, 18, 36884, 45078, 24, 27, 90143, 159779, 159744, 102439, 159779, 98347, 0, 0, 159744, 40976, 18, 18, 36884, 0, 45078, 0, 2224253, 172032, 2224253, 2232448, 2232448, 172032, 2232448, 90143, 0, 0, 2170880, 0, 0, 550, 829, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 124, 124, 127, 127, 127, 40976, 18, 36884, 45078, 25, 29, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 163931, 40976, 18, 18, 36884, 0, 45078, 249856, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 2170880, 0, 0, 827, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 4243810, 4243810, 24, 24, 27, 27, 27, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 57344, 286, 2158592, 2158592, 2158592, 2158592, 2707456, 2732032, 2158592, 2158592, 2158592, 2822144, 2826240, 2158592, 2895872, 2158592, 2158592, 2924544, 2158592, 2158592, 2973696, 2158592, 2207744, 2207744, 2207744, 3186688, 2207744, 0, 0, 0, 0, 0, 0, 53248, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 1613, 97, 97, 97, 97, 97, 97, 1495, 97, 97, 97, 97, 97, 97, 97, 97, 97, 566, 97, 97, 97, 97, 97, 97, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 546, 0, 0, 0, 0, 286, 2158592, 2158592, 2158592, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 17, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 20480, 120, 121, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 2170880, 0, 53248, 550, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 196608, 18, 266240, 24, 24, 27, 27, 27, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 0, 45, 45, 45, 45, 45, 45, 45, 1535, 45, 45, 45, 45, 45, 45, 45, 1416, 45, 45, 45, 45, 45, 45, 45, 45, 424, 45, 45, 45, 45, 45, 45, 45, 45, 45, 405, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 199, 45, 45, 67, 67, 67, 67, 67, 491, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1766, 67, 67, 67, 1767, 67, 24850, 24850, 12564, 12564, 0, 0, 2166784, 546, 0, 53531, 53531, 0, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 743, 57889, 0, 2170880, 0, 0, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 1856, 45, 1858, 1859, 67, 67, 67, 1009, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1021, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2367773, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2699549, 2158877, 2158877, 2158877, 2158877, 2158877, 2748701, 2756893, 2777373, 2801949, 97, 1115, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 857, 97, 67, 67, 67, 67, 67, 1258, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1826, 67, 97, 97, 97, 97, 97, 97, 1338, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 870, 97, 97, 67, 67, 67, 1463, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1579, 67, 67, 97, 97, 97, 1518, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 904, 905, 97, 97, 97, 97, 1620, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 0, 0, 0, 0, 0, 45, 1679, 67, 67, 67, 1682, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1690, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 669, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 189, 45, 45, 45, 1748, 45, 45, 45, 1749, 1750, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1959, 67, 67, 67, 67, 1768, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1791, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1802, 67, 1817, 67, 67, 67, 67, 67, 67, 1823, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 97, 1848, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 659, 45, 45, 45, 45, 45, 45, 45, 1863, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 495, 67, 67, 67, 67, 67, 1878, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 0, 1973, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1165, 97, 1167, 0, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 136, 2158592, 2158592, 2158592, 2158592, 2158592, 3158016, 229376, 2375680, 2379776, 2158592, 2158592, 2420736, 2158592, 2449408, 2158592, 2158592, 67, 24850, 24850, 12564, 12564, 0, 0, 280, 547, 0, 53531, 53531, 0, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 1789, 97, 57889, 547, 547, 0, 0, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 1799, 45, 45, 45, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 1092, 0, 0, 0, 0, 0, 97, 97, 97, 97, 1612, 97, 97, 97, 97, 1616, 97, 1297, 1472, 0, 0, 0, 0, 1303, 1474, 0, 0, 0, 0, 1309, 1476, 0, 0, 0, 0, 97, 97, 97, 1481, 97, 97, 97, 97, 97, 97, 1488, 97, 0, 1474, 0, 1476, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 607, 97, 97, 97, 97, 40976, 18, 36884, 45078, 26, 30, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 213080, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 143448, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 0, 0, 0, 0, 97, 97, 97, 97, 1482, 97, 1483, 97, 97, 97, 97, 97, 97, 1326, 97, 97, 1329, 1330, 97, 97, 97, 97, 97, 97, 1159, 1160, 97, 97, 97, 97, 97, 97, 97, 97, 590, 97, 97, 97, 97, 97, 97, 97, 0, 94242, 0, 0, 0, 2211974, 102439, 0, 0, 106538, 98347, 0, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2474122, 2158730, 2158730, 2494602, 2158730, 2158730, 2158730, 2809994, 2158730, 2158730, 2842762, 2158730, 2158730, 2158730, 2900106, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3014794, 2158730, 2158730, 3051658, 2158730, 2158730, 3100810, 2158730, 2158730, 2158730, 2158730, 3096714, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2207744, 2207744, 2207744, 2207744, 2207744, 2572288, 2207744, 2207744, 2207744, 2207744, 541, 541, 543, 543, 0, 0, 2166784, 0, 548, 549, 549, 0, 286, 2158877, 2158877, 2158877, 2863389, 2892061, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3186973, 2158877, 0, 0, 0, 0, 0, 0, 0, 0, 2367626, 2158877, 2404637, 2412829, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2564381, 2158877, 2158877, 2605341, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2679069, 2158877, 2695453, 2158877, 2703645, 2158877, 2711837, 2752797, 2158877, 0, 2158877, 2158877, 2158877, 2384010, 2158730, 2158730, 2158730, 2158730, 3006602, 2383872, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2441216, 2445312, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2502656, 2158877, 2785565, 2158877, 2810141, 2158877, 2158877, 2842909, 2158877, 2158877, 2158877, 2900253, 2158877, 2158877, 2158877, 2158877, 2158877, 2531613, 2158877, 2158877, 2158877, 2158877, 2158877, 2617629, 2158877, 2158877, 2158877, 2158877, 2158730, 2818186, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3105053, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 0, 0, 0, 0, 0, 97, 97, 97, 1611, 97, 97, 97, 97, 97, 97, 97, 1496, 97, 97, 1499, 97, 97, 97, 97, 97, 2441354, 2445450, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2502794, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2433162, 2158730, 2453642, 2461834, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2580618, 2158730, 2158730, 2158730, 2158730, 2621578, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2699402, 2158730, 2158730, 2158730, 2158730, 2678922, 2158730, 2695306, 2158730, 2703498, 2158730, 2711690, 2752650, 2158730, 2158730, 2785418, 2158730, 2158730, 2158730, 3113098, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3186826, 2158730, 2207744, 2207744, 2207744, 2207744, 2699264, 2207744, 2207744, 2207744, 2207744, 2207744, 2748416, 2756608, 2777088, 2801664, 2207744, 2207744, 2158877, 2158877, 2158877, 2158877, 2158877, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 0, 0, 2535709, 2543901, 2158877, 2158877, 2158877, 0, 0, 0, 2158877, 2158877, 2158877, 2990365, 2158877, 2158877, 2158730, 2158730, 2158730, 2158730, 2158730, 2572426, 2158877, 2502941, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2580765, 2158877, 2158877, 2158877, 2158877, 2621725, 2158877, 3019037, 2158877, 3043613, 2158877, 2158877, 2158877, 2158877, 3080477, 2158877, 2158877, 3113245, 2158877, 2158877, 2158877, 2158877, 0, 2158877, 2908445, 2158877, 2158877, 2158877, 2978077, 2158877, 2158877, 2158877, 2158877, 3039517, 2158877, 2158730, 2510986, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2584714, 2158730, 2609290, 2158730, 2158730, 2629770, 2158730, 2158730, 2158730, 2388106, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2605194, 2158730, 2158730, 2158730, 2158730, 2687114, 2158730, 2715786, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2867338, 2158730, 2904202, 2158730, 2158730, 2158730, 2642058, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2781322, 2793610, 2158730, 3121290, 2158730, 2158730, 2158730, 3149962, 2158730, 2158730, 3170442, 3174538, 2158730, 2367488, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2580480, 2207744, 2207744, 2207744, 2207744, 2621440, 2207744, 2207744, 2158877, 2433309, 2158877, 2453789, 2461981, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2511133, 2158877, 2158877, 2158877, 2158877, 2584861, 2158877, 2609437, 2158877, 2158877, 2629917, 2158877, 2158877, 2158877, 2687261, 2158877, 2715933, 2158877, 2158730, 2158730, 2973834, 2158730, 2982026, 2158730, 2158730, 3002506, 2158730, 3047562, 3063946, 3076234, 2158730, 2158730, 2158730, 2158730, 2207744, 2506752, 2207744, 2207744, 2207744, 2207744, 2207744, 2158877, 2507037, 0, 0, 2158877, 2158730, 2158730, 2158730, 3203210, 2207744, 2207744, 2207744, 2207744, 2207744, 2424832, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 823, 0, 825, 2707741, 2732317, 2158877, 2158877, 2158877, 2822429, 2826525, 2158877, 2896157, 2158877, 2158877, 2924829, 2158877, 2158877, 2973981, 2158877, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 642, 0, 2158592, 0, 45, 1529, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1755, 45, 67, 67, 2982173, 2158877, 2158877, 3002653, 2158877, 3047709, 3064093, 3076381, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3203357, 2523274, 2527370, 2158730, 2158730, 2576522, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2908298, 2494749, 2158877, 2158877, 2158877, 2523421, 2527517, 2158877, 2158877, 2576669, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 0, 40976, 0, 18, 18, 4321280, 2224253, 2232448, 4329472, 2232448, 2158730, 2498698, 2158730, 2158730, 2158730, 2158730, 2568330, 2158730, 2592906, 2625674, 2158730, 2158730, 2674826, 2736266, 2158730, 2158730, 2158730, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2158730, 2912394, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3109002, 2158730, 2158730, 3133578, 3145866, 3154058, 2375680, 2207744, 3108864, 2207744, 2207744, 3133440, 3145728, 3153920, 2375965, 2380061, 2158877, 2158877, 2421021, 2158877, 2449693, 2158877, 2158877, 2158877, 3117341, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3104906, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158877, 2498845, 2158877, 2158877, 0, 2158877, 2158877, 2568477, 2158877, 2593053, 2625821, 2158877, 2158877, 2674973, 0, 0, 0, 0, 97, 97, 1480, 97, 97, 97, 97, 97, 1485, 97, 97, 97, 0, 97, 97, 1729, 97, 1731, 97, 97, 97, 97, 97, 97, 97, 311, 97, 97, 97, 97, 97, 97, 97, 97, 1520, 97, 97, 1523, 97, 97, 1526, 97, 2736413, 2158877, 2158877, 0, 2158877, 2912541, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3109149, 2158877, 2158877, 3014941, 2158877, 2158877, 3051805, 2158877, 2158877, 3100957, 2158877, 2158877, 3121437, 2158877, 2158877, 2158877, 3150109, 3133725, 3146013, 3154205, 2158730, 2408586, 2416778, 2158730, 2465930, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3018890, 2158730, 3043466, 2158730, 2158730, 2158730, 2158730, 3080330, 2633866, 2658442, 2740362, 2744458, 2834570, 2949258, 2158730, 2986122, 2158730, 2998410, 2158730, 2158730, 2158730, 3129482, 2207744, 2408448, 2949120, 2207744, 2985984, 2207744, 2998272, 2207744, 2207744, 2207744, 3129344, 2158877, 2408733, 2416925, 2158877, 2466077, 2158877, 2158877, 3170589, 3174685, 2158877, 0, 0, 0, 2158730, 2158730, 2158730, 2158730, 2158730, 2424970, 2158730, 2158730, 2158730, 2158730, 2707594, 2732170, 2158730, 2158730, 2158730, 2822282, 2826378, 2158730, 2896010, 2158730, 2158730, 2924682, 2949405, 2158877, 2986269, 2158877, 2998557, 2158877, 2158877, 2158877, 3129629, 2158730, 2158730, 2478218, 2158730, 2158730, 2158730, 2535562, 2543754, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3117194, 2207744, 2207744, 2478080, 2207744, 2207744, 2207744, 2207744, 2781184, 2793472, 2207744, 2818048, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 541, 0, 543, 2207744, 2535424, 2543616, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3117056, 2158877, 2158877, 2478365, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158730, 2158730, 2482314, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2207744, 2207744, 2207744, 2387968, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 542, 0, 544, 2158730, 2158730, 2158730, 2990218, 2158730, 2158730, 2207744, 2207744, 2482176, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 135, 0, 2207744, 2207744, 2990080, 2207744, 2207744, 2158877, 2158877, 2482461, 2158877, 2158877, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2158730, 2429066, 2158730, 2515082, 2158730, 2588810, 2158730, 2838666, 2158730, 2158730, 2158730, 3010698, 2207744, 2428928, 2207744, 2514944, 2207744, 2588672, 2207744, 2838528, 2207744, 2207744, 2207744, 3010560, 2158877, 2429213, 2158877, 2515229, 0, 0, 2158877, 2588957, 2158877, 0, 2838813, 2158877, 2158877, 2158877, 3010845, 2158730, 2506890, 2158730, 2158730, 2158730, 2748554, 2756746, 2777226, 2801802, 2158730, 2158730, 2158730, 2863242, 2891914, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2564234, 2158730, 2158730, 2158730, 2158730, 2158730, 2597002, 2158730, 2158730, 2158730, 3006464, 2384157, 0, 0, 2158877, 2158877, 2158877, 2158877, 3006749, 2158730, 2637962, 2953354, 2158730, 2207744, 2637824, 2953216, 2207744, 0, 0, 2158877, 2638109, 2953501, 2158877, 2539658, 2158730, 2539520, 2207744, 0, 0, 2539805, 2158877, 2158730, 2158730, 2158730, 2977930, 2158730, 2158730, 2158730, 2158730, 3039370, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3158154, 2207744, 0, 2158877, 2158730, 2207744, 0, 2158877, 2158730, 2207744, 0, 2158877, 2965642, 2965504, 2965789, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1484, 97, 97, 97, 97, 2158592, 18, 0, 122880, 0, 0, 0, 77824, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 356, 0, 0, 0, 0, 0, 0, 28809, 0, 139, 45, 45, 45, 45, 45, 45, 1751, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1427, 67, 67, 67, 67, 67, 1432, 67, 67, 67, 3104768, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 122880, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 1322, 550, 0, 286, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 24, 4329472, 27, 27, 2207744, 2207744, 2977792, 2207744, 2207744, 2207744, 2207744, 3039232, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3158016, 542, 0, 0, 0, 542, 0, 544, 0, 0, 0, 544, 0, 550, 0, 0, 0, 0, 0, 97, 97, 1610, 97, 97, 97, 97, 97, 97, 97, 97, 898, 97, 97, 97, 97, 97, 97, 97, 0, 94242, 0, 0, 0, 2211840, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 237568, 102439, 106538, 98347, 0, 0, 20480, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 192512, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 94, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 96, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 12378, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 126, 126, 126, 126, 90143, 0, 0, 2170880, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 20480, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 241664, 102439, 106538, 98347, 0, 0, 20568, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 200797, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 20480, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 0, 0, 44, 0, 0, 20575, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 41, 41, 41, 0, 0, 1126400, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 0, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 89, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 131201, 27, 27, 90143, 0, 0, 2170880, 0, 0, 550, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2441216, 2445312, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 94242, 0, 0, 208896, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 0, 0, 0, 0, 0, 0, 0, 2367488, 32768, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2433024, 2158592, 2453504, 2461696, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2510848, 2158592, 2158592, 2158592, 2158592, 40976, 18, 36884, 245783, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 20480, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 221184, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 180224, 40976, 18, 18, 36884, 155648, 45078, 0, 24, 24, 217088, 27, 27, 27, 217088, 90143, 0, 0, 2170880, 0, 0, 828, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2207744, 2207744, 2387968, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 233472, 0, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 45, 45, 718, 45, 45, 45, 45, 45, 45, 45, 45, 45, 727, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 45, 1808, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 97, 97, 0, 0, 97, 67, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 1788, 97, 97, 0, 97, 2024, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 235, 67, 67, 67, 67, 67, 57889, 0, 0, 54074, 54074, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 1798, 45, 45, 1800, 45, 45, 0, 1472, 0, 0, 0, 0, 0, 1474, 0, 0, 0, 0, 0, 1476, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 1320, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 1787, 0, 97, 97, 0, 97, 97, 97, 45, 45, 45, 45, 2029, 45, 67, 67, 67, 67, 2033, 1527, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 663, 67, 24850, 24850, 12564, 12564, 0, 57889, 281, 0, 0, 53531, 53531, 367, 286, 97, 97, 0, 0, 97, 97, 97, 97, 1786, 97, 0, 0, 97, 97, 0, 1790, 40976, 19, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 262144, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 46, 67, 98, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 45, 67, 97, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 258048, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 1122423, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 1114152, 1114152, 1114152, 0, 0, 1114112, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 37, 102439, 106538, 98347, 0, 0, 204800, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 57436, 40976, 18, 36884, 45078, 24, 27, 33, 33, 0, 33, 33, 33, 0, 0, 0, 40976, 18, 18, 36884, 0, 45078, 0, 124, 124, 124, 127, 127, 127, 127, 90143, 0, 0, 2170880, 0, 0, 550, 0, 2158877, 2158877, 2158877, 2388253, 2158877, 2158877, 2158877, 2158877, 2158877, 2781469, 2793757, 2158877, 2818333, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2867485, 2158877, 2904349, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3096861, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2441501, 2445597, 2158877, 2158877, 2158877, 2158877, 2158877, 40976, 122, 123, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 936, 2158592, 4243810, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 935, 45, 45, 45, 715, 45, 45, 45, 45, 45, 45, 45, 723, 45, 45, 45, 45, 45, 1182, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 430, 45, 45, 45, 45, 45, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 47, 68, 99, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 48, 69, 100, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 49, 70, 101, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 50, 71, 102, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 51, 72, 103, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 52, 73, 104, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 53, 74, 105, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 54, 75, 106, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 55, 76, 107, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 56, 77, 108, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 57, 78, 109, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 58, 79, 110, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 59, 80, 111, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 60, 81, 112, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 61, 82, 113, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 62, 83, 114, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 63, 84, 115, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 64, 85, 116, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 65, 86, 117, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 66, 87, 118, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 118820, 102439, 106538, 98347, 118820, 118820, 118820, 40976, 18, 18, 0, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 1314, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 1321, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 0, 367, 0, 0, 1315, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1360, 97, 97, 131, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 145, 149, 45, 45, 45, 45, 45, 174, 45, 179, 45, 185, 45, 188, 45, 45, 202, 67, 255, 67, 67, 269, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 292, 296, 97, 97, 97, 97, 97, 321, 97, 326, 97, 332, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 646, 335, 97, 97, 349, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 437, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 523, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 511, 67, 67, 67, 97, 97, 97, 620, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1501, 1502, 97, 793, 67, 67, 796, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 808, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 2052, 67, 67, 67, 67, 813, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 830, 97, 97, 97, 97, 97, 97, 97, 97, 97, 315, 97, 97, 97, 97, 97, 97, 841, 97, 97, 97, 97, 97, 97, 97, 97, 97, 854, 97, 97, 97, 97, 97, 97, 589, 97, 97, 97, 97, 97, 97, 97, 97, 97, 867, 97, 97, 97, 97, 97, 97, 97, 891, 97, 97, 894, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 906, 45, 937, 45, 45, 940, 45, 45, 45, 45, 45, 45, 948, 45, 45, 45, 45, 45, 734, 735, 67, 737, 67, 738, 67, 740, 67, 67, 67, 45, 967, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 435, 45, 45, 45, 980, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 415, 45, 45, 67, 67, 1024, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 67, 67, 67, 67, 67, 25398, 1081, 13112, 1085, 54074, 1089, 0, 0, 0, 0, 0, 0, 363, 0, 28809, 0, 139, 45, 45, 45, 45, 45, 45, 1674, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1913, 67, 1914, 67, 67, 67, 1918, 67, 67, 97, 97, 97, 97, 1118, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 630, 97, 97, 97, 97, 97, 1169, 97, 97, 97, 97, 97, 0, 921, 0, 1175, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 1534, 45, 45, 45, 45, 45, 1538, 45, 45, 45, 45, 1233, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 742, 67, 45, 45, 1191, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 454, 67, 67, 67, 67, 1243, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1251, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 2050, 0, 97, 97, 45, 45, 45, 732, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 67, 67, 67, 1284, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 772, 67, 67, 67, 1293, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 368, 2158592, 2158592, 2158592, 2404352, 2412544, 1323, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1331, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1737, 97, 1364, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1373, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 647, 45, 45, 1387, 45, 45, 1391, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 410, 45, 45, 45, 45, 45, 1400, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1407, 45, 45, 45, 45, 45, 941, 45, 943, 45, 45, 45, 45, 45, 45, 951, 45, 67, 1438, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1447, 67, 67, 67, 67, 67, 67, 799, 67, 67, 67, 804, 67, 67, 67, 67, 67, 67, 67, 1443, 67, 67, 1446, 67, 67, 67, 67, 67, 67, 67, 1298, 0, 0, 0, 1304, 0, 0, 0, 1310, 97, 1491, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1500, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1736, 97, 45, 45, 1541, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 677, 45, 45, 67, 1581, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 791, 792, 67, 67, 67, 67, 1598, 67, 1600, 67, 67, 67, 67, 67, 67, 67, 67, 1472, 97, 97, 97, 1727, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1513, 97, 97, 67, 67, 97, 1879, 97, 1881, 97, 0, 1884, 0, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 1842, 97, 97, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1928, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 1903, 45, 45, 45, 67, 67, 67, 67, 97, 97, 97, 97, 1971, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 1381, 45, 45, 45, 45, 1976, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1747, 809, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 97, 907, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 638, 0, 0, 0, 0, 1478, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1150, 97, 97, 97, 97, 67, 67, 67, 67, 1244, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 477, 67, 67, 67, 67, 67, 67, 1294, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1324, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 1374, 97, 97, 97, 97, 0, 1175, 0, 45, 45, 45, 45, 45, 45, 45, 45, 945, 45, 45, 45, 45, 45, 45, 45, 45, 1908, 45, 45, 1910, 45, 67, 67, 67, 67, 67, 67, 67, 67, 1919, 67, 0, 0, 97, 97, 97, 97, 45, 2048, 67, 2049, 0, 0, 97, 2051, 45, 45, 45, 939, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 397, 45, 45, 45, 1921, 67, 67, 1923, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 1947, 45, 1935, 0, 0, 0, 97, 1939, 97, 97, 1941, 97, 45, 45, 45, 45, 45, 45, 382, 389, 45, 45, 45, 45, 45, 45, 45, 45, 1810, 45, 45, 1812, 67, 67, 67, 67, 67, 256, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 336, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 371, 373, 45, 45, 45, 955, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 413, 45, 45, 45, 457, 459, 67, 67, 67, 67, 67, 67, 67, 67, 473, 67, 478, 67, 67, 482, 67, 67, 485, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 1828, 97, 554, 556, 97, 97, 97, 97, 97, 97, 97, 97, 570, 97, 575, 97, 97, 579, 97, 97, 582, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 330, 97, 97, 67, 746, 67, 67, 67, 67, 67, 67, 67, 67, 67, 758, 67, 67, 67, 67, 67, 67, 67, 1587, 67, 1589, 67, 67, 67, 67, 67, 67, 67, 97, 1706, 97, 97, 97, 1709, 97, 97, 97, 97, 97, 844, 97, 97, 97, 97, 97, 97, 97, 97, 97, 856, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1735, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 1642, 97, 1644, 97, 97, 890, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 67, 67, 67, 67, 1065, 1066, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 532, 67, 67, 67, 67, 67, 67, 67, 1451, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 496, 67, 67, 97, 97, 1505, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 593, 97, 97, 0, 1474, 0, 1476, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1617, 97, 97, 1635, 0, 1637, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 885, 97, 97, 97, 97, 67, 67, 1704, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 565, 572, 97, 97, 97, 97, 97, 97, 97, 97, 1832, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 1946, 45, 45, 67, 67, 67, 67, 67, 97, 1926, 97, 1927, 97, 0, 0, 0, 97, 97, 1934, 2043, 0, 0, 97, 97, 97, 2047, 45, 45, 67, 67, 0, 1832, 97, 97, 45, 45, 45, 981, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1227, 45, 45, 45, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 372, 45, 45, 45, 45, 1661, 1662, 45, 45, 45, 45, 45, 1666, 45, 45, 45, 45, 45, 1673, 45, 1675, 45, 45, 45, 45, 45, 45, 45, 67, 1426, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1275, 67, 67, 67, 67, 67, 45, 418, 45, 45, 420, 45, 45, 423, 45, 45, 45, 45, 45, 45, 45, 45, 959, 45, 45, 962, 45, 45, 45, 45, 458, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 483, 67, 67, 67, 67, 504, 67, 67, 506, 67, 67, 509, 67, 67, 67, 67, 67, 67, 67, 753, 67, 67, 67, 67, 67, 67, 67, 67, 467, 67, 67, 67, 67, 67, 67, 67, 555, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 580, 97, 97, 97, 97, 601, 97, 97, 603, 97, 97, 606, 97, 97, 97, 97, 97, 97, 848, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1498, 97, 97, 97, 97, 97, 97, 45, 45, 714, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 989, 990, 45, 67, 67, 67, 67, 67, 1011, 67, 67, 67, 67, 1015, 67, 67, 67, 67, 67, 67, 67, 768, 67, 67, 67, 67, 67, 67, 67, 67, 769, 67, 67, 67, 67, 67, 67, 67, 45, 45, 1179, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1003, 1004, 67, 1217, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 728, 67, 1461, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1034, 67, 97, 1516, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 871, 97, 67, 67, 67, 1705, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 567, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1715, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 1380, 45, 45, 45, 45, 45, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 1887, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 2006, 45, 45, 1907, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1920, 67, 97, 0, 2035, 97, 97, 97, 97, 97, 45, 45, 45, 45, 67, 67, 67, 1428, 67, 67, 67, 67, 67, 67, 1435, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 146, 45, 152, 45, 45, 165, 45, 175, 45, 180, 45, 45, 187, 190, 195, 45, 203, 254, 257, 262, 67, 270, 67, 67, 0, 24850, 12564, 0, 0, 0, 281, 28809, 53531, 97, 97, 97, 293, 97, 299, 97, 97, 312, 97, 322, 97, 327, 97, 97, 334, 337, 342, 97, 350, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 67, 484, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 499, 97, 581, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 596, 648, 45, 650, 45, 651, 45, 653, 45, 45, 45, 657, 45, 45, 45, 45, 45, 45, 1954, 67, 67, 67, 1958, 67, 67, 67, 67, 67, 67, 67, 783, 67, 67, 67, 788, 67, 67, 67, 67, 680, 45, 45, 45, 45, 45, 45, 45, 45, 688, 689, 691, 45, 45, 45, 45, 45, 983, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 947, 45, 45, 45, 45, 952, 45, 45, 698, 699, 45, 45, 702, 703, 45, 45, 45, 45, 45, 45, 45, 711, 744, 67, 67, 67, 67, 67, 67, 67, 67, 67, 757, 67, 67, 67, 67, 761, 67, 67, 67, 67, 765, 67, 767, 67, 67, 67, 67, 67, 67, 67, 67, 775, 776, 778, 67, 67, 67, 67, 67, 67, 785, 786, 67, 67, 789, 790, 67, 67, 67, 67, 67, 67, 1574, 67, 67, 67, 67, 67, 1578, 67, 67, 67, 67, 67, 67, 1012, 67, 67, 67, 67, 67, 67, 67, 67, 67, 468, 475, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 798, 67, 67, 67, 802, 67, 67, 67, 67, 67, 67, 67, 67, 1588, 67, 67, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 67, 810, 67, 67, 67, 67, 67, 67, 67, 67, 67, 821, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 0, 833, 97, 835, 97, 836, 97, 838, 97, 97, 0, 0, 97, 97, 97, 1785, 97, 97, 0, 0, 97, 97, 0, 97, 97, 1979, 97, 97, 45, 45, 1983, 45, 1984, 45, 45, 45, 45, 45, 652, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 690, 45, 45, 694, 45, 45, 97, 842, 97, 97, 97, 97, 97, 97, 97, 97, 97, 855, 97, 97, 97, 97, 0, 1717, 1718, 97, 97, 97, 97, 97, 1722, 97, 0, 0, 859, 97, 97, 97, 97, 863, 97, 865, 97, 97, 97, 97, 97, 97, 97, 97, 604, 97, 97, 97, 97, 97, 97, 97, 873, 874, 876, 97, 97, 97, 97, 97, 97, 883, 884, 97, 97, 887, 888, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 225280, 0, 365, 0, 367, 0, 45, 45, 45, 1531, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1199, 45, 45, 45, 45, 45, 97, 97, 908, 97, 97, 97, 97, 97, 97, 97, 97, 97, 919, 638, 0, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2425117, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2597149, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2642205, 2158877, 2158877, 2158877, 2158877, 2158877, 3158301, 0, 2375818, 2379914, 2158730, 2158730, 2420874, 2158730, 2449546, 2158730, 2158730, 953, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 965, 978, 45, 45, 45, 45, 45, 45, 985, 45, 45, 45, 45, 45, 45, 45, 45, 971, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1027, 67, 1029, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1455, 67, 67, 67, 67, 67, 67, 67, 1077, 1078, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 0, 366, 0, 139, 2158730, 2158730, 2158730, 2404490, 2412682, 1113, 97, 97, 97, 97, 97, 97, 1121, 97, 1123, 97, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1540, 1155, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 615, 1168, 97, 97, 1171, 1172, 97, 97, 0, 921, 0, 1175, 0, 0, 0, 0, 45, 45, 45, 45, 45, 1533, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1559, 1561, 45, 45, 45, 1564, 45, 1566, 1567, 45, 45, 45, 1219, 45, 45, 45, 45, 45, 45, 45, 1226, 45, 45, 45, 45, 45, 168, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 427, 45, 45, 45, 45, 45, 45, 45, 1231, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1242, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1046, 67, 67, 1254, 67, 1256, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 806, 807, 67, 67, 97, 1336, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1111, 97, 97, 97, 97, 97, 1351, 97, 97, 97, 1354, 97, 97, 97, 1359, 97, 97, 97, 0, 97, 97, 97, 97, 1640, 97, 97, 97, 97, 97, 97, 97, 897, 97, 97, 97, 902, 97, 97, 97, 97, 97, 97, 97, 97, 1366, 97, 97, 97, 97, 97, 97, 97, 1371, 97, 97, 97, 0, 97, 97, 97, 1730, 97, 97, 97, 97, 97, 97, 97, 97, 915, 97, 97, 97, 97, 0, 360, 0, 67, 67, 67, 1440, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1017, 67, 1019, 67, 67, 67, 67, 67, 1453, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1459, 97, 97, 97, 1493, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1525, 97, 97, 97, 97, 97, 97, 1507, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1514, 67, 67, 67, 67, 1584, 67, 67, 67, 67, 67, 1590, 67, 67, 67, 67, 67, 67, 67, 784, 67, 67, 67, 67, 67, 67, 67, 67, 1055, 67, 67, 67, 67, 1060, 67, 67, 67, 67, 67, 67, 67, 1599, 1601, 67, 67, 67, 1604, 67, 1606, 1607, 67, 1472, 0, 1474, 0, 1476, 0, 97, 97, 97, 97, 97, 97, 1614, 97, 97, 97, 97, 45, 45, 1850, 45, 45, 45, 45, 1855, 45, 45, 45, 45, 45, 1222, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1229, 97, 1618, 97, 97, 97, 97, 97, 97, 97, 1625, 97, 97, 97, 97, 97, 0, 1175, 0, 45, 45, 45, 45, 45, 45, 45, 45, 447, 45, 45, 45, 45, 45, 67, 67, 1633, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1643, 1645, 97, 97, 0, 0, 97, 97, 97, 2002, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 1740, 45, 45, 45, 1744, 45, 45, 45, 97, 1648, 97, 1650, 1651, 97, 0, 45, 45, 45, 1654, 45, 45, 45, 45, 45, 169, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 658, 45, 45, 45, 45, 664, 45, 45, 1659, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1187, 45, 45, 1669, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1005, 67, 67, 1681, 67, 67, 67, 67, 67, 67, 67, 1686, 67, 67, 67, 67, 67, 67, 67, 800, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1603, 67, 67, 67, 67, 67, 0, 97, 97, 1713, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 1378, 45, 45, 45, 45, 45, 45, 45, 408, 45, 45, 45, 45, 45, 45, 45, 45, 1547, 45, 1549, 45, 45, 45, 45, 45, 97, 97, 1780, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 45, 2027, 2028, 45, 45, 67, 67, 2031, 2032, 67, 45, 45, 1804, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1917, 67, 67, 67, 67, 67, 67, 67, 1819, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1708, 97, 97, 97, 97, 97, 45, 45, 1862, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 497, 67, 67, 67, 1877, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 1839, 0, 0, 97, 97, 97, 97, 1936, 0, 0, 97, 97, 97, 97, 97, 97, 1943, 1944, 1945, 45, 45, 45, 45, 670, 45, 45, 45, 45, 674, 45, 45, 45, 45, 678, 45, 1948, 45, 1950, 45, 45, 45, 45, 1955, 1956, 1957, 67, 67, 67, 1960, 67, 1962, 67, 67, 67, 67, 1967, 1968, 1969, 97, 0, 0, 0, 97, 97, 1974, 97, 0, 1936, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 1906, 0, 1977, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1746, 45, 45, 45, 45, 2011, 67, 67, 2013, 67, 67, 67, 2017, 97, 97, 0, 0, 2021, 97, 8192, 97, 97, 2025, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1916, 67, 67, 67, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 140, 45, 45, 45, 1180, 45, 45, 45, 45, 1184, 45, 45, 45, 45, 45, 45, 45, 387, 45, 392, 45, 45, 396, 45, 45, 399, 45, 45, 67, 207, 67, 67, 67, 67, 67, 67, 236, 67, 67, 67, 67, 67, 67, 67, 817, 67, 67, 67, 67, 25398, 542, 13112, 544, 97, 97, 287, 97, 97, 97, 97, 97, 97, 316, 97, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 1656, 1657, 45, 376, 45, 45, 45, 45, 45, 388, 45, 45, 45, 45, 45, 45, 45, 45, 1406, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 462, 67, 67, 67, 67, 67, 474, 67, 67, 67, 67, 67, 67, 67, 1245, 67, 67, 67, 67, 67, 67, 67, 67, 1013, 67, 67, 1016, 67, 67, 67, 67, 97, 97, 97, 97, 559, 97, 97, 97, 97, 97, 571, 97, 97, 97, 97, 97, 97, 896, 97, 97, 97, 900, 97, 97, 97, 97, 97, 97, 912, 914, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 391, 45, 45, 45, 45, 45, 45, 45, 45, 713, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 662, 45, 1140, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 636, 67, 67, 1283, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 513, 67, 67, 1363, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 889, 97, 97, 97, 1714, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 926, 45, 45, 45, 45, 45, 45, 45, 45, 672, 45, 45, 45, 45, 45, 45, 45, 45, 686, 45, 45, 45, 45, 45, 45, 45, 45, 944, 45, 45, 45, 45, 45, 45, 45, 45, 1676, 45, 45, 45, 45, 45, 45, 67, 97, 97, 97, 1833, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 1902, 45, 45, 45, 45, 45, 957, 45, 45, 45, 45, 961, 45, 963, 45, 45, 45, 67, 97, 2034, 0, 97, 97, 97, 97, 97, 2040, 45, 45, 45, 2042, 67, 67, 67, 67, 67, 67, 1586, 67, 67, 67, 67, 67, 67, 67, 67, 67, 469, 67, 67, 67, 67, 67, 67, 132, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 45, 45, 1414, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 428, 45, 45, 45, 45, 45, 57889, 0, 0, 54074, 54074, 550, 831, 97, 97, 97, 97, 97, 97, 97, 97, 97, 568, 97, 97, 97, 97, 578, 97, 45, 45, 968, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1228, 45, 45, 67, 67, 67, 67, 67, 25398, 1082, 13112, 1086, 54074, 1090, 0, 0, 0, 0, 0, 0, 364, 0, 0, 0, 139, 2158592, 2158592, 2158592, 2404352, 2412544, 67, 67, 67, 67, 1464, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 510, 67, 67, 67, 67, 97, 97, 97, 97, 1519, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 918, 97, 0, 0, 0, 0, 1528, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 976, 45, 1554, 45, 45, 45, 45, 45, 45, 45, 45, 1562, 45, 45, 1565, 45, 45, 45, 45, 683, 45, 45, 45, 687, 45, 45, 692, 45, 45, 45, 45, 45, 1953, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1014, 67, 67, 67, 67, 67, 67, 1568, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 67, 67, 67, 67, 67, 1585, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1594, 97, 97, 1649, 97, 97, 97, 0, 45, 45, 1653, 45, 45, 45, 45, 45, 45, 383, 45, 45, 45, 45, 45, 45, 45, 45, 45, 986, 45, 45, 45, 45, 45, 45, 45, 45, 1670, 45, 1672, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 736, 67, 67, 67, 67, 67, 741, 67, 67, 67, 1680, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1074, 67, 67, 67, 1692, 67, 67, 67, 67, 67, 67, 67, 1697, 67, 1699, 67, 67, 67, 67, 67, 67, 1041, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1044, 67, 67, 67, 67, 67, 67, 67, 1769, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 624, 97, 97, 97, 97, 97, 97, 634, 97, 97, 1792, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 958, 45, 45, 45, 45, 45, 45, 964, 45, 150, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 977, 204, 45, 67, 67, 67, 217, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 787, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 271, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 97, 297, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1108, 97, 97, 97, 97, 97, 97, 97, 97, 351, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 45, 938, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1398, 45, 45, 45, 153, 45, 161, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 660, 661, 45, 45, 205, 45, 67, 67, 67, 67, 220, 67, 228, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 1302, 0, 0, 0, 1308, 0, 67, 67, 67, 67, 67, 272, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 97, 352, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 439, 45, 45, 45, 45, 45, 445, 45, 45, 45, 452, 45, 45, 67, 67, 212, 216, 67, 67, 67, 67, 67, 241, 67, 246, 67, 252, 67, 67, 486, 67, 67, 67, 67, 67, 67, 67, 494, 67, 67, 67, 67, 67, 67, 67, 1272, 67, 67, 67, 67, 67, 67, 67, 67, 507, 67, 67, 67, 67, 67, 67, 67, 67, 521, 67, 67, 525, 67, 67, 67, 67, 67, 531, 67, 67, 67, 538, 67, 0, 0, 2046, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 1192, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1418, 45, 45, 1421, 97, 97, 583, 97, 97, 97, 97, 97, 97, 97, 591, 97, 97, 97, 97, 97, 97, 913, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 1384, 97, 618, 97, 97, 622, 97, 97, 97, 97, 97, 628, 97, 97, 97, 635, 97, 18, 131427, 0, 0, 0, 639, 0, 132, 362, 0, 0, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 932, 45, 45, 45, 45, 45, 1544, 45, 45, 45, 45, 45, 1550, 45, 45, 45, 45, 45, 1194, 45, 1196, 45, 45, 45, 45, 45, 45, 45, 45, 999, 45, 45, 45, 45, 45, 67, 67, 45, 45, 667, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1408, 45, 45, 45, 696, 45, 45, 45, 701, 45, 45, 45, 45, 45, 45, 45, 45, 710, 45, 45, 45, 1220, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 194, 45, 45, 45, 729, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 797, 67, 67, 67, 67, 67, 67, 805, 67, 67, 67, 67, 67, 67, 67, 1695, 67, 67, 67, 67, 67, 1700, 67, 1702, 67, 67, 67, 67, 67, 814, 816, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 67, 67, 1008, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1020, 67, 0, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 67, 67, 67, 67, 1429, 67, 1430, 67, 67, 67, 67, 67, 1062, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 518, 1076, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 0, 28809, 0, 139, 45, 45, 45, 45, 45, 97, 97, 97, 97, 1102, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1124, 97, 1126, 97, 97, 1114, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1112, 97, 97, 1156, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 594, 97, 97, 97, 97, 1170, 97, 97, 97, 97, 0, 921, 0, 0, 0, 0, 0, 0, 45, 45, 45, 45, 1532, 45, 45, 45, 45, 1536, 45, 45, 45, 45, 45, 172, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 706, 45, 45, 709, 45, 45, 1177, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1202, 45, 1204, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1215, 45, 45, 45, 1232, 45, 45, 45, 45, 45, 45, 45, 67, 1237, 67, 67, 67, 67, 67, 67, 1259, 67, 67, 67, 67, 67, 67, 1264, 67, 67, 67, 1282, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1289, 67, 67, 67, 1292, 97, 97, 97, 97, 1339, 97, 97, 97, 97, 97, 97, 1344, 97, 97, 97, 97, 45, 1849, 45, 1851, 45, 45, 45, 45, 45, 45, 45, 45, 721, 45, 45, 45, 45, 45, 726, 45, 1385, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1188, 45, 45, 1401, 1402, 45, 45, 45, 45, 1405, 45, 45, 45, 45, 45, 45, 45, 45, 1752, 45, 45, 45, 45, 45, 67, 67, 1410, 45, 45, 45, 1413, 45, 1415, 45, 45, 45, 45, 45, 45, 1419, 45, 45, 45, 45, 1806, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 97, 97, 2019, 0, 97, 67, 67, 67, 1452, 67, 67, 67, 67, 67, 67, 67, 67, 1457, 67, 67, 67, 67, 67, 67, 1271, 67, 67, 67, 1274, 67, 67, 67, 1279, 67, 1460, 67, 1462, 67, 67, 67, 67, 67, 67, 1466, 67, 67, 67, 67, 67, 67, 67, 67, 1602, 67, 67, 1605, 67, 67, 67, 0, 97, 97, 97, 1506, 97, 97, 97, 97, 97, 97, 97, 97, 1512, 97, 97, 97, 0, 1728, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 901, 97, 97, 97, 97, 1515, 97, 1517, 97, 97, 97, 97, 97, 97, 1521, 97, 97, 97, 97, 97, 97, 0, 45, 1652, 45, 45, 45, 1655, 45, 45, 45, 45, 45, 1542, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1552, 1553, 45, 45, 45, 1556, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 693, 45, 45, 45, 67, 67, 67, 67, 1572, 67, 67, 67, 67, 1576, 67, 67, 67, 67, 67, 67, 67, 67, 1685, 67, 67, 67, 67, 67, 67, 67, 67, 1465, 67, 67, 1468, 67, 67, 1471, 67, 67, 1582, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1580, 67, 67, 1596, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 542, 0, 544, 67, 67, 67, 67, 1759, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 533, 67, 67, 67, 67, 67, 67, 67, 1770, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 1777, 97, 97, 97, 1793, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 998, 45, 45, 1001, 1002, 45, 45, 67, 67, 45, 1861, 45, 67, 67, 67, 67, 67, 67, 67, 67, 1871, 67, 1873, 1874, 67, 0, 97, 45, 67, 0, 97, 45, 67, 16384, 97, 45, 67, 97, 0, 0, 0, 1473, 0, 1082, 0, 0, 0, 1475, 0, 1086, 0, 0, 0, 1477, 1876, 67, 97, 97, 97, 97, 97, 1883, 0, 1885, 97, 97, 97, 1889, 0, 0, 0, 286, 0, 0, 0, 286, 0, 2367488, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 24, 126, 126, 126, 2053, 0, 2055, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 97, 97, 2039, 97, 45, 45, 45, 45, 67, 67, 67, 67, 67, 226, 67, 67, 67, 67, 67, 67, 67, 67, 1246, 67, 67, 1249, 1250, 67, 67, 67, 132, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 141, 45, 45, 45, 1403, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1186, 45, 45, 1189, 45, 45, 155, 45, 45, 45, 45, 45, 45, 45, 45, 45, 191, 45, 45, 45, 45, 700, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1753, 45, 45, 45, 67, 67, 45, 45, 67, 208, 67, 67, 67, 222, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1764, 67, 67, 67, 67, 67, 67, 67, 258, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 288, 97, 97, 97, 302, 97, 97, 97, 97, 97, 97, 97, 97, 97, 627, 97, 97, 97, 97, 97, 97, 338, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 370, 45, 45, 45, 45, 716, 45, 45, 45, 45, 45, 722, 45, 45, 45, 45, 45, 45, 1912, 67, 67, 67, 67, 67, 67, 67, 67, 67, 819, 67, 67, 25398, 542, 13112, 544, 45, 403, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1409, 45, 67, 67, 67, 67, 489, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 771, 67, 67, 67, 67, 520, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 534, 67, 67, 67, 67, 67, 67, 1286, 67, 67, 67, 67, 67, 67, 67, 1291, 67, 67, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 97, 553, 97, 97, 97, 97, 586, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1138, 97, 97, 97, 97, 617, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 631, 97, 97, 97, 0, 1834, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 353, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 45, 668, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 724, 45, 45, 45, 45, 45, 682, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 949, 45, 45, 45, 67, 67, 747, 748, 67, 67, 67, 67, 755, 67, 67, 67, 67, 67, 67, 67, 0, 0, 1301, 0, 0, 0, 1307, 0, 0, 67, 794, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1701, 67, 97, 97, 97, 845, 846, 97, 97, 97, 97, 853, 97, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 97, 97, 892, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 610, 97, 97, 45, 992, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 1239, 67, 67, 67, 1063, 67, 67, 67, 67, 67, 1068, 67, 67, 67, 67, 67, 67, 67, 0, 1299, 0, 0, 0, 1305, 0, 0, 0, 97, 1141, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1152, 97, 97, 0, 0, 97, 97, 1784, 97, 97, 97, 0, 0, 97, 97, 0, 97, 1978, 97, 97, 97, 1982, 45, 45, 45, 45, 45, 45, 45, 45, 45, 972, 973, 45, 45, 45, 45, 45, 97, 97, 97, 97, 1157, 97, 97, 97, 97, 97, 1162, 97, 97, 97, 97, 97, 97, 1145, 97, 97, 97, 97, 97, 1151, 97, 97, 97, 1253, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 539, 45, 1423, 45, 45, 67, 67, 67, 67, 67, 67, 67, 1431, 67, 67, 67, 67, 67, 67, 67, 1773, 67, 97, 97, 97, 97, 97, 97, 97, 625, 97, 97, 97, 97, 97, 97, 97, 97, 850, 97, 97, 97, 97, 97, 97, 97, 97, 880, 97, 97, 97, 97, 97, 97, 97, 97, 1106, 97, 97, 97, 97, 97, 97, 97, 67, 67, 1439, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 514, 67, 67, 97, 97, 1492, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 611, 97, 97, 1703, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 852, 97, 97, 97, 97, 97, 97, 45, 1949, 45, 1951, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 1961, 67, 0, 97, 45, 67, 0, 97, 2060, 2061, 0, 2062, 45, 67, 97, 0, 0, 2036, 97, 97, 97, 97, 45, 45, 45, 45, 67, 67, 67, 67, 67, 223, 67, 67, 237, 67, 67, 67, 67, 67, 67, 67, 1297, 0, 0, 0, 1303, 0, 0, 0, 1309, 1963, 67, 67, 67, 97, 97, 97, 97, 0, 1972, 0, 97, 97, 97, 1975, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 931, 45, 45, 45, 45, 45, 407, 45, 45, 45, 45, 45, 45, 45, 45, 45, 417, 45, 45, 1989, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1996, 97, 18, 131427, 0, 0, 360, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 930, 45, 45, 45, 45, 45, 45, 444, 45, 45, 45, 45, 45, 45, 45, 67, 67, 97, 97, 1998, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1985, 45, 1986, 45, 45, 45, 156, 45, 45, 170, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 675, 45, 45, 45, 45, 679, 131427, 0, 358, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 381, 45, 45, 45, 45, 45, 45, 45, 45, 45, 400, 45, 45, 419, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 436, 67, 67, 67, 67, 67, 505, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 820, 67, 25398, 542, 13112, 544, 67, 67, 522, 67, 67, 67, 67, 67, 529, 67, 67, 67, 67, 67, 67, 67, 0, 1300, 0, 0, 0, 1306, 0, 0, 0, 97, 97, 619, 97, 97, 97, 97, 97, 626, 97, 97, 97, 97, 97, 97, 97, 1105, 97, 97, 97, 97, 1109, 97, 97, 97, 67, 67, 67, 67, 749, 67, 67, 67, 67, 67, 67, 67, 67, 67, 760, 67, 0, 97, 45, 67, 2058, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 97, 97, 97, 97, 45, 45, 45, 2041, 67, 67, 67, 67, 67, 780, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 516, 67, 67, 97, 97, 97, 878, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1629, 97, 0, 45, 979, 45, 45, 45, 45, 984, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1000, 45, 45, 45, 45, 67, 67, 67, 1023, 67, 67, 67, 67, 1028, 67, 67, 67, 67, 67, 67, 67, 67, 67, 470, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 1094, 0, 0, 0, 1092, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1486, 97, 1489, 97, 97, 97, 1117, 97, 97, 97, 97, 1122, 97, 97, 97, 97, 97, 97, 97, 1146, 97, 97, 97, 97, 97, 97, 97, 97, 881, 97, 97, 97, 886, 97, 97, 97, 1311, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1615, 97, 97, 97, 97, 97, 1619, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1631, 97, 97, 1847, 97, 45, 45, 45, 45, 1852, 45, 45, 45, 45, 45, 45, 45, 1235, 45, 45, 45, 67, 67, 67, 67, 67, 1868, 67, 67, 67, 1872, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1882, 0, 0, 0, 97, 97, 97, 97, 0, 1891, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 1929, 0, 0, 97, 97, 97, 97, 97, 97, 45, 1900, 45, 1901, 45, 45, 45, 1905, 45, 67, 2054, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 2037, 2038, 97, 97, 45, 45, 45, 45, 67, 67, 67, 67, 1867, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1774, 97, 97, 97, 97, 97, 97, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 142, 45, 45, 45, 1412, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 432, 45, 45, 45, 45, 45, 157, 45, 45, 171, 45, 45, 45, 182, 45, 45, 45, 45, 200, 45, 45, 45, 1543, 45, 45, 45, 45, 45, 45, 45, 45, 1551, 45, 45, 45, 45, 1181, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1211, 45, 45, 45, 1214, 45, 45, 45, 67, 209, 67, 67, 67, 224, 67, 67, 238, 67, 67, 67, 249, 67, 0, 97, 2056, 2057, 0, 2059, 45, 67, 0, 97, 45, 67, 97, 0, 0, 1937, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1741, 45, 45, 45, 45, 45, 45, 67, 67, 67, 267, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 289, 97, 97, 97, 304, 97, 97, 318, 97, 97, 97, 329, 97, 97, 0, 0, 97, 97, 2001, 0, 97, 2003, 97, 97, 97, 45, 45, 45, 1739, 45, 45, 45, 1742, 45, 45, 45, 45, 45, 97, 97, 347, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 666, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1420, 45, 57889, 0, 0, 54074, 54074, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 840, 67, 1007, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 759, 67, 67, 67, 67, 67, 67, 67, 1052, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1031, 67, 67, 67, 67, 67, 97, 97, 97, 1101, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 592, 97, 97, 97, 1190, 45, 45, 45, 45, 45, 1195, 45, 1197, 45, 45, 45, 45, 1201, 45, 45, 45, 45, 1952, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 250, 67, 67, 67, 1255, 67, 1257, 67, 67, 67, 67, 1261, 67, 67, 67, 67, 67, 67, 67, 67, 1696, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 2162688, 0, 0, 67, 67, 1267, 67, 67, 67, 67, 67, 67, 1273, 67, 67, 67, 67, 67, 67, 67, 67, 1763, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 280, 94, 0, 0, 1281, 67, 67, 67, 67, 1285, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1070, 67, 67, 67, 67, 67, 1335, 97, 1337, 97, 97, 97, 97, 1341, 97, 97, 97, 97, 97, 97, 97, 97, 882, 97, 97, 97, 97, 97, 97, 97, 1347, 97, 97, 97, 97, 97, 97, 1353, 97, 97, 97, 97, 97, 97, 1361, 97, 18, 131427, 0, 638, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 544, 0, 550, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2473984, 2158592, 2158592, 2158592, 2990080, 2158592, 2158592, 2207744, 2207744, 2482176, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 0, 53530, 97, 97, 97, 1365, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 608, 97, 97, 97, 45, 45, 1424, 45, 1425, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1058, 67, 67, 67, 67, 45, 1555, 45, 45, 1557, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 707, 45, 45, 45, 45, 67, 67, 1570, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 773, 67, 67, 1595, 67, 67, 1597, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 2158592, 2158592, 2158592, 2404352, 2412544, 97, 97, 97, 1636, 97, 97, 97, 1639, 97, 97, 1641, 97, 97, 97, 97, 97, 97, 1173, 0, 921, 0, 0, 0, 0, 0, 0, 45, 67, 67, 67, 1693, 67, 67, 67, 67, 67, 67, 67, 1698, 67, 67, 67, 67, 67, 67, 273, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 1860, 45, 45, 67, 67, 1865, 67, 67, 67, 67, 1870, 67, 67, 67, 67, 1875, 67, 67, 97, 97, 1880, 97, 97, 0, 0, 0, 97, 97, 1888, 97, 0, 0, 0, 1938, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1854, 45, 45, 45, 45, 45, 45, 45, 1909, 45, 45, 1911, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1248, 67, 67, 67, 67, 67, 67, 1922, 67, 67, 1924, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 1898, 45, 45, 45, 45, 45, 45, 1904, 45, 45, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 16384, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 1724, 2008, 2009, 45, 45, 67, 67, 67, 2014, 2015, 67, 67, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 2022, 0, 2023, 97, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1869, 67, 67, 67, 67, 67, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 147, 151, 154, 45, 162, 45, 45, 176, 178, 181, 45, 45, 45, 192, 196, 45, 45, 45, 45, 2012, 67, 67, 67, 67, 67, 67, 2018, 97, 0, 0, 97, 1894, 1895, 97, 1897, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 656, 45, 45, 45, 45, 45, 45, 67, 259, 263, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 294, 298, 301, 97, 309, 97, 97, 323, 325, 328, 97, 97, 97, 97, 97, 560, 97, 97, 97, 569, 97, 97, 97, 97, 97, 97, 306, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1624, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 1175, 0, 0, 0, 0, 45, 339, 343, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 67, 67, 503, 67, 67, 67, 67, 67, 67, 67, 67, 67, 512, 67, 67, 519, 97, 97, 600, 97, 97, 97, 97, 97, 97, 97, 97, 97, 609, 97, 97, 616, 45, 649, 45, 45, 45, 45, 45, 654, 45, 45, 45, 45, 45, 45, 45, 45, 1393, 45, 45, 45, 45, 45, 45, 45, 45, 1209, 45, 45, 45, 45, 45, 45, 45, 67, 763, 67, 67, 67, 67, 67, 67, 67, 67, 770, 67, 67, 67, 774, 67, 0, 2045, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 994, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 213, 67, 219, 67, 67, 232, 67, 242, 67, 247, 67, 67, 67, 779, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1018, 67, 67, 67, 67, 811, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 0, 97, 834, 97, 97, 97, 97, 97, 839, 97, 18, 131427, 0, 638, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 645, 97, 97, 861, 97, 97, 97, 97, 97, 97, 97, 97, 868, 97, 97, 97, 872, 97, 97, 877, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 613, 97, 97, 97, 97, 97, 909, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 18, 18, 24, 24, 27, 27, 27, 1036, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1047, 67, 67, 67, 1050, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1033, 67, 67, 67, 97, 97, 1130, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 638, 0, 0, 67, 67, 67, 1295, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 1317, 97, 97, 97, 97, 97, 97, 1375, 97, 97, 97, 0, 0, 0, 45, 1379, 45, 45, 45, 45, 45, 45, 422, 45, 45, 45, 429, 431, 45, 45, 45, 45, 0, 1090, 0, 0, 97, 1479, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1357, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1716, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1723, 0, 921, 29315, 0, 0, 0, 0, 45, 929, 45, 45, 45, 45, 45, 45, 45, 1234, 45, 45, 45, 45, 67, 67, 67, 67, 1240, 97, 97, 97, 1738, 45, 45, 45, 45, 45, 45, 45, 1743, 45, 45, 45, 45, 166, 45, 45, 45, 45, 184, 186, 45, 45, 197, 45, 45, 97, 1779, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 18, 131427, 0, 638, 0, 0, 0, 0, 362, 0, 640, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1539, 45, 45, 1803, 45, 45, 45, 45, 45, 1809, 45, 45, 45, 67, 67, 67, 1814, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 1932, 97, 97, 0, 1781, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 67, 67, 67, 1818, 67, 67, 67, 67, 67, 1824, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 1890, 0, 1829, 97, 97, 0, 0, 97, 97, 1836, 97, 97, 0, 0, 0, 97, 97, 97, 97, 1981, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1987, 1845, 97, 97, 97, 45, 45, 45, 45, 45, 1853, 45, 45, 45, 1857, 45, 45, 45, 67, 1864, 67, 1866, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 1710, 1711, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 1886, 97, 97, 97, 0, 0, 97, 97, 97, 97, 1838, 0, 0, 0, 97, 1843, 97, 0, 1893, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1745, 45, 45, 67, 2044, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 1660, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 453, 45, 455, 67, 67, 67, 67, 268, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 348, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 359, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 421, 45, 45, 45, 45, 45, 45, 45, 434, 45, 45, 695, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1667, 45, 0, 921, 29315, 0, 925, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1548, 45, 45, 45, 45, 45, 45, 67, 1037, 67, 1039, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1277, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 1095, 0, 0, 0, 1096, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 869, 97, 97, 97, 97, 97, 97, 1131, 97, 1133, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1370, 97, 97, 97, 97, 97, 1312, 0, 0, 0, 0, 1096, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1327, 97, 97, 97, 97, 97, 1332, 97, 97, 97, 1830, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 1896, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1210, 45, 45, 45, 45, 45, 45, 133, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 45, 380, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 401, 45, 45, 158, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1200, 45, 45, 45, 45, 206, 67, 67, 67, 67, 67, 225, 67, 67, 67, 67, 67, 67, 67, 67, 754, 67, 67, 67, 67, 67, 67, 67, 57889, 0, 0, 54074, 54074, 550, 832, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1342, 97, 97, 97, 97, 97, 97, 67, 67, 67, 67, 67, 25398, 1083, 13112, 1087, 54074, 1091, 0, 0, 0, 0, 0, 0, 1316, 0, 831, 97, 97, 97, 97, 97, 97, 97, 1174, 921, 0, 1175, 0, 0, 0, 0, 45, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 148, 67, 67, 264, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 295, 97, 97, 97, 97, 313, 97, 97, 97, 97, 331, 333, 97, 18, 131427, 356, 638, 0, 0, 0, 0, 362, 0, 0, 365, 0, 367, 0, 45, 45, 1530, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 988, 45, 45, 45, 97, 344, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 402, 404, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1756, 67, 438, 45, 45, 45, 45, 45, 45, 45, 45, 449, 450, 45, 45, 45, 67, 67, 214, 218, 221, 67, 229, 67, 67, 243, 245, 248, 67, 67, 67, 67, 67, 488, 490, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1071, 67, 1073, 67, 67, 67, 67, 67, 524, 67, 67, 67, 67, 67, 67, 67, 67, 535, 536, 67, 67, 67, 67, 67, 67, 1683, 1684, 67, 67, 67, 67, 1688, 1689, 67, 67, 67, 67, 67, 67, 1694, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1288, 67, 67, 67, 67, 67, 67, 97, 97, 97, 585, 587, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1163, 97, 97, 97, 97, 97, 97, 97, 621, 97, 97, 97, 97, 97, 97, 97, 97, 632, 633, 97, 97, 0, 0, 97, 1783, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 2026, 45, 45, 45, 45, 67, 2030, 67, 67, 67, 67, 67, 67, 1053, 1054, 67, 67, 67, 67, 67, 67, 1061, 67, 712, 45, 45, 45, 717, 45, 45, 45, 45, 45, 45, 45, 45, 725, 45, 45, 45, 163, 167, 173, 177, 45, 45, 45, 45, 45, 193, 45, 45, 45, 45, 982, 45, 45, 45, 45, 45, 45, 987, 45, 45, 45, 45, 45, 1558, 45, 1560, 45, 45, 45, 45, 45, 45, 45, 45, 704, 705, 45, 45, 45, 45, 45, 45, 45, 45, 731, 45, 45, 45, 67, 67, 67, 67, 67, 739, 67, 67, 67, 67, 67, 67, 464, 67, 67, 67, 67, 67, 67, 479, 67, 67, 67, 67, 67, 764, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1290, 67, 67, 67, 67, 67, 67, 812, 67, 67, 67, 67, 818, 67, 67, 67, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 0, 97, 97, 97, 97, 97, 837, 97, 97, 97, 97, 97, 602, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1137, 97, 97, 97, 97, 97, 97, 97, 97, 97, 862, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1627, 97, 97, 97, 0, 97, 97, 97, 97, 910, 97, 97, 97, 97, 916, 97, 97, 97, 0, 0, 0, 97, 97, 1940, 97, 97, 1942, 45, 45, 45, 45, 45, 45, 385, 45, 45, 45, 45, 395, 45, 45, 45, 45, 966, 45, 969, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 975, 45, 45, 45, 406, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 974, 45, 45, 45, 67, 67, 67, 67, 1010, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1262, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1040, 67, 1042, 67, 1045, 67, 67, 67, 67, 67, 67, 67, 527, 67, 67, 67, 67, 67, 67, 537, 67, 67, 67, 67, 67, 1051, 67, 67, 67, 67, 67, 1057, 67, 67, 67, 67, 67, 67, 67, 1454, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1445, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1079, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2207744, 2207744, 2207744, 2207744, 2572288, 2207744, 2207744, 2207744, 1098, 97, 97, 97, 97, 97, 1104, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1356, 97, 97, 97, 97, 97, 97, 1128, 97, 97, 97, 97, 97, 97, 1134, 97, 1136, 97, 1139, 97, 97, 97, 97, 97, 97, 1622, 97, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 0, 0, 1176, 0, 646, 45, 67, 67, 67, 1268, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1469, 67, 67, 67, 97, 1348, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1127, 97, 67, 1569, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1448, 1449, 67, 1816, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1825, 67, 67, 1827, 97, 97, 0, 0, 1782, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 1831, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 1980, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1395, 45, 45, 45, 45, 45, 97, 1846, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1212, 45, 45, 45, 45, 45, 45, 2010, 45, 67, 67, 67, 67, 67, 2016, 67, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 2007, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 143, 45, 45, 45, 1671, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1813, 67, 67, 1815, 45, 45, 67, 210, 67, 67, 67, 67, 67, 67, 239, 67, 67, 67, 67, 67, 67, 67, 1575, 67, 67, 67, 67, 67, 67, 67, 67, 493, 67, 67, 67, 67, 67, 67, 67, 97, 97, 290, 97, 97, 97, 97, 97, 97, 319, 97, 97, 97, 97, 97, 97, 303, 97, 97, 317, 97, 97, 97, 97, 97, 97, 305, 97, 97, 97, 97, 97, 97, 97, 97, 97, 899, 97, 97, 97, 97, 97, 97, 375, 45, 45, 45, 379, 45, 45, 390, 45, 45, 394, 45, 45, 45, 45, 45, 443, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 461, 67, 67, 67, 465, 67, 67, 476, 67, 67, 480, 67, 67, 67, 67, 67, 67, 1761, 67, 67, 67, 67, 67, 67, 67, 67, 67, 530, 67, 67, 67, 67, 67, 67, 500, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1075, 97, 97, 97, 558, 97, 97, 97, 562, 97, 97, 573, 97, 97, 577, 97, 97, 0, 1999, 97, 97, 97, 0, 97, 97, 2004, 2005, 97, 45, 45, 45, 45, 1193, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 676, 45, 45, 45, 45, 597, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1334, 45, 681, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1396, 45, 45, 1399, 45, 45, 730, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1434, 67, 67, 67, 67, 67, 67, 750, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1456, 67, 67, 67, 67, 67, 45, 45, 993, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1238, 67, 67, 1006, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1280, 1048, 1049, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1059, 67, 67, 67, 67, 67, 67, 1296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2367488, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 97, 97, 1100, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 638, 0, 920, 97, 97, 1142, 1143, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1153, 97, 97, 97, 97, 97, 1144, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1149, 97, 97, 97, 97, 1154, 45, 1218, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1678, 45, 45, 45, 67, 67, 67, 67, 67, 1269, 67, 67, 67, 67, 67, 67, 67, 67, 1278, 67, 67, 67, 67, 67, 67, 1772, 67, 67, 97, 97, 97, 97, 97, 97, 97, 0, 921, 922, 1175, 0, 0, 0, 0, 45, 97, 97, 1349, 97, 97, 97, 97, 97, 97, 97, 97, 1358, 97, 97, 97, 97, 97, 97, 1623, 97, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 0, 926, 0, 0, 0, 45, 45, 1411, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1754, 45, 45, 67, 67, 1301, 0, 1307, 0, 1313, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 21054, 97, 97, 97, 97, 67, 1757, 67, 67, 67, 1760, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1467, 67, 67, 67, 67, 67, 1778, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 97, 97, 1158, 97, 97, 97, 1161, 97, 97, 97, 97, 1166, 97, 97, 97, 97, 97, 1325, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1328, 97, 97, 97, 97, 97, 97, 97, 67, 67, 67, 67, 67, 1820, 67, 1822, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 1933, 97, 1892, 97, 97, 97, 97, 97, 97, 1899, 45, 45, 45, 45, 45, 45, 45, 45, 1664, 45, 45, 45, 45, 45, 45, 45, 45, 1546, 45, 45, 45, 45, 45, 45, 45, 45, 1208, 45, 45, 45, 45, 45, 45, 45, 45, 1224, 45, 45, 45, 45, 45, 45, 45, 45, 673, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1925, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 623, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 307, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1796, 97, 45, 45, 45, 45, 45, 45, 45, 970, 45, 45, 45, 45, 45, 45, 45, 45, 1417, 45, 45, 45, 45, 45, 45, 45, 67, 1964, 67, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 1721, 97, 97, 0, 0, 1997, 97, 0, 0, 2000, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 733, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 803, 67, 67, 67, 67, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 144, 45, 45, 45, 1805, 45, 1807, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 231, 67, 67, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 281, 28809, 53531, 45, 45, 67, 211, 67, 67, 67, 67, 230, 234, 240, 244, 67, 67, 67, 67, 67, 67, 492, 67, 67, 67, 67, 67, 67, 67, 67, 67, 471, 67, 67, 67, 67, 481, 67, 67, 260, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 291, 97, 97, 97, 97, 310, 314, 320, 324, 97, 97, 97, 97, 97, 97, 1367, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1355, 97, 97, 97, 97, 97, 97, 1362, 340, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 360, 0, 362, 0, 365, 28809, 367, 139, 369, 45, 45, 45, 374, 67, 67, 460, 67, 67, 67, 67, 466, 67, 67, 67, 67, 67, 67, 67, 67, 801, 67, 67, 67, 67, 67, 67, 67, 67, 67, 487, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 498, 67, 67, 67, 67, 67, 67, 1821, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 0, 67, 502, 67, 67, 67, 67, 67, 67, 67, 508, 67, 67, 67, 515, 517, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 1931, 97, 97, 97, 97, 97, 588, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 629, 97, 97, 97, 97, 97, 67, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 552, 97, 97, 97, 97, 97, 1352, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1511, 97, 97, 97, 97, 97, 97, 97, 557, 97, 97, 97, 97, 563, 97, 97, 97, 97, 97, 97, 97, 97, 1135, 97, 97, 97, 97, 97, 97, 97, 97, 97, 584, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 595, 97, 97, 97, 97, 97, 895, 97, 97, 97, 97, 97, 97, 903, 97, 97, 97, 0, 97, 97, 1638, 97, 97, 97, 97, 97, 97, 97, 97, 1646, 97, 599, 97, 97, 97, 97, 97, 97, 97, 605, 97, 97, 97, 612, 614, 97, 97, 97, 97, 97, 1377, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 655, 45, 45, 45, 45, 45, 45, 45, 745, 67, 67, 67, 67, 751, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1577, 67, 67, 67, 67, 67, 762, 67, 67, 67, 67, 766, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1765, 67, 67, 67, 67, 67, 777, 67, 67, 781, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1592, 1593, 67, 67, 97, 843, 97, 97, 97, 97, 849, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1510, 97, 97, 97, 97, 97, 97, 97, 860, 97, 97, 97, 97, 864, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1797, 45, 45, 45, 45, 1801, 45, 97, 875, 97, 97, 879, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1522, 97, 97, 97, 97, 97, 991, 45, 45, 45, 45, 996, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 215, 67, 67, 67, 67, 233, 67, 67, 67, 67, 251, 253, 1022, 67, 67, 67, 1026, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1035, 67, 67, 1038, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1458, 67, 67, 67, 67, 67, 1064, 67, 67, 67, 1067, 67, 67, 67, 67, 1072, 67, 67, 67, 67, 67, 67, 1442, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1775, 97, 97, 97, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 1096, 0, 921, 29315, 0, 0, 0, 0, 928, 45, 45, 45, 45, 45, 934, 45, 45, 45, 164, 45, 45, 45, 45, 45, 45, 45, 45, 45, 198, 45, 45, 45, 378, 45, 45, 45, 45, 45, 45, 393, 45, 45, 45, 398, 45, 97, 97, 1116, 97, 97, 97, 1120, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1147, 1148, 97, 97, 97, 97, 97, 97, 97, 1129, 97, 97, 1132, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1626, 97, 97, 97, 97, 0, 45, 1178, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1185, 45, 45, 45, 45, 441, 45, 45, 45, 45, 45, 45, 451, 45, 45, 67, 67, 67, 67, 67, 227, 67, 67, 67, 67, 67, 67, 67, 67, 1260, 67, 67, 67, 1263, 67, 67, 1265, 1203, 45, 45, 1205, 45, 1206, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1216, 67, 1266, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1276, 67, 67, 67, 67, 67, 67, 752, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1056, 67, 67, 67, 67, 67, 67, 45, 1386, 45, 1389, 45, 45, 45, 45, 1394, 45, 45, 45, 1397, 45, 45, 45, 45, 995, 45, 997, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1915, 67, 67, 67, 67, 67, 1422, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1433, 67, 1436, 67, 67, 67, 67, 1441, 67, 67, 67, 1444, 67, 67, 67, 67, 67, 67, 67, 0, 24851, 12565, 0, 0, 0, 0, 28809, 53532, 97, 97, 97, 97, 1494, 97, 97, 97, 1497, 97, 97, 97, 97, 97, 97, 97, 1368, 97, 97, 97, 97, 97, 97, 97, 97, 851, 97, 97, 97, 97, 97, 97, 97, 67, 67, 67, 1571, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 67, 67, 1583, 67, 67, 67, 67, 67, 67, 67, 67, 1591, 67, 67, 67, 67, 67, 67, 782, 67, 67, 67, 67, 67, 67, 67, 67, 67, 756, 67, 67, 67, 67, 67, 67, 97, 1634, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1125, 97, 97, 97, 1647, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 719, 720, 45, 45, 45, 45, 45, 45, 45, 45, 685, 45, 45, 45, 45, 45, 45, 45, 45, 45, 942, 45, 45, 946, 45, 45, 45, 950, 45, 45, 1658, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1668, 1712, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 1835, 97, 97, 97, 97, 0, 0, 0, 97, 97, 1844, 97, 97, 1726, 0, 97, 97, 97, 97, 97, 1732, 97, 1734, 97, 97, 97, 97, 97, 300, 97, 308, 97, 97, 97, 97, 97, 97, 97, 97, 866, 97, 97, 97, 97, 97, 97, 97, 67, 67, 67, 1758, 67, 67, 67, 1762, 67, 67, 67, 67, 67, 67, 67, 67, 1043, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1771, 67, 67, 67, 97, 97, 97, 97, 97, 1776, 97, 97, 97, 97, 97, 1794, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 1183, 45, 45, 45, 45, 45, 45, 45, 45, 45, 409, 45, 45, 45, 45, 45, 45, 67, 67, 67, 1966, 97, 97, 97, 1970, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 1720, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 1837, 97, 0, 1840, 1841, 97, 97, 97, 1988, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1994, 1995, 67, 97, 97, 97, 97, 97, 911, 97, 97, 97, 97, 97, 97, 97, 638, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 1319, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 1733, 97, 97, 97, 97, 97, 97, 1340, 97, 97, 97, 1343, 97, 97, 1345, 97, 1346, 67, 67, 265, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 345, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 0, 361, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 671, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 411, 45, 45, 414, 45, 45, 45, 45, 377, 45, 45, 45, 386, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1207, 45, 45, 45, 45, 45, 45, 1213, 45, 45, 67, 67, 67, 67, 67, 463, 67, 67, 67, 472, 67, 67, 67, 67, 67, 67, 67, 528, 67, 67, 67, 67, 67, 67, 67, 67, 1287, 67, 67, 67, 67, 67, 67, 67, 540, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 97, 97, 97, 97, 97, 1103, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 917, 97, 97, 0, 0, 0, 637, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 927, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1223, 45, 45, 45, 45, 45, 45, 45, 45, 45, 426, 45, 45, 433, 45, 45, 45, 45, 697, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 708, 45, 45, 45, 45, 1221, 45, 45, 45, 45, 1225, 45, 45, 45, 45, 45, 45, 384, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1198, 45, 45, 45, 45, 45, 45, 67, 67, 795, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1470, 67, 67, 67, 67, 67, 67, 67, 815, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 97, 97, 97, 893, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1164, 97, 97, 97, 67, 67, 67, 1025, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1687, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 1097, 1241, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1450, 45, 45, 1388, 45, 1390, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1236, 67, 67, 67, 67, 67, 1437, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1472, 1490, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1503, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 1930, 0, 97, 97, 97, 97, 97, 847, 97, 97, 97, 97, 97, 97, 97, 97, 97, 858, 67, 67, 1965, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 1719, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 1382, 45, 1383, 45, 45, 45, 159, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1563, 45, 45, 45, 45, 45, 67, 261, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 341, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 97, 1099, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1333, 97, 1230, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1992, 67, 1993, 67, 67, 67, 97, 97, 45, 45, 160, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1665, 45, 45, 45, 45, 45, 131427, 357, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 684, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 412, 45, 45, 45, 416, 45, 45, 45, 440, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1990, 67, 1991, 67, 67, 67, 67, 67, 67, 67, 97, 97, 1707, 97, 97, 97, 97, 97, 97, 501, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1691, 67, 67, 67, 67, 67, 526, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1030, 67, 1032, 67, 67, 67, 67, 598, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1632, 0, 921, 29315, 923, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1392, 45, 45, 45, 45, 45, 45, 45, 45, 45, 960, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 1093, 0, 0, 0, 0, 0, 97, 1609, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1369, 97, 97, 97, 1372, 97, 97, 67, 67, 266, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 346, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 665, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1677, 45, 45, 45, 45, 67, 45, 45, 954, 45, 956, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1404, 45, 45, 45, 45, 45, 45, 45, 45, 45, 425, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1270, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1069, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1350, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1524, 97, 97, 97, 97, 97, 97, 97, 1376, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 1545, 45, 45, 45, 45, 45, 45, 45, 45, 45, 448, 45, 45, 45, 45, 67, 456, 67, 67, 67, 67, 67, 1573, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1247, 67, 67, 67, 67, 67, 1252, 97, 1725, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1628, 97, 1630, 0, 0, 94242, 0, 0, 0, 2211840, 0, 1118208, 0, 0, 0, 0, 2158592, 2158731, 2158592, 2158592, 2158592, 3117056, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3018752, 2158592, 3043328, 2158592, 2158592, 2158592, 2158592, 3080192, 2158592, 2158592, 3112960, 2158592, 2158592, 2158592, 2158592, 2158592, 2158878, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2605056, 2158592, 2158592, 2207744, 0, 542, 0, 544, 0, 0, 2166784, 0, 0, 0, 550, 0, 0, 2158592, 2158592, 2686976, 2158592, 2715648, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2867200, 2158592, 2904064, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 94242, 0, 0, 0, 2211840, 0, 0, 1130496, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 0, 139, 0, 0, 0, 139, 0, 2367488, 2207744, 0, 0, 0, 0, 176128, 0, 2166784, 0, 0, 0, 0, 0, 286, 2158592, 2158592, 3170304, 3174400, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 1508, 2158592, 2908160, 2158592, 2158592, 2158592, 2977792, 2158592, 2158592, 2158592, 2158592, 3039232, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3158016, 67, 24850, 24850, 12564, 12564, 0, 0, 0, 0, 0, 53531, 53531, 0, 286, 97, 97, 97, 97, 97, 1119, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1509, 97, 97, 97, 97, 97, 97, 97, 97, 564, 97, 97, 97, 97, 97, 97, 97, 57889, 0, 0, 0, 0, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 561, 97, 97, 97, 97, 97, 97, 576, 97, 97, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 0, 0, 139264, 0, 921, 29315, 0, 0, 926, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1811, 45, 67, 67, 67, 67, 67, 0, 2146304, 2146304, 0, 0, 0, 0, 2224128, 2224128, 2224128, 2232320, 2232320, 2232320, 2232320, 0, 0, 1301, 0, 0, 0, 0, 0, 1307, 0, 0, 0, 0, 0, 1313, 0, 0, 0, 0, 0, 0, 0, 97, 97, 1318, 97, 97, 97, 97, 97, 97, 1795, 97, 97, 45, 45, 45, 45, 45, 45, 45, 446, 45, 45, 45, 45, 45, 45, 67, 67, 2158592, 2146304, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 921, 29315, 0, 924, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1537, 45, 45, 45, 45 -]; - -JSONiqTokenizer.EXPECTED = -[ 290, 300, 304, 353, 296, 309, 305, 319, 315, 324, 328, 352, 354, 334, 338, 330, 320, 345, 349, 293, 358, 362, 341, 366, 312, 370, 374, 378, 382, 386, 390, 394, 398, 737, 402, 634, 439, 604, 634, 634, 634, 634, 408, 634, 634, 634, 404, 634, 634, 634, 457, 634, 634, 963, 634, 634, 413, 634, 634, 634, 634, 634, 634, 634, 663, 418, 422, 903, 902, 426, 431, 548, 634, 437, 521, 919, 443, 615, 409, 449, 455, 624, 731, 751, 634, 461, 465, 672, 470, 469, 474, 481, 485, 477, 489, 493, 629, 542, 497, 505, 603, 602, 991, 648, 510, 804, 634, 515, 958, 526, 525, 530, 768, 634, 546, 552, 711, 710, 593, 558, 562, 618, 566, 570, 574, 578, 582, 586, 590, 608, 612, 660, 822, 821, 634, 622, 596, 444, 628, 533, 724, 633, 640, 653, 647, 652, 536, 1008, 451, 450, 445, 657, 670, 676, 685, 689, 693, 697, 701, 704, 707, 715, 719, 798, 815, 634, 723, 762, 996, 634, 728, 969, 730, 735, 908, 634, 741, 679, 889, 511, 747, 634, 750, 755, 499, 666, 499, 501, 759, 772, 776, 780, 634, 787, 784, 797, 802, 809, 808, 427, 814, 1006, 517, 634, 519, 853, 634, 813, 850, 793, 634, 819, 826, 833, 832, 837, 843, 847, 857, 861, 863, 867, 871, 875, 879, 883, 643, 887, 539, 980, 979, 634, 893, 944, 634, 900, 896, 634, 907, 933, 506, 912, 917, 828, 433, 636, 635, 554, 961, 923, 930, 927, 937, 941, 634, 634, 634, 974, 948, 952, 985, 913, 968, 967, 743, 634, 973, 839, 634, 978, 599, 634, 984, 989, 765, 444, 995, 1000, 634, 1003, 790, 955, 1012, 681, 634, 634, 634, 634, 634, 414, 1016, 1020, 1024, 1085, 1027, 1090, 1090, 1046, 1080, 1137, 1108, 1215, 1049, 1032, 1039, 1085, 1085, 1085, 1085, 1058, 1062, 1068, 1085, 1086, 1090, 1090, 1091, 1072, 1064, 1107, 1090, 1090, 1090, 1118, 1123, 1138, 1078, 1074, 1084, 1085, 1085, 1085, 1087, 1090, 1062, 1052, 1060, 1114, 1062, 1104, 1085, 1085, 1090, 1090, 1028, 1122, 1063, 1128, 1139, 1127, 1158, 1085, 1085, 1151, 1090, 1090, 1090, 1095, 1090, 1132, 1073, 1136, 1143, 1061, 1150, 1085, 1155, 1098, 1101, 1146, 1162, 1169, 1101, 1185, 1151, 1090, 1110, 1173, 1054, 1087, 1109, 1177, 1165, 1089, 1204, 1184, 1107, 1189, 1193, 1088, 1197, 1180, 1201, 1208, 1042, 1212, 1219, 1223, 1227, 1231, 1235, 1245, 1777, 1527, 1686, 1686, 1238, 1686, 1254, 1686, 1686, 1686, 1294, 1669, 1686, 1686, 1686, 1322, 1625, 1534, 1268, 1624, 1275, 1281, 1443, 1292, 1300, 1686, 1686, 1686, 1350, 1826, 1306, 1686, 1686, 1240, 2032, 1317, 1321, 1686, 1686, 1253, 1686, 1326, 1686, 1686, 1686, 1418, 1709, 1446, 1686, 1686, 1686, 1492, 1686, 1295, 1447, 1686, 1686, 1258, 1686, 1736, 1686, 1686, 1520, 1355, 1686, 1288, 1348, 1361, 1686, 1359, 1686, 1364, 1498, 1368, 1302, 1362, 1381, 1389, 1395, 1486, 1686, 1371, 1377, 1370, 1686, 1375, 1382, 1384, 1402, 1408, 1385, 1383, 1619, 1413, 1423, 1428, 1433, 1686, 1686, 1270, 1686, 1338, 1686, 1440, 1686, 1686, 1686, 1499, 1465, 1686, 1686, 1686, 1639, 1473, 1884, 1686, 1686, 1293, 1864, 1686, 1686, 1296, 1321, 1483, 1686, 1686, 1686, 1646, 1686, 1748, 1496, 1686, 1418, 1675, 1686, 1418, 1702, 1686, 1418, 1981, 1686, 1429, 1409, 1427, 1504, 1692, 1686, 1686, 1313, 1448, 1651, 1508, 1686, 1686, 1340, 1686, 1903, 1686, 1686, 1435, 1513, 1686, 1283, 1287, 1519, 1686, 1524, 1363, 1568, 1938, 1539, 1566, 1579, 1479, 1533, 1538, 1553, 1544, 1552, 1557, 1563, 1574, 1557, 1583, 1589, 1590, 1759, 1594, 1603, 1607, 1611, 1686, 1436, 1514, 1686, 1434, 1656, 1686, 1434, 1680, 1686, 1453, 1686, 1686, 1686, 1559, 1617, 1686, 1770, 1418, 1623, 1769, 1629, 1686, 1515, 1335, 1686, 1285, 1686, 1671, 1921, 1650, 1686, 1686, 1344, 1308, 1666, 1686, 1686, 1686, 1659, 1685, 1686, 1686, 1686, 1686, 1241, 1686, 1686, 1844, 1691, 1686, 1630, 1977, 1970, 1362, 1686, 1686, 1686, 1693, 1698, 1686, 1686, 1686, 1697, 1686, 1764, 1715, 1686, 1634, 1638, 1686, 1599, 1585, 1686, 1271, 1686, 1269, 1686, 1721, 1686, 1686, 1354, 1686, 1801, 1686, 1799, 1686, 1640, 1686, 1686, 1461, 1686, 1686, 1732, 1686, 1944, 1686, 1740, 1686, 1746, 1415, 1396, 1686, 1598, 1547, 1417, 1597, 1416, 1577, 1546, 1397, 1577, 1547, 1548, 1570, 1398, 1753, 1686, 1652, 1509, 1686, 1686, 1686, 1757, 1686, 1419, 1686, 1763, 1418, 1768, 1781, 1686, 1686, 1686, 1705, 1686, 2048, 1792, 1686, 1686, 1686, 1735, 1686, 1797, 1686, 1686, 1404, 1686, 1639, 1815, 1686, 1686, 1418, 2017, 1820, 1686, 1686, 1803, 1686, 1686, 1686, 1736, 1489, 1686, 1686, 1825, 1338, 1260, 1263, 1686, 1686, 1785, 1686, 1686, 1728, 1686, 1686, 1749, 1497, 1830, 1830, 1262, 1248, 1261, 1329, 1260, 1264, 1329, 1248, 1249, 1259, 1540, 1849, 1842, 1686, 1686, 1835, 1686, 1686, 1816, 1686, 1686, 1831, 1882, 1848, 1686, 1686, 1686, 1774, 2071, 1854, 1686, 1686, 1469, 1884, 1686, 1821, 1859, 1686, 1686, 1350, 1883, 1686, 1686, 1686, 1781, 1391, 1875, 1686, 1686, 1613, 1644, 1686, 1686, 1889, 1686, 1686, 1662, 1884, 1686, 1885, 1890, 1686, 1686, 1686, 1894, 1686, 1686, 1678, 1686, 1907, 1686, 1686, 1529, 1914, 1686, 1838, 1686, 1686, 1881, 1686, 1686, 1872, 1876, 1836, 1919, 1686, 1837, 1692, 1910, 1686, 1925, 1928, 1742, 1686, 1811, 1811, 1930, 1810, 1929, 1935, 1928, 1900, 1942, 1867, 1868, 1931, 1035, 1788, 1948, 1952, 1956, 1960, 1964, 1686, 1976, 1686, 1686, 1686, 2065, 1686, 1992, 2037, 1686, 1686, 1998, 2009, 1972, 2002, 1686, 1686, 1686, 2077, 1300, 2023, 1686, 1686, 1686, 1807, 2031, 1686, 1686, 1686, 1860, 1500, 2032, 1686, 1686, 1686, 2083, 1686, 2036, 1686, 1277, 1276, 2042, 1877, 1686, 1686, 2041, 1686, 1686, 2027, 2037, 2012, 1686, 2012, 1855, 1850, 1686, 2046, 1686, 1686, 2054, 1996, 1686, 1897, 1309, 2059, 2052, 1686, 2058, 1686, 1686, 2081, 1686, 1717, 1477, 1686, 1331, 1686, 1686, 1687, 1686, 1860, 1681, 1686, 1686, 1686, 1966, 1724, 1686, 1686, 1686, 1984, 2015, 1686, 1686, 1686, 1988, 1686, 2063, 1686, 1686, 1686, 2005, 1686, 1727, 1686, 1686, 1711, 1457, 2069, 1686, 1686, 1686, 2019, 2075, 1686, 1686, 1915, 1686, 1686, 1793, 1874, 1686, 1686, 1491, 1362, 1449, 1686, 1686, 1460, 2098, 2087, 2091, 2095, 2184, 2102, 2113, 2780, 2117, 2134, 2142, 2281, 2146, 2146, 2146, 2304, 2296, 2181, 2639, 2591, 2872, 2592, 2873, 2313, 2195, 2200, 2281, 2146, 2273, 2226, 2204, 2152, 2219, 2276, 2167, 2177, 2276, 2235, 2276, 2276, 2230, 2281, 2276, 2296, 2276, 2293, 2276, 2276, 2276, 2276, 2234, 2276, 2311, 2314, 2210, 2199, 2217, 2222, 2276, 2276, 2276, 2240, 2276, 2294, 2276, 2276, 2173, 2276, 2198, 2281, 2281, 2281, 2281, 2282, 2146, 2146, 2146, 2146, 2205, 2146, 2204, 2248, 2276, 2235, 2276, 2297, 2276, 2276, 2276, 2277, 2256, 2281, 2283, 2146, 2146, 2146, 2275, 2276, 2295, 2276, 2276, 2293, 2146, 2304, 2264, 2269, 2221, 2276, 2276, 2276, 2293, 2295, 2276, 2276, 2276, 2295, 2263, 2205, 2268, 2220, 2172, 2276, 2276, 2276, 2296, 2276, 2276, 2296, 2294, 2276, 2276, 2278, 2281, 2281, 2280, 2281, 2281, 2281, 2283, 2206, 2223, 2276, 2276, 2279, 2281, 2281, 2146, 2273, 2276, 2276, 2281, 2281, 2281, 2276, 2292, 2276, 2298, 2225, 2276, 2298, 2169, 2224, 2292, 2298, 2171, 2229, 2281, 2281, 2171, 2236, 2281, 2281, 2281, 2146, 2275, 2225, 2292, 2299, 2276, 2229, 2281, 2146, 2276, 2290, 2297, 2283, 2146, 2146, 2274, 2224, 2227, 2298, 2225, 2297, 2276, 2230, 2170, 2230, 2282, 2146, 2147, 2151, 2156, 2288, 2276, 2230, 2303, 2308, 2236, 2284, 2228, 2318, 2318, 2318, 2326, 2335, 2339, 2343, 2349, 2416, 2693, 2357, 2592, 2109, 2592, 2592, 2162, 2943, 2823, 2646, 2592, 2361, 2592, 2122, 2592, 2592, 2122, 2470, 2592, 2592, 2592, 2109, 2107, 2592, 2592, 2592, 2123, 2592, 2592, 2592, 2125, 2592, 2413, 2592, 2592, 2592, 2127, 2592, 2592, 2414, 2592, 2592, 2592, 2130, 2952, 2592, 2594, 2592, 2592, 2212, 2609, 2252, 2592, 2592, 2592, 2446, 2434, 2592, 2592, 2592, 2212, 2446, 2450, 2456, 2431, 2435, 2592, 2592, 2243, 2478, 2448, 2439, 2946, 2592, 2592, 2592, 2368, 2809, 2813, 2450, 2441, 2212, 2812, 2449, 2440, 2947, 2592, 2592, 2592, 2345, 2451, 2457, 2948, 2592, 2124, 2592, 2592, 2650, 2823, 2449, 2455, 2946, 2592, 2128, 2592, 2592, 2649, 2952, 2592, 2810, 2448, 2461, 2991, 2467, 2592, 2592, 2329, 2817, 2474, 2990, 2466, 2592, 2592, 2373, 2447, 2992, 2469, 2592, 2592, 2592, 2373, 2447, 2477, 2468, 2592, 2592, 2353, 2469, 2592, 2495, 2592, 2592, 2415, 2483, 2592, 2415, 2496, 2592, 2592, 2352, 2592, 2592, 2352, 2352, 2469, 2592, 2592, 2363, 2331, 2494, 2592, 2592, 2592, 2375, 2592, 2375, 2415, 2504, 2592, 2592, 2367, 2372, 2503, 2592, 2592, 2592, 2389, 2418, 2415, 2592, 2592, 2373, 2592, 2592, 2592, 2593, 2732, 2417, 2415, 2592, 2417, 2520, 2592, 2592, 2592, 2390, 2521, 2521, 2592, 2592, 2592, 2401, 2599, 2585, 2526, 2531, 2120, 2592, 2212, 2426, 2450, 2463, 2948, 2592, 2592, 2592, 2213, 2389, 2527, 2532, 2121, 2542, 2551, 2105, 2592, 2213, 2592, 2592, 2592, 2558, 2538, 2544, 2553, 2557, 2537, 2543, 2552, 2421, 2572, 2576, 2546, 2543, 2547, 2592, 2592, 2373, 2615, 2575, 2545, 2105, 2592, 2244, 2479, 2592, 2129, 2592, 2592, 2628, 2690, 2469, 2562, 2566, 2592, 2592, 2592, 2415, 2928, 2934, 2401, 2570, 2574, 2564, 2572, 2585, 2590, 2592, 2592, 2585, 2965, 2592, 2592, 2592, 2445, 2251, 2592, 2592, 2592, 2474, 2592, 2609, 2892, 2592, 2362, 2592, 2592, 2138, 2851, 2159, 2592, 2592, 2592, 2509, 2888, 2892, 2592, 2592, 2592, 2490, 2418, 2891, 2592, 2592, 2376, 2592, 2592, 2374, 2592, 2889, 2388, 2592, 2373, 2373, 2890, 2592, 2592, 2387, 2592, 2887, 2505, 2892, 2592, 2373, 2610, 2388, 2592, 2592, 2376, 2373, 2592, 2887, 2891, 2592, 2374, 2592, 2592, 2608, 2159, 2614, 2620, 2592, 2592, 2394, 2594, 2887, 2399, 2592, 2887, 2397, 2508, 2374, 2507, 2592, 2375, 2592, 2592, 2592, 2595, 2508, 2506, 2592, 2506, 2505, 2505, 2592, 2507, 2637, 2505, 2592, 2592, 2401, 2661, 2592, 2643, 2592, 2592, 2417, 2592, 2655, 2592, 2592, 2592, 2510, 2414, 2656, 2592, 2592, 2592, 2516, 2592, 2593, 2660, 2665, 2880, 2592, 2592, 2592, 2522, 2767, 2666, 2881, 2592, 2592, 2420, 2571, 2696, 2592, 2592, 2592, 2580, 2572, 2686, 2632, 2698, 2592, 2383, 2514, 2592, 2163, 2932, 2465, 2685, 2631, 2697, 2592, 2388, 2592, 2592, 2212, 2604, 2671, 2632, 2678, 2592, 2401, 2405, 2409, 2592, 2592, 2592, 2679, 2592, 2592, 2592, 2592, 2108, 2677, 2591, 2592, 2592, 2592, 2419, 2592, 2683, 2187, 2191, 2469, 2671, 2189, 2467, 2592, 2401, 2629, 2633, 2702, 2468, 2592, 2592, 2421, 2536, 2703, 2469, 2592, 2592, 2422, 2573, 2593, 2672, 2467, 2592, 2402, 2406, 2592, 2402, 2979, 2592, 2592, 2626, 2673, 2467, 2592, 2446, 2259, 2947, 2592, 2377, 2709, 2592, 2592, 2522, 2862, 2713, 2468, 2592, 2592, 2581, 2572, 2562, 2374, 2374, 2592, 2376, 2721, 2724, 2592, 2592, 2624, 2373, 2731, 2592, 2592, 2592, 2626, 2732, 2592, 2592, 2592, 2755, 2656, 2726, 2736, 2741, 2592, 2486, 2593, 2381, 2592, 2727, 2737, 2742, 2715, 2747, 2753, 2592, 2498, 2469, 2873, 2743, 2592, 2592, 2592, 2791, 2759, 2763, 2592, 2592, 2627, 2704, 2592, 2592, 2522, 2789, 2593, 2761, 2753, 2592, 2498, 2863, 2592, 2592, 2767, 2592, 2592, 2592, 2792, 2789, 2592, 2592, 2592, 2803, 2126, 2592, 2592, 2592, 2811, 2122, 2592, 2592, 2592, 2834, 2777, 2592, 2592, 2592, 2848, 2936, 2591, 2489, 2797, 2592, 2592, 2670, 2631, 2490, 2798, 2592, 2592, 2592, 2963, 2807, 2592, 2592, 2592, 2965, 2838, 2592, 2592, 2592, 2975, 2330, 2818, 2829, 2592, 2498, 2939, 2592, 2498, 2592, 2791, 2331, 2819, 2830, 2592, 2592, 2592, 2982, 2834, 2817, 2828, 2106, 2592, 2592, 2592, 2405, 2405, 2817, 2828, 2592, 2592, 2415, 2849, 2842, 2592, 2522, 2773, 2592, 2522, 2868, 2592, 2580, 2600, 2586, 2137, 2850, 2843, 2592, 2592, 2855, 2937, 2844, 2592, 2592, 2592, 2987, 2936, 2591, 2592, 2592, 2684, 2630, 2592, 2856, 2938, 2592, 2592, 2860, 2939, 2592, 2592, 2872, 2592, 2861, 2591, 2592, 2592, 2887, 2616, 2592, 2867, 2592, 2592, 2708, 2592, 2498, 2469, 2498, 2497, 2785, 2773, 2499, 2783, 2770, 2877, 2877, 2877, 2772, 2592, 2592, 2345, 2885, 2592, 2592, 2592, 2715, 2762, 2515, 2896, 2592, 2592, 2715, 2917, 2516, 2897, 2592, 2592, 2592, 2901, 2906, 2911, 2592, 2592, 2956, 2960, 2715, 2902, 2907, 2912, 2593, 2916, 2920, 2820, 2922, 2822, 2592, 2592, 2715, 2927, 2921, 2821, 2106, 2592, 2592, 2974, 2408, 2321, 2821, 2106, 2592, 2592, 2983, 2592, 2593, 2404, 2408, 2592, 2592, 2717, 2749, 2716, 2928, 2322, 2822, 2593, 2926, 2919, 2820, 2934, 2823, 2592, 2592, 2592, 2651, 2824, 2592, 2592, 2592, 2130, 2952, 2592, 2592, 2592, 2592, 2964, 2592, 2592, 2716, 2748, 2592, 2969, 2592, 2592, 2716, 2918, 2368, 2970, 2592, 2592, 2592, 2403, 2407, 2592, 2592, 2787, 2211, 2404, 2409, 2592, 2592, 2802, 2837, 2987, 2592, 2592, 2592, 2809, 2427, 2592, 2793, 2592, 2592, 2809, 2447, 1073741824, 0x80000000, 539754496, 542375936, 402653184, 554434560, 571736064, 545521856, 268451840, 335544320, 268693630, 512, 2048, 256, 1024, 0, 1024, 0, 1073741824, 0x80000000, 0, 0, 0, 8388608, 0, 0, 1073741824, 1073741824, 0, 0x80000000, 537133056, 4194304, 1048576, 268435456, -1073741824, 0, 0, 0, 1048576, 0, 0, 0, 1572864, 0, 0, 0, 4194304, 0, 134217728, 16777216, 0, 0, 32, 64, 98304, 0, 33554432, 8388608, 192, 67108864, 67108864, 67108864, 67108864, 16, 32, 4, 0, 8192, 196608, 196608, 229376, 80, 4096, 524288, 8388608, 0, 0, 32, 128, 256, 24576, 24600, 24576, 24576, 2, 24576, 24576, 24576, 24584, 24592, 24576, 24578, 24576, 24578, 24576, 24576, 16, 512, 2048, 2048, 256, 4096, 32768, 1048576, 4194304, 67108864, 134217728, 268435456, 262144, 134217728, 0, 128, 128, 64, 16384, 16384, 16384, 67108864, 32, 32, 4, 4, 4096, 262144, 134217728, 0, 0, 0, 2, 0, 8192, 131072, 131072, 4096, 4096, 4096, 4096, 24576, 24576, 24576, 8, 8, 24576, 24576, 16384, 16384, 16384, 24576, 24584, 24576, 24576, 24576, 16384, 24576, 536870912, 262144, 0, 0, 32, 2048, 8192, 4, 4096, 4096, 4096, 786432, 8388608, 16777216, 0, 128, 16384, 16384, 16384, 32768, 65536, 2097152, 32, 32, 32, 32, 4, 4, 4, 4, 4, 4096, 67108864, 67108864, 67108864, 24576, 24576, 24576, 24576, 0, 16384, 16384, 16384, 16384, 67108864, 67108864, 8, 67108864, 24576, 8, 8, 8, 24576, 24576, 24576, 24578, 24576, 24576, 24576, 2, 2, 2, 16384, 67108864, 67108864, 67108864, 32, 67108864, 8, 8, 24576, 2048, 0x80000000, 536870912, 262144, 262144, 262144, 67108864, 8, 24576, 16384, 32768, 1048576, 4194304, 25165824, 67108864, 24576, 32770, 2, 4, 112, 512, 98304, 524288, 50, 402653186, 1049090, 1049091, 10, 66, 100925514, 10, 66, 12582914, 0, 0, -1678194207, -1678194207, -1041543218, 0, 32768, 0, 0, 32, 65536, 268435456, 1, 1, 513, 1048577, 0, 12582912, 0, 0, 0, 4, 1792, 0, 0, 0, 7, 29360128, 0, 0, 0, 8, 0, 0, 0, 12, 1, 1, 0, 0, -604102721, -604102721, 4194304, 8388608, 0, 0, 0, 31, 925600, 997981306, 997981306, 997981306, 0, 0, 2048, 8388608, 0, 0, 1, 2, 4, 32, 64, 512, 8192, 0, 0, 0, 245760, 997720064, 0, 0, 0, 32, 0, 0, 0, 3, 12, 16, 32, 8, 112, 3072, 12288, 16384, 32768, 65536, 131072, 7864320, 16777216, 973078528, 0, 0, 65536, 131072, 3670016, 4194304, 16777216, 33554432, 2, 8, 48, 2048, 8192, 16384, 32768, 65536, 131072, 524288, 131072, 524288, 3145728, 4194304, 16777216, 33554432, 65536, 131072, 2097152, 4194304, 16777216, 33554432, 134217728, 268435456, 536870912, 0, 0, 0, 1024, 0, 8, 48, 2048, 8192, 65536, 33554432, 268435456, 536870912, 65536, 268435456, 536870912, 0, 0, 32768, 0, 0, 126, 623104, 65011712, 0, 32, 65536, 536870912, 0, 0, 65536, 524288, 0, 32, 65536, 0, 0, 0, 2048, 0, 0, 0, 15482, 245760, -604102721, 0, 0, 0, 18913, 33062912, 925600, -605028352, 0, 0, 0, 65536, 31, 8096, 131072, 786432, 3145728, 3145728, 12582912, 50331648, 134217728, 268435456, 160, 256, 512, 7168, 131072, 786432, 131072, 786432, 1048576, 2097152, 12582912, 16777216, 268435456, 1073741824, 0x80000000, 12582912, 16777216, 33554432, 268435456, 1073741824, 0x80000000, 3, 12, 16, 160, 256, 7168, 786432, 1048576, 12582912, 16777216, 268435456, 1073741824, 0, 8, 16, 32, 128, 256, 512, 7168, 786432, 1048576, 2097152, 0, 1, 2, 8, 16, 7168, 786432, 1048576, 8388608, 16777216, 16777216, 1073741824, 0, 0, 0, 0, 1, 0, 0, 8, 32, 128, 256, 7168, 8, 32, 0, 3072, 0, 8, 32, 3072, 4096, 524288, 8, 32, 0, 0, 3072, 4096, 0, 2048, 524288, 8388608, 8, 2048, 0, 0, 1, 12, 256, 4096, 32768, 262144, 1048576, 4194304, 67108864, 0, 2048, 0, 2048, 2048, 1073741824, -58805985, -58805985, -58805985, 0, 0, 262144, 0, 0, 32, 4194304, 16777216, 134217728, 4382, 172032, -58982400, 0, 0, 2, 28, 256, 4096, 8192, 8192, 32768, 131072, 262144, 524288, 1, 2, 12, 256, 4096, 0, 0, 4194304, 67108864, 134217728, 805306368, 1073741824, 0, 0, 1, 2, 12, 16, 256, 4096, 1048576, 67108864, 134217728, 268435456, 0, 512, 1048576, 4194304, 201326592, 1879048192, 0, 0, 12, 256, 4096, 134217728, 268435456, 536870912, 12, 256, 268435456, 536870912, 0, 12, 256, 0, 0, 1, 32, 64, 512, 0, 0, 205236961, 205236961, 0, 0, 0, 1, 96, 640, 1, 10976, 229376, 204996608, 0, 640, 2048, 8192, 229376, 1572864, 1572864, 2097152, 201326592, 0, 0, 0, 64, 512, 2048, 229376, 1572864, 201326592, 1572864, 201326592, 0, 0, 1, 4382, 0, 1, 32, 2048, 65536, 131072, 1572864, 201326592, 131072, 1572864, 134217728, 0, 0, 524288, 524288, 0, 0, 0, -68582786, -68582786, -68582786, 0, 0, 2097152, 524288, 0, 524288, 0, 0, 65536, 131072, 1572864, 0, 0, 2, 4, 0, 0, 65011712, -134217728, 0, 0, 0, 0, 2, 4, 120, 512, -268435456, 0, 0, 0, 2, 8, 48, 64, 2048, 8192, 98304, 524288, 2097152, 4194304, 25165824, 33554432, 134217728, 268435456, 0x80000000, 0, 0, 25165824, 33554432, 134217728, 1879048192, 0x80000000, 0, 0, 4, 112, 512, 622592, 65011712, 134217728, -268435456, 16777216, 33554432, 134217728, 1610612736, 0, 0, 0, 64, 98304, 524288, 4194304, 16777216, 33554432, 0, 98304, 524288, 16777216, 33554432, 0, 65536, 524288, 33554432, 536870912, 1073741824, 0, 65536, 524288, 536870912, 1073741824, 0, 0, 65536, 524288, 536870912, 0, 524288, 0, 524288, 524288, 1048576, 2086666240, 0x80000000, 0, -1678194207, 0, 0, 0, 8, 32, 2048, 524288, 8388608, 0, 0, 33062912, 436207616, 0x80000000, 0, 0, 32, 64, 2432, 16384, 32768, 32768, 524288, 3145728, 4194304, 25165824, 25165824, 167772160, 268435456, 0x80000000, 0, 32, 64, 384, 2048, 16384, 32768, 1048576, 2097152, 4194304, 25165824, 32, 64, 128, 256, 2048, 16384, 2048, 16384, 1048576, 4194304, 16777216, 33554432, 134217728, 536870912, 1073741824, 0, 0, 2048, 16384, 4194304, 16777216, 33554432, 134217728, 805306368, 0, 0, 16777216, 134217728, 268435456, 0x80000000, 0, 622592, 622592, 622592, 8807, 8807, 434791, 0, 0, 16777216, 0, 0, 0, 7, 608, 8192, 0, 0, 0, 3, 4, 96, 512, 32, 64, 8192, 0, 0, 16777216, 134217728, 0, 0, 2, 4, 8192, 16384, 65536, 2097152, 33554432, 268435456 -]; - -JSONiqTokenizer.TOKEN = -[ - "(0)", - "ModuleDecl", - "Annotation", - "OptionDecl", - "Operator", - "Variable", - "Tag", - "EndTag", - "PragmaContents", - "DirCommentContents", - "DirPIContents", - "CDataSectionContents", - "AttrTest", - "Wildcard", - "EQName", - "IntegerLiteral", - "DecimalLiteral", - "DoubleLiteral", - "PredefinedEntityRef", - "'\"\"'", - "EscapeApos", - "QuotChar", - "AposChar", - "ElementContentChar", - "QuotAttrContentChar", - "AposAttrContentChar", - "NCName", - "QName", - "S", - "CharRef", - "CommentContents", - "DocTag", - "DocCommentContents", - "EOF", - "'!'", - "'\"'", - "'#'", - "'#)'", - "''''", - "'('", - "'(#'", - "'(:'", - "'(:~'", - "')'", - "'*'", - "'*'", - "','", - "'-->'", - "'.'", - "'/'", - "'/>'", - "':'", - "':)'", - "';'", - "'", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-jsx.js b/util/build-sample-browser/player/vendor/ace/mode-jsx.js deleted file mode 100644 index 8cd7a7d200..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-jsx.js +++ /dev/null @@ -1,712 +0,0 @@ -ace.define('ace/mode/jsx', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jsx_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JsxHighlightRules = require("./jsx_highlight_rules").JsxHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -function Mode() { - this.HighlightRules = JsxHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -} -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/jsx"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/jsx_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JsxHighlightRules = function() { - var keywords = lang.arrayToMap( - ("break|do|instanceof|typeof|case|else|new|var|catch|finally|return|void|continue|for|switch|default|while|function|this|" + - "if|throw|" + - "delete|in|try|" + - "class|extends|super|import|from|into|implements|interface|static|mixin|override|abstract|final|" + - "number|int|string|boolean|variant|" + - "log|assert").split("|") - ); - - var buildinConstants = lang.arrayToMap( - ("null|true|false|NaN|Infinity|__FILE__|__LINE__|undefined").split("|") - ); - - var reserved = lang.arrayToMap( - ("debugger|with|" + - "const|export|" + - "let|private|public|yield|protected|" + - "extern|native|as|operator|__fake__|__readonly__").split("|") - ); - - var identifierRe = "[a-zA-Z_][a-zA-Z0-9_]*\\b"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : [ - "storage.type", - "text", - "entity.name.function" - ], - regex : "(function)(\\s+)(" + identifierRe + ")" - }, { - token : function(value) { - if (value == "this") - return "variable.language"; - else if (value == "function") - return "storage.type"; - else if (keywords.hasOwnProperty(value) || reserved.hasOwnProperty(value)) - return "keyword"; - else if (buildinConstants.hasOwnProperty(value)) - return "constant.language"; - else if (/^_?[A-Z][a-zA-Z0-9_]*$/.test(value)) - return "language.support.class"; - else - return "identifier"; - }, - regex : identifierRe - }, { - token : "keyword.operator", - regex : "!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({<]" - }, { - token : "paren.rparen", - regex : "[\\])}>]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(JsxHighlightRules, TextHighlightRules); - -exports.JsxHighlightRules = JsxHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-julia.js b/util/build-sample-browser/player/vendor/ace/mode-julia.js deleted file mode 100644 index f37058fda5..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-julia.js +++ /dev/null @@ -1,286 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/julia', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/julia_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JuliaHighlightRules = require("./julia_highlight_rules").JuliaHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JuliaHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "#"; - this.blockComment = ""; - this.$id = "ace/mode/julia"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/julia_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JuliaHighlightRules = function() { - - this.$rules = { start: - [ { include: '#function_decl' }, - { include: '#function_call' }, - { include: '#type_decl' }, - { include: '#keyword' }, - { include: '#operator' }, - { include: '#number' }, - { include: '#string' }, - { include: '#comment' } ], - '#bracket': - [ { token: 'keyword.bracket.julia', - regex: '\\(|\\)|\\[|\\]|\\{|\\}|,' } ], - '#comment': - [ { token: - [ 'punctuation.definition.comment.julia', - 'comment.line.number-sign.julia' ], - regex: '(#)(?!\\{)(.*$)'} ], - '#function_call': - [ { token: [ 'support.function.julia', 'text' ], - regex: '([a-zA-Z0-9_]+!?)(\\w*\\()'} ], - '#function_decl': - [ { token: [ 'keyword.other.julia', 'meta.function.julia', - 'entity.name.function.julia', 'meta.function.julia','text' ], - regex: '(function|macro)(\\s*)([a-zA-Z0-9_\\{]+!?)(\\w*)([(\\\\{])'} ], - '#keyword': - [ { token: 'keyword.other.julia', - regex: '\\b(?:function|type|immutable|macro|quote|abstract|bitstype|typealias|module|baremodule|new)\\b' }, - { token: 'keyword.control.julia', - regex: '\\b(?:if|else|elseif|while|for|in|begin|let|end|do|try|catch|finally|return|break|continue)\\b' }, - { token: 'storage.modifier.variable.julia', - regex: '\\b(?:global|local|const|export|import|importall|using)\\b' }, - { token: 'variable.macro.julia', regex: '@\\w+\\b' } ], - '#number': - [ { token: 'constant.numeric.julia', - regex: '\\b0(?:x|X)[0-9a-fA-F]*|(?:\\b[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]*)?(?:im)?|\\bInf(?:32)?\\b|\\bNaN(?:32)?\\b|\\btrue\\b|\\bfalse\\b' } ], - '#operator': - [ { token: 'keyword.operator.update.julia', - regex: '=|:=|\\+=|-=|\\*=|/=|//=|\\.//=|\\.\\*=|\\\\=|\\.\\\\=|^=|\\.^=|%=|\\|=|&=|\\$=|<<=|>>=' }, - { token: 'keyword.operator.ternary.julia', regex: '\\?|:' }, - { token: 'keyword.operator.boolean.julia', - regex: '\\|\\||&&|!' }, - { token: 'keyword.operator.arrow.julia', regex: '->|<-|-->' }, - { token: 'keyword.operator.relation.julia', - regex: '>|<|>=|<=|==|!=|\\.>|\\.<|\\.>=|\\.>=|\\.==|\\.!=|\\.=|\\.!|<:|:>' }, - { token: 'keyword.operator.range.julia', regex: ':' }, - { token: 'keyword.operator.shift.julia', regex: '<<|>>' }, - { token: 'keyword.operator.bitwise.julia', regex: '\\||\\&|~' }, - { token: 'keyword.operator.arithmetic.julia', - regex: '\\+|-|\\*|\\.\\*|/|\\./|//|\\.//|%|\\.%|\\\\|\\.\\\\|\\^|\\.\\^' }, - { token: 'keyword.operator.isa.julia', regex: '::' }, - { token: 'keyword.operator.dots.julia', - regex: '\\.(?=[a-zA-Z])|\\.\\.+' }, - { token: 'keyword.operator.interpolation.julia', - regex: '\\$#?(?=.)' }, - { token: [ 'variable', 'keyword.operator.transposed-variable.julia' ], - regex: '(\\w+)((?:\'|\\.\')*\\.?\')' }, - { token: 'text', - regex: '\\[|\\('}, - { token: [ 'text', 'keyword.operator.transposed-matrix.julia' ], - regex: "([\\]\\)])((?:'|\\.')*\\.?')"} ], - '#string': - [ { token: 'punctuation.definition.string.begin.julia', - regex: '\'', - push: - [ { token: 'punctuation.definition.string.end.julia', - regex: '\'', - next: 'pop' }, - { include: '#string_escaped_char' }, - { defaultToken: 'string.quoted.single.julia' } ] }, - { token: 'punctuation.definition.string.begin.julia', - regex: '"', - push: - [ { token: 'punctuation.definition.string.end.julia', - regex: '"', - next: 'pop' }, - { include: '#string_escaped_char' }, - { defaultToken: 'string.quoted.double.julia' } ] }, - { token: 'punctuation.definition.string.begin.julia', - regex: '\\b\\w+"', - push: - [ { token: 'punctuation.definition.string.end.julia', - regex: '"\\w*', - next: 'pop' }, - { include: '#string_custom_escaped_char' }, - { defaultToken: 'string.quoted.custom-double.julia' } ] }, - { token: 'punctuation.definition.string.begin.julia', - regex: '`', - push: - [ { token: 'punctuation.definition.string.end.julia', - regex: '`', - next: 'pop' }, - { include: '#string_escaped_char' }, - { defaultToken: 'string.quoted.backtick.julia' } ] } ], - '#string_custom_escaped_char': [ { token: 'constant.character.escape.julia', regex: '\\\\"' } ], - '#string_escaped_char': - [ { token: 'constant.character.escape.julia', - regex: '\\\\(?:\\\\|[0-3]\\d{,2}|[4-7]\\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8}|.)' } ], - '#type_decl': - [ { token: - [ 'keyword.control.type.julia', - 'meta.type.julia', - 'entity.name.type.julia', - 'entity.other.inherited-class.julia', - 'punctuation.separator.inheritance.julia', - 'entity.other.inherited-class.julia' ], - regex: '(type|immutable)(\\s+)([a-zA-Z0-9_]+)(?:(\\s*)(<:)(\\s*[.a-zA-Z0-9_:]+))?' }, - { token: [ 'other.typed-variable.julia', 'support.type.julia' ], - regex: '([a-zA-Z0-9_]+)(::[a-zA-Z0-9_{}]+)' } ] } - - this.normalizeRules(); -}; - -JuliaHighlightRules.metaData = { fileTypes: [ 'jl' ], - firstLineMatch: '^#!.*\\bjulia\\s*$', - foldingStartMarker: '^\\s*(?:if|while|for|begin|function|macro|module|baremodule|type|immutable|let)\\b(?!.*\\bend\\b).*$', - foldingStopMarker: '^\\s*(?:end)\\b.*$', - name: 'Julia', - scopeName: 'source.julia' } - - -oop.inherits(JuliaHighlightRules, TextHighlightRules); - -exports.JuliaHighlightRules = JuliaHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-latex.js b/util/build-sample-browser/player/vendor/ace/mode-latex.js deleted file mode 100644 index 01721185aa..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-latex.js +++ /dev/null @@ -1,190 +0,0 @@ -ace.define('ace/mode/latex', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/latex_highlight_rules', 'ace/mode/folding/latex', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var LatexHighlightRules = require("./latex_highlight_rules").LatexHighlightRules; -var LatexFoldMode = require("./folding/latex").FoldMode; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = LatexHighlightRules; - this.foldingRules = new LatexFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "%"; - - this.$id = "ace/mode/latex"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); -ace.define('ace/mode/latex_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LatexHighlightRules = function() { - this.$rules = { - "start" : [{ - token : "keyword", - regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "string", - regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$" - }, { - token : "comment", - regex : "%.*$" - }] - }; -}; - -oop.inherits(LatexHighlightRules, TextHighlightRules); - -exports.LatexHighlightRules = LatexHighlightRules; - -}); - -ace.define('ace/mode/folding/latex', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function() {}; - -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /^\s*\\(begin)|(section|subsection)\b|{\s*$/; - this.foldingStopMarker = /^\s*\\(end)\b|^\s*}/; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var line = session.doc.getLine(row); - var match = this.foldingStartMarker.exec(line); - if (match) { - if (match[1]) - return this.latexBlock(session, row, match[0].length - 1); - if (match[2]) - return this.latexSection(session, row, match[0].length - 1); - - return this.openingBracketBlock(session, "{", row, match.index); - } - - var match = this.foldingStopMarker.exec(line); - if (match) { - if (match[1]) - return this.latexBlock(session, row, match[0].length - 1); - - return this.closingBracketBlock(session, "}", row, match.index + match[0].length); - } - }; - - this.latexBlock = function(session, row, column) { - var keywords = { - "\\begin": 1, - "\\end": -1 - }; - - var stream = new TokenIterator(session, row, column); - var token = stream.getCurrentToken(); - if (!token || token.type !== "keyword") - return; - - var val = token.value; - var dir = keywords[val]; - - var getType = function() { - var token = stream.stepForward(); - var type = token.type == "lparen" ?stream.stepForward().value : ""; - if (dir === -1) { - stream.stepBackward(); - if (type) - stream.stepBackward(); - } - return type; - }; - var stack = [getType()]; - var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length; - var startRow = row; - - stream.step = dir === -1 ? stream.stepBackward : stream.stepForward; - while(token = stream.step()) { - if (token.type !== "keyword") - continue; - var level = keywords[token.value]; - if (!level) - continue; - var type = getType(); - if (level === dir) - stack.unshift(type); - else if (stack.shift() !== type || !stack.length) - break; - } - - if (stack.length) - return; - - var row = stream.getCurrentTokenRow(); - if (dir === -1) - return new Range(row, session.getLine(row).length, startRow, startColumn); - stream.stepBackward(); - return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn()); - }; - - this.latexSection = function(session, row, column) { - var keywords = ["\\subsection", "\\section", "\\begin", "\\end"]; - - var stream = new TokenIterator(session, row, column); - var token = stream.getCurrentToken(); - if (!token || token.type != "keyword") - return; - - var startLevel = keywords.indexOf(token.value); - var stackDepth = 0 - var endRow = row; - - while(token = stream.stepForward()) { - if (token.type !== "keyword") - continue; - var level = keywords.indexOf(token.value); - - if (level >= 2) { - if (!stackDepth) - endRow = stream.getCurrentTokenRow() - 1; - stackDepth += level == 2 ? 1 : - 1; - if (stackDepth < 0) - break - } else if (level >= startLevel) - break; - } - - if (!stackDepth) - endRow = stream.getCurrentTokenRow() - 1; - - while (endRow > row && !/\S/.test(session.getLine(endRow))) - endRow--; - - return new Range( - row, session.getLine(row).length, - endRow, session.getLine(endRow).length - ); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-less.js b/util/build-sample-browser/player/vendor/ace/mode-less.js deleted file mode 100644 index c77c14a067..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-less.js +++ /dev/null @@ -1,884 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/less', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/less_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = LessHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/less"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/less_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LessHighlightRules = function() { - - var properties = lang.arrayToMap( (function () { - - var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); - - var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + - "background-size|binding|border-bottom-colors|border-left-colors|" + - "border-right-colors|border-top-colors|border-end|border-end-color|" + - "border-end-style|border-end-width|border-image|border-start|" + - "border-start-color|border-start-style|border-start-width|box-align|" + - "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + - "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + - "column-rule-width|column-rule-style|column-rule-color|float-edge|" + - "font-feature-settings|font-language-override|force-broken-image-icon|" + - "image-region|margin-end|margin-start|opacity|outline|outline-color|" + - "outline-offset|outline-radius|outline-radius-bottomleft|" + - "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + - "outline-style|outline-width|padding-end|padding-start|stack-sizing|" + - "tab-size|text-blink|text-decoration-color|text-decoration-line|" + - "text-decoration-style|transform|transform-origin|transition|" + - "transition-delay|transition-duration|transition-property|" + - "transition-timing-function|user-focus|user-input|user-modify|user-select|" + - "window-shadow|border-radius").split("|"); - - var properties = ("azimuth|background-attachment|background-color|background-image|" + - "background-position|background-repeat|background|border-bottom-color|" + - "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + - "border-color|border-left-color|border-left-style|border-left-width|" + - "border-left|border-right-color|border-right-style|border-right-width|" + - "border-right|border-spacing|border-style|border-top-color|" + - "border-top-style|border-top-width|border-top|border-width|border|" + - "bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + - "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + - "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + - "font-stretch|font-style|font-variant|font-weight|font|height|left|" + - "letter-spacing|line-height|list-style-image|list-style-position|" + - "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + - "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + - "min-width|opacity|orphans|outline-color|" + - "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + - "padding-left|padding-right|padding-top|padding|page-break-after|" + - "page-break-before|page-break-inside|page|pause-after|pause-before|" + - "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + - "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + - "stress|table-layout|text-align|text-decoration|text-indent|" + - "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + - "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + - "z-index").split("|"); - var ret = []; - for (var i=0, ln=browserPrefix.length; i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - }, { - caseInsensitive: true - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; -}; - -oop.inherits(LessHighlightRules, TextHighlightRules); - -exports.LessHighlightRules = LessHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-liquid.js b/util/build-sample-browser/player/vendor/ace/mode-liquid.js deleted file mode 100644 index 91decf65a6..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-liquid.js +++ /dev/null @@ -1,1063 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/liquid', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/liquid_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var LiquidHighlightRules = require("./liquid_highlight_rules").LiquidHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = LiquidHighlightRules; - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/liquid"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/liquid_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/html_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - -var LiquidHighlightRules = function() { - HtmlHighlightRules.call(this); - var functions = ( - "date|capitalize|downcase|upcase|first|last|join|sort|map|size|escape|" + - "escape_once|strip_html|strip_newlines|newline_to_br|replace|replace_first|" + - "truncate|truncatewords|prepend|append|minus|plus|times|divided_by|split" - ); - - var keywords = ( - "capture|endcapture|case|endcase|when|comment|endcomment|" + - "cycle|for|endfor|in|reversed|if|endif|else|elsif|include|endinclude|unless|endunless|" + - "style|text|image|widget|plugin|marker|endmarker|tablerow|endtablerow" - ); - - var builtinVariables = 'forloop|tablerowloop'; - - var definitions = ("assign"); - - var keywordMapper = this.createKeywordMapper({ - "variable.language": builtinVariables, - "keyword": keywords, - "support.function": functions, - "keyword.definition": definitions - }, "identifier"); - for (var rule in this.$rules) { - this.$rules[rule].unshift({ - token : "variable", - regex : "{%", - push : "liquid-start" - }, { - token : "variable", - regex : "{{", - push : "liquid-start" - }); - } - - this.addRules({ - "liquid-start" : [{ - token: "variable", - regex: "}}", - next: "pop" - }, { - token: "variable", - regex: "%}", - next: "pop" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\/|\\*|\\-|\\+|=|!=|\\?\\:" - }, { - token : "paren.lparen", - regex : /[\[\({]/ - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "text", - regex : "\\s+" - }] - }); - - this.normalizeRules(); -}; -oop.inherits(LiquidHighlightRules, TextHighlightRules); - -exports.LiquidHighlightRules = LiquidHighlightRules; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-lisp.js b/util/build-sample-browser/player/vendor/ace/mode-lisp.js deleted file mode 100644 index 2d79f94a2f..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-lisp.js +++ /dev/null @@ -1,137 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/lisp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lisp_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var LispHighlightRules = require("./lisp_highlight_rules").LispHighlightRules; - -var Mode = function() { - this.HighlightRules = LispHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ";"; - - this.$id = "ace/mode/lisp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - - -ace.define('ace/mode/lisp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LispHighlightRules = function() { - var keywordControl = "case|do|let|loop|if|else|when"; - var keywordOperator = "eq|neq|and|or"; - var constantLanguage = "null|nil"; - var supportFunctions = "cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn"; - - var keywordMapper = this.createKeywordMapper({ - "keyword.control": keywordControl, - "keyword.operator": keywordOperator, - "constant.language": constantLanguage, - "support.function": supportFunctions - }, "identifier", true); - - this.$rules = - { - "start": [ - { - token : "comment", - regex : ";.*$" - }, - { - token: ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"], - regex: "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)" - }, - { - token: ["punctuation.definition.constant.character.lisp", "constant.character.lisp"], - regex: "(#)((?:\\w|[\\\\+-=<>'\"&#])+)" - }, - { - token: ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"], - regex: "(\\*)(\\S*)(\\*)" - }, - { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, - { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, - { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, - { - token : "string", - regex : '"(?=.)', - next : "qqstring" - } - ], - "qqstring": [ - { - token: "constant.character.escape.lisp", - regex: "\\\\." - }, - { - token : "string", - regex : '[^"\\\\]+' - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "start" - } - ] -} - -}; - -oop.inherits(LispHighlightRules, TextHighlightRules); - -exports.LispHighlightRules = LispHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-livescript.js b/util/build-sample-browser/player/vendor/ace/mode-livescript.js deleted file mode 100644 index 5de4147852..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-livescript.js +++ /dev/null @@ -1,289 +0,0 @@ -ace.define('ace/mode/livescript', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/text'], function(require, exports, module) { - var identifier, LiveScriptMode, keywordend, stringfill; - identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*'; - exports.Mode = LiveScriptMode = (function(superclass){ - var indenter, prototype = extend$((import$(LiveScriptMode, superclass).displayName = 'LiveScriptMode', LiveScriptMode), superclass).prototype, constructor = LiveScriptMode; - function LiveScriptMode(){ - var that; - this.$tokenizer = new (require('../tokenizer')).Tokenizer(LiveScriptMode.Rules); - if (that = require('../mode/matching_brace_outdent')) { - this.$outdent = new that.MatchingBraceOutdent; - } - this.$id = "ace/mode/livescript"; - } - indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$'); - prototype.getNextLineIndent = function(state, line, tab){ - var indent, tokens; - indent = this.$getIndent(line); - tokens = this.$tokenizer.getLineTokens(line, state).tokens; - if (!(tokens.length && tokens[tokens.length - 1].type === 'comment')) { - if (state === 'start' && indenter.test(line)) { - indent += tab; - } - } - return indent; - }; - prototype.toggleCommentLines = function(state, doc, startRow, endRow){ - var comment, range, i$, i, out, line; - comment = /^(\s*)#/; - range = new (require('../range')).Range(0, 0, 0, 0); - for (i$ = startRow; i$ <= endRow; ++i$) { - i = i$; - if (out = comment.test(line = doc.getLine(i))) { - line = line.replace(comment, '$1'); - } else { - line = line.replace(/^\s*/, '$&#'); - } - range.end.row = range.start.row = i; - range.end.column = line.length + 1; - doc.replace(range, line); - } - return 1 - out * 2; - }; - prototype.checkOutdent = function(state, line, input){ - var ref$; - return (ref$ = this.$outdent) != null ? ref$.checkOutdent(line, input) : void 8; - }; - prototype.autoOutdent = function(state, doc, row){ - var ref$; - return (ref$ = this.$outdent) != null ? ref$.autoOutdent(doc, row) : void 8; - }; - return LiveScriptMode; - }(require('../mode/text').Mode)); - keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))'; - stringfill = { - token: 'string', - regex: '.+' - }; - LiveScriptMode.Rules = { - start: [ - { - token: 'keyword', - regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend - }, { - token: 'constant.language', - regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend - }, { - token: 'invalid.illegal', - regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend - }, { - token: 'language.support.class', - regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend - }, { - token: 'language.support.function', - regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend - }, { - token: 'variable.language', - regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend - }, { - token: 'identifier', - regex: identifier + '\\s*:(?![:=])' - }, { - token: 'variable', - regex: identifier - }, { - token: 'keyword.operator', - regex: '(?:\\.{3}|\\s+\\?)' - }, { - token: 'keyword.variable', - regex: '(?:@+|::|\\.\\.)', - next: 'key' - }, { - token: 'keyword.operator', - regex: '\\.\\s*', - next: 'key' - }, { - token: 'string', - regex: '\\\\\\S[^\\s,;)}\\]]*' - }, { - token: 'string.doc', - regex: '\'\'\'', - next: 'qdoc' - }, { - token: 'string.doc', - regex: '"""', - next: 'qqdoc' - }, { - token: 'string', - regex: '\'', - next: 'qstring' - }, { - token: 'string', - regex: '"', - next: 'qqstring' - }, { - token: 'string', - regex: '`', - next: 'js' - }, { - token: 'string', - regex: '<\\[', - next: 'words' - }, { - token: 'string.regex', - regex: '//', - next: 'heregex' - }, { - token: 'comment.doc', - regex: '/\\*', - next: 'comment' - }, { - token: 'comment', - regex: '#.*' - }, { - token: 'string.regex', - regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}', - next: 'key' - }, { - token: 'constant.numeric', - regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)' - }, { - token: 'lparen', - regex: '[({[]' - }, { - token: 'rparen', - regex: '[)}\\]]', - next: 'key' - }, { - token: 'keyword.operator', - regex: '\\S+' - }, { - token: 'text', - regex: '\\s+' - } - ], - heregex: [ - { - token: 'string.regex', - regex: '.*?//[gimy$?]{0,4}', - next: 'start' - }, { - token: 'string.regex', - regex: '\\s*#{' - }, { - token: 'comment.regex', - regex: '\\s+(?:#.*)?' - }, { - token: 'string.regex', - regex: '\\S+' - } - ], - key: [ - { - token: 'keyword.operator', - regex: '[.?@!]+' - }, { - token: 'identifier', - regex: identifier, - next: 'start' - }, { - token: 'text', - regex: '.', - next: 'start' - } - ], - comment: [ - { - token: 'comment.doc', - regex: '.*?\\*/', - next: 'start' - }, { - token: 'comment.doc', - regex: '.+' - } - ], - qdoc: [ - { - token: 'string', - regex: ".*?'''", - next: 'key' - }, stringfill - ], - qqdoc: [ - { - token: 'string', - regex: '.*?"""', - next: 'key' - }, stringfill - ], - qstring: [ - { - token: 'string', - regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'', - next: 'key' - }, stringfill - ], - qqstring: [ - { - token: 'string', - regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', - next: 'key' - }, stringfill - ], - js: [ - { - token: 'string', - regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`', - next: 'key' - }, stringfill - ], - words: [ - { - token: 'string', - regex: '.*?\\]>', - next: 'key' - }, stringfill - ] - }; -function extend$(sub, sup){ - function fun(){} fun.prototype = (sub.superclass = sup).prototype; - (sub.prototype = new fun).constructor = sub; - if (typeof sup.extended == 'function') sup.extended(sub); - return sub; -} -function import$(obj, src){ - var own = {}.hasOwnProperty; - for (var key in src) if (own.call(src, key)) obj[key] = src[key]; - return obj; -} -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-logiql.js b/util/build-sample-browser/player/vendor/ace/mode-logiql.js deleted file mode 100644 index df4141e1c2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-logiql.js +++ /dev/null @@ -1,699 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/logiql', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/logiql_highlight_rules', 'ace/mode/folding/coffee', 'ace/token_iterator', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/matching_brace_outdent'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var LogiQLHighlightRules = require("./logiql_highlight_rules").LogiQLHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; -var TokenIterator = require("../token_iterator").TokenIterator; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; - -var Mode = function() { - this.HighlightRules = LogiQLHighlightRules; - this.foldingRules = new FoldMode(); - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - if (/comment|string/.test(endState)) - return indent; - if (tokens.length && tokens[tokens.length - 1].type == "comment.single") - return indent; - - var match = line.match(); - if (/(-->|<--|<-|->|{)\s*$/.test(line)) - indent += tab; - return indent; - }; - - this.checkOutdent = function(state, line, input) { - if (this.$outdent.checkOutdent(line, input)) - return true; - - if (input !== "\n" && input !== "\r\n") - return false; - - if (!/^\s+/.test(line)) - return false; - - return true; - }; - - this.autoOutdent = function(state, doc, row) { - if (this.$outdent.autoOutdent(doc, row)) - return; - var prevLine = doc.getLine(row); - var match = prevLine.match(/^\s+/); - var column = prevLine.lastIndexOf(".") + 1; - if (!match || !row || !column) return 0; - - var line = doc.getLine(row + 1); - var startRange = this.getMatching(doc, {row: row, column: column}); - if (!startRange || startRange.start.row == row) return 0; - - column = match[0].length; - var indent = this.$getIndent(doc.getLine(startRange.start.row)); - doc.replace(new Range(row + 1, 0, row + 1, column), indent); - }; - - this.getMatching = function(session, row, column) { - if (row == undefined) - row = session.selection.lead - if (typeof row == "object") { - column = row.column; - row = row.row; - } - - var startToken = session.getTokenAt(row, column); - var KW_START = "keyword.start", KW_END = "keyword.end"; - var tok; - if (!startToken) - return; - if (startToken.type == KW_START) { - var it = new TokenIterator(session, row, column); - it.step = it.stepForward; - } else if (startToken.type == KW_END) { - var it = new TokenIterator(session, row, column); - it.step = it.stepBackward; - } else - return; - - while (tok = it.step()) { - if (tok.type == KW_START || tok.type == KW_END) - break; - } - if (!tok || tok.type == startToken.type) - return; - - var col = it.getCurrentTokenColumn(); - var row = it.getCurrentTokenRow(); - return new Range(row, col, row, col + tok.value.length); - }; - this.$id = "ace/mode/logiql"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/logiql_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LogiQLHighlightRules = function() { - - this.$rules = { start: - [ { token: 'comment.block', - regex: '/\\*', - push: - [ { token: 'comment.block', regex: '\\*/', next: 'pop' }, - { defaultToken: 'comment.block' } ], - }, - { token: 'comment.single', - regex: '//.*', - }, - { token: 'constant.numeric', - regex: '\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fd]?', - }, - { token: 'string', - regex: '"', - push: - [ { token: 'string', regex: '"', next: 'pop' }, - { defaultToken: 'string' } ], - }, - { token: 'constant.language', - regex: '\\b(true|false)\\b', - }, - { token: 'entity.name.type.logicblox', - regex: '`[a-zA-Z_:]+(\\d|\\a)*\\b', - }, - { token: 'keyword.start', regex: '->', comment: 'Constraint' }, - { token: 'keyword.start', regex: '-->', comment: 'Level 1 Constraint'}, - { token: 'keyword.start', regex: '<-', comment: 'Rule' }, - { token: 'keyword.start', regex: '<--', comment: 'Level 1 Rule' }, - { token: 'keyword.end', regex: '\\.', comment: 'Terminator' }, - { token: 'keyword.other', regex: '!', comment: 'Negation' }, - { token: 'keyword.other', regex: ',', comment: 'Conjunction' }, - { token: 'keyword.other', regex: ';', comment: 'Disjunction' }, - { token: 'keyword.operator', regex: '<=|>=|!=|<|>', comment: 'Equality'}, - { token: 'keyword.other', regex: '@', comment: 'Equality' }, - { token: 'keyword.operator', regex: '\\+|-|\\*|/', comment: 'Arithmetic operations'}, - { token: 'keyword', regex: '::', comment: 'Colon colon' }, - { token: 'support.function', - regex: '\\b(agg\\s*<<)', - push: - [ { include: '$self' }, - { token: 'support.function', - regex: '>>', - next: 'pop' } ], - }, - { token: 'storage.modifier', - regex: '\\b(lang:[\\w:]*)', - }, - { token: [ 'storage.type', 'text' ], - regex: '(export|sealed|clauses|block|alias|alias_all)(\\s*\\()(?=`)', - }, - { token: 'entity.name', - regex: '[a-zA-Z_][a-zA-Z_0-9:]*(@prev|@init|@final)?(?=(\\(|\\[))', - }, - { token: 'variable.parameter', - regex: '([a-zA-Z][a-zA-Z_0-9]*|_)\\s*(?=(,|\\.|<-|->|\\)|\\]|=))', - } ] } - - this.normalizeRules(); -}; - -oop.inherits(LogiQLHighlightRules, TextHighlightRules); - -exports.LogiQLHighlightRules = LogiQLHighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-lsl.js b/util/build-sample-browser/player/vendor/ace/mode-lsl.js deleted file mode 100644 index 8fb33657c7..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-lsl.js +++ /dev/null @@ -1,920 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/lsl', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/lsl_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/text', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/lib/oop'], function(require, exports, module) { - - -var Tokenizer = require("../tokenizer").Tokenizer; -var Rules = require("./lsl_highlight_rules").LSLHighlightRules; -var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var TextMode = require("./text").Mode; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; -var oop = require("../lib/oop"); - -var Mode = function() { - this.HighlightRules = Rules; - this.$outdent = new Outdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ["//"]; - - this.blockComment = { - start: "/*", - end: "*/" - }; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type === "comment.block.lsl") { - return indent; - } - - if (state === "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/lsl"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/lsl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -oop.inherits(LSLHighlightRules, TextHighlightRules); - -function LSLHighlightRules() { - var keywordMapper = this.createKeywordMapper({ - "constant.language.float.lsl" : "DEG_TO_RAD|PI|PI_BY_TWO|RAD_TO_DEG|SQRT2|TWO_PI", - "constant.language.integer.lsl": "ACTIVE|AGENT|AGENT_ALWAYS_RUN|AGENT_ATTACHMENTS|" + - "AGENT_AUTOPILOT|AGENT_AWAY|AGENT_BUSY|AGENT_BY_LEGACY_NAME|AGENT_BY_USERNAME|" + - "AGENT_CROUCHING|AGENT_FLYING|AGENT_IN_AIR|AGENT_LIST_PARCEL|AGENT_LIST_PARCEL_OWNER|" + - "AGENT_LIST_REGION|AGENT_MOUSELOOK|AGENT_ON_OBJECT|AGENT_SCRIPTED|AGENT_SITTING|" + - "AGENT_TYPING|AGENT_WALKING|ALL_SIDES|ANIM_ON|ATTACH_AVATAR_CENTER|ATTACH_BACK|" + - "ATTACH_BELLY|ATTACH_CHEST|ATTACH_CHIN|ATTACH_HEAD|ATTACH_HUD_BOTTOM|" + - "ATTACH_HUD_BOTTOM_LEFT|ATTACH_HUD_BOTTOM_RIGHT|ATTACH_HUD_CENTER_1|ATTACH_HUD_CENTER_2|" + - "ATTACH_HUD_TOP_CENTER|ATTACH_HUD_TOP_LEFT|ATTACH_HUD_TOP_RIGHT|ATTACH_LEAR|" + - "ATTACH_LEFT_PEC|ATTACH_LEYE|ATTACH_LFOOT|ATTACH_LHAND|ATTACH_LHIP|ATTACH_LLARM|" + - "ATTACH_LLLEG|ATTACH_LSHOULDER|ATTACH_LUARM|ATTACH_LULEG|ATTACH_MOUTH|" + - "ATTACH_NECK|ATTACH_NOSE|ATTACH_PELVIS|ATTACH_REAR|ATTACH_REYE|ATTACH_RFOOT|" + - "ATTACH_RHAND|ATTACH_RHIP|ATTACH_RIGHT_PEC|ATTACH_RLARM|ATTACH_RLLEG|" + - "ATTACH_RSHOULDER|ATTACH_RUARM|ATTACH_RULEG|AVOID_CHARACTERS|AVOID_DYNAMIC_OBSTACLES|" + - "AVOID_NONE|CAMERA_ACTIVE|CAMERA_BEHINDNESS_ANGLE|CAMERA_BEHINDNESS_LAG|" + - "CAMERA_DISTANCE|CAMERA_FOCUS|CAMERA_FOCUS_LAG|CAMERA_FOCUS_LOCKED|CAMERA_FOCUS_OFFSET|" + - "CAMERA_FOCUS_THRESHOLD|CAMERA_PITCH|CAMERA_POSITION|CAMERA_POSITION_LAG|" + - "CAMERA_POSITION_LOCKED|CAMERA_POSITION_THRESHOLD|CHANGED_ALLOWED_DROP|" + - "CHANGED_COLOR|CHANGED_INVENTORY|CHANGED_LINK|CHANGED_MEDIA|CHANGED_OWNER|" + - "CHANGED_REGION|CHANGED_REGION_START|CHANGED_SCALE|CHANGED_SHAPE|CHANGED_TELEPORT|" + - "CHANGED_TEXTURE|CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES|CHARACTER_AVOIDANCE_MODE|" + - "CHARACTER_CMD_JUMP|CHARACTER_CMD_SMOOTH_STOP|CHARACTER_CMD_STOP|CHARACTER_DESIRED_SPEED|" + - "CHARACTER_DESIRED_TURN_SPEED|CHARACTER_LENGTH|CHARACTER_MAX_ACCEL|CHARACTER_MAX_DECEL|" + - "CHARACTER_MAX_SPEED|CHARACTER_MAX_TURN_RADIUS|CHARACTER_ORIENTATION|" + - "CHARACTER_RADIUS|CHARACTER_STAY_WITHIN_PARCEL|CHARACTER_TYPE|CHARACTER_TYPE_A|" + - "CHARACTER_TYPE_B|CHARACTER_TYPE_C|CHARACTER_TYPE_D|CHARACTER_TYPE_NONE|" + - "CLICK_ACTION_BUY|CLICK_ACTION_NONE|CLICK_ACTION_OPEN|CLICK_ACTION_OPEN_MEDIA|" + - "CLICK_ACTION_PAY|CLICK_ACTION_PLAY|CLICK_ACTION_SIT|CLICK_ACTION_TOUCH|" + - "CONTENT_TYPE_ATOM|CONTENT_TYPE_FORM|CONTENT_TYPE_HTML|CONTENT_TYPE_JSON|" + - "CONTENT_TYPE_LLSD|CONTENT_TYPE_RSS|CONTENT_TYPE_TEXT|CONTENT_TYPE_XHTML|" + - "CONTENT_TYPE_XML|CONTROL_BACK|CONTROL_DOWN|CONTROL_FWD|CONTROL_LBUTTON|" + - "CONTROL_LEFT|CONTROL_ML_LBUTTON|CONTROL_RIGHT|CONTROL_ROT_LEFT|CONTROL_ROT_RIGHT|" + - "CONTROL_UP|DATA_BORN|DATA_NAME|DATA_ONLINE|DATA_PAYINFO|DATA_SIM_POS|" + - "DATA_SIM_RATING|DATA_SIM_STATUS|DEBUG_CHANNEL|DENSITY|ERR_GENERIC|ERR_MALFORMED_PARAMS|" + - "ERR_PARCEL_PERMISSIONS|ERR_RUNTIME_PERMISSIONS|ERR_THROTTLED|ESTATE_ACCESS_ALLOWED_AGENT_ADD|" + - "ESTATE_ACCESS_ALLOWED_AGENT_REMOVE|ESTATE_ACCESS_ALLOWED_GROUP_ADD|ESTATE_ACCESS_ALLOWED_GROUP_REMOVE|" + - "ESTATE_ACCESS_BANNED_AGENT_ADD|ESTATE_ACCESS_BANNED_AGENT_REMOVE|FORCE_DIRECT_PATH|" + - "FRICTION|GCNP_RADIUS|GCNP_STATIC|GRAVITY_MULTIPLIER|HORIZONTAL|HTTP_BODY_MAXLENGTH|" + - "HTTP_BODY_TRUNCATED|HTTP_CUSTOM_HEADER|HTTP_METHOD|HTTP_MIMETYPE|HTTP_PRAGMA_NO_CACHE|" + - "HTTP_VERBOSE_THROTTLE|HTTP_VERIFY_CERT|INVENTORY_ALL|INVENTORY_ANIMATION|" + - "INVENTORY_BODYPART|INVENTORY_CLOTHING|INVENTORY_GESTURE|INVENTORY_LANDMARK|" + - "INVENTORY_NONE|INVENTORY_NOTECARD|INVENTORY_OBJECT|INVENTORY_SCRIPT|" + - "INVENTORY_SOUND|INVENTORY_TEXTURE|JSON_APPEND|KFM_CMD_PAUSE|KFM_CMD_PLAY|" + - "KFM_CMD_SET_MODE|KFM_CMD_STOP|KFM_COMMAND|KFM_DATA|KFM_FORWARD|KFM_LOOP|" + - "KFM_MODE|KFM_PING_PONG|KFM_REVERSE|KFM_ROTATION|KFM_TRANSLATION|LAND_LEVEL|" + - "LAND_LOWER|LAND_NOISE|LAND_RAISE|LAND_REVERT|LAND_SMOOTH|LINK_ALL_CHILDREN|" + - "LINK_ALL_OTHERS|LINK_ROOT|LINK_SET|LINK_THIS|LIST_STAT_GEOMETRIC_MEAN|" + - "LIST_STAT_MAX|LIST_STAT_MEAN|LIST_STAT_MEDIAN|LIST_STAT_MIN|LIST_STAT_NUM_COUNT|" + - "LIST_STAT_RANGE|LIST_STAT_STD_DEV|LIST_STAT_SUM|LIST_STAT_SUM_SQUARES|" + - "LOOP|MASK_BASE|MASK_EVERYONE|MASK_GROUP|MASK_NEXT|MASK_OWNER|OBJECT_ATTACHED_POINT|" + - "OBJECT_CHARACTER_TIME|OBJECT_CREATOR|OBJECT_DESC|OBJECT_GROUP|OBJECT_NAME|" + - "OBJECT_OWNER|OBJECT_PATHFINDING_TYPE|OBJECT_PHANTOM|OBJECT_PHYSICS|OBJECT_PHYSICS_COST|" + - "OBJECT_POS|OBJECT_PRIM_EQUIVALENCE|OBJECT_RETURN_PARCEL|OBJECT_RETURN_PARCEL_OWNER|" + - "OBJECT_RETURN_REGION|OBJECT_ROOT|OBJECT_ROT|OBJECT_RUNNING_SCRIPT_COUNT|" + - "OBJECT_SCRIPT_MEMORY|OBJECT_SCRIPT_TIME|OBJECT_SERVER_COST|OBJECT_STREAMING_COST|" + - "OBJECT_TEMP_ON_REZ|OBJECT_TOTAL_SCRIPT_COUNT|OBJECT_UNKNOWN_DETAIL|OBJECT_VELOCITY|" + - "OPT_AVATAR|OPT_CHARACTER|OPT_EXCLUSION_VOLUME|OPT_LEGACY_LINKSET|OPT_MATERIAL_VOLUME|" + - "OPT_OTHER|OPT_STATIC_OBSTACLE|OPT_WALKABLE|PARCEL_COUNT_GROUP|PARCEL_COUNT_OTHER|" + - "PARCEL_COUNT_OWNER|PARCEL_COUNT_SELECTED|PARCEL_COUNT_TEMP|PARCEL_COUNT_TOTAL|" + - "PARCEL_DETAILS_AREA|PARCEL_DETAILS_DESC|PARCEL_DETAILS_GROUP|PARCEL_DETAILS_ID|" + - "PARCEL_DETAILS_NAME|PARCEL_DETAILS_OWNER|PARCEL_DETAILS_SEE_AVATARS|" + - "PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS|" + - "PARCEL_FLAG_ALLOW_CREATE_OBJECTS|PARCEL_FLAG_ALLOW_DAMAGE|PARCEL_FLAG_ALLOW_FLY|" + - "PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_GROUP_SCRIPTS|" + - "PARCEL_FLAG_ALLOW_LANDMARK|PARCEL_FLAG_ALLOW_SCRIPTS|PARCEL_FLAG_ALLOW_TERRAFORM|" + - "PARCEL_FLAG_LOCAL_SOUND_ONLY|PARCEL_FLAG_RESTRICT_PUSHOBJECT|PARCEL_FLAG_USE_ACCESS_GROUP|" + - "PARCEL_FLAG_USE_ACCESS_LIST|PARCEL_FLAG_USE_BAN_LIST|PARCEL_FLAG_USE_LAND_PASS_LIST|" + - "PARCEL_MEDIA_COMMAND_AGENT|PARCEL_MEDIA_COMMAND_AUTO_ALIGN|PARCEL_MEDIA_COMMAND_DESC|" + - "PARCEL_MEDIA_COMMAND_LOOP|PARCEL_MEDIA_COMMAND_LOOP_SET|PARCEL_MEDIA_COMMAND_PAUSE|" + - "PARCEL_MEDIA_COMMAND_PLAY|PARCEL_MEDIA_COMMAND_SIZE|PARCEL_MEDIA_COMMAND_STOP|" + - "PARCEL_MEDIA_COMMAND_TEXTURE|PARCEL_MEDIA_COMMAND_TIME|PARCEL_MEDIA_COMMAND_TYPE|" + - "PARCEL_MEDIA_COMMAND_UNLOAD|PARCEL_MEDIA_COMMAND_URL|PASSIVE|PATROL_PAUSE_AT_WAYPOINTS|" + - "PAY_DEFAULT|PAY_HIDE|PAYMENT_INFO_ON_FILE|PAYMENT_INFO_USED|PERM_ALL|" + - "PERM_COPY|PERM_MODIFY|PERM_MOVE|PERM_TRANSFER|PERMISSION_ATTACH|PERMISSION_CHANGE_LINKS|" + - "PERMISSION_CONTROL_CAMERA|PERMISSION_DEBIT|PERMISSION_OVERRIDE_ANIMATIONS|" + - "PERMISSION_RETURN_OBJECTS|PERMISSION_SILENT_ESTATE_MANAGEMENT|PERMISSION_TAKE_CONTROLS|" + - "PERMISSION_TELEPORT|PERMISSION_TRACK_CAMERA|PERMISSION_TRIGGER_ANIMATION|" + - "PING_PONG|PRIM_BUMP_BARK|PRIM_BUMP_BLOBS|PRIM_BUMP_BRICKS|PRIM_BUMP_BRIGHT|" + - "PRIM_BUMP_CHECKER|PRIM_BUMP_CONCRETE|PRIM_BUMP_DARK|PRIM_BUMP_DISKS|" + - "PRIM_BUMP_GRAVEL|PRIM_BUMP_LARGETILE|PRIM_BUMP_NONE|PRIM_BUMP_SHINY|" + - "PRIM_BUMP_SIDING|PRIM_BUMP_STONE|PRIM_BUMP_STUCCO|PRIM_BUMP_SUCTION|" + - "PRIM_BUMP_TILE|PRIM_BUMP_WEAVE|PRIM_BUMP_WOOD|PRIM_COLOR|PRIM_DESC|PRIM_FLEXIBLE|" + - "PRIM_FULLBRIGHT|PRIM_GLOW|PRIM_HOLE_CIRCLE|PRIM_HOLE_DEFAULT|PRIM_HOLE_SQUARE|" + - "PRIM_HOLE_TRIANGLE|PRIM_LINK_TARGET|PRIM_MATERIAL|PRIM_MATERIAL_FLESH|" + - "PRIM_MATERIAL_GLASS|PRIM_MATERIAL_METAL|PRIM_MATERIAL_PLASTIC|PRIM_MATERIAL_RUBBER|" + - "PRIM_MATERIAL_STONE|PRIM_MATERIAL_WOOD|PRIM_MEDIA_ALT_IMAGE_ENABLE|PRIM_MEDIA_AUTO_LOOP|" + - "PRIM_MEDIA_AUTO_PLAY|PRIM_MEDIA_AUTO_SCALE|PRIM_MEDIA_AUTO_ZOOM|PRIM_MEDIA_CONTROLS|" + - "PRIM_MEDIA_CONTROLS_MINI|PRIM_MEDIA_CONTROLS_STANDARD|PRIM_MEDIA_CURRENT_URL|" + - "PRIM_MEDIA_FIRST_CLICK_INTERACT|PRIM_MEDIA_HEIGHT_PIXELS|PRIM_MEDIA_HOME_URL|" + - "PRIM_MEDIA_MAX_HEIGHT_PIXELS|PRIM_MEDIA_MAX_URL_LENGTH|PRIM_MEDIA_MAX_WHITELIST_COUNT|" + - "PRIM_MEDIA_MAX_WHITELIST_SIZE|PRIM_MEDIA_MAX_WIDTH_PIXELS|PRIM_MEDIA_PARAM_MAX|" + - "PRIM_MEDIA_PERM_ANYONE|PRIM_MEDIA_PERM_GROUP|PRIM_MEDIA_PERM_NONE|PRIM_MEDIA_PERM_OWNER|" + - "PRIM_MEDIA_PERMS_CONTROL|PRIM_MEDIA_PERMS_INTERACT|PRIM_MEDIA_WHITELIST|" + - "PRIM_MEDIA_WHITELIST_ENABLE|PRIM_MEDIA_WIDTH_PIXELS|PRIM_NAME|PRIM_OMEGA|" + - "PRIM_PHANTOM|PRIM_PHYSICS|PRIM_PHYSICS_SHAPE_CONVEX|PRIM_PHYSICS_SHAPE_NONE|" + - "PRIM_PHYSICS_SHAPE_PRIM|PRIM_PHYSICS_SHAPE_TYPE|PRIM_POINT_LIGHT|PRIM_POS_LOCAL|" + - "PRIM_POSITION|PRIM_ROT_LOCAL|PRIM_ROTATION|PRIM_SCULPT_FLAG_INVERT|PRIM_SCULPT_FLAG_MIRROR|" + - "PRIM_SCULPT_TYPE_CYLINDER|PRIM_SCULPT_TYPE_MASK|PRIM_SCULPT_TYPE_PLANE|" + - "PRIM_SCULPT_TYPE_SPHERE|PRIM_SCULPT_TYPE_TORUS|PRIM_SHINY_HIGH|PRIM_SHINY_LOW|" + - "PRIM_SHINY_MEDIUM|PRIM_SHINY_NONE|PRIM_SIZE|PRIM_SLICE|PRIM_TEMP_ON_REZ|" + - "PRIM_TEXGEN|PRIM_TEXGEN_DEFAULT|PRIM_TEXGEN_PLANAR|PRIM_TEXT|PRIM_TEXTURE|" + - "PRIM_TYPE|PRIM_TYPE_BOX|PRIM_TYPE_CYLINDER|PRIM_TYPE_PRISM|PRIM_TYPE_RING|" + - "PRIM_TYPE_SCULPT|PRIM_TYPE_SPHERE|PRIM_TYPE_TORUS|PRIM_TYPE_TUBE|PROFILE_NONE|" + - "PROFILE_SCRIPT_MEMORY|PSYS_PART_BOUNCE_MASK|PSYS_PART_EMISSIVE_MASK|" + - "PSYS_PART_END_ALPHA|PSYS_PART_END_COLOR|PSYS_PART_END_SCALE|PSYS_PART_FLAGS|" + - "PSYS_PART_FOLLOW_SRC_MASK|PSYS_PART_FOLLOW_VELOCITY_MASK|PSYS_PART_INTERP_COLOR_MASK|" + - "PSYS_PART_INTERP_SCALE_MASK|PSYS_PART_MAX_AGE|PSYS_PART_START_ALPHA|" + - "PSYS_PART_START_COLOR|PSYS_PART_START_SCALE|PSYS_PART_TARGET_LINEAR_MASK|" + - "PSYS_PART_TARGET_POS_MASK|PSYS_PART_WIND_MASK|PSYS_SRC_ACCEL|PSYS_SRC_ANGLE_BEGIN|" + - "PSYS_SRC_ANGLE_END|PSYS_SRC_BURST_PART_COUNT|PSYS_SRC_BURST_RADIUS|PSYS_SRC_BURST_RATE|" + - "PSYS_SRC_BURST_SPEED_MAX|PSYS_SRC_BURST_SPEED_MIN|PSYS_SRC_MAX_AGE|PSYS_SRC_OMEGA|" + - "PSYS_SRC_PATTERN|PSYS_SRC_PATTERN_ANGLE|PSYS_SRC_PATTERN_ANGLE_CONE|" + - "PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY|PSYS_SRC_PATTERN_DROP|PSYS_SRC_PATTERN_EXPLODE|" + - "PSYS_SRC_TARGET_KEY|PSYS_SRC_TEXTURE|PU_EVADE_HIDDEN|PU_EVADE_SPOTTED|" + - "PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED|PU_FAILURE_INVALID_GOAL|PU_FAILURE_INVALID_START|" + - "PU_FAILURE_NO_NAVMESH|PU_FAILURE_NO_VALID_DESTINATION|PU_FAILURE_OTHER|" + - "PU_FAILURE_PARCEL_UNREACHABLE|PU_FAILURE_TARGET_GONE|PU_FAILURE_UNREACHABLE|" + - "PU_GOAL_REACHED|PU_SLOWDOWN_DISTANCE_REACHED|PUBLIC_CHANNEL|PURSUIT_FUZZ_FACTOR|" + - "PURSUIT_GOAL_TOLERANCE|PURSUIT_INTERCEPT|PURSUIT_OFFSET|RC_DATA_FLAGS|" + - "RC_DETECT_PHANTOM|RC_GET_LINK_NUM|RC_GET_NORMAL|RC_GET_ROOT_KEY|RC_MAX_HITS|" + - "RC_REJECT_AGENTS|RC_REJECT_LAND|RC_REJECT_NONPHYSICAL|RC_REJECT_PHYSICAL|" + - "RC_REJECT_TYPES|RCERR_CAST_TIME_EXCEEDED|RCERR_SIM_PERF_LOW|RCERR_UNKNOWN|" + - "REGION_FLAG_ALLOW_DAMAGE|REGION_FLAG_ALLOW_DIRECT_TELEPORT|REGION_FLAG_BLOCK_FLY|" + - "REGION_FLAG_BLOCK_TERRAFORM|REGION_FLAG_DISABLE_COLLISIONS|REGION_FLAG_DISABLE_PHYSICS|" + - "REGION_FLAG_FIXED_SUN|REGION_FLAG_RESTRICT_PUSHOBJECT|REGION_FLAG_SANDBOX|" + - "REMOTE_DATA_CHANNEL|REMOTE_DATA_REPLY|REMOTE_DATA_REQUEST|REQUIRE_LINE_OF_SIGHT|" + - "RESTITUTION|REVERSE|ROTATE|SCALE|SCRIPTED|SIM_STAT_PCT_CHARS_STEPPED|" + - "SMOOTH|STATUS_BLOCK_GRAB|STATUS_BLOCK_GRAB_OBJECT|STATUS_BOUNDS_ERROR|" + - "STATUS_CAST_SHADOWS|STATUS_DIE_AT_EDGE|STATUS_INTERNAL_ERROR|STATUS_MALFORMED_PARAMS|" + - "STATUS_NOT_FOUND|STATUS_NOT_SUPPORTED|STATUS_OK|STATUS_PHANTOM|STATUS_PHYSICS|" + - "STATUS_RETURN_AT_EDGE|STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z|" + - "STATUS_SANDBOX|STATUS_TYPE_MISMATCH|STATUS_WHITELIST_FAILED|STRING_TRIM|" + - "STRING_TRIM_HEAD|STRING_TRIM_TAIL|TOUCH_INVALID_FACE|TRAVERSAL_TYPE|" + - "TRAVERSAL_TYPE_FAST|TRAVERSAL_TYPE_NONE|TRAVERSAL_TYPE_SLOW|TYPE_FLOAT|" + - "TYPE_INTEGER|TYPE_INVALID|TYPE_KEY|TYPE_ROTATION|TYPE_STRING|TYPE_VECTOR|" + - "VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY|VEHICLE_ANGULAR_DEFLECTION_TIMESCALE|" + - "VEHICLE_ANGULAR_FRICTION_TIMESCALE|VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE|" + - "VEHICLE_ANGULAR_MOTOR_DIRECTION|VEHICLE_ANGULAR_MOTOR_TIMESCALE|VEHICLE_BANKING_EFFICIENCY|" + - "VEHICLE_BANKING_MIX|VEHICLE_BANKING_TIMESCALE|VEHICLE_BUOYANCY|VEHICLE_FLAG_CAMERA_DECOUPLED|" + - "VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT|VEHICLE_FLAG_HOVER_TERRAIN_ONLY|VEHICLE_FLAG_HOVER_UP_ONLY|" + - "VEHICLE_FLAG_HOVER_WATER_ONLY|VEHICLE_FLAG_LIMIT_MOTOR_UP|VEHICLE_FLAG_LIMIT_ROLL_ONLY|" + - "VEHICLE_FLAG_MOUSELOOK_BANK|VEHICLE_FLAG_MOUSELOOK_STEER|VEHICLE_FLAG_NO_DEFLECTION_UP|" + - "VEHICLE_HOVER_EFFICIENCY|VEHICLE_HOVER_HEIGHT|VEHICLE_HOVER_TIMESCALE|" + - "VEHICLE_LINEAR_DEFLECTION_EFFICIENCY|VEHICLE_LINEAR_DEFLECTION_TIMESCALE|" + - "VEHICLE_LINEAR_FRICTION_TIMESCALE|VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE|" + - "VEHICLE_LINEAR_MOTOR_DIRECTION|VEHICLE_LINEAR_MOTOR_OFFSET|VEHICLE_LINEAR_MOTOR_TIMESCALE|" + - "VEHICLE_REFERENCE_FRAME|VEHICLE_TYPE_AIRPLANE|VEHICLE_TYPE_BALLOON|VEHICLE_TYPE_BOAT|" + - "VEHICLE_TYPE_CAR|VEHICLE_TYPE_NONE|VEHICLE_TYPE_SLED|VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY|" + - "VEHICLE_VERTICAL_ATTRACTION_TIMESCALE|VERTICAL|WANDER_PAUSE_AT_WAYPOINTS", - "constant.language.integer.boolean.lsl" : "FALSE|TRUE", - "constant.language.quaternion.lsl" : "ZERO_ROTATION", - "constant.language.string.lsl" : "EOF|JSON_ARRAY|JSON_FALSE|JSON_INVALID|" + - "JSON_NULL|JSON_NUMBER|JSON_OBJECT|JSON_STRING|JSON_TRUE|NULL_KEY|" + - "TEXTURE_BLANK|TEXTURE_DEFAULT|TEXTURE_MEDIA|TEXTURE_PLYWOOD|" + - "TEXTURE_TRANSPARENT|URL_REQUEST_DENIED|URL_REQUEST_GRANTED", - "constant.language.vector.lsl" : "TOUCH_INVALID_TEXCOORD|TOUCH_INVALID_VECTOR|ZERO_VECTOR", - "invalid.broken.lsl": "LAND_LARGE_BRUSH|LAND_MEDIUM_BRUSH|LAND_SMALL_BRUSH", - "invalid.deprecated.lsl" : "ATTACH_LPEC|ATTACH_RPEC|CHARACTER_MAX_ANGULAR_ACCEL|" + - "CHARACTER_MAX_ANGULAR_SPEED|CHARACTER_TURN_SPEED_MULTIPLIER|DATA_RATING|" + - "PRIM_CAST_SHADOWS|PRIM_MATERIAL_LIGHT|PRIM_PHYSICS_MATERIAL|PRIM_TYPE_LEGACY|" + - "PSYS_SRC_INNERANGLE|PSYS_SRC_OUTERANGLE|VEHICLE_FLAG_NO_FLY_UP|llCloud|" + - "llGodLikeRezObject|llMakeExplosion|llMakeFire|llMakeFountain|llMakeSmoke|" + - "llRemoteDataSetRegion|llSetInventoryPermMask|llSetObjectPermMask|llSound|" + - "llSoundPreload|llXorBase64Strings|llXorBase64StringsCorrect", - "invalid.godmode.lsl": "llGodLikeRezObject|llSetInventoryPermMask|llSetObjectPermMask", - "invalid.illegal.lsl" : "print", - "invalid.unimplemented.lsl": "CHARACTER_MAX_ANGULAR_ACCEL|CHARACTER_MAX_ANGULAR_SPEED|" + - "CHARACTER_TURN_SPEED_MULTIPLIER|PERMISSION_CHANGE_JOINTS|PERMISSION_CHANGE_PERMISSIONS|" + - "PERMISSION_RELEASE_OWNERSHIP|PERMISSION_REMAP_CONTROLS|PRIM_PHYSICS_MATERIAL|PRIM_TYPE_LEGACY|" + - "PSYS_SRC_OBJ_REL_MASK|event|llCollisionSprite|llPointAt|llRefreshPrimURL|" + - "llReleaseCamera|llRemoteLoadScript|llSetPrimURL|llStopPointAt|llTakeCamera", - "keyword.control.lsl" : "do|else|for|if|jump|return|while", - "storage.type.lsl" : "float|integer|key|list|quaternion|rotation|string|vector", - "support.function.lsl": "llAbs|llAcos|llAddToLandBanList|llAddToLandPassList|" + - "llAdjustSoundVolume|llAllowInventoryDrop|llAngleBetween|llApplyImpulse|" + - "llApplyRotationalImpulse|llAsin|llAtan2|llAttachToAvatar|llAttachToAvatarTemp|" + - "llAvatarOnLinkSitTarget|llAvatarOnSitTarget|llAxes2Rot|llAxisAngle2Rot|" + - "llBase64ToInteger|llBase64ToString|llBreakAllLinks|llBreakLink|llCastRay|" + - "llCeil|llClearCameraParams|llClearLinkMedia|llClearPrimMedia|llCloseRemoteDataChannel|" + - "llCollisionFilter|llCollisionSound|llCos|llCreateCharacter|llCreateLink|" + - "llCSV2List|llDeleteCharacter|llDeleteSubList|llDeleteSubString|llDetachFromAvatar|" + - "llDetectedGrab|llDetectedGroup|llDetectedKey|llDetectedLinkNumber|llDetectedName|" + - "llDetectedOwner|llDetectedPos|llDetectedRot|llDetectedTouchBinormal|" + - "llDetectedTouchFace|llDetectedTouchNormal|llDetectedTouchPos|llDetectedTouchST|" + - "llDetectedTouchUV|llDetectedType|llDetectedVel|llDialog|llDie|llDumpList2String|" + - "llEdgeOfWorld|llEjectFromLand|llEmail|llEscapeURL|llEuler2Rot|llExecCharacterCmd|" + - "llEvade|llFabs|llFleeFrom|llFloor|llForceMouselook|llFrand|llGenerateKey|" + - "llGetAccel|llGetAgentInfo|llGetAgentLanguage|llGetAgentList|llGetAgentSize|" + - "llGetAlpha|llGetAndResetTime|llGetAnimation|llGetAnimationList|llGetAnimationOverride|" + - "llGetAttached|llGetBoundingBox|llGetCameraPos|llGetCameraRot|llGetCenterOfMass|" + - "llGetClosestNavPoint|llGetColor|llGetCreator|llGetDate|llGetDisplayName|" + - "llGetEnergy|llGetEnv|llGetForce|llGetFreeMemory|llGetFreeURLs|llGetGeometricCenter|" + - "llGetGMTclock|llGetHTTPHeader|llGetInventoryCreator|llGetInventoryKey|llGetInventoryName|" + - "llGetInventoryNumber|llGetInventoryPermMask|llGetInventoryType|llGetKey|" + - "llGetLandOwnerAt|llGetLinkKey|llGetLinkMedia|llGetLinkName|llGetLinkNumber|" + - "llGetLinkNumberOfSides|llGetLinkPrimitiveParams|llGetListEntryType|llGetListLength|" + - "llGetLocalPos|llGetLocalRot|llGetMass|llGetMassMKS|llGetMemoryLimit|" + - "llGetNextEmail|llGetNotecardLine|llGetNumberOfNotecardLines|llGetNumberOfPrims|" + - "llGetNumberOfSides|llGetObjectDesc|llGetObjectDetails|llGetObjectMass|" + - "llGetObjectName|llGetObjectPermMask|llGetObjectPrimCount|llGetOmega|" + - "llGetOwner|llGetOwnerKey|llGetParcelDetails|llGetParcelFlags|llGetParcelMaxPrims|" + - "llGetParcelMusicURL|llGetParcelPrimCount|llGetParcelPrimOwners|llGetPermissions|" + - "llGetPermissionsKey|llGetPhysicsMaterial|llGetPos|llGetPrimitiveParams|" + - "llGetPrimMediaParams|llGetRegionAgentCount|llGetRegionCorner|llGetRegionFlags|" + - "llGetRegionFPS|llGetRegionName|llGetRegionTimeDilation|llGetRootPosition|" + - "llGetRootRotation|llGetRot|llGetScale|llGetScriptName|llGetScriptState|" + - "llGetSimStats|llGetSimulatorHostname|llGetSPMaxMemory|llGetStartParameter|" + - "llGetStaticPath|llGetStatus|llGetSubString|llGetSunDirection|llGetTexture|" + - "llGetTextureOffset|llGetTextureRot|llGetTextureScale|llGetTime|llGetTimeOfDay|" + - "llGetTimestamp|llGetTorque|llGetUnixTime|llGetUsedMemory|llGetUsername|" + - "llGetVel|llGetWallclock|llGiveInventory|llGiveInventoryList|llGiveMoney|" + - "llGround|llGroundContour|llGroundNormal|llGroundRepel|llGroundSlope|" + - "llHTTPRequest|llHTTPResponse|llInsertString|llInstantMessage|llIntegerToBase64|" + - "llJson2List|llJsonGetValue|llJsonSetValue|llJsonValueType|llKey2Name|" + - "llLinkParticleSystem|llLinkSitTarget|llList2CSV|llList2Float|llList2Integer|" + - "llList2Json|llList2Key|llList2List|llList2ListStrided|llList2Rot|" + - "llList2String|llList2Vector|llListen|llListenControl|llListenRemove|" + - "llListFindList|llListInsertList|llListRandomize|llListReplaceList|llListSort|" + - "llListStatistics|llLoadURL|llLog|llLog10|llLookAt|llLoopSound|llLoopSoundMaster|" + - "llLoopSoundSlave|llManageEstateAccess|llMapDestination|llMD5String|llMessageLinked|" + - "llMinEventDelay|llModifyLand|llModPow|llMoveToTarget|llNavigateTo|llOffsetTexture|" + - "llOpenRemoteDataChannel|llOverMyLand|llOwnerSay|llParcelMediaCommandList|" + - "llParcelMediaQuery|llParseString2List|llParseStringKeepNulls|llParticleSystem|" + - "llPassCollisions|llPassTouches|llPatrolPoints|llPlaySound|llPlaySoundSlave|" + - "llPow|llPreloadSound|llPursue|llPushObject|llRegionSay|llRegionSayTo|" + - "llReleaseControls|llReleaseURL|llRemoteDataReply|llRemoteLoadScriptPin|" + - "llRemoveFromLandBanList|llRemoveFromLandPassList|llRemoveInventory|llRemoveVehicleFlags|" + - "llRequestAgentData|llRequestDisplayName|llRequestInventoryData|llRequestPermissions|" + - "llRequestSecureURL|llRequestSimulatorData|llRequestURL|llRequestUsername|" + - "llResetAnimationOverride|llResetLandBanList|llResetLandPassList|llResetOtherScript|" + - "llResetScript|llResetTime|llReturnObjectsByID|llReturnObjectsByOwner|" + - "llRezAtRoot|llRezObject|llRot2Angle|llRot2Axis|llRot2Euler|" + - "llRot2Fwd|llRot2Left|llRot2Up|llRotateTexture|llRotBetween|llRotLookAt|" + - "llRotTarget|llRotTargetRemove|llRound|llSameGroup|llSay|llScaleTexture|" + - "llScriptDanger|llScriptProfiler|llSendRemoteData|llSensor|llSensorRemove|" + - "llSensorRepeat|llSetAlpha|llSetAngularVelocity|llSetAnimationOverride|llSetBuoyancy|" + - "llSetCameraAtOffset|llSetCameraEyeOffset|llSetCameraParams|llSetClickAction|" + - "llSetColor|llSetContentType|llSetDamage|llSetForce|llSetForceAndTorque|llSetHoverHeight|" + - "llSetKeyframedMotion|llSetLinkAlpha|llSetLinkCamera|llSetLinkColor|llSetLinkMedia|" + - "llSetLinkPrimitiveParams|llSetLinkPrimitiveParamsFast|llSetLinkTexture|llSetLinkTextureAnim|" + - "llSetLocalRot|llSetMemoryLimit|llSetObjectDesc|llSetObjectName|llSetParcelMusicURL|" + - "llSetPayPrice|llSetPhysicsMaterial|llSetPos|llSetPrimitiveParams|llSetPrimMediaParams|" + - "llSetRegionPos|llSetRemoteScriptAccessPin|llSetRot|llSetScale|llSetScriptState|" + - "llSetSitText|llSetSoundQueueing|llSetSoundRadius|llSetStatus|llSetText|" + - "llSetTexture|llSetTextureAnim|llSetTimerEvent|llSetTorque|llSetTouchText|" + - "llSetVehicleFlags|llSetVehicleFloatParam|llSetVehicleRotationParam|llSetVehicleType|" + - "llSetVehicleVectorParam|llSetVelocity|llSHA1String|llShout|llSin|llSitTarget|" + - "llSleep|llSqrt|llStartAnimation|llStopAnimation|llStopHover|llStopLookAt|" + - "llStopMoveToTarget|llStopSound|llStringLength|llStringToBase64|llStringTrim|" + - "llSubStringIndex|llTakeControls|llTan|llTarget|llTargetOmega|llTargetRemove|" + - "llTeleportAgent|llTeleportAgentGlobalCoords|llTeleportAgentHome|llTextBox|" + - "llToLower|llToUpper|llTransferLindenDollars|llTriggerSound|llTriggerSoundLimited|" + - "llUnescapeURL|llUnSit|llUpdateCharacter|llVecDist|llVecMag|llVecNorm|" + - "llVolumeDetect|llWanderWithin|llWater|llWhisper|llWind|llXorBase64", - "support.function.event.lsl" : "at_rot_target|at_target|attach|changed|collision|" + - "collision_end|collision_start|control|dataserver|email|http_request|" + - "http_response|land_collision|land_collision_end|land_collision_start|" + - "link_message|listen|money|moving_end|moving_start|no_sensor|not_at_rot_target|" + - "not_at_target|object_rez|on_rez|path_update|remote_data|run_time_permissions|" + - "sensor|state_entry|state_exit|timer|touch|touch_end|touch_start|transaction_result" - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment.line.double-slash.lsl", - regex : "\\/\\/.*$" - }, { - token : "comment.block.lsl", - regex : "\\/\\*", - next : "comment" - }, { - token : "string.quoted.double.lsl", - start : '"', - end : '"', - next : [{ - token : "constant.language.escape.lsl", regex : /\\[tn"\\]/ - }] - }, { - token : "constant.numeric.lsl", - regex : "(0[xX][0-9a-fA-F]+|[+-]?[0-9]+(?:(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?)?)\\b" - }, { - token : "entity.name.state.lsl", - regex : "\\b((state)\\s+\\w+|default)\\b" - }, { - token : keywordMapper, - regex : "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b" - }, { - token : "support.function.user-defined.lsl", - regex : /\b([a-zA-Z_]\w*)(?=\(.*?\))/ - }, { - token : "keyword.operator.lsl", - regex : "\\+\\+|\\-\\-|<<|>>|&&?|\\|\\|?|\\^|~|[!%<>=*+\\-\\/]=?" - }, { - token : "punctuation.operator.lsl", - regex : "\\,|\\;" - }, { - token : "paren.lparen.lsl", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen.lsl", - regex : "[\\]\\)\\}]" - }, { - token : "text.lsl", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment.block.lsl", - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment.block.lsl", - regex : ".+" - } - ] - }; - this.normalizeRules(); -} - -exports.LSLHighlightRules = LSLHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-lua.js b/util/build-sample-browser/player/vendor/ace/mode-lua.js deleted file mode 100644 index 952ae0e5e3..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-lua.js +++ /dev/null @@ -1,457 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/lua', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lua_highlight_rules', 'ace/mode/folding/lua', 'ace/range', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; -var LuaFoldMode = require("./folding/lua").FoldMode; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function() { - this.HighlightRules = LuaHighlightRules; - - this.foldingRules = new LuaFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - this.blockComment = {start: "--[", end: "]--"}; - - var indentKeywords = { - "function": 1, - "then": 1, - "do": 1, - "else": 1, - "elseif": 1, - "repeat": 1, - "end": -1, - "until": -1 - }; - var outdentKeywords = [ - "else", - "elseif", - "end", - "until" - ]; - - function getNetIndentLevel(tokens) { - var level = 0; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type == "keyword") { - if (token.value in indentKeywords) { - level += indentKeywords[token.value]; - } - } else if (token.type == "paren.lparen") { - level ++; - } else if (token.type == "paren.rparen") { - level --; - } - } - if (level < 0) { - return -1; - } else if (level > 0) { - return 1; - } else { - return 0; - } - } - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var level = 0; - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (state == "start") { - level = getNetIndentLevel(tokens); - } - if (level > 0) { - return indent + tab; - } else if (level < 0 && indent.substr(indent.length - tab.length) == tab) { - if (!this.checkOutdent(state, line, "\n")) { - return indent.substr(0, indent.length - tab.length); - } - } - return indent; - }; - - this.checkOutdent = function(state, line, input) { - if (input != "\n" && input != "\r" && input != "\r\n") - return false; - - if (line.match(/^\s*[\)\}\]]$/)) - return true; - - var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; - - if (!tokens || !tokens.length) - return false; - - return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1); - }; - - this.autoOutdent = function(state, session, row) { - var prevLine = session.getLine(row - 1); - var prevIndent = this.$getIndent(prevLine).length; - var prevTokens = this.getTokenizer().getLineTokens(prevLine, "start").tokens; - var tabLength = session.getTabString().length; - var expectedIndent = prevIndent + tabLength * getNetIndentLevel(prevTokens); - var curIndent = this.$getIndent(session.getLine(row)).length; - if (curIndent < expectedIndent) { - return; - } - session.outdentRows(new Range(row, 0, row + 2, 0)); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/lua_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("error", function(e) { - session.setAnnotations([e.data]); - }); - - worker.on("ok", function(e) { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/lua"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/lua_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LuaHighlightRules = function() { - - var keywords = ( - "break|do|else|elseif|end|for|function|if|in|local|repeat|"+ - "return|then|until|while|or|and|not" - ); - - var builtinConstants = ("true|false|nil|_G|_VERSION"); - - var functions = ( - "string|xpcall|package|tostring|print|os|unpack|require|"+ - "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+ - "collectgarbage|getmetatable|module|rawset|math|debug|"+ - "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+ - "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+ - "load|error|loadfile|"+ - - "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+ - "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+ - "loaders|cpath|config|path|seeall|exit|setlocale|date|"+ - "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+ - "lines|write|close|flush|open|output|type|read|stderr|"+ - "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+ - "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+ - "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+ - "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+ - "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+ - "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+ - "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+ - "status|wrap|create|running|"+ - "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+ - "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber" - ); - - var stdLibaries = ("string|package|os|io|math|debug|table|coroutine"); - - var futureReserved = ""; - - var deprecatedIn5152 = ("setn|foreach|foreachi|gcinfo|log10|maxn"); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "support.function": functions, - "invalid.deprecated": deprecatedIn5152, - "constant.library": stdLibaries, - "constant.language": builtinConstants, - "invalid.illegal": futureReserved, - "variable.language": "self" - }, "identifier"); - - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; - var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; - var integer = "(?:" + decimalInteger + "|" + hexInteger + ")"; - - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var floatNumber = "(?:" + pointFloat + ")"; - - this.$rules = { - "start" : [{ - stateName: "bracketedComment", - onMatch : function(value, currentState, stack){ - stack.unshift(this.next, value.length - 2, currentState); - return "comment"; - }, - regex : /\-\-\[=*\[/, - next : [ - { - onMatch : function(value, currentState, stack) { - if (value.length == stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); - } else { - this.next = ""; - } - return "comment"; - }, - regex : /\]=*\]/, - next : "start" - }, { - defaultToken : "comment" - } - ] - }, - - { - token : "comment", - regex : "\\-\\-.*$" - }, - { - stateName: "bracketedString", - onMatch : function(value, currentState, stack){ - stack.unshift(this.next, value.length, currentState); - return "comment"; - }, - regex : /\[=*\[/, - next : [ - { - onMatch : function(value, currentState, stack) { - if (value.length == stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); - } else { - this.next = ""; - } - return "comment"; - }, - - regex : /\]=*\]/, - next : "start" - }, { - defaultToken : "comment" - } - ] - }, - { - token : "string", // " string - regex : '"(?:[^\\\\]|\\\\.)*?"' - }, { - token : "string", // ' string - regex : "'(?:[^\\\\]|\\\\.)*?'" - }, { - token : "constant.numeric", // float - regex : floatNumber - }, { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\." - }, { - token : "paren.lparen", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen", - regex : "[\\]\\)\\}]" - }, { - token : "text", - regex : "\\s+|\\w+" - } ] - }; - - this.normalizeRules(); -} - -oop.inherits(LuaHighlightRules, TextHighlightRules); - -exports.LuaHighlightRules = LuaHighlightRules; -}); - -ace.define('ace/mode/folding/lua', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; -var TokenIterator = require("../../token_iterator").TokenIterator; - - -var FoldMode = exports.FoldMode = function() {}; - -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /\b(function|then|do|repeat)\b|{\s*$|(\[=*\[)/; - this.foldingStopMarker = /\bend\b|^\s*}|\]=*\]/; - - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var isStart = this.foldingStartMarker.test(line); - var isEnd = this.foldingStopMarker.test(line); - - if (isStart && !isEnd) { - var match = line.match(this.foldingStartMarker); - if (match[1] == "then" && /\belseif\b/.test(line)) - return; - if (match[1]) { - if (session.getTokenAt(row, match.index + 1).type === "keyword") - return "start"; - } else if (match[2]) { - var type = session.bgTokenizer.getState(row) || ""; - if (type[0] == "bracketedComment" || type[0] == "bracketedString") - return "start"; - } else { - return "start"; - } - } - if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd) - return ""; - - var match = line.match(this.foldingStopMarker); - if (match[0] === "end") { - if (session.getTokenAt(row, match.index + 1).type === "keyword") - return "end"; - } else if (match[0][0] === "]") { - var type = session.bgTokenizer.getState(row - 1) || ""; - if (type[0] == "bracketedComment" || type[0] == "bracketedString") - return "end"; - } else - return "end"; - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var line = session.doc.getLine(row); - var match = this.foldingStartMarker.exec(line); - if (match) { - if (match[1]) - return this.luaBlock(session, row, match.index + 1); - - if (match[2]) - return session.getCommentFoldRange(row, match.index + 1); - - return this.openingBracketBlock(session, "{", row, match.index); - } - - var match = this.foldingStopMarker.exec(line); - if (match) { - if (match[0] === "end") { - if (session.getTokenAt(row, match.index + 1).type === "keyword") - return this.luaBlock(session, row, match.index + 1); - } - - if (match[0][0] === "]") - return session.getCommentFoldRange(row, match.index + 1); - - return this.closingBracketBlock(session, "}", row, match.index + match[0].length); - } - }; - - this.luaBlock = function(session, row, column) { - var stream = new TokenIterator(session, row, column); - var indentKeywords = { - "function": 1, - "do": 1, - "then": 1, - "elseif": -1, - "end": -1, - "repeat": 1, - "until": -1 - }; - - var token = stream.getCurrentToken(); - if (!token || token.type != "keyword") - return; - - var val = token.value; - var stack = [val]; - var dir = indentKeywords[val]; - - if (!dir) - return; - - var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length; - var startRow = row; - - stream.step = dir === -1 ? stream.stepBackward : stream.stepForward; - while(token = stream.step()) { - if (token.type !== "keyword") - continue; - var level = dir * indentKeywords[token.value]; - - if (level > 0) { - stack.unshift(token.value); - } else if (level <= 0) { - stack.shift(); - if (!stack.length && token.value != "elseif") - break; - if (level === 0) - stack.unshift(token.value); - } - } - - var row = stream.getCurrentTokenRow(); - if (dir === -1) - return new Range(row, session.getLine(row).length, startRow, startColumn); - else - return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn()); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-luapage.js b/util/build-sample-browser/player/vendor/ace/mode-luapage.js deleted file mode 100644 index 1d7bd4b576..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-luapage.js +++ /dev/null @@ -1,2884 +0,0 @@ -ace.define('ace/mode/luapage', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/mode/lua', 'ace/tokenizer', 'ace/mode/luapage_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlMode = require("./html").Mode; -var LuaMode = require("./lua").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var LuaPageHighlightRules = require("./luapage_highlight_rules").LuaPageHighlightRules; - -var Mode = function() { - this.HighlightRules = LuaPageHighlightRules; - - this.HighlightRules = LuaPageHighlightRules; - this.createModeDelegates({ - "lua-": LuaMode - }); -}; -oop.inherits(Mode, HtmlMode); - -(function() { - this.$id = "ace/mode/luapage"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == ' selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/lua', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lua_highlight_rules', 'ace/mode/folding/lua', 'ace/range', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; -var LuaFoldMode = require("./folding/lua").FoldMode; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function() { - this.HighlightRules = LuaHighlightRules; - - this.foldingRules = new LuaFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - this.blockComment = {start: "--[", end: "]--"}; - - var indentKeywords = { - "function": 1, - "then": 1, - "do": 1, - "else": 1, - "elseif": 1, - "repeat": 1, - "end": -1, - "until": -1 - }; - var outdentKeywords = [ - "else", - "elseif", - "end", - "until" - ]; - - function getNetIndentLevel(tokens) { - var level = 0; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type == "keyword") { - if (token.value in indentKeywords) { - level += indentKeywords[token.value]; - } - } else if (token.type == "paren.lparen") { - level ++; - } else if (token.type == "paren.rparen") { - level --; - } - } - if (level < 0) { - return -1; - } else if (level > 0) { - return 1; - } else { - return 0; - } - } - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var level = 0; - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (state == "start") { - level = getNetIndentLevel(tokens); - } - if (level > 0) { - return indent + tab; - } else if (level < 0 && indent.substr(indent.length - tab.length) == tab) { - if (!this.checkOutdent(state, line, "\n")) { - return indent.substr(0, indent.length - tab.length); - } - } - return indent; - }; - - this.checkOutdent = function(state, line, input) { - if (input != "\n" && input != "\r" && input != "\r\n") - return false; - - if (line.match(/^\s*[\)\}\]]$/)) - return true; - - var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; - - if (!tokens || !tokens.length) - return false; - - return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1); - }; - - this.autoOutdent = function(state, session, row) { - var prevLine = session.getLine(row - 1); - var prevIndent = this.$getIndent(prevLine).length; - var prevTokens = this.getTokenizer().getLineTokens(prevLine, "start").tokens; - var tabLength = session.getTabString().length; - var expectedIndent = prevIndent + tabLength * getNetIndentLevel(prevTokens); - var curIndent = this.$getIndent(session.getLine(row)).length; - if (curIndent < expectedIndent) { - return; - } - session.outdentRows(new Range(row, 0, row + 2, 0)); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/lua_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("error", function(e) { - session.setAnnotations([e.data]); - }); - - worker.on("ok", function(e) { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/lua"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/lua_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LuaHighlightRules = function() { - - var keywords = ( - "break|do|else|elseif|end|for|function|if|in|local|repeat|"+ - "return|then|until|while|or|and|not" - ); - - var builtinConstants = ("true|false|nil|_G|_VERSION"); - - var functions = ( - "string|xpcall|package|tostring|print|os|unpack|require|"+ - "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+ - "collectgarbage|getmetatable|module|rawset|math|debug|"+ - "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+ - "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+ - "load|error|loadfile|"+ - - "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+ - "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+ - "loaders|cpath|config|path|seeall|exit|setlocale|date|"+ - "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+ - "lines|write|close|flush|open|output|type|read|stderr|"+ - "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+ - "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+ - "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+ - "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+ - "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+ - "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+ - "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+ - "status|wrap|create|running|"+ - "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+ - "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber" - ); - - var stdLibaries = ("string|package|os|io|math|debug|table|coroutine"); - - var futureReserved = ""; - - var deprecatedIn5152 = ("setn|foreach|foreachi|gcinfo|log10|maxn"); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "support.function": functions, - "invalid.deprecated": deprecatedIn5152, - "constant.library": stdLibaries, - "constant.language": builtinConstants, - "invalid.illegal": futureReserved, - "variable.language": "self" - }, "identifier"); - - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; - var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; - var integer = "(?:" + decimalInteger + "|" + hexInteger + ")"; - - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var floatNumber = "(?:" + pointFloat + ")"; - - this.$rules = { - "start" : [{ - stateName: "bracketedComment", - onMatch : function(value, currentState, stack){ - stack.unshift(this.next, value.length - 2, currentState); - return "comment"; - }, - regex : /\-\-\[=*\[/, - next : [ - { - onMatch : function(value, currentState, stack) { - if (value.length == stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); - } else { - this.next = ""; - } - return "comment"; - }, - regex : /\]=*\]/, - next : "start" - }, { - defaultToken : "comment" - } - ] - }, - - { - token : "comment", - regex : "\\-\\-.*$" - }, - { - stateName: "bracketedString", - onMatch : function(value, currentState, stack){ - stack.unshift(this.next, value.length, currentState); - return "comment"; - }, - regex : /\[=*\[/, - next : [ - { - onMatch : function(value, currentState, stack) { - if (value.length == stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); - } else { - this.next = ""; - } - return "comment"; - }, - - regex : /\]=*\]/, - next : "start" - }, { - defaultToken : "comment" - } - ] - }, - { - token : "string", // " string - regex : '"(?:[^\\\\]|\\\\.)*?"' - }, { - token : "string", // ' string - regex : "'(?:[^\\\\]|\\\\.)*?'" - }, { - token : "constant.numeric", // float - regex : floatNumber - }, { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\." - }, { - token : "paren.lparen", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen", - regex : "[\\]\\)\\}]" - }, { - token : "text", - regex : "\\s+|\\w+" - } ] - }; - - this.normalizeRules(); -} - -oop.inherits(LuaHighlightRules, TextHighlightRules); - -exports.LuaHighlightRules = LuaHighlightRules; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/lua', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; -var TokenIterator = require("../../token_iterator").TokenIterator; - - -var FoldMode = exports.FoldMode = function() {}; - -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /\b(function|then|do|repeat)\b|{\s*$|(\[=*\[)/; - this.foldingStopMarker = /\bend\b|^\s*}|\]=*\]/; - - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var isStart = this.foldingStartMarker.test(line); - var isEnd = this.foldingStopMarker.test(line); - - if (isStart && !isEnd) { - var match = line.match(this.foldingStartMarker); - if (match[1] == "then" && /\belseif\b/.test(line)) - return; - if (match[1]) { - if (session.getTokenAt(row, match.index + 1).type === "keyword") - return "start"; - } else if (match[2]) { - var type = session.bgTokenizer.getState(row) || ""; - if (type[0] == "bracketedComment" || type[0] == "bracketedString") - return "start"; - } else { - return "start"; - } - } - if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd) - return ""; - - var match = line.match(this.foldingStopMarker); - if (match[0] === "end") { - if (session.getTokenAt(row, match.index + 1).type === "keyword") - return "end"; - } else if (match[0][0] === "]") { - var type = session.bgTokenizer.getState(row - 1) || ""; - if (type[0] == "bracketedComment" || type[0] == "bracketedString") - return "end"; - } else - return "end"; - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var line = session.doc.getLine(row); - var match = this.foldingStartMarker.exec(line); - if (match) { - if (match[1]) - return this.luaBlock(session, row, match.index + 1); - - if (match[2]) - return session.getCommentFoldRange(row, match.index + 1); - - return this.openingBracketBlock(session, "{", row, match.index); - } - - var match = this.foldingStopMarker.exec(line); - if (match) { - if (match[0] === "end") { - if (session.getTokenAt(row, match.index + 1).type === "keyword") - return this.luaBlock(session, row, match.index + 1); - } - - if (match[0][0] === "]") - return session.getCommentFoldRange(row, match.index + 1); - - return this.closingBracketBlock(session, "}", row, match.index + match[0].length); - } - }; - - this.luaBlock = function(session, row, column) { - var stream = new TokenIterator(session, row, column); - var indentKeywords = { - "function": 1, - "do": 1, - "then": 1, - "elseif": -1, - "end": -1, - "repeat": 1, - "until": -1 - }; - - var token = stream.getCurrentToken(); - if (!token || token.type != "keyword") - return; - - var val = token.value; - var stack = [val]; - var dir = indentKeywords[val]; - - if (!dir) - return; - - var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length; - var startRow = row; - - stream.step = dir === -1 ? stream.stepBackward : stream.stepForward; - while(token = stream.step()) { - if (token.type !== "keyword") - continue; - var level = dir * indentKeywords[token.value]; - - if (level > 0) { - stack.unshift(token.value); - } else if (level <= 0) { - stack.shift(); - if (!stack.length && token.value != "elseif") - break; - if (level === 0) - stack.unshift(token.value); - } - } - - var row = stream.getCurrentTokenRow(); - if (dir === -1) - return new Range(row, session.getLine(row).length, startRow, startColumn); - else - return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn()); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/luapage_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/lua_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; - -var LuaPageHighlightRules = function() { - HtmlHighlightRules.call(this); - - var startRules = [ - { - token: "keyword", - regex: "<\\%\\=?", - push: "lua-start" - }, { - token: "keyword", - regex: "<\\?lua\\=?", - push: "lua-start" - } - ]; - - var endRules = [ - { - token: "keyword", - regex: "\\%>", - next: "pop" - }, { - token: "keyword", - regex: "\\?>", - next: "pop" - } - ]; - - this.embedRules(LuaHighlightRules, "lua-", endRules, ["start"]); - - for (var key in this.$rules) - this.$rules[key].unshift.apply(this.$rules[key], startRules); - - this.normalizeRules(); -}; - -oop.inherits(LuaPageHighlightRules, HtmlHighlightRules); - -exports.LuaPageHighlightRules = LuaPageHighlightRules; - -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-lucene.js b/util/build-sample-browser/player/vendor/ace/mode-lucene.js deleted file mode 100644 index 7ed0761f06..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-lucene.js +++ /dev/null @@ -1,68 +0,0 @@ -ace.define('ace/mode/lucene', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lucene_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules; - -var Mode = function() { - this.$tokenizer = new Tokenizer(new LuceneHighlightRules().getRules()); -}; - -oop.inherits(Mode, TextMode); - -(function() { - this.$id = "ace/mode/lucene"; -}).call(Mode.prototype); - -exports.Mode = Mode; -});ace.define('ace/mode/lucene_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LuceneHighlightRules = function() { - this.$rules = { - "start" : [ - { - token : "constant.character.negation", - regex : "[\\-]" - }, { - token : "constant.character.interro", - regex : "[\\?]" - }, { - token : "constant.character.asterisk", - regex : "[\\*]" - }, { - token: 'constant.character.proximity', - regex: '~[0-9]+\\b' - }, { - token : 'keyword.operator', - regex: '(?:AND|OR|NOT)\\b' - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "keyword", - regex : "[\\S]+:" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "text", - regex : "\\s+" - } - ] - }; -}; - -oop.inherits(LuceneHighlightRules, TextHighlightRules); - -exports.LuceneHighlightRules = LuceneHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-makefile.js b/util/build-sample-browser/player/vendor/ace/mode-makefile.js deleted file mode 100644 index c00557b64b..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-makefile.js +++ /dev/null @@ -1,332 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/makefile', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/makefile_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var MakefileHighlightRules = require("./makefile_highlight_rules").MakefileHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = MakefileHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "#"; - this.$indentWithTabs = true; - - this.$id = "ace/mode/makefile"; -}).call(Mode.prototype); - -exports.Mode = Mode; -});ace.define('ace/mode/makefile_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/sh_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ShHighlightFile = require("./sh_highlight_rules"); - -var MakefileHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "keyword": ShHighlightFile.reservedKeywords, - "support.function.builtin": ShHighlightFile.languageConstructs, - "invalid.deprecated": "debugger" - }, "string"); - - this.$rules = - { - "start": [ - { - token: "string.interpolated.backtick.makefile", - regex: "`", - next: "shell-start" - }, - { - token: "punctuation.definition.comment.makefile", - regex: /#(?=.)/, - next: "comment" - }, - { - token: [ "keyword.control.makefile"], - regex: "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)" - }, - {// ^([^\t ]+(\s[^\t ]+)*:(?!\=))\s*.* - token: ["entity.name.function.makefile", "text"], - regex: "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)" - } - ], - "comment": [ - { - token : "punctuation.definition.comment.makefile", - regex : /.+\\/ - }, - { - token : "punctuation.definition.comment.makefile", - regex : ".+", - next : "start" - } - ], - "shell-start": [ - { - token: keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, - { - token: "string", - regex : "\\w+" - }, - { - token : "string.interpolated.backtick.makefile", - regex : "`", - next : "start" - } - ] -} - -}; - -oop.inherits(MakefileHighlightRules, TextHighlightRules); - -exports.MakefileHighlightRules = MakefileHighlightRules; -}); - -ace.define('ace/mode/sh_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var reservedKeywords = exports.reservedKeywords = ( - '!|{|}|case|do|done|elif|else|'+ - 'esac|fi|for|if|in|then|until|while|'+ - '&|;|export|local|read|typeset|unset|'+ - 'elif|select|set' - ); - -var languageConstructs = exports.languageConstructs = ( - '[|]|alias|bg|bind|break|builtin|'+ - 'cd|command|compgen|complete|continue|'+ - 'dirs|disown|echo|enable|eval|exec|'+ - 'exit|fc|fg|getopts|hash|help|history|'+ - 'jobs|kill|let|logout|popd|printf|pushd|'+ - 'pwd|return|set|shift|shopt|source|'+ - 'suspend|test|times|trap|type|ulimit|'+ - 'umask|unalias|wait' -); - -var ShHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "keyword": reservedKeywords, - "support.function.builtin": languageConstructs, - "invalid.deprecated": "debugger" - }, "identifier"); - - var integer = "(?:(?:[1-9]\\d*)|(?:0))"; - - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")"; - var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; - var fileDescriptor = "(?:&" + intPart + ")"; - - var variableName = "[a-zA-Z][a-zA-Z0-9_]*"; - var variable = "(?:(?:\\$" + variableName + ")|(?:" + variableName + "=))"; - - var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))"; - - var func = "(?:" + variableName + "\\s*\\(\\))"; - - this.$rules = { - "start" : [{ - token : "constant", - regex : /\\./ - }, { - token : ["text", "comment"], - regex : /(^|\s)(#.*)$/ - }, { - token : "string", - regex : '"', - push : [{ - token : "constant.language.escape", - regex : /\\(?:[$abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/ - }, { - token : "constant", - regex : /\$\w+/ - }, { - token : "string", - regex : '"', - next: "pop" - }, { - defaultToken: "string" - }] - }, { - token : "variable.language", - regex : builtinVariable - }, { - token : "variable", - regex : variable - }, { - token : "support.function", - regex : func - }, { - token : "support.function", - regex : fileDescriptor - }, { - token : "string", // ' string - start : "'", end : "'" - }, { - token : "constant.numeric", // float - regex : floatNumber - }, { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=" - }, { - token : "paren.lparen", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen", - regex : "[\\]\\)\\}]" - } ] - }; - - this.normalizeRules(); -}; - -oop.inherits(ShHighlightRules, TextHighlightRules); - -exports.ShHighlightRules = ShHighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-markdown.js b/util/build-sample-browser/player/vendor/ace/mode-markdown.js deleted file mode 100644 index 54d0a2576d..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-markdown.js +++ /dev/null @@ -1,2776 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/markdown', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/xml', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/markdown_highlight_rules', 'ace/mode/folding/markdown'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var XmlMode = require("./xml").Mode; -var HtmlMode = require("./html").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules; -var MarkdownFoldMode = require("./folding/markdown").FoldMode; - -var Mode = function() { - this.HighlightRules = MarkdownHighlightRules; - - this.createModeDelegates({ - "js-": JavaScriptMode, - "xml-": XmlMode, - "html-": HtmlMode - }); - - this.foldingRules = new MarkdownFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.type = "text"; - this.lineCommentStart = ">"; - - this.getNextLineIndent = function(state, line, tab) { - if (state == "listblock") { - var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line); - if (!match) - return ""; - var marker = match[2]; - if (!marker) - marker = parseInt(match[3], 10) + 1 + "."; - return match[1] + marker + match[4]; - } else { - return this.$getIndent(line); - } - }; - this.$id = "ace/mode/markdown"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '"}; - - this.$id = "ace/mode/xml"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var MixedFoldMode = require("./mixed").FoldMode; -var XmlFoldMode = require("./xml").FoldMode; -var CStyleFoldMode = require("./cstyle").FoldMode; - -var FoldMode = exports.FoldMode = function() { - MixedFoldMode.call(this, new XmlFoldMode({ - "area": 1, - "base": 1, - "br": 1, - "col": 1, - "command": 1, - "embed": 1, - "hr": 1, - "img": 1, - "input": 1, - "keygen": 1, - "link": 1, - "meta": 1, - "param": 1, - "source": 1, - "track": 1, - "wbr": 1, - "li": 1, - "dt": 1, - "dd": 1, - "p": 1, - "rt": 1, - "rp": 1, - "optgroup": 1, - "option": 1, - "colgroup": 1, - "td": 1, - "th": 1 - }), { - "js-": new CStyleFoldMode(), - "css-": new CStyleFoldMode() - }); -}; - -oop.inherits(FoldMode, MixedFoldMode); - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(defaultMode, subModes) { - this.defaultMode = defaultMode; - this.subModes = subModes; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - - this.$getMode = function(state) { - if (typeof state != "string") - state = state[0]; - for (var key in this.subModes) { - if (state.indexOf(key) === 0) - return this.subModes[key]; - } - return null; - }; - - this.$tryMode = function(state, session, foldStyle, row) { - var mode = this.$getMode(state); - return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); - }; - - this.getFoldWidget = function(session, foldStyle, row) { - return ( - this.$tryMode(session.getState(row-1), session, foldStyle, row) || - this.$tryMode(session.getState(row), session, foldStyle, row) || - this.defaultMode.getFoldWidget(session, foldStyle, row) - ); - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var mode = this.$getMode(session.getState(row-1)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.$getMode(session.getState(row)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.defaultMode; - - return mode.getFoldWidgetRange(session, foldStyle, row); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/markdown_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules', 'ace/mode/html_highlight_rules', 'ace/mode/css_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; - -var escaped = function(ch) { - return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*"; -} - -function github_embed(tag, prefix) { - return { // Github style block - token : "support.function", - regex : "^```" + tag + "\\s*$", - push : prefix + "start" - }; -} - -var MarkdownHighlightRules = function() { - HtmlHighlightRules.call(this); - - this.$rules["start"].unshift({ - token : "empty_line", - regex : '^$', - next: "allowBlock" - }, { // h1 - token: "markup.heading.1", - regex: "^=+(?=\\s*$)" - }, { // h2 - token: "markup.heading.2", - regex: "^\\-+(?=\\s*$)" - }, { - token : function(value) { - return "markup.heading." + value.length; - }, - regex : /^#{1,6}(?=\s*[^ #]|\s+#.)/, - next : "header" - }, - github_embed("(?:javascript|js)", "jscode-"), - github_embed("xml", "xmlcode-"), - github_embed("html", "htmlcode-"), - github_embed("css", "csscode-"), - { // Github style block - token : "support.function", - regex : "^```\\s*\\S*(?:{.*?\\})?\\s*$", - next : "githubblock" - }, { // block quote - token : "string.blockquote", - regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", - next : "blockquote" - }, { // HR * - _ - token : "constant", - regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$", - next: "allowBlock" - }, { // list - token : "markup.list", - regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", - next : "listblock-start" - }, { - include : "basic" - }); - - this.addRules({ - "basic" : [{ - token : "constant.language.escape", - regex : /\\[\\`*_{}\[\]()#+\-.!]/ - }, { // code span ` - token : "support.function", - regex : "(`+)(.*?[^`])(\\1)" - }, { // reference - token : ["text", "constant", "text", "url", "string", "text"], - regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" - }, { // link by reference - token : ["text", "string", "text", "constant", "text"], - regex : "(\\[)(" + escaped("]") + ")(\\]\s*\\[)("+ escaped("]") + ")(\\])" - }, { // link by url - token : ["text", "string", "text", "markup.underline", "string", "text"], - regex : "(\\[)(" + // [ - escaped("]") + // link text - ")(\\]\\()"+ // ]( - '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href - '(\\s*"' + escaped('"') + '"\\s*)?' + // "title" - "(\\))" // ) - }, { // strong ** __ - token : "string.strong", - regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" - }, { // emphasis * _ - token : "string.emphasis", - regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" - }, { // - token : ["text", "url", "text"], - regex : "(<)("+ - "(?:https?|ftp|dict):[^'\">\\s]+"+ - "|"+ - "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+ - ")(>)" - }], - "allowBlock": [ - {token : "support.function", regex : "^ {4}.+", next : "allowBlock"}, - {token : "empty", regex : "", next : "start"} - ], - - "header" : [{ - regex: "$", - next : "start" - }, { - include: "basic" - }, { - defaultToken : "heading" - } ], - - "listblock-start" : [{ - token : "support.variable", - regex : /(?:\[[ x]\])?/, - next : "listblock" - }], - - "listblock" : [ { // Lists only escape on completely blank lines. - token : "empty_line", - regex : "^$", - next : "start" - }, { // list - token : "markup.list", - regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", - next : "listblock-start" - }, { - include : "basic", noEscape: true - }, { - defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly - } ], - - "blockquote" : [ { // BLockquotes only escape on blank lines. - token : "empty_line", - regex : "^\\s*$", - next : "start" - }, { // block quote - token : "string.blockquote", - regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", - next : "blockquote" - }, { - include : "basic", noEscape: true - }, { - defaultToken : "string.blockquote" - } ], - - "githubblock" : [ { - token : "support.function", - regex : "^```", - next : "start" - }, { - token : "support.function", - regex : ".+" - } ] - }); - - this.embedRules(JavaScriptHighlightRules, "jscode-", [{ - token : "support.function", - regex : "^```", - next : "pop" - }]); - - this.embedRules(HtmlHighlightRules, "htmlcode-", [{ - token : "support.function", - regex : "^```", - next : "pop" - }]); - - this.embedRules(CssHighlightRules, "csscode-", [{ - token : "support.function", - regex : "^```", - next : "pop" - }]); - - this.embedRules(XmlHighlightRules, "xmlcode-", [{ - token : "support.function", - regex : "^```", - next : "pop" - }]); - - this.normalizeRules(); -}; -oop.inherits(MarkdownHighlightRules, TextHighlightRules); - -exports.MarkdownHighlightRules = MarkdownHighlightRules; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/markdown', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - this.foldingStartMarker = /^(?:[=-]+\s*$|#{1,6} |`{3})/; - - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - if (!this.foldingStartMarker.test(line)) - return ""; - - if (line[0] == "`") { - if (session.bgTokenizer.getState(row) == "start") - return "end"; - return "start"; - } - - return "start"; - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var line = session.getLine(row); - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - if (!line.match(this.foldingStartMarker)) - return; - - if (line[0] == "`") { - if (session.bgTokenizer.getState(row) !== "start") { - while (++row < maxRow) { - line = session.getLine(row); - if (line[0] == "`" & line.substring(0, 3) == "```") - break; - } - return new Range(startRow, startColumn, row, 0); - } else { - while (row -- > 0) { - line = session.getLine(row); - if (line[0] == "`" & line.substring(0, 3) == "```") - break; - } - return new Range(row, line.length, startRow, 0); - } - } - - var token; - function isHeading(row) { - token = session.getTokens(row)[0]; - return token && token.type.lastIndexOf(heading, 0) === 0; - } - - var heading = "markup.heading"; - function getLevel() { - var ch = token.value[0]; - if (ch == "=") return 6; - if (ch == "-") return 5; - return 7 - token.value.search(/[^#]/); - } - - if (isHeading(row)) { - var startHeadingLevel = getLevel(); - while (++row < maxRow) { - if (!isHeading(row)) - continue; - var level = getLevel(); - if (level >= startHeadingLevel) - break; - } - - endRow = row - (!token || ["=", "-"].indexOf(token.value[0]) == -1 ? 1 : 2); - - if (endRow > startRow) { - while (endRow > startRow && /^\s*$/.test(session.getLine(endRow))) - endRow--; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - } - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-matlab.js b/util/build-sample-browser/player/vendor/ace/mode-matlab.js deleted file mode 100644 index ebc598b292..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-matlab.js +++ /dev/null @@ -1,230 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/matlab', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/matlab_highlight_rules', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var MatlabHighlightRules = require("./matlab_highlight_rules").MatlabHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = MatlabHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "%"; - this.blockComment = {start: "%{", end: "%}"}; - - this.$id = "ace/mode/matlab"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/matlab_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var MatlabHighlightRules = function() { - -var keywords = ( - "break|case|catch|classdef|continue|else|elseif|end|for|function|global|if|otherwise|parfor|persistent|return|spmd|switch|try|while" - ); - - var builtinConstants = ( - "true|false|inf|Inf|nan|NaN|eps|pi|ans|nargin|nargout|varargin|varargout" - ); - - var builtinFunctions = ( - "abs|accumarray|acos(?:d|h)?|acot(?:d|h)?|acsc(?:d|h)?|actxcontrol(?:list|select)?|actxGetRunningServer|actxserver|addlistener|addpath|addpref|addtodate|"+ - "airy|align|alim|all|allchild|alpha|alphamap|amd|ancestor|and|angle|annotation|any|area|arrayfun|asec(?:d|h)?|asin(?:d|h)?|assert|assignin|atan(?:2|d|h)?|" + - "audiodevinfo|audioplayer|audiorecorder|aufinfo|auread|autumn|auwrite|avifile|aviinfo|aviread|axes|axis|balance|bar(?:3|3h|h)?|base2dec|beep|BeginInvoke|bench|"+ - "bessel(?:h|i|j|k|y)|beta|betainc|betaincinv|betaln|bicg|bicgstab|bicgstabl|bin2dec|bitand|bitcmp|bitget|bitmax|bitnot|bitor|bitset|bitshift|bitxor|blanks|blkdiag|"+ - "bone|box|brighten|brush|bsxfun|builddocsearchdb|builtin|bvp4c|bvp5c|bvpget|bvpinit|bvpset|bvpxtend|calendar|calllib|callSoapService|camdolly|cameratoolbar|camlight|"+ - "camlookat|camorbit|campan|campos|camproj|camroll|camtarget|camup|camva|camzoom|cart2pol|cart2sph|cast|cat|caxis|cd|cdf2rdf|cdfepoch|cdfinfo|cdflib(?:\.(?:close|closeVar|"+ - "computeEpoch|computeEpoch16|create|createAttr|createVar|delete|deleteAttr|deleteAttrEntry|deleteAttrgEntry|deleteVar|deleteVarRecords|epoch16Breakdown|epochBreakdown|getAttrEntry|"+ - "getAttrgEntry|getAttrMaxEntry|getAttrMaxgEntry|getAttrName|getAttrNum|getAttrScope|getCacheSize|getChecksum|getCompression|getCompressionCacheSize|getConstantNames|"+ - "getConstantValue|getCopyright|getFileBackward|getFormat|getLibraryCopyright|getLibraryVersion|getMajority|getName|getNumAttrEntries|getNumAttrgEntries|getNumAttributes|"+ - "getNumgAttributes|getReadOnlyMode|getStageCacheSize|getValidate|getVarAllocRecords|getVarBlockingFactor|getVarCacheSize|getVarCompression|getVarData|getVarMaxAllocRecNum|"+ - "getVarMaxWrittenRecNum|getVarName|getVarNum|getVarNumRecsWritten|getVarPadValue|getVarRecordData|getVarReservePercent|getVarsMaxWrittenRecNum|getVarSparseRecords|getVersion|"+ - "hyperGetVarData|hyperPutVarData|inquire|inquireAttr|inquireAttrEntry|inquireAttrgEntry|inquireVar|open|putAttrEntry|putAttrgEntry|putVarData|putVarRecordData|renameAttr|"+ - "renameVar|setCacheSize|setChecksum|setCompression|setCompressionCacheSize|setFileBackward|setFormat|setMajority|setReadOnlyMode|setStageCacheSize|setValidate|"+ - "setVarAllocBlockRecords|setVarBlockingFactor|setVarCacheSize|setVarCompression|setVarInitialRecs|setVarPadValue|SetVarReservePercent|setVarsCacheSize|setVarSparseRecords))?|"+ - "cdfread|cdfwrite|ceil|cell2mat|cell2struct|celldisp|cellfun|cellplot|cellstr|cgs|checkcode|checkin|checkout|chol|cholinc|cholupdate|circshift|cla|clabel|class|clc|clear|"+ - "clearvars|clf|clipboard|clock|close|closereq|cmopts|cmpermute|cmunique|colamd|colon|colorbar|colordef|colormap|colormapeditor|colperm|Combine|comet|comet3|commandhistory|"+ - "commandwindow|compan|compass|complex|computer|cond|condeig|condest|coneplot|conj|containers\.Map|contour(?:3|c|f|slice)?|contrast|conv|conv2|convhull|convhulln|convn|cool|"+ - "copper|copyfile|copyobj|corrcoef|cos(?:d|h)?|cot(?:d|h)?|cov|cplxpair|cputime|createClassFromWsdl|createSoapMessage|cross|csc(?:d|h)?|csvread|csvwrite|ctranspose|cumprod|"+ - "cumsum|cumtrapz|curl|customverctrl|cylinder|daqread|daspect|datacursormode|datatipinfo|date|datenum|datestr|datetick|datevec|dbclear|dbcont|dbdown|dblquad|dbmex|dbquit|"+ - "dbstack|dbstatus|dbstep|dbstop|dbtype|dbup|dde23|ddeget|ddesd|ddeset|deal|deblank|dec2base|dec2bin|dec2hex|decic|deconv|del2|delaunay|delaunay3|delaunayn|DelaunayTri|delete|"+ - "demo|depdir|depfun|det|detrend|deval|diag|dialog|diary|diff|diffuse|dir|disp|display|dither|divergence|dlmread|dlmwrite|dmperm|doc|docsearch|dos|dot|dragrect|drawnow|dsearch|"+ - "dsearchn|dynamicprops|echo|echodemo|edit|eig|eigs|ellipj|ellipke|ellipsoid|empty|enableNETfromNetworkDrive|enableservice|EndInvoke|enumeration|eomday|eq|erf|erfc|erfcinv|"+ - "erfcx|erfinv|error|errorbar|errordlg|etime|etree|etreeplot|eval|evalc|evalin|event\.(?:EventData|listener|PropertyEvent|proplistener)|exifread|exist|exit|exp|expint|expm|"+ - "expm1|export2wsdlg|eye|ezcontour|ezcontourf|ezmesh|ezmeshc|ezplot|ezplot3|ezpolar|ezsurf|ezsurfc|factor|factorial|fclose|feather|feature|feof|ferror|feval|fft|fft2|fftn|"+ - "fftshift|fftw|fgetl|fgets|fieldnames|figure|figurepalette|fileattrib|filebrowser|filemarker|fileparts|fileread|filesep|fill|fill3|filter|filter2|find|findall|findfigs|"+ - "findobj|findstr|finish|fitsdisp|fitsinfo|fitsread|fitswrite|fix|flag|flipdim|fliplr|flipud|floor|flow|fminbnd|fminsearch|fopen|format|fplot|fprintf|frame2im|fread|freqspace|"+ - "frewind|fscanf|fseek|ftell|FTP|full|fullfile|func2str|functions|funm|fwrite|fzero|gallery|gamma|gammainc|gammaincinv|gammaln|gca|gcbf|gcbo|gcd|gcf|gco|ge|genpath|genvarname|"+ - "get|getappdata|getenv|getfield|getframe|getpixelposition|getpref|ginput|gmres|gplot|grabcode|gradient|gray|graymon|grid|griddata(?:3|n)?|griddedInterpolant|gsvd|gt|gtext|"+ - "guidata|guide|guihandles|gunzip|gzip|h5create|h5disp|h5info|h5read|h5readatt|h5write|h5writeatt|hadamard|handle|hankel|hdf|hdf5|hdf5info|hdf5read|hdf5write|hdfinfo|"+ - "hdfread|hdftool|help|helpbrowser|helpdesk|helpdlg|helpwin|hess|hex2dec|hex2num|hgexport|hggroup|hgload|hgsave|hgsetget|hgtransform|hidden|hilb|hist|histc|hold|home|horzcat|"+ - "hostid|hot|hsv|hsv2rgb|hypot|ichol|idivide|ifft|ifft2|ifftn|ifftshift|ilu|im2frame|im2java|imag|image|imagesc|imapprox|imfinfo|imformats|import|importdata|imread|imwrite|"+ - "ind2rgb|ind2sub|inferiorto|info|inline|inmem|inpolygon|input|inputdlg|inputname|inputParser|inspect|instrcallback|instrfind|instrfindall|int2str|integral(?:2|3)?|interp(?:1|"+ - "1q|2|3|ft|n)|interpstreamspeed|intersect|intmax|intmin|inv|invhilb|ipermute|isa|isappdata|iscell|iscellstr|ischar|iscolumn|isdir|isempty|isequal|isequaln|isequalwithequalnans|"+ - "isfield|isfinite|isfloat|isglobal|ishandle|ishghandle|ishold|isinf|isinteger|isjava|iskeyword|isletter|islogical|ismac|ismatrix|ismember|ismethod|isnan|isnumeric|isobject|"+ - "isocaps|isocolors|isonormals|isosurface|ispc|ispref|isprime|isprop|isreal|isrow|isscalar|issorted|isspace|issparse|isstr|isstrprop|isstruct|isstudent|isunix|isvarname|"+ - "isvector|javaaddpath|javaArray|javachk|javaclasspath|javacomponent|javaMethod|javaMethodEDT|javaObject|javaObjectEDT|javarmpath|jet|keyboard|kron|lasterr|lasterror|"+ - "lastwarn|lcm|ldivide|ldl|le|legend|legendre|length|libfunctions|libfunctionsview|libisloaded|libpointer|libstruct|license|light|lightangle|lighting|lin2mu|line|lines|"+ - "linkaxes|linkdata|linkprop|linsolve|linspace|listdlg|listfonts|load|loadlibrary|loadobj|log|log10|log1p|log2|loglog|logm|logspace|lookfor|lower|ls|lscov|lsqnonneg|lsqr|"+ - "lt|lu|luinc|magic|makehgtform|mat2cell|mat2str|material|matfile|matlab\.io\.MatFile|matlab\.mixin\.(?:Copyable|Heterogeneous(?:\.getDefaultScalarElement)?)|matlabrc|"+ - "matlabroot|max|maxNumCompThreads|mean|median|membrane|memmapfile|memory|menu|mesh|meshc|meshgrid|meshz|meta\.(?:class(?:\.fromName)?|DynamicProperty|EnumeratedValue|event|"+ - "MetaData|method|package(?:\.(?:fromName|getAllPackages))?|property)|metaclass|methods|methodsview|mex(?:\.getCompilerConfigurations)?|MException|mexext|mfilename|min|minres|"+ - "minus|mislocked|mkdir|mkpp|mldivide|mlint|mlintrpt|mlock|mmfileinfo|mmreader|mod|mode|more|move|movefile|movegui|movie|movie2avi|mpower|mrdivide|msgbox|mtimes|mu2lin|"+ - "multibandread|multibandwrite|munlock|namelengthmax|nargchk|narginchk|nargoutchk|native2unicode|nccreate|ncdisp|nchoosek|ncinfo|ncread|ncreadatt|ncwrite|ncwriteatt|"+ - "ncwriteschema|ndgrid|ndims|ne|NET(?:\.(?:addAssembly|Assembly|convertArray|createArray|createGeneric|disableAutoRelease|enableAutoRelease|GenericClass|invokeGenericMethod|"+ - "NetException|setStaticProperty))?|netcdf\.(?:abort|close|copyAtt|create|defDim|defGrp|defVar|defVarChunking|defVarDeflate|defVarFill|defVarFletcher32|delAtt|endDef|getAtt|"+ - "getChunkCache|getConstant|getConstantNames|getVar|inq|inqAtt|inqAttID|inqAttName|inqDim|inqDimID|inqDimIDs|inqFormat|inqGrpName|inqGrpNameFull|inqGrpParent|inqGrps|"+ - "inqLibVers|inqNcid|inqUnlimDims|inqVar|inqVarChunking|inqVarDeflate|inqVarFill|inqVarFletcher32|inqVarID|inqVarIDs|open|putAtt|putVar|reDef|renameAtt|renameDim|renameVar|"+ - "setChunkCache|setDefaultFormat|setFill|sync)|newplot|nextpow2|nnz|noanimate|nonzeros|norm|normest|not|notebook|now|nthroot|null|num2cell|num2hex|num2str|numel|nzmax|"+ - "ode(?:113|15i|15s|23|23s|23t|23tb|45)|odeget|odeset|odextend|onCleanup|ones|open|openfig|opengl|openvar|optimget|optimset|or|ordeig|orderfields|ordqz|ordschur|orient|"+ - "orth|pack|padecoef|pagesetupdlg|pan|pareto|parseSoapResponse|pascal|patch|path|path2rc|pathsep|pathtool|pause|pbaspect|pcg|pchip|pcode|pcolor|pdepe|pdeval|peaks|perl|perms|"+ - "permute|pie|pink|pinv|planerot|playshow|plot|plot3|plotbrowser|plotedit|plotmatrix|plottools|plotyy|plus|pol2cart|polar|poly|polyarea|polyder|polyeig|polyfit|polyint|polyval|"+ - "polyvalm|pow2|power|ppval|prefdir|preferences|primes|print|printdlg|printopt|printpreview|prod|profile|profsave|propedit|propertyeditor|psi|publish|PutCharArray|PutFullMatrix|"+ - "PutWorkspaceData|pwd|qhull|qmr|qr|qrdelete|qrinsert|qrupdate|quad|quad2d|quadgk|quadl|quadv|questdlg|quit|quiver|quiver3|qz|rand|randi|randn|randperm|RandStream(?:\.(?:create|"+ - "getDefaultStream|getGlobalStream|list|setDefaultStream|setGlobalStream))?|rank|rat|rats|rbbox|rcond|rdivide|readasync|real|reallog|realmax|realmin|realpow|realsqrt|record|"+ - "rectangle|rectint|recycle|reducepatch|reducevolume|refresh|refreshdata|regexp|regexpi|regexprep|regexptranslate|rehash|rem|Remove|RemoveAll|repmat|reset|reshape|residue|"+ - "restoredefaultpath|rethrow|rgb2hsv|rgb2ind|rgbplot|ribbon|rmappdata|rmdir|rmfield|rmpath|rmpref|rng|roots|rose|rosser|rot90|rotate|rotate3d|round|rref|rsf2csf|run|save|saveas|"+ - "saveobj|savepath|scatter|scatter3|schur|sec|secd|sech|selectmoveresize|semilogx|semilogy|sendmail|serial|set|setappdata|setdiff|setenv|setfield|setpixelposition|setpref|setstr|"+ - "setxor|shading|shg|shiftdim|showplottool|shrinkfaces|sign|sin(?:d|h)?|size|slice|smooth3|snapnow|sort|sortrows|sound|soundsc|spalloc|spaugment|spconvert|spdiags|specular|speye|"+ - "spfun|sph2cart|sphere|spinmap|spline|spones|spparms|sprand|sprandn|sprandsym|sprank|spring|sprintf|spy|sqrt|sqrtm|squeeze|ss2tf|sscanf|stairs|startup|std|stem|stem3|stopasync|"+ - "str2double|str2func|str2mat|str2num|strcat|strcmp|strcmpi|stream2|stream3|streamline|streamparticles|streamribbon|streamslice|streamtube|strfind|strjust|strmatch|strncmp|"+ - "strncmpi|strread|strrep|strtok|strtrim|struct2cell|structfun|strvcat|sub2ind|subplot|subsasgn|subsindex|subspace|subsref|substruct|subvolume|sum|summer|superclasses|superiorto|"+ - "support|surf|surf2patch|surface|surfc|surfl|surfnorm|svd|svds|swapbytes|symamd|symbfact|symmlq|symrcm|symvar|system|tan(?:d|h)?|tar|tempdir|tempname|tetramesh|texlabel|text|"+ - "textread|textscan|textwrap|tfqmr|throw|tic|Tiff(?:\.(?:getTagNames|getVersion))?|timer|timerfind|timerfindall|times|timeseries|title|toc|todatenum|toeplitz|toolboxdir|trace|"+ - "transpose|trapz|treelayout|treeplot|tril|trimesh|triplequad|triplot|TriRep|TriScatteredInterp|trisurf|triu|tscollection|tsearch|tsearchn|tstool|type|typecast|uibuttongroup|"+ - "uicontextmenu|uicontrol|uigetdir|uigetfile|uigetpref|uiimport|uimenu|uiopen|uipanel|uipushtool|uiputfile|uiresume|uisave|uisetcolor|uisetfont|uisetpref|uistack|uitable|"+ - "uitoggletool|uitoolbar|uiwait|uminus|undocheckout|unicode2native|union|unique|unix|unloadlibrary|unmesh|unmkpp|untar|unwrap|unzip|uplus|upper|urlread|urlwrite|usejava|"+ - "userpath|validateattributes|validatestring|vander|var|vectorize|ver|verctrl|verLessThan|version|vertcat|VideoReader(?:\.isPlatformSupported)?|VideoWriter(?:\.getProfiles)?|"+ - "view|viewmtx|visdiff|volumebounds|voronoi|voronoin|wait|waitbar|waitfor|waitforbuttonpress|warndlg|warning|waterfall|wavfinfo|wavplay|wavread|wavrecord|wavwrite|web|weekday|"+ - "what|whatsnew|which|whitebg|who|whos|wilkinson|winopen|winqueryreg|winter|wk1finfo|wk1read|wk1write|workspace|xlabel|xlim|xlsfinfo|xlsread|xlswrite|xmlread|xmlwrite|xor|xslt|"+ - "ylabel|ylim|zeros|zip|zlabel|zlim|zoom|addedvarplot|andrewsplot|anova(?:1|2|n)|ansaribradley|aoctool|barttest|bbdesign|beta(?:cdf|fit|inv|like|pdf|rnd|stat)|bino(?:cdf|fit|inv|"+ - "pdf|rnd|stat)|biplot|bootci|bootstrp|boxplot|candexch|candgen|canoncorr|capability|capaplot|caseread|casewrite|categorical|ccdesign|cdfplot|chi2(?:cdf|gof|inv|pdf|rnd|stat)|"+ - "cholcov|Classification(?:BaggedEnsemble|Discriminant(?:\.(?:fit|make|template))?|Ensemble|KNN(?:\.(?:fit|template))?|PartitionedEnsemble|PartitionedModel|Tree(?:\.(?:fit|"+ - "template))?)|classify|classregtree|cluster|clusterdata|cmdscale|combnk|Compact(?:Classification(?:Discriminant|Ensemble|Tree)|Regression(?:Ensemble|Tree)|TreeBagger)|confusionmat|"+ - "controlchart|controlrules|cophenet|copula(?:cdf|fit|param|pdf|rnd|stat)|cordexch|corr|corrcov|coxphfit|createns|crosstab|crossval|cvpartition|datasample|dataset|daugment|dcovary|"+ - "dendrogram|dfittool|disttool|dummyvar|dwtest|ecdf|ecdfhist|ev(?:cdf|fit|inv|like|pdf|rnd|stat)|ExhaustiveSearcher|exp(?:cdf|fit|inv|like|pdf|rnd|stat)|factoran|fcdf|ff2n|finv|"+ - "fitdist|fitensemble|fpdf|fracfact|fracfactgen|friedman|frnd|fstat|fsurfht|fullfact|gagerr|gam(?:cdf|fit|inv|like|pdf|rnd|stat)|GeneralizedLinearModel(?:\.fit)?|geo(?:cdf|inv|mean|"+ - "pdf|rnd|stat)|gev(?:cdf|fit|inv|like|pdf|rnd|stat)|gline|glmfit|glmval|glyphplot|gmdistribution(?:\.fit)?|gname|gp(?:cdf|fit|inv|like|pdf|rnd|stat)|gplotmatrix|grp2idx|grpstats|"+ - "gscatter|haltonset|harmmean|hist3|histfit|hmm(?:decode|estimate|generate|train|viterbi)|hougen|hyge(?:cdf|inv|pdf|rnd|stat)|icdf|inconsistent|interactionplot|invpred|iqr|iwishrnd|"+ - "jackknife|jbtest|johnsrnd|KDTreeSearcher|kmeans|knnsearch|kruskalwallis|ksdensity|kstest|kstest2|kurtosis|lasso|lassoglm|lassoPlot|leverage|lhsdesign|lhsnorm|lillietest|"+ - "LinearModel(?:\.fit)?|linhyptest|linkage|logn(?:cdf|fit|inv|like|pdf|rnd|stat)|lsline|mad|mahal|maineffectsplot|manova1|manovacluster|mdscale|mhsample|mle|mlecov|mnpdf|"+ - "mnrfit|mnrnd|mnrval|moment|multcompare|multivarichart|mvn(?:cdf|pdf|rnd)|mvregress|mvregresslike|mvt(?:cdf|pdf|rnd)|NaiveBayes(?:\.fit)?|nan(?:cov|max|mean|median|min|std|"+ - "sum|var)|nbin(?:cdf|fit|inv|pdf|rnd|stat)|ncf(?:cdf|inv|pdf|rnd|stat)|nct(?:cdf|inv|pdf|rnd|stat)|ncx2(?:cdf|inv|pdf|rnd|stat)|NeighborSearcher|nlinfit|nlintool|nlmefit|nlmefitsa|"+ - "nlparci|nlpredci|nnmf|nominal|NonLinearModel(?:\.fit)?|norm(?:cdf|fit|inv|like|pdf|rnd|stat)|normplot|normspec|ordinal|outlierMeasure|parallelcoords|paretotails|partialcorr|"+ - "pcacov|pcares|pdf|pdist|pdist2|pearsrnd|perfcurve|perms|piecewisedistribution|plsregress|poiss(?:cdf|fit|inv|pdf|rnd|tat)|polyconf|polytool|prctile|princomp|ProbDist(?:Kernel|"+ - "Parametric|UnivKernel|UnivParam)?|probplot|procrustes|qqplot|qrandset|qrandstream|quantile|randg|random|randsample|randtool|range|rangesearch|ranksum|rayl(?:cdf|fit|inv|pdf|"+ - "rnd|stat)|rcoplot|refcurve|refline|regress|Regression(?:BaggedEnsemble|Ensemble|PartitionedEnsemble|PartitionedModel|Tree(?:\.(?:fit|template))?)|regstats|relieff|ridge|"+ - "robustdemo|robustfit|rotatefactors|rowexch|rsmdemo|rstool|runstest|sampsizepwr|scatterhist|sequentialfs|signrank|signtest|silhouette|skewness|slicesample|sobolset|squareform|"+ - "statget|statset|stepwise|stepwisefit|surfht|tabulate|tblread|tblwrite|tcdf|tdfread|tiedrank|tinv|tpdf|TreeBagger|treedisp|treefit|treeprune|treetest|treeval|trimmean|trnd|tstat|"+ - "ttest|ttest2|unid(?:cdf|inv|pdf|rnd|stat)|unif(?:cdf|inv|it|pdf|rnd|stat)|vartest(?:2|n)?|wbl(?:cdf|fit|inv|like|pdf|rnd|stat)|wblplot|wishrnd|x2fx|xptread|zscore|ztest"+ - "adapthisteq|analyze75info|analyze75read|applycform|applylut|axes2pix|bestblk|blockproc|bwarea|bwareaopen|bwboundaries|bwconncomp|bwconvhull|bwdist|bwdistgeodesic|bweuler|"+ - "bwhitmiss|bwlabel|bwlabeln|bwmorph|bwpack|bwperim|bwselect|bwtraceboundary|bwulterode|bwunpack|checkerboard|col2im|colfilt|conndef|convmtx2|corner|cornermetric|corr2|cp2tform|"+ - "cpcorr|cpselect|cpstruct2pairs|dct2|dctmtx|deconvblind|deconvlucy|deconvreg|deconvwnr|decorrstretch|demosaic|dicom(?:anon|dict|info|lookup|read|uid|write)|edge|edgetaper|entropy|"+ - "entropyfilt|fan2para|fanbeam|findbounds|fliptform|freqz2|fsamp2|fspecial|ftrans2|fwind1|fwind2|getheight|getimage|getimagemodel|getline|getneighbors|getnhood|getpts|"+ - "getrangefromclass|getrect|getsequence|gray2ind|graycomatrix|graycoprops|graydist|grayslice|graythresh|hdrread|hdrwrite|histeq|hough|houghlines|houghpeaks|iccfind|iccread|"+ - "iccroot|iccwrite|idct2|ifanbeam|im2bw|im2col|im2double|im2int16|im2java2d|im2single|im2uint16|im2uint8|imabsdiff|imadd|imadjust|ImageAdapter|imageinfo|imagemodel|imapplymatrix|"+ - "imattributes|imbothat|imclearborder|imclose|imcolormaptool|imcomplement|imcontour|imcontrast|imcrop|imdilate|imdisplayrange|imdistline|imdivide|imellipse|imerode|imextendedmax|"+ - "imextendedmin|imfill|imfilter|imfindcircles|imfreehand|imfuse|imgca|imgcf|imgetfile|imhandles|imhist|imhmax|imhmin|imimposemin|imlincomb|imline|immagbox|immovie|immultiply|imnoise|"+ - "imopen|imoverview|imoverviewpanel|impixel|impixelinfo|impixelinfoval|impixelregion|impixelregionpanel|implay|impoint|impoly|impositionrect|improfile|imputfile|impyramid|"+ - "imreconstruct|imrect|imregconfig|imregionalmax|imregionalmin|imregister|imresize|imroi|imrotate|imsave|imscrollpanel|imshow|imshowpair|imsubtract|imtool|imtophat|imtransform|"+ - "imview|ind2gray|ind2rgb|interfileinfo|interfileread|intlut|ippl|iptaddcallback|iptcheckconn|iptcheckhandle|iptcheckinput|iptcheckmap|iptchecknargin|iptcheckstrs|iptdemos|iptgetapi|"+ - "iptGetPointerBehavior|iptgetpref|ipticondir|iptnum2ordinal|iptPointerManager|iptprefs|iptremovecallback|iptSetPointerBehavior|iptsetpref|iptwindowalign|iradon|isbw|isflat|isgray|"+ - "isicc|isind|isnitf|isrgb|isrset|lab2double|lab2uint16|lab2uint8|label2rgb|labelmatrix|makecform|makeConstrainToRectFcn|makehdr|makelut|makeresampler|maketform|mat2gray|mean2|"+ - "medfilt2|montage|nitfinfo|nitfread|nlfilter|normxcorr2|ntsc2rgb|openrset|ordfilt2|otf2psf|padarray|para2fan|phantom|poly2mask|psf2otf|qtdecomp|qtgetblk|qtsetblk|radon|rangefilt|"+ - "reflect|regionprops|registration\.metric\.(?:MattesMutualInformation|MeanSquares)|registration\.optimizer\.(?:OnePlusOneEvolutionary|RegularStepGradientDescent)|rgb2gray|"+ - "rgb2ntsc|rgb2ycbcr|roicolor|roifill|roifilt2|roipoly|rsetwrite|std2|stdfilt|strel|stretchlim|subimage|tformarray|tformfwd|tforminv|tonemap|translate|truesize|uintlut|viscircles|"+ - "warp|watershed|whitepoint|wiener2|xyz2double|xyz2uint16|ycbcr2rgb|bintprog|color|fgoalattain|fminbnd|fmincon|fminimax|fminsearch|fminunc|fseminf|fsolve|fzero|fzmult|gangstr|ktrlink|"+ - "linprog|lsqcurvefit|lsqlin|lsqnonlin|lsqnonneg|optimget|optimset|optimtool|quadprog" - ); - var storageType = ( - "cell|struct|char|double|single|logical|u?int(?:8|16|32|64)|sparse" - ); - var keywordMapper = this.createKeywordMapper({ - "storage.type": storageType, - "support.function": builtinFunctions, - "keyword": keywords, - "constant.language": builtinConstants - }, "identifier", true); - - this.$rules = { - "start" : [ { - token : "comment", - regex : "^%[^\r\n]*" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "string", // ' string - regex : "'.*?'" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } ] - }; -}; - -oop.inherits(MatlabHighlightRules, TextHighlightRules); - -exports.MatlabHighlightRules = MatlabHighlightRules; -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/mode-mel.js b/util/build-sample-browser/player/vendor/ace/mode-mel.js deleted file mode 100644 index 5623f50a55..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-mel.js +++ /dev/null @@ -1,600 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/mel', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/mel_highlight_rules', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var MELHighlightRules = require("./mel_highlight_rules").MELHighlightRules; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = MELHighlightRules; - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/mel"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/mel_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var MELHighlightRules = function() { - - this.$rules = { start: - [ { caseInsensitive: true, - token: 'storage.type.mel', - regex: '\\b(matrix|string|vector|float|int|void)\\b' }, - { caseInsensitive: true, - token: 'support.function.mel', - regex: '\\b((s(h(ow(ManipCtx|S(hadingGroupAttrEditor|electionInTitle)|H(idden|elp)|Window)|el(f(Button|TabLayout|Layout)|lField)|ading(GeometryRelCtx|Node|Connection|LightRelCtx))|y(s(tem|File)|mbol(Button|CheckBox))|nap(shot|Mode|2to2 |TogetherCtx|Key)|c(ulpt|ene(UIReplacement|Editor)|ale(BrushBrightness |Constraint|Key(Ctx)?)?|r(ipt(Node|Ctx|Table|edPanel(Type)?|Job|EditorInfo)|oll(Field|Layout))|mh)|t(itch(Surface(Points)?|AndExplodeShell )|a(ckTrace|rt(sWith |String ))|r(cmp|i(ng(ToStringArray |Array(Remove(Duplicates | )|C(ount |atenate )|ToString |Intersector))|p )|oke))|i(n(gleProfileBirailSurface)?|ze|gn|mplify)|o(u(nd(Control)?|rce)|ft(Mod(Ctx)?)?|rt)|u(perCtx|rface(S(haderList|ampler))?|b(st(itute(Geometry|AllString )?|ring)|d(M(irror|a(tchTopology|p(SewMove|Cut)))|iv(Crease|DisplaySmoothness)?|C(ollapse|leanTopology)|T(o(Blind|Poly)|ransferUVsToCache)|DuplicateAndConnect|EditUV|ListComponentConversion|AutoProjection)))|p(h(ere|rand)|otLight(PreviewPort)?|aceLocator|r(ing|eadSheetEditor))|e(t(s|MenuMode|Sta(te |rtupMessage|mpDensity )|NodeTypeFlag|ConstraintRestPosition |ToolTo|In(putDeviceMapping|finity)|D(ynamic|efaultShadingGroup|rivenKeyframe)|UITemplate|P(ar(ticleAttr|ent)|roject )|E(scapeCtx|dit(or|Ctx))|Key(Ctx|frame|Path)|F(ocus|luidAttr)|Attr(Mapping)?)|parator|ed|l(ect(Mode|ionConnection|Context|Type|edNodes|Pr(iority|ef)|Key(Ctx)?)?|LoadSettings)|archPathArray )|kin(Cluster|Percent)|q(uareSurface|rt)|w(itchTable|atchDisplayPort)|a(ve(Menu|Shelf|ToolSettings|I(nitialState|mage)|Pref(s|Objects)|Fluid|A(ttrPreset |llShelves))|mpleImage)|rtContext|mooth(step|Curve|TangentSurface))|h(sv_to_rgb|yp(ot|er(Graph|Shade|Panel))|i(tTest|de|lite)|ot(Box|key(Check)?)|ud(Button|Slider(Button)?)|e(lp(Line)?|adsUpDisplay|rmite)|wRe(nder(Load)?|flectionMap)|ard(enPointCurve|ware(RenderPanel)?))|n(o(nLinear|ise|de(Type|IconButton|Outliner|Preset)|rmal(ize |Constraint))|urbs(Boolean|S(elect|quare)|C(opyUVSet|ube)|To(Subdiv|Poly(gonsPref)?)|Plane|ViewDirectionVector )|ew(ton|PanelItems)|ame(space(Info)?|Command|Field))|c(h(oice|dir|eck(Box(Grp)?|DefaultRenderGlobals)|a(n(nelBox|geSubdiv(Region|ComponentDisplayLevel))|racter(Map|OutlineEditor)?))|y(cleCheck|linder)|tx(Completion|Traverse|EditMode|Abort)|irc(ularFillet|le)|o(s|n(str(uctionHistory|ain(Value)?)|nect(ionInfo|Control|Dynamic|Joint|Attr)|t(extInfo|rol)|dition|e|vert(SolidTx|Tessellation|Unit|FromOldLayers |Lightmap)|firmDialog)|py(SkinWeights|Key|Flexor|Array )|l(or(Slider(Grp|ButtonGrp)|Index(SliderGrp)?|Editor|AtPoint)?|umnLayout|lision)|arsenSubdivSelectionList|m(p(onentEditor|utePolysetVolume |actHairSystem )|mand(Port|Echo|Line)))|u(tKey|r(ve(MoveEPCtx|SketchCtx|CVCtx|Intersect|OnSurface|E(ditorCtx|PCtx)|AddPtCtx)?|rent(Ctx|Time(Ctx)?|Unit)))|p(GetSolverAttr|Button|S(olver(Types)?|e(t(SolverAttr|Edit)|am))|C(o(nstraint|llision)|ache)|Tool|P(anel|roperty))|eil|l(ip(Schedule(rOutliner)?|TrimBefore |Editor(CurrentTimeCtx)?)?|ose(Surface|Curve)|uster|ear(Cache)?|amp)|a(n(CreateManip|vas)|tch(Quiet)?|pitalizeString |mera(View)?)|r(oss(Product )?|eate(RenderLayer|MotionField |SubdivRegion|N(ode|ewShelf )|D(isplayLayer|rawCtx)|Editor))|md(Shell|FileOutput))|M(R(ender(ShadowData|Callback|Data|Util|View|Line(Array)?)|ampAttribute)|G(eometryData|lobal)|M(odelMessage|essage|a(nipData|t(erial|rix)))|BoundingBox|S(yntax|ceneMessage|t(atus|ring(Array)?)|imple|pace|elect(ion(Mask|List)|Info)|watchRender(Register|Base))|H(ardwareRenderer|WShaderSwatchGenerator)|NodeMessage|C(o(nditionMessage|lor(Array)?|m(putation|mand(Result|Message)))|ursor|loth(Material|S(ystem|olverRegister)|Con(straint|trol)|Triangle|Particle|Edge|Force)|allbackIdArray)|T(ypeId|ime(r(Message)?|Array)?|oolsInfo|esselationParams|r(imBoundaryArray|ansformationMatrix))|I(ntArray|t(Geometry|Mesh(Polygon|Edge|Vertex|FaceVertex)|S(urfaceCV|electionList)|CurveCV|Instancer|eratorType|D(ependency(Graph|Nodes)|ag)|Keyframe)|k(System|HandleGroup)|mage)|3dView|Object(SetMessage|Handle|Array)?|D(G(M(odifier|essage)|Context)|ynSwept(Triangle|Line)|istance|oubleArray|evice(State|Channel)|a(ta(Block|Handle)|g(M(odifier|essage)|Path(Array)?))|raw(Request(Queue)?|Info|Data|ProcedureBase))|U(serEventMessage|i(nt(Array|64Array)|Message))|P(o(int(Array)?|lyMessage)|lug(Array)?|rogressWindow|x(G(eometry(Iterator|Data)|lBuffer)|M(idiInputDevice|odelEditorCommand|anipContainer)|S(urfaceShape(UI)?|pringNode|electionContext)|HwShaderNode|Node|Co(ntext(Command)?|m(ponentShape|mand))|T(oolCommand|ransform(ationMatrix)?)|IkSolver(Node)?|3dModelView|ObjectSet|D(eformerNode|ata|ragAndDropBehavior)|PolyT(weakUVCommand|rg)|EmitterNode|F(i(eldNode|leTranslator)|luidEmitterNode)|LocatorNode))|E(ulerRotation|vent(Message)?)|ayatomr|Vector(Array)?|Quaternion|F(n(R(otateManip|eflectShader|adialField)|G(e(nericAttribute|ometry(Data|Filter))|ravityField)|M(otionPath|es(sageAttribute|h(Data)?)|a(nip3D|trix(Data|Attribute)))|B(l(innShader|endShapeDeformer)|ase)|S(caleManip|t(ateManip|ring(Data|ArrayData))|ingleIndexedComponent|ubd(Names|Data)?|p(hereData|otLight)|et|kinCluster)|HikEffector|N(on(ExtendedLight|AmbientLight)|u(rbs(Surface(Data)?|Curve(Data)?)|meric(Data|Attribute))|ewtonField)|C(haracter|ircleSweepManip|ompo(nent(ListData)?|undAttribute)|urveSegmentManip|lip|amera)|T(ypedAttribute|oggleManip|urbulenceField|r(ipleIndexedComponent|ansform))|I(ntArrayData|k(Solver|Handle|Joint|Effector))|D(ynSweptGeometryData|i(s(cManip|tanceManip)|rection(Manip|alLight))|ouble(IndexedComponent|ArrayData)|ependencyNode|a(ta|gNode)|ragField)|U(ni(tAttribute|formField)|Int64ArrayData)|P(hong(Shader|EShader)|oint(On(SurfaceManip|CurveManip)|Light|ArrayData)|fxGeometry|lugin(Data)?|arti(cleSystem|tion))|E(numAttribute|xpression)|V(o(lume(Light|AxisField)|rtexField)|ectorArrayData)|KeyframeDelta(Move|B(lockAddRemove|reakdown)|Scale|Tangent|InfType|Weighted|AddRemove)?|F(ield|luid|reePointTriadManip)|W(ireDeformer|eightGeometryFilter)|L(ight(DataAttribute)?|a(yeredShader|ttice(D(eformer|ata))?|mbertShader))|A(ni(sotropyShader|mCurve)|ttribute|irField|r(eaLight|rayAttrsData)|mbientLight))?|ile(IO|Object)|eedbackLine|loat(Matrix|Point(Array)?|Vector(Array)?|Array))|L(i(ghtLinks|brary)|ockMessage)|A(n(im(Message|C(ontrol|urveC(hange|lipboard(Item(Array)?)?))|Util)|gle)|ttribute(Spec(Array)?|Index)|r(rayData(Builder|Handle)|g(Database|Parser|List))))|t(hreePointArcCtx|ime(Control|Port|rX)|o(ol(Button|HasOptions|Collection|Dropped|PropertyWindow)|NativePath |upper|kenize(List )?|l(ower|erance)|rus|ggle(WindowVisibility|Axis)?)|u(rbulence|mble(Ctx)?)|ex(RotateContext|M(oveContext|anipContext)|t(ScrollList|Curves|ure(HairColor |DisplacePlane |PlacementContext|Window)|ToShelf |Field(Grp|ButtonGrp)?)?|S(caleContext|electContext|mudgeUVContext)|WinToolCtx)|woPointArcCtx|a(n(gentConstraint)?|bLayout)|r(im|unc(ate(HairCache|FluidCache))?|a(ns(formLimits|lator)|c(e|k(Ctx)?))))|i(s(olateSelect|Connected|True|Dirty|ParentOf |Valid(String |ObjectName |UiName )|AnimCurve )|n(s(tance(r)?|ert(Joint(Ctx)?|K(not(Surface|Curve)|eyCtx)))|heritTransform|t(S(crollBar|lider(Grp)?)|er(sect|nalVar|ToUI )|Field(Grp)?))|conText(Radio(Button|Collection)|Button|StaticLabel|CheckBox)|temFilter(Render|Type|Attr)?|prEngine|k(S(ystem(Info)?|olver|plineHandleCtx)|Handle(Ctx|DisplayScale)?|fkDisplayMethod)|m(portComposerCurves |fPlugins|age))|o(ceanNurbsPreviewPlane |utliner(Panel|Editor)|p(tion(Menu(Grp)?|Var)|en(GLExtension|MayaPref))|verrideModifier|ffset(Surface|Curve(OnSurface)?)|r(ientConstraint|bit(Ctx)?)|b(soleteProc |j(ect(Center|Type(UI)?|Layer )|Exists)))|d(yn(RelEd(itor|Panel)|Globals|C(ontrol|ache)|P(a(intEditor|rticleCtx)|ref)|Exp(ort|ression)|amicLoad)|i(s(connect(Joint|Attr)|tanceDim(Context|ension)|pla(y(RGBColor|S(tats|urface|moothness)|C(olor|ull)|Pref|LevelOfDetail|Affected)|cementToPoly)|kCache|able)|r(name |ect(ionalLight|KeyCtx)|map)|mWhen)|o(cServer|Blur|t(Product )?|ubleProfileBirailSurface|peSheetEditor|lly(Ctx)?)|uplicate(Surface|Curve)?|e(tach(Surface|Curve|DeviceAttr)|vice(Panel|Editor)|f(ine(DataServer|VirtualDevice)|ormer|ault(Navigation|LightListCheckBox))|l(ete(Sh(elfTab |adingGroupsAndMaterials )|U(nusedBrushes |I)|Attr)?|randstr)|g_to_rad)|agPose|r(opoffLocator|ag(gerContext)?)|g(timer|dirty|Info|eval))|CBG |u(serCtx|n(t(angleUV|rim)|i(t|form)|do(Info)?|loadPlugin|assignInputDevice|group)|iTemplate|p(dateAE |Axis)|v(Snapshot|Link))|joint(C(tx|luster)|DisplayScale|Lattice)?|p(sd(ChannelOutliner|TextureFile|E(ditTextureFile|xport))|close|i(c(ture|kWalk)|xelMove)|o(se|int(MatrixMult |C(onstraint|urveConstraint)|On(Surface|Curve)|Position|Light)|p(upMenu|en)|w|l(y(Reduce|GeoSampler|M(irrorFace|ove(UV|Edge|Vertex|Facet(UV)?)|erge(UV|Edge(Ctx)?|Vertex|Facet(Ctx)?)|ap(Sew(Move)?|Cut|Del))|B(oolOp|evel|l(indData|endColor))|S(traightenUVBorder|oftEdge|u(perCtx|bdivide(Edge|Facet))|p(her(icalProjection|e)|lit(Ring|Ctx|Edge|Vertex)?)|e(tToFaceNormal|parate|wEdge|lect(Constraint(Monitor)?|EditCtx))|mooth)|Normal(izeUV|PerVertex)?|C(hipOff|ylind(er|ricalProjection)|o(ne|pyUV|l(or(BlindData|Set|PerVertex)|lapse(Edge|Facet)))|u(t(Ctx)?|be)|l(ipboard|oseBorder)|acheMonitor|rea(seEdge|teFacet(Ctx)?))|T(o(Subdiv|rus)|r(iangulate|ansfer))|In(stallAction|fo)|Options|D(uplicate(Edge|AndConnect)|el(Edge|Vertex|Facet))|U(nite|VSet)|P(yramid|oke|lan(e|arProjection)|r(ism|ojection))|E(ditUV|valuate|xtrude(Edge|Facet))|Qu(eryBlindData|ad)|F(orceUV|lip(UV|Edge))|WedgeFace|L(istComponentConversion|ayoutUV)|A(utoProjection|ppend(Vertex|FacetCtx)?|verage(Normal|Vertex)))|eVectorConstraint))|utenv|er(cent|formanceOptions)|fxstrokes|wd|l(uginInfo|a(y(b(last|ackOptions))?|n(e|arSrf)))|a(steKey|ne(l(History|Configuration)?|Layout)|thAnimation|irBlend|use|lettePort|r(ti(cle(RenderInfo|Instancer|Exists)?|tion)|ent(Constraint)?|am(Dim(Context|ension)|Locator)))|r(int|o(j(ect(ion(Manip|Context)|Curve|Tangent)|FileViewer)|pMo(dCtx|ve)|gress(Bar|Window)|mptDialog)|eloadRefEd))|e(n(codeString|d(sWith |String )|v|ableDevice)|dit(RenderLayer(Globals|Members)|or(Template)?|DisplayLayer(Globals|Members)|AttrLimits )|v(ent|al(Deferred|Echo)?)|quivalent(Tol | )|ffector|r(f|ror)|x(clusiveLightCheckBox|t(end(Surface|Curve)|rude)|ists|p(ortComposerCurves |ression(EditorListen)?)?|ec(uteForEachObject )?|actWorldBoundingBox)|mit(ter)?)|v(i(sor|ew(Set|HeadOn|2dToolCtx|C(lipPlane|amera)|Place|Fit|LookAt))|o(lumeAxis|rtex)|e(ctorize|rifyCmd )|alidateShelfName )|key(Tangent|frame(Region(MoveKeyCtx|S(caleKeyCtx|e(tKeyCtx|lectKeyCtx))|CurrentTimeCtx|TrackCtx|InsertKeyCtx|D(irectKeyCtx|ollyCtx))|Stats|Outliner)?)|qu(it|erySubdiv)|f(c(heck|lose)|i(nd(RelatedSkinCluster |MenuItem |er|Keyframe|AllIntersections )|tBspline|l(ter(StudioImport|Curve|Expand)?|e(BrowserDialog|test|Info|Dialog|Extension )?|letCurve)|rstParentOf )|o(ntDialog|pen|rmLayout)|print|eof|flush|write|l(o(or|w|at(S(crollBar|lider(Grp|ButtonGrp|2)?)|Eq |Field(Grp)?))|u(shUndo|id(CacheInfo|Emitter|VoxelInfo))|exor)|r(omNativePath |e(eFormFillet|wind|ad)|ameLayout)|get(word|line)|mod)|w(hatIs|i(ndow(Pref)?|re(Context)?)|orkspace|ebBrowser(Prefs)?|a(itCursor|rning)|ri(nkle(Context)?|teTake))|l(s(T(hroughFilter|ype )|UI)?|i(st(Relatives|MenuAnnotation |Sets|History|NodeTypes|C(onnections|ameras)|Transforms |InputDevice(s|Buttons|Axes)|erEditor|DeviceAttachments|Unselected |A(nimatable|ttr))|n(step|eIntersection )|ght(link|List(Panel|Editor)?))|o(ckNode|okThru|ft|ad(NewShelf |P(lugin|refObjects)|Fluid)|g)|a(ssoContext|y(out|er(Button|ed(ShaderPort|TexturePort)))|ttice(DeformKeyCtx)?|unch(ImageEditor)?))|a(ssign(Command|InputDevice)|n(notate|im(C(one|urveEditor)|Display|View)|gle(Between)?)|tt(ach(Surface|Curve|DeviceAttr)|r(ibute(Menu|Info|Exists|Query)|NavigationControlGrp|Co(ntrolGrp|lorSliderGrp|mpatibility)|PresetEditWin|EnumOptionMenu(Grp)?|Field(Grp|SliderGrp)))|i(r|mConstraint)|d(d(NewShelfTab|Dynamic|PP|Attr(ibuteEditorNodeHelp)?)|vanceToNextDrivenKey)|uto(Place|Keyframe)|pp(endStringArray|l(y(Take|AttrPreset)|icationName))|ffect(s|edNet)|l(i(as(Attr)?|gn(Surface|C(tx|urve))?)|lViewFit)|r(c(len|Len(DimContext|gthDimension))|t(BuildPaintMenu|Se(tPaintCtx|lectCtx)|3dPaintCtx|UserPaintCtx|PuttyCtx|FluidAttrCtx|Attr(SkinPaintCtx|Ctx|PaintVertexCtx))|rayMapper)|mbientLight|b(s|out))|r(igid(Body|Solver)|o(t(at(ionInterpolation|e))?|otOf |undConstantRadius|w(ColumnLayout|Layout)|ll(Ctx)?)|un(up|TimeCommand)|e(s(olutionNode|et(Tool|AE )|ampleFluid)|hash|n(der(GlobalsNode|Manip|ThumbnailUpdate|Info|er|Partition|QualityNode|Window(SelectContext|Editor)|LayerButton)?|ame(SelectionList |UI|Attr)?)|cord(Device|Attr)|target|order(Deformers)?|do|v(olve|erse(Surface|Curve))|quires|f(ineSubdivSelectionList|erence(Edit|Query)?|resh(AE )?)|loadImage|adTake|root|move(MultiInstance|Joint)|build(Surface|Curve))|a(n(d(state|omizeFollicles )?|geControl)|d(i(o(MenuItemCollection|Button(Grp)?|Collection)|al)|_to_deg)|mpColorPort)|gb_to_hsv)|g(o(toBindPose |al)|e(t(M(odifiers|ayaPanelTypes )|Classification|InputDeviceRange|pid|env|DefaultBrush|Pa(nel|rticleAttr)|F(ileList|luidAttr)|A(ttr|pplicationVersionAsFloat ))|ometryConstraint)|l(Render(Editor)?|obalStitch)|a(uss|mma)|r(id(Layout)?|oup(ObjectsByName )?|a(dientControl(NoAttr)?|ph(SelectContext|TrackCtx|DollyCtx)|vity|bColor))|match)|x(pmPicker|form|bmLangPathList )|m(i(n(imizeApp)?|rrorJoint)|o(del(CurrentTimeCtx|Panel|Editor)|use|v(In|e(IKtoFK |VertexAlongDirection|KeyCtx)?|Out))|u(te|ltiProfileBirailSurface)|e(ssageLine|nu(BarLayout|Item(ToShelf )?|Editor)?|mory)|a(nip(Rotate(Context|LimitsCtx)|Move(Context|LimitsCtx)|Scale(Context|LimitsCtx)|Options)|tch|ke(Roll |SingleSurface|TubeOn |Identity|Paintable|bot|Live)|rker|g|x))|b(in(Membership|d(Skin|Pose))|o(neLattice|undary|x(ZoomCtx|DollyCtx))|u(tton(Manip)?|ild(BookmarkMenu|KeyframeMenu)|fferCurve)|e(ssel|vel(Plus)?)|l(indDataType|end(Shape(Panel|Editor)?|2|TwoAttr))|a(sename(Ex | )|tchRender|ke(Results|Simulation|Clip|PartialHistory|FluidShading )))))\\b' }, - { caseInsensitive: true, - token: 'support.constant.mel', - regex: '\\b(s(h(ellTessellate|a(d(ing(Map|Engine)|erGlow)|pe))|n(ow|apshot(Shape)?)|c(ulpt|aleConstraint|ript)|t(yleCurve|itch(Srf|AsNurbsShell)|u(cco|dioClearCoat)|encil|roke(Globals)?)|i(ngleShadingSwitch|mpleVolumeShader)|o(ftMod(Manip|Handle)?|lidFractal)|u(rface(Sha(der|pe)|Info|EdManip|VarGroup|Luminance)|b(Surface|d(M(odifier(UV|World)?|ap(SewMove|Cut|pingManip))|B(lindData|ase)|iv(ReverseFaces|SurfaceVarGroup|Co(llapse|mponentId)|To(Nurbs|Poly))?|HierBlind|CleanTopology|Tweak(UV)?|P(lanarProj|rojManip)|LayoutUV|A(ddTopology|utoProj))|Curve))|p(BirailSrf|otLight|ring)|e(tRange|lectionListOperator)|k(inCluster|etchPlane)|quareSrf|ampler(Info)?|m(ooth(Curve|TangentSrf)|ear))|h(svToRgb|yper(GraphInfo|View|Layout)|ik(Solver|Handle|Effector)|oldMatrix|eightField|w(Re(nderGlobals|flectionMap)|Shader)|a(ir(System|Constraint|TubeShader)|rd(enPoint|wareRenderGlobals)))|n(o(n(ExtendedLightShapeNode|Linear|AmbientLightShapeNode)|ise|rmalConstraint)|urbs(Surface|Curve|T(oSubdiv(Proc)?|essellate)|DimShape)|e(twork|wtonField))|c(h(o(ice|oser)|ecker|aracter(Map|Offset)?)|o(n(straint|tr(olPoint|ast)|dition)|py(ColorSet|UVSet))|urve(Range|Shape|Normalizer(Linear|Angle)?|In(tersect|fo)|VarGroup|From(Mesh(CoM|Edge)?|Su(rface(Bnd|CoS|Iso)?|bdiv(Edge|Face)?)))|l(ip(Scheduler|Library)|o(se(stPointOnSurface|Surface|Curve)|th|ud)|uster(Handle)?|amp)|amera(View)?|r(eate(BPManip|ColorSet|UVSet)|ater))|t(ime(ToUnitConversion|Function)?|oo(nLineAttributes|lDrawManip)|urbulenceField|ex(BaseDeformManip|ture(BakeSet|2d|ToGeom|3d|Env)|SmudgeUVManip|LatticeDeformManip)|weak|angentConstraint|r(i(pleShadingSwitch|m(WithBoundaries)?)|ansform(Geometry)?))|i(n(s(tancer|ertKnot(Surface|Curve))|tersectSurface)|k(RPsolver|MCsolver|S(ystem|olver|Csolver|plineSolver)|Handle|PASolver|Effector)|m(plicit(Box|Sphere|Cone)|agePlane))|o(cean(Shader)?|pticalFX|ffset(Surface|C(os|urve))|ldBlindDataBase|rient(Constraint|ationMarker)|bject(RenderFilter|MultiFilter|BinFilter|S(criptFilter|et)|NameFilter|TypeFilter|Filter|AttrFilter))|d(yn(Globals|Base)|i(s(tance(Between|DimShape)|pla(yLayer(Manager)?|cementShader)|kCache)|rect(ionalLight|edDisc)|mensionShape)|o(ubleShadingSwitch|f)|pBirailSrf|e(tach(Surface|Curve)|pendNode|f(orm(Bend|S(ine|quash)|Twist|ableShape|F(unc|lare)|Wave)|ault(RenderUtilityList|ShaderList|TextureList|LightList))|lete(Co(lorSet|mponent)|UVSet))|ag(Node|Pose)|r(opoffLocator|agField))|u(seBackground|n(trim|i(t(Conversion|ToTimeConversion)|formField)|known(Transform|Dag)?)|vChooser)|j(iggle|oint(Cluster|Ffd|Lattice)?)|p(sdFileTex|hong(E)?|o(s(tProcessList|itionMarker)|int(MatrixMult|Constraint|On(SurfaceInfo|CurveInfo)|Emitter|Light)|l(y(Reduce|M(irror|o(difier(UV|World)?|ve(UV|Edge|Vertex|Face(tUV)?))|erge(UV|Edge|Vert|Face)|ap(Sew(Move)?|Cut|Del))|B(oolOp|evel|lindData|ase)|S(traightenUVBorder|oftEdge|ubd(Edge|Face)|p(h(ere|Proj)|lit(Ring|Edge|Vert)?)|e(parate|wEdge)|mooth(Proxy|Face)?)|Normal(izeUV|PerVertex)?|C(hipOff|yl(inder|Proj)|o(ne|pyUV|l(orPerVertex|lapse(Edge|F)))|u(t(Manip(Container)?)?|be)|loseBorder|rea(seEdge|t(or|eFace)))|T(o(Subdiv|rus)|weak(UV)?|r(iangulate|ansfer))|OptUvs|D(uplicateEdge|el(Edge|Vertex|Facet))|Unite|P(yramid|oke(Manip)?|lan(e|arProj)|r(i(sm|mitive)|oj))|Extrude(Edge|Vertex|Face)|VertexNormalManip|Quad|Flip(UV|Edge)|WedgeFace|LayoutUV|A(utoProj|ppend(Vertex)?|verageVertex))|eVectorConstraint))|fx(Geometry|Hair|Toon)|l(usMinusAverage|a(n(e|arTrimSurface)|ce(2dTexture|3dTexture)))|a(ssMatrix|irBlend|r(ti(cle(SamplerInfo|C(olorMapper|loud)|TranspMapper|IncandMapper|AgeMapper)?|tion)|ent(Constraint|Tessellate)|amDimension))|r(imitive|o(ject(ion|Curve|Tangent)|xyManager)))|e(n(tity|v(Ball|ironmentFog|S(phere|ky)|C(hrome|ube)|Fog))|x(t(end(Surface|Curve)|rude)|p(lodeNurbsShell|ression)))|v(iewManip|o(lume(Shader|Noise|Fog|Light|AxisField)|rtexField)|e(ctor(RenderGlobals|Product)|rtexBakeSet))|quadShadingSwitch|f(i(tBspline|eld|l(ter(Resample|Simplify|ClosestSample|Euler)?|e|letCurve))|o(urByFourMatrix|llicle)|urPointOn(MeshInfo|Subd)|f(BlendSrf(Obsolete)?|d|FilletSrf)|l(ow|uid(S(hape|liceManip)|Texture(2D|3D)|Emitter)|exorShape)|ra(ctal|meCache))|w(tAddMatrix|ire|ood|eightGeometryFilter|ater|rap)|l(ight(Info|Fog|Li(st|nker))?|o(cator|okAt|d(Group|Thresholds)|ft)|uminance|ea(stSquaresModifier|ther)|a(yered(Shader|Texture)|ttice|mbert))|a(n(notationShape|i(sotropic|m(Blend(InOut)?|C(urve(T(T|U|L|A)|U(T|U|L|A))?|lip)))|gleBetween)|tt(ach(Surface|Curve)|rHierarchyTest)|i(rField|mConstraint)|dd(Matrix|DoubleLinear)|udio|vg(SurfacePoints|NurbsSurfacePoints|Curves)|lign(Manip|Surface|Curve)|r(cLengthDimension|tAttrPaintTest|eaLight|rayMapper)|mbientLight|bstractBase(NurbsConversion|Create))|r(igid(Body|Solver|Constraint)|o(ck|undConstantRadius)|e(s(olution|ultCurve(TimeTo(Time|Unitless|Linear|Angular))?)|nder(Rect|Globals(List)?|Box|Sphere|Cone|Quality|L(ight|ayer(Manager)?))|cord|v(olve(dPrimitive)?|erse(Surface|Curve)?)|f(erence|lect)|map(Hsv|Color|Value)|build(Surface|Curve))|a(dialField|mp(Shader)?)|gbToHsv|bfSrf)|g(uide|eo(Connect(or|able)|metry(Shape|Constraint|VarGroup|Filter))|lobal(Stitch|CacheControl)|ammaCorrect|r(id|oup(Id|Parts)|a(nite|vityField)))|Fur(Globals|Description|Feedback|Attractors)|xformManip|m(o(tionPath|untain|vie)|u(te|lt(Matrix|i(plyDivide|listerLight)|DoubleLinear))|pBirailSrf|e(sh(VarGroup)?|ntalray(Texture|IblShape))|a(terialInfo|ke(Group|Nurb(sSquare|Sphere|C(ylinder|ircle|one|ube)|Torus|Plane)|CircularArc|T(hreePointCircularArc|extCurves|woPointCircularArc))|rble))|b(irailSrf|o(neLattice|olean|undary(Base)?)|u(lge|mp(2d|3d))|evel(Plus)?|l(in(n|dDataTemplate)|end(Shape|Color(s|Sets)|TwoAttr|Device|Weighted)?)|a(se(GeometryVarGroup|ShadingSwitch|Lattice)|keSet)|r(ownian|ush)))\\b' }, - { caseInsensitive: true, - token: 'keyword.control.mel', - regex: '\\b(if|in|else|for|while|break|continue|case|default|do|switch|return|switch|case|source|catch|alias)\\b' }, - { token: 'keyword.other.mel', regex: '\\b(global)\\b' }, - { caseInsensitive: true, - token: 'constant.language.mel', - regex: '\\b(null|undefined)\\b' }, - { token: 'constant.numeric.mel', - regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b' }, - { token: 'punctuation.definition.string.begin.mel', - regex: '"', - push: - [ { token: 'constant.character.escape.mel', regex: '\\\\.' }, - { token: 'punctuation.definition.string.end.mel', - regex: '"', - next: 'pop' }, - { defaultToken: 'string.quoted.double.mel' } ] }, - - { token: [ 'variable.other.mel', 'punctuation.definition.variable.mel' ], - regex: '(\\$)([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*?\\b)' }, - - { token: 'punctuation.definition.string.begin.mel', - regex: '\'', - push: - [ { token: 'constant.character.escape.mel', regex: '\\\\.' }, - { token: 'punctuation.definition.string.end.mel', - regex: '\'', - next: 'pop' }, - { defaultToken: 'string.quoted.single.mel' } ] }, - - { token: 'constant.language.mel', - regex: '\\b(false|true|yes|no|on|off)\\b' }, - - { token: 'punctuation.definition.comment.mel', - regex: '/\\*', - push: - [ { token: 'punctuation.definition.comment.mel', - regex: '\\*/', - next: 'pop' }, - { defaultToken: 'comment.block.mel' } ] }, - - { token: [ 'comment.line.double-slash.mel', 'punctuation.definition.comment.mel' ], - regex: '(//)(.*$\\n?)' }, - - { caseInsensitive: true, - token: 'keyword.operator.mel', - regex: '\\b(instanceof)\\b' }, - { token: 'keyword.operator.symbolic.mel', - regex: '[-\\!\\%\\&\\*\\+\\=\\/\\?\\:]' }, - - { token: [ 'meta.preprocessor.mel', 'punctuation.definition.preprocessor.mel' ], - regex: '(^[ \\t]*)((?:#)[a-zA-Z]+)' }, - - { token: [ 'meta.function.mel', 'keyword.other.mel', 'storage.type.mel', 'entity.name.function.mel', 'punctuation.section.function.mel' ], - regex: '((?:global\\s*)?proc)\\s*(\\w+\\s*\\[?\\]?\\s+|\\s+)([A-Za-z_][A-Za-z0-9_\\.]*)(\\s*(\\())', - push: - [ { include: '$self' }, - { token: 'punctuation.section.function.mel', - regex: '\\)', - next: 'pop' }, - { defaultToken: 'meta.function.mel' } ] } - - ] } - - this.normalizeRules(); -}; - -oop.inherits(MELHighlightRules, TextHighlightRules); - -exports.MELHighlightRules = MELHighlightRules; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-mushcode.js b/util/build-sample-browser/player/vendor/ace/mode-mushcode.js deleted file mode 100644 index 6a851b6cc0..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-mushcode.js +++ /dev/null @@ -1,705 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/mushcode', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/mushcode_highlight_rules', 'ace/mode/folding/pythonic', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var MushCodeRules = require("./mushcode_highlight_rules").MushCodeRules; -var PythonFoldMode = require("./folding/pythonic").FoldMode; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = MushCodeRules; - this.foldingRules = new PythonFoldMode("\\:"); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "#"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[\:]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - var outdents = { - "pass": 1, - "return": 1, - "raise": 1, - "break": 1, - "continue": 1 - }; - - this.checkOutdent = function(state, line, input) { - if (input !== "\r\n" && input !== "\r" && input !== "\n") - return false; - - var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; - - if (!tokens) - return false; - do { - var last = tokens.pop(); - } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); - - if (!last) - return false; - - return (last.type == "keyword" && outdents[last.value]); - }; - - this.autoOutdent = function(state, doc, row) { - - row += 1; - var indent = this.$getIndent(doc.getLine(row)); - var tab = doc.getTabString(); - if (indent.slice(-tab.length) == tab) - doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); - }; - - this.$id = "ace/mode/mushcode"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/mushcode_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var MushCodeRules = function() { - - - var keywords = ( - "@if|"+ - "@ifelse|"+ - "@switch|"+ - "@halt|"+ - "@dolist|"+ - "@create|"+ - "@scent|"+ - "@sound|"+ - "@touch|"+ - "@ataste|"+ - "@osound|"+ - "@ahear|"+ - "@aahear|"+ - "@amhear|"+ - "@otouch|"+ - "@otaste|"+ - "@drop|"+ - "@odrop|"+ - "@adrop|"+ - "@dropfail|"+ - "@odropfail|"+ - "@smell|"+ - "@oemit|"+ - "@emit|"+ - "@pemit|"+ - "@parent|"+ - "@clone|"+ - "@taste|"+ - "whisper|"+ - "page|"+ - "say|"+ - "pose|"+ - "semipose|"+ - "teach|"+ - "touch|"+ - "taste|"+ - "smell|"+ - "listen|"+ - "look|"+ - "move|"+ - "go|"+ - "home|"+ - "follow|"+ - "unfollow|"+ - "desert|"+ - "dismiss|"+ - "@tel" - ); - - var builtinConstants = ( - "=#0" - ); - - var builtinFunctions = ( - "default|"+ - "edefault|"+ - "eval|"+ - "get_eval|"+ - "get|"+ - "grep|"+ - "grepi|"+ - "hasattr|"+ - "hasattrp|"+ - "hasattrval|"+ - "hasattrpval|"+ - "lattr|"+ - "nattr|"+ - "poss|"+ - "udefault|"+ - "ufun|"+ - "u|"+ - "v|"+ - "uldefault|"+ - "xget|"+ - "zfun|"+ - "band|"+ - "bnand|"+ - "bnot|"+ - "bor|"+ - "bxor|"+ - "shl|"+ - "shr|"+ - "and|"+ - "cand|"+ - "cor|"+ - "eq|"+ - "gt|"+ - "gte|"+ - "lt|"+ - "lte|"+ - "nand|"+ - "neq|"+ - "nor|"+ - "not|"+ - "or|"+ - "t|"+ - "xor|"+ - "con|"+ - "entrances|"+ - "exit|"+ - "followers|"+ - "home|"+ - "lcon|"+ - "lexits|"+ - "loc|"+ - "locate|"+ - "lparent|"+ - "lsearch|"+ - "next|"+ - "num|"+ - "owner|"+ - "parent|"+ - "pmatch|"+ - "rloc|"+ - "rnum|"+ - "room|"+ - "where|"+ - "zone|"+ - "worn|"+ - "held|"+ - "carried|"+ - "acos|"+ - "asin|"+ - "atan|"+ - "ceil|"+ - "cos|"+ - "e|"+ - "exp|"+ - "fdiv|"+ - "fmod|"+ - "floor|"+ - "log|"+ - "ln|"+ - "pi|"+ - "power|"+ - "round|"+ - "sin|"+ - "sqrt|"+ - "tan|"+ - "aposs|"+ - "andflags|"+ - "conn|"+ - "commandssent|"+ - "controls|"+ - "doing|"+ - "elock|"+ - "findable|"+ - "flags|"+ - "fullname|"+ - "hasflag|"+ - "haspower|"+ - "hastype|"+ - "hidden|"+ - "idle|"+ - "isbaker|"+ - "lock|"+ - "lstats|"+ - "money|"+ - "who|"+ - "name|"+ - "nearby|"+ - "obj|"+ - "objflags|"+ - "photo|"+ - "poll|"+ - "powers|"+ - "pendingtext|"+ - "receivedtext|"+ - "restarts|"+ - "restarttime|"+ - "subj|"+ - "shortestpath|"+ - "tmoney|"+ - "type|"+ - "visible|"+ - "cat|"+ - "element|"+ - "elements|"+ - "extract|"+ - "filter|"+ - "filterbool|"+ - "first|"+ - "foreach|"+ - "fold|"+ - "grab|"+ - "graball|"+ - "index|"+ - "insert|"+ - "itemize|"+ - "items|"+ - "iter|"+ - "last|"+ - "ldelete|"+ - "map|"+ - "match|"+ - "matchall|"+ - "member|"+ - "mix|"+ - "munge|"+ - "pick|"+ - "remove|"+ - "replace|"+ - "rest|"+ - "revwords|"+ - "setdiff|"+ - "setinter|"+ - "setunion|"+ - "shuffle|"+ - "sort|"+ - "sortby|"+ - "splice|"+ - "step|"+ - "wordpos|"+ - "words|"+ - "add|"+ - "lmath|"+ - "max|"+ - "mean|"+ - "median|"+ - "min|"+ - "mul|"+ - "percent|"+ - "sign|"+ - "stddev|"+ - "sub|"+ - "val|"+ - "bound|"+ - "abs|"+ - "inc|"+ - "dec|"+ - "dist2d|"+ - "dist3d|"+ - "div|"+ - "floordiv|"+ - "mod|"+ - "modulo|"+ - "remainder|"+ - "vadd|"+ - "vdim|"+ - "vdot|"+ - "vmag|"+ - "vmax|"+ - "vmin|"+ - "vmul|"+ - "vsub|"+ - "vunit|"+ - "regedit|"+ - "regeditall|"+ - "regeditalli|"+ - "regediti|"+ - "regmatch|"+ - "regmatchi|"+ - "regrab|"+ - "regraball|"+ - "regraballi|"+ - "regrabi|"+ - "regrep|"+ - "regrepi|"+ - "after|"+ - "alphamin|"+ - "alphamax|"+ - "art|"+ - "before|"+ - "brackets|"+ - "capstr|"+ - "case|"+ - "caseall|"+ - "center|"+ - "containsfansi|"+ - "comp|"+ - "decompose|"+ - "decrypt|"+ - "delete|"+ - "edit|"+ - "encrypt|"+ - "escape|"+ - "if|"+ - "ifelse|"+ - "lcstr|"+ - "left|"+ - "lit|"+ - "ljust|"+ - "merge|"+ - "mid|"+ - "ostrlen|"+ - "pos|"+ - "repeat|"+ - "reverse|"+ - "right|"+ - "rjust|"+ - "scramble|"+ - "secure|"+ - "space|"+ - "spellnum|"+ - "squish|"+ - "strcat|"+ - "strmatch|"+ - "strinsert|"+ - "stripansi|"+ - "stripfansi|"+ - "strlen|"+ - "switch|"+ - "switchall|"+ - "table|"+ - "tr|"+ - "trim|"+ - "ucstr|"+ - "unsafe|"+ - "wrap|"+ - "ctitle|"+ - "cwho|"+ - "channels|"+ - "clock|"+ - "cflags|"+ - "ilev|"+ - "itext|"+ - "inum|"+ - "convsecs|"+ - "convutcsecs|"+ - "convtime|"+ - "ctime|"+ - "etimefmt|"+ - "isdaylight|"+ - "mtime|"+ - "secs|"+ - "msecs|"+ - "starttime|"+ - "time|"+ - "timefmt|"+ - "timestring|"+ - "utctime|"+ - "atrlock|"+ - "clone|"+ - "create|"+ - "cook|"+ - "dig|"+ - "emit|"+ - "lemit|"+ - "link|"+ - "oemit|"+ - "open|"+ - "pemit|"+ - "remit|"+ - "set|"+ - "tel|"+ - "wipe|"+ - "zemit|"+ - "fbcreate|"+ - "fbdestroy|"+ - "fbwrite|"+ - "fbclear|"+ - "fbcopy|"+ - "fbcopyto|"+ - "fbclip|"+ - "fbdump|"+ - "fbflush|"+ - "fbhset|"+ - "fblist|"+ - "fbstats|"+ - "qentries|"+ - "qentry|"+ - "play|"+ - "ansi|"+ - "break|"+ - "c|"+ - "asc|"+ - "die|"+ - "isdbref|"+ - "isint|"+ - "isnum|"+ - "isletters|"+ - "linecoords|"+ - "localize|"+ - "lnum|"+ - "nameshort|"+ - "null|"+ - "objeval|"+ - "r|"+ - "rand|"+ - "s|"+ - "setq|"+ - "setr|"+ - "soundex|"+ - "soundslike|"+ - "valid|"+ - "vchart|"+ - "vchart2|"+ - "vlabel|"+ - "@@|"+ - "bakerdays|"+ - "bodybuild|"+ - "box|"+ - "capall|"+ - "catalog|"+ - "children|"+ - "ctrailer|"+ - "darttime|"+ - "debt|"+ - "detailbar|"+ - "exploredroom|"+ - "fansitoansi|"+ - "fansitoxansi|"+ - "fullbar|"+ - "halfbar|"+ - "isdarted|"+ - "isnewbie|"+ - "isword|"+ - "lambda|"+ - "lobjects|"+ - "lplayers|"+ - "lthings|"+ - "lvexits|"+ - "lvobjects|"+ - "lvplayers|"+ - "lvthings|"+ - "newswrap|"+ - "numsuffix|"+ - "playerson|"+ - "playersthisweek|"+ - "randomad|"+ - "randword|"+ - "realrandword|"+ - "replacechr|"+ - "second|"+ - "splitamount|"+ - "strlenall|"+ - "text|"+ - "third|"+ - "tofansi|"+ - "totalac|"+ - "unique|"+ - "getaddressroom|"+ - "listpropertycomm|"+ - "listpropertyres|"+ - "lotowner|"+ - "lotrating|"+ - "lotratingcount|"+ - "lotvalue|"+ - "boughtproduct|"+ - "companyabb|"+ - "companyicon|"+ - "companylist|"+ - "companyname|"+ - "companyowners|"+ - "companyvalue|"+ - "employees|"+ - "invested|"+ - "productlist|"+ - "productname|"+ - "productowners|"+ - "productrating|"+ - "productratingcount|"+ - "productsoldat|"+ - "producttype|"+ - "ratedproduct|"+ - "soldproduct|"+ - "topproducts|"+ - "totalspentonproduct|"+ - "totalstock|"+ - "transfermoney|"+ - "uniquebuyercount|"+ - "uniqueproductsbought|"+ - "validcompany|"+ - "deletepicture|"+ - "fbsave|"+ - "getpicturesecurity|"+ - "haspicture|"+ - "listpictures|"+ - "picturesize|"+ - "replacecolor|"+ - "rgbtocolor|"+ - "savepicture|"+ - "setpicturesecurity|"+ - "showpicture|"+ - "piechart|"+ - "piechartlabel|"+ - "createmaze|"+ - "drawmaze|"+ - "drawwireframe" - ); - var keywordMapper = this.createKeywordMapper({ - "invalid.deprecated": "debugger", - "support.function": builtinFunctions, - "constant.language": builtinConstants, - "keyword": keywords - }, "identifier"); - - var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?"; - - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; - var octInteger = "(?:0[oO]?[0-7]+)"; - var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; - var binInteger = "(?:0[bB][01]+)"; - var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; - - var exponent = "(?:[eE][+-]?\\d+)"; - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; - var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; - - this.$rules = { - "start" : [ - { - token : "variable", // mush substitution register - regex : "%[0-9]{1}" - }, - { - token : "variable", // mush substitution register - regex : "%q[0-9A-Za-z]{1}" - }, - { - token : "variable", // mush special character register - regex : "%[a-zA-Z]{1}" - }, - { - token: "variable.language", - regex: "%[a-z0-9-_]+" - }, - { - token : "constant.numeric", // imaginary - regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" - }, { - token : "constant.numeric", // float - regex : floatNumber - }, { - token : "constant.numeric", // long integer - regex : integer + "[lL]\\b" - }, { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|#|%|<<|>>|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen", - regex : "[\\]\\)\\}]" - }, { - token : "text", - regex : "\\s+" - } ] - }; -}; - -oop.inherits(MushCodeRules, TextHighlightRules); - -exports.MushCodeRules = MushCodeRules; -}); - -ace.define('ace/mode/folding/pythonic', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(markers) { - this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$"); -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - if (match[1]) - return this.openingBracketBlock(session, match[1], row, match.index); - if (match[2]) - return this.indentationBlock(session, row, match.index + match[2].length); - return this.indentationBlock(session, row); - } - } - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-mushcode_high_rules.js b/util/build-sample-browser/player/vendor/ace/mode-mushcode_high_rules.js deleted file mode 100644 index 4639c98f86..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-mushcode_high_rules.js +++ /dev/null @@ -1,569 +0,0 @@ -/* - * MUSHCodeMode - */ - -ace.define('ace/mode/mushcode_high_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var MushCodeRules = function() { - - - var keywords = ( - "@if|"+ - "@ifelse|"+ - "@switch|"+ - "@halt|"+ - "@dolist|"+ - "@create|"+ - "@scent|"+ - "@sound|"+ - "@touch|"+ - "@ataste|"+ - "@osound|"+ - "@ahear|"+ - "@aahear|"+ - "@amhear|"+ - "@otouch|"+ - "@otaste|"+ - "@drop|"+ - "@odrop|"+ - "@adrop|"+ - "@dropfail|"+ - "@odropfail|"+ - "@smell|"+ - "@oemit|"+ - "@emit|"+ - "@pemit|"+ - "@parent|"+ - "@clone|"+ - "@taste|"+ - "whisper|"+ - "page|"+ - "say|"+ - "pose|"+ - "semipose|"+ - "teach|"+ - "touch|"+ - "taste|"+ - "smell|"+ - "listen|"+ - "look|"+ - "move|"+ - "go|"+ - "home|"+ - "follow|"+ - "unfollow|"+ - "desert|"+ - "dismiss|"+ - "@tel" - ); - - var builtinConstants = ( - "=#0" - ); - - var builtinFunctions = ( - "default|"+ - "edefault|"+ - "eval|"+ - "get_eval|"+ - "get|"+ - "grep|"+ - "grepi|"+ - "hasattr|"+ - "hasattrp|"+ - "hasattrval|"+ - "hasattrpval|"+ - "lattr|"+ - "nattr|"+ - "poss|"+ - "udefault|"+ - "ufun|"+ - "u|"+ - "v|"+ - "uldefault|"+ - "xget|"+ - "zfun|"+ - "band|"+ - "bnand|"+ - "bnot|"+ - "bor|"+ - "bxor|"+ - "shl|"+ - "shr|"+ - "and|"+ - "cand|"+ - "cor|"+ - "eq|"+ - "gt|"+ - "gte|"+ - "lt|"+ - "lte|"+ - "nand|"+ - "neq|"+ - "nor|"+ - "not|"+ - "or|"+ - "t|"+ - "xor|"+ - "con|"+ - "entrances|"+ - "exit|"+ - "followers|"+ - "home|"+ - "lcon|"+ - "lexits|"+ - "loc|"+ - "locate|"+ - "lparent|"+ - "lsearch|"+ - "next|"+ - "num|"+ - "owner|"+ - "parent|"+ - "pmatch|"+ - "rloc|"+ - "rnum|"+ - "room|"+ - "where|"+ - "zone|"+ - "worn|"+ - "held|"+ - "carried|"+ - "acos|"+ - "asin|"+ - "atan|"+ - "ceil|"+ - "cos|"+ - "e|"+ - "exp|"+ - "fdiv|"+ - "fmod|"+ - "floor|"+ - "log|"+ - "ln|"+ - "pi|"+ - "power|"+ - "round|"+ - "sin|"+ - "sqrt|"+ - "tan|"+ - "aposs|"+ - "andflags|"+ - "conn|"+ - "commandssent|"+ - "controls|"+ - "doing|"+ - "elock|"+ - "findable|"+ - "flags|"+ - "fullname|"+ - "hasflag|"+ - "haspower|"+ - "hastype|"+ - "hidden|"+ - "idle|"+ - "isbaker|"+ - "lock|"+ - "lstats|"+ - "money|"+ - "who|"+ - "name|"+ - "nearby|"+ - "obj|"+ - "objflags|"+ - "photo|"+ - "poll|"+ - "powers|"+ - "pendingtext|"+ - "receivedtext|"+ - "restarts|"+ - "restarttime|"+ - "subj|"+ - "shortestpath|"+ - "tmoney|"+ - "type|"+ - "visible|"+ - "cat|"+ - "element|"+ - "elements|"+ - "extract|"+ - "filter|"+ - "filterbool|"+ - "first|"+ - "foreach|"+ - "fold|"+ - "grab|"+ - "graball|"+ - "index|"+ - "insert|"+ - "itemize|"+ - "items|"+ - "iter|"+ - "last|"+ - "ldelete|"+ - "map|"+ - "match|"+ - "matchall|"+ - "member|"+ - "mix|"+ - "munge|"+ - "pick|"+ - "remove|"+ - "replace|"+ - "rest|"+ - "revwords|"+ - "setdiff|"+ - "setinter|"+ - "setunion|"+ - "shuffle|"+ - "sort|"+ - "sortby|"+ - "splice|"+ - "step|"+ - "wordpos|"+ - "words|"+ - "add|"+ - "lmath|"+ - "max|"+ - "mean|"+ - "median|"+ - "min|"+ - "mul|"+ - "percent|"+ - "sign|"+ - "stddev|"+ - "sub|"+ - "val|"+ - "bound|"+ - "abs|"+ - "inc|"+ - "dec|"+ - "dist2d|"+ - "dist3d|"+ - "div|"+ - "floordiv|"+ - "mod|"+ - "modulo|"+ - "remainder|"+ - "vadd|"+ - "vdim|"+ - "vdot|"+ - "vmag|"+ - "vmax|"+ - "vmin|"+ - "vmul|"+ - "vsub|"+ - "vunit|"+ - "regedit|"+ - "regeditall|"+ - "regeditalli|"+ - "regediti|"+ - "regmatch|"+ - "regmatchi|"+ - "regrab|"+ - "regraball|"+ - "regraballi|"+ - "regrabi|"+ - "regrep|"+ - "regrepi|"+ - "after|"+ - "alphamin|"+ - "alphamax|"+ - "art|"+ - "before|"+ - "brackets|"+ - "capstr|"+ - "case|"+ - "caseall|"+ - "center|"+ - "containsfansi|"+ - "comp|"+ - "decompose|"+ - "decrypt|"+ - "delete|"+ - "edit|"+ - "encrypt|"+ - "escape|"+ - "if|"+ - "ifelse|"+ - "lcstr|"+ - "left|"+ - "lit|"+ - "ljust|"+ - "merge|"+ - "mid|"+ - "ostrlen|"+ - "pos|"+ - "repeat|"+ - "reverse|"+ - "right|"+ - "rjust|"+ - "scramble|"+ - "secure|"+ - "space|"+ - "spellnum|"+ - "squish|"+ - "strcat|"+ - "strmatch|"+ - "strinsert|"+ - "stripansi|"+ - "stripfansi|"+ - "strlen|"+ - "switch|"+ - "switchall|"+ - "table|"+ - "tr|"+ - "trim|"+ - "ucstr|"+ - "unsafe|"+ - "wrap|"+ - "ctitle|"+ - "cwho|"+ - "channels|"+ - "clock|"+ - "cflags|"+ - "ilev|"+ - "itext|"+ - "inum|"+ - "convsecs|"+ - "convutcsecs|"+ - "convtime|"+ - "ctime|"+ - "etimefmt|"+ - "isdaylight|"+ - "mtime|"+ - "secs|"+ - "msecs|"+ - "starttime|"+ - "time|"+ - "timefmt|"+ - "timestring|"+ - "utctime|"+ - "atrlock|"+ - "clone|"+ - "create|"+ - "cook|"+ - "dig|"+ - "emit|"+ - "lemit|"+ - "link|"+ - "oemit|"+ - "open|"+ - "pemit|"+ - "remit|"+ - "set|"+ - "tel|"+ - "wipe|"+ - "zemit|"+ - "fbcreate|"+ - "fbdestroy|"+ - "fbwrite|"+ - "fbclear|"+ - "fbcopy|"+ - "fbcopyto|"+ - "fbclip|"+ - "fbdump|"+ - "fbflush|"+ - "fbhset|"+ - "fblist|"+ - "fbstats|"+ - "qentries|"+ - "qentry|"+ - "play|"+ - "ansi|"+ - "break|"+ - "c|"+ - "asc|"+ - "die|"+ - "isdbref|"+ - "isint|"+ - "isnum|"+ - "isletters|"+ - "linecoords|"+ - "localize|"+ - "lnum|"+ - "nameshort|"+ - "null|"+ - "objeval|"+ - "r|"+ - "rand|"+ - "s|"+ - "setq|"+ - "setr|"+ - "soundex|"+ - "soundslike|"+ - "valid|"+ - "vchart|"+ - "vchart2|"+ - "vlabel|"+ - "@@|"+ - "bakerdays|"+ - "bodybuild|"+ - "box|"+ - "capall|"+ - "catalog|"+ - "children|"+ - "ctrailer|"+ - "darttime|"+ - "debt|"+ - "detailbar|"+ - "exploredroom|"+ - "fansitoansi|"+ - "fansitoxansi|"+ - "fullbar|"+ - "halfbar|"+ - "isdarted|"+ - "isnewbie|"+ - "isword|"+ - "lambda|"+ - "lobjects|"+ - "lplayers|"+ - "lthings|"+ - "lvexits|"+ - "lvobjects|"+ - "lvplayers|"+ - "lvthings|"+ - "newswrap|"+ - "numsuffix|"+ - "playerson|"+ - "playersthisweek|"+ - "randomad|"+ - "randword|"+ - "realrandword|"+ - "replacechr|"+ - "second|"+ - "splitamount|"+ - "strlenall|"+ - "text|"+ - "third|"+ - "tofansi|"+ - "totalac|"+ - "unique|"+ - "getaddressroom|"+ - "listpropertycomm|"+ - "listpropertyres|"+ - "lotowner|"+ - "lotrating|"+ - "lotratingcount|"+ - "lotvalue|"+ - "boughtproduct|"+ - "companyabb|"+ - "companyicon|"+ - "companylist|"+ - "companyname|"+ - "companyowners|"+ - "companyvalue|"+ - "employees|"+ - "invested|"+ - "productlist|"+ - "productname|"+ - "productowners|"+ - "productrating|"+ - "productratingcount|"+ - "productsoldat|"+ - "producttype|"+ - "ratedproduct|"+ - "soldproduct|"+ - "topproducts|"+ - "totalspentonproduct|"+ - "totalstock|"+ - "transfermoney|"+ - "uniquebuyercount|"+ - "uniqueproductsbought|"+ - "validcompany|"+ - "deletepicture|"+ - "fbsave|"+ - "getpicturesecurity|"+ - "haspicture|"+ - "listpictures|"+ - "picturesize|"+ - "replacecolor|"+ - "rgbtocolor|"+ - "savepicture|"+ - "setpicturesecurity|"+ - "showpicture|"+ - "piechart|"+ - "piechartlabel|"+ - "createmaze|"+ - "drawmaze|"+ - "drawwireframe" - ); - var keywordMapper = this.createKeywordMapper({ - "invalid.deprecated": "debugger", - "support.function": builtinFunctions, - "constant.language": builtinConstants, - "keyword": keywords - }, "identifier"); - - var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?"; - - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; - var octInteger = "(?:0[oO]?[0-7]+)"; - var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; - var binInteger = "(?:0[bB][01]+)"; - var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; - - var exponent = "(?:[eE][+-]?\\d+)"; - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; - var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; - - this.$rules = { - "start" : [ - { - token : "variable", // mush substitution register - regex : "%[0-9]{1}" - }, - { - token : "variable", // mush substitution register - regex : "%q[0-9A-Za-z]{1}" - }, - { - token : "variable", // mush special character register - regex : "%[a-zA-Z]{1}" - }, - { - token: "variable.language", - regex: "%[a-z0-9-_]+" - }, - { - token : "constant.numeric", // imaginary - regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" - }, { - token : "constant.numeric", // float - regex : floatNumber - }, { - token : "constant.numeric", // long integer - regex : integer + "[lL]\\b" - }, { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|#|%|<<|>>|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen", - regex : "[\\]\\)\\}]" - }, { - token : "text", - regex : "\\s+" - } ] - }; -}; - -oop.inherits(MushCodeRules, TextHighlightRules); - -exports.MushCodeRules = MushCodeRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-mysql.js b/util/build-sample-browser/player/vendor/ace/mode-mysql.js deleted file mode 100644 index 03ccfeddd1..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-mysql.js +++ /dev/null @@ -1,185 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/mysql', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/mysql_highlight_rules', 'ace/range'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var TextMode = require("../mode/text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var MysqlHighlightRules = require("./mysql_highlight_rules").MysqlHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = MysqlHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ["--", "#"]; // todo space - this.blockComment = {start: "/*", end: "*/"}; - - this.$id = "ace/mode/mysql"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/mysql_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var MysqlHighlightRules = function() { - - var mySqlKeywords = /*sql*/ "alter|and|as|asc|between|count|create|delete|desc|distinct|drop|from|having|in|insert|into|is|join|like|not|on|or|order|select|set|table|union|update|values|where" + "|accessible|action|add|after|algorithm|all|analyze|asensitive|at|authors|auto_increment|autocommit|avg|avg_row_length|before|binary|binlog|both|btree|cache|call|cascade|cascaded|case|catalog_name|chain|change|changed|character|check|checkpoint|checksum|class_origin|client_statistics|close|coalesce|code|collate|collation|collations|column|columns|comment|commit|committed|completion|concurrent|condition|connection|consistent|constraint|contains|continue|contributors|convert|cross|current_date|current_time|current_timestamp|current_user|cursor|data|database|databases|day_hour|day_microsecond|day_minute|day_second|deallocate|dec|declare|default|delay_key_write|delayed|delimiter|des_key_file|describe|deterministic|dev_pop|dev_samp|deviance|directory|disable|discard|distinctrow|div|dual|dumpfile|each|elseif|enable|enclosed|end|ends|engine|engines|enum|errors|escape|escaped|even|event|events|every|execute|exists|exit|explain|extended|fast|fetch|field|fields|first|flush|for|force|foreign|found_rows|full|fulltext|function|general|global|grant|grants|group|groupby_concat|handler|hash|help|high_priority|hosts|hour_microsecond|hour_minute|hour_second|if|ignore|ignore_server_ids|import|index|index_statistics|infile|inner|innodb|inout|insensitive|insert_method|install|interval|invoker|isolation|iterate|key|keys|kill|language|last|leading|leave|left|level|limit|linear|lines|list|load|local|localtime|localtimestamp|lock|logs|low_priority|master|master_heartbeat_period|master_ssl_verify_server_cert|masters|match|max|max_rows|maxvalue|message_text|middleint|migrate|min|min_rows|minute_microsecond|minute_second|mod|mode|modifies|modify|mutex|mysql_errno|natural|next|no|no_write_to_binlog|offline|offset|one|online|open|optimize|option|optionally|out|outer|outfile|pack_keys|parser|partition|partitions|password|phase|plugin|plugins|prepare|preserve|prev|primary|privileges|procedure|processlist|profile|profiles|purge|query|quick|range|read|read_write|reads|real|rebuild|recover|references|regexp|relaylog|release|remove|rename|reorganize|repair|repeatable|replace|require|resignal|restrict|resume|return|returns|revoke|right|rlike|rollback|rollup|row|row_format|rtree|savepoint|schedule|schema|schema_name|schemas|second_microsecond|security|sensitive|separator|serializable|server|session|share|show|signal|slave|slow|smallint|snapshot|soname|spatial|specific|sql|sql_big_result|sql_buffer_result|sql_cache|sql_calc_found_rows|sql_no_cache|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|start|starting|starts|status|std|stddev|stddev_pop|stddev_samp|storage|straight_join|subclass_origin|sum|suspend|table_name|table_statistics|tables|tablespace|temporary|terminated|to|trailing|transaction|trigger|triggers|truncate|uncommitted|undo|uninstall|unique|unlock|upgrade|usage|use|use_frm|user|user_resources|user_statistics|using|utc_date|utc_time|utc_timestamp|value|variables|varying|view|views|warnings|when|while|with|work|write|xa|xor|year_month|zerofill|begin|do|then|else|loop|repeat"; - var builtins = "by|bool|boolean|bit|blob|decimal|double|enum|float|long|longblob|longtext|medium|mediumblob|mediumint|mediumtext|time|timestamp|tinyblob|tinyint|tinytext|text|bigint|int|int1|int2|int3|int4|int8|integer|float|float4|float8|double|char|varbinary|varchar|varcharacter|precision|date|datetime|year|unsigned|signed|numeric" - var variable = "charset|clear|connect|edit|ego|exit|go|help|nopager|notee|nowarning|pager|print|prompt|quit|rehash|source|status|system|tee" - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtins, - "keyword": mySqlKeywords, - "constant": "false|true|null|unknown|date|time|timestamp|ODBCdotTable|zerolessFloat", - "variable.language": variable - }, "identifier", true); - - - function string(rule) { - var start = rule.start; - var escapeSeq = rule.escape; - return { - token: "string.start", - regex: start, - next: [ - {token: "constant.language.escape", regex: escapeSeq}, - {token: "string.end", next: "start", regex: start}, - {defaultToken: "string"} - ] - }; - } - - this.$rules = { - "start" : [ { - token : "comment", regex : "(?:-- |#).*$" - }, - string({start: '"', escape: /\\[0'"bnrtZ\\%_]?/}), - string({start: "'", escape: /\\[0'"bnrtZ\\%_]?/}), - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+|[xX]'[0-9a-fA-F]+'|0[bB][01]+|[bB]'[01]+'/ - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "constant.class", - regex : "@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "constant.buildin", - regex : "`[^`]*`" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); - this.normalizeRules(); -}; - -oop.inherits(MysqlHighlightRules, TextHighlightRules); - -exports.MysqlHighlightRules = MysqlHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-nix.js b/util/build-sample-browser/player/vendor/ace/mode-nix.js deleted file mode 100644 index f25294460f..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-nix.js +++ /dev/null @@ -1,965 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Zef Hemel - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/nix', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/c_cpp', 'ace/tokenizer', 'ace/mode/nix_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var CMode = require("./c_cpp").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var NixHighlightRules = require("./nix_highlight_rules").NixHighlightRules; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - CMode.call(this); - this.HighlightRules = NixHighlightRules; - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, CMode); - -(function() { - this.lineCommentStart = "#"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/nix"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/c_cpp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c_cpp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = c_cppHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/c_cpp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/c_cpp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" - -var c_cppHighlightRules = function() { - - var keywordControls = ( - "break|case|continue|default|do|else|for|goto|if|_Pragma|" + - "return|switch|while|catch|operator|try|throw|using" - ); - - var storageType = ( - "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + - "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + - "class|wchar_t|template" - ); - - var storageModifiers = ( - "const|extern|register|restrict|static|volatile|inline|private:|" + - "protected:|public:|friend|explicit|virtual|export|mutable|typename" - ); - - var keywordOperators = ( - "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + - "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" - ); - - var builtinConstants = ( - "NULL|true|false|TRUE|FALSE" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.control" : keywordControls, - "storage.type" : storageType, - "storage.modifier" : storageModifiers, - "keyword.operator" : keywordOperators, - "variable.language": "this", - "constant.language": builtinConstants - }, "identifier"); - - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "keyword", // pre-compiler directives - regex : "#\\s*(?:include|import|pragma|line|define|undef|if|ifdef|else|elif|ifndef)\\b", - next : "directive" - }, { - token : "keyword", // special case pre-compiler directive - regex : "(?:#\\s*endif)\\b" - }, { - token : "support.function.C99.c", - regex : cFunctions - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "directive" : [ - { - token : "constant.other.multiline", - regex : /\\/ - }, - { - token : "constant.other.multiline", - regex : /.*\\/ - }, - { - token : "constant.other", - regex : "\\s*<.+?>", - next : "start" - }, - { - token : "constant.other", // single line - regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', - next : "start" - }, - { - token : "constant.other", // single line - regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", - next : "start" - }, - { - token : "constant.other", - regex : /[^\\\/]+/, - next : "start" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(c_cppHighlightRules, TextHighlightRules); - -exports.c_cppHighlightRules = c_cppHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); -ace.define('ace/mode/nix_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - - var oop = require("../lib/oop"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - var NixHighlightRules = function() { - - var constantLanguage = "true|false"; - var keywordControl = "with|import|if|else|then|inherit"; - var keywordDeclaration = "let|in|rec"; - - var keywordMapper = this.createKeywordMapper({ - "constant.language.nix": constantLanguage, - "keyword.control.nix": keywordControl, - "keyword.declaration.nix": keywordDeclaration - }, "identifier"); - - this.$rules = { - "start": [{ - token: "comment", - regex: /#.*$/ - }, { - token: "comment", - regex: /\/\*/, - next: "comment" - }, { - token: "constant", - regex: "<[^>]+>" - }, { - regex: "(==|!=|<=?|>=?)", - token: ["keyword.operator.comparison.nix"] - }, { - regex: "((?:[+*/%-]|\\~)=)", - token: ["keyword.operator.assignment.arithmetic.nix"] - }, { - regex: "=", - token: "keyword.operator.assignment.nix" - }, { - token: "string", - regex: "''", - next: "qqdoc" - }, { - token: "string", - regex: "'", - next: "qstring" - }, { - token: "string", - regex: '"', - push: "qqstring" - }, { - token: "constant.numeric", // hex - regex: "0[xX][0-9a-fA-F]+\\b" - }, { - token: "constant.numeric", // float - regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token: keywordMapper, - regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - regex: "}", - token: function(val, start, stack) { - return stack[1] && stack[1].charAt(0) == "q" ? "constant.language.escape" : "text"; - }, - next: "pop" - }], - "comment": [{ - token: "comment", // closing comment - regex: ".*?\\*\\/", - next: "start" - }, { - token: "comment", // comment spanning whole line - regex: ".+" - }], - "qqdoc": [ - { - token: "constant.language.escape", - regex: /\$\{/, - push: "start" - }, { - token: "string", - regex: "''", - next: "pop" - }, { - defaultToken: "string" - }], - "qqstring": [ - { - token: "constant.language.escape", - regex: /\$\{/, - push: "start" - }, { - token: "string", - regex: '"', - next: "pop" - }, { - defaultToken: "string" - }], - "qstring": [ - { - token: "constant.language.escape", - regex: /\$\{/, - push: "start" - }, { - token: "string", - regex: "'", - next: "pop" - }, { - defaultToken: "string" - }] - }; - - this.normalizeRules(); - }; - - oop.inherits(NixHighlightRules, TextHighlightRules); - - exports.NixHighlightRules = NixHighlightRules; -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/mode-objectivec.js b/util/build-sample-browser/player/vendor/ace/mode-objectivec.js deleted file mode 100644 index 726c7f4072..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-objectivec.js +++ /dev/null @@ -1,699 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/objectivec', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/objectivec_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ObjectiveCHighlightRules = require("./objectivec_highlight_rules").ObjectiveCHighlightRules; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ObjectiveCHighlightRules; - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/objectivec"; -}).call(Mode.prototype); - -exports.Mode = Mode; -});ace.define('ace/mode/objectivec_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/c_cpp_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var C_Highlight_File = require("./c_cpp_highlight_rules"); -var CHighlightRules = C_Highlight_File.c_cppHighlightRules; - -var ObjectiveCHighlightRules = function() { - - var escapedConstRe = "\\\\(?:[abefnrtv'\"?\\\\]|" + - "[0-3]\\d{1,2}|" + - "[4-7]\\d?|" + - "222|" + - "x[a-zA-Z0-9]+)"; - - var specialVariables = [{ - regex: "\\b_cmd\\b", - token: "variable.other.selector.objc" - }, { - regex: "\\b(?:self|super)\\b", - token: "variable.language.objc" - } - ]; - - var cObj = new CHighlightRules(); - var cRules = cObj.getRules(); - - this.$rules = { - "start": [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, - { - token: [ "storage.type.objc", "punctuation.definition.storage.type.objc", - "entity.name.type.objc", "text", "entity.other.inherited-class.objc" - ], - regex: "(@)(interface|protocol)(?!.+;)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*:\\s*)([A-Za-z]+)" - }, - { - token: [ "storage.type.objc" ], - regex: "(@end)" - }, - { - token: [ "storage.type.objc", "entity.name.type.objc", - "entity.other.inherited-class.objc" - ], - regex: "(@implementation)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*?::\\s*(?:[A-Za-z][A-Za-z0-9]*))?" - }, - { - token: "string.begin.objc", - regex: '@"', - next: "constant_NSString" - }, - { - token: "storage.type.objc", - regex: "\\bid\\s*<", - next: "protocol_list" - }, - { - token: "keyword.control.macro.objc", - regex: "\\bNS_DURING|NS_HANDLER|NS_ENDHANDLER\\b" - }, - { - token: ["punctuation.definition.keyword.objc", "keyword.control.exception.objc"], - regex: "(@)(try|catch|finally|throw)\\b" - }, - { - token: ["punctuation.definition.keyword.objc", "keyword.other.objc"], - regex: "(@)(defs|encode)\\b" - }, - { - token: ["storage.type.id.objc", "text"], - regex: "(\\bid\\b)(\\s|\\n)?" - }, - { - token: "storage.type.objc", - regex: "\\bIBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class\\b" - }, - { - token: [ "punctuation.definition.storage.type.objc", "storage.type.objc"], - regex: "(@)(class|protocol)\\b" - }, - { - token: [ "punctuation.definition.storage.type.objc", "punctuation"], - regex: "(@selector)(\\s*\\()", - next: "selectors" - }, - { - token: [ "punctuation.definition.storage.modifier.objc", "storage.modifier.objc"], - regex: "(@)(synchronized|public|private|protected|package)\\b" - }, - { - token: "constant.language.objc", - regex: "\\bYES|NO|Nil|nil\\b" - }, - { - token: "support.variable.foundation", - regex: "\\bNSApp\\b" - }, - { - token: [ "support.function.cocoa.leopard"], - regex: "(?:\\b)(NS(?:Rect(?:ToCGRect|FromCGRect)|MakeCollectable|S(?:tringFromProtocol|ize(?:ToCGSize|FromCGSize))|Draw(?:NinePartImage|ThreePartImage)|P(?:oint(?:ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))(?:\\b)" - }, - { - token: ["support.function.cocoa"], - regex: "(?:\\b)(NS(?:R(?:ound(?:DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(?:CriticalAlertPanel(?:RelativeToWindow)?|InformationalAlertPanel(?:RelativeToWindow)?|AlertPanel(?:RelativeToWindow)?)|e(?:set(?:MapTable|HashTable)|c(?:ycleZone|t(?:Clip(?:List)?|F(?:ill(?:UsingOperation|List(?:UsingOperation|With(?:Grays|Colors(?:UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(?:dPixel|l(?:MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(?:SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(?:s)?|WindowServerMemory|AlertPanel)|M(?:i(?:n(?:X|Y)|d(?:X|Y))|ouseInRect|a(?:p(?:Remove|Get|Member|Insert(?:IfAbsent|KnownAbsent)?)|ke(?:R(?:ect|ange)|Size|Point)|x(?:Range|X|Y)))|B(?:itsPer(?:SampleFromDepth|PixelFromDepth)|e(?:stDepth|ep|gin(?:CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(?:ho(?:uldRetainWithZone|w(?:sServicesMenuItem|AnimationEffect))|tringFrom(?:R(?:ect|ange)|MapTable|S(?:ize|elector)|HashTable|Class|Point)|izeFromString|e(?:t(?:ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(?:Big(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|Short|Host(?:ShortTo(?:Big|Little)|IntTo(?:Big|Little)|DoubleTo(?:Big|Little)|FloatTo(?:Big|Little)|Long(?:To(?:Big|Little)|LongTo(?:Big|Little)))|Int|Double|Float|L(?:ittle(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|ong(?:Long)?)))|H(?:ighlightRect|o(?:stByteOrder|meDirectory(?:ForUser)?)|eight|ash(?:Remove|Get|Insert(?:IfAbsent|KnownAbsent)?)|FSType(?:CodeFromFileType|OfFile))|N(?:umberOfColorComponents|ext(?:MapEnumeratorPair|HashEnumeratorItem))|C(?:o(?:n(?:tainsRect|vert(?:GlyphsToPackedGlyphs|Swapped(?:DoubleToHost|FloatToHost)|Host(?:DoubleToSwapped|FloatToSwapped)))|unt(?:MapTable|HashTable|Frames|Windows(?:ForContext)?)|py(?:M(?:emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(?:MapTables|HashTables))|lassFromString|reate(?:MapTable(?:WithZone)?|HashTable(?:WithZone)?|Zone|File(?:namePboardType|ContentsPboardType)))|TemporaryDirectory|I(?:s(?:ControllerMarker|EmptyRect|FreedObject)|n(?:setRect|crementExtraRefCount|te(?:r(?:sect(?:sRect|ionR(?:ect|ange))|faceStyleForKey)|gralRect)))|Zone(?:Realloc|Malloc|Name|Calloc|Fr(?:omPointer|ee))|O(?:penStepRootDirectory|ffsetRect)|D(?:i(?:sableScreenUpdates|videRect)|ottedFrameRect|e(?:c(?:imal(?:Round|Multiply|S(?:tring|ubtract)|Normalize|Co(?:py|mpa(?:ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(?:MemoryPages|Object))|raw(?:Gr(?:oove|ayBezel)|B(?:itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(?:hiteBezel|indowBackground)|LightBezel))|U(?:serName|n(?:ionR(?:ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(?:Bundle(?:Setup|Cleanup)|Setup(?:VirtualMachine)?|Needs(?:ToLoadClasses|VirtualMachine)|ClassesF(?:orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(?:oint(?:InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(?:n(?:d(?:MapTableEnumeration|HashTableEnumeration)|umerate(?:MapTable|HashTable)|ableScreenUpdates)|qual(?:R(?:ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(?:ileTypeForHFSTypeCode|ullUserName|r(?:ee(?:MapTable|HashTable)|ame(?:Rect(?:WithWidth(?:UsingOperation)?)?|Address)))|Wi(?:ndowList(?:ForContext)?|dth)|Lo(?:cationInRange|g(?:v|PageSize)?)|A(?:ccessibility(?:R(?:oleDescription(?:ForUIElement)?|aiseBadArgumentException)|Unignored(?:Children(?:ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(?:Main|Load)|vailableWindowDepths|ll(?:MapTable(?:Values|Keys)|HashTableObjects|ocate(?:MemoryPages|Collectable|Object)))))(?:\\b)" - }, - { - token: ["support.class.cocoa.leopard"], - regex: "(?:\\b)(NS(?:RuleEditor|G(?:arbageCollector|radient)|MapTable|HashTable|Co(?:ndition|llectionView(?:Item)?)|T(?:oolbarItemGroup|extInputClient|r(?:eeNode|ackingArea))|InvocationOperation|Operation(?:Queue)?|D(?:ictionaryController|ockTile)|P(?:ointer(?:Functions|Array)|athC(?:o(?:ntrol(?:Delegate)?|mponentCell)|ell(?:Delegate)?)|r(?:intPanelAccessorizing|edicateEditor(?:RowTemplate)?))|ViewController|FastEnumeration|Animat(?:ionContext|ablePropertyContainer)))(?:\\b)" - }, - { - token: ["support.class.cocoa"], - regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)" - }, - { - token: ["support.type.cocoa.leopard"], - regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)" - }, - { - token: ["support.class.quartz"], - regex: "(?:\\b)(C(?:I(?:Sampler|Co(?:ntext|lor)|Image(?:Accumulator)?|PlugIn(?:Registration)?|Vector|Kernel|Filter(?:Generator|Shape)?)|A(?:Renderer|MediaTiming(?:Function)?|BasicAnimation|ScrollLayer|Constraint(?:LayoutManager)?|T(?:iledLayer|extLayer|rans(?:ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(?:nimation(?:Group)?|ction))))(?:\\b)" - }, - { - token: ["support.type.quartz"], - regex: "(?:\\b)(C(?:G(?:Float|Point|Size|Rect)|IFormat|AConstraintAttribute))(?:\\b)" - }, - { - token: ["support.type.cocoa"], - regex: "(?:\\b)(NS(?:R(?:ect(?:Edge)?|ange)|G(?:lyph(?:Relation|LayoutMode)?|radientType)|M(?:odalSession|a(?:trixMode|p(?:Table|Enumerator)))|B(?:itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(?:cr(?:oll(?:er(?:Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(?:Granularity|Direction|Affinity)|wapped(?:Double|Float)|aveOperationType)|Ha(?:sh(?:Table|Enumerator)|ndler(?:2)?)|C(?:o(?:ntrol(?:Size|Tint)|mp(?:ositingOperation|arisonResult))|ell(?:State|Type|ImagePosition|Attribute))|T(?:hreadPrivate|ypesetterGlyphInfo|i(?:ckMarkPosition|tlePosition|meInterval)|o(?:ol(?:TipTag|bar(?:SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(?:TabType|Alignment)|ab(?:State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(?:ContextAuxiliary|PixelFormatAuxiliary)|D(?:ocumentChangeType|atePickerElementFlags|ra(?:werState|gOperation))|UsableScrollerParts|P(?:oint|r(?:intingPageOrder|ogressIndicator(?:Style|Th(?:ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(?:nt(?:SymbolicTraits|TraitMask|Action)|cusRingType)|W(?:indow(?:OrderingMode|Depth)|orkspace(?:IconCreationOptions|LaunchOptions)|ritingDirection)|L(?:ineBreakMode|ayout(?:Status|Direction))|A(?:nimation(?:Progress|Effect)|ppl(?:ication(?:TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle)))(?:\\b)" - }, - { - token: ["support.constant.cocoa"], - regex: "(?:\\b)(NS(?:NotFound|Ordered(?:Ascending|Descending|Same)))(?:\\b)" - }, - { - token: ["support.constant.notification.cocoa.leopard"], - regex: "(?:\\b)(NS(?:MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification)(?:\\b)" - }, - { - token: ["support.constant.notification.cocoa"], - regex: "(?:\\b)(NS(?:Menu(?:Did(?:RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(?:ystemColorsDidChange|plitView(?:DidResizeSubviews|WillResizeSubviews))|C(?:o(?:nt(?:extHelpModeDid(?:Deactivate|Activate)|rolT(?:intDidChange|extDid(?:BeginEditing|Change|EndEditing)))|lor(?:PanelColorDidChange|ListDidChange)|mboBox(?:Selection(?:IsChanging|DidChange)|Will(?:Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(?:oolbar(?:DidRemoveItem|WillAddItem)|ext(?:Storage(?:DidProcessEditing|WillProcessEditing)|Did(?:BeginEditing|Change|EndEditing)|View(?:DidChange(?:Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)))|ImageRepRegistryDidChange|OutlineView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)|Item(?:Did(?:Collapse|Expand)|Will(?:Collapse|Expand)))|Drawer(?:Did(?:Close|Open)|Will(?:Close|Open))|PopUpButton(?:CellWillPopUp|WillPopUp)|View(?:GlobalFrameDidChange|BoundsDidChange|F(?:ocusDidChange|rameDidChange))|FontSetChanged|W(?:indow(?:Did(?:Resi(?:ze|gn(?:Main|Key))|M(?:iniaturize|ove)|Become(?:Main|Key)|ChangeScreen(?:|Profile)|Deminiaturize|Update|E(?:ndSheet|xpose))|Will(?:M(?:iniaturize|ove)|BeginSheet|Close))|orkspace(?:SessionDid(?:ResignActive|BecomeActive)|Did(?:Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(?:Sleep|Unmount|PowerOff|LaunchApplication)))|A(?:ntialiasThresholdChanged|ppl(?:ication(?:Did(?:ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(?:nhide|pdate)|FinishLaunching)|Will(?:ResignActive|BecomeActive|Hide|Terminate|U(?:nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification)(?:\\b)" - }, - { - token: ["support.constant.cocoa.leopard"], - regex: "(?:\\b)(NS(?:RuleEditor(?:RowType(?:Simple|Compound)|NestingMode(?:Si(?:ngle|mple)|Compound|List))|GradientDraws(?:BeforeStartingLocation|AfterEndingLocation)|M(?:inusSetExpressionType|a(?:chPortDeallocate(?:ReceiveRight|SendRight|None)|pTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(?:oxCustom|undleExecutableArchitecture(?:X86|I386|PPC(?:64)?)|etweenPredicateOperatorType|ackgroundStyle(?:Raised|Dark|L(?:ight|owered)))|S(?:tring(?:DrawingTruncatesLastVisibleLine|EncodingConversion(?:ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(?:e(?:ech(?:SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(?:GrammarFlag|SpellingFlag))|litViewDividerStyleThi(?:n|ck))|e(?:rvice(?:RequestTimedOutError|M(?:iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(?:inimum|aximum)|Application(?:NotFoundError|LaunchFailedError))|gmentStyle(?:Round(?:Rect|ed)|SmallSquare|Capsule|Textured(?:Rounded|Square)|Automatic)))|H(?:UDWindowMask|ashTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(?:oModeColorPanel|etServiceNoAutoRename)|C(?:hangeRedone|o(?:ntainsPredicateOperatorType|l(?:orRenderingIntent(?:RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(?:None|ContentArea|TrackableArea|EditableTextArea))|T(?:imeZoneNameStyle(?:S(?:hort(?:Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(?:Regular|SourceList)|racking(?:Mouse(?:Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(?:ssumeInside|ctive(?:In(?:KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(?:n(?:tersectSetExpressionType|dexedColorSpaceModel)|mageScale(?:None|Proportionally(?:Down|UpOrDown)|AxesIndependently))|Ope(?:nGLPFAAllowOfflineRenderers|rationQueue(?:DefaultMaxConcurrentOperationCount|Priority(?:High|Normal|Very(?:High|Low)|Low)))|D(?:iacriticInsensitiveSearch|ownloadsDirectory)|U(?:nionSetExpressionType|TF(?:16(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(?:ointerFunctions(?:Ma(?:chVirtualMemory|llocMemory)|Str(?:ongMemory|uctPersonality)|C(?:StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(?:paque(?:Memory|Personality)|bjectP(?:ointerPersonality|ersonality)))|at(?:hStyle(?:Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(?:Scaling|Copies|Orientation|P(?:a(?:perSize|ge(?:Range|SetupAccessory))|review)))|Executable(?:RuntimeMismatchError|NotLoadableError|ErrorM(?:inimum|aximum)|L(?:inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(?:Initial|Prior)|F(?:i(?:ndPanelSubstringMatchType(?:StartsWith|Contains|EndsWith|FullWord)|leRead(?:TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(?:ndow(?:BackingLocation(?:MainMemory|Default|VideoMemory)|Sharing(?:Read(?:Only|Write)|None)|CollectionBehavior(?:MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType))(?:\\b)" - }, - { - token: ["support.constant.cocoa"], - regex: "(?:\\b)(NS(?:R(?:GB(?:ModeColorPanel|ColorSpaceModel)|ight(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey)|ound(?:RectBezelStyle|Bankers|ed(?:BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(?:CapStyle|JoinStyle))|un(?:StoppedResponse|ContinuesResponse|AbortedResponse)|e(?:s(?:izableWindowMask|et(?:CursorRectsRunLoopOrdering|FunctionKey))|ce(?:ssedBezelStyle|iver(?:sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(?:evancyLevelIndicatorStyle|ative(?:Before|After))|gular(?:SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(?:n(?:domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(?:ModeMatrix|Button)))|G(?:IFFileType|lyph(?:Below|Inscribe(?:B(?:elow|ase)|Over(?:strike|Below)|Above)|Layout(?:WithPrevious|A(?:tAPoint|gainstAPoint))|A(?:ttribute(?:BidiLevel|Soft|Inscribe|Elastic)|bove))|r(?:ooveBorder|eaterThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|a(?:y(?:ModeColorPanel|ColorSpaceModel)|dient(?:None|Con(?:cave(?:Strong|Weak)|vex(?:Strong|Weak)))|phiteControlTint)))|XML(?:N(?:o(?:tationDeclarationKind|de(?:CompactEmptyElement|IsCDATA|OptionsNone|Use(?:SingleQuotes|DoubleQuotes)|Pre(?:serve(?:NamespaceOrder|C(?:haracterReferences|DATA)|DTD|Prefixes|E(?:ntities|mptyElements)|Quotes|Whitespace|A(?:ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(?:ocument(?:X(?:MLKind|HTMLKind|Include)|HTMLKind|T(?:idy(?:XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(?:arser(?:GTRequiredError|XMLDeclNot(?:StartedError|FinishedError)|Mi(?:splaced(?:XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(?:StartedError|FinishedError))|S(?:t(?:andaloneValueError|ringNot(?:StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(?:MTOKENRequiredError|o(?:t(?:ationNot(?:StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(?:haracterRef(?:In(?:DTDError|PrologError|EpilogError)|AtEOFError)|o(?:nditionalSectionNot(?:StartedError|FinishedError)|mment(?:NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(?:ternalError|valid(?:HexCharacterRefError|C(?:haracter(?:RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(?:NameError|Error)))|OutOfMemoryError|D(?:ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(?:RI(?:RequiredError|FragmentError)|n(?:declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(?:CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(?:MissingSemiError|NoNameError|In(?:Internal(?:SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(?:ocessingInstructionNot(?:StartedError|FinishedError)|ematureDocumentEndError))|E(?:n(?:codingNotSupportedError|tity(?:Ref(?:In(?:DTDError|PrologError|EpilogError)|erence(?:MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(?:StartedError|FinishedError)|Is(?:ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(?:StartedError|FinishedError)|xt(?:ernalS(?:tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(?:iteralNot(?:StartedError|FinishedError)|T(?:RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(?:RedefinedError|HasNoValueError|Not(?:StartedError|FinishedError)|ListNot(?:StartedError|FinishedError)))|rocessingInstructionKind)|E(?:ntity(?:GeneralKind|DeclarationKind|UnparsedKind|P(?:ar(?:sedKind|ameterKind)|redefined))|lement(?:Declaration(?:MixedKind|UndefinedKind|E(?:lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(?:N(?:MToken(?:sKind|Kind)|otationKind)|CDATAKind|ID(?:Ref(?:sKind|Kind)|Kind)|DeclarationKind|En(?:tit(?:yKind|iesKind)|umerationKind)|Kind))|M(?:i(?:n(?:XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(?:nthCalendarUnit|deSwitchFunctionKey|use(?:Moved(?:Mask)?|E(?:ntered(?:Mask)?|ventSubtype|xited(?:Mask)?))|veToBezierPathElement|mentary(?:ChangeButton|Push(?:Button|InButton)|Light(?:Button)?))|enuFunctionKey|a(?:c(?:intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(?:XEdge|YEdge))|ACHOperatingSystem)|B(?:MPFileType|o(?:ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(?:Se(?:condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(?:zelBorder|velLineJoinStyle|low(?:Bottom|Top)|gin(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(?:spaceCharacter|tabTextMovement|ingStore(?:Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(?:owser(?:NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(?:h(?:ift(?:JISStringEncoding|KeyMask)|ow(?:ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(?:s(?:ReqFunctionKey|tem(?:D(?:omainMask|efined(?:Mask)?)|FunctionKey))|mbolStringEncoding)|c(?:a(?:nnedOption|le(?:None|ToFit|Proportionally))|r(?:oll(?:er(?:NoPart|Increment(?:Page|Line|Arrow)|Decrement(?:Page|Line|Arrow)|Knob(?:Slot)?|Arrows(?:M(?:inEnd|axEnd)|None|DefaultSetting))|Wheel(?:Mask)?|LockFunctionKey)|eenChangedEventType))|t(?:opFunctionKey|r(?:ingDrawing(?:OneShot|DisableScreenFontSubstitution|Uses(?:DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(?:Status(?:Reading|NotOpen|Closed|Open(?:ing)?|Error|Writing|AtEnd)|Event(?:Has(?:BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(?:ndEncountered|rrorOccurred)))))|i(?:ngle(?:DateMode|UnderlineStyle)|ze(?:DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(?:condCalendarUnit|lect(?:By(?:Character|Paragraph|Word)|i(?:ng(?:Next|Previous)|onAffinity(?:Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(?:Momentary|Select(?:One|Any)))|quareLineCapStyle|witchButton|ave(?:ToOperation|Op(?:tions(?:Yes|No|Ask)|eration)|AsOperation)|mall(?:SquareBezelStyle|C(?:ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(?:ighlightModeMatrix|SBModeColorPanel|o(?:ur(?:Minute(?:SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(?:Never|OnlyFromMainDocumentDomain|Always)|e(?:lp(?:ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(?:MonthDa(?:yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(?:o(?:n(?:StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(?:ification(?:SuspensionBehavior(?:Hold|Coalesce|D(?:eliverImmediately|rop))|NoCoalescing|CoalescingOn(?:Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(?:cr(?:iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(?:itle|opLevelContainersSpecifierError|abs(?:BezelBorder|NoBorder|LineBorder))|I(?:nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(?:ll(?:Glyph|CellType)|m(?:eric(?:Search|PadKeyMask)|berFormatter(?:Round(?:Half(?:Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(?:10|Default)|S(?:cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(?:ercentStyle|ad(?:Before(?:Suffix|Prefix)|After(?:Suffix|Prefix))))))|e(?:t(?:Services(?:BadArgumentError|NotFoundError|C(?:ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(?:StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(?:t(?:iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(?:hange(?:ReadOtherContents|GrayCell(?:Mask)?|BackgroundCell(?:Mask)?|Cleared|Done|Undone|Autosaved)|MYK(?:ModeColorPanel|ColorSpaceModel)|ircular(?:BezelStyle|Slider)|o(?:n(?:stantValueExpressionType|t(?:inuousCapacityLevelIndicatorStyle|entsCellMask|ain(?:sComparison|erSpecifierError)|rol(?:Glyph|KeyMask))|densedFontMask)|lor(?:Panel(?:RGBModeMask|GrayModeMask|HSBModeMask|C(?:MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(?:p(?:osite(?:XOR|Source(?:In|O(?:ut|ver)|Atop)|Highlight|C(?:opy|lear)|Destination(?:In|O(?:ut|ver)|Atop)|Plus(?:Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(?:stom(?:SelectorPredicateOperatorType|PaletteModeColorPanel)|r(?:sor(?:Update(?:Mask)?|PointingDevice)|veToBezierPathElement))|e(?:nterT(?:extAlignment|abStopType)|ll(?:State|H(?:ighlighted|as(?:Image(?:Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(?:Bordered|InsetButton)|Disabled|Editable|LightsBy(?:Gray|Background|Contents)|AllowsMixedState))|l(?:ipPagination|o(?:s(?:ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(?:ControlTint|DisplayFunctionKey|LineFunctionKey))|a(?:seInsensitive(?:Search|PredicateOption)|n(?:notCreateScriptCommandError|cel(?:Button|TextMovement))|chesDirectory|lculation(?:NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(?:itical(?:Request|AlertStyle)|ayonModeColorPanel))|T(?:hick(?:SquareBezelStyle|erSquareBezelStyle)|ypesetter(?:Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(?:ineBreakAction|atestBehavior))|i(?:ckMark(?:Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(?:olbarItemVisibilityPriority(?:Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(?:Compression(?:N(?:one|EXT)|CCITTFAX(?:3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(?:rminate(?:Now|Cancel|Later)|xt(?:Read(?:InapplicableDocumentTypeError|WriteErrorM(?:inimum|aximum))|Block(?:M(?:i(?:nimum(?:Height|Width)|ddleAlignment)|a(?:rgin|ximum(?:Height|Width)))|B(?:o(?:ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(?:ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(?:Characters|Attributes)|CellType|ured(?:RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(?:FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(?:RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(?:Character|TextMovement|le(?:tP(?:oint(?:Mask|EventSubtype)?|roximity(?:Mask|EventSubtype)?)|Column(?:NoResizing|UserResizingMask|AutoresizingMask)|View(?:ReverseSequentialColumnAutoresizingStyle|GridNone|S(?:olid(?:HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(?:n(?:sert(?:CharFunctionKey|FunctionKey|LineFunctionKey)|t(?:Type|ernalS(?:criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(?:Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(?:2022JPStringEncoding|Latin(?:1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(?:R(?:ight|ep(?:MatchesDevice|LoadStatus(?:ReadingHeader|Completed|InvalidData|Un(?:expectedEOF|knownType)|WillNeedAllData)))|Below|C(?:ellType|ache(?:BySize|Never|Default|Always))|Interpolation(?:High|None|Default|Low)|O(?:nly|verlaps)|Frame(?:Gr(?:oove|ayBezel)|Button|None|Photo)|L(?:oadStatus(?:ReadError|C(?:ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(?:lign(?:Right|Bottom(?:Right|Left)?|Center|Top(?:Right|Left)?|Left)|bove)))|O(?:n(?:State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|TextMovement)|SF1OperatingSystem|pe(?:n(?:GL(?:GO(?:Re(?:setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(?:R(?:obust|endererID)|M(?:inimumPolicy|ulti(?:sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(?:creenMask|te(?:ncilSize|reo)|ingleRenderer|upersample|ample(?:s|Buffers|Alpha))|NoRecovery|C(?:o(?:lor(?:Size|Float)|mpliant)|losestPolicy)|OffScreen|D(?:oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(?:cc(?:umSize|elerated)|ux(?:Buffers|DepthStencil)|l(?:phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(?:criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(?:B(?:itfield|oolType)|S(?:hortType|tr(?:ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(?:Type|longType)|ArrayType))|D(?:i(?:s(?:c(?:losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(?:Selection|PredicateModifier))|o(?:c(?:ModalWindowMask|ument(?:Directory|ationDirectory))|ubleType|wn(?:TextMovement|ArrowFunctionKey))|e(?:s(?:cendingPageOrder|ktopDirectory)|cimalTabStopType|v(?:ice(?:NColorSpaceModel|IndependentModifierFlagsMask)|eloper(?:Directory|ApplicationDirectory))|fault(?:ControlTint|TokenStyle)|lete(?:Char(?:acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(?:yCalendarUnit|teFormatter(?:MediumStyle|Behavior(?:10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(?:wer(?:Clos(?:ingState|edState)|Open(?:ingState|State))|gOperation(?:Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(?:ser(?:CancelledError|D(?:irectory|omainMask)|FunctionKey)|RL(?:Handle(?:NotLoaded|Load(?:Succeeded|InProgress|Failed))|CredentialPersistence(?:None|Permanent|ForSession))|n(?:scaledWindowMask|cachedRead|i(?:codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(?:o(?:CloseGroupingRunLoopOrdering|FunctionKey)|e(?:finedDateComponent|rline(?:Style(?:Single|None|Thick|Double)|Pattern(?:Solid|D(?:ot|ash(?:Dot(?:Dot)?)?)))))|known(?:ColorSpaceModel|P(?:ointingDevice|ageOrder)|KeyS(?:criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(?:dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(?:ustifiedTextAlignment|PEG(?:2000FileType|FileType)|apaneseEUC(?:GlyphPacking|StringEncoding))|P(?:o(?:s(?:t(?:Now|erFontMask|WhenIdle|ASAP)|iti(?:on(?:Replace|Be(?:fore|ginning)|End|After)|ve(?:IntType|DoubleType|FloatType)))|pUp(?:NoArrow|ArrowAt(?:Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(?:InCell(?:Mask)?|OnPushOffButton)|e(?:n(?:TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(?:Mask)?)|P(?:S(?:caleField|tatus(?:Title|Field)|aveButton)|N(?:ote(?:Title|Field)|ame(?:Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(?:a(?:perFeedButton|ge(?:Range(?:To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(?:useFunctionKey|ragraphSeparatorCharacter|ge(?:DownFunctionKey|UpFunctionKey))|r(?:int(?:ing(?:ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(?:NotFound|OK|Error)|FunctionKey)|o(?:p(?:ertyList(?:XMLFormat|MutableContainers(?:AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(?:BarStyle|SpinningStyle|Preferred(?:SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(?:ssedTab|vFunctionKey))|L(?:HeightForm|CancelButton|TitleField|ImageButton|O(?:KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(?:n(?:terCharacter|d(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|v(?:e(?:nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(?:Comparison|PredicateOperatorType)|ra(?:serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(?:clude(?:10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(?:i(?:ew(?:M(?:in(?:XMargin|YMargin)|ax(?:XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(?:lidationErrorM(?:inimum|aximum)|riableExpressionType))|Key(?:SpecifierEvaluationScriptError|Down(?:Mask)?|Up(?:Mask)?|PathExpressionType|Value(?:MinusSetMutation|SetSetMutation|Change(?:Re(?:placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(?:New|Old)|UnionSetMutation|ValidationError))|QTMovie(?:NormalPlayback|Looping(?:BackAndForthPlayback|Playback))|F(?:1(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(?:nd(?:PanelAction(?:Replace(?:A(?:ndFind|ll(?:InSelection)?))?|S(?:howFindPanel|e(?:tFindString|lectAll(?:InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(?:Read(?:No(?:SuchFileError|PermissionError)|CorruptFileError|In(?:validFileNameError|applicableStringEncodingError)|Un(?:supportedSchemeError|knownError))|HandlingPanel(?:CancelButton|OKButton)|NoSuchFileError|ErrorM(?:inimum|aximum)|Write(?:NoPermissionError|In(?:validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(?:supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(?:nt(?:Mo(?:noSpaceTrait|dernSerifsClass)|BoldTrait|S(?:ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(?:o(?:ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(?:ntegerAdvancementsRenderingMode|talicTrait)|O(?:ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(?:nknownClass|IOptimizedTrait)|Panel(?:S(?:hadowEffectModeMask|t(?:andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(?:ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(?:amilyClassMask|reeformSerifsClass)|Antialiased(?:RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(?:Below|Type(?:None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(?:attingError(?:M(?:inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(?:ExpressionType|KeyMask)|3(?:1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(?:RevertButton|S(?:ize(?:Title|Field)|etButton)|CurrentField|Preview(?:Button|Field))|l(?:oat(?:ingPointSamplesBitmapFormat|Type)|agsChanged(?:Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(?:heelModeColorPanel|indow(?:s(?:NTOperatingSystem|CP125(?:1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(?:InterfaceStyle|OperatingSystem))|M(?:iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(?:NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(?:ctivation|ddingToRecents)|A(?:sync|nd(?:Hide(?:Others)?|Print)|llowingClassicStartup))|eek(?:day(?:CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(?:ntsBidiLevels|rningAlertStyle)|r(?:itingDirection(?:RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(?:i(?:stModeMatrix|ne(?:Moves(?:Right|Down|Up|Left)|B(?:order|reakBy(?:C(?:harWrapping|lipping)|Truncating(?:Middle|Head|Tail)|WordWrapping))|S(?:eparatorCharacter|weep(?:Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(?:ssThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey))|a(?:yout(?:RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(?:sc(?:iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(?:y(?:Type|PredicateModifier|EventMask)|choredSearch|imation(?:Blocking|Nonblocking(?:Threaded)?|E(?:ffect(?:DisappearingItemDefault|Poof)|ase(?:In(?:Out)?|Out))|Linear)|dPredicateType)|t(?:Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(?:obe(?:GB1CharacterCollection|CNS1CharacterCollection|Japan(?:1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(?:saveOperation|Pagination)|pp(?:lication(?:SupportDirectory|D(?:irectory|e(?:fined(?:Mask)?|legateReply(?:Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(?:Mask)?)|l(?:ternateKeyMask|pha(?:ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(?:SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(?:ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(?:sWrongScriptError|EvaluationScriptError)|bove(?:Bottom|Top)|WTEventType)))(?:\\b)" - }, - { - token: "support.function.C99.c", - regex: C_Highlight_File.cFunctions - }, - { - token : cObj.getKeywords(), - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, - { - token: "punctuation.section.scope.begin.objc", - regex: "\\[", - next: "bracketed_content" - }, - { - token: "meta.function.objc", - regex: "^(?:-|\\+)\\s*" - } - ], - "constant_NSString": [ - { - token: "constant.character.escape.objc", - regex: escapedConstRe - }, - { - token: "invalid.illegal.unknown-escape.objc", - regex: "\\\\." - }, - { - token: "string", - regex: '[^"\\\\]+' - }, - { - token: "punctuation.definition.string.end", - regex: "\"", - next: "start" - } - ], - "protocol_list": [ - { - token: "punctuation.section.scope.end.objc", - regex: ">", - next: "start" - }, - { - token: "support.other.protocol.objc", - regex: "\bNS(?:GlyphStorage|M(?:utableCopying|enuItem)|C(?:hangeSpelling|o(?:ding|pying|lorPicking(?:Custom|Default)))|T(?:oolbarItemValidations|ext(?:Input|AttachmentCell))|I(?:nputServ(?:iceProvider|erMouseTracker)|gnoreMisspelledWords)|Obj(?:CTypeSerializationCallBack|ect)|D(?:ecimalNumberBehaviors|raggingInfo)|U(?:serInterfaceValidations|RL(?:HandleClient|DownloadDelegate|ProtocolClient|AuthenticationChallengeSender))|Validated(?:ToobarItem|UserInterfaceItem)|Locking)\b" - } - ], - "selectors": [ - { - token: "support.function.any-method.name-of-parameter.objc", - regex: "\\b(?:[a-zA-Z_:][\\w]*)+" - }, - { - token: "punctuation", - regex: "\\)", - next: "start" - } - ], - "bracketed_content": [ - { - token: "punctuation.section.scope.end.objc", - regex: "\]", - next: "start" - }, - { - token: ["support.function.any-method.objc"], - regex: "(?:predicateWithFormat:| NSPredicate predicateWithFormat:)", - next: "start" - }, - { - token: "support.function.any-method.objc", - regex: "\\w+(?::|(?=\]))", - next: "start" - } - ], - "bracketed_strings": [ - { - token: "punctuation.section.scope.end.objc", - regex: "\]", - next: "start" - }, - { - token: "keyword.operator.logical.predicate.cocoa", - regex: "\\b(?:AND|OR|NOT|IN)\\b" - }, - { - token: ["invalid.illegal.unknown-method.objc", "punctuation.separator.arguments.objc"], - regex: "\\b(\w+)(:)" - }, - { - regex: "\\b(?:ALL|ANY|SOME|NONE)\\b", - token: "constant.language.predicate.cocoa" - }, - { - regex: "\\b(?:NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\\b", - token: "constant.language.predicate.cocoa" - }, - { - regex: "\\b(?:MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\\b", - token: "keyword.operator.comparison.predicate.cocoa" - }, - { - regex: "\\bC(?:ASEINSENSITIVE|I)\\b", - token: "keyword.other.modifier.predicate.cocoa" - }, - { - regex: "\\b(?:ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b", - token: "keyword.other.predicate.cocoa" - }, - { - regex: escapedConstRe, - token: "constant.character.escape.objc" - }, - { - regex: "\\\\.", - token: "invalid.illegal.unknown-escape.objc" - }, - { - token: "string", - regex: '[^"\\\\]' - }, - { - token: "punctuation.definition.string.end.objc", - regex: "\"", - next: "predicates" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "methods" : [ - { - token : "meta.function.objc", - regex : "(?=\\{|#)|;", - next : "start" - } - ] -} - for (var r in cRules) { - if (this.$rules[r]) { - if (this.$rules[r].push) - this.$rules[r].push.apply(this.$rules[r], cRules[r]); - } else { - this.$rules[r] = cRules[r]; - } - } - - this.$rules.bracketed_content = this.$rules.bracketed_content.concat( - this.$rules.start, specialVariables - ); - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(ObjectiveCHighlightRules, CHighlightRules); - -exports.ObjectiveCHighlightRules = ObjectiveCHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); -ace.define('ace/mode/c_cpp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" - -var c_cppHighlightRules = function() { - - var keywordControls = ( - "break|case|continue|default|do|else|for|goto|if|_Pragma|" + - "return|switch|while|catch|operator|try|throw|using" - ); - - var storageType = ( - "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + - "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + - "class|wchar_t|template" - ); - - var storageModifiers = ( - "const|extern|register|restrict|static|volatile|inline|private:|" + - "protected:|public:|friend|explicit|virtual|export|mutable|typename" - ); - - var keywordOperators = ( - "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + - "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" - ); - - var builtinConstants = ( - "NULL|true|false|TRUE|FALSE" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.control" : keywordControls, - "storage.type" : storageType, - "storage.modifier" : storageModifiers, - "keyword.operator" : keywordOperators, - "variable.language": "this", - "constant.language": builtinConstants - }, "identifier"); - - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "keyword", // pre-compiler directives - regex : "#\\s*(?:include|import|pragma|line|define|undef|if|ifdef|else|elif|ifndef)\\b", - next : "directive" - }, { - token : "keyword", // special case pre-compiler directive - regex : "(?:#\\s*endif)\\b" - }, { - token : "support.function.C99.c", - regex : cFunctions - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "directive" : [ - { - token : "constant.other.multiline", - regex : /\\/ - }, - { - token : "constant.other.multiline", - regex : /.*\\/ - }, - { - token : "constant.other", - regex : "\\s*<.+?>", - next : "start" - }, - { - token : "constant.other", // single line - regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', - next : "start" - }, - { - token : "constant.other", // single line - regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", - next : "start" - }, - { - token : "constant.other", - regex : /[^\\\/]+/, - next : "start" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(c_cppHighlightRules, TextHighlightRules); - -exports.c_cppHighlightRules = c_cppHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-ocaml.js b/util/build-sample-browser/player/vendor/ace/mode-ocaml.js deleted file mode 100644 index 551c8017f2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-ocaml.js +++ /dev/null @@ -1,445 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/ocaml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ocaml_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var OcamlHighlightRules = require("./ocaml_highlight_rules").OcamlHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = OcamlHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Mode, TextMode); - -var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|with))\s*$/; - -(function() { - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - var i, line; - var outdent = true; - var re = /^\s*\(\*(.*)\*\)/; - - for (i=startRow; i<= endRow; i++) { - if (!re.test(doc.getLine(i))) { - outdent = false; - break; - } - } - - var range = new Range(0, 0, 0, 0); - for (i=startRow; i<= endRow; i++) { - line = doc.getLine(i); - range.start.row = i; - range.end.row = i; - range.end.column = line.length; - - doc.replace(range, outdent ? line.match(re)[1] : "(*" + line + "*)"); - } - }; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - - if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') && - state === 'start' && indenter.test(line)) - indent += tab; - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/ocaml"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/ocaml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var OcamlHighlightRules = function() { - - var keywords = ( - "and|as|assert|begin|class|constraint|do|done|downto|else|end|" + - "exception|external|for|fun|function|functor|if|in|include|" + - "inherit|initializer|lazy|let|match|method|module|mutable|new|" + - "object|of|open|or|private|rec|sig|struct|then|to|try|type|val|" + - "virtual|when|while|with" - ); - - var builtinConstants = ("true|false"); - - var builtinFunctions = ( - "abs|abs_big_int|abs_float|abs_num|abstract_tag|accept|access|acos|add|" + - "add_available_units|add_big_int|add_buffer|add_channel|add_char|" + - "add_initializer|add_int_big_int|add_interfaces|add_num|add_string|" + - "add_substitute|add_substring|alarm|allocated_bytes|allow_only|" + - "allow_unsafe_modules|always|append|appname_get|appname_set|" + - "approx_num_exp|approx_num_fix|arg|argv|arith_status|array|" + - "array1_of_genarray|array2_of_genarray|array3_of_genarray|asin|asr|" + - "assoc|assq|at_exit|atan|atan2|auto_synchronize|background|basename|" + - "beginning_of_input|big_int_of_int|big_int_of_num|big_int_of_string|bind|" + - "bind_class|bind_tag|bits|bits_of_float|black|blit|blit_image|blue|bool|" + - "bool_of_string|bounded_full_split|bounded_split|bounded_split_delim|" + - "bprintf|break|broadcast|bscanf|button_down|c_layout|capitalize|cardinal|" + - "cardinal|catch|catch_break|ceil|ceiling_num|channel|char|char_of_int|" + - "chdir|check|check_suffix|chmod|choose|chop_extension|chop_suffix|chown|" + - "chown|chr|chroot|classify_float|clear|clear_available_units|" + - "clear_close_on_exec|clear_graph|clear_nonblock|clear_parser|" + - "close|close|closeTk|close_box|close_graph|close_in|close_in_noerr|" + - "close_out|close_out_noerr|close_process|close_process|" + - "close_process_full|close_process_in|close_process_out|close_subwindow|" + - "close_tag|close_tbox|closedir|closedir|closure_tag|code|combine|" + - "combine|combine|command|compact|compare|compare_big_int|compare_num|" + - "complex32|complex64|concat|conj|connect|contains|contains_from|contents|" + - "copy|cos|cosh|count|count|counters|create|create_alarm|create_image|" + - "create_matrix|create_matrix|create_matrix|create_object|" + - "create_object_and_run_initializers|create_object_opt|create_process|" + - "create_process|create_process_env|create_process_env|create_table|" + - "current|current_dir_name|current_point|current_x|current_y|curveto|" + - "custom_tag|cyan|data_size|decr|decr_num|default_available_units|delay|" + - "delete_alarm|descr_of_in_channel|descr_of_out_channel|destroy|diff|dim|" + - "dim1|dim2|dim3|dims|dirname|display_mode|div|div_big_int|div_num|" + - "double_array_tag|double_tag|draw_arc|draw_char|draw_circle|draw_ellipse|" + - "draw_image|draw_poly|draw_poly_line|draw_rect|draw_segments|draw_string|" + - "dummy_pos|dummy_table|dump_image|dup|dup2|elements|empty|end_of_input|" + - "environment|eprintf|epsilon_float|eq_big_int|eq_num|equal|err_formatter|" + - "error_message|escaped|establish_server|executable_name|execv|execve|execvp|" + - "execvpe|exists|exists2|exit|exp|failwith|fast_sort|fchmod|fchown|field|" + - "file|file_exists|fill|fill_arc|fill_circle|fill_ellipse|fill_poly|fill_rect|" + - "filter|final_tag|finalise|find|find_all|first_chars|firstkey|flatten|" + - "float|float32|float64|float_of_big_int|float_of_bits|float_of_int|" + - "float_of_num|float_of_string|floor|floor_num|flush|flush_all|flush_input|" + - "flush_str_formatter|fold|fold_left|fold_left2|fold_right|fold_right2|" + - "for_all|for_all2|force|force_newline|force_val|foreground|fork|" + - "format_of_string|formatter_of_buffer|formatter_of_out_channel|" + - "fortran_layout|forward_tag|fprintf|frexp|from|from_channel|from_file|" + - "from_file_bin|from_function|from_string|fscanf|fst|fstat|ftruncate|" + - "full_init|full_major|full_split|gcd_big_int|ge_big_int|ge_num|" + - "genarray_of_array1|genarray_of_array2|genarray_of_array3|get|" + - "get_all_formatter_output_functions|get_approx_printing|get_copy|" + - "get_ellipsis_text|get_error_when_null_denominator|get_floating_precision|" + - "get_formatter_output_functions|get_formatter_tag_functions|get_image|" + - "get_margin|get_mark_tags|get_max_boxes|get_max_indent|get_method|" + - "get_method_label|get_normalize_ratio|get_normalize_ratio_when_printing|" + - "get_print_tags|get_state|get_variable|getcwd|getegid|getegid|getenv|" + - "getenv|getenv|geteuid|geteuid|getgid|getgid|getgrgid|getgrgid|getgrnam|" + - "getgrnam|getgroups|gethostbyaddr|gethostbyname|gethostname|getitimer|" + - "getlogin|getpeername|getpid|getppid|getprotobyname|getprotobynumber|" + - "getpwnam|getpwuid|getservbyname|getservbyport|getsockname|getsockopt|" + - "getsockopt_float|getsockopt_int|getsockopt_optint|gettimeofday|getuid|" + - "global_replace|global_substitute|gmtime|green|grid|group_beginning|" + - "group_end|gt_big_int|gt_num|guard|handle_unix_error|hash|hash_param|" + - "hd|header_size|i|id|ignore|in_channel_length|in_channel_of_descr|incr|" + - "incr_num|index|index_from|inet_addr_any|inet_addr_of_string|infinity|" + - "infix_tag|init|init_class|input|input_binary_int|input_byte|input_char|" + - "input_line|input_value|int|int16_signed|int16_unsigned|int32|int64|" + - "int8_signed|int8_unsigned|int_of_big_int|int_of_char|int_of_float|" + - "int_of_num|int_of_string|integer_num|inter|interactive|inv|invalid_arg|" + - "is_block|is_empty|is_implicit|is_int|is_int_big_int|is_integer_num|" + - "is_relative|iter|iter2|iteri|join|junk|key_pressed|kill|kind|kprintf|" + - "kscanf|land|last_chars|layout|lazy_from_fun|lazy_from_val|lazy_is_val|" + - "lazy_tag|ldexp|le_big_int|le_num|length|lexeme|lexeme_char|lexeme_end|" + - "lexeme_end_p|lexeme_start|lexeme_start_p|lineto|link|list|listen|lnot|" + - "loadfile|loadfile_private|localtime|lock|lockf|log|log10|logand|lognot|" + - "logor|logxor|lor|lower_window|lowercase|lseek|lsl|lsr|lstat|lt_big_int|" + - "lt_num|lxor|magenta|magic|mainLoop|major|major_slice|make|make_formatter|" + - "make_image|make_lexer|make_matrix|make_self_init|map|map2|map_file|mapi|" + - "marshal|match_beginning|match_end|matched_group|matched_string|max|" + - "max_array_length|max_big_int|max_elt|max_float|max_int|max_num|" + - "max_string_length|mem|mem_assoc|mem_assq|memq|merge|min|min_big_int|" + - "min_elt|min_float|min_int|min_num|minor|minus_big_int|minus_num|" + - "minus_one|mkdir|mkfifo|mktime|mod|mod_big_int|mod_float|mod_num|modf|" + - "mouse_pos|moveto|mul|mult_big_int|mult_int_big_int|mult_num|nan|narrow|" + - "nat_of_num|nativeint|neg|neg_infinity|new_block|new_channel|new_method|" + - "new_variable|next|nextkey|nice|nice|no_scan_tag|norm|norm2|not|npeek|" + - "nth|nth_dim|num_digits_big_int|num_dims|num_of_big_int|num_of_int|" + - "num_of_nat|num_of_ratio|num_of_string|O|obj|object_tag|ocaml_version|" + - "of_array|of_channel|of_float|of_int|of_int32|of_list|of_nativeint|" + - "of_string|one|openTk|open_box|open_connection|open_graph|open_hbox|" + - "open_hovbox|open_hvbox|open_in|open_in_bin|open_in_gen|open_out|" + - "open_out_bin|open_out_gen|open_process|open_process_full|open_process_in|" + - "open_process_out|open_subwindow|open_tag|open_tbox|open_temp_file|" + - "open_vbox|opendbm|opendir|openfile|or|os_type|out_channel_length|" + - "out_channel_of_descr|output|output_binary_int|output_buffer|output_byte|" + - "output_char|output_string|output_value|over_max_boxes|pack|params|" + - "parent_dir_name|parse|parse_argv|partition|pause|peek|pipe|pixels|" + - "place|plot|plots|point_color|polar|poll|pop|pos_in|pos_out|pow|" + - "power_big_int_positive_big_int|power_big_int_positive_int|" + - "power_int_positive_big_int|power_int_positive_int|power_num|" + - "pp_close_box|pp_close_tag|pp_close_tbox|pp_force_newline|" + - "pp_get_all_formatter_output_functions|pp_get_ellipsis_text|" + - "pp_get_formatter_output_functions|pp_get_formatter_tag_functions|" + - "pp_get_margin|pp_get_mark_tags|pp_get_max_boxes|pp_get_max_indent|" + - "pp_get_print_tags|pp_open_box|pp_open_hbox|pp_open_hovbox|pp_open_hvbox|" + - "pp_open_tag|pp_open_tbox|pp_open_vbox|pp_over_max_boxes|pp_print_as|" + - "pp_print_bool|pp_print_break|pp_print_char|pp_print_cut|pp_print_float|" + - "pp_print_flush|pp_print_if_newline|pp_print_int|pp_print_newline|" + - "pp_print_space|pp_print_string|pp_print_tab|pp_print_tbreak|" + - "pp_set_all_formatter_output_functions|pp_set_ellipsis_text|" + - "pp_set_formatter_out_channel|pp_set_formatter_output_functions|" + - "pp_set_formatter_tag_functions|pp_set_margin|pp_set_mark_tags|" + - "pp_set_max_boxes|pp_set_max_indent|pp_set_print_tags|pp_set_tab|" + - "pp_set_tags|pred|pred_big_int|pred_num|prerr_char|prerr_endline|" + - "prerr_float|prerr_int|prerr_newline|prerr_string|print|print_as|" + - "print_bool|print_break|print_char|print_cut|print_endline|print_float|" + - "print_flush|print_if_newline|print_int|print_newline|print_space|" + - "print_stat|print_string|print_tab|print_tbreak|printf|prohibit|" + - "public_method_label|push|putenv|quo_num|quomod_big_int|quote|raise|" + - "raise_window|ratio_of_num|rcontains_from|read|read_float|read_int|" + - "read_key|read_line|readdir|readdir|readlink|really_input|receive|recv|" + - "recvfrom|red|ref|regexp|regexp_case_fold|regexp_string|" + - "regexp_string_case_fold|register|register_exception|rem|remember_mode|" + - "remove|remove_assoc|remove_assq|rename|replace|replace_first|" + - "replace_matched|repr|reset|reshape|reshape_1|reshape_2|reshape_3|rev|" + - "rev_append|rev_map|rev_map2|rewinddir|rgb|rhs_end|rhs_end_pos|rhs_start|" + - "rhs_start_pos|rindex|rindex_from|rlineto|rmdir|rmoveto|round_num|" + - "run_initializers|run_initializers_opt|scanf|search_backward|" + - "search_forward|seek_in|seek_out|select|self|self_init|send|sendto|set|" + - "set_all_formatter_output_functions|set_approx_printing|" + - "set_binary_mode_in|set_binary_mode_out|set_close_on_exec|" + - "set_close_on_exec|set_color|set_ellipsis_text|" + - "set_error_when_null_denominator|set_field|set_floating_precision|" + - "set_font|set_formatter_out_channel|set_formatter_output_functions|" + - "set_formatter_tag_functions|set_line_width|set_margin|set_mark_tags|" + - "set_max_boxes|set_max_indent|set_method|set_nonblock|set_nonblock|" + - "set_normalize_ratio|set_normalize_ratio_when_printing|set_print_tags|" + - "set_signal|set_state|set_tab|set_tag|set_tags|set_text_size|" + - "set_window_title|setgid|setgid|setitimer|setitimer|setsid|setsid|" + - "setsockopt|setsockopt|setsockopt_float|setsockopt_float|setsockopt_int|" + - "setsockopt_int|setsockopt_optint|setsockopt_optint|setuid|setuid|" + - "shift_left|shift_left|shift_left|shift_right|shift_right|shift_right|" + - "shift_right_logical|shift_right_logical|shift_right_logical|show_buckets|" + - "shutdown|shutdown|shutdown_connection|shutdown_connection|sigabrt|" + - "sigalrm|sigchld|sigcont|sigfpe|sighup|sigill|sigint|sigkill|sign_big_int|" + - "sign_num|signal|signal|sigpending|sigpending|sigpipe|sigprocmask|" + - "sigprocmask|sigprof|sigquit|sigsegv|sigstop|sigsuspend|sigsuspend|" + - "sigterm|sigtstp|sigttin|sigttou|sigusr1|sigusr2|sigvtalrm|sin|singleton|" + - "sinh|size|size|size_x|size_y|sleep|sleep|sleep|slice_left|slice_left|" + - "slice_left_1|slice_left_2|slice_right|slice_right|slice_right_1|" + - "slice_right_2|snd|socket|socket|socket|socketpair|socketpair|sort|sound|" + - "split|split_delim|sprintf|sprintf|sqrt|sqrt|sqrt_big_int|square_big_int|" + - "square_num|sscanf|stable_sort|stable_sort|stable_sort|stable_sort|stable_sort|" + - "stable_sort|stat|stat|stat|stat|stat|stats|stats|std_formatter|stdbuf|" + - "stderr|stderr|stderr|stdib|stdin|stdin|stdin|stdout|stdout|stdout|" + - "str_formatter|string|string_after|string_before|string_match|" + - "string_of_big_int|string_of_bool|string_of_float|string_of_format|" + - "string_of_inet_addr|string_of_inet_addr|string_of_int|string_of_num|" + - "string_partial_match|string_tag|sub|sub|sub_big_int|sub_left|sub_num|" + - "sub_right|subset|subset|substitute_first|substring|succ|succ|" + - "succ|succ|succ_big_int|succ_num|symbol_end|symbol_end_pos|symbol_start|" + - "symbol_start_pos|symlink|symlink|sync|synchronize|system|system|system|" + - "tag|take|tan|tanh|tcdrain|tcdrain|tcflow|tcflow|tcflush|tcflush|" + - "tcgetattr|tcgetattr|tcsendbreak|tcsendbreak|tcsetattr|tcsetattr|" + - "temp_file|text_size|time|time|time|timed_read|timed_write|times|times|" + - "tl|tl|tl|to_buffer|to_channel|to_float|to_hex|to_int|to_int32|to_list|" + - "to_list|to_list|to_nativeint|to_string|to_string|to_string|to_string|" + - "to_string|top|top|total_size|transfer|transp|truncate|truncate|truncate|" + - "truncate|truncate|truncate|try_lock|umask|umask|uncapitalize|uncapitalize|" + - "uncapitalize|union|union|unit_big_int|unlink|unlink|unlock|unmarshal|" + - "unsafe_blit|unsafe_fill|unsafe_get|unsafe_get|unsafe_set|unsafe_set|" + - "update|uppercase|uppercase|uppercase|uppercase|usage|utimes|utimes|wait|" + - "wait|wait|wait|wait_next_event|wait_pid|wait_read|wait_signal|" + - "wait_timed_read|wait_timed_write|wait_write|waitpid|white|" + - "widen|window_id|word_size|wrap|wrap_abort|write|yellow|yield|zero|zero_big_int|" + - - "Arg|Arith_status|Array|Array1|Array2|Array3|ArrayLabels|Big_int|Bigarray|" + - "Buffer|Callback|CamlinternalOO|Char|Complex|Condition|Dbm|Digest|Dynlink|" + - "Event|Filename|Format|Gc|Genarray|Genlex|Graphics|GraphicsX11|Hashtbl|" + - "Int32|Int64|LargeFile|Lazy|Lexing|List|ListLabels|Make|Map|Marshal|" + - "MoreLabels|Mutex|Nativeint|Num|Obj|Oo|Parsing|Pervasives|Printexc|" + - "Printf|Queue|Random|Scanf|Scanning|Set|Sort|Stack|State|StdLabels|Str|" + - "Stream|String|StringLabels|Sys|Thread|ThreadUnix|Tk|Unix|UnixLabels|Weak" - ); - - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": keywords, - "constant.language": builtinConstants, - "support.function": builtinFunctions - }, "identifier"); - - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; - var octInteger = "(?:0[oO]?[0-7]+)"; - var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; - var binInteger = "(?:0[bB][01]+)"; - var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; - - var exponent = "(?:[eE][+-]?\\d+)"; - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; - var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : '\\(\\*.*?\\*\\)\\s*?$' - }, - { - token : "comment", - regex : '\\(\\*.*', - next : "comment" - }, - { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, - { - token : "string", // single char - regex : "'.'" - }, - { - token : "string", // " string - regex : '"', - next : "qstring" - }, - { - token : "constant.numeric", // imaginary - regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" - }, - { - token : "constant.numeric", // float - regex : floatNumber - }, - { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, - { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, - { - token : "keyword.operator", - regex : "\\+\\.|\\-\\.|\\*\\.|\\/\\.|#|;;|\\+|\\-|\\*|\\*\\*\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|<-|=" - }, - { - token : "paren.lparen", - regex : "[[({]" - }, - { - token : "paren.rparen", - regex : "[\\])}]" - }, - { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\)", - next : "start" - }, - { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - - "qstring" : [ - { - token : "string", - regex : '"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ] - }; -}; - -oop.inherits(OcamlHighlightRules, TextHighlightRules); - -exports.OcamlHighlightRules = OcamlHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-pascal.js b/util/build-sample-browser/player/vendor/ace/mode-pascal.js deleted file mode 100644 index d386ae3560..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-pascal.js +++ /dev/null @@ -1,233 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/pascal', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/pascal_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var PascalHighlightRules = require("./pascal_highlight_rules").PascalHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = PascalHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ["--", "//"]; - this.blockComment = [ - {start: "(*", end: "*)"}, - {start: "{", end: "}"} - ]; - - this.$id = "ace/mode/pascal"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/pascal_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var PascalHighlightRules = function() { - - this.$rules = { start: - [ { caseInsensitive: true, - token: 'keyword.control.pascal', - regex: '\\b(?:(absolute|abstract|all|and|and_then|array|as|asm|attribute|begin|bindable|case|class|const|constructor|destructor|div|do|do|else|end|except|export|exports|external|far|file|finalization|finally|for|forward|goto|if|implementation|import|in|inherited|initialization|interface|interrupt|is|label|library|mod|module|name|near|nil|not|object|of|only|operator|or|or_else|otherwise|packed|pow|private|program|property|protected|public|published|qualified|record|repeat|resident|restricted|segment|set|shl|shr|then|to|try|type|unit|until|uses|value|var|view|virtual|while|with|xor))\\b' }, - { caseInsensitive: true, - token: - [ 'variable.pascal', "text", - 'storage.type.prototype.pascal', - 'entity.name.function.prototype.pascal' ], - regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?(?=(?:\\(.*?\\))?;\\s*(?:attribute|forward|external))' }, - { caseInsensitive: true, - token: - [ 'variable.pascal', "text", - 'storage.type.function.pascal', - 'entity.name.function.pascal' ], - regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?' }, - { token: 'constant.numeric.pascal', - regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b' }, - { token: 'punctuation.definition.comment.pascal', - regex: '--.*$', - push_: - [ { token: 'comment.line.double-dash.pascal.one', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-dash.pascal.one' } ] }, - { token: 'punctuation.definition.comment.pascal', - regex: '//.*$', - push_: - [ { token: 'comment.line.double-slash.pascal.two', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-slash.pascal.two' } ] }, - { token: 'punctuation.definition.comment.pascal', - regex: '\\(\\*', - push: - [ { token: 'punctuation.definition.comment.pascal', - regex: '\\*\\)', - next: 'pop' }, - { defaultToken: 'comment.block.pascal.one' } ] }, - { token: 'punctuation.definition.comment.pascal', - regex: '\\{', - push: - [ { token: 'punctuation.definition.comment.pascal', - regex: '\\}', - next: 'pop' }, - { defaultToken: 'comment.block.pascal.two' } ] }, - { token: 'punctuation.definition.string.begin.pascal', - regex: '"', - push: - [ { token: 'constant.character.escape.pascal', regex: '\\\\.' }, - { token: 'punctuation.definition.string.end.pascal', - regex: '"', - next: 'pop' }, - { defaultToken: 'string.quoted.double.pascal' } ], - }, - { token: 'punctuation.definition.string.begin.pascal', - regex: '\'', - push: - [ { token: 'constant.character.escape.apostrophe.pascal', - regex: '\'\'' }, - { token: 'punctuation.definition.string.end.pascal', - regex: '\'', - next: 'pop' }, - { defaultToken: 'string.quoted.single.pascal' } ] }, - { token: 'keyword.operator', - regex: '[+\\-;,/*%]|:=|=' } ] } - - this.normalizeRules(); -}; - -oop.inherits(PascalHighlightRules, TextHighlightRules); - -exports.PascalHighlightRules = PascalHighlightRules; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-perl.js b/util/build-sample-browser/player/vendor/ace/mode-perl.js deleted file mode 100644 index 12756fcc3b..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-perl.js +++ /dev/null @@ -1,359 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/perl', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/perl_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var PerlHighlightRules = require("./perl_highlight_rules").PerlHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = PerlHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new CStyleFoldMode({start: "^=(begin|item)\\b", end: "^=(cut)\\b"}); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "#"; - this.blockComment = [ - {start: "=begin", end: "=cut"}, - {start: "=item", end: "=cut"} - ]; - - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[\:]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/perl"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/perl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var PerlHighlightRules = function() { - - var keywords = ( - "base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" + - "no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars" - ); - - var buildinConstants = ("ARGV|ENV|INC|SIG"); - - var builtinFunctions = ( - "getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" + - "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" + - "getpeername|setpriority|getprotoent|setprotoent|getpriority|" + - "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" + - "getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" + - "localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" + - "closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" + - "shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|" + - "dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|" + - "setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|" + - "lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|" + - "waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|" + - "chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|" + - "unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|" + - "length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|" + - "undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|" + - "sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|" + - "BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|" + - "join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|" + - "keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|" + - "eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|" + - "map|die|uc|lc|do" - ); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": buildinConstants, - "support.function": builtinFunctions - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment.doc", - regex : "^=(?:begin|item)\\b", - next : "block_comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0x[0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "%#|\\$#|\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)" - }, { - token : "comment", - regex : "#.*$" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "block_comment": [ - { - token: "comment.doc", - regex: "^=cut\\b", - next: "start" - }, - { - defaultToken: "comment.doc" - } - ] - }; -}; - -oop.inherits(PerlHighlightRules, TextHighlightRules); - -exports.PerlHighlightRules = PerlHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-pgsql.js b/util/build-sample-browser/player/vendor/ace/mode-pgsql.js deleted file mode 100644 index 7a941d590d..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-pgsql.js +++ /dev/null @@ -1,1356 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/pgsql', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/pgsql_highlight_rules', 'ace/range'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var TextMode = require("../mode/text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var PgsqlHighlightRules = require("./pgsql_highlight_rules").PgsqlHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = PgsqlHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "--"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - if (state == "start" || state == "keyword.statementEnd") { - return ""; - } else { - return this.$getIndent(line); // Keep whatever indent the previous line has - } - } - - this.$id = "ace/mode/pgsql"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/pgsql_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules', 'ace/mode/perl_highlight_rules', 'ace/mode/python_highlight_rules', 'ace/mode/json_highlight_rules', 'ace/mode/javascript_highlight_rules'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var PerlHighlightRules = require("./perl_highlight_rules").PerlHighlightRules; -var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules; -var JsonHighlightRules = require("./json_highlight_rules").JsonHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; - -var PgsqlHighlightRules = function() { - var keywords = ( - "abort|absolute|abstime|access|aclitem|action|add|admin|after|aggregate|all|also|alter|always|" + - "analyse|analyze|and|any|anyarray|anyelement|anyenum|anynonarray|anyrange|array|as|asc|" + - "assertion|assignment|asymmetric|at|attribute|authorization|backward|before|begin|between|" + - "bigint|binary|bit|bool|boolean|both|box|bpchar|by|bytea|cache|called|cascade|cascaded|case|cast|" + - "catalog|chain|char|character|characteristics|check|checkpoint|cid|cidr|circle|class|close|" + - "cluster|coalesce|collate|collation|column|comment|comments|commit|committed|concurrently|" + - "configuration|connection|constraint|constraints|content|continue|conversion|copy|cost|" + - "create|cross|cstring|csv|current|current_catalog|current_date|current_role|" + - "current_schema|current_time|current_timestamp|current_user|cursor|cycle|data|database|" + - "date|daterange|day|deallocate|dec|decimal|declare|default|defaults|deferrable|deferred|" + - "definer|delete|delimiter|delimiters|desc|dictionary|disable|discard|distinct|do|document|" + - "domain|double|drop|each|else|enable|encoding|encrypted|end|enum|escape|event|event_trigger|" + - "except|exclude|excluding|exclusive|execute|exists|explain|extension|external|extract|false|" + - "family|fdw_handler|fetch|first|float|float4|float8|following|for|force|foreign|forward|" + - "freeze|from|full|function|functions|global|grant|granted|greatest|group|gtsvector|handler|" + - "having|header|hold|hour|identity|if|ilike|immediate|immutable|implicit|in|including|" + - "increment|index|indexes|inet|inherit|inherits|initially|inline|inner|inout|input|" + - "insensitive|insert|instead|int|int2|int2vector|int4|int4range|int8|int8range|integer|" + - "internal|intersect|interval|into|invoker|is|isnull|isolation|join|json|key|label|language|" + - "language_handler|large|last|lateral|lc_collate|lc_ctype|leading|leakproof|least|left|level|" + - "like|limit|line|listen|load|local|localtime|localtimestamp|location|lock|lseg|macaddr|" + - "mapping|match|materialized|maxvalue|minute|minvalue|mode|money|month|move|name|names|" + - "national|natural|nchar|next|no|none|not|nothing|notify|notnull|nowait|null|nullif|nulls|" + - "numeric|numrange|object|of|off|offset|oid|oids|oidvector|on|only|opaque|operator|option|" + - "options|or|order|out|outer|over|overlaps|overlay|owned|owner|parser|partial|partition|passing|" + - "password|path|pg_attribute|pg_auth_members|pg_authid|pg_class|pg_database|pg_node_tree|" + - "pg_proc|pg_type|placing|plans|point|polygon|position|preceding|precision|prepare|prepared|" + - "preserve|primary|prior|privileges|procedural|procedure|program|quote|range|read|real|" + - "reassign|recheck|record|recursive|ref|refcursor|references|refresh|regclass|regconfig|" + - "regdictionary|regoper|regoperator|regproc|regprocedure|regtype|reindex|relative|release|" + - "reltime|rename|repeatable|replace|replica|reset|restart|restrict|returning|returns|revoke|" + - "right|role|rollback|row|rows|rule|savepoint|schema|scroll|search|second|security|select|" + - "sequence|sequences|serializable|server|session|session_user|set|setof|share|show|similar|" + - "simple|smallint|smgr|snapshot|some|stable|standalone|start|statement|statistics|stdin|" + - "stdout|storage|strict|strip|substring|symmetric|sysid|system|table|tables|tablespace|temp|" + - "template|temporary|text|then|tid|time|timestamp|timestamptz|timetz|tinterval|to|trailing|" + - "transaction|treat|trigger|trim|true|truncate|trusted|tsquery|tsrange|tstzrange|tsvector|" + - "txid_snapshot|type|types|unbounded|uncommitted|unencrypted|union|unique|unknown|unlisten|" + - "unlogged|until|update|user|using|uuid|vacuum|valid|validate|validator|value|values|varbit|" + - "varchar|variadic|varying|verbose|version|view|void|volatile|when|where|whitespace|window|" + - "with|without|work|wrapper|write|xid|xml|xmlattributes|xmlconcat|xmlelement|xmlexists|" + - "xmlforest|xmlparse|xmlpi|xmlroot|xmlserialize|year|yes|zone" - ); - - - var builtinFunctions = ( - "RI_FKey_cascade_del|RI_FKey_cascade_upd|RI_FKey_check_ins|RI_FKey_check_upd|" + - "RI_FKey_noaction_del|RI_FKey_noaction_upd|RI_FKey_restrict_del|RI_FKey_restrict_upd|" + - "RI_FKey_setdefault_del|RI_FKey_setdefault_upd|RI_FKey_setnull_del|" + - "RI_FKey_setnull_upd|abbrev|abs|abstime|abstimeeq|abstimege|abstimegt|abstimein|abstimele|" + - "abstimelt|abstimene|abstimeout|abstimerecv|abstimesend|aclcontains|acldefault|" + - "aclexplode|aclinsert|aclitemeq|aclitemin|aclitemout|aclremove|acos|age|any_in|any_out|" + - "anyarray_in|anyarray_out|anyarray_recv|anyarray_send|anyelement_in|anyelement_out|" + - "anyenum_in|anyenum_out|anynonarray_in|anynonarray_out|anyrange_in|anyrange_out|" + - "anytextcat|area|areajoinsel|areasel|array_agg|array_agg_finalfn|array_agg_transfn|" + - "array_append|array_cat|array_dims|array_eq|array_fill|array_ge|array_gt|array_in|" + - "array_larger|array_le|array_length|array_lower|array_lt|array_ndims|array_ne|array_out|" + - "array_prepend|array_recv|array_remove|array_replace|array_send|array_smaller|" + - "array_to_json|array_to_string|array_typanalyze|array_upper|arraycontained|" + - "arraycontains|arraycontjoinsel|arraycontsel|arrayoverlap|ascii|ascii_to_mic|" + - "ascii_to_utf8|asin|atan|atan2|avg|big5_to_euc_tw|big5_to_mic|big5_to_utf8|bit_and|bit_in|" + - "bit_length|bit_or|bit_out|bit_recv|bit_send|bitand|bitcat|bitcmp|biteq|bitge|bitgt|bitle|" + - "bitlt|bitne|bitnot|bitor|bitshiftleft|bitshiftright|bittypmodin|bittypmodout|bitxor|bool|" + - "bool_and|bool_or|booland_statefunc|booleq|boolge|boolgt|boolin|boolle|boollt|boolne|" + - "boolor_statefunc|boolout|boolrecv|boolsend|box|box_above|box_above_eq|box_add|box_below|" + - "box_below_eq|box_center|box_contain|box_contain_pt|box_contained|box_distance|box_div|" + - "box_eq|box_ge|box_gt|box_in|box_intersect|box_le|box_left|box_lt|box_mul|box_out|" + - "box_overabove|box_overbelow|box_overlap|box_overleft|box_overright|box_recv|box_right|" + - "box_same|box_send|box_sub|bpchar_larger|bpchar_pattern_ge|bpchar_pattern_gt|" + - "bpchar_pattern_le|bpchar_pattern_lt|bpchar_smaller|bpcharcmp|bpchareq|bpcharge|" + - "bpchargt|bpchariclike|bpcharicnlike|bpcharicregexeq|bpcharicregexne|bpcharin|bpcharle|" + - "bpcharlike|bpcharlt|bpcharne|bpcharnlike|bpcharout|bpcharrecv|bpcharregexeq|" + - "bpcharregexne|bpcharsend|bpchartypmodin|bpchartypmodout|broadcast|btabstimecmp|" + - "btarraycmp|btbeginscan|btboolcmp|btbpchar_pattern_cmp|btbuild|btbuildempty|" + - "btbulkdelete|btcanreturn|btcharcmp|btcostestimate|btendscan|btfloat48cmp|btfloat4cmp|" + - "btfloat4sortsupport|btfloat84cmp|btfloat8cmp|btfloat8sortsupport|btgetbitmap|" + - "btgettuple|btinsert|btint24cmp|btint28cmp|btint2cmp|btint2sortsupport|btint42cmp|" + - "btint48cmp|btint4cmp|btint4sortsupport|btint82cmp|btint84cmp|btint8cmp|" + - "btint8sortsupport|btmarkpos|btnamecmp|btnamesortsupport|btoidcmp|btoidsortsupport|" + - "btoidvectorcmp|btoptions|btrecordcmp|btreltimecmp|btrescan|btrestrpos|btrim|" + - "bttext_pattern_cmp|bttextcmp|bttidcmp|bttintervalcmp|btvacuumcleanup|" + - "bytea_string_agg_finalfn|bytea_string_agg_transfn|byteacat|byteacmp|byteaeq|byteage|" + - "byteagt|byteain|byteale|bytealike|bytealt|byteane|byteanlike|byteaout|bytearecv|byteasend|" + - "cash_cmp|cash_div_cash|cash_div_flt4|cash_div_flt8|cash_div_int2|cash_div_int4|cash_eq|" + - "cash_ge|cash_gt|cash_in|cash_le|cash_lt|cash_mi|cash_mul_flt4|cash_mul_flt8|" + - "cash_mul_int2|cash_mul_int4|cash_ne|cash_out|cash_pl|cash_recv|cash_send|cash_words|" + - "cashlarger|cashsmaller|cbrt|ceil|ceiling|center|char|char_length|character_length|chareq|" + - "charge|chargt|charin|charle|charlt|charne|charout|charrecv|charsend|chr|cideq|cidin|cidout|" + - "cidr|cidr_in|cidr_out|cidr_recv|cidr_send|cidrecv|cidsend|circle|circle_above|" + - "circle_add_pt|circle_below|circle_center|circle_contain|circle_contain_pt|" + - "circle_contained|circle_distance|circle_div_pt|circle_eq|circle_ge|circle_gt|circle_in|" + - "circle_le|circle_left|circle_lt|circle_mul_pt|circle_ne|circle_out|circle_overabove|" + - "circle_overbelow|circle_overlap|circle_overleft|circle_overright|circle_recv|" + - "circle_right|circle_same|circle_send|circle_sub_pt|clock_timestamp|close_lb|close_ls|" + - "close_lseg|close_pb|close_pl|close_ps|close_sb|close_sl|col_description|concat|concat_ws|" + - "contjoinsel|contsel|convert|convert_from|convert_to|corr|cos|cot|count|covar_pop|" + - "covar_samp|cstring_in|cstring_out|cstring_recv|cstring_send|cume_dist|current_database|" + - "current_query|current_schema|current_schemas|current_setting|current_user|currtid|" + - "currtid2|currval|cursor_to_xml|cursor_to_xmlschema|database_to_xml|" + - "database_to_xml_and_xmlschema|database_to_xmlschema|date|date_cmp|date_cmp_timestamp|" + - "date_cmp_timestamptz|date_eq|date_eq_timestamp|date_eq_timestamptz|date_ge|" + - "date_ge_timestamp|date_ge_timestamptz|date_gt|date_gt_timestamp|date_gt_timestamptz|" + - "date_in|date_larger|date_le|date_le_timestamp|date_le_timestamptz|date_lt|" + - "date_lt_timestamp|date_lt_timestamptz|date_mi|date_mi_interval|date_mii|date_ne|" + - "date_ne_timestamp|date_ne_timestamptz|date_out|date_part|date_pl_interval|date_pli|" + - "date_recv|date_send|date_smaller|date_sortsupport|date_trunc|daterange|" + - "daterange_canonical|daterange_subdiff|datetime_pl|datetimetz_pl|dcbrt|decode|degrees|" + - "dense_rank|dexp|diagonal|diameter|dispell_init|dispell_lexize|dist_cpoly|dist_lb|dist_pb|" + - "dist_pc|dist_pl|dist_ppath|dist_ps|dist_sb|dist_sl|div|dlog1|dlog10|domain_in|domain_recv|" + - "dpow|dround|dsimple_init|dsimple_lexize|dsnowball_init|dsnowball_lexize|dsqrt|" + - "dsynonym_init|dsynonym_lexize|dtrunc|elem_contained_by_range|encode|enum_cmp|enum_eq|" + - "enum_first|enum_ge|enum_gt|enum_in|enum_larger|enum_last|enum_le|enum_lt|enum_ne|enum_out|" + - "enum_range|enum_recv|enum_send|enum_smaller|eqjoinsel|eqsel|euc_cn_to_mic|" + - "euc_cn_to_utf8|euc_jis_2004_to_shift_jis_2004|euc_jis_2004_to_utf8|euc_jp_to_mic|" + - "euc_jp_to_sjis|euc_jp_to_utf8|euc_kr_to_mic|euc_kr_to_utf8|euc_tw_to_big5|" + - "euc_tw_to_mic|euc_tw_to_utf8|event_trigger_in|event_trigger_out|every|exp|factorial|" + - "family|fdw_handler_in|fdw_handler_out|first_value|float4|float48div|float48eq|float48ge|" + - "float48gt|float48le|float48lt|float48mi|float48mul|float48ne|float48pl|float4_accum|" + - "float4abs|float4div|float4eq|float4ge|float4gt|float4in|float4larger|float4le|float4lt|" + - "float4mi|float4mul|float4ne|float4out|float4pl|float4recv|float4send|float4smaller|" + - "float4um|float4up|float8|float84div|float84eq|float84ge|float84gt|float84le|float84lt|" + - "float84mi|float84mul|float84ne|float84pl|float8_accum|float8_avg|float8_corr|" + - "float8_covar_pop|float8_covar_samp|float8_regr_accum|float8_regr_avgx|" + - "float8_regr_avgy|float8_regr_intercept|float8_regr_r2|float8_regr_slope|" + - "float8_regr_sxx|float8_regr_sxy|float8_regr_syy|float8_stddev_pop|float8_stddev_samp|" + - "float8_var_pop|float8_var_samp|float8abs|float8div|float8eq|float8ge|float8gt|float8in|" + - "float8larger|float8le|float8lt|float8mi|float8mul|float8ne|float8out|float8pl|float8recv|" + - "float8send|float8smaller|float8um|float8up|floor|flt4_mul_cash|flt8_mul_cash|" + - "fmgr_c_validator|fmgr_internal_validator|fmgr_sql_validator|format|format_type|" + - "gb18030_to_utf8|gbk_to_utf8|generate_series|generate_subscripts|get_bit|get_byte|" + - "get_current_ts_config|getdatabaseencoding|getpgusername|gin_cmp_prefix|" + - "gin_cmp_tslexeme|gin_extract_tsquery|gin_extract_tsvector|gin_tsquery_consistent|" + - "ginarrayconsistent|ginarrayextract|ginbeginscan|ginbuild|ginbuildempty|ginbulkdelete|" + - "gincostestimate|ginendscan|gingetbitmap|gininsert|ginmarkpos|ginoptions|" + - "ginqueryarrayextract|ginrescan|ginrestrpos|ginvacuumcleanup|gist_box_compress|" + - "gist_box_consistent|gist_box_decompress|gist_box_penalty|gist_box_picksplit|" + - "gist_box_same|gist_box_union|gist_circle_compress|gist_circle_consistent|" + - "gist_point_compress|gist_point_consistent|gist_point_distance|gist_poly_compress|" + - "gist_poly_consistent|gistbeginscan|gistbuild|gistbuildempty|gistbulkdelete|" + - "gistcostestimate|gistendscan|gistgetbitmap|gistgettuple|gistinsert|gistmarkpos|" + - "gistoptions|gistrescan|gistrestrpos|gistvacuumcleanup|gtsquery_compress|" + - "gtsquery_consistent|gtsquery_decompress|gtsquery_penalty|gtsquery_picksplit|" + - "gtsquery_same|gtsquery_union|gtsvector_compress|gtsvector_consistent|" + - "gtsvector_decompress|gtsvector_penalty|gtsvector_picksplit|gtsvector_same|" + - "gtsvector_union|gtsvectorin|gtsvectorout|has_any_column_privilege|" + - "has_column_privilege|has_database_privilege|has_foreign_data_wrapper_privilege|" + - "has_function_privilege|has_language_privilege|has_schema_privilege|" + - "has_sequence_privilege|has_server_privilege|has_table_privilege|" + - "has_tablespace_privilege|has_type_privilege|hash_aclitem|hash_array|hash_numeric|" + - "hash_range|hashbeginscan|hashbpchar|hashbuild|hashbuildempty|hashbulkdelete|hashchar|" + - "hashcostestimate|hashendscan|hashenum|hashfloat4|hashfloat8|hashgetbitmap|hashgettuple|" + - "hashinet|hashinsert|hashint2|hashint2vector|hashint4|hashint8|hashmacaddr|hashmarkpos|" + - "hashname|hashoid|hashoidvector|hashoptions|hashrescan|hashrestrpos|hashtext|" + - "hashvacuumcleanup|hashvarlena|height|host|hostmask|iclikejoinsel|iclikesel|" + - "icnlikejoinsel|icnlikesel|icregexeqjoinsel|icregexeqsel|icregexnejoinsel|icregexnesel|" + - "inet_client_addr|inet_client_port|inet_in|inet_out|inet_recv|inet_send|" + - "inet_server_addr|inet_server_port|inetand|inetmi|inetmi_int8|inetnot|inetor|inetpl|" + - "initcap|int2|int24div|int24eq|int24ge|int24gt|int24le|int24lt|int24mi|int24mul|int24ne|" + - "int24pl|int28div|int28eq|int28ge|int28gt|int28le|int28lt|int28mi|int28mul|int28ne|int28pl|" + - "int2_accum|int2_avg_accum|int2_mul_cash|int2_sum|int2abs|int2and|int2div|int2eq|int2ge|" + - "int2gt|int2in|int2larger|int2le|int2lt|int2mi|int2mod|int2mul|int2ne|int2not|int2or|int2out|" + - "int2pl|int2recv|int2send|int2shl|int2shr|int2smaller|int2um|int2up|int2vectoreq|" + - "int2vectorin|int2vectorout|int2vectorrecv|int2vectorsend|int2xor|int4|int42div|int42eq|" + - "int42ge|int42gt|int42le|int42lt|int42mi|int42mul|int42ne|int42pl|int48div|int48eq|int48ge|" + - "int48gt|int48le|int48lt|int48mi|int48mul|int48ne|int48pl|int4_accum|int4_avg_accum|" + - "int4_mul_cash|int4_sum|int4abs|int4and|int4div|int4eq|int4ge|int4gt|int4in|int4inc|" + - "int4larger|int4le|int4lt|int4mi|int4mod|int4mul|int4ne|int4not|int4or|int4out|int4pl|" + - "int4range|int4range_canonical|int4range_subdiff|int4recv|int4send|int4shl|int4shr|" + - "int4smaller|int4um|int4up|int4xor|int8|int82div|int82eq|int82ge|int82gt|int82le|int82lt|" + - "int82mi|int82mul|int82ne|int82pl|int84div|int84eq|int84ge|int84gt|int84le|int84lt|int84mi|" + - "int84mul|int84ne|int84pl|int8_accum|int8_avg|int8_avg_accum|int8_sum|int8abs|int8and|" + - "int8div|int8eq|int8ge|int8gt|int8in|int8inc|int8inc_any|int8inc_float8_float8|int8larger|" + - "int8le|int8lt|int8mi|int8mod|int8mul|int8ne|int8not|int8or|int8out|int8pl|int8pl_inet|" + - "int8range|int8range_canonical|int8range_subdiff|int8recv|int8send|int8shl|int8shr|" + - "int8smaller|int8um|int8up|int8xor|integer_pl_date|inter_lb|inter_sb|inter_sl|internal_in|" + - "internal_out|interval_accum|interval_avg|interval_cmp|interval_div|interval_eq|" + - "interval_ge|interval_gt|interval_hash|interval_in|interval_larger|interval_le|" + - "interval_lt|interval_mi|interval_mul|interval_ne|interval_out|interval_pl|" + - "interval_pl_date|interval_pl_time|interval_pl_timestamp|interval_pl_timestamptz|" + - "interval_pl_timetz|interval_recv|interval_send|interval_smaller|interval_transform|" + - "interval_um|intervaltypmodin|intervaltypmodout|intinterval|isclosed|isempty|isfinite|" + - "ishorizontal|iso8859_1_to_utf8|iso8859_to_utf8|iso_to_koi8r|iso_to_mic|iso_to_win1251|" + - "iso_to_win866|isopen|isparallel|isperp|isvertical|johab_to_utf8|json_agg|" + - "json_agg_finalfn|json_agg_transfn|json_array_element|json_array_element_text|" + - "json_array_elements|json_array_length|json_each|json_each_text|json_extract_path|" + - "json_extract_path_op|json_extract_path_text|json_extract_path_text_op|json_in|" + - "json_object_field|json_object_field_text|json_object_keys|json_out|" + - "json_populate_record|json_populate_recordset|json_recv|json_send|justify_days|" + - "justify_hours|justify_interval|koi8r_to_iso|koi8r_to_mic|koi8r_to_utf8|" + - "koi8r_to_win1251|koi8r_to_win866|koi8u_to_utf8|lag|language_handler_in|" + - "language_handler_out|last_value|lastval|latin1_to_mic|latin2_to_mic|latin2_to_win1250|" + - "latin3_to_mic|latin4_to_mic|lead|left|length|like|like_escape|likejoinsel|likesel|line|" + - "line_distance|line_eq|line_horizontal|line_in|line_interpt|line_intersect|line_out|" + - "line_parallel|line_perp|line_recv|line_send|line_vertical|ln|lo_close|lo_creat|lo_create|" + - "lo_export|lo_import|lo_lseek|lo_lseek64|lo_open|lo_tell|lo_tell64|lo_truncate|" + - "lo_truncate64|lo_unlink|log|loread|lower|lower_inc|lower_inf|lowrite|lpad|lseg|lseg_center|" + - "lseg_distance|lseg_eq|lseg_ge|lseg_gt|lseg_horizontal|lseg_in|lseg_interpt|" + - "lseg_intersect|lseg_le|lseg_length|lseg_lt|lseg_ne|lseg_out|lseg_parallel|lseg_perp|" + - "lseg_recv|lseg_send|lseg_vertical|ltrim|macaddr_and|macaddr_cmp|macaddr_eq|macaddr_ge|" + - "macaddr_gt|macaddr_in|macaddr_le|macaddr_lt|macaddr_ne|macaddr_not|macaddr_or|" + - "macaddr_out|macaddr_recv|macaddr_send|makeaclitem|masklen|max|md5|mic_to_ascii|" + - "mic_to_big5|mic_to_euc_cn|mic_to_euc_jp|mic_to_euc_kr|mic_to_euc_tw|mic_to_iso|" + - "mic_to_koi8r|mic_to_latin1|mic_to_latin2|mic_to_latin3|mic_to_latin4|mic_to_sjis|" + - "mic_to_win1250|mic_to_win1251|mic_to_win866|min|mktinterval|mod|money|mul_d_interval|" + - "name|nameeq|namege|namegt|nameiclike|nameicnlike|nameicregexeq|nameicregexne|namein|" + - "namele|namelike|namelt|namene|namenlike|nameout|namerecv|nameregexeq|nameregexne|namesend|" + - "neqjoinsel|neqsel|netmask|network|network_cmp|network_eq|network_ge|network_gt|" + - "network_le|network_lt|network_ne|network_sub|network_subeq|network_sup|network_supeq|" + - "nextval|nlikejoinsel|nlikesel|notlike|now|npoints|nth_value|ntile|numeric_abs|" + - "numeric_accum|numeric_add|numeric_avg|numeric_avg_accum|numeric_cmp|numeric_div|" + - "numeric_div_trunc|numeric_eq|numeric_exp|numeric_fac|numeric_ge|numeric_gt|numeric_in|" + - "numeric_inc|numeric_larger|numeric_le|numeric_ln|numeric_log|numeric_lt|numeric_mod|" + - "numeric_mul|numeric_ne|numeric_out|numeric_power|numeric_recv|numeric_send|" + - "numeric_smaller|numeric_sqrt|numeric_stddev_pop|numeric_stddev_samp|numeric_sub|" + - "numeric_transform|numeric_uminus|numeric_uplus|numeric_var_pop|numeric_var_samp|" + - "numerictypmodin|numerictypmodout|numnode|numrange|numrange_subdiff|obj_description|" + - "octet_length|oid|oideq|oidge|oidgt|oidin|oidlarger|oidle|oidlt|oidne|oidout|oidrecv|oidsend|" + - "oidsmaller|oidvectoreq|oidvectorge|oidvectorgt|oidvectorin|oidvectorle|oidvectorlt|" + - "oidvectorne|oidvectorout|oidvectorrecv|oidvectorsend|oidvectortypes|on_pb|on_pl|" + - "on_ppath|on_ps|on_sb|on_sl|opaque_in|opaque_out|overlaps|overlay|path|path_add|path_add_pt|" + - "path_center|path_contain_pt|path_distance|path_div_pt|path_in|path_inter|path_length|" + - "path_mul_pt|path_n_eq|path_n_ge|path_n_gt|path_n_le|path_n_lt|path_npoints|path_out|" + - "path_recv|path_send|path_sub_pt|pclose|percent_rank|pg_advisory_lock|" + - "pg_advisory_lock_shared|pg_advisory_unlock|pg_advisory_unlock_all|" + - "pg_advisory_unlock_shared|pg_advisory_xact_lock|pg_advisory_xact_lock_shared|" + - "pg_available_extension_versions|pg_available_extensions|pg_backend_pid|" + - "pg_backup_start_time|pg_cancel_backend|pg_char_to_encoding|pg_client_encoding|" + - "pg_collation_for|pg_collation_is_visible|pg_column_is_updatable|pg_column_size|" + - "pg_conf_load_time|pg_conversion_is_visible|pg_create_restore_point|" + - "pg_current_xlog_insert_location|pg_current_xlog_location|pg_cursor|pg_database_size|" + - "pg_describe_object|pg_encoding_max_length|pg_encoding_to_char|" + - "pg_event_trigger_dropped_objects|pg_export_snapshot|pg_extension_config_dump|" + - "pg_extension_update_paths|pg_function_is_visible|pg_get_constraintdef|pg_get_expr|" + - "pg_get_function_arguments|pg_get_function_identity_arguments|" + - "pg_get_function_result|pg_get_functiondef|pg_get_indexdef|pg_get_keywords|" + - "pg_get_multixact_members|pg_get_ruledef|pg_get_serial_sequence|pg_get_triggerdef|" + - "pg_get_userbyid|pg_get_viewdef|pg_has_role|pg_identify_object|pg_indexes_size|" + - "pg_is_in_backup|pg_is_in_recovery|pg_is_other_temp_schema|pg_is_xlog_replay_paused|" + - "pg_last_xact_replay_timestamp|pg_last_xlog_receive_location|" + - "pg_last_xlog_replay_location|pg_listening_channels|pg_lock_status|pg_ls_dir|" + - "pg_my_temp_schema|pg_node_tree_in|pg_node_tree_out|pg_node_tree_recv|" + - "pg_node_tree_send|pg_notify|pg_opclass_is_visible|pg_operator_is_visible|" + - "pg_opfamily_is_visible|pg_options_to_table|pg_postmaster_start_time|" + - "pg_prepared_statement|pg_prepared_xact|pg_read_binary_file|pg_read_file|" + - "pg_relation_filenode|pg_relation_filepath|pg_relation_is_updatable|pg_relation_size|" + - "pg_reload_conf|pg_rotate_logfile|pg_sequence_parameters|pg_show_all_settings|" + - "pg_size_pretty|pg_sleep|pg_start_backup|pg_stat_clear_snapshot|pg_stat_file|" + - "pg_stat_get_activity|pg_stat_get_analyze_count|pg_stat_get_autoanalyze_count|" + - "pg_stat_get_autovacuum_count|pg_stat_get_backend_activity|" + - "pg_stat_get_backend_activity_start|pg_stat_get_backend_client_addr|" + - "pg_stat_get_backend_client_port|pg_stat_get_backend_dbid|pg_stat_get_backend_idset|" + - "pg_stat_get_backend_pid|pg_stat_get_backend_start|pg_stat_get_backend_userid|" + - "pg_stat_get_backend_waiting|pg_stat_get_backend_xact_start|" + - "pg_stat_get_bgwriter_buf_written_checkpoints|" + - "pg_stat_get_bgwriter_buf_written_clean|pg_stat_get_bgwriter_maxwritten_clean|" + - "pg_stat_get_bgwriter_requested_checkpoints|pg_stat_get_bgwriter_stat_reset_time|" + - "pg_stat_get_bgwriter_timed_checkpoints|pg_stat_get_blocks_fetched|" + - "pg_stat_get_blocks_hit|pg_stat_get_buf_alloc|pg_stat_get_buf_fsync_backend|" + - "pg_stat_get_buf_written_backend|pg_stat_get_checkpoint_sync_time|" + - "pg_stat_get_checkpoint_write_time|pg_stat_get_db_blk_read_time|" + - "pg_stat_get_db_blk_write_time|pg_stat_get_db_blocks_fetched|" + - "pg_stat_get_db_blocks_hit|pg_stat_get_db_conflict_all|" + - "pg_stat_get_db_conflict_bufferpin|pg_stat_get_db_conflict_lock|" + - "pg_stat_get_db_conflict_snapshot|pg_stat_get_db_conflict_startup_deadlock|" + - "pg_stat_get_db_conflict_tablespace|pg_stat_get_db_deadlocks|" + - "pg_stat_get_db_numbackends|pg_stat_get_db_stat_reset_time|" + - "pg_stat_get_db_temp_bytes|pg_stat_get_db_temp_files|pg_stat_get_db_tuples_deleted|" + - "pg_stat_get_db_tuples_fetched|pg_stat_get_db_tuples_inserted|" + - "pg_stat_get_db_tuples_returned|pg_stat_get_db_tuples_updated|" + - "pg_stat_get_db_xact_commit|pg_stat_get_db_xact_rollback|pg_stat_get_dead_tuples|" + - "pg_stat_get_function_calls|pg_stat_get_function_self_time|" + - "pg_stat_get_function_total_time|pg_stat_get_last_analyze_time|" + - "pg_stat_get_last_autoanalyze_time|pg_stat_get_last_autovacuum_time|" + - "pg_stat_get_last_vacuum_time|pg_stat_get_live_tuples|pg_stat_get_numscans|" + - "pg_stat_get_tuples_deleted|pg_stat_get_tuples_fetched|" + - "pg_stat_get_tuples_hot_updated|pg_stat_get_tuples_inserted|" + - "pg_stat_get_tuples_returned|pg_stat_get_tuples_updated|pg_stat_get_vacuum_count|" + - "pg_stat_get_wal_senders|pg_stat_get_xact_blocks_fetched|" + - "pg_stat_get_xact_blocks_hit|pg_stat_get_xact_function_calls|" + - "pg_stat_get_xact_function_self_time|pg_stat_get_xact_function_total_time|" + - "pg_stat_get_xact_numscans|pg_stat_get_xact_tuples_deleted|" + - "pg_stat_get_xact_tuples_fetched|pg_stat_get_xact_tuples_hot_updated|" + - "pg_stat_get_xact_tuples_inserted|pg_stat_get_xact_tuples_returned|" + - "pg_stat_get_xact_tuples_updated|pg_stat_reset|pg_stat_reset_shared|" + - "pg_stat_reset_single_function_counters|pg_stat_reset_single_table_counters|" + - "pg_stop_backup|pg_switch_xlog|pg_table_is_visible|pg_table_size|" + - "pg_tablespace_databases|pg_tablespace_location|pg_tablespace_size|" + - "pg_terminate_backend|pg_timezone_abbrevs|pg_timezone_names|pg_total_relation_size|" + - "pg_trigger_depth|pg_try_advisory_lock|pg_try_advisory_lock_shared|" + - "pg_try_advisory_xact_lock|pg_try_advisory_xact_lock_shared|pg_ts_config_is_visible|" + - "pg_ts_dict_is_visible|pg_ts_parser_is_visible|pg_ts_template_is_visible|" + - "pg_type_is_visible|pg_typeof|pg_xlog_location_diff|pg_xlog_replay_pause|" + - "pg_xlog_replay_resume|pg_xlogfile_name|pg_xlogfile_name_offset|pi|plainto_tsquery|" + - "plpgsql_call_handler|plpgsql_inline_handler|plpgsql_validator|point|point_above|" + - "point_add|point_below|point_distance|point_div|point_eq|point_horiz|point_in|point_left|" + - "point_mul|point_ne|point_out|point_recv|point_right|point_send|point_sub|point_vert|" + - "poly_above|poly_below|poly_center|poly_contain|poly_contain_pt|poly_contained|" + - "poly_distance|poly_in|poly_left|poly_npoints|poly_out|poly_overabove|poly_overbelow|" + - "poly_overlap|poly_overleft|poly_overright|poly_recv|poly_right|poly_same|poly_send|" + - "polygon|popen|position|positionjoinsel|positionsel|postgresql_fdw_validator|pow|power|" + - "prsd_end|prsd_headline|prsd_lextype|prsd_nexttoken|prsd_start|pt_contained_circle|" + - "pt_contained_poly|query_to_xml|query_to_xml_and_xmlschema|query_to_xmlschema|" + - "querytree|quote_ident|quote_literal|quote_nullable|radians|radius|random|range_adjacent|" + - "range_after|range_before|range_cmp|range_contained_by|range_contains|" + - "range_contains_elem|range_eq|range_ge|range_gist_compress|range_gist_consistent|" + - "range_gist_decompress|range_gist_penalty|range_gist_picksplit|range_gist_same|" + - "range_gist_union|range_gt|range_in|range_intersect|range_le|range_lt|range_minus|" + - "range_ne|range_out|range_overlaps|range_overleft|range_overright|range_recv|range_send|" + - "range_typanalyze|range_union|rangesel|rank|record_eq|record_ge|record_gt|record_in|" + - "record_le|record_lt|record_ne|record_out|record_recv|record_send|regclass|regclassin|" + - "regclassout|regclassrecv|regclasssend|regconfigin|regconfigout|regconfigrecv|" + - "regconfigsend|regdictionaryin|regdictionaryout|regdictionaryrecv|regdictionarysend|" + - "regexeqjoinsel|regexeqsel|regexnejoinsel|regexnesel|regexp_matches|regexp_replace|" + - "regexp_split_to_array|regexp_split_to_table|regoperatorin|regoperatorout|" + - "regoperatorrecv|regoperatorsend|regoperin|regoperout|regoperrecv|regopersend|" + - "regprocedurein|regprocedureout|regprocedurerecv|regproceduresend|regprocin|regprocout|" + - "regprocrecv|regprocsend|regr_avgx|regr_avgy|regr_count|regr_intercept|regr_r2|" + - "regr_slope|regr_sxx|regr_sxy|regr_syy|regtypein|regtypeout|regtyperecv|regtypesend|" + - "reltime|reltimeeq|reltimege|reltimegt|reltimein|reltimele|reltimelt|reltimene|reltimeout|" + - "reltimerecv|reltimesend|repeat|replace|reverse|right|round|row_number|row_to_json|rpad|" + - "rtrim|scalargtjoinsel|scalargtsel|scalarltjoinsel|scalarltsel|schema_to_xml|" + - "schema_to_xml_and_xmlschema|schema_to_xmlschema|session_user|set_bit|set_byte|" + - "set_config|set_masklen|setseed|setval|setweight|shell_in|shell_out|" + - "shift_jis_2004_to_euc_jis_2004|shift_jis_2004_to_utf8|shobj_description|sign|" + - "similar_escape|sin|sjis_to_euc_jp|sjis_to_mic|sjis_to_utf8|slope|smgreq|smgrin|smgrne|" + - "smgrout|spg_kd_choose|spg_kd_config|spg_kd_inner_consistent|spg_kd_picksplit|" + - "spg_quad_choose|spg_quad_config|spg_quad_inner_consistent|spg_quad_leaf_consistent|" + - "spg_quad_picksplit|spg_range_quad_choose|spg_range_quad_config|" + - "spg_range_quad_inner_consistent|spg_range_quad_leaf_consistent|" + - "spg_range_quad_picksplit|spg_text_choose|spg_text_config|spg_text_inner_consistent|" + - "spg_text_leaf_consistent|spg_text_picksplit|spgbeginscan|spgbuild|spgbuildempty|" + - "spgbulkdelete|spgcanreturn|spgcostestimate|spgendscan|spggetbitmap|spggettuple|" + - "spginsert|spgmarkpos|spgoptions|spgrescan|spgrestrpos|spgvacuumcleanup|split_part|sqrt|" + - "statement_timestamp|stddev|stddev_pop|stddev_samp|string_agg|string_agg_finalfn|" + - "string_agg_transfn|string_to_array|strip|strpos|substr|substring|sum|" + - "suppress_redundant_updates_trigger|table_to_xml|table_to_xml_and_xmlschema|" + - "table_to_xmlschema|tan|text|text_ge|text_gt|text_larger|text_le|text_lt|text_pattern_ge|" + - "text_pattern_gt|text_pattern_le|text_pattern_lt|text_smaller|textanycat|textcat|texteq|" + - "texticlike|texticnlike|texticregexeq|texticregexne|textin|textlen|textlike|textne|" + - "textnlike|textout|textrecv|textregexeq|textregexne|textsend|thesaurus_init|" + - "thesaurus_lexize|tideq|tidge|tidgt|tidin|tidlarger|tidle|tidlt|tidne|tidout|tidrecv|tidsend|" + - "tidsmaller|time_cmp|time_eq|time_ge|time_gt|time_hash|time_in|time_larger|time_le|time_lt|" + - "time_mi_interval|time_mi_time|time_ne|time_out|time_pl_interval|time_recv|time_send|" + - "time_smaller|time_transform|timedate_pl|timemi|timenow|timeofday|timepl|timestamp_cmp|" + - "timestamp_cmp_date|timestamp_cmp_timestamptz|timestamp_eq|timestamp_eq_date|" + - "timestamp_eq_timestamptz|timestamp_ge|timestamp_ge_date|timestamp_ge_timestamptz|" + - "timestamp_gt|timestamp_gt_date|timestamp_gt_timestamptz|timestamp_hash|timestamp_in|" + - "timestamp_larger|timestamp_le|timestamp_le_date|timestamp_le_timestamptz|" + - "timestamp_lt|timestamp_lt_date|timestamp_lt_timestamptz|timestamp_mi|" + - "timestamp_mi_interval|timestamp_ne|timestamp_ne_date|timestamp_ne_timestamptz|" + - "timestamp_out|timestamp_pl_interval|timestamp_recv|timestamp_send|timestamp_smaller|" + - "timestamp_sortsupport|timestamp_transform|timestamptypmodin|timestamptypmodout|" + - "timestamptz_cmp|timestamptz_cmp_date|timestamptz_cmp_timestamp|timestamptz_eq|" + - "timestamptz_eq_date|timestamptz_eq_timestamp|timestamptz_ge|timestamptz_ge_date|" + - "timestamptz_ge_timestamp|timestamptz_gt|timestamptz_gt_date|" + - "timestamptz_gt_timestamp|timestamptz_in|timestamptz_larger|timestamptz_le|" + - "timestamptz_le_date|timestamptz_le_timestamp|timestamptz_lt|timestamptz_lt_date|" + - "timestamptz_lt_timestamp|timestamptz_mi|timestamptz_mi_interval|timestamptz_ne|" + - "timestamptz_ne_date|timestamptz_ne_timestamp|timestamptz_out|" + - "timestamptz_pl_interval|timestamptz_recv|timestamptz_send|timestamptz_smaller|" + - "timestamptztypmodin|timestamptztypmodout|timetypmodin|timetypmodout|timetz_cmp|" + - "timetz_eq|timetz_ge|timetz_gt|timetz_hash|timetz_in|timetz_larger|timetz_le|timetz_lt|" + - "timetz_mi_interval|timetz_ne|timetz_out|timetz_pl_interval|timetz_recv|timetz_send|" + - "timetz_smaller|timetzdate_pl|timetztypmodin|timetztypmodout|timezone|tinterval|" + - "tintervalct|tintervalend|tintervaleq|tintervalge|tintervalgt|tintervalin|tintervalle|" + - "tintervalleneq|tintervallenge|tintervallengt|tintervallenle|tintervallenlt|" + - "tintervallenne|tintervallt|tintervalne|tintervalout|tintervalov|tintervalrecv|" + - "tintervalrel|tintervalsame|tintervalsend|tintervalstart|to_ascii|to_char|to_date|to_hex|" + - "to_json|to_number|to_timestamp|to_tsquery|to_tsvector|transaction_timestamp|translate|" + - "trigger_in|trigger_out|trunc|ts_debug|ts_headline|ts_lexize|ts_match_qv|ts_match_tq|" + - "ts_match_tt|ts_match_vq|ts_parse|ts_rank|ts_rank_cd|ts_rewrite|ts_stat|ts_token_type|" + - "ts_typanalyze|tsmatchjoinsel|tsmatchsel|tsq_mcontained|tsq_mcontains|tsquery_and|" + - "tsquery_cmp|tsquery_eq|tsquery_ge|tsquery_gt|tsquery_le|tsquery_lt|tsquery_ne|" + - "tsquery_not|tsquery_or|tsqueryin|tsqueryout|tsqueryrecv|tsquerysend|tsrange|" + - "tsrange_subdiff|tstzrange|tstzrange_subdiff|tsvector_cmp|tsvector_concat|tsvector_eq|" + - "tsvector_ge|tsvector_gt|tsvector_le|tsvector_lt|tsvector_ne|tsvector_update_trigger|" + - "tsvector_update_trigger_column|tsvectorin|tsvectorout|tsvectorrecv|tsvectorsend|" + - "txid_current|txid_current_snapshot|txid_snapshot_in|txid_snapshot_out|" + - "txid_snapshot_recv|txid_snapshot_send|txid_snapshot_xip|txid_snapshot_xmax|" + - "txid_snapshot_xmin|txid_visible_in_snapshot|uhc_to_utf8|unique_key_recheck|unknownin|" + - "unknownout|unknownrecv|unknownsend|unnest|upper|upper_inc|upper_inf|utf8_to_ascii|" + - "utf8_to_big5|utf8_to_euc_cn|utf8_to_euc_jis_2004|utf8_to_euc_jp|utf8_to_euc_kr|" + - "utf8_to_euc_tw|utf8_to_gb18030|utf8_to_gbk|utf8_to_iso8859|utf8_to_iso8859_1|" + - "utf8_to_johab|utf8_to_koi8r|utf8_to_koi8u|utf8_to_shift_jis_2004|utf8_to_sjis|" + - "utf8_to_uhc|utf8_to_win|uuid_cmp|uuid_eq|uuid_ge|uuid_gt|uuid_hash|uuid_in|uuid_le|" + - "uuid_lt|uuid_ne|uuid_out|uuid_recv|uuid_send|var_pop|var_samp|varbit_in|varbit_out|" + - "varbit_recv|varbit_send|varbit_transform|varbitcmp|varbiteq|varbitge|varbitgt|varbitle|" + - "varbitlt|varbitne|varbittypmodin|varbittypmodout|varchar_transform|varcharin|" + - "varcharout|varcharrecv|varcharsend|varchartypmodin|varchartypmodout|variance|version|" + - "void_in|void_out|void_recv|void_send|width|width_bucket|win1250_to_latin2|" + - "win1250_to_mic|win1251_to_iso|win1251_to_koi8r|win1251_to_mic|win1251_to_win866|" + - "win866_to_iso|win866_to_koi8r|win866_to_mic|win866_to_win1251|win_to_utf8|xideq|" + - "xideqint4|xidin|xidout|xidrecv|xidsend|xml|xml_in|xml_is_well_formed|" + - "xml_is_well_formed_content|xml_is_well_formed_document|xml_out|xml_recv|xml_send|" + - "xmlagg|xmlcomment|xmlconcat2|xmlexists|xmlvalidate|xpath|xpath_exists" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "keyword": keywords - }, "identifier", true); - - - var sqlRules = [{ - token : "string", // single line string -- assume dollar strings if multi-line for now - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "variable.language", // pg identifier - regex : '".*?"' - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_][a-zA-Z0-9_$]*\\b" // TODO - Unicode in identifiers - }, { - token : "keyword.operator", - regex : "!|!!|!~|!~\\*|!~~|!~~\\*|#|##|#<|#<=|#<>|#=|#>|#>=|%|\\&|\\&\\&|\\&<|\\&<\\||\\&>|\\*|\\+|" + - "\\-|/|<|<#>|<\\->|<<|<<=|<<\\||<=|<>|<\\?>|<@|<\\^|=|>|>=|>>|>>=|>\\^|\\?#|\\?\\-|\\?\\-\\||" + - "\\?\\||\\?\\|\\||@|@\\-@|@>|@@|@@@|\\^|\\||\\|\\&>|\\|/|\\|>>|\\|\\||\\|\\|/|~|~\\*|~<=~|~<~|" + - "~=|~>=~|~>~|~~|~~\\*" - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } - ]; - - - this.$rules = { - "start" : [{ - token : "comment", - regex : "--.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi-line comment - regex : "\\/\\*", - next : "comment" - },{ - token : "keyword.statementBegin", - regex : "^[a-zA-Z]+", // Could enumerate starting keywords but this allows things to work when new statements are added. - next : "statement" - },{ - token : "support.buildin", // psql directive - regex : "^\\\\[\\S]+.*$" - } - ], - - "statement" : [{ - token : "comment", - regex : "--.*$" - }, { - token : "comment", // multi-line comment - regex : "\\/\\*", - next : "commentStatement" - }, { - token : "statementEnd", - regex : ";", - next : "start" - }, { - token : "string", - regex : "\\$perl\\$", - next : "perl-start" - }, { - token : "string", - regex : "\\$python\\$", - next : "python-start" - }, { - token : "string", - regex : "\\$json\\$", - next : "json-start" - }, { - token : "string", - regex : "\\$(js|javascript)\\$", - next : "javascript-start" - }, { - token : "string", - regex : "\\$[\\w_0-9]*\\$$", // dollar quote at the end of a line - next : "dollarSql" - }, { - token : "string", - regex : "\\$[\\w_0-9]*\\$", - next : "dollarStatementString" - } - ].concat(sqlRules), - - "dollarSql" : [{ - token : "comment", - regex : "--.*$" - }, { - token : "comment", // multi-line comment - regex : "\\/\\*", - next : "commentDollarSql" - }, { - token : "string", // end quoting with dollar at the start of a line - regex : "^\\$[\\w_0-9]*\\$", - next : "statement" - }, { - token : "string", - regex : "\\$[\\w_0-9]*\\$", - next : "dollarSqlString" - } - ].concat(sqlRules), - - "comment" : [{ - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - - "commentStatement" : [{ - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "statement" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - - "commentDollarSql" : [{ - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "dollarSql" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - - "dollarStatementString" : [{ - token : "string", // closing dollarstring - regex : ".*?\\$[\\w_0-9]*\\$", - next : "statement" - }, { - token : "string", // dollarstring spanning whole line - regex : ".+" - } - ], - - "dollarSqlString" : [{ - token : "string", // closing dollarstring - regex : ".*?\\$[\\w_0-9]*\\$", - next : "dollarSql" - }, { - token : "string", // dollarstring spanning whole line - regex : ".+" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); - this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]); - this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]); - this.embedRules(JsonHighlightRules, "json-", [{token : "string", regex : "\\$json\\$", next : "statement"}]); - this.embedRules(JavaScriptHighlightRules, "javascript-", [{token : "string", regex : "\\$(js|javascript)\\$", next : "statement"}]); -}; - -oop.inherits(PgsqlHighlightRules, TextHighlightRules); - -exports.PgsqlHighlightRules = PgsqlHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/perl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var PerlHighlightRules = function() { - - var keywords = ( - "base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" + - "no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars" - ); - - var buildinConstants = ("ARGV|ENV|INC|SIG"); - - var builtinFunctions = ( - "getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" + - "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" + - "getpeername|setpriority|getprotoent|setprotoent|getpriority|" + - "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" + - "getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" + - "localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" + - "closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" + - "shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|" + - "dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|" + - "setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|" + - "lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|" + - "waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|" + - "chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|" + - "unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|" + - "length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|" + - "undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|" + - "sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|" + - "BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|" + - "join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|" + - "keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|" + - "eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|" + - "map|die|uc|lc|do" - ); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": buildinConstants, - "support.function": builtinFunctions - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment.doc", - regex : "^=(?:begin|item)\\b", - next : "block_comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0x[0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "%#|\\$#|\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)" - }, { - token : "comment", - regex : "#.*$" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "block_comment": [ - { - token: "comment.doc", - regex: "^=cut\\b", - next: "start" - }, - { - defaultToken: "comment.doc" - } - ] - }; -}; - -oop.inherits(PerlHighlightRules, TextHighlightRules); - -exports.PerlHighlightRules = PerlHighlightRules; -}); - -ace.define('ace/mode/python_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var PythonHighlightRules = function() { - - var keywords = ( - "and|as|assert|break|class|continue|def|del|elif|else|except|exec|" + - "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" + - "raise|return|try|while|with|yield" - ); - - var builtinConstants = ( - "True|False|None|NotImplemented|Ellipsis|__debug__" - ); - - var builtinFunctions = ( - "abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" + - "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" + - "binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|" + - "float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" + - "chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" + - "cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" + - "__import__|complex|hash|min|set|apply|delattr|help|next|setattr|" + - "buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern" - ); - var keywordMapper = this.createKeywordMapper({ - "invalid.deprecated": "debugger", - "support.function": builtinFunctions, - "constant.language": builtinConstants, - "keyword": keywords - }, "identifier"); - - var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?"; - - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; - var octInteger = "(?:0[oO]?[0-7]+)"; - var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; - var binInteger = "(?:0[bB][01]+)"; - var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; - - var exponent = "(?:[eE][+-]?\\d+)"; - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; - var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; - - var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"; - - this.$rules = { - "start" : [ { - token : "comment", - regex : "#.*$" - }, { - token : "string", // multi line """ string start - regex : strPre + '"{3}', - next : "qqstring3" - }, { - token : "string", // " string - regex : strPre + '"(?=.)', - next : "qqstring" - }, { - token : "string", // multi line ''' string start - regex : strPre + "'{3}", - next : "qstring3" - }, { - token : "string", // ' string - regex : strPre + "'(?=.)", - next : "qstring" - }, { - token : "constant.numeric", // imaginary - regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" - }, { - token : "constant.numeric", // float - regex : floatNumber - }, { - token : "constant.numeric", // long integer - regex : integer + "[lL]\\b" - }, { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen", - regex : "[\\]\\)\\}]" - }, { - token : "text", - regex : "\\s+" - } ], - "qqstring3" : [ { - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", // multi line """ string end - regex : '"{3}', - next : "start" - }, { - defaultToken : "string" - } ], - "qstring3" : [ { - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", // multi line ''' string end - regex : "'{3}", - next : "start" - }, { - defaultToken : "string" - } ], - "qqstring" : [{ - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "start" - }, { - defaultToken: "string" - }], - "qstring" : [{ - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "start" - }, { - defaultToken: "string" - }] - }; -}; - -oop.inherits(PythonHighlightRules, TextHighlightRules); - -exports.PythonHighlightRules = PythonHighlightRules; -}); - -ace.define('ace/mode/json_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JsonHighlightRules = function() { - this.$rules = { - "start" : [ - { - token : "variable", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' - }, { - token : "string", // single line - regex : '"', - next : "string" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : "invalid.illegal", // single quoted strings are not allowed - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "invalid.illegal", // comments are not allowed - regex : "\\/\\/.*$" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "string" : [ - { - token : "constant.language.escape", - regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ - }, { - token : "string", - regex : '[^"\\\\]+' - }, { - token : "string", - regex : '"', - next : "start" - }, { - token : "string", - regex : "", - next : "start" - } - ] - }; - -}; - -oop.inherits(JsonHighlightRules, TextHighlightRules); - -exports.JsonHighlightRules = JsonHighlightRules; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-php.js b/util/build-sample-browser/player/vendor/ace/mode-php.js deleted file mode 100644 index a738de5452..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-php.js +++ /dev/null @@ -1,2526 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/php', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/php_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/unicode'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules; -var PhpLangHighlightRules = require("./php_highlight_rules").PhpLangHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; -var unicode = require("../unicode"); - -var Mode = function(opts) { - this.inlinePhp = opts && opts.inline; - var HighlightRules = this.inlinePhp ? PhpLangHighlightRules : PhpHighlightRules; - this.HighlightRules = HighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.tokenRe = new RegExp("^[" - + unicode.packages.L - + unicode.packages.Mn + unicode.packages.Mc - + unicode.packages.Nd - + unicode.packages.Pc + "\_]+", "g" - ); - - this.nonTokenRe = new RegExp("^(?:[^" - + unicode.packages.L - + unicode.packages.Mn + unicode.packages.Mc - + unicode.packages.Nd - + unicode.packages.Pc + "\_]|\s])+", "g" - ); - - - this.lineCommentStart = ["//", "#"]; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "php-start") { - var match = line.match(/^.*[\{\(\[\:]\s*$/); - if (match) { - indent += tab; - } - } else if (state == "php-doc-start") { - if (endState != "php-doc-start") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/php_worker", "PhpWorker"); - worker.attachToDocument(session.getDocument()); - - if (this.inlinePhp) - worker.call("setOptions", [{inline: true}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("ok", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/php"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/php_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules', 'ace/mode/html_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - -var PhpLangHighlightRules = function() { - var docComment = DocCommentHighlightRules; - var builtinFunctions = lang.arrayToMap( - ('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|' + - 'aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|amqpconnection|amqpexchange|amqpqueue|' + - 'apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|' + - 'apache_reset_timeout|apache_response_headers|apache_setenv|apc_add|apc_bin_dump|apc_bin_dumpfile|apc_bin_load|apc_bin_loadfile|' + - 'apc_cache_info|apc_cas|apc_clear_cache|apc_compile_file|apc_dec|apc_define_constants|apc_delete|apc_delete_file|apc_exists|apc_fetch|' + - 'apc_inc|apc_load_constants|apc_sma_info|apc_store|apciterator|apd_breakpoint|apd_callstack|apd_clunk|apd_continue|apd_croak|' + - 'apd_dump_function_table|apd_dump_persistent_resources|apd_dump_regular_resources|apd_echo|apd_get_active_symbols|apd_set_pprof_trace|' + - 'apd_set_session|apd_set_session_trace|apd_set_session_trace_socket|appenditerator|array|array_change_key_case|array_chunk|array_combine|' + - 'array_count_values|array_diff|array_diff_assoc|array_diff_key|array_diff_uassoc|array_diff_ukey|array_fill|array_fill_keys|array_filter|' + - 'array_flip|array_intersect|array_intersect_assoc|array_intersect_key|array_intersect_uassoc|array_intersect_ukey|array_key_exists|' + - 'array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_product|array_push|array_rand|' + - 'array_reduce|array_replace|array_replace_recursive|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|' + - 'array_udiff_assoc|array_udiff_uassoc|array_uintersect|array_uintersect_assoc|array_uintersect_uassoc|array_unique|array_unshift|' + - 'array_values|array_walk|array_walk_recursive|arrayaccess|arrayiterator|arrayobject|arsort|asin|asinh|asort|assert|assert_options|atan|' + - 'atan2|atanh|audioproperties|badfunctioncallexception|badmethodcallexception|base64_decode|base64_encode|base_convert|basename|' + - 'bbcode_add_element|bbcode_add_smiley|bbcode_create|bbcode_destroy|bbcode_parse|bbcode_set_arg_parser|bbcode_set_flags|bcadd|bccomp|bcdiv|' + - 'bcmod|bcmul|bcompiler_load|bcompiler_load_exe|bcompiler_parse_class|bcompiler_read|bcompiler_write_class|bcompiler_write_constant|' + - 'bcompiler_write_exe_footer|bcompiler_write_file|bcompiler_write_footer|bcompiler_write_function|bcompiler_write_functions_from_file|' + - 'bcompiler_write_header|bcompiler_write_included_filename|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|' + - 'bindtextdomain|bson_decode|bson_encode|bumpValue|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|' + - 'cachingiterator|cairo|cairo_create|cairo_font_face_get_type|cairo_font_face_status|cairo_font_options_create|cairo_font_options_equal|' + - 'cairo_font_options_get_antialias|cairo_font_options_get_hint_metrics|cairo_font_options_get_hint_style|' + - 'cairo_font_options_get_subpixel_order|cairo_font_options_hash|cairo_font_options_merge|cairo_font_options_set_antialias|' + - 'cairo_font_options_set_hint_metrics|cairo_font_options_set_hint_style|cairo_font_options_set_subpixel_order|cairo_font_options_status|' + - 'cairo_format_stride_for_width|cairo_image_surface_create|cairo_image_surface_create_for_data|cairo_image_surface_create_from_png|' + - 'cairo_image_surface_get_data|cairo_image_surface_get_format|cairo_image_surface_get_height|cairo_image_surface_get_stride|' + - 'cairo_image_surface_get_width|cairo_matrix_create_scale|cairo_matrix_create_translate|cairo_matrix_invert|cairo_matrix_multiply|' + - 'cairo_matrix_rotate|cairo_matrix_transform_distance|cairo_matrix_transform_point|cairo_matrix_translate|cairo_pattern_add_color_stop_rgb|' + - 'cairo_pattern_add_color_stop_rgba|cairo_pattern_create_for_surface|cairo_pattern_create_linear|cairo_pattern_create_radial|' + - 'cairo_pattern_create_rgb|cairo_pattern_create_rgba|cairo_pattern_get_color_stop_count|cairo_pattern_get_color_stop_rgba|' + - 'cairo_pattern_get_extend|cairo_pattern_get_filter|cairo_pattern_get_linear_points|cairo_pattern_get_matrix|' + - 'cairo_pattern_get_radial_circles|cairo_pattern_get_rgba|cairo_pattern_get_surface|cairo_pattern_get_type|cairo_pattern_set_extend|' + - 'cairo_pattern_set_filter|cairo_pattern_set_matrix|cairo_pattern_status|cairo_pdf_surface_create|cairo_pdf_surface_set_size|' + - 'cairo_ps_get_levels|cairo_ps_level_to_string|cairo_ps_surface_create|cairo_ps_surface_dsc_begin_page_setup|' + - 'cairo_ps_surface_dsc_begin_setup|cairo_ps_surface_dsc_comment|cairo_ps_surface_get_eps|cairo_ps_surface_restrict_to_level|' + - 'cairo_ps_surface_set_eps|cairo_ps_surface_set_size|cairo_scaled_font_create|cairo_scaled_font_extents|cairo_scaled_font_get_ctm|' + - 'cairo_scaled_font_get_font_face|cairo_scaled_font_get_font_matrix|cairo_scaled_font_get_font_options|cairo_scaled_font_get_scale_matrix|' + - 'cairo_scaled_font_get_type|cairo_scaled_font_glyph_extents|cairo_scaled_font_status|cairo_scaled_font_text_extents|' + - 'cairo_surface_copy_page|cairo_surface_create_similar|cairo_surface_finish|cairo_surface_flush|cairo_surface_get_content|' + - 'cairo_surface_get_device_offset|cairo_surface_get_font_options|cairo_surface_get_type|cairo_surface_mark_dirty|' + - 'cairo_surface_mark_dirty_rectangle|cairo_surface_set_device_offset|cairo_surface_set_fallback_resolution|cairo_surface_show_page|' + - 'cairo_surface_status|cairo_surface_write_to_png|cairo_svg_surface_create|cairo_svg_surface_restrict_to_version|' + - 'cairo_svg_version_to_string|cairoantialias|cairocontent|cairocontext|cairoexception|cairoextend|cairofillrule|cairofilter|cairofontface|' + - 'cairofontoptions|cairofontslant|cairofonttype|cairofontweight|cairoformat|cairogradientpattern|cairohintmetrics|cairohintstyle|' + - 'cairoimagesurface|cairolineargradient|cairolinecap|cairolinejoin|cairomatrix|cairooperator|cairopath|cairopattern|cairopatterntype|' + - 'cairopdfsurface|cairopslevel|cairopssurface|cairoradialgradient|cairoscaledfont|cairosolidpattern|cairostatus|cairosubpixelorder|' + - 'cairosurface|cairosurfacepattern|cairosurfacetype|cairosvgsurface|cairosvgversion|cairotoyfontface|cal_days_in_month|cal_from_jd|cal_info|' + - 'cal_to_jd|calcul_hmac|calculhmac|call_user_func|call_user_func_array|call_user_method|call_user_method_array|callbackfilteriterator|ceil|' + - 'chdb|chdb_create|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_alias|class_exists|class_implements|' + - 'class_parents|classkit_import|classkit_method_add|classkit_method_copy|classkit_method_redefine|classkit_method_remove|' + - 'classkit_method_rename|clearstatcache|clone|closedir|closelog|collator|com|com_addref|com_create_guid|com_event_sink|com_get|' + - 'com_get_active_object|com_invoke|com_isenum|com_load|com_load_typelib|com_message_pump|com_print_typeinfo|com_propget|com_propput|' + - 'com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|construct|construct|construct|' + - 'convert_cyr_string|convert_uudecode|convert_uuencode|copy|cos|cosh|count|count_chars|countable|counter_bump|counter_bump_value|' + - 'counter_create|counter_get|counter_get_meta|counter_get_named|counter_get_value|counter_reset|counter_reset_value|crack_check|' + - 'crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|' + - 'ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|cubrid_affected_rows|cubrid_bind|' + - 'cubrid_client_encoding|cubrid_close|cubrid_close_prepare|cubrid_close_request|cubrid_col_get|cubrid_col_size|cubrid_column_names|' + - 'cubrid_column_types|cubrid_commit|cubrid_connect|cubrid_connect_with_url|cubrid_current_oid|cubrid_data_seek|cubrid_db_name|' + - 'cubrid_disconnect|cubrid_drop|cubrid_errno|cubrid_error|cubrid_error_code|cubrid_error_code_facility|cubrid_error_msg|cubrid_execute|' + - 'cubrid_fetch|cubrid_fetch_array|cubrid_fetch_assoc|cubrid_fetch_field|cubrid_fetch_lengths|cubrid_fetch_object|cubrid_fetch_row|' + - 'cubrid_field_flags|cubrid_field_len|cubrid_field_name|cubrid_field_seek|cubrid_field_table|cubrid_field_type|cubrid_free_result|' + - 'cubrid_get|cubrid_get_autocommit|cubrid_get_charset|cubrid_get_class_name|cubrid_get_client_info|cubrid_get_db_parameter|' + - 'cubrid_get_server_info|cubrid_insert_id|cubrid_is_instance|cubrid_list_dbs|cubrid_load_from_glo|cubrid_lob_close|cubrid_lob_export|' + - 'cubrid_lob_get|cubrid_lob_send|cubrid_lob_size|cubrid_lock_read|cubrid_lock_write|cubrid_move_cursor|cubrid_new_glo|cubrid_next_result|' + - 'cubrid_num_cols|cubrid_num_fields|cubrid_num_rows|cubrid_ping|cubrid_prepare|cubrid_put|cubrid_query|cubrid_real_escape_string|' + - 'cubrid_result|cubrid_rollback|cubrid_save_to_glo|cubrid_schema|cubrid_send_glo|cubrid_seq_drop|cubrid_seq_insert|cubrid_seq_put|' + - 'cubrid_set_add|cubrid_set_autocommit|cubrid_set_db_parameter|cubrid_set_drop|cubrid_unbuffered_query|cubrid_version|curl_close|' + - 'curl_copy_handle|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|' + - 'curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_setopt_array|' + - 'curl_version|current|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|date_add|date_create|' + - 'date_create_from_format|date_date_set|date_default_timezone_get|date_default_timezone_set|date_diff|date_format|date_get_last_errors|' + - 'date_interval_create_from_date_string|date_interval_format|date_isodate_set|date_modify|date_offset_get|date_parse|date_parse_from_format|' + - 'date_sub|date_sun_info|date_sunrise|date_sunset|date_time_set|date_timestamp_get|date_timestamp_set|date_timezone_get|date_timezone_set|' + - 'dateinterval|dateperiod|datetime|datetimezone|db2_autocommit|db2_bind_param|db2_client_info|db2_close|db2_column_privileges|db2_columns|' + - 'db2_commit|db2_conn_error|db2_conn_errormsg|db2_connect|db2_cursor_type|db2_escape_string|db2_exec|db2_execute|db2_fetch_array|' + - 'db2_fetch_assoc|db2_fetch_both|db2_fetch_object|db2_fetch_row|db2_field_display_size|db2_field_name|db2_field_num|db2_field_precision|' + - 'db2_field_scale|db2_field_type|db2_field_width|db2_foreign_keys|db2_free_result|db2_free_stmt|db2_get_option|db2_last_insert_id|' + - 'db2_lob_read|db2_next_result|db2_num_fields|db2_num_rows|db2_pclose|db2_pconnect|db2_prepare|db2_primary_keys|db2_procedure_columns|' + - 'db2_procedures|db2_result|db2_rollback|db2_server_info|db2_set_option|db2_special_columns|db2_statistics|db2_stmt_error|db2_stmt_errormsg|' + - 'db2_table_privileges|db2_tables|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|' + - 'dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|' + - 'dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|' + - 'dbase_replace_record|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|' + - 'dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|' + - 'dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|' + - 'dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|' + - 'dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|' + - 'dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|' + - 'dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debug_zval_dump|decbin|dechex|decoct|define|' + - 'define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|' + - 'dio_truncate|dio_write|dir|directoryiterator|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|' + - 'dns_get_mx|dns_get_record|dom_import_simplexml|domainexception|domattr|domattribute_name|domattribute_set_value|domattribute_specified|' + - 'domattribute_value|domcharacterdata|domcomment|domdocument|domdocument_add_root|domdocument_create_attribute|' + - 'domdocument_create_cdata_section|domdocument_create_comment|domdocument_create_element|domdocument_create_element_ns|' + - 'domdocument_create_entity_reference|domdocument_create_processing_instruction|domdocument_create_text_node|domdocument_doctype|' + - 'domdocument_document_element|domdocument_dump_file|domdocument_dump_mem|domdocument_get_element_by_id|domdocument_get_elements_by_tagname|' + - 'domdocument_html_dump_mem|domdocument_xinclude|domdocumentfragment|domdocumenttype|domdocumenttype_entities|' + - 'domdocumenttype_internal_subset|domdocumenttype_name|domdocumenttype_notations|domdocumenttype_public_id|domdocumenttype_system_id|' + - 'domelement|domelement_get_attribute|domelement_get_attribute_node|domelement_get_elements_by_tagname|domelement_has_attribute|' + - 'domelement_remove_attribute|domelement_set_attribute|domelement_set_attribute_node|domelement_tagname|domentity|domentityreference|' + - 'domexception|domimplementation|domnamednodemap|domnode|domnode_add_namespace|domnode_append_child|domnode_append_sibling|' + - 'domnode_attributes|domnode_child_nodes|domnode_clone_node|domnode_dump_node|domnode_first_child|domnode_get_content|' + - 'domnode_has_attributes|domnode_has_child_nodes|domnode_insert_before|domnode_is_blank_node|domnode_last_child|domnode_next_sibling|' + - 'domnode_node_name|domnode_node_type|domnode_node_value|domnode_owner_document|domnode_parent_node|domnode_prefix|domnode_previous_sibling|' + - 'domnode_remove_child|domnode_replace_child|domnode_replace_node|domnode_set_content|domnode_set_name|domnode_set_namespace|' + - 'domnode_unlink_node|domnodelist|domnotation|domprocessinginstruction|domprocessinginstruction_data|domprocessinginstruction_target|' + - 'domtext|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|' + - 'domxml_xslt_stylesheet_file|domxml_xslt_version|domxpath|domxsltstylesheet_process|domxsltstylesheet_result_dump_file|' + - 'domxsltstylesheet_result_dump_mem|dotnet|dotnet_load|doubleval|each|easter_date|easter_days|echo|empty|emptyiterator|' + - 'enchant_broker_describe|enchant_broker_dict_exists|enchant_broker_free|enchant_broker_free_dict|enchant_broker_get_error|' + - 'enchant_broker_init|enchant_broker_list_dicts|enchant_broker_request_dict|enchant_broker_request_pwl_dict|enchant_broker_set_ordering|' + - 'enchant_dict_add_to_personal|enchant_dict_add_to_session|enchant_dict_check|enchant_dict_describe|enchant_dict_get_error|' + - 'enchant_dict_is_in_session|enchant_dict_quick_check|enchant_dict_store_replacement|enchant_dict_suggest|end|ereg|ereg_replace|eregi|' + - 'eregi_replace|error_get_last|error_log|error_reporting|errorexception|escapeshellarg|escapeshellcmd|eval|event_add|event_base_free|' + - 'event_base_loop|event_base_loopbreak|event_base_loopexit|event_base_new|event_base_priority_init|event_base_set|event_buffer_base_set|' + - 'event_buffer_disable|event_buffer_enable|event_buffer_fd_set|event_buffer_free|event_buffer_new|event_buffer_priority_set|' + - 'event_buffer_read|event_buffer_set_callback|event_buffer_timeout_set|event_buffer_watermark_set|event_buffer_write|event_del|event_free|' + - 'event_new|event_set|exception|exec|exif_imagetype|exif_read_data|exif_tagname|exif_thumbnail|exit|exp|expect_expectl|expect_popen|explode|' + - 'expm1|export|export|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|' + - 'fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|' + - 'fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|' + - 'fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|' + - 'fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|' + - 'fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|' + - 'fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|' + - 'fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|' + - 'fbsql_rows_fetched|fbsql_select_db|fbsql_set_characterset|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|' + - 'fbsql_stop_db|fbsql_table_name|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|' + - 'fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|' + - 'fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|' + - 'fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_on_import_javascript|fdf_set_opt|' + - 'fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|' + - 'file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|' + - 'filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filesystemiterator|' + - 'filetype|filter_has_var|filter_id|filter_input|filter_input_array|filter_list|filter_var|filter_var_array|filteriterator|finfo_buffer|' + - 'finfo_close|finfo_file|finfo_open|finfo_set_flags|floatval|flock|floor|flush|fmod|fnmatch|fopen|forward_static_call|' + - 'forward_static_call_array|fpassthru|fprintf|fputcsv|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|' + - 'ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|' + - 'ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|' + - 'ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|' + - 'func_num_args|function_exists|fwrite|gc_collect_cycles|gc_disable|gc_enable|gc_enabled|gd_info|gearmanclient|gearmanjob|gearmantask|' + - 'gearmanworker|geoip_continent_code_by_name|geoip_country_code3_by_name|geoip_country_code_by_name|geoip_country_name_by_name|' + - 'geoip_database_info|geoip_db_avail|geoip_db_filename|geoip_db_get_all_info|geoip_id_by_name|geoip_isp_by_name|geoip_org_by_name|' + - 'geoip_record_by_name|geoip_region_by_name|geoip_region_name_by_code|geoip_time_zone_by_country_and_region|getMeta|getNamed|getValue|' + - 'get_browser|get_called_class|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|' + - 'get_declared_interfaces|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|' + - 'get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|' + - 'get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getconstant|getconstants|getconstructor|' + - 'getcwd|getdate|getdefaultproperties|getdoccomment|getendline|getenv|getextension|getextensionname|getfilename|gethostbyaddr|gethostbyname|' + - 'gethostbynamel|gethostname|getimagesize|getinterfacenames|getinterfaces|getlastmod|getmethod|getmethods|getmodifiers|getmxrr|getmygid|' + - 'getmyinode|getmypid|getmyuid|getname|getnamespacename|getopt|getparentclass|getproperties|getproperty|getprotobyname|getprotobynumber|' + - 'getrandmax|getrusage|getservbyname|getservbyport|getshortname|getstartline|getstaticproperties|getstaticpropertyvalue|gettext|' + - 'gettimeofday|gettype|glob|globiterator|gmagick|gmagickdraw|gmagickpixel|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|' + - 'gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|' + - 'gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_nextprime|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|' + - 'gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_testbit|gmp_xor|gmstrftime|' + - 'gnupg_adddecryptkey|gnupg_addencryptkey|gnupg_addsignkey|gnupg_cleardecryptkeys|gnupg_clearencryptkeys|gnupg_clearsignkeys|gnupg_decrypt|' + - 'gnupg_decryptverify|gnupg_encrypt|gnupg_encryptsign|gnupg_export|gnupg_geterror|gnupg_getprotocol|gnupg_import|gnupg_init|gnupg_keyinfo|' + - 'gnupg_setarmor|gnupg_seterrormode|gnupg_setsignmode|gnupg_sign|gnupg_verify|gopher_parsedir|grapheme_extract|grapheme_stripos|' + - 'grapheme_stristr|grapheme_strlen|grapheme_strpos|grapheme_strripos|grapheme_strrpos|grapheme_strstr|grapheme_substr|gregoriantojd|' + - 'gupnp_context_get_host_ip|gupnp_context_get_port|gupnp_context_get_subscription_timeout|gupnp_context_host_path|gupnp_context_new|' + - 'gupnp_context_set_subscription_timeout|gupnp_context_timeout_add|gupnp_context_unhost_path|gupnp_control_point_browse_start|' + - 'gupnp_control_point_browse_stop|gupnp_control_point_callback_set|gupnp_control_point_new|gupnp_device_action_callback_set|' + - 'gupnp_device_info_get|gupnp_device_info_get_service|gupnp_root_device_get_available|gupnp_root_device_get_relative_location|' + - 'gupnp_root_device_new|gupnp_root_device_set_available|gupnp_root_device_start|gupnp_root_device_stop|gupnp_service_action_get|' + - 'gupnp_service_action_return|gupnp_service_action_return_error|gupnp_service_action_set|gupnp_service_freeze_notify|gupnp_service_info_get|' + - 'gupnp_service_info_get_introspection|gupnp_service_introspection_get_state_variable|gupnp_service_notify|gupnp_service_proxy_action_get|' + - 'gupnp_service_proxy_action_set|gupnp_service_proxy_add_notify|gupnp_service_proxy_callback_set|gupnp_service_proxy_get_subscribed|' + - 'gupnp_service_proxy_remove_notify|gupnp_service_proxy_set_subscribed|gupnp_service_thaw_notify|gzclose|gzcompress|gzdecode|gzdeflate|' + - 'gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|' + - 'halt_compiler|haruannotation|haruannotation_setborderstyle|haruannotation_sethighlightmode|haruannotation_seticon|' + - 'haruannotation_setopened|harudestination|harudestination_setfit|harudestination_setfitb|harudestination_setfitbh|harudestination_setfitbv|' + - 'harudestination_setfith|harudestination_setfitr|harudestination_setfitv|harudestination_setxyz|harudoc|harudoc_addpage|' + - 'harudoc_addpagelabel|harudoc_construct|harudoc_createoutline|harudoc_getcurrentencoder|harudoc_getcurrentpage|harudoc_getencoder|' + - 'harudoc_getfont|harudoc_getinfoattr|harudoc_getpagelayout|harudoc_getpagemode|harudoc_getstreamsize|harudoc_insertpage|harudoc_loadjpeg|' + - 'harudoc_loadpng|harudoc_loadraw|harudoc_loadttc|harudoc_loadttf|harudoc_loadtype1|harudoc_output|harudoc_readfromstream|' + - 'harudoc_reseterror|harudoc_resetstream|harudoc_save|harudoc_savetostream|harudoc_setcompressionmode|harudoc_setcurrentencoder|' + - 'harudoc_setencryptionmode|harudoc_setinfoattr|harudoc_setinfodateattr|harudoc_setopenaction|harudoc_setpagelayout|harudoc_setpagemode|' + - 'harudoc_setpagesconfiguration|harudoc_setpassword|harudoc_setpermission|harudoc_usecnsencodings|harudoc_usecnsfonts|' + - 'harudoc_usecntencodings|harudoc_usecntfonts|harudoc_usejpencodings|harudoc_usejpfonts|harudoc_usekrencodings|harudoc_usekrfonts|' + - 'haruencoder|haruencoder_getbytetype|haruencoder_gettype|haruencoder_getunicode|haruencoder_getwritingmode|haruexception|harufont|' + - 'harufont_getascent|harufont_getcapheight|harufont_getdescent|harufont_getencodingname|harufont_getfontname|harufont_gettextwidth|' + - 'harufont_getunicodewidth|harufont_getxheight|harufont_measuretext|haruimage|haruimage_getbitspercomponent|haruimage_getcolorspace|' + - 'haruimage_getheight|haruimage_getsize|haruimage_getwidth|haruimage_setcolormask|haruimage_setmaskimage|haruoutline|' + - 'haruoutline_setdestination|haruoutline_setopened|harupage|harupage_arc|harupage_begintext|harupage_circle|harupage_closepath|' + - 'harupage_concat|harupage_createdestination|harupage_createlinkannotation|harupage_createtextannotation|harupage_createurlannotation|' + - 'harupage_curveto|harupage_curveto2|harupage_curveto3|harupage_drawimage|harupage_ellipse|harupage_endpath|harupage_endtext|' + - 'harupage_eofill|harupage_eofillstroke|harupage_fill|harupage_fillstroke|harupage_getcharspace|harupage_getcmykfill|harupage_getcmykstroke|' + - 'harupage_getcurrentfont|harupage_getcurrentfontsize|harupage_getcurrentpos|harupage_getcurrenttextpos|harupage_getdash|' + - 'harupage_getfillingcolorspace|harupage_getflatness|harupage_getgmode|harupage_getgrayfill|harupage_getgraystroke|harupage_getheight|' + - 'harupage_gethorizontalscaling|harupage_getlinecap|harupage_getlinejoin|harupage_getlinewidth|harupage_getmiterlimit|harupage_getrgbfill|' + - 'harupage_getrgbstroke|harupage_getstrokingcolorspace|harupage_gettextleading|harupage_gettextmatrix|harupage_gettextrenderingmode|' + - 'harupage_gettextrise|harupage_gettextwidth|harupage_gettransmatrix|harupage_getwidth|harupage_getwordspace|harupage_lineto|' + - 'harupage_measuretext|harupage_movetextpos|harupage_moveto|harupage_movetonextline|harupage_rectangle|harupage_setcharspace|' + - 'harupage_setcmykfill|harupage_setcmykstroke|harupage_setdash|harupage_setflatness|harupage_setfontandsize|harupage_setgrayfill|' + - 'harupage_setgraystroke|harupage_setheight|harupage_sethorizontalscaling|harupage_setlinecap|harupage_setlinejoin|harupage_setlinewidth|' + - 'harupage_setmiterlimit|harupage_setrgbfill|harupage_setrgbstroke|harupage_setrotate|harupage_setsize|harupage_setslideshow|' + - 'harupage_settextleading|harupage_settextmatrix|harupage_settextrenderingmode|harupage_settextrise|harupage_setwidth|harupage_setwordspace|' + - 'harupage_showtext|harupage_showtextnextline|harupage_stroke|harupage_textout|harupage_textrect|hasconstant|hash|hash_algos|hash_copy|' + - 'hash_file|hash_final|hash_hmac|hash_hmac_file|hash_init|hash_update|hash_update_file|hash_update_stream|hasmethod|hasproperty|header|' + - 'header_register_callback|header_remove|headers_list|headers_sent|hebrev|hebrevc|hex2bin|hexdec|highlight_file|highlight_string|' + - 'html_entity_decode|htmlentities|htmlspecialchars|htmlspecialchars_decode|http_build_cookie|http_build_query|http_build_str|http_build_url|' + - 'http_cache_etag|http_cache_last_modified|http_chunked_decode|http_date|http_deflate|http_get|http_get_request_body|' + - 'http_get_request_body_stream|http_get_request_headers|http_head|http_inflate|http_match_etag|http_match_modified|' + - 'http_match_request_header|http_negotiate_charset|http_negotiate_content_type|http_negotiate_language|http_parse_cookie|http_parse_headers|' + - 'http_parse_message|http_parse_params|http_persistent_handles_clean|http_persistent_handles_count|http_persistent_handles_ident|' + - 'http_post_data|http_post_fields|http_put_data|http_put_file|http_put_stream|http_redirect|http_request|http_request_body_encode|' + - 'http_request_method_exists|http_request_method_name|http_request_method_register|http_request_method_unregister|http_response_code|' + - 'http_send_content_disposition|http_send_content_type|http_send_data|http_send_file|http_send_last_modified|http_send_status|' + - 'http_send_stream|http_support|http_throttle|httpdeflatestream|httpdeflatestream_construct|httpdeflatestream_factory|' + - 'httpdeflatestream_finish|httpdeflatestream_flush|httpdeflatestream_update|httpinflatestream|httpinflatestream_construct|' + - 'httpinflatestream_factory|httpinflatestream_finish|httpinflatestream_flush|httpinflatestream_update|httpmessage|httpmessage_addheaders|' + - 'httpmessage_construct|httpmessage_detach|httpmessage_factory|httpmessage_fromenv|httpmessage_fromstring|httpmessage_getbody|' + - 'httpmessage_getheader|httpmessage_getheaders|httpmessage_gethttpversion|httpmessage_getparentmessage|httpmessage_getrequestmethod|' + - 'httpmessage_getrequesturl|httpmessage_getresponsecode|httpmessage_getresponsestatus|httpmessage_gettype|httpmessage_guesscontenttype|' + - 'httpmessage_prepend|httpmessage_reverse|httpmessage_send|httpmessage_setbody|httpmessage_setheaders|httpmessage_sethttpversion|' + - 'httpmessage_setrequestmethod|httpmessage_setrequesturl|httpmessage_setresponsecode|httpmessage_setresponsestatus|httpmessage_settype|' + - 'httpmessage_tomessagetypeobject|httpmessage_tostring|httpquerystring|httpquerystring_construct|httpquerystring_get|httpquerystring_mod|' + - 'httpquerystring_set|httpquerystring_singleton|httpquerystring_toarray|httpquerystring_tostring|httpquerystring_xlate|httprequest|' + - 'httprequest_addcookies|httprequest_addheaders|httprequest_addpostfields|httprequest_addpostfile|httprequest_addputdata|' + - 'httprequest_addquerydata|httprequest_addrawpostdata|httprequest_addssloptions|httprequest_clearhistory|httprequest_construct|' + - 'httprequest_enablecookies|httprequest_getcontenttype|httprequest_getcookies|httprequest_getheaders|httprequest_gethistory|' + - 'httprequest_getmethod|httprequest_getoptions|httprequest_getpostfields|httprequest_getpostfiles|httprequest_getputdata|' + - 'httprequest_getputfile|httprequest_getquerydata|httprequest_getrawpostdata|httprequest_getrawrequestmessage|' + - 'httprequest_getrawresponsemessage|httprequest_getrequestmessage|httprequest_getresponsebody|httprequest_getresponsecode|' + - 'httprequest_getresponsecookies|httprequest_getresponsedata|httprequest_getresponseheader|httprequest_getresponseinfo|' + - 'httprequest_getresponsemessage|httprequest_getresponsestatus|httprequest_getssloptions|httprequest_geturl|httprequest_resetcookies|' + - 'httprequest_send|httprequest_setcontenttype|httprequest_setcookies|httprequest_setheaders|httprequest_setmethod|httprequest_setoptions|' + - 'httprequest_setpostfields|httprequest_setpostfiles|httprequest_setputdata|httprequest_setputfile|httprequest_setquerydata|' + - 'httprequest_setrawpostdata|httprequest_setssloptions|httprequest_seturl|httprequestpool|httprequestpool_attach|httprequestpool_construct|' + - 'httprequestpool_destruct|httprequestpool_detach|httprequestpool_getattachedrequests|httprequestpool_getfinishedrequests|' + - 'httprequestpool_reset|httprequestpool_send|httprequestpool_socketperform|httprequestpool_socketselect|httpresponse|httpresponse_capture|' + - 'httpresponse_getbuffersize|httpresponse_getcache|httpresponse_getcachecontrol|httpresponse_getcontentdisposition|' + - 'httpresponse_getcontenttype|httpresponse_getdata|httpresponse_getetag|httpresponse_getfile|httpresponse_getgzip|httpresponse_getheader|' + - 'httpresponse_getlastmodified|httpresponse_getrequestbody|httpresponse_getrequestbodystream|httpresponse_getrequestheaders|' + - 'httpresponse_getstream|httpresponse_getthrottledelay|httpresponse_guesscontenttype|httpresponse_redirect|httpresponse_send|' + - 'httpresponse_setbuffersize|httpresponse_setcache|httpresponse_setcachecontrol|httpresponse_setcontentdisposition|' + - 'httpresponse_setcontenttype|httpresponse_setdata|httpresponse_setetag|httpresponse_setfile|httpresponse_setgzip|httpresponse_setheader|' + - 'httpresponse_setlastmodified|httpresponse_setstream|httpresponse_setthrottledelay|httpresponse_status|hw_array2objrec|hw_changeobject|' + - 'hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|' + - 'hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|' + - 'hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|' + - 'hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|' + - 'hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|' + - 'hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|' + - 'hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|' + - 'hwapi_attribute|hwapi_attribute_key|hwapi_attribute_langdepvalue|hwapi_attribute_value|hwapi_attribute_values|hwapi_checkin|' + - 'hwapi_checkout|hwapi_children|hwapi_content|hwapi_content_mimetype|hwapi_content_read|hwapi_copy|hwapi_dbstat|hwapi_dcstat|' + - 'hwapi_dstanchors|hwapi_dstofsrcanchor|hwapi_error_count|hwapi_error_reason|hwapi_find|hwapi_ftstat|hwapi_hgcsp|hwapi_hwstat|' + - 'hwapi_identify|hwapi_info|hwapi_insert|hwapi_insertanchor|hwapi_insertcollection|hwapi_insertdocument|hwapi_link|hwapi_lock|hwapi_move|' + - 'hwapi_new_content|hwapi_object|hwapi_object_assign|hwapi_object_attreditable|hwapi_object_count|hwapi_object_insert|hwapi_object_new|' + - 'hwapi_object_remove|hwapi_object_title|hwapi_object_value|hwapi_objectbyanchor|hwapi_parents|hwapi_reason_description|hwapi_reason_type|' + - 'hwapi_remove|hwapi_replace|hwapi_setcommittedversion|hwapi_srcanchors|hwapi_srcsofdst|hwapi_unlock|hwapi_user|hwapi_userlist|hypot|' + - 'ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|' + - 'ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|' + - 'ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|' + - 'ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|' + - 'ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|' + - 'ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|' + - 'ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|' + - 'iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|id3_get_frame_long_name|id3_get_frame_short_name|id3_get_genre_id|id3_get_genre_list|' + - 'id3_get_genre_name|id3_get_tag|id3_get_version|id3_remove_tag|id3_set_tag|id3v2attachedpictureframe|id3v2frame|id3v2tag|idate|' + - 'idn_to_ascii|idn_to_unicode|idn_to_utf8|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|' + - 'ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|' + - 'ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|' + - 'ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|' + - 'ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|iis_add_server|iis_get_dir_security|' + - 'iis_get_script_map|iis_get_server_by_comment|iis_get_server_by_path|iis_get_server_rights|iis_get_service_state|iis_remove_server|' + - 'iis_set_app_settings|iis_set_dir_security|iis_set_script_map|iis_set_server_rights|iis_start_server|iis_start_service|iis_stop_server|' + - 'iis_stop_service|image2wbmp|image_type_to_extension|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|' + - 'imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|' + - 'imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|' + - 'imagecolorsforindex|imagecolorstotal|imagecolortransparent|imageconvolution|imagecopy|imagecopymerge|imagecopymergegray|' + - 'imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|' + - 'imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|' + - 'imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|' + - 'imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|' + - 'imagegd2|imagegif|imagegrabscreen|imagegrabwindow|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|' + - 'imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|' + - 'imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|' + - 'imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imagick|' + - 'imagick_adaptiveblurimage|imagick_adaptiveresizeimage|imagick_adaptivesharpenimage|imagick_adaptivethresholdimage|imagick_addimage|' + - 'imagick_addnoiseimage|imagick_affinetransformimage|imagick_animateimages|imagick_annotateimage|imagick_appendimages|imagick_averageimages|' + - 'imagick_blackthresholdimage|imagick_blurimage|imagick_borderimage|imagick_charcoalimage|imagick_chopimage|imagick_clear|imagick_clipimage|' + - 'imagick_clippathimage|imagick_clone|imagick_clutimage|imagick_coalesceimages|imagick_colorfloodfillimage|imagick_colorizeimage|' + - 'imagick_combineimages|imagick_commentimage|imagick_compareimagechannels|imagick_compareimagelayers|imagick_compareimages|' + - 'imagick_compositeimage|imagick_construct|imagick_contrastimage|imagick_contraststretchimage|imagick_convolveimage|imagick_cropimage|' + - 'imagick_cropthumbnailimage|imagick_current|imagick_cyclecolormapimage|imagick_decipherimage|imagick_deconstructimages|' + - 'imagick_deleteimageartifact|imagick_despeckleimage|imagick_destroy|imagick_displayimage|imagick_displayimages|imagick_distortimage|' + - 'imagick_drawimage|imagick_edgeimage|imagick_embossimage|imagick_encipherimage|imagick_enhanceimage|imagick_equalizeimage|' + - 'imagick_evaluateimage|imagick_extentimage|imagick_flattenimages|imagick_flipimage|imagick_floodfillpaintimage|imagick_flopimage|' + - 'imagick_frameimage|imagick_fximage|imagick_gammaimage|imagick_gaussianblurimage|imagick_getcolorspace|imagick_getcompression|' + - 'imagick_getcompressionquality|imagick_getcopyright|imagick_getfilename|imagick_getfont|imagick_getformat|imagick_getgravity|' + - 'imagick_gethomeurl|imagick_getimage|imagick_getimagealphachannel|imagick_getimageartifact|imagick_getimagebackgroundcolor|' + - 'imagick_getimageblob|imagick_getimageblueprimary|imagick_getimagebordercolor|imagick_getimagechanneldepth|' + - 'imagick_getimagechanneldistortion|imagick_getimagechanneldistortions|imagick_getimagechannelextrema|imagick_getimagechannelmean|' + - 'imagick_getimagechannelrange|imagick_getimagechannelstatistics|imagick_getimageclipmask|imagick_getimagecolormapcolor|' + - 'imagick_getimagecolors|imagick_getimagecolorspace|imagick_getimagecompose|imagick_getimagecompression|imagick_getimagecompressionquality|' + - 'imagick_getimagedelay|imagick_getimagedepth|imagick_getimagedispose|imagick_getimagedistortion|imagick_getimageextrema|' + - 'imagick_getimagefilename|imagick_getimageformat|imagick_getimagegamma|imagick_getimagegeometry|imagick_getimagegravity|' + - 'imagick_getimagegreenprimary|imagick_getimageheight|imagick_getimagehistogram|imagick_getimageindex|imagick_getimageinterlacescheme|' + - 'imagick_getimageinterpolatemethod|imagick_getimageiterations|imagick_getimagelength|imagick_getimagemagicklicense|imagick_getimagematte|' + - 'imagick_getimagemattecolor|imagick_getimageorientation|imagick_getimagepage|imagick_getimagepixelcolor|imagick_getimageprofile|' + - 'imagick_getimageprofiles|imagick_getimageproperties|imagick_getimageproperty|imagick_getimageredprimary|imagick_getimageregion|' + - 'imagick_getimagerenderingintent|imagick_getimageresolution|imagick_getimagesblob|imagick_getimagescene|imagick_getimagesignature|' + - 'imagick_getimagesize|imagick_getimagetickspersecond|imagick_getimagetotalinkdensity|imagick_getimagetype|imagick_getimageunits|' + - 'imagick_getimagevirtualpixelmethod|imagick_getimagewhitepoint|imagick_getimagewidth|imagick_getinterlacescheme|imagick_getiteratorindex|' + - 'imagick_getnumberimages|imagick_getoption|imagick_getpackagename|imagick_getpage|imagick_getpixeliterator|imagick_getpixelregioniterator|' + - 'imagick_getpointsize|imagick_getquantumdepth|imagick_getquantumrange|imagick_getreleasedate|imagick_getresource|imagick_getresourcelimit|' + - 'imagick_getsamplingfactors|imagick_getsize|imagick_getsizeoffset|imagick_getversion|imagick_hasnextimage|imagick_haspreviousimage|' + - 'imagick_identifyimage|imagick_implodeimage|imagick_labelimage|imagick_levelimage|imagick_linearstretchimage|imagick_liquidrescaleimage|' + - 'imagick_magnifyimage|imagick_mapimage|imagick_mattefloodfillimage|imagick_medianfilterimage|imagick_mergeimagelayers|imagick_minifyimage|' + - 'imagick_modulateimage|imagick_montageimage|imagick_morphimages|imagick_mosaicimages|imagick_motionblurimage|imagick_negateimage|' + - 'imagick_newimage|imagick_newpseudoimage|imagick_nextimage|imagick_normalizeimage|imagick_oilpaintimage|imagick_opaquepaintimage|' + - 'imagick_optimizeimagelayers|imagick_orderedposterizeimage|imagick_paintfloodfillimage|imagick_paintopaqueimage|' + - 'imagick_painttransparentimage|imagick_pingimage|imagick_pingimageblob|imagick_pingimagefile|imagick_polaroidimage|imagick_posterizeimage|' + - 'imagick_previewimages|imagick_previousimage|imagick_profileimage|imagick_quantizeimage|imagick_quantizeimages|imagick_queryfontmetrics|' + - 'imagick_queryfonts|imagick_queryformats|imagick_radialblurimage|imagick_raiseimage|imagick_randomthresholdimage|imagick_readimage|' + - 'imagick_readimageblob|imagick_readimagefile|imagick_recolorimage|imagick_reducenoiseimage|imagick_removeimage|imagick_removeimageprofile|' + - 'imagick_render|imagick_resampleimage|imagick_resetimagepage|imagick_resizeimage|imagick_rollimage|imagick_rotateimage|' + - 'imagick_roundcorners|imagick_sampleimage|imagick_scaleimage|imagick_separateimagechannel|imagick_sepiatoneimage|' + - 'imagick_setbackgroundcolor|imagick_setcolorspace|imagick_setcompression|imagick_setcompressionquality|imagick_setfilename|' + - 'imagick_setfirstiterator|imagick_setfont|imagick_setformat|imagick_setgravity|imagick_setimage|imagick_setimagealphachannel|' + - 'imagick_setimageartifact|imagick_setimagebackgroundcolor|imagick_setimagebias|imagick_setimageblueprimary|imagick_setimagebordercolor|' + - 'imagick_setimagechanneldepth|imagick_setimageclipmask|imagick_setimagecolormapcolor|imagick_setimagecolorspace|imagick_setimagecompose|' + - 'imagick_setimagecompression|imagick_setimagecompressionquality|imagick_setimagedelay|imagick_setimagedepth|imagick_setimagedispose|' + - 'imagick_setimageextent|imagick_setimagefilename|imagick_setimageformat|imagick_setimagegamma|imagick_setimagegravity|' + - 'imagick_setimagegreenprimary|imagick_setimageindex|imagick_setimageinterlacescheme|imagick_setimageinterpolatemethod|' + - 'imagick_setimageiterations|imagick_setimagematte|imagick_setimagemattecolor|imagick_setimageopacity|imagick_setimageorientation|' + - 'imagick_setimagepage|imagick_setimageprofile|imagick_setimageproperty|imagick_setimageredprimary|imagick_setimagerenderingintent|' + - 'imagick_setimageresolution|imagick_setimagescene|imagick_setimagetickspersecond|imagick_setimagetype|imagick_setimageunits|' + - 'imagick_setimagevirtualpixelmethod|imagick_setimagewhitepoint|imagick_setinterlacescheme|imagick_setiteratorindex|imagick_setlastiterator|' + - 'imagick_setoption|imagick_setpage|imagick_setpointsize|imagick_setresolution|imagick_setresourcelimit|imagick_setsamplingfactors|' + - 'imagick_setsize|imagick_setsizeoffset|imagick_settype|imagick_shadeimage|imagick_shadowimage|imagick_sharpenimage|imagick_shaveimage|' + - 'imagick_shearimage|imagick_sigmoidalcontrastimage|imagick_sketchimage|imagick_solarizeimage|imagick_spliceimage|imagick_spreadimage|' + - 'imagick_steganoimage|imagick_stereoimage|imagick_stripimage|imagick_swirlimage|imagick_textureimage|imagick_thresholdimage|' + - 'imagick_thumbnailimage|imagick_tintimage|imagick_transformimage|imagick_transparentpaintimage|imagick_transposeimage|' + - 'imagick_transverseimage|imagick_trimimage|imagick_uniqueimagecolors|imagick_unsharpmaskimage|imagick_valid|imagick_vignetteimage|' + - 'imagick_waveimage|imagick_whitethresholdimage|imagick_writeimage|imagick_writeimagefile|imagick_writeimages|imagick_writeimagesfile|' + - 'imagickdraw|imagickdraw_affine|imagickdraw_annotation|imagickdraw_arc|imagickdraw_bezier|imagickdraw_circle|imagickdraw_clear|' + - 'imagickdraw_clone|imagickdraw_color|imagickdraw_comment|imagickdraw_composite|imagickdraw_construct|imagickdraw_destroy|' + - 'imagickdraw_ellipse|imagickdraw_getclippath|imagickdraw_getcliprule|imagickdraw_getclipunits|imagickdraw_getfillcolor|' + - 'imagickdraw_getfillopacity|imagickdraw_getfillrule|imagickdraw_getfont|imagickdraw_getfontfamily|imagickdraw_getfontsize|' + - 'imagickdraw_getfontstyle|imagickdraw_getfontweight|imagickdraw_getgravity|imagickdraw_getstrokeantialias|imagickdraw_getstrokecolor|' + - 'imagickdraw_getstrokedasharray|imagickdraw_getstrokedashoffset|imagickdraw_getstrokelinecap|imagickdraw_getstrokelinejoin|' + - 'imagickdraw_getstrokemiterlimit|imagickdraw_getstrokeopacity|imagickdraw_getstrokewidth|imagickdraw_gettextalignment|' + - 'imagickdraw_gettextantialias|imagickdraw_gettextdecoration|imagickdraw_gettextencoding|imagickdraw_gettextundercolor|' + - 'imagickdraw_getvectorgraphics|imagickdraw_line|imagickdraw_matte|imagickdraw_pathclose|imagickdraw_pathcurvetoabsolute|' + - 'imagickdraw_pathcurvetoquadraticbezierabsolute|imagickdraw_pathcurvetoquadraticbezierrelative|' + - 'imagickdraw_pathcurvetoquadraticbeziersmoothabsolute|imagickdraw_pathcurvetoquadraticbeziersmoothrelative|imagickdraw_pathcurvetorelative|' + - 'imagickdraw_pathcurvetosmoothabsolute|imagickdraw_pathcurvetosmoothrelative|imagickdraw_pathellipticarcabsolute|' + - 'imagickdraw_pathellipticarcrelative|imagickdraw_pathfinish|imagickdraw_pathlinetoabsolute|imagickdraw_pathlinetohorizontalabsolute|' + - 'imagickdraw_pathlinetohorizontalrelative|imagickdraw_pathlinetorelative|imagickdraw_pathlinetoverticalabsolute|' + - 'imagickdraw_pathlinetoverticalrelative|imagickdraw_pathmovetoabsolute|imagickdraw_pathmovetorelative|imagickdraw_pathstart|' + - 'imagickdraw_point|imagickdraw_polygon|imagickdraw_polyline|imagickdraw_pop|imagickdraw_popclippath|imagickdraw_popdefs|' + - 'imagickdraw_poppattern|imagickdraw_push|imagickdraw_pushclippath|imagickdraw_pushdefs|imagickdraw_pushpattern|imagickdraw_rectangle|' + - 'imagickdraw_render|imagickdraw_rotate|imagickdraw_roundrectangle|imagickdraw_scale|imagickdraw_setclippath|imagickdraw_setcliprule|' + - 'imagickdraw_setclipunits|imagickdraw_setfillalpha|imagickdraw_setfillcolor|imagickdraw_setfillopacity|imagickdraw_setfillpatternurl|' + - 'imagickdraw_setfillrule|imagickdraw_setfont|imagickdraw_setfontfamily|imagickdraw_setfontsize|imagickdraw_setfontstretch|' + - 'imagickdraw_setfontstyle|imagickdraw_setfontweight|imagickdraw_setgravity|imagickdraw_setstrokealpha|imagickdraw_setstrokeantialias|' + - 'imagickdraw_setstrokecolor|imagickdraw_setstrokedasharray|imagickdraw_setstrokedashoffset|imagickdraw_setstrokelinecap|' + - 'imagickdraw_setstrokelinejoin|imagickdraw_setstrokemiterlimit|imagickdraw_setstrokeopacity|imagickdraw_setstrokepatternurl|' + - 'imagickdraw_setstrokewidth|imagickdraw_settextalignment|imagickdraw_settextantialias|imagickdraw_settextdecoration|' + - 'imagickdraw_settextencoding|imagickdraw_settextundercolor|imagickdraw_setvectorgraphics|imagickdraw_setviewbox|imagickdraw_skewx|' + - 'imagickdraw_skewy|imagickdraw_translate|imagickpixel|imagickpixel_clear|imagickpixel_construct|imagickpixel_destroy|imagickpixel_getcolor|' + - 'imagickpixel_getcolorasstring|imagickpixel_getcolorcount|imagickpixel_getcolorvalue|imagickpixel_gethsl|imagickpixel_issimilar|' + - 'imagickpixel_setcolor|imagickpixel_setcolorvalue|imagickpixel_sethsl|imagickpixeliterator|imagickpixeliterator_clear|' + - 'imagickpixeliterator_construct|imagickpixeliterator_destroy|imagickpixeliterator_getcurrentiteratorrow|' + - 'imagickpixeliterator_getiteratorrow|imagickpixeliterator_getnextiteratorrow|imagickpixeliterator_getpreviousiteratorrow|' + - 'imagickpixeliterator_newpixeliterator|imagickpixeliterator_newpixelregioniterator|imagickpixeliterator_resetiterator|' + - 'imagickpixeliterator_setiteratorfirstrow|imagickpixeliterator_setiteratorlastrow|imagickpixeliterator_setiteratorrow|' + - 'imagickpixeliterator_synciterator|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|' + - 'imap_clearflag_full|imap_close|imap_create|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|' + - 'imap_fetchbody|imap_fetchheader|imap_fetchmime|imap_fetchstructure|imap_fetchtext|imap_gc|imap_get_quota|imap_get_quotaroot|imap_getacl|' + - 'imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|' + - 'imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|' + - 'imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_rename|imap_renamemailbox|imap_reopen|' + - 'imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_savebody|imap_scan|imap_scanmailbox|imap_search|' + - 'imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|' + - 'imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implementsinterface|implode|import_request_variables|in_array|include|' + - 'include_once|inclued_get_data|inet_ntop|inet_pton|infiniteiterator|ingres_autocommit|ingres_autocommit_state|ingres_charset|ingres_close|' + - 'ingres_commit|ingres_connect|ingres_cursor|ingres_errno|ingres_error|ingres_errsqlstate|ingres_escape_string|ingres_execute|' + - 'ingres_fetch_array|ingres_fetch_assoc|ingres_fetch_object|ingres_fetch_proc_return|ingres_fetch_row|ingres_field_length|ingres_field_name|' + - 'ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_free_result|ingres_next_error|ingres_num_fields|' + - 'ingres_num_rows|ingres_pconnect|ingres_prepare|ingres_query|ingres_result_seek|ingres_rollback|ingres_set_environment|' + - 'ingres_unbuffered_query|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|innamespace|inotify_add_watch|inotify_init|inotify_queue_len|' + - 'inotify_read|inotify_rm_watch|interface_exists|intl_error_name|intl_get_error_code|intl_get_error_message|intl_is_failure|' + - 'intldateformatter|intval|invalidargumentexception|invoke|invokeargs|ip2long|iptcembed|iptcparse|is_a|is_array|is_bool|is_callable|is_dir|' + - 'is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|' + - 'is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isabstract|' + - 'iscloneable|isdisabled|isfinal|isinstance|isinstantiable|isinterface|isinternal|isiterateable|isset|issubclassof|isuserdefined|iterator|' + - 'iterator_apply|iterator_count|iterator_to_array|iteratoraggregate|iteratoriterator|java_last_exception_clear|java_last_exception_get|' + - 'jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|json_decode|json_encode|' + - 'json_last_error|jsonserializable|judy|judy_type|judy_version|juliantojd|kadm5_chpass_principal|kadm5_create_principal|' + - 'kadm5_delete_principal|kadm5_destroy|kadm5_flush|kadm5_get_policies|kadm5_get_principal|kadm5_get_principals|kadm5_init_with_password|' + - 'kadm5_modify_principal|key|krsort|ksort|lcfirst|lcg_value|lchgrp|lchown|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|' + - 'ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|' + - 'ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|' + - 'ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|' + - 'ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_sasl_bind|ldap_search|ldap_set_option|' + - 'ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|lengthexception|levenshtein|libxml_clear_errors|' + - 'libxml_disable_entity_loader|libxml_get_errors|libxml_get_last_error|libxml_set_streams_context|libxml_use_internal_errors|libxmlerror|' + - 'limititerator|link|linkinfo|list|locale|localeconv|localtime|log|log10|log1p|logicexception|long2ip|lstat|ltrim|lzf_compress|' + - 'lzf_decompress|lzf_optimized_for|m_checkstatus|m_completeauthorizations|m_connect|m_connectionerror|m_deletetrans|m_destroyconn|' + - 'm_destroyengine|m_getcell|m_getcellbynum|m_getcommadelimited|m_getheader|m_initconn|m_initengine|m_iscommadelimited|m_maxconntimeout|' + - 'm_monitor|m_numcolumns|m_numrows|m_parsecommadelimited|m_responsekeys|m_responseparam|m_returnstatus|m_setblocking|m_setdropfile|m_setip|' + - 'm_setssl|m_setssl_cafile|m_setssl_files|m_settimeout|m_sslcert_gen_hash|m_transactionssent|m_transinqueue|m_transkeyval|m_transnew|' + - 'm_transsend|m_uwait|m_validateidentifier|m_verifyconnection|m_verifysslcert|magic_quotes_runtime|mail|' + - 'mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|' + - 'mailparse_msg_extract_whole_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|' + - 'mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|' + - 'maxdb_affected_rows|maxdb_autocommit|maxdb_bind_param|maxdb_bind_result|maxdb_change_user|maxdb_character_set_name|maxdb_client_encoding|' + - 'maxdb_close|maxdb_close_long_data|maxdb_commit|maxdb_connect|maxdb_connect_errno|maxdb_connect_error|maxdb_data_seek|maxdb_debug|' + - 'maxdb_disable_reads_from_master|maxdb_disable_rpl_parse|maxdb_dump_debug_info|maxdb_embedded_connect|maxdb_enable_reads_from_master|' + - 'maxdb_enable_rpl_parse|maxdb_errno|maxdb_error|maxdb_escape_string|maxdb_execute|maxdb_fetch|maxdb_fetch_array|maxdb_fetch_assoc|' + - 'maxdb_fetch_field|maxdb_fetch_field_direct|maxdb_fetch_fields|maxdb_fetch_lengths|maxdb_fetch_object|maxdb_fetch_row|maxdb_field_count|' + - 'maxdb_field_seek|maxdb_field_tell|maxdb_free_result|maxdb_get_client_info|maxdb_get_client_version|maxdb_get_host_info|maxdb_get_metadata|' + - 'maxdb_get_proto_info|maxdb_get_server_info|maxdb_get_server_version|maxdb_info|maxdb_init|maxdb_insert_id|maxdb_kill|maxdb_master_query|' + - 'maxdb_more_results|maxdb_multi_query|maxdb_next_result|maxdb_num_fields|maxdb_num_rows|maxdb_options|maxdb_param_count|maxdb_ping|' + - 'maxdb_prepare|maxdb_query|maxdb_real_connect|maxdb_real_escape_string|maxdb_real_query|maxdb_report|maxdb_rollback|' + - 'maxdb_rpl_parse_enabled|maxdb_rpl_probe|maxdb_rpl_query_type|maxdb_select_db|maxdb_send_long_data|maxdb_send_query|maxdb_server_end|' + - 'maxdb_server_init|maxdb_set_opt|maxdb_sqlstate|maxdb_ssl_set|maxdb_stat|maxdb_stmt_affected_rows|maxdb_stmt_bind_param|' + - 'maxdb_stmt_bind_result|maxdb_stmt_close|maxdb_stmt_close_long_data|maxdb_stmt_data_seek|maxdb_stmt_errno|maxdb_stmt_error|' + - 'maxdb_stmt_execute|maxdb_stmt_fetch|maxdb_stmt_free_result|maxdb_stmt_init|maxdb_stmt_num_rows|maxdb_stmt_param_count|maxdb_stmt_prepare|' + - 'maxdb_stmt_reset|maxdb_stmt_result_metadata|maxdb_stmt_send_long_data|maxdb_stmt_sqlstate|maxdb_stmt_store_result|maxdb_store_result|' + - 'maxdb_thread_id|maxdb_thread_safe|maxdb_use_result|maxdb_warning_count|mb_check_encoding|mb_convert_case|mb_convert_encoding|' + - 'mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|' + - 'mb_encode_numericentity|mb_encoding_aliases|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|' + - 'mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|' + - 'mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_list_encodings|mb_output_handler|mb_parse_str|' + - 'mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_stripos|mb_stristr|' + - 'mb_strlen|mb_strpos|mb_strrchr|mb_strrichr|mb_strripos|mb_strrpos|mb_strstr|mb_strtolower|mb_strtoupper|mb_strwidth|' + - 'mb_substitute_character|mb_substr|mb_substr_count|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|' + - 'mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|' + - 'mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|' + - 'mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|' + - 'mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|' + - 'mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|' + - 'mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|md5|md5_file|' + - 'mdecrypt_generic|memcache|memcache_debug|memcached|memory_get_peak_usage|memory_get_usage|messageformatter|metaphone|method_exists|mhash|' + - 'mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_keypress|' + - 'ming_setcubicthreshold|ming_setscale|ming_setswfcompression|ming_useconstants|ming_useswfversion|mkdir|mktime|money_format|mongo|' + - 'mongobindata|mongocode|mongocollection|mongoconnectionexception|mongocursor|mongocursorexception|mongocursortimeoutexception|mongodate|' + - 'mongodb|mongodbref|mongoexception|mongogridfs|mongogridfscursor|mongogridfsexception|mongogridfsfile|mongoid|mongoint32|mongoint64|' + - 'mongomaxkey|mongominkey|mongoregex|mongotimestamp|move_uploaded_file|mpegfile|mqseries_back|mqseries_begin|mqseries_close|mqseries_cmit|' + - 'mqseries_conn|mqseries_connx|mqseries_disc|mqseries_get|mqseries_inq|mqseries_open|mqseries_put|mqseries_put1|mqseries_set|' + - 'mqseries_strerror|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|' + - 'msession_get_array|msession_get_data|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|' + - 'msession_set|msession_set_array|msession_set_data|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_queue_exists|' + - 'msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|' + - 'msql_createdb|msql_data_seek|msql_db_query|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|' + - 'msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|' + - 'msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|' + - 'msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|' + - 'mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|' + - 'mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|' + - 'mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|' + - 'mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|' + - 'mssql_select_db|mt_getrandmax|mt_rand|mt_srand|multipleiterator|mysql_affected_rows|mysql_client_encoding|mysql_close|mysql_connect|' + - 'mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|' + - 'mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|' + - 'mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|' + - 'mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|' + - 'mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|' + - 'mysql_select_db|mysql_set_charset|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli|mysqli_bind_param|' + - 'mysqli_bind_result|mysqli_client_encoding|mysqli_connect|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_driver|' + - 'mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_get_metadata|' + - 'mysqli_master_query|mysqli_param_count|mysqli_report|mysqli_result|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|' + - 'mysqli_send_long_data|mysqli_send_query|mysqli_set_opt|mysqli_slave_query|mysqli_stmt|mysqli_warning|mysqlnd_ms_get_stats|' + - 'mysqlnd_ms_query_is_select|mysqlnd_ms_set_user_pick_server|mysqlnd_qc_change_handler|mysqlnd_qc_clear_cache|mysqlnd_qc_get_cache_info|' + - 'mysqlnd_qc_get_core_stats|mysqlnd_qc_get_handler|mysqlnd_qc_get_query_trace_log|mysqlnd_qc_set_user_handlers|natcasesort|natsort|' + - 'ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|' + - 'ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|' + - 'ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|' + - 'ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|' + - 'ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|' + - 'ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|' + - 'ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|' + - 'ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|' + - 'ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|' + - 'ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|' + - 'ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|' + - 'ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|' + - 'ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|' + - 'ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|' + - 'ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|' + - 'ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|' + - 'ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|' + - 'ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|' + - 'ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|' + - 'ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|' + - 'ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|' + - 'ncurses_wstandout|ncurses_wvline|newinstance|newinstanceargs|newt_bell|newt_button|newt_button_bar|newt_centered_window|newt_checkbox|' + - 'newt_checkbox_get_value|newt_checkbox_set_flags|newt_checkbox_set_value|newt_checkbox_tree|newt_checkbox_tree_add_item|' + - 'newt_checkbox_tree_find_item|newt_checkbox_tree_get_current|newt_checkbox_tree_get_entry_value|newt_checkbox_tree_get_multi_selection|' + - 'newt_checkbox_tree_get_selection|newt_checkbox_tree_multi|newt_checkbox_tree_set_current|newt_checkbox_tree_set_entry|' + - 'newt_checkbox_tree_set_entry_value|newt_checkbox_tree_set_width|newt_clear_key_buffer|newt_cls|newt_compact_button|' + - 'newt_component_add_callback|newt_component_takes_focus|newt_create_grid|newt_cursor_off|newt_cursor_on|newt_delay|newt_draw_form|' + - 'newt_draw_root_text|newt_entry|newt_entry_get_value|newt_entry_set|newt_entry_set_filter|newt_entry_set_flags|newt_finished|newt_form|' + - 'newt_form_add_component|newt_form_add_components|newt_form_add_hot_key|newt_form_destroy|newt_form_get_current|newt_form_run|' + - 'newt_form_set_background|newt_form_set_height|newt_form_set_size|newt_form_set_timer|newt_form_set_width|newt_form_watch_fd|' + - 'newt_get_screen_size|newt_grid_add_components_to_form|newt_grid_basic_window|newt_grid_free|newt_grid_get_size|newt_grid_h_close_stacked|' + - 'newt_grid_h_stacked|newt_grid_place|newt_grid_set_field|newt_grid_simple_window|newt_grid_v_close_stacked|newt_grid_v_stacked|' + - 'newt_grid_wrapped_window|newt_grid_wrapped_window_at|newt_init|newt_label|newt_label_set_text|newt_listbox|newt_listbox_append_entry|' + - 'newt_listbox_clear|newt_listbox_clear_selection|newt_listbox_delete_entry|newt_listbox_get_current|newt_listbox_get_selection|' + - 'newt_listbox_insert_entry|newt_listbox_item_count|newt_listbox_select_item|newt_listbox_set_current|newt_listbox_set_current_by_key|' + - 'newt_listbox_set_data|newt_listbox_set_entry|newt_listbox_set_width|newt_listitem|newt_listitem_get_data|newt_listitem_set|' + - 'newt_open_window|newt_pop_help_line|newt_pop_window|newt_push_help_line|newt_radio_get_current|newt_radiobutton|newt_redraw_help_line|' + - 'newt_reflow_text|newt_refresh|newt_resize_screen|newt_resume|newt_run_form|newt_scale|newt_scale_set|newt_scrollbar_set|' + - 'newt_set_help_callback|newt_set_suspend_callback|newt_suspend|newt_textbox|newt_textbox_get_num_lines|newt_textbox_reflowed|' + - 'newt_textbox_set_height|newt_textbox_set_text|newt_vertical_scrollbar|newt_wait_for_key|newt_win_choice|newt_win_entries|newt_win_menu|' + - 'newt_win_message|newt_win_messagev|newt_win_ternary|next|ngettext|nl2br|nl_langinfo|norewinditerator|normalizer|notes_body|notes_copy_db|' + - 'notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|' + - 'notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|nthmac|number_format|' + - 'numberformatter|oauth|oauth_get_sbs|oauth_urlencode|oauthexception|oauthprovider|ob_clean|ob_deflatehandler|ob_end_clean|ob_end_flush|' + - 'ob_etaghandler|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|' + - 'ob_implicit_flush|ob_inflatehandler|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_array_by_name|oci_bind_by_name|oci_cancel|' + - 'oci_client_version|oci_close|oci_collection_append|oci_collection_assign|oci_collection_element_assign|oci_collection_element_get|' + - 'oci_collection_free|oci_collection_max|oci_collection_size|oci_collection_trim|oci_commit|oci_connect|oci_define_by_name|oci_error|' + - 'oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|' + - 'oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_append|' + - 'oci_lob_close|oci_lob_copy|oci_lob_eof|oci_lob_erase|oci_lob_export|oci_lob_flush|oci_lob_free|oci_lob_getbuffering|oci_lob_import|' + - 'oci_lob_is_equal|oci_lob_load|oci_lob_read|oci_lob_rewind|oci_lob_save|oci_lob_savefile|oci_lob_seek|oci_lob_setbuffering|oci_lob_size|' + - 'oci_lob_tell|oci_lob_truncate|oci_lob_write|oci_lob_writetemporary|oci_lob_writetofile|oci_new_collection|oci_new_connect|oci_new_cursor|' + - 'oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|' + - 'oci_set_action|oci_set_client_identifier|oci_set_client_info|oci_set_edition|oci_set_module_name|oci_set_prefetch|oci_statement_type|' + - 'ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|' + - 'ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|' + - 'ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|' + - 'ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|' + - 'ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|' + - 'octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|' + - 'odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|' + - 'odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|' + - 'odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|' + - 'odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|' + - 'odbc_statistics|odbc_tableprivileges|odbc_tables|openal_buffer_create|openal_buffer_data|openal_buffer_destroy|openal_buffer_get|' + - 'openal_buffer_loadwav|openal_context_create|openal_context_current|openal_context_destroy|openal_context_process|openal_context_suspend|' + - 'openal_device_close|openal_device_open|openal_listener_get|openal_listener_set|openal_source_create|openal_source_destroy|' + - 'openal_source_get|openal_source_pause|openal_source_play|openal_source_rewind|openal_source_set|openal_source_stop|openal_stream|opendir|' + - 'openlog|openssl_cipher_iv_length|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_get_public_key|openssl_csr_get_subject|' + - 'openssl_csr_new|openssl_csr_sign|openssl_decrypt|openssl_dh_compute_key|openssl_digest|openssl_encrypt|openssl_error_string|' + - 'openssl_free_key|openssl_get_cipher_methods|openssl_get_md_methods|openssl_get_privatekey|openssl_get_publickey|openssl_open|' + - 'openssl_pkcs12_export|openssl_pkcs12_export_to_file|openssl_pkcs12_read|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|' + - 'openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_free|openssl_pkey_get_details|openssl_pkey_get_private|' + - 'openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|' + - 'openssl_random_pseudo_bytes|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|' + - 'openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ord|outeriterator|' + - 'outofboundsexception|outofrangeexception|output_add_rewrite_var|output_reset_rewrite_vars|overflowexception|overload|override_function|' + - 'ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|' + - 'ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|' + - 'ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parentiterator|parse_ini_file|parse_ini_string|' + - 'parse_str|parse_url|parsekit_compile_file|parsekit_compile_string|parsekit_func_arginfo|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|' + - 'pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_signal_dispatch|pcntl_sigprocmask|pcntl_sigtimedwait|pcntl_sigwaitinfo|' + - 'pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|' + - 'pdf_activate_item|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_nameddest|pdf_add_note|pdf_add_outline|' + - 'pdf_add_pdflink|pdf_add_table_cell|pdf_add_textflow|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_document|' + - 'pdf_begin_font|pdf_begin_glyph|pdf_begin_item|pdf_begin_layer|pdf_begin_page|pdf_begin_page_ext|pdf_begin_pattern|pdf_begin_template|' + - 'pdf_begin_template_ext|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|' + - 'pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_create_3dview|pdf_create_action|pdf_create_annotation|' + - 'pdf_create_bookmark|pdf_create_field|pdf_create_fieldgroup|pdf_create_gstate|pdf_create_pvf|pdf_create_textflow|pdf_curveto|' + - 'pdf_define_layer|pdf_delete|pdf_delete_pvf|pdf_delete_table|pdf_delete_textflow|pdf_encoding_set_char|pdf_end_document|pdf_end_font|' + - 'pdf_end_glyph|pdf_end_item|pdf_end_layer|pdf_end_page|pdf_end_page_ext|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|' + - 'pdf_fill_imageblock|pdf_fill_pdfblock|pdf_fill_stroke|pdf_fill_textblock|pdf_findfont|pdf_fit_image|pdf_fit_pdi_page|pdf_fit_table|' + - 'pdf_fit_textflow|pdf_fit_textline|pdf_get_apiname|pdf_get_buffer|pdf_get_errmsg|pdf_get_errnum|pdf_get_font|pdf_get_fontname|' + - 'pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|' + - 'pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_info_font|pdf_info_matchbox|pdf_info_table|pdf_info_textflow|pdf_info_textline|' + - 'pdf_initgraphics|pdf_lineto|pdf_load_3ddata|pdf_load_font|pdf_load_iccprofile|pdf_load_image|pdf_makespotcolor|pdf_moveto|pdf_new|' + - 'pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|' + - 'pdf_open_pdi_document|pdf_open_pdi_page|pdf_open_tiff|pdf_pcos_get_number|pdf_pcos_get_stream|pdf_pcos_get_string|pdf_place_image|' + - 'pdf_place_pdi_page|pdf_process_pdi|pdf_rect|pdf_restore|pdf_resume_page|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|' + - 'pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_gstate|pdf_set_horiz_scaling|pdf_set_info|' + - 'pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_layer_dependency|' + - 'pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|' + - 'pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setdashpattern|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|' + - 'pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|' + - 'pdf_setrgbcolor_stroke|pdf_shading|pdf_shading_pattern|pdf_shfill|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|' + - 'pdf_suspend_page|pdf_translate|pdf_utf16_to_utf8|pdf_utf32_to_utf16|pdf_utf8_to_utf16|pdo|pdo_cubrid_schema|pdo_pgsqllobcreate|' + - 'pdo_pgsqllobopen|pdo_pgsqllobunlink|pdo_sqlitecreateaggregate|pdo_sqlitecreatefunction|pdoexception|pdostatement|pfsockopen|' + - 'pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|' + - 'pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_execute|pg_fetch_all|' + - 'pg_fetch_all_columns|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|' + - 'pg_field_num|pg_field_prtlen|pg_field_size|pg_field_table|pg_field_type|pg_field_type_oid|pg_free_result|pg_get_notify|pg_get_pid|' + - 'pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|' + - 'pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|' + - 'pg_parameter_status|pg_pconnect|pg_ping|pg_port|pg_prepare|pg_put_line|pg_query|pg_query_params|pg_result_error|pg_result_error_field|' + - 'pg_result_seek|pg_result_status|pg_select|pg_send_execute|pg_send_prepare|pg_send_query|pg_send_query_params|pg_set_client_encoding|' + - 'pg_set_error_verbosity|pg_trace|pg_transaction_status|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|pg_version|php_check_syntax|' + - 'php_ini_loaded_file|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_strip_whitespace|php_uname|phpcredits|phpinfo|phpversion|pi|' + - 'png2wbmp|popen|pos|posix_access|posix_ctermid|posix_errno|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|' + - 'posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|' + - 'posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_initgroups|posix_isatty|posix_kill|posix_mkfifo|posix_mknod|posix_setegid|' + - 'posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_filter|' + - 'preg_grep|preg_last_error|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|' + - 'printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|' + - 'printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|' + - 'printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|' + - 'printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|' + - 'printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|property_exists|' + - 'ps_add_bookmark|ps_add_launchlink|ps_add_locallink|ps_add_note|ps_add_pdflink|ps_add_weblink|ps_arc|ps_arcn|ps_begin_page|' + - 'ps_begin_pattern|ps_begin_template|ps_circle|ps_clip|ps_close|ps_close_image|ps_closepath|ps_closepath_stroke|ps_continue_text|ps_curveto|' + - 'ps_delete|ps_end_page|ps_end_pattern|ps_end_template|ps_fill|ps_fill_stroke|ps_findfont|ps_get_buffer|ps_get_parameter|ps_get_value|' + - 'ps_hyphenate|ps_include_file|ps_lineto|ps_makespotcolor|ps_moveto|ps_new|ps_open_file|ps_open_image|ps_open_image_file|' + - 'ps_open_memory_image|ps_place_image|ps_rect|ps_restore|ps_rotate|ps_save|ps_scale|ps_set_border_color|ps_set_border_dash|' + - 'ps_set_border_style|ps_set_info|ps_set_parameter|ps_set_text_pos|ps_set_value|ps_setcolor|ps_setdash|ps_setflat|ps_setfont|ps_setgray|' + - 'ps_setlinecap|ps_setlinejoin|ps_setlinewidth|ps_setmiterlimit|ps_setoverprintmode|ps_setpolydash|ps_shading|ps_shading_pattern|ps_shfill|' + - 'ps_show|ps_show2|ps_show_boxed|ps_show_xy|ps_show_xy2|ps_string_geometry|ps_stringwidth|ps_stroke|ps_symbol|ps_symbol_name|' + - 'ps_symbol_width|ps_translate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|' + - 'pspell_config_data_dir|pspell_config_dict_dir|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|' + - 'pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|' + - 'pspell_store_replacement|pspell_suggest|putenv|px_close|px_create_fp|px_date2string|px_delete|px_delete_record|px_get_field|px_get_info|' + - 'px_get_parameter|px_get_record|px_get_schema|px_get_value|px_insert_record|px_new|px_numfields|px_numrecords|px_open_fp|px_put_record|' + - 'px_retrieve_record|px_set_blob_file|px_set_parameter|px_set_tablename|px_set_targetencoding|px_set_value|px_timestamp2string|' + - 'px_update_record|qdom_error|qdom_tree|quoted_printable_decode|quoted_printable_encode|quotemeta|rad2deg|radius_acct_open|' + - 'radius_add_server|radius_auth_open|radius_close|radius_config|radius_create_request|radius_cvt_addr|radius_cvt_int|radius_cvt_string|' + - 'radius_demangle|radius_demangle_mppe_key|radius_get_attr|radius_get_vendor_attr|radius_put_addr|radius_put_attr|radius_put_int|' + - 'radius_put_string|radius_put_vendor_addr|radius_put_vendor_attr|radius_put_vendor_int|radius_put_vendor_string|' + - 'radius_request_authenticator|radius_send_request|radius_server_secret|radius_strerror|rand|range|rangeexception|rar_wrapper_cache_stats|' + - 'rararchive|rarentry|rarexception|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|' + - 'readline_callback_handler_install|readline_callback_handler_remove|readline_callback_read_char|readline_clear_history|' + - 'readline_completion_function|readline_info|readline_list_history|readline_on_new_line|readline_read_history|readline_redisplay|' + - 'readline_write_history|readlink|realpath|realpath_cache_get|realpath_cache_size|recode|recode_file|recode_string|recursivearrayiterator|' + - 'recursivecachingiterator|recursivecallbackfilteriterator|recursivedirectoryiterator|recursivefilteriterator|recursiveiterator|' + - 'recursiveiteratoriterator|recursiveregexiterator|recursivetreeiterator|reflection|reflectionclass|reflectionexception|reflectionextension|' + - 'reflectionfunction|reflectionfunctionabstract|reflectionmethod|reflectionobject|reflectionparameter|reflectionproperty|reflector|' + - 'regexiterator|register_shutdown_function|register_tick_function|rename|rename_function|require|require_once|reset|resetValue|' + - 'resourcebundle|restore_error_handler|restore_exception_handler|restore_include_path|return|rewind|rewinddir|rmdir|round|rpm_close|' + - 'rpm_get_tag|rpm_is_valid|rpm_open|rpm_version|rrd_create|rrd_error|rrd_fetch|rrd_first|rrd_graph|rrd_info|rrd_last|rrd_lastupdate|' + - 'rrd_restore|rrd_tune|rrd_update|rrd_xport|rrdcreator|rrdgraph|rrdupdater|rsort|rtrim|runkit_class_adopt|runkit_class_emancipate|' + - 'runkit_constant_add|runkit_constant_redefine|runkit_constant_remove|runkit_function_add|runkit_function_copy|runkit_function_redefine|' + - 'runkit_function_remove|runkit_function_rename|runkit_import|runkit_lint|runkit_lint_file|runkit_method_add|runkit_method_copy|' + - 'runkit_method_redefine|runkit_method_remove|runkit_method_rename|runkit_return_value_used|runkit_sandbox_output_handler|' + - 'runkit_superglobals|runtimeexception|samconnection_commit|samconnection_connect|samconnection_constructor|samconnection_disconnect|' + - 'samconnection_errno|samconnection_error|samconnection_isconnected|samconnection_peek|samconnection_peekall|samconnection_receive|' + - 'samconnection_remove|samconnection_rollback|samconnection_send|samconnection_setDebug|samconnection_subscribe|samconnection_unsubscribe|' + - 'sammessage_body|sammessage_constructor|sammessage_header|sca_createdataobject|sca_getservice|sca_localproxy_createdataobject|' + - 'sca_soapproxy_createdataobject|scandir|sdo_das_changesummary_beginlogging|sdo_das_changesummary_endlogging|' + - 'sdo_das_changesummary_getchangeddataobjects|sdo_das_changesummary_getchangetype|sdo_das_changesummary_getoldcontainer|' + - 'sdo_das_changesummary_getoldvalues|sdo_das_changesummary_islogging|sdo_das_datafactory_addpropertytotype|sdo_das_datafactory_addtype|' + - 'sdo_das_datafactory_getdatafactory|sdo_das_dataobject_getchangesummary|sdo_das_relational_applychanges|sdo_das_relational_construct|' + - 'sdo_das_relational_createrootdataobject|sdo_das_relational_executepreparedquery|sdo_das_relational_executequery|' + - 'sdo_das_setting_getlistindex|sdo_das_setting_getpropertyindex|sdo_das_setting_getpropertyname|sdo_das_setting_getvalue|' + - 'sdo_das_setting_isset|sdo_das_xml_addtypes|sdo_das_xml_create|sdo_das_xml_createdataobject|sdo_das_xml_createdocument|' + - 'sdo_das_xml_document_getrootdataobject|sdo_das_xml_document_getrootelementname|sdo_das_xml_document_getrootelementuri|' + - 'sdo_das_xml_document_setencoding|sdo_das_xml_document_setxmldeclaration|sdo_das_xml_document_setxmlversion|sdo_das_xml_loadfile|' + - 'sdo_das_xml_loadstring|sdo_das_xml_savefile|sdo_das_xml_savestring|sdo_datafactory_create|sdo_dataobject_clear|' + - 'sdo_dataobject_createdataobject|sdo_dataobject_getcontainer|sdo_dataobject_getsequence|sdo_dataobject_gettypename|' + - 'sdo_dataobject_gettypenamespaceuri|sdo_exception_getcause|sdo_list_insert|sdo_model_property_getcontainingtype|' + - 'sdo_model_property_getdefault|sdo_model_property_getname|sdo_model_property_gettype|sdo_model_property_iscontainment|' + - 'sdo_model_property_ismany|sdo_model_reflectiondataobject_construct|sdo_model_reflectiondataobject_export|' + - 'sdo_model_reflectiondataobject_getcontainmentproperty|sdo_model_reflectiondataobject_getinstanceproperties|' + - 'sdo_model_reflectiondataobject_gettype|sdo_model_type_getbasetype|sdo_model_type_getname|sdo_model_type_getnamespaceuri|' + - 'sdo_model_type_getproperties|sdo_model_type_getproperty|sdo_model_type_isabstracttype|sdo_model_type_isdatatype|sdo_model_type_isinstance|' + - 'sdo_model_type_isopentype|sdo_model_type_issequencedtype|sdo_sequence_getproperty|sdo_sequence_insert|sdo_sequence_move|seekableiterator|' + - 'sem_acquire|sem_get|sem_release|sem_remove|serializable|serialize|session_cache_expire|session_cache_limiter|session_commit|' + - 'session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|' + - 'session_pgsql_add_error|session_pgsql_get_error|session_pgsql_get_field|session_pgsql_reset|session_pgsql_set_field|session_pgsql_status|' + - 'session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|' + - 'session_unregister|session_unset|session_write_close|setCounterClass|set_error_handler|set_exception_handler|set_file_buffer|' + - 'set_include_path|set_magic_quotes_runtime|set_socket_blocking|set_time_limit|setcookie|setlocale|setproctitle|setrawcookie|' + - 'setstaticpropertyvalue|setthreadtitle|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_has_var|shm_put_var|' + - 'shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|signeurlpaiement|' + - 'similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|simplexmlelement|simplexmliterator|sin|sinh|sizeof|sleep|snmp|' + - 'snmp2_get|snmp2_getnext|snmp2_real_walk|snmp2_set|snmp2_walk|snmp3_get|snmp3_getnext|snmp3_real_walk|snmp3_set|snmp3_walk|' + - 'snmp_get_quick_print|snmp_get_valueretrieval|snmp_read_mib|snmp_set_enum_print|snmp_set_oid_numeric_print|snmp_set_oid_output_format|' + - 'snmp_set_quick_print|snmp_set_valueretrieval|snmpget|snmpgetnext|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|soapclient|soapfault|' + - 'soapheader|soapparam|soapserver|soapvar|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|' + - 'socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_last_error|' + - 'socket_listen|socket_read|socket_recv|socket_recvfrom|socket_select|socket_send|socket_sendto|socket_set_block|socket_set_blocking|' + - 'socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|solr_get_version|solrclient|' + - 'solrclientexception|solrdocument|solrdocumentfield|solrexception|solrgenericresponse|solrillegalargumentexception|' + - 'solrillegaloperationexception|solrinputdocument|solrmodifiableparams|solrobject|solrparams|solrpingresponse|solrquery|solrqueryresponse|' + - 'solrresponse|solrupdateresponse|solrutils|sort|soundex|sphinxclient|spl_autoload|spl_autoload_call|spl_autoload_extensions|' + - 'spl_autoload_functions|spl_autoload_register|spl_autoload_unregister|spl_classes|spl_object_hash|splbool|spldoublylinkedlist|splenum|' + - 'splfileinfo|splfileobject|splfixedarray|splfloat|splheap|splint|split|spliti|splmaxheap|splminheap|splobjectstorage|splobserver|' + - 'splpriorityqueue|splqueue|splstack|splstring|splsubject|spltempfileobject|spoofchecker|sprintf|sql_regcase|sqlite3|sqlite3result|' + - 'sqlite3stmt|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|' + - 'sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_exec|sqlite_factory|sqlite_fetch_all|' + - 'sqlite_fetch_array|sqlite_fetch_column_types|sqlite_fetch_object|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|' + - 'sqlite_has_more|sqlite_has_prev|sqlite_key|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|' + - 'sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_prev|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_single_query|' + - 'sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqlite_valid|sqrt|srand|sscanf|ssdeep_fuzzy_compare|' + - 'ssdeep_fuzzy_hash|ssdeep_fuzzy_hash_filename|ssh2_auth_hostbased_file|ssh2_auth_none|ssh2_auth_password|ssh2_auth_pubkey_file|' + - 'ssh2_connect|ssh2_exec|ssh2_fetch_stream|ssh2_fingerprint|ssh2_methods_negotiated|ssh2_publickey_add|ssh2_publickey_init|' + - 'ssh2_publickey_list|ssh2_publickey_remove|ssh2_scp_recv|ssh2_scp_send|ssh2_sftp|ssh2_sftp_lstat|ssh2_sftp_mkdir|ssh2_sftp_readlink|' + - 'ssh2_sftp_realpath|ssh2_sftp_rename|ssh2_sftp_rmdir|ssh2_sftp_stat|ssh2_sftp_symlink|ssh2_sftp_unlink|ssh2_shell|ssh2_tunnel|stat|' + - 'stats_absolute_deviation|stats_cdf_beta|stats_cdf_binomial|stats_cdf_cauchy|stats_cdf_chisquare|stats_cdf_exponential|stats_cdf_f|' + - 'stats_cdf_gamma|stats_cdf_laplace|stats_cdf_logistic|stats_cdf_negative_binomial|stats_cdf_noncentral_chisquare|stats_cdf_noncentral_f|' + - 'stats_cdf_poisson|stats_cdf_t|stats_cdf_uniform|stats_cdf_weibull|stats_covariance|stats_den_uniform|stats_dens_beta|stats_dens_cauchy|' + - 'stats_dens_chisquare|stats_dens_exponential|stats_dens_f|stats_dens_gamma|stats_dens_laplace|stats_dens_logistic|' + - 'stats_dens_negative_binomial|stats_dens_normal|stats_dens_pmf_binomial|stats_dens_pmf_hypergeometric|stats_dens_pmf_poisson|stats_dens_t|' + - 'stats_dens_weibull|stats_harmonic_mean|stats_kurtosis|stats_rand_gen_beta|stats_rand_gen_chisquare|stats_rand_gen_exponential|' + - 'stats_rand_gen_f|stats_rand_gen_funiform|stats_rand_gen_gamma|stats_rand_gen_ibinomial|stats_rand_gen_ibinomial_negative|' + - 'stats_rand_gen_int|stats_rand_gen_ipoisson|stats_rand_gen_iuniform|stats_rand_gen_noncenral_chisquare|stats_rand_gen_noncentral_f|' + - 'stats_rand_gen_noncentral_t|stats_rand_gen_normal|stats_rand_gen_t|stats_rand_get_seeds|stats_rand_phrase_to_seeds|stats_rand_ranf|' + - 'stats_rand_setall|stats_skew|stats_standard_deviation|stats_stat_binomial_coef|stats_stat_correlation|stats_stat_gennch|' + - 'stats_stat_independent_t|stats_stat_innerproduct|stats_stat_noncentral_t|stats_stat_paired_t|stats_stat_percentile|stats_stat_powersum|' + - 'stats_variance|stomp|stomp_connect_error|stomp_version|stompexception|stompframe|str_getcsv|str_ireplace|str_pad|str_repeat|str_replace|' + - 'str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_bucket_append|stream_bucket_make_writeable|' + - 'stream_bucket_new|stream_bucket_prepend|stream_context_create|stream_context_get_default|stream_context_get_options|' + - 'stream_context_get_params|stream_context_set_default|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|' + - 'stream_encoding|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_filter_remove|stream_get_contents|' + - 'stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_is_local|' + - 'stream_notification_callback|stream_register_wrapper|stream_resolve_include_path|stream_select|stream_set_blocking|stream_set_read_buffer|' + - 'stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_enable_crypto|stream_socket_get_name|' + - 'stream_socket_pair|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_socket_shutdown|stream_supports_lock|' + - 'stream_wrapper_register|stream_wrapper_restore|stream_wrapper_unregister|streamwrapper|strftime|strip_tags|stripcslashes|stripos|' + - 'stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpbrk|strpos|strptime|strrchr|strrev|strripos|strrpos|strspn|' + - 'strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|svm|svmmodel|svn_add|' + - 'svn_auth_get_parameter|svn_auth_set_parameter|svn_blame|svn_cat|svn_checkout|svn_cleanup|svn_client_version|svn_commit|svn_delete|' + - 'svn_diff|svn_export|svn_fs_abort_txn|svn_fs_apply_text|svn_fs_begin_txn2|svn_fs_change_node_prop|svn_fs_check_path|' + - 'svn_fs_contents_changed|svn_fs_copy|svn_fs_delete|svn_fs_dir_entries|svn_fs_file_contents|svn_fs_file_length|svn_fs_is_dir|svn_fs_is_file|' + - 'svn_fs_make_dir|svn_fs_make_file|svn_fs_node_created_rev|svn_fs_node_prop|svn_fs_props_changed|svn_fs_revision_prop|svn_fs_revision_root|' + - 'svn_fs_txn_root|svn_fs_youngest_rev|svn_import|svn_log|svn_ls|svn_mkdir|svn_repos_create|svn_repos_fs|svn_repos_fs_begin_txn_for_commit|' + - 'svn_repos_fs_commit_txn|svn_repos_hotcopy|svn_repos_open|svn_repos_recover|svn_revert|svn_status|svn_update|swf_actiongeturl|' + - 'swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|' + - 'swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|' + - 'swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|' + - 'swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|' + - 'swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|' + - 'swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|' + - 'swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|' + - 'swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|' + - 'swfbitmap|swfbutton|swfdisplayitem|swffill|swffont|swffontchar|swfgradient|swfmorph|swfmovie|swfprebuiltclip|swfshape|swfsound|' + - 'swfsoundinstance|swfsprite|swftext|swftextfield|swfvideostream|swish_construct|swish_getmetalist|swish_getpropertylist|swish_prepare|' + - 'swish_query|swishresult_getmetalist|swishresult_stem|swishresults_getparsedwords|swishresults_getremovedstopwords|swishresults_nextresult|' + - 'swishresults_seekresult|swishsearch_execute|swishsearch_resetlimit|swishsearch_setlimit|swishsearch_setphrasedelimiter|' + - 'swishsearch_setsort|swishsearch_setstructure|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|' + - 'sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|' + - 'sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|' + - 'sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|' + - 'sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|sys_get_temp_dir|sys_getloadavg|syslog|system|tag|tan|tanh|' + - 'tcpwrap_check|tempnam|textdomain|tidy|tidy_access_count|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_error_buffer|' + - 'tidy_get_output|tidy_load_config|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|tidynode|time|' + - 'time_nanosleep|time_sleep_until|timezone_abbreviations_list|timezone_identifiers_list|timezone_location_get|timezone_name_from_abbr|' + - 'timezone_name_get|timezone_offset_get|timezone_open|timezone_transitions_get|timezone_version_get|tmpfile|token_get_all|token_name|' + - 'tokyotyrant|tokyotyrantquery|tokyotyranttable|tostring|tostring|touch|transliterator|traversable|trigger_error|trim|uasort|ucfirst|' + - 'ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|' + - 'udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|' + - 'udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|' + - 'uksort|umask|underflowexception|unexpectedvalueexception|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|' + - 'urldecode|urlencode|use_soap_error_handler|user_error|usleep|usort|utf8_decode|utf8_encode|v8js|v8jsexception|var_dump|var_export|variant|' + - 'variant_abs|variant_add|variant_and|variant_cast|variant_cat|variant_cmp|variant_date_from_timestamp|variant_date_to_timestamp|' + - 'variant_div|variant_eqv|variant_fix|variant_get_type|variant_idiv|variant_imp|variant_int|variant_mod|variant_mul|variant_neg|variant_not|' + - 'variant_or|variant_pow|variant_round|variant_set|variant_set_type|variant_sub|variant_xor|version_compare|vfprintf|virtual|' + - 'vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|' + - 'vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|' + - 'vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|' + - 'w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|' + - 'wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|win32_continue_service|win32_create_service|win32_delete_service|' + - 'win32_get_last_control_message|win32_pause_service|win32_ps_list_procs|win32_ps_stat_mem|win32_ps_stat_proc|win32_query_service_status|' + - 'win32_set_service_status|win32_start_service|win32_start_service_ctrl_dispatcher|win32_stop_service|wincache_fcache_fileinfo|' + - 'wincache_fcache_meminfo|wincache_lock|wincache_ocache_fileinfo|wincache_ocache_meminfo|wincache_refresh_if_changed|' + - 'wincache_rplist_fileinfo|wincache_rplist_meminfo|wincache_scache_info|wincache_scache_meminfo|wincache_ucache_add|wincache_ucache_cas|' + - 'wincache_ucache_clear|wincache_ucache_dec|wincache_ucache_delete|wincache_ucache_exists|wincache_ucache_get|wincache_ucache_inc|' + - 'wincache_ucache_info|wincache_ucache_meminfo|wincache_ucache_set|wincache_unlock|wordwrap|xattr_get|xattr_list|xattr_remove|xattr_set|' + - 'xattr_supported|xdiff_file_bdiff|xdiff_file_bdiff_size|xdiff_file_bpatch|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|' + - 'xdiff_file_patch|xdiff_file_patch_binary|xdiff_file_rabdiff|xdiff_string_bdiff|xdiff_string_bdiff_size|xdiff_string_bpatch|' + - 'xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xdiff_string_rabdiff|' + - 'xhprof_disable|xhprof_enable|xhprof_sample_disable|xhprof_sample_enable|xml_error_string|xml_get_current_byte_index|' + - 'xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|' + - 'xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|' + - 'xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|' + - 'xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlreader|' + - 'xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_is_fault|xmlrpc_parse_method_descriptions|' + - 'xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|' + - 'xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xmlwriter_end_attribute|xmlwriter_end_cdata|' + - 'xmlwriter_end_comment|xmlwriter_end_document|xmlwriter_end_dtd|xmlwriter_end_dtd_attlist|xmlwriter_end_dtd_element|' + - 'xmlwriter_end_dtd_entity|xmlwriter_end_element|xmlwriter_end_pi|xmlwriter_flush|xmlwriter_full_end_element|xmlwriter_open_memory|' + - 'xmlwriter_open_uri|xmlwriter_output_memory|xmlwriter_set_indent|xmlwriter_set_indent_string|xmlwriter_start_attribute|' + - 'xmlwriter_start_attribute_ns|xmlwriter_start_cdata|xmlwriter_start_comment|xmlwriter_start_document|xmlwriter_start_dtd|' + - 'xmlwriter_start_dtd_attlist|xmlwriter_start_dtd_element|xmlwriter_start_dtd_entity|xmlwriter_start_element|xmlwriter_start_element_ns|' + - 'xmlwriter_start_pi|xmlwriter_text|xmlwriter_write_attribute|xmlwriter_write_attribute_ns|xmlwriter_write_cdata|xmlwriter_write_comment|' + - 'xmlwriter_write_dtd|xmlwriter_write_dtd_attlist|xmlwriter_write_dtd_element|xmlwriter_write_dtd_entity|xmlwriter_write_element|' + - 'xmlwriter_write_element_ns|xmlwriter_write_pi|xmlwriter_write_raw|xpath_eval|xpath_eval_expression|xpath_new_context|xpath_register_ns|' + - 'xpath_register_ns_auto|xptr_eval|xptr_new_context|xslt_backend_info|xslt_backend_name|xslt_backend_version|xslt_create|xslt_errno|' + - 'xslt_error|xslt_free|xslt_getopt|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_object|' + - 'xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|xslt_setopt|xsltprocessor|yaml_emit|' + - 'yaml_emit_file|yaml_parse|yaml_parse_file|yaml_parse_url|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|' + - 'yaz_element|yaz_errno|yaz_error|yaz_es|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|' + - 'yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|' + - 'yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_thread_id|zend_version|zip_close|zip_entry_close|' + - 'zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|' + - 'ziparchive|ziparchive_addemptydir|ziparchive_addfile|ziparchive_addfromstring|ziparchive_close|ziparchive_deleteindex|' + - 'ziparchive_deletename|ziparchive_extractto|ziparchive_getarchivecomment|ziparchive_getcommentindex|ziparchive_getcommentname|' + - 'ziparchive_getfromindex|ziparchive_getfromname|ziparchive_getnameindex|ziparchive_getstatusstring|ziparchive_getstream|' + - 'ziparchive_locatename|ziparchive_open|ziparchive_renameindex|ziparchive_renamename|ziparchive_setCommentName|ziparchive_setarchivecomment|' + - 'ziparchive_setcommentindex|ziparchive_statindex|ziparchive_statname|ziparchive_unchangeall|ziparchive_unchangearchive|' + - 'ziparchive_unchangeindex|ziparchive_unchangename|zlib_get_coding_type').split('|') - ); - var keywords = lang.arrayToMap( - ('abstract|and|array|as|break|case|catch|class|clone|const|continue|declare|default|do|else|elseif|enddeclare|endfor|endforeach|endif|' + - 'endswitch|endwhile|extends|final|for|foreach|function|global|goto|if|implements|interface|instanceof|namespace|new|or|private|protected|' + - 'public|static|switch|throw|try|use|var|while|xor').split('|') - ); - var languageConstructs = lang.arrayToMap( - ('die|echo|empty|exit|eval|include|include_once|isset|list|require|require_once|return|print|unset').split('|') - ); - - var builtinConstants = lang.arrayToMap( - ('true|false|null|__CLASS__|__DIR__|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__NAMESPACE__').split('|') - ); - - var builtinVariables = lang.arrayToMap( - ('$GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|' + - '$http_response_header|$argc|$argv').split('|') - ); - var builtinFunctionsDeprecated = lang.arrayToMap( - ('key_exists|cairo_matrix_create_scale|cairo_matrix_create_translate|call_user_method|call_user_method_array|com_addref|com_get|' + - 'com_invoke|com_isenum|com_load|com_release|com_set|connection_timeout|cubrid_load_from_glo|cubrid_new_glo|cubrid_save_to_glo|' + - 'cubrid_send_glo|define_syslog_variables|dl|ereg|ereg_replace|eregi|eregi_replace|hw_documentattributes|hw_documentbodytag|' + - 'hw_documentsize|hw_outputdocument|imagedashedline|maxdb_bind_param|maxdb_bind_result|maxdb_client_encoding|maxdb_close_long_data|' + - 'maxdb_execute|maxdb_fetch|maxdb_get_metadata|maxdb_param_count|maxdb_send_long_data|mcrypt_ecb|mcrypt_generic_end|mime_content_type|' + - 'mysql_createdb|mysql_dbname|mysql_db_query|mysql_drop_db|mysql_dropdb|mysql_escape_string|mysql_fieldflags|mysql_fieldflags|' + - 'mysql_fieldname|mysql_fieldtable|mysql_fieldtype|mysql_freeresult|mysql_listdbs|mysql_list_fields|mysql_listfields|mysql_list_tables|' + - 'mysql_listtables|mysql_numfields|mysql_numrows|mysql_selectdb|mysql_tablename|mysqli_bind_param|mysqli_bind_result|' + - 'mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_execute|' + - 'mysqli_fetch|mysqli_get_metadata|mysqli_master_query|mysqli_param_count|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|' + - 'mysqli_send_long_data|mysqli_send_query|mysqli_slave_query|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|' + - 'ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|' + - 'ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|' + - 'ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|' + - 'ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|' + - 'ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|PDF_add_annotation|PDF_add_bookmark|' + - 'PDF_add_launchlink|PDF_add_locallink|PDF_add_note|PDF_add_outline|PDF_add_pdflink|PDF_add_weblink|PDF_attach_file|PDF_begin_page|' + - 'PDF_begin_template|PDF_close_pdi|PDF_close|PDF_findfont|PDF_get_font|PDF_get_fontname|PDF_get_fontsize|PDF_get_image_height|' + - 'PDF_get_image_width|PDF_get_majorversion|PDF_get_minorversion|PDF_get_pdi_parameter|PDF_get_pdi_value|PDF_open_ccitt|PDF_open_file|' + - 'PDF_open_gif|PDF_open_image_file|PDF_open_image|PDF_open_jpeg|PDF_open_pdi|PDF_open_tiff|PDF_place_image|PDF_place_pdi_page|' + - 'PDF_set_border_color|PDF_set_border_dash|PDF_set_border_style|PDF_set_char_spacing|PDF_set_duration|PDF_set_horiz_scaling|' + - 'PDF_set_info_author|PDF_set_info_creator|PDF_set_info_keywords|PDF_set_info_subject|PDF_set_info_title|PDF_set_leading|' + - 'PDF_set_text_matrix|PDF_set_text_rendering|PDF_set_text_rise|PDF_set_word_spacing|PDF_setgray_fill|PDF_setgray_stroke|PDF_setgray|' + - 'PDF_setpolydash|PDF_setrgbcolor_fill|PDF_setrgbcolor_stroke|PDF_setrgbcolor|PDF_show_boxed|php_check_syntax|px_set_tablename|' + - 'px_set_targetencoding|runkit_sandbox_output_handler|session_is_registered|session_register|session_unregister' + - 'set_magic_quotes_runtime|magic_quotes_runtime|set_socket_blocking|socket_set_blocking|set_socket_timeout|socket_set_timeout|split|spliti|' + - 'sql_regcase').split('|') - ); - - var keywordsDeprecated = lang.arrayToMap( - ('cfunction|old_function').split('|') - ); - - var futureReserved = lang.arrayToMap([]); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : /(?:#|\/\/)(?:[^?]|\?[^>])*/ - }, - docComment.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)" - }, { - token : "string", // " string start - regex : '"', - next : "qqstring" - }, { - token : "string", // ' string start - regex : "'", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language", // constants - regex : "\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|" + - "ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|" + - "HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|" + - "L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|" + - "VERSION))|__COMPILER_HALT_OFFSET__)\\b" - }, { - token : ["keyword", "text", "support.class"], - regex : "\\b(new)(\\s+)(\\w+)" - }, { - token : ["support.class", "keyword.operator"], - regex : "\\b(\\w+)(::)" - }, { - token : "constant.language", // constants - regex : "\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|" + - "SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|" + - "O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|" + - "R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|" + - "YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|" + - "ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|" + - "T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|" + - "HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|" + - "I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|" + - "O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|" + - "L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|" + - "M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|" + - "OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|" + - "P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|" + - "RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|" + - "T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b" - }, { - token : function(value) { - if (keywords.hasOwnProperty(value)) - return "keyword"; - else if (builtinConstants.hasOwnProperty(value)) - return "constant.language"; - else if (builtinVariables.hasOwnProperty(value)) - return "variable.language"; - else if (futureReserved.hasOwnProperty(value)) - return "invalid.illegal"; - else if (builtinFunctions.hasOwnProperty(value)) - return "support.function"; - else if (value == "debugger") - return "invalid.deprecated"; - else - if(value.match(/^(\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|self|parent)$/)) - return "variable"; - return "identifier"; - }, - regex : "[a-zA-Z_$\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\b" - }, { - onMatch : function(value, currentSate, state) { - value = value.substr(3); - if (value[0] == "'" || value[0] == '"') - value = value.slice(1, -1); - state.unshift(this.next, value); - return "markup.list"; - }, - regex : /<<<(?:\w+|'\w+'|"\w+")$/, - next: "heredoc" - }, { - token : "keyword.operator", - regex : "::|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|!=|!==|<=|>=|=>|<<=|>>=|>>>=|<>|<|>|=|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "heredoc" : [ - { - onMatch : function(value, currentSate, stack) { - if (stack[1] != value) - return "string"; - stack.shift(); - stack.shift(); - return "markup.list" - }, - regex : "^\\w+(?=;?$)", - next: "start" - }, { - token: "string", - regex : ".*" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : '\\\\(?:[nrtvef\\\\"$]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})' - }, { - token : "constant.language.escape", - regex : /\$[\w]+(?:\[[\w\]+]|=>\w+)?/ - }, { - token : "constant.language.escape", - regex : /\$\{[^"\}]+\}?/ // this is wrong but ok for now - }, - {token : "string", regex : '"', next : "start"}, - {defaultToken : "string"} - ], - "qstring" : [ - {token : "constant.language.escape", regex : /\\['\\]/}, - {token : "string", regex : "'", next : "start"}, - {defaultToken : "string"} - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(PhpLangHighlightRules, TextHighlightRules); - - -var PhpHighlightRules = function() { - HtmlHighlightRules.call(this); - - var startRules = [ - { - token : "support.php_tag", // php open tag - regex : "<\\?(?:php|=)?", - push : "php-start" - } - ]; - - var endRules = [ - { - token : "support.php_tag", // php close tag - regex : "\\?>", - next : "pop" - } - ]; - - for (var key in this.$rules) - this.$rules[key].unshift.apply(this.$rules[key], startRules); - - this.embedRules(PhpLangHighlightRules, "php-", endRules, ["start"]); - - this.normalizeRules(); -}; - -oop.inherits(PhpHighlightRules, HtmlHighlightRules); - -exports.PhpHighlightRules = PhpHighlightRules; -exports.PhpLangHighlightRules = PhpLangHighlightRules; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-plain_text.js b/util/build-sample-browser/player/vendor/ace/mode-plain_text.js deleted file mode 100644 index 322c6d3a3d..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-plain_text.js +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/plain_text', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/behaviour'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var Behaviour = require("./behaviour").Behaviour; - -var Mode = function() { - this.HighlightRules = TextHighlightRules; - this.$behaviour = new Behaviour(); -}; - -oop.inherits(Mode, TextMode); - -(function() { - this.type = "text"; - this.getNextLineIndent = function(state, line, tab) { - return ''; - }; - this.$id = "ace/mode/plain_text"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/mode-powershell.js b/util/build-sample-browser/player/vendor/ace/mode-powershell.js deleted file mode 100644 index e77b3cd15e..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-powershell.js +++ /dev/null @@ -1,695 +0,0 @@ -ace.define('ace/mode/powershell', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/powershell_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var PowershellHighlightRules = require("./powershell_highlight_rules").PowershellHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = PowershellHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode({start: "^\\s*(<#)", end: "^[#\\s]>\\s*$"}); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "#"; - this.blockComment = {start: "<#", end: "#>"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - - this.createWorker = function(session) { - return null; - }; - - this.$id = "ace/mode/powershell"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/powershell_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var PowershellHighlightRules = function() { - - var keywords = ( - "function|if|else|elseif|switch|while|default|for|do|until|break|continue|" + - "foreach|return|filter|in|trap|throw|param|begin|process|end" - ); - - var builtinFunctions = ( - "Get-Alias|Import-Alias|New-Alias|Set-Alias|Get-AuthenticodeSignature|Set-AuthenticodeSignature|" + - "Set-Location|Get-ChildItem|Clear-Item|Get-Command|Measure-Command|Trace-Command|" + - "Add-Computer|Checkpoint-Computer|Remove-Computer|Restart-Computer|Restore-Computer|Stop-Computer|" + - "Reset-ComputerMachinePassword|Test-ComputerSecureChannel|Add-Content|Get-Content|Set-Content|Clear-Content|" + - "Get-Command|Invoke-Command|Enable-ComputerRestore|Disable-ComputerRestore|Get-ComputerRestorePoint|Test-Connection|" + - "ConvertFrom-CSV|ConvertTo-CSV|ConvertTo-Html|ConvertTo-Xml|ConvertFrom-SecureString|ConvertTo-SecureString|" + - "Copy-Item|Export-Counter|Get-Counter|Import-Counter|Get-Credential|Get-Culture|" + - "Get-ChildItem|Get-Date|Set-Date|Remove-Item|Compare-Object|Get-Event|" + - "Get-WinEvent|New-Event|Remove-Event|Unregister-Event|Wait-Event|Clear-EventLog|" + - "Get-Eventlog|Limit-EventLog|New-Eventlog|Remove-EventLog|Show-EventLog|Write-EventLog|" + - "Get-EventSubscriber|Register-EngineEvent|Register-ObjectEvent|Register-WmiEvent|Get-ExecutionPolicy|Set-ExecutionPolicy|" + - "Export-Alias|Export-Clixml|Export-Console|Export-Csv|ForEach-Object|Format-Custom|" + - "Format-List|Format-Table|Format-Wide|Export-FormatData|Get-FormatData|Get-Item|" + - "Get-ChildItem|Get-Help|Add-History|Clear-History|Get-History|Invoke-History|" + - "Get-Host|Read-Host|Write-Host|Get-HotFix|Import-Clixml|Import-Csv|" + - "Invoke-Command|Invoke-Expression|Get-Item|Invoke-Item|New-Item|Remove-Item|" + - "Set-Item|Clear-ItemProperty|Copy-ItemProperty|Get-ItemProperty|Move-ItemProperty|New-ItemProperty|" + - "Remove-ItemProperty|Rename-ItemProperty|Set-ItemProperty|Get-Job|Receive-Job|Remove-Job|" + - "Start-Job|Stop-Job|Wait-Job|Stop-Process|Update-List|Get-Location|" + - "Pop-Location|Push-Location|Set-Location|Send-MailMessage|Add-Member|Get-Member|" + - "Move-Item|Compare-Object|Group-Object|Measure-Object|New-Object|Select-Object|" + - "Sort-Object|Where-Object|Out-Default|Out-File|Out-GridView|Out-Host|" + - "Out-Null|Out-Printer|Out-String|Convert-Path|Join-Path|Resolve-Path|" + - "Split-Path|Test-Path|Get-Pfxcertificate|Pop-Location|Push-Location|Get-Process|" + - "Start-Process|Stop-Process|Wait-Process|Enable-PSBreakpoint|Disable-PSBreakpoint|Get-PSBreakpoint|" + - "Set-PSBreakpoint|Remove-PSBreakpoint|Get-PSDrive|New-PSDrive|Remove-PSDrive|Get-PSProvider|" + - "Set-PSdebug|Enter-PSSession|Exit-PSSession|Export-PSSession|Get-PSSession|Import-PSSession|" + - "New-PSSession|Remove-PSSession|Disable-PSSessionConfiguration|Enable-PSSessionConfiguration|Get-PSSessionConfiguration|Register-PSSessionConfiguration|" + - "Set-PSSessionConfiguration|Unregister-PSSessionConfiguration|New-PSSessionOption|Add-PsSnapIn|Get-PsSnapin|Remove-PSSnapin|" + - "Get-Random|Read-Host|Remove-Item|Rename-Item|Rename-ItemProperty|Select-Object|" + - "Select-XML|Send-MailMessage|Get-Service|New-Service|Restart-Service|Resume-Service|" + - "Set-Service|Start-Service|Stop-Service|Suspend-Service|Sort-Object|Start-Sleep|" + - "ConvertFrom-StringData|Select-String|Tee-Object|New-Timespan|Trace-Command|Get-Tracesource|" + - "Set-Tracesource|Start-Transaction|Complete-Transaction|Get-Transaction|Use-Transaction|Undo-Transaction|" + - "Start-Transcript|Stop-Transcript|Add-Type|Update-TypeData|Get-Uiculture|Get-Unique|" + - "Update-Formatdata|Update-Typedata|Clear-Variable|Get-Variable|New-Variable|Remove-Variable|" + - "Set-Variable|New-WebServiceProxy|Where-Object|Write-Debug|Write-Error|Write-Host|" + - "Write-Output|Write-Progress|Write-Verbose|Write-Warning|Set-WmiInstance|Invoke-WmiMethod|" + - "Get-WmiObject|Remove-WmiObject|Connect-WSMan|Disconnect-WSMan|Test-WSMan|Invoke-WSManAction|" + - "Disable-WSManCredSSP|Enable-WSManCredSSP|Get-WSManCredSSP|New-WSManInstance|Get-WSManInstance|Set-WSManInstance|" + - "Remove-WSManInstance|Set-WSManQuickConfig|New-WSManSessionOption" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "keyword": keywords - }, "identifier"); - - var binaryOperatorsRe = "eq|ne|ge|gt|lt|le|like|notlike|match|notmatch|replace|contains|notcontains|" + - "ieq|ine|ige|igt|ile|ilt|ilike|inotlike|imatch|inotmatch|ireplace|icontains|inotcontains|" + - "is|isnot|as|" + - "and|or|band|bor|not"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "#.*$" - }, { - token : "comment.start", - regex : "<#", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "[$](?:[Tt]rue|[Ff]alse)\\b" - }, { - token : "constant.language", - regex : "[$][Nn]ull\\b" - }, { - token : "variable.instance", - regex : "[$][a-zA-Z][a-zA-Z0-9_]*\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b" - }, { - token : "keyword.operator", - regex : "\\-(?:" + binaryOperatorsRe + ")" - }, { - token : "keyword.operator", - regex : "&|\\*|\\+|\\-|\\=|\\+=|\\-=" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment.end", - regex : "#>", - next : "start" - }, { - token : "doc.comment.tag", - regex : "^\\.\\w+" - }, { - token : "comment", - regex : "\\w+" - }, { - token : "comment", - regex : "." - } - ] - }; -}; - -oop.inherits(PowershellHighlightRules, TextHighlightRules); - -exports.PowershellHighlightRules = PowershellHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-prolog.js b/util/build-sample-browser/player/vendor/ace/mode-prolog.js deleted file mode 100644 index d8a8bfb612..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-prolog.js +++ /dev/null @@ -1,354 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/prolog', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/prolog_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var PrologHighlightRules = require("./prolog_highlight_rules").PrologHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = PrologHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "%"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/prolog"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/prolog_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var PrologHighlightRules = function() { - - this.$rules = { start: - [ { include: '#comment' }, - { include: '#basic_fact' }, - { include: '#rule' }, - { include: '#directive' }, - { include: '#fact' } ], - '#atom': - [ { token: 'constant.other.atom.prolog', - regex: '\\b[a-z][a-zA-Z0-9_]*\\b' }, - { token: 'constant.numeric.prolog', - regex: '-?\\d+(?:\\.\\d+)?' }, - { include: '#string' } ], - '#basic_elem': - [ { include: '#comment' }, - { include: '#statement' }, - { include: '#constants' }, - { include: '#operators' }, - { include: '#builtins' }, - { include: '#list' }, - { include: '#atom' }, - { include: '#variable' } ], - '#basic_fact': - [ { token: - [ 'entity.name.function.fact.basic.prolog', - 'punctuation.end.fact.basic.prolog' ], - regex: '([a-z]\\w*)(\\.)' } ], - '#builtins': - [ { token: 'support.function.builtin.prolog', - regex: '\\b(?:abolish|abort|ancestors|arg|ascii|assert[az]|atom(?:ic)?|body|char|close|conc|concat|consult|define|definition|dynamic|dump|fail|file|free|free_proc|functor|getc|goal|halt|head|head|integer|length|listing|match_args|member|next_clause|nl|nonvar|nth|number|cvars|nvars|offset|op|print?|prompt|putc|quoted|ratom|read|redefine|rename|retract(?:all)?|see|seeing|seen|skip|spy|statistics|system|tab|tell|telling|term|time|told|univ|unlink_clause|unspy_predicate|var|write)\\b' } ], - '#comment': - [ { token: - [ 'punctuation.definition.comment.prolog', - 'comment.line.percentage.prolog' ], - regex: '(%)(.*$)' }, - { token: 'punctuation.definition.comment.prolog', - regex: '/\\*', - push: - [ { token: 'punctuation.definition.comment.prolog', - regex: '\\*/', - next: 'pop' }, - { defaultToken: 'comment.block.prolog' } ] } ], - '#constants': - [ { token: 'constant.language.prolog', - regex: '\\b(?:true|false|yes|no)\\b' } ], - '#directive': - [ { token: 'keyword.operator.directive.prolog', - regex: ':-', - push: - [ { token: 'meta.directive.prolog', regex: '\\.', next: 'pop' }, - { include: '#comment' }, - { include: '#statement' }, - { defaultToken: 'meta.directive.prolog' } ] } ], - '#expr': - [ { include: '#comments' }, - { token: 'meta.expression.prolog', - regex: '\\(', - push: - [ { token: 'meta.expression.prolog', regex: '\\)', next: 'pop' }, - { include: '#expr' }, - { defaultToken: 'meta.expression.prolog' } ] }, - { token: 'keyword.control.cutoff.prolog', regex: '!' }, - { token: 'punctuation.control.and.prolog', regex: ',' }, - { token: 'punctuation.control.or.prolog', regex: ';' }, - { include: '#basic_elem' } ], - '#fact': - [ { token: - [ 'entity.name.function.fact.prolog', - 'punctuation.begin.fact.parameters.prolog' ], - regex: '([a-z]\\w*)(\\()(?!.*:-)', - push: - [ { token: - [ 'punctuation.end.fact.parameters.prolog', - 'punctuation.end.fact.prolog' ], - regex: '(\\))(\\.?)', - next: 'pop' }, - { include: '#parameter' }, - { defaultToken: 'meta.fact.prolog' } ] } ], - '#list': - [ { token: 'punctuation.begin.list.prolog', - regex: '\\[(?=.*\\])', - push: - [ { token: 'punctuation.end.list.prolog', - regex: '\\]', - next: 'pop' }, - { include: '#comment' }, - { token: 'punctuation.separator.list.prolog', regex: ',' }, - { token: 'punctuation.concat.list.prolog', - regex: '\\|', - push: - [ { token: 'meta.list.concat.prolog', - regex: '(?=\\s*\\])', - next: 'pop' }, - { include: '#basic_elem' }, - { defaultToken: 'meta.list.concat.prolog' } ] }, - { include: '#basic_elem' }, - { defaultToken: 'meta.list.prolog' } ] } ], - '#operators': - [ { token: 'keyword.operator.prolog', - regex: '\\\\\\+|\\bnot\\b|\\bis\\b|->|[><]|[><\\\\:=]?=|(?:=\\\\|\\\\=)=' } ], - '#parameter': - [ { token: 'variable.language.anonymous.prolog', - regex: '\\b_\\b' }, - { token: 'variable.parameter.prolog', - regex: '\\b[A-Z_]\\w*\\b' }, - { token: 'punctuation.separator.parameters.prolog', regex: ',' }, - { include: '#basic_elem' }, - { token: 'text', regex: '[^\\s]' } ], - '#rule': - [ { token: 'meta.rule.prolog', - regex: '(?=[a-z]\\w*.*:-)', - push: - [ { token: 'punctuation.rule.end.prolog', - regex: '\\.', - next: 'pop' }, - { token: 'meta.rule.signature.prolog', - regex: '(?=[a-z]\\w*.*:-)', - push: - [ { token: 'meta.rule.signature.prolog', - regex: '(?=:-)', - next: 'pop' }, - { token: 'entity.name.function.rule.prolog', - regex: '[a-z]\\w*(?=\\(|\\s*:-)' }, - { token: 'punctuation.rule.parameters.begin.prolog', - regex: '\\(', - push: - [ { token: 'punctuation.rule.parameters.end.prolog', - regex: '\\)', - next: 'pop' }, - { include: '#parameter' }, - { defaultToken: 'meta.rule.parameters.prolog' } ] }, - { defaultToken: 'meta.rule.signature.prolog' } ] }, - { token: 'keyword.operator.definition.prolog', - regex: ':-', - push: - [ { token: 'meta.rule.definition.prolog', - regex: '(?=\\.)', - next: 'pop' }, - { include: '#comment' }, - { include: '#expr' }, - { defaultToken: 'meta.rule.definition.prolog' } ] }, - { defaultToken: 'meta.rule.prolog' } ] } ], - '#statement': - [ { token: 'meta.statement.prolog', - regex: '(?=[a-z]\\w*\\()', - push: - [ { token: 'punctuation.end.statement.parameters.prolog', - regex: '\\)', - next: 'pop' }, - { include: '#builtins' }, - { include: '#atom' }, - { token: 'punctuation.begin.statement.parameters.prolog', - regex: '\\(', - push: - [ { token: 'meta.statement.parameters.prolog', - regex: '(?=\\))', - next: 'pop' }, - { token: 'punctuation.separator.statement.prolog', regex: ',' }, - { include: '#basic_elem' }, - { defaultToken: 'meta.statement.parameters.prolog' } ] }, - { defaultToken: 'meta.statement.prolog' } ] } ], - '#string': - [ { token: 'punctuation.definition.string.begin.prolog', - regex: '\'', - push: - [ { token: 'punctuation.definition.string.end.prolog', - regex: '\'', - next: 'pop' }, - { token: 'constant.character.escape.prolog', regex: '\\\\.' }, - { token: 'constant.character.escape.quote.prolog', - regex: '\'\'' }, - { defaultToken: 'string.quoted.single.prolog' } ] } ], - '#variable': - [ { token: 'variable.language.anonymous.prolog', - regex: '\\b_\\b' }, - { token: 'variable.other.prolog', - regex: '\\b[A-Z_][a-zA-Z0-9_]*\\b' } ] } - - this.normalizeRules(); -}; - -PrologHighlightRules.metaData = { fileTypes: [ 'plg', 'prolog' ], - foldingStartMarker: '(%\\s*region \\w*)|([a-z]\\w*.*:- ?)', - foldingStopMarker: '(%\\s*end(\\s*region)?)|(?=\\.)', - keyEquivalent: '^~P', - name: 'Prolog', - scopeName: 'source.prolog' } - - -oop.inherits(PrologHighlightRules, TextHighlightRules); - -exports.PrologHighlightRules = PrologHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-properties.js b/util/build-sample-browser/player/vendor/ace/mode-properties.js deleted file mode 100644 index 309a9d46f6..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-properties.js +++ /dev/null @@ -1,104 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/properties', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/properties_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var PropertiesHighlightRules = require("./properties_highlight_rules").PropertiesHighlightRules; - -var Mode = function() { - this.HighlightRules = PropertiesHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - this.$id = "ace/mode/properties"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/properties_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var PropertiesHighlightRules = function() { - - var escapeRe = /\\u[0-9a-fA-F]{4}|\\/; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : /[!#].*$/ - }, { - token : "keyword", - regex : /[=:]$/ - }, { - token : "keyword", - regex : /[=:]/, - next : "value" - }, { - token : "constant.language.escape", - regex : escapeRe - }, { - defaultToken: "variable" - } - ], - "value" : [ - { - regex : /\\$/, - token : "string", - next : "value" - }, { - regex : /$/, - token : "string", - next : "start" - }, { - token : "constant.language.escape", - regex : escapeRe - }, { - defaultToken: "string" - } - ] - }; - -}; - -oop.inherits(PropertiesHighlightRules, TextHighlightRules); - -exports.PropertiesHighlightRules = PropertiesHighlightRules; -}); - diff --git a/util/build-sample-browser/player/vendor/ace/mode-protobuf.js b/util/build-sample-browser/player/vendor/ace/mode-protobuf.js deleted file mode 100644 index 4181cf71a2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-protobuf.js +++ /dev/null @@ -1,915 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Zef Hemel - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/protobuf', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/c_cpp', 'ace/tokenizer', 'ace/mode/protobuf_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var CMode = require("./c_cpp").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ProtobufHighlightRules = require("./protobuf_highlight_rules").ProtobufHighlightRules; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - CMode.call(this); - var highlighter = new ProtobufHighlightRules(); - this.foldingRules = new CStyleFoldMode(); - - this.$tokenizer = new Tokenizer(highlighter.getRules()); - this.$keywordList = highlighter.$keywordList; -}; -oop.inherits(Mode, CMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/protobuf"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/c_cpp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c_cpp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = c_cppHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/c_cpp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/c_cpp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" - -var c_cppHighlightRules = function() { - - var keywordControls = ( - "break|case|continue|default|do|else|for|goto|if|_Pragma|" + - "return|switch|while|catch|operator|try|throw|using" - ); - - var storageType = ( - "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + - "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + - "class|wchar_t|template" - ); - - var storageModifiers = ( - "const|extern|register|restrict|static|volatile|inline|private:|" + - "protected:|public:|friend|explicit|virtual|export|mutable|typename" - ); - - var keywordOperators = ( - "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + - "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" - ); - - var builtinConstants = ( - "NULL|true|false|TRUE|FALSE" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.control" : keywordControls, - "storage.type" : storageType, - "storage.modifier" : storageModifiers, - "keyword.operator" : keywordOperators, - "variable.language": "this", - "constant.language": builtinConstants - }, "identifier"); - - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "keyword", // pre-compiler directives - regex : "#\\s*(?:include|import|pragma|line|define|undef|if|ifdef|else|elif|ifndef)\\b", - next : "directive" - }, { - token : "keyword", // special case pre-compiler directive - regex : "(?:#\\s*endif)\\b" - }, { - token : "support.function.C99.c", - regex : cFunctions - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "directive" : [ - { - token : "constant.other.multiline", - regex : /\\/ - }, - { - token : "constant.other.multiline", - regex : /.*\\/ - }, - { - token : "constant.other", - regex : "\\s*<.+?>", - next : "start" - }, - { - token : "constant.other", // single line - regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', - next : "start" - }, - { - token : "constant.other", // single line - regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", - next : "start" - }, - { - token : "constant.other", - regex : /[^\\\/]+/, - next : "start" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(c_cppHighlightRules, TextHighlightRules); - -exports.c_cppHighlightRules = c_cppHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); -ace.define('ace/mode/protobuf_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - - var oop = require("../lib/oop"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - var ProtobufHighlightRules = function() { - - var builtinTypes = "double|float|int32|int64|uint32|uint64|sint32|" + - "sint64|fixed32|fixed64|sfixed32|sfixed64|bool|" + - "string|bytes"; - var keywordDeclaration = "message|required|optional|repeated|package|" + - "import|option|enum"; - - var keywordMapper = this.createKeywordMapper({ - "keyword.declaration.protobuf": keywordDeclaration, - "support.type": builtinTypes - }, "identifier"); - - this.$rules = { - "start": [{ - token: "comment", - regex: /\/\/.*$/ - }, { - token: "comment", - regex: /\/\*/, - next: "comment" - }, { - token: "constant", - regex: "<[^>]+>" - }, { - regex: "=", - token: "keyword.operator.assignment.protobuf" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : '[\'](?:(?:\\\\.)|(?:[^\'\\\\]))*?[\']' - }, { - token: "constant.numeric", // hex - regex: "0[xX][0-9a-fA-F]+\\b" - }, { - token: "constant.numeric", // float - regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token: keywordMapper, - regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }], - "comment": [{ - token: "comment", // closing comment - regex: ".*?\\*\\/", - next: "start" - }, { - token: "comment", // comment spanning whole line - regex: ".+" - }] - }; - - this.normalizeRules(); - }; - - oop.inherits(ProtobufHighlightRules, TextHighlightRules); - - exports.ProtobufHighlightRules = ProtobufHighlightRules; -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/mode-python.js b/util/build-sample-browser/player/vendor/ace/mode-python.js deleted file mode 100644 index 52c906e5cd..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-python.js +++ /dev/null @@ -1,295 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/python', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/python_highlight_rules', 'ace/mode/folding/pythonic', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules; -var PythonFoldMode = require("./folding/pythonic").FoldMode; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = PythonHighlightRules; - this.foldingRules = new PythonFoldMode("\\:"); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "#"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[\:]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - var outdents = { - "pass": 1, - "return": 1, - "raise": 1, - "break": 1, - "continue": 1 - }; - - this.checkOutdent = function(state, line, input) { - if (input !== "\r\n" && input !== "\r" && input !== "\n") - return false; - - var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; - - if (!tokens) - return false; - do { - var last = tokens.pop(); - } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); - - if (!last) - return false; - - return (last.type == "keyword" && outdents[last.value]); - }; - - this.autoOutdent = function(state, doc, row) { - - row += 1; - var indent = this.$getIndent(doc.getLine(row)); - var tab = doc.getTabString(); - if (indent.slice(-tab.length) == tab) - doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); - }; - - this.$id = "ace/mode/python"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/python_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var PythonHighlightRules = function() { - - var keywords = ( - "and|as|assert|break|class|continue|def|del|elif|else|except|exec|" + - "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" + - "raise|return|try|while|with|yield" - ); - - var builtinConstants = ( - "True|False|None|NotImplemented|Ellipsis|__debug__" - ); - - var builtinFunctions = ( - "abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" + - "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" + - "binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|" + - "float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" + - "chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" + - "cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" + - "__import__|complex|hash|min|set|apply|delattr|help|next|setattr|" + - "buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern" - ); - var keywordMapper = this.createKeywordMapper({ - "invalid.deprecated": "debugger", - "support.function": builtinFunctions, - "constant.language": builtinConstants, - "keyword": keywords - }, "identifier"); - - var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?"; - - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; - var octInteger = "(?:0[oO]?[0-7]+)"; - var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; - var binInteger = "(?:0[bB][01]+)"; - var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; - - var exponent = "(?:[eE][+-]?\\d+)"; - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; - var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; - - var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"; - - this.$rules = { - "start" : [ { - token : "comment", - regex : "#.*$" - }, { - token : "string", // multi line """ string start - regex : strPre + '"{3}', - next : "qqstring3" - }, { - token : "string", // " string - regex : strPre + '"(?=.)', - next : "qqstring" - }, { - token : "string", // multi line ''' string start - regex : strPre + "'{3}", - next : "qstring3" - }, { - token : "string", // ' string - regex : strPre + "'(?=.)", - next : "qstring" - }, { - token : "constant.numeric", // imaginary - regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" - }, { - token : "constant.numeric", // float - regex : floatNumber - }, { - token : "constant.numeric", // long integer - regex : integer + "[lL]\\b" - }, { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen", - regex : "[\\]\\)\\}]" - }, { - token : "text", - regex : "\\s+" - } ], - "qqstring3" : [ { - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", // multi line """ string end - regex : '"{3}', - next : "start" - }, { - defaultToken : "string" - } ], - "qstring3" : [ { - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", // multi line ''' string end - regex : "'{3}", - next : "start" - }, { - defaultToken : "string" - } ], - "qqstring" : [{ - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "start" - }, { - defaultToken: "string" - }], - "qstring" : [{ - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "start" - }, { - defaultToken: "string" - }] - }; -}; - -oop.inherits(PythonHighlightRules, TextHighlightRules); - -exports.PythonHighlightRules = PythonHighlightRules; -}); - -ace.define('ace/mode/folding/pythonic', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(markers) { - this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$"); -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - if (match[1]) - return this.openingBracketBlock(session, match[1], row, match.index); - if (match[2]) - return this.indentationBlock(session, row, match.index + match[2].length); - return this.indentationBlock(session, row); - } - } - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-r.js b/util/build-sample-browser/player/vendor/ace/mode-r.js deleted file mode 100644 index e462c9f6c3..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-r.js +++ /dev/null @@ -1,337 +0,0 @@ -/* - * r.js - * - * Copyright (C) 2009-11 by RStudio, Inc. - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * - */ -ace.define('ace/mode/r', ['require', 'exports', 'module' , 'ace/range', 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/r_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/unicode'], function(require, exports, module) { - - - var Range = require("../range").Range; - var oop = require("../lib/oop"); - var TextMode = require("./text").Mode; - var Tokenizer = require("../tokenizer").Tokenizer; - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - var RHighlightRules = require("./r_highlight_rules").RHighlightRules; - var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; - var unicode = require("../unicode"); - - var Mode = function() - { - this.HighlightRules = RHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - }; - oop.inherits(Mode, TextMode); - - (function() - { - this.lineCommentStart = "#"; - this.$id = "ace/mode/r"; - }).call(Mode.prototype); - exports.Mode = Mode; -}); -ace.define('ace/mode/r_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/tex_highlight_rules'], function(require, exports, module) { - - var oop = require("../lib/oop"); - var lang = require("../lib/lang"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules; - - var RHighlightRules = function() - { - - var keywords = lang.arrayToMap( - ("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass") - .split("|") - ); - - var buildinConstants = lang.arrayToMap( - ("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|" + - "NA_complex_").split("|") - ); - - this.$rules = { - "start" : [ - { - token : "comment.sectionhead", - regex : "#+(?!').*(?:----|====|####)\\s*$" - }, - { - token : "comment", - regex : "#+'", - next : "rd-start" - }, - { - token : "comment", - regex : "#.*$" - }, - { - token : "string", // multi line string start - regex : '["]', - next : "qqstring" - }, - { - token : "string", // multi line string start - regex : "[']", - next : "qstring" - }, - { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+[Li]?\\b" - }, - { - token : "constant.numeric", // explicit integer - regex : "\\d+L\\b" - }, - { - token : "constant.numeric", // number - regex : "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b" - }, - { - token : "constant.numeric", // number with leading decimal - regex : "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b" - }, - { - token : "constant.language.boolean", - regex : "(?:TRUE|FALSE|T|F)\\b" - }, - { - token : "identifier", - regex : "`.*?`" - }, - { - onMatch : function(value) { - if (keywords[value]) - return "keyword"; - else if (buildinConstants[value]) - return "constant.language"; - else if (value == '...' || value.match(/^\.\.\d+$/)) - return "variable.language"; - else - return "identifier"; - }, - regex : "[a-zA-Z.][a-zA-Z0-9._]*\\b" - }, - { - token : "keyword.operator", - regex : "%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:" - }, - { - token : "keyword.operator", // infix operators - regex : "%.*?%" - }, - { - token : "paren.keyword.operator", - regex : "[[({]" - }, - { - token : "paren.keyword.operator", - regex : "[\\])}]" - }, - { - token : "text", - regex : "\\s+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, - { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, - { - token : "string", - regex : '.+' - } - ] - }; - - var rdRules = new TexHighlightRules("comment").getRules(); - for (var i = 0; i < rdRules["start"].length; i++) { - rdRules["start"][i].token += ".virtual-comment"; - } - - this.addRules(rdRules, "rd-"); - this.$rules["rd-start"].unshift({ - token: "text", - regex: "^", - next: "start" - }); - this.$rules["rd-start"].unshift({ - token : "keyword", - regex : "@(?!@)[^ ]*" - }); - this.$rules["rd-start"].unshift({ - token : "comment", - regex : "@@" - }); - this.$rules["rd-start"].push({ - token : "comment", - regex : "[^%\\\\[({\\])}]+" - }); - }; - - oop.inherits(RHighlightRules, TextHighlightRules); - - exports.RHighlightRules = RHighlightRules; -}); -ace.define('ace/mode/tex_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var TexHighlightRules = function(textClass) { - - if (!textClass) - textClass = "text"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "%.*$" - }, { - token : textClass, // non-command - regex : "\\\\[$&%#\\{\\}]" - }, { - token : "keyword", // command - regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b", - next : "nospell" - }, { - token : "keyword", // command - regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])" - }, { - token : "paren.keyword.operator", - regex : "[[({]" - }, { - token : "paren.keyword.operator", - regex : "[\\])}]" - }, { - token : textClass, - regex : "\\s+" - } - ], - "nospell" : [ - { - token : "comment", - regex : "%.*$", - next : "start" - }, { - token : "nospell." + textClass, // non-command - regex : "\\\\[$&%#\\{\\}]" - }, { - token : "keyword", // command - regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b" - }, { - token : "keyword", // command - regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])", - next : "start" - }, { - token : "paren.keyword.operator", - regex : "[[({]" - }, { - token : "paren.keyword.operator", - regex : "[\\])]" - }, { - token : "paren.keyword.operator", - regex : "}", - next : "start" - }, { - token : "nospell." + textClass, - regex : "\\s+" - }, { - token : "nospell." + textClass, - regex : "\\w+" - } - ] - }; -}; - -oop.inherits(TexHighlightRules, TextHighlightRules); - -exports.TexHighlightRules = TexHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-rdoc.js b/util/build-sample-browser/player/vendor/ace/mode-rdoc.js deleted file mode 100644 index 97115202fb..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-rdoc.js +++ /dev/null @@ -1,210 +0,0 @@ -/* - * rdoc.js - * - * Copyright (C) 2009-11 by RStudio, Inc. - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * - */ -ace.define('ace/mode/rdoc', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/rdoc_highlight_rules', 'ace/mode/matching_brace_outdent'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var RDocHighlightRules = require("./rdoc_highlight_rules").RDocHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; - -var Mode = function(suppressHighlighting) { - this.HighlightRules = RDocHighlightRules; - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - this.$id = "ace/mode/rdoc"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/rdoc_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/latex_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var LaTeXHighlightRules = require("./latex_highlight_rules"); - -var RDocHighlightRules = function() { - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "%.*$" - }, { - token : "text", // non-command - regex : "\\\\[$&%#\\{\\}]" - }, { - token : "keyword", // command - regex : "\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b", - next : "nospell" - }, { - token : "keyword", // command - regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])" - }, { - token : "paren.keyword.operator", - regex : "[[({]" - }, { - token : "paren.keyword.operator", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "nospell" : [ - { - token : "comment", - regex : "%.*$", - next : "start" - }, { - token : "nospell.text", // non-command - regex : "\\\\[$&%#\\{\\}]" - }, { - token : "keyword", // command - regex : "\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b" - }, { - token : "keyword", // command - regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])", - next : "start" - }, { - token : "paren.keyword.operator", - regex : "[[({]" - }, { - token : "paren.keyword.operator", - regex : "[\\])]" - }, { - token : "paren.keyword.operator", - regex : "}", - next : "start" - }, { - token : "nospell.text", - regex : "\\s+" - }, { - token : "nospell.text", - regex : "\\w+" - } - ] - }; -}; - -oop.inherits(RDocHighlightRules, TextHighlightRules); - -exports.RDocHighlightRules = RDocHighlightRules; -}); -ace.define('ace/mode/latex_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LatexHighlightRules = function() { - this.$rules = { - "start" : [{ - token : "keyword", - regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "string", - regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$" - }, { - token : "comment", - regex : "%.*$" - }] - }; -}; - -oop.inherits(LatexHighlightRules, TextHighlightRules); - -exports.LatexHighlightRules = LatexHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-rhtml.js b/util/build-sample-browser/player/vendor/ace/mode-rhtml.js deleted file mode 100644 index 5aa556a910..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-rhtml.js +++ /dev/null @@ -1,2715 +0,0 @@ -/* - * rhtml.js - * - * Copyright (C) 2009-11 by RStudio, Inc. - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - */ - -ace.define('ace/mode/rhtml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/rhtml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlMode = require("./html").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; - -var RHtmlHighlightRules = require("./rhtml_highlight_rules").RHtmlHighlightRules; - -var Mode = function(doc, session) { - this.$session = session; - this.HighlightRules = RHtmlHighlightRules; -}; -oop.inherits(Mode, HtmlMode); - -(function() { - this.insertChunkInfo = { - value: "\n", - position: {row: 0, column: 15} - }; - - this.getLanguageMode = function(position) - { - return this.$session.getState(position.row).match(/^r-/) ? 'R' : 'HTML'; - }; - - this.$id = "ace/mode/rhtml"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == ' selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(defaultMode, subModes) { - this.defaultMode = defaultMode; - this.subModes = subModes; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - - this.$getMode = function(state) { - if (typeof state != "string") - state = state[0]; - for (var key in this.subModes) { - if (state.indexOf(key) === 0) - return this.subModes[key]; - } - return null; - }; - - this.$tryMode = function(state, session, foldStyle, row) { - var mode = this.$getMode(state); - return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); - }; - - this.getFoldWidget = function(session, foldStyle, row) { - return ( - this.$tryMode(session.getState(row-1), session, foldStyle, row) || - this.$tryMode(session.getState(row), session, foldStyle, row) || - this.defaultMode.getFoldWidget(session, foldStyle, row) - ); - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var mode = this.$getMode(session.getState(row-1)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.$getMode(session.getState(row)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.defaultMode; - - return mode.getFoldWidgetRange(session, foldStyle, row); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); -ace.define('ace/mode/rhtml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/r_highlight_rules', 'ace/mode/html_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var RHighlightRules = require("./r_highlight_rules").RHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var RHtmlHighlightRules = function() { - HtmlHighlightRules.call(this); - - this.$rules["start"].unshift({ - token: "support.function.codebegin", - regex: "^<" + "!--\\s*begin.rcode\\s*(?:.*)", - next: "r-start" - }); - - this.embedRules(RHighlightRules, "r-", [{ - token: "support.function.codeend", - regex: "^\\s*end.rcode\\s*-->", - next: "start" - }], ["start"]); - - this.normalizeRules(); -}; -oop.inherits(RHtmlHighlightRules, TextHighlightRules); - -exports.RHtmlHighlightRules = RHtmlHighlightRules; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/r_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/tex_highlight_rules'], function(require, exports, module) { - - var oop = require("../lib/oop"); - var lang = require("../lib/lang"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules; - - var RHighlightRules = function() - { - - var keywords = lang.arrayToMap( - ("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass") - .split("|") - ); - - var buildinConstants = lang.arrayToMap( - ("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|" + - "NA_complex_").split("|") - ); - - this.$rules = { - "start" : [ - { - token : "comment.sectionhead", - regex : "#+(?!').*(?:----|====|####)\\s*$" - }, - { - token : "comment", - regex : "#+'", - next : "rd-start" - }, - { - token : "comment", - regex : "#.*$" - }, - { - token : "string", // multi line string start - regex : '["]', - next : "qqstring" - }, - { - token : "string", // multi line string start - regex : "[']", - next : "qstring" - }, - { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+[Li]?\\b" - }, - { - token : "constant.numeric", // explicit integer - regex : "\\d+L\\b" - }, - { - token : "constant.numeric", // number - regex : "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b" - }, - { - token : "constant.numeric", // number with leading decimal - regex : "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b" - }, - { - token : "constant.language.boolean", - regex : "(?:TRUE|FALSE|T|F)\\b" - }, - { - token : "identifier", - regex : "`.*?`" - }, - { - onMatch : function(value) { - if (keywords[value]) - return "keyword"; - else if (buildinConstants[value]) - return "constant.language"; - else if (value == '...' || value.match(/^\.\.\d+$/)) - return "variable.language"; - else - return "identifier"; - }, - regex : "[a-zA-Z.][a-zA-Z0-9._]*\\b" - }, - { - token : "keyword.operator", - regex : "%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:" - }, - { - token : "keyword.operator", // infix operators - regex : "%.*?%" - }, - { - token : "paren.keyword.operator", - regex : "[[({]" - }, - { - token : "paren.keyword.operator", - regex : "[\\])}]" - }, - { - token : "text", - regex : "\\s+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, - { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, - { - token : "string", - regex : '.+' - } - ] - }; - - var rdRules = new TexHighlightRules("comment").getRules(); - for (var i = 0; i < rdRules["start"].length; i++) { - rdRules["start"][i].token += ".virtual-comment"; - } - - this.addRules(rdRules, "rd-"); - this.$rules["rd-start"].unshift({ - token: "text", - regex: "^", - next: "start" - }); - this.$rules["rd-start"].unshift({ - token : "keyword", - regex : "@(?!@)[^ ]*" - }); - this.$rules["rd-start"].unshift({ - token : "comment", - regex : "@@" - }); - this.$rules["rd-start"].push({ - token : "comment", - regex : "[^%\\\\[({\\])}]+" - }); - }; - - oop.inherits(RHighlightRules, TextHighlightRules); - - exports.RHighlightRules = RHighlightRules; -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/tex_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var TexHighlightRules = function(textClass) { - - if (!textClass) - textClass = "text"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "%.*$" - }, { - token : textClass, // non-command - regex : "\\\\[$&%#\\{\\}]" - }, { - token : "keyword", // command - regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b", - next : "nospell" - }, { - token : "keyword", // command - regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])" - }, { - token : "paren.keyword.operator", - regex : "[[({]" - }, { - token : "paren.keyword.operator", - regex : "[\\])}]" - }, { - token : textClass, - regex : "\\s+" - } - ], - "nospell" : [ - { - token : "comment", - regex : "%.*$", - next : "start" - }, { - token : "nospell." + textClass, // non-command - regex : "\\\\[$&%#\\{\\}]" - }, { - token : "keyword", // command - regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b" - }, { - token : "keyword", // command - regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])", - next : "start" - }, { - token : "paren.keyword.operator", - regex : "[[({]" - }, { - token : "paren.keyword.operator", - regex : "[\\])]" - }, { - token : "paren.keyword.operator", - regex : "}", - next : "start" - }, { - token : "nospell." + textClass, - regex : "\\s+" - }, { - token : "nospell." + textClass, - regex : "\\w+" - } - ] - }; -}; - -oop.inherits(TexHighlightRules, TextHighlightRules); - -exports.TexHighlightRules = TexHighlightRules; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-ruby.js b/util/build-sample-browser/player/vendor/ace/mode-ruby.js deleted file mode 100644 index cbe27d46a2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-ruby.js +++ /dev/null @@ -1,444 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/ruby', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ruby_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = RubyHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - - this.lineCommentStart = "#"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/); - var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/); - var startingConditional = line.match(/^\s*(if|else)\s*/) - if (match || startingClassOrMethod || startingDoBlock || startingConditional) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return /^\s+end$/.test(line + input) || /^\s+}$/.test(line + input) || /^\s+else$/.test(line + input); - }; - - this.autoOutdent = function(state, doc, row) { - var indent = this.$getIndent(doc.getLine(row)); - var tab = doc.getTabString(); - if (indent.slice(-tab.length) == tab) - doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); - }; - - this.$id = "ace/mode/ruby"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/ruby_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var constantOtherSymbol = exports.constantOtherSymbol = { - token : "constant.other.symbol.ruby", // symbol - regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?" -}; - -var qString = exports.qString = { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" -}; - -var qqString = exports.qqString = { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' -}; - -var tString = exports.tString = { - token : "string", // backtick string - regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]" -}; - -var constantNumericHex = exports.constantNumericHex = { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b" -}; - -var constantNumericFloat = exports.constantNumericFloat = { - token : "constant.numeric", // float - regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b" -}; - -var RubyHighlightRules = function() { - - var builtinFunctions = ( - "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" + - "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + - "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" + - "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" + - "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" + - "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" + - "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" + - "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" + - "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" + - "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" + - "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" + - "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" + - "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" + - "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" + - "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" + - "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" + - "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" + - "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" + - "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" + - "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" + - "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" + - "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" + - "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" + - "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" + - "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" + - "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" + - "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" + - "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" + - "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" + - "has_many|has_one|belongs_to|has_and_belongs_to_many" - ); - - var keywords = ( - "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" + - "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + - "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield" - ); - - var buildinConstants = ( - "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" + - "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING" - ); - - var builtinVariables = ( - "\$DEBUG|\$defout|\$FILENAME|\$LOAD_PATH|\$SAFE|\$stdin|\$stdout|\$stderr|\$VERBOSE|" + - "$!|root_url|flash|session|cookies|params|request|response|logger|self" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": buildinConstants, - "variable.language": builtinVariables, - "support.function": builtinFunctions, - "invalid.deprecated": "debugger" // TODO is this a remnant from js mode? - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "#.*$" - }, { - token : "comment", // multi line comment - regex : "^=begin(?:$|\\s.*$)", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, - - qString, - qqString, - tString, - - { - token : "text", // namespaces aren't symbols - regex : "::" - }, { - token : "variable.instance", // instance variable - regex : "@{1,2}[a-zA-Z_\\d]+" - }, { - token : "support.class", // class name - regex : "[A-Z][a-zA-Z_\\d]+" - }, - - constantOtherSymbol, - constantNumericHex, - constantNumericFloat, - - { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "punctuation.separator.key-value", - regex : "=>" - }, { - stateName: "heredoc", - onMatch : function(value, currentState, stack) { - var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; - var tokens = value.split(this.splitRegex); - stack.push(next, tokens[3]); - return [ - {type:"constant", value: tokens[1]}, - {type:"string", value: tokens[2]}, - {type:"support.class", value: tokens[3]}, - {type:"string", value: tokens[4]} - ]; - }, - regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", - rules: { - heredoc: [{ - onMatch: function(value, currentState, stack) { - if (value === stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack[0] || "start"; - return "support.class"; - } - this.next = ""; - return "string"; - }, - regex: ".*$", - next: "start" - }], - indentedHeredoc: [{ - token: "string", - regex: "^ +" - }, { - onMatch: function(value, currentState, stack) { - if (value === stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack[0] || "start"; - return "support.class"; - } - this.next = ""; - return "string"; - }, - regex: ".*$", - next: "start" - }] - } - }, { - regex : "$", - token : "empty", - next : function(currentState, stack) { - if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") - return stack[0]; - return currentState; - } - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : "^=end(?:$|\\s.*$)", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; - - this.normalizeRules(); -}; - -oop.inherits(RubyHighlightRules, TextHighlightRules); - -exports.RubyHighlightRules = RubyHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-rust.js b/util/build-sample-browser/player/vendor/ace/mode-rust.js deleted file mode 100644 index 05afb2ed52..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-rust.js +++ /dev/null @@ -1,245 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/rust', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/rust_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var RustHighlightRules = require("./rust_highlight_rules").RustHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = RustHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "/\\*"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/rust"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/rust_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var RustHighlightRules = function() { - - this.$rules = { start: - [ { token: 'variable.other.source.rust', - regex: '\'[a-zA-Z_][a-zA-Z0-9_]*[^\\\']' }, - { token: 'string.quoted.single.source.rust', - regex: '\'', - push: - [ { token: 'string.quoted.single.source.rust', - regex: '\'', - next: 'pop' }, - { include: '#rust_escaped_character' }, - { defaultToken: 'string.quoted.single.source.rust' } ] }, - { token: 'string.quoted.double.source.rust', - regex: '"', - push: - [ { token: 'string.quoted.double.source.rust', - regex: '"', - next: 'pop' }, - { include: '#rust_escaped_character' }, - { defaultToken: 'string.quoted.double.source.rust' } ] }, - { token: [ 'keyword.source.rust', 'meta.function.source.rust', - 'entity.name.function.source.rust', 'meta.function.source.rust' ], - regex: '\\b(fn)(\\s+)([a-zA-Z_][a-zA-Z0-9_][\\w\\:,+ \\\'<>]*)(\\s*\\()' }, - { token: 'support.constant', regex: '\\b[a-zA-Z_][\\w\\d]*::' }, - { token: 'keyword.source.rust', - regex: '\\b(?:as|assert|break|claim|const|copy|Copy|do|drop|else|extern|fail|for|if|impl|in|let|log|loop|match|mod|module|move|mut|Owned|priv|pub|pure|ref|return|unchecked|unsafe|use|while|mod|Send|static|trait|class|struct|enum|type)\\b' }, - { token: 'storage.type.source.rust', - regex: '\\b(?:Self|m32|m64|m128|f80|f16|f128|int|uint|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|option|either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b' }, - { token: 'variable.language.source.rust', regex: '\\bself\\b' }, - { token: 'keyword.operator', - regex: '!|\\$|\\*|\\-\\-|\\-|\\+\\+|\\+|-->|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|/=|%=|\\+=|\\-=|&=|\\^=|,|;' }, - { token: 'constant.language.source.rust', - regex: '\\b(?:true|false|Some|None|Left|Right|Ok|Err)\\b' }, - { token: 'support.constant.source.rust', - regex: '\\b(?:EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\\b' }, - { token: 'meta.preprocessor.source.rust', - regex: '\\b\\w\\(\\w\\)*!|#\\[[\\w=\\(\\)_]+\\]\\b' }, - { token: 'constant.numeric.integer.source.rust', - regex: '\\b(?:[0-9][0-9_]*|[0-9][0-9_]*(?:u|u8|u16|u32|u64)|[0-9][0-9_]*(?:i|i8|i16|i32|i64))\\b' }, - { token: 'constant.numeric.hex.source.rust', - regex: '\\b(?:0x[a-fA-F0-9_]+|0x[a-fA-F0-9_]+(?:u|u8|u16|u32|u64)|0x[a-fA-F0-9_]+(?:i|i8|i16|i32|i64))\\b' }, - { token: 'constant.numeric.binary.source.rust', - regex: '\\b(?:0b[01_]+|0b[01_]+(?:u|u8|u16|u32|u64)|0b[01_]+(?:i|i8|i16|i32|i64))\\b' }, - { token: 'constant.numeric.float.source.rust', - regex: '[0-9][0-9_]*(?:f32|f64|f)|[0-9][0-9_]*[eE][+-]=[0-9_]+|[0-9][0-9_]*[eE][+-]=[0-9_]+(?:f32|f64|f)|[0-9][0-9_]*\\.[0-9_]+|[0-9][0-9_]*\\.[0-9_]+(?:f32|f64|f)|[0-9][0-9_]*\\.[0-9_]+%[eE][+-]=[0-9_]+|[0-9][0-9_]*\\.[0-9_]+%[eE][+-]=[0-9_]+(?:f32|f64|f)' }, - { token: 'comment.line.documentation.source.rust', - regex: '//!.*$', - push_: - [ { token: 'comment.line.documentation.source.rust', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.documentation.source.rust' } ] }, - { token: 'comment.line.double-dash.source.rust', - regex: '//.*$', - push_: - [ { token: 'comment.line.double-dash.source.rust', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-dash.source.rust' } ] }, - { token: 'comment.block.source.rust', - regex: '/\\*', - push: - [ { token: 'comment.block.source.rust', - regex: '\\*/', - next: 'pop' }, - { defaultToken: 'comment.block.source.rust' } ] } ], - '#rust_escaped_character': - [ { token: 'constant.character.escape.source.rust', - regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)' } ] } - - this.normalizeRules(); -}; - -RustHighlightRules.metaData = { fileTypes: [ 'rs', 'rc' ], - foldingStartMarker: '^.*\\bfn\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$', - foldingStopMarker: '^\\s*\\}', - name: 'Rust', - scopeName: 'source.rust' } - - -oop.inherits(RustHighlightRules, TextHighlightRules); - -exports.RustHighlightRules = RustHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-sass.js b/util/build-sample-browser/player/vendor/ace/mode-sass.js deleted file mode 100644 index b492739273..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-sass.js +++ /dev/null @@ -1,443 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/sass', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/sass_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var SassHighlightRules = require("./sass_highlight_rules").SassHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = SassHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.$id = "ace/mode/sass"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/sass_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/scss_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules; - -var SassHighlightRules = function() { - ScssHighlightRules.call(this); - var start = this.$rules.start; - if (start[1].token == "comment") { - start.splice(1, 1, { - onMatch: function(value, currentState, stack) { - stack.unshift(this.next, -1, value.length - 2, currentState); - return "comment"; - }, - regex: /^\s*\/\*/, - next: "comment" - }, { - token: "error.invalid", - regex: "/\\*|[{;}]" - }, { - token: "support.type", - regex: /^\s*:[\w\-]+\s/ - }); - - this.$rules.comment = [ - {regex: /^\s*/, onMatch: function(value, currentState, stack) { - if (stack[1] === -1) - stack[1] = Math.max(stack[2], value.length - 1); - if (value.length <= stack[1]) {stack.shift();stack.shift();stack.shift(); - this.next = stack.shift(); - return "text"; - } else { - this.next = ""; - return "comment"; - } - }, next: "start"}, - {defaultToken: "comment"} - ] - } -}; - -oop.inherits(SassHighlightRules, ScssHighlightRules); - -exports.SassHighlightRules = SassHighlightRules; - -}); - -ace.define('ace/mode/scss_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ScssHighlightRules = function() { - - var properties = lang.arrayToMap( (function () { - - var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); - - var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + - "background-size|binding|border-bottom-colors|border-left-colors|" + - "border-right-colors|border-top-colors|border-end|border-end-color|" + - "border-end-style|border-end-width|border-image|border-start|" + - "border-start-color|border-start-style|border-start-width|box-align|" + - "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + - "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + - "column-rule-width|column-rule-style|column-rule-color|float-edge|" + - "font-feature-settings|font-language-override|force-broken-image-icon|" + - "image-region|margin-end|margin-start|opacity|outline|outline-color|" + - "outline-offset|outline-radius|outline-radius-bottomleft|" + - "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + - "outline-style|outline-width|padding-end|padding-start|stack-sizing|" + - "tab-size|text-blink|text-decoration-color|text-decoration-line|" + - "text-decoration-style|transform|transform-origin|transition|" + - "transition-delay|transition-duration|transition-property|" + - "transition-timing-function|user-focus|user-input|user-modify|user-select|" + - "window-shadow|border-radius").split("|"); - - var properties = ("azimuth|background-attachment|background-color|background-image|" + - "background-position|background-repeat|background|border-bottom-color|" + - "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + - "border-color|border-left-color|border-left-style|border-left-width|" + - "border-left|border-right-color|border-right-style|border-right-width|" + - "border-right|border-spacing|border-style|border-top-color|" + - "border-top-style|border-top-width|border-top|border-width|border|bottom|" + - "box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + - "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + - "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + - "font-stretch|font-style|font-variant|font-weight|font|height|left|" + - "letter-spacing|line-height|list-style-image|list-style-position|" + - "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + - "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + - "min-width|opacity|orphans|outline-color|" + - "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + - "padding-left|padding-right|padding-top|padding|page-break-after|" + - "page-break-before|page-break-inside|page|pause-after|pause-before|" + - "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + - "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + - "stress|table-layout|text-align|text-decoration|text-indent|" + - "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + - "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + - "z-index").split("|"); - var ret = []; - for (var i=0, ln=browserPrefix.length; i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - }, { - caseInsensitive: true - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ] - }; -}; - -oop.inherits(ScssHighlightRules, TextHighlightRules); - -exports.ScssHighlightRules = ScssHighlightRules; - -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-scad.js b/util/build-sample-browser/player/vendor/ace/mode-scad.js deleted file mode 100644 index 90ba0d10a4..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-scad.js +++ /dev/null @@ -1,747 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/scad', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/scad_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var scadHighlightRules = require("./scad_highlight_rules").scadHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = scadHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/scad"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/scad_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var scadHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": "module|if|else|for", - "constant.language": "NULL" - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant", // - regex : "<[a-zA-Z0-9.]+>" - }, { - token : "keyword", // pre-compiler directivs - regex : "(?:use|include)" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(scadHighlightRules, TextHighlightRules); - -exports.scadHighlightRules = scadHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-scala.js b/util/build-sample-browser/player/vendor/ace/mode-scala.js deleted file mode 100644 index 7e1ed171a5..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-scala.js +++ /dev/null @@ -1,1113 +0,0 @@ -ace.define('ace/mode/scala', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/scala_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var JavaScriptMode = require("./javascript").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ScalaHighlightRules = require("./scala_highlight_rules").ScalaHighlightRules; - -var Mode = function() { - JavaScriptMode.call(this); - - this.HighlightRules = ScalaHighlightRules; -}; -oop.inherits(Mode, JavaScriptMode); - -(function() { - - this.createWorker = function(session) { - return null; - }; - - this.$id = "ace/mode/scala"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); -ace.define('ace/mode/scala_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ScalaHighlightRules = function() { - var keywords = ( - "case|default|do|else|for|if|match|while|throw|return|try|catch|finally|yield|" + - "abstract|class|def|extends|final|forSome|implicit|implicits|import|lazy|new|object|" + - "override|package|private|protected|sealed|super|this|trait|type|val|var|with" - ); - - var buildinConstants = ("true|false"); - - var langClasses = ( - "AbstractMethodError|AssertionError|ClassCircularityError|"+ - "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ - "ExceptionInInitializerError|IllegalAccessError|"+ - "IllegalThreadStateException|InstantiationError|InternalError|"+ - - "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ - "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ - "SuppressWarnings|TypeNotPresentException|UnknownError|"+ - "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ - "InstantiationException|IndexOutOfBoundsException|"+ - "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ - "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ - "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ - "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ - "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ - "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ - "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ - "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ - "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ - "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ - "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ - "ArrayStoreException|ClassCastException|LinkageError|"+ - "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ - "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ - "Cloneable|Class|CharSequence|Comparable|String|Object|" + - "Unit|Any|AnyVal|AnyRef|Null|ScalaObject|Singleton|Seq|Iterable|List|" + - "Option|Array|Char|Byte|Short|Int|Long|Nothing" - - - ); - - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": keywords, - "support.function": langClasses, - "constant.language": buildinConstants - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", - regex : '"""', - next : "tstring" - }, { - token : "string", - regex : '"(?=.)', // " strings can't span multiple lines - next : "string" - }, { - token : "symbol.constant", // single line - regex : "'[\\w\\d_]+" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "string" : [ - { - token : "escape", - regex : '\\\\"' - }, { - token : "string", - regex : '"', - next : "start" - }, { - token : "string.invalid", - regex : '[^"\\\\]*$', - next : "start" - }, { - token : "string", - regex : '[^"\\\\]+' - } - ], - "tstring" : [ - { - token : "string", // closing comment - regex : '"{3,5}', - next : "start" - }, { - token : "string", // comment spanning whole line - regex : ".+?" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(ScalaHighlightRules, TextHighlightRules); - -exports.ScalaHighlightRules = ScalaHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-scheme.js b/util/build-sample-browser/player/vendor/ace/mode-scheme.js deleted file mode 100644 index 55f648a5e8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-scheme.js +++ /dev/null @@ -1,143 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * NalaGinrut@gmail.com - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/scheme', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/scheme_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var SchemeHighlightRules = require("./scheme_highlight_rules").SchemeHighlightRules; - -var Mode = function() { - this.HighlightRules = SchemeHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ";"; - - this.$id = "ace/mode/scheme"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/scheme_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var SchemeHighlightRules = function() { - var keywordControl = "case|do|let|loop|if|else|when"; - var keywordOperator = "eq?|eqv?|equal?|and|or|not|null?"; - var constantLanguage = "#t|#f"; - var supportFunctions = "cons|car|cdr|cond|lambda|lambda*|syntax-rules|format|set!|quote|eval|append|list|list?|member?|load"; - - var keywordMapper = this.createKeywordMapper({ - "keyword.control": keywordControl, - "keyword.operator": keywordOperator, - "constant.language": constantLanguage, - "support.function": supportFunctions - }, "identifier", true); - - this.$rules = - { - "start": [ - { - token : "comment", - regex : ";.*$" - }, - { - "token": ["storage.type.function-type.scheme", "text", "entity.name.function.scheme"], - "regex": "(?:\\b(?:(define|define-syntax|define-macro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)" - }, - { - "token": "punctuation.definition.constant.character.scheme", - "regex": "#:\\S+" - }, - { - "token": ["punctuation.definition.variable.scheme", "variable.other.global.scheme", "punctuation.definition.variable.scheme"], - "regex": "(\\*)(\\S*)(\\*)" - }, - { - "token" : "constant.numeric", // hex - "regex" : "#[xXoObB][0-9a-fA-F]+" - }, - { - "token" : "constant.numeric", // float - "regex" : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?" - }, - { - "token" : keywordMapper, - "regex" : "[a-zA-Z_#][a-zA-Z0-9_\\-\\?\\!\\*]*" - }, - { - "token" : "string", - "regex" : '"(?=.)', - "next" : "qqstring" - } - ], - "qqstring": [ - { - "token": "constant.character.escape.scheme", - "regex": "\\\\." - }, - { - "token" : "string", - "regex" : '[^"\\\\]+', - "merge" : true - }, { - "token" : "string", - "regex" : "\\\\$", - "next" : "qqstring", - "merge" : true - }, { - "token" : "string", - "regex" : '"|$', - "next" : "start", - "merge" : true - } - ] -} - -}; - -oop.inherits(SchemeHighlightRules, TextHighlightRules); - -exports.SchemeHighlightRules = SchemeHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-scss.js b/util/build-sample-browser/player/vendor/ace/mode-scss.js deleted file mode 100644 index d0acd29067..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-scss.js +++ /dev/null @@ -1,909 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/scss', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/scss_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ScssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/scss"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/scss_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ScssHighlightRules = function() { - - var properties = lang.arrayToMap( (function () { - - var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); - - var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + - "background-size|binding|border-bottom-colors|border-left-colors|" + - "border-right-colors|border-top-colors|border-end|border-end-color|" + - "border-end-style|border-end-width|border-image|border-start|" + - "border-start-color|border-start-style|border-start-width|box-align|" + - "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + - "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + - "column-rule-width|column-rule-style|column-rule-color|float-edge|" + - "font-feature-settings|font-language-override|force-broken-image-icon|" + - "image-region|margin-end|margin-start|opacity|outline|outline-color|" + - "outline-offset|outline-radius|outline-radius-bottomleft|" + - "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + - "outline-style|outline-width|padding-end|padding-start|stack-sizing|" + - "tab-size|text-blink|text-decoration-color|text-decoration-line|" + - "text-decoration-style|transform|transform-origin|transition|" + - "transition-delay|transition-duration|transition-property|" + - "transition-timing-function|user-focus|user-input|user-modify|user-select|" + - "window-shadow|border-radius").split("|"); - - var properties = ("azimuth|background-attachment|background-color|background-image|" + - "background-position|background-repeat|background|border-bottom-color|" + - "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + - "border-color|border-left-color|border-left-style|border-left-width|" + - "border-left|border-right-color|border-right-style|border-right-width|" + - "border-right|border-spacing|border-style|border-top-color|" + - "border-top-style|border-top-width|border-top|border-width|border|bottom|" + - "box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + - "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + - "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + - "font-stretch|font-style|font-variant|font-weight|font|height|left|" + - "letter-spacing|line-height|list-style-image|list-style-position|" + - "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + - "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + - "min-width|opacity|orphans|outline-color|" + - "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + - "padding-left|padding-right|padding-top|padding|page-break-after|" + - "page-break-before|page-break-inside|page|pause-after|pause-before|" + - "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + - "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + - "stress|table-layout|text-align|text-decoration|text-indent|" + - "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + - "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + - "z-index").split("|"); - var ret = []; - for (var i=0, ln=browserPrefix.length; i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - }, { - caseInsensitive: true - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ] - }; -}; - -oop.inherits(ScssHighlightRules, TextHighlightRules); - -exports.ScssHighlightRules = ScssHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-sh.js b/util/build-sample-browser/player/vendor/ace/mode-sh.js deleted file mode 100644 index 3ef412cd39..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-sh.js +++ /dev/null @@ -1,320 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/sh', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/sh_highlight_rules', 'ace/range', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules; -var Range = require("../range").Range; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ShHighlightRules; - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - - this.lineCommentStart = "#"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[\:]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - var outdents = { - "pass": 1, - "return": 1, - "raise": 1, - "break": 1, - "continue": 1 - }; - - this.checkOutdent = function(state, line, input) { - if (input !== "\r\n" && input !== "\r" && input !== "\n") - return false; - - var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; - - if (!tokens) - return false; - do { - var last = tokens.pop(); - } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); - - if (!last) - return false; - - return (last.type == "keyword" && outdents[last.value]); - }; - - this.autoOutdent = function(state, doc, row) { - - row += 1; - var indent = this.$getIndent(doc.getLine(row)); - var tab = doc.getTabString(); - if (indent.slice(-tab.length) == tab) - doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); - }; - - this.$id = "ace/mode/sh"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/sh_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var reservedKeywords = exports.reservedKeywords = ( - '!|{|}|case|do|done|elif|else|'+ - 'esac|fi|for|if|in|then|until|while|'+ - '&|;|export|local|read|typeset|unset|'+ - 'elif|select|set' - ); - -var languageConstructs = exports.languageConstructs = ( - '[|]|alias|bg|bind|break|builtin|'+ - 'cd|command|compgen|complete|continue|'+ - 'dirs|disown|echo|enable|eval|exec|'+ - 'exit|fc|fg|getopts|hash|help|history|'+ - 'jobs|kill|let|logout|popd|printf|pushd|'+ - 'pwd|return|set|shift|shopt|source|'+ - 'suspend|test|times|trap|type|ulimit|'+ - 'umask|unalias|wait' -); - -var ShHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "keyword": reservedKeywords, - "support.function.builtin": languageConstructs, - "invalid.deprecated": "debugger" - }, "identifier"); - - var integer = "(?:(?:[1-9]\\d*)|(?:0))"; - - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")"; - var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; - var fileDescriptor = "(?:&" + intPart + ")"; - - var variableName = "[a-zA-Z][a-zA-Z0-9_]*"; - var variable = "(?:(?:\\$" + variableName + ")|(?:" + variableName + "=))"; - - var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))"; - - var func = "(?:" + variableName + "\\s*\\(\\))"; - - this.$rules = { - "start" : [{ - token : "constant", - regex : /\\./ - }, { - token : ["text", "comment"], - regex : /(^|\s)(#.*)$/ - }, { - token : "string", - regex : '"', - push : [{ - token : "constant.language.escape", - regex : /\\(?:[$abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/ - }, { - token : "constant", - regex : /\$\w+/ - }, { - token : "string", - regex : '"', - next: "pop" - }, { - defaultToken: "string" - }] - }, { - token : "variable.language", - regex : builtinVariable - }, { - token : "variable", - regex : variable - }, { - token : "support.function", - regex : func - }, { - token : "support.function", - regex : fileDescriptor - }, { - token : "string", // ' string - start : "'", end : "'" - }, { - token : "constant.numeric", // float - regex : floatNumber - }, { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=" - }, { - token : "paren.lparen", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen", - regex : "[\\]\\)\\}]" - } ] - }; - - this.normalizeRules(); -}; - -oop.inherits(ShHighlightRules, TextHighlightRules); - -exports.ShHighlightRules = ShHighlightRules; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-sjs.js b/util/build-sample-browser/player/vendor/ace/mode-sjs.js deleted file mode 100644 index 6870a17aa1..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-sjs.js +++ /dev/null @@ -1,1184 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/sjs', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/sjs_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var JSMode = require("./javascript").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var SJSHighlightRules = require("./sjs_highlight_rules").SJSHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - var highlighter = new SJSHighlightRules(); - - this.$tokenizer = new Tokenizer(highlighter.getRules()); - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.$keywordList = highlighter.$keywordList; - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, JSMode); -(function() { - this.createWorker = function(session) { - return null; - } - this.$id = "ace/mode/sjs"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/sjs_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var SJSHighlightRules = function() { - var parent = new JavaScriptHighlightRules(); - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - var contextAware = function(f) { - f.isContextAware = true; - return f; - }; - - var ctxBegin = function(opts) { - return { - token: opts.token, - regex: opts.regex, - next: contextAware(function(currentState, stack) { - if (stack.length === 0) - stack.unshift(currentState); - stack.unshift(opts.next); - return opts.next; - }), - }; - }; - - var ctxEnd = function(opts) { - return { - token: opts.token, - regex: opts.regex, - next: contextAware(function(currentState, stack) { - stack.shift(); - return stack[0] || "start"; - }), - }; - }; - - this.$rules = parent.$rules; - this.$rules.no_regex = [ - { - token: "keyword", - regex: "(waitfor|or|and|collapse|spawn|retract)\\b" - }, - { - token: "keyword.operator", - regex: "(->|=>|\\.\\.)" - }, - { - token: "variable.language", - regex: "(hold|default)\\b" - }, - ctxBegin({ - token: "string", - regex: "`", - next: "bstring" - }), - ctxBegin({ - token: "string", - regex: '"', - next: "qqstring" - }), - ctxBegin({ - token: "string", - regex: '"', - next: "qqstring" - }), - { - token: ["paren.lparen", "text", "paren.rparen"], - regex: "(\\{)(\\s*)(\\|)", - next: "block_arguments", - } - - ].concat(this.$rules.no_regex); - - this.$rules.block_arguments = [ - { - token: "paren.rparen", - regex: "\\|", - next: "no_regex", - } - ].concat(this.$rules.function_arguments); - - this.$rules.bstring = [ - { - token : "constant.language.escape", - regex : escapedRe - }, - { - token : "string", - regex : "\\\\$", - next: "bstring" - }, - ctxBegin({ - token : "paren.lparen", - regex : "\\$\\{", - next: "string_interp" - }), - ctxBegin({ - token : "paren.lparen", - regex : "\\$", - next: "bstring_interp_single" - }), - ctxEnd({ - token : "string", - regex : "`", - }), - { - defaultToken: "string" - } - ]; - - this.$rules.qqstring = [ - { - token : "constant.language.escape", - regex : escapedRe - }, - { - token : "string", - regex : "\\\\$", - next: "qqstring", - }, - ctxBegin({ - token : "paren.lparen", - regex : "#\\{", - next: "string_interp" - }), - ctxEnd({ - token : "string", - regex : '"', - }), - { - defaultToken: "string" - } - ]; - var embeddableRules = []; - for (var i=0; i indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/smarty_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - -var SmartyHighlightRules = function() { - HtmlHighlightRules.call(this); - var smartyRules = { start: - [ { include: '#comments' }, - { include: '#blocks' } ], - '#blocks': - [ { token: 'punctuation.section.embedded.begin.smarty', - regex: '\\{%?', - push: - [ { token: 'punctuation.section.embedded.end.smarty', - regex: '%?\\}', - next: 'pop' }, - { include: '#strings' }, - { include: '#variables' }, - { include: '#lang' }, - { defaultToken: 'source.smarty' } ] } ], - '#comments': - [ { token: - [ 'punctuation.definition.comment.smarty', - 'comment.block.smarty' ], - regex: '(\\{%?)(\\*)', - push: - [ { token: 'comment.block.smarty', regex: '\\*%?\\}', next: 'pop' }, - { defaultToken: 'comment.block.smarty' } ] } ], - '#lang': - [ { token: 'keyword.operator.smarty', - regex: '(?:!=|!|<=|>=|<|>|===|==|%|&&|\\|\\|)|\\b(?:and|or|eq|neq|ne|gte|gt|ge|lte|lt|le|not|mod)\\b' }, - { token: 'constant.language.smarty', - regex: '\\b(?:TRUE|FALSE|true|false)\\b' }, - { token: 'keyword.control.smarty', - regex: '\\b(?:if|else|elseif|foreach|foreachelse|section|switch|case|break|default)\\b' }, - { token: 'variable.parameter.smarty', regex: '\\b[a-zA-Z]+=' }, - { token: 'support.function.built-in.smarty', - regex: '\\b(?:capture|config_load|counter|cycle|debug|eval|fetch|include_php|include|insert|literal|math|strip|rdelim|ldelim|assign|constant|block|html_[a-z_]*)\\b' }, - { token: 'support.function.variable-modifier.smarty', - regex: '\\|(?:capitalize|cat|count_characters|count_paragraphs|count_sentences|count_words|date_format|default|escape|indent|lower|nl2br|regex_replace|replace|spacify|string_format|strip_tags|strip|truncate|upper|wordwrap)' } ], - '#strings': - [ { token: 'punctuation.definition.string.begin.smarty', - regex: '\'', - push: - [ { token: 'punctuation.definition.string.end.smarty', - regex: '\'', - next: 'pop' }, - { token: 'constant.character.escape.smarty', regex: '\\\\.' }, - { defaultToken: 'string.quoted.single.smarty' } ] }, - { token: 'punctuation.definition.string.begin.smarty', - regex: '"', - push: - [ { token: 'punctuation.definition.string.end.smarty', - regex: '"', - next: 'pop' }, - { token: 'constant.character.escape.smarty', regex: '\\\\.' }, - { defaultToken: 'string.quoted.double.smarty' } ] } ], - '#variables': - [ { token: - [ 'punctuation.definition.variable.smarty', - 'variable.other.global.smarty' ], - regex: '\\b(\\$)(Smarty\\.)' }, - { token: - [ 'punctuation.definition.variable.smarty', - 'variable.other.smarty' ], - regex: '(\\$)([a-zA-Z_][a-zA-Z0-9_]*)\\b' }, - { token: [ 'keyword.operator.smarty', 'variable.other.property.smarty' ], - regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)\\b' }, - { token: - [ 'keyword.operator.smarty', - 'meta.function-call.object.smarty', - 'punctuation.definition.variable.smarty', - 'variable.other.smarty', - 'punctuation.definition.variable.smarty' ], - regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)(\\()(.*?)(\\))' } ] } - - var smartyStart = smartyRules.start; - - ["start", "qqstring_inner", "qstring_inner", "attributes", "cdata"].forEach(function(x) { - this.$rules[x].unshift.apply(this.$rules[x], smartyStart); - }, this); - - Object.keys(smartyRules).forEach(function(x) { - if (!this.$rules[x]) - this.$rules[x] = smartyRules[x]; - }, this); - - this.normalizeRules(); -}; - -SmartyHighlightRules.metaData = { fileTypes: [ 'tpl' ], - foldingStartMarker: '\\{%?', - foldingStopMarker: '%?\\}', - name: 'Smarty', - scopeName: 'text.html.smarty' } - - -oop.inherits(SmartyHighlightRules, HtmlHighlightRules); - -exports.SmartyHighlightRules = SmartyHighlightRules; -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-snippets.js b/util/build-sample-browser/player/vendor/ace/mode-snippets.js deleted file mode 100644 index eec90b8937..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-snippets.js +++ /dev/null @@ -1,198 +0,0 @@ -ace.define('ace/mode/snippets', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var SnippetHighlightRules = function() { - - var builtins = "SELECTION|CURRENT_WORD|SELECTED_TEXT|CURRENT_LINE|LINE_INDEX|" + - "LINE_NUMBER|SOFT_TABS|TAB_SIZE|FILENAME|FILEPATH|FULLNAME"; - - this.$rules = { - "start" : [ - {token:"constant.language.escape", regex: /\\[\$}`\\]/}, - {token:"keyword", regex: "\\$(?:TM_)?(?:" + builtins + ")\\b"}, - {token:"variable", regex: "\\$\\w+"}, - {onMatch: function(value, state, stack) { - if (stack[1]) - stack[1]++; - else - stack.unshift(state, 1); - return this.tokenName; - }, tokenName: "markup.list", regex: "\\${", next: "varDecl"}, - {onMatch: function(value, state, stack) { - if (!stack[1]) - return "text"; - stack[1]--; - if (!stack[1]) - stack.splice(0,2); - return this.tokenName; - }, tokenName: "markup.list", regex: "}"}, - {token: "doc.comment", regex:/^\${2}-{5,}$/} - ], - "varDecl" : [ - {regex: /\d+\b/, token: "constant.numeric"}, - {token:"keyword", regex: "(?:TM_)?(?:" + builtins + ")\\b"}, - {token:"variable", regex: "\\w+"}, - {regex: /:/, token: "punctuation.operator", next: "start"}, - {regex: /\//, token: "string.regex", next: "regexp"}, - {regex: "", next: "start"} - ], - "regexp" : [ - {regex: /\\./, token: "escape"}, - {regex: /\[/, token: "regex.start", next: "charClass"}, - {regex: "/", token: "string.regex", next: "format"}, - {"token": "string.regex", regex:"."} - ], - charClass : [ - {regex: "\\.", token: "escape"}, - {regex: "\\]", token: "regex.end", next: "regexp"}, - {"token": "string.regex", regex:"."} - ], - "format" : [ - {regex: /\\[ulULE]/, token: "keyword"}, - {regex: /\$\d+/, token: "variable"}, - {regex: "/[gim]*:?", token: "string.regex", next: "start"}, - {"token": "string", regex:"."} - ] - }; -}; -oop.inherits(SnippetHighlightRules, TextHighlightRules); - -exports.SnippetHighlightRules = SnippetHighlightRules; - -var SnippetGroupHighlightRules = function() { - this.$rules = { - "start" : [ - {token: "text", regex: "^\\t", next: "sn-start"}, - {token:"invalid", regex: /^ \s*/}, - {token:"comment", regex: /^#.*/}, - {token:"constant.language.escape", regex: "^regex ", next: "regex"}, - {token:"constant.language.escape", regex: "^(trigger|endTrigger|name|snippet|guard|endGuard|tabTrigger|key)\\b"} - ], - "regex" : [ - {token:"text", regex: "\\."}, - {token:"keyword", regex: "/"}, - {token:"empty", regex: "$", next: "start"} - ] - }; - this.embedRules(SnippetHighlightRules, "sn-", [ - {token: "text", regex: "^\\t", next: "sn-start"}, - {onMatch: function(value, state, stack) { - stack.splice(stack.length); - return this.tokenName; - }, tokenName: "text", regex: "^(?!\t)", next: "start"} - ]) - -}; - -oop.inherits(SnippetGroupHighlightRules, TextHighlightRules); - -exports.SnippetGroupHighlightRules = SnippetGroupHighlightRules; - -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = SnippetGroupHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.$indentWithTabs = true; - this.$id = "ace/mode/snippets"; -}).call(Mode.prototype); -exports.Mode = Mode; - - -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-soy_template.js b/util/build-sample-browser/player/vendor/ace/mode-soy_template.js deleted file mode 100644 index b9efddc568..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-soy_template.js +++ /dev/null @@ -1,2759 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/soy_template', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/soy_template_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlMode = require("./html").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var SoyTemplateHighlightRules = require("./soy_template_highlight_rules").SoyTemplateHighlightRules; - -var Mode = function() { - HtmlMode.call(this); - this.HighlightRules = SoyTemplateHighlightRules; -}; -oop.inherits(Mode, HtmlMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/soy_template"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { - - -var TokenIterator = require("../token_iterator").TokenIterator; - -var commonAttributes = [ - "accesskey", - "class", - "contenteditable", - "contextmenu", - "dir", - "draggable", - "dropzone", - "hidden", - "id", - "lang", - "spellcheck", - "style", - "tabindex", - "title", - "translate" -]; - -var eventAttributes = [ - "onabort", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncuechange", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onscroll", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "onvolumechange", - "onwaiting" -]; - -var globalAttributes = commonAttributes.concat(eventAttributes); - -var attributeMap = { - "html": ["manifest"], - "head": [], - "title": [], - "base": ["href", "target"], - "link": ["href", "hreflang", "rel", "media", "type", "sizes"], - "meta": ["http-equiv", "name", "content", "charset"], - "style": ["type", "media", "scoped"], - "script": ["charset", "type", "src", "defer", "async"], - "noscript": ["href"], - "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], - "section": [], - "nav": [], - "article": ["pubdate"], - "aside": [], - "h1": [], - "h2": [], - "h3": [], - "h4": [], - "h5": [], - "h6": [], - "header": [], - "footer": [], - "address": [], - "main": [], - "p": [], - "hr": [], - "pre": [], - "blockquote": ["cite"], - "ol": ["start", "reversed"], - "ul": [], - "li": ["value"], - "dl": [], - "dt": [], - "dd": [], - "figure": [], - "figcaption": [], - "div": [], - "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], - "em": [], - "strong": [], - "small": [], - "s": [], - "cite": [], - "q": ["cite"], - "dfn": [], - "abbr": [], - "data": [], - "time": ["datetime"], - "code": [], - "var": [], - "samp": [], - "kbd": [], - "sub": [], - "sup": [], - "i": [], - "b": [], - "u": [], - "mark": [], - "ruby": [], - "rt": [], - "rp": [], - "bdi": [], - "bdo": [], - "span": [], - "br": [], - "wbr": [], - "ins": ["cite", "datetime"], - "del": ["cite", "datetime"], - "img": ["alt", "src", "height", "width", "usemap", "ismap"], - "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], - "embed": ["src", "height", "width", "type"], - "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], - "param": ["name", "value"], - "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], - "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], - "source": ["src", "type", "media"], - "track": ["kind", "src", "srclang", "label", "default"], - "canvas": ["width", "height"], - "map": ["name"], - "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], - "svg": [], - "math": [], - "table": ["summary"], - "caption": [], - "colgroup": ["span"], - "col": ["span"], - "tbody": [], - "thead": [], - "tfoot": [], - "tr": [], - "td": ["headers", "rowspan", "colspan"], - "th": ["headers", "rowspan", "colspan", "scope"], - "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], - "fieldset": ["disabled", "form", "name"], - "legend": [], - "label": ["form", "for"], - "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], - "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], - "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], - "datalist": [], - "optgroup": ["disabled", "label"], - "option": ["disabled", "selected", "label", "value"], - "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], - "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], - "output": ["for", "form", "name"], - "progress": ["value", "max"], - "meter": ["value", "min", "max", "low", "high", "optimum"], - "details": ["open"], - "summary": [], - "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], - "menu": ["type", "label"], - "dialog": ["open"] -}; - -var allElements = Object.keys(attributeMap); - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); -} - -function findTagName(session, pos) { - var iterator = new TokenIterator(session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); - } - if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) - return token.value; -} - -var HtmlCompletions = function() { - -}; - -(function() { - - this.getCompletions = function(state, session, pos, prefix) { - var token = session.getTokenAt(pos.row, pos.column); - - if (!token) - return []; - if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) - return this.getTagCompletions(state, session, pos, prefix); - if (hasType(token, 'text') || hasType(token, 'attribute-name')) - return this.getAttributeCompetions(state, session, pos, prefix); - - return []; - }; - - this.getTagCompletions = function(state, session, pos, prefix) { - var elements = allElements; - if (prefix) { - elements = elements.filter(function(element){ - return element.indexOf(prefix) === 0; - }); - } - return elements.map(function(element){ - return { - value: element, - meta: "tag" - }; - }); - }; - - this.getAttributeCompetions = function(state, session, pos, prefix) { - var tagName = findTagName(session, pos); - if (!tagName) - return []; - var attributes = globalAttributes; - if (tagName in attributeMap) { - attributes = attributes.concat(attributeMap[tagName]); - } - if (prefix) { - attributes = attributes.filter(function(attribute){ - return attribute.indexOf(prefix) === 0; - }); - } - return attributes.map(function(attribute){ - return { - caption: attribute, - snippet: attribute + '="$0"', - meta: "attribute" - }; - }); - }; - -}).call(HtmlCompletions.prototype); - -exports.HtmlCompletions = HtmlCompletions; -}); - -ace.define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions', 'ace/worker/worker_client'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var HtmlCompletions = require("./html_completions").HtmlCompletions; -var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function(options) { - this.fragmentContext = options && options.fragmentContext; - this.HighlightRules = HtmlHighlightRules; - this.$behaviour = new HtmlBehaviour(); - this.$completer = new HtmlCompletions(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.getCompletions = function(state, session, pos, prefix) { - return this.$completer.getCompletions(state, session, pos, prefix); - }; - - this.createWorker = function(session) { - if (this.constructor != Mode) - return; - var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - if (this.fragmentContext) - worker.call("setOptions", [{context: this.fragmentContext}]); - - worker.on("error", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/html"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/soy_template_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - -var SoyTemplateHighlightRules = function() { - HtmlHighlightRules.call(this); - - var soyRules = { start: - [ { include: '#template' }, - { include: '#if' }, - { include: '#comment-line' }, - { include: '#comment-block' }, - { include: '#comment-doc' }, - { include: '#call' }, - { include: '#css' }, - { include: '#param' }, - { include: '#print' }, - { include: '#msg' }, - { include: '#for' }, - { include: '#foreach' }, - { include: '#switch' }, - { include: '#tag' }, - { include: 'text.html.basic' } ], - '#call': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.call.soy' ], - regex: '(\\{/?)(\\s*)(?=call|delcall)', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { include: '#string-quoted-single' }, - { include: '#string-quoted-double' }, - { token: ['entity.name.tag.soy', 'variable.parameter.soy'], - regex: '(call|delcall)(\\s+[\\.\\w]+)'}, - { token: - [ 'entity.other.attribute-name.soy', - 'text', - 'keyword.operator.soy' ], - regex: '\\b(data)(\\s*)(=)' }, - { defaultToken: 'meta.tag.call.soy' } ] } ], - '#comment-line': - [ { token: - [ 'comment.line.double-slash.soy', - 'punctuation.definition.comment.soy', - 'comment.line.double-slash.soy' ], - regex: '(\\s+)(//)(.*$)' } ], - '#comment-block': - [ { token: 'punctuation.definition.comment.begin.soy', - regex: '/\\*(?!\\*)', - push: - [ { token: 'punctuation.definition.comment.end.soy', - regex: '\\*/', - next: 'pop' }, - { defaultToken: 'comment.block.soy' } ] } ], - '#comment-doc': - [ { token: 'punctuation.definition.comment.begin.soy', - regex: '/\\*\\*(?!/)', - push: - [ { token: 'punctuation.definition.comment.end.soy', - regex: '\\*/', - next: 'pop' }, - { token: [ 'support.type.soy', 'text', 'variable.parameter.soy' ], - regex: '(@param|@param\\?)(\\s+)(\\w+)' }, - { defaultToken: 'comment.block.documentation.soy' } ] } ], - '#css': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.css.soy', - 'entity.name.tag.soy' ], - regex: '(\\{/?)(\\s*)(css)\\b', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { token: 'support.constant.soy', - regex: '\\b(?:LITERAL|REFERENCE|BACKEND_SPECIFIC|GOOG)\\b' }, - { defaultToken: 'meta.tag.css.soy' } ] } ], - '#for': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.for.soy', - 'entity.name.tag.soy' ], - regex: '(\\{/?)(\\s*)(for)\\b', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { token: 'keyword.operator.soy', regex: '\\bin\\b' }, - { token: 'support.function.soy', regex: '\\brange\\b' }, - { include: '#variable' }, - { include: '#number' }, - { include: '#primitive' }, - { defaultToken: 'meta.tag.for.soy' } ] } ], - '#foreach': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.foreach.soy', - 'entity.name.tag.soy' ], - regex: '(\\{/?)(\\s*)(foreach)\\b', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { token: 'keyword.operator.soy', regex: '\\bin\\b' }, - { include: '#variable' }, - { defaultToken: 'meta.tag.foreach.soy' } ] } ], - '#function': - [ { token: 'support.function.soy', - regex: '\\b(?:isFirst|isLast|index|hasData|length|keys|round|floor|ceiling|min|max|randomInt)\\b' } ], - '#if': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.if.soy', - 'entity.name.tag.soy' ], - regex: '(\\{/?)(\\s*)(if|elseif)\\b', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { include: '#variable' }, - { include: '#operator' }, - { include: '#function' }, - { include: '#string-quoted-single' }, - { include: '#string-quoted-double' }, - { defaultToken: 'meta.tag.if.soy' } ] } ], - '#namespace': - [ { token: [ 'entity.name.tag.soy', 'text', 'variable.parameter.soy' ], - regex: '(namespace|delpackage)(\\s+)([\\w\\.]+)' } ], - '#number': [ { token: 'constant.numeric', regex: '[\\d]+' } ], - '#operator': - [ { token: 'keyword.operator.soy', - regex: '==|!=|\\band\\b|\\bor\\b|\\bnot\\b|-|\\+|/|\\?:' } ], - '#param': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.param.soy', - 'entity.name.tag.soy' ], - regex: '(\\{/?)(\\s*)(param)', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { include: '#variable' }, - { token: - [ 'entity.other.attribute-name.soy', - 'text', - 'keyword.operator.soy' ], - regex: '\\b([\\w]*)(\\s*)((?::)?)' }, - { defaultToken: 'meta.tag.param.soy' } ] } ], - '#primitive': - [ { token: 'constant.language.soy', - regex: '\\b(?:null|false|true)\\b' } ], - '#msg': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.msg.soy', - 'entity.name.tag.soy' ], - regex: '(\\{/?)(\\s*)(msg)\\b', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { include: '#string-quoted-single' }, - { include: '#string-quoted-double' }, - { token: - [ 'entity.other.attribute-name.soy', - 'text', - 'keyword.operator.soy' ], - regex: '\\b(meaning|desc)(\\s*)(=)' }, - { defaultToken: 'meta.tag.msg.soy' } ] } ], - '#print': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.print.soy', - 'entity.name.tag.soy' ], - regex: '(\\{/?)(\\s*)(print)\\b', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { include: '#variable' }, - { include: '#print-parameter' }, - { include: '#number' }, - { include: '#primitive' }, - { include: '#attribute-lookup' }, - { defaultToken: 'meta.tag.print.soy' } ] } ], - '#print-parameter': - [ { token: 'keyword.operator.soy', regex: '\\|' }, - { token: 'variable.parameter.soy', - regex: 'noAutoescape|id|escapeHtml|escapeJs|insertWorkBreaks|truncate' } ], - '#special-character': - [ { token: 'support.constant.soy', - regex: '\\bsp\\b|\\bnil\\b|\\\\r|\\\\n|\\\\t|\\blb\\b|\\brb\\b' } ], - '#string-quoted-double': [ { token: 'string.quoted.double', regex: '"[^"]*"' } ], - '#string-quoted-single': [ { token: 'string.quoted.single', regex: '\'[^\']*\'' } ], - '#switch': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.switch.soy', - 'entity.name.tag.soy' ], - regex: '(\\{/?)(\\s*)(switch|case)\\b', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { include: '#variable' }, - { include: '#function' }, - { include: '#number' }, - { include: '#string-quoted-single' }, - { include: '#string-quoted-double' }, - { defaultToken: 'meta.tag.switch.soy' } ] } ], - '#attribute-lookup': - [ { token: 'punctuation.definition.attribute-lookup.begin.soy', - regex: '\\[', - push: - [ { token: 'punctuation.definition.attribute-lookup.end.soy', - regex: '\\]', - next: 'pop' }, - { include: '#variable' }, - { include: '#function' }, - { include: '#operator' }, - { include: '#number' }, - { include: '#primitive' }, - { include: '#string-quoted-single' }, - { include: '#string-quoted-double' } ] } ], - '#tag': - [ { token: 'punctuation.definition.tag.begin.soy', - regex: '\\{', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { include: '#namespace' }, - { include: '#variable' }, - { include: '#special-character' }, - { include: '#tag-simple' }, - { include: '#function' }, - { include: '#operator' }, - { include: '#attribute-lookup' }, - { include: '#number' }, - { include: '#primitive' }, - { include: '#print-parameter' } ] } ], - '#tag-simple': - [ { token: 'entity.name.tag.soy', - regex: '{{\\s*(?:literal|else|ifempty|default)\\s*(?=\\})'} ], - '#template': - [ { token: - [ 'punctuation.definition.tag.begin.soy', - 'meta.tag.template.soy' ], - regex: '(\\{/?)(\\s*)(?=template|deltemplate)', - push: - [ { token: 'punctuation.definition.tag.end.soy', - regex: '\\}', - next: 'pop' }, - { token: ['entity.name.tag.soy', 'text', 'entity.name.function.soy' ], - regex: '(template|deltemplate)(\\s+)([\\.\\w]+)', - originalRegex: '(?<=template|deltemplate)\\s+([\\.\\w]+)' }, - { token: - [ 'entity.other.attribute-name.soy', - 'text', - 'keyword.operator.soy', - 'text', - 'string.quoted.double.soy' ], - regex: '\\b(private)(\\s*)(=)(\\s*)("true"|"false")' }, - { token: - [ 'entity.other.attribute-name.soy', - 'text', - 'keyword.operator.soy', - 'text', - 'string.quoted.single.soy' ], - regex: '\\b(private)(\\s*)(=)(\\s*)(\'true\'|\'false\')' }, - { token: - [ 'entity.other.attribute-name.soy', - 'text', - 'keyword.operator.soy', - 'text', - 'string.quoted.double.soy' ], - regex: '\\b(autoescape)(\\s*)(=)(\\s*)("true"|"false"|"contextual")' }, - { token: - [ 'entity.other.attribute-name.soy', - 'text', - 'keyword.operator.soy', - 'text', - 'string.quoted.single.soy' ], - regex: '\\b(autoescape)(\\s*)(=)(\\s*)(\'true\'|\'false\'|\'contextual\')' }, - { defaultToken: 'meta.tag.template.soy' } ] } ], - '#variable': [ { token: 'variable.other.soy', regex: '\\$[\\w\\.]+' } ] } - - - for (var i in soyRules) { - if (this.$rules[i]) { - this.$rules[i].unshift.call(this.$rules[i], soyRules[i]); - } else { - this.$rules[i] = soyRules[i]; - } - } - - this.normalizeRules(); -}; - -SoyTemplateHighlightRules.metaData = { comment: 'SoyTemplate', - fileTypes: [ 'soy' ], - firstLineMatch: '\\{\\s*namespace\\b', - foldingStartMarker: '\\{\\s*template\\s+[^\\}]*\\}', - foldingStopMarker: '\\{\\s*/\\s*template\\s*\\}', - name: 'SoyTemplate', - scopeName: 'source.soy' } - - -oop.inherits(SoyTemplateHighlightRules, HtmlHighlightRules); - -exports.SoyTemplateHighlightRules = SoyTemplateHighlightRules; -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-space.js b/util/build-sample-browser/player/vendor/ace/mode-space.js deleted file mode 100644 index c892693873..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-space.js +++ /dev/null @@ -1,160 +0,0 @@ -ace.define('ace/mode/space', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/folding/coffee', 'ace/mode/space_highlight_rules'], function(require, exports, module) { - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var FoldMode = require("./folding/coffee").FoldMode; -var SpaceHighlightRules = require("./space_highlight_rules").SpaceHighlightRules; -var Mode = function() { - var highlighter = new SpaceHighlightRules(); - this.$tokenizer = new Tokenizer(highlighter.getRules()); - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); -(function() { - - this.$id = "ace/mode/space"; -}).call(Mode.prototype); -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); -ace.define('ace/mode/space_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var SpaceHighlightRules = function() { - this.$rules = { - "start" : [ - { - token : "empty_line", - regex : / */, - next : "key" - }, - { - token : "empty_line", - regex : /$/, - next : "key" - } - ], - "key" : [ - { - token : "variable", - regex : /\S+/ - }, - { - token : "empty_line", - regex : /$/, - next : "start" - },{ - token : "keyword.operator", - regex : / /, - next : "value" - } - ], - "value" : [ - { - token : "keyword.operator", - regex : /$/, - next : "start" - }, - { - token : "string", - regex : /[^$]/ - } - ] - }; - -}; - -oop.inherits(SpaceHighlightRules, TextHighlightRules); - -exports.SpaceHighlightRules = SpaceHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-sql.js b/util/build-sample-browser/player/vendor/ace/mode-sql.js deleted file mode 100644 index 6472a0dd19..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-sql.js +++ /dev/null @@ -1,124 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/sql', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/sql_highlight_rules', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = SqlHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - - this.$id = "ace/mode/sql"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/sql_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var SqlHighlightRules = function() { - - var keywords = ( - "select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" + - "when|else|end|type|left|right|join|on|outer|desc|asc" - ); - - var builtinConstants = ( - "true|false|null" - ); - - var builtinFunctions = ( - "count|min|max|avg|sum|rank|now|coalesce" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "keyword": keywords, - "constant.language": builtinConstants - }, "identifier", true); - - this.$rules = { - "start" : [ { - token : "comment", - regex : "--.*$" - }, { - token : "comment", - start : "/\\*", - end : "\\*/" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "string", // ' string - regex : "'.*?'" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } ] - }; - this.normalizeRules(); -}; - -oop.inherits(SqlHighlightRules, TextHighlightRules); - -exports.SqlHighlightRules = SqlHighlightRules; -}); - diff --git a/util/build-sample-browser/player/vendor/ace/mode-stylus.js b/util/build-sample-browser/player/vendor/ace/mode-stylus.js deleted file mode 100644 index 55d73ed7bf..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-stylus.js +++ /dev/null @@ -1,447 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/stylus', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/stylus_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var StylusHighlightRules = require("./stylus_highlight_rules").StylusHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = StylusHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.$id = "ace/mode/stylus"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/stylus_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/css_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var CssHighlightRules = require("./css_highlight_rules"); - -var StylusHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.type": CssHighlightRules.supportType, - "support.function": CssHighlightRules.supportFunction, - "support.constant": CssHighlightRules.supportConstant, - "support.constant.color": CssHighlightRules.supportConstantColor, - "support.constant.fonts": CssHighlightRules.supportConstantFonts - }, "text", true); - - this.$rules = { - start: [ - { - token : "comment", - regex : /\/\/.*$/ - }, - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, - { - token: ["entity.name.function.stylus", "text"], - regex: "^([-a-zA-Z_][-\\w]*)?(\\()" - }, - { - token: ["entity.other.attribute-name.class.stylus"], - regex: "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*" - }, - { - token: ["entity.language.stylus"], - regex: "^ *&" - }, - { - token: ["variable.language.stylus"], - regex: "(arguments)" - }, - { - token: ["keyword.stylus"], - regex: "@[-\\w]+" - }, - { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : CssHighlightRules.pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : CssHighlightRules.pseudoClasses - }, - { - token: ["entity.name.tag.stylus"], - regex: "(?:\\b)(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(?:h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)(?:\\b)" - }, - { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, - { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, - { - token: ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"], - regex: "(#)([a-zA-Z][a-zA-Z0-9_-]*)" - }, - { - token: "meta.vendor-prefix.stylus", - regex: "-webkit-|-moz\\-|-ms-|-o-" - }, - { - token: "keyword.control.stylus", - regex: "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b" - }, - { - token: "keyword.operator.stylus", - regex: "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!=" - }, - { - token: "keyword.operator.stylus", - regex: "(?:in|is(?:nt)?|not)\\b" - }, - { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, - { - token : "constant.numeric", - regex : CssHighlightRules.numRe - }, - { - token : "keyword", - regex : "(?:ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)\\b" - }, - { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '[^"\\\\]+' - }, - { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, - { - token : "string", - regex : '"|$', - next : "start" - } - ], - "qstring" : [ - { - token : "string", - regex : "[^'\\\\]+" - }, - { - token : "string", - regex : "\\\\$", - next : "qstring" - }, - { - token : "string", - regex : "'|$", - next : "start" - } - ] -} - -}; - -oop.inherits(StylusHighlightRules, TextHighlightRules); - -exports.StylusHighlightRules = StylusHighlightRules; -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "#") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "#") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-svg.js b/util/build-sample-browser/player/vendor/ace/mode-svg.js deleted file mode 100644 index 207c79de2a..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-svg.js +++ /dev/null @@ -1,1658 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/svg', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/svg_highlight_rules', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var XmlMode = require("./xml").Mode; -var JavaScriptMode = require("./javascript").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var SvgHighlightRules = require("./svg_highlight_rules").SvgHighlightRules; -var MixedFoldMode = require("./folding/mixed").FoldMode; -var XmlFoldMode = require("./folding/xml").FoldMode; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - XmlMode.call(this); - - this.HighlightRules = SvgHighlightRules; - - this.createModeDelegates({ - "js-": JavaScriptMode - }); - - this.foldingRules = new MixedFoldMode(new XmlFoldMode({}), { - "js-": new CStyleFoldMode() - }); -}; - -oop.inherits(Mode, XmlMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - - this.$id = "ace/mode/svg"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == ' selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/svg_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var SvgHighlightRules = function() { - XmlHighlightRules.call(this); - - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - this.normalizeRules(); -}; - -oop.inherits(SvgHighlightRules, XmlHighlightRules); - -exports.SvgHighlightRules = SvgHighlightRules; -}); - -ace.define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; -var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; -var XmlFoldMode = require("./folding/xml").FoldMode; - -var Mode = function() { - this.HighlightRules = XmlHighlightRules; - this.$behaviour = new XmlBehaviour(); - this.foldingRules = new XmlFoldMode(); -}; - -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.$id = "ace/mode/xml"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(defaultMode, subModes) { - this.defaultMode = defaultMode; - this.subModes = subModes; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - - this.$getMode = function(state) { - if (typeof state != "string") - state = state[0]; - for (var key in this.subModes) { - if (state.indexOf(key) === 0) - return this.subModes[key]; - } - return null; - }; - - this.$tryMode = function(state, session, foldStyle, row) { - var mode = this.$getMode(state); - return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); - }; - - this.getFoldWidget = function(session, foldStyle, row) { - return ( - this.$tryMode(session.getState(row-1), session, foldStyle, row) || - this.$tryMode(session.getState(row), session, foldStyle, row) || - this.defaultMode.getFoldWidget(session, foldStyle, row) - ); - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var mode = this.$getMode(session.getState(row-1)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.$getMode(session.getState(row)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.defaultMode; - - return mode.getFoldWidgetRange(session, foldStyle, row); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-tcl.js b/util/build-sample-browser/player/vendor/ace/mode-tcl.js deleted file mode 100644 index aebee1c732..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-tcl.js +++ /dev/null @@ -1,361 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/tcl', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/folding/cstyle', 'ace/mode/tcl_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; -var TclHighlightRules = require("./tcl_highlight_rules").TclHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = TclHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "#"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/tcl"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/tcl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var TclHighlightRules = function() { - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "#.*\\\\$", - next : "commentfollow" - }, { - token : "comment", - regex : "#.*$" - }, { - token : "support.function", - regex : '[\\\\]$', - next : "splitlineStart" - }, { - token : "text", - regex : '[\\\\](?:["]|[{]|[}]|[[]|[]]|[$]|[\])' - }, { - token : "text", // last value before command - regex : '^|[^{][;][^}]|[/\r/]', - next : "commandItem" - }, { - token : "string", // single line - regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line """ string start - regex : '[ ]*["]', - next : "qqstring" - }, { - token : "variable.instance", - regex : "[$]", - next : "variable" - }, { - token : "support.function", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::" - }, { - token : "identifier", - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "paren.lparen", - regex : "[[{]", - next : "commandItem" - }, { - token : "paren.lparen", - regex : "[(]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "commandItem" : [ - { - token : "comment", - regex : "#.*\\\\$", - next : "commentfollow" - }, { - token : "comment", - regex : "#.*$", - next : "start" - }, { - token : "string", // single line - regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "variable.instance", - regex : "[$]", - next : "variable" - }, { - token : "support.function", - regex : "(?:[:][:])[a-zA-Z0-9_/]+(?:[:][:])", - next : "commandItem" - }, { - token : "support.function", - regex : "[a-zA-Z0-9_/]+(?:[:][:])", - next : "commandItem" - }, { - token : "support.function", - regex : "(?:[:][:])", - next : "commandItem" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "support.function", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::" - }, { - token : "keyword", - regex : "[a-zA-Z0-9_/]+", - next : "start" - } ], - "commentfollow" : [ - { - token : "comment", - regex : ".*\\\\$", - next : "commentfollow" - }, { - token : "comment", - regex : '.+', - next : "start" - } ], - "splitlineStart" : [ - { - token : "text", - regex : "^.", - next : "start" - }], - "variable" : [ - { - token : "variable.instance", // variable tcl - regex : "[a-zA-Z_\\d]+(?:[(][a-zA-Z_\\d]+[)])?", - next : "start" - }, { - token : "variable.instance", // variable tcl with braces - regex : "{?[a-zA-Z_\\d]+}?", - next : "start" - }], - "qqstring" : [ { - token : "string", // multi line """ string end - regex : '(?:[^\\\\]|\\\\.)*?["]', - next : "start" - }, { - token : "string", - regex : '.+' - } ] - }; -}; - -oop.inherits(TclHighlightRules, TextHighlightRules); - -exports.TclHighlightRules = TclHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-tex.js b/util/build-sample-browser/player/vendor/ace/mode-tex.js deleted file mode 100644 index d8809a1b26..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-tex.js +++ /dev/null @@ -1,187 +0,0 @@ -/* - * tex.js - * - * Copyright (C) 2009-11 by RStudio, Inc. - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * - */ -ace.define('ace/mode/tex', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/tex_highlight_rules', 'ace/mode/matching_brace_outdent'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; - -var Mode = function(suppressHighlighting) { - if (suppressHighlighting) - this.HighlightRules = TextHighlightRules; - else - this.HighlightRules = TexHighlightRules; - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.allowAutoInsert = function() { - return false; - }; - this.$id = "ace/mode/tex"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -ace.define('ace/mode/tex_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var TexHighlightRules = function(textClass) { - - if (!textClass) - textClass = "text"; - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "%.*$" - }, { - token : textClass, // non-command - regex : "\\\\[$&%#\\{\\}]" - }, { - token : "keyword", // command - regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b", - next : "nospell" - }, { - token : "keyword", // command - regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])" - }, { - token : "paren.keyword.operator", - regex : "[[({]" - }, { - token : "paren.keyword.operator", - regex : "[\\])}]" - }, { - token : textClass, - regex : "\\s+" - } - ], - "nospell" : [ - { - token : "comment", - regex : "%.*$", - next : "start" - }, { - token : "nospell." + textClass, // non-command - regex : "\\\\[$&%#\\{\\}]" - }, { - token : "keyword", // command - regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b" - }, { - token : "keyword", // command - regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])", - next : "start" - }, { - token : "paren.keyword.operator", - regex : "[[({]" - }, { - token : "paren.keyword.operator", - regex : "[\\])]" - }, { - token : "paren.keyword.operator", - regex : "}", - next : "start" - }, { - token : "nospell." + textClass, - regex : "\\s+" - }, { - token : "nospell." + textClass, - regex : "\\w+" - } - ] - }; -}; - -oop.inherits(TexHighlightRules, TextHighlightRules); - -exports.TexHighlightRules = TexHighlightRules; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-textile.js b/util/build-sample-browser/player/vendor/ace/mode-textile.js deleted file mode 100644 index 784e972594..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-textile.js +++ /dev/null @@ -1,171 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/textile', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/textile_highlight_rules', 'ace/mode/matching_brace_outdent'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var TextileHighlightRules = require("./textile_highlight_rules").TextileHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; - -var Mode = function() { - this.HighlightRules = TextileHighlightRules; - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.getNextLineIndent = function(state, line, tab) { - if (state == "intag") - return tab; - - return ""; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/textile"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/textile_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var TextileHighlightRules = function() { - this.$rules = { - "start" : [ - { - token : function(value) { - if (value.charAt(0) == "h") - return "markup.heading." + value.charAt(1); - else - return "markup.heading"; - }, - regex : "h1|h2|h3|h4|h5|h6|bq|p|bc|pre", - next : "blocktag" - }, - { - token : "keyword", - regex : "[\\*]+|[#]+" - }, - { - token : "text", - regex : ".+" - } - ], - "blocktag" : [ - { - token : "keyword", - regex : "\\. ", - next : "start" - }, - { - token : "keyword", - regex : "\\(", - next : "blocktagproperties" - } - ], - "blocktagproperties" : [ - { - token : "keyword", - regex : "\\)", - next : "blocktag" - }, - { - token : "string", - regex : "[a-zA-Z0-9\\-_]+" - }, - { - token : "keyword", - regex : "#" - } - ] - }; -}; - -oop.inherits(TextileHighlightRules, TextHighlightRules); - -exports.TextileHighlightRules = TextileHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-toml.js b/util/build-sample-browser/player/vendor/ace/mode-toml.js deleted file mode 100644 index 631adc635f..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-toml.js +++ /dev/null @@ -1,177 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Garen J. Torikian - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/toml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/toml_highlight_rules', 'ace/mode/folding/ini'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var TomlHighlightRules = require("./toml_highlight_rules").TomlHighlightRules; -var FoldMode = require("./folding/ini").FoldMode; - -var Mode = function() { - this.HighlightRules = TomlHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "#"; - this.$id = "ace/mode/toml"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/toml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var TomlHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "constant.language.boolean": "true|false" - }, "identifier"); - - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - this.$rules = { - "start": [ - { - token: "comment.toml", - regex: /#.*$/ - }, - { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, - { - token: ["variable.keygroup.toml"], - regex: "(?:^\\s*)(\\[([^\\]]+)\\])" - }, - { - token : keywordMapper, - regex : identifierRe - }, - { - token : "support.date.toml", - regex: "\\d{4}-\\d{2}-\\d{2}(T)\\d{2}:\\d{2}:\\d{2}(Z)" - }, - { - token: "constant.numeric.toml", - regex: "-?\\d+(\\.?\\d+)?" - } - ], - "qqstring" : [ - { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, - { - token : "constant.language.escape", - regex : '\\\\[0tnr"\\\\]' - }, - { - token : "string", - regex : '"|$', - next : "start" - }, - { - defaultToken: "string" - } - ] - } - -}; - -oop.inherits(TomlHighlightRules, TextHighlightRules); - -exports.TomlHighlightRules = TomlHighlightRules; -}); - -ace.define('ace/mode/folding/ini', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function() { -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /^\s*\[([^\])]*)]\s*(?:$|[;#])/; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var re = this.foldingStartMarker; - var line = session.getLine(row); - - var m = line.match(re); - - if (!m) return; - - var startName = m[1] + "."; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - if (/^\s*$/.test(line)) - continue; - m = line.match(re); - if (m && m[1].lastIndexOf(startName, 0) !== 0) - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-twig.js b/util/build-sample-browser/player/vendor/ace/mode-twig.js deleted file mode 100644 index bfbb589c7b..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-twig.js +++ /dev/null @@ -1,2258 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/twig', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/twig_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/matching_brace_outdent'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var TwigHighlightRules = require("./twig_highlight_rules").TwigHighlightRules; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; -var HtmlFoldMode = require("./folding/html").FoldMode; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; - -var Mode = function() { - this.HighlightRules = TwigHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new HtmlBehaviour(); - - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode - }); - - this.foldingRules = new HtmlFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.blockComment = {start: "{#", end: "#}"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - this.$id = "ace/mode/twig"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("csslint", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/twig_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/html_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var TwigHighlightRules = function() { - HtmlHighlightRules.call(this); - - var tags = "autoescape|block|do|embed|extends|filter|flush|for|from|if|import|include|macro|sandbox|set|spaceless|use|verbatim"; - tags = tags + "|end" + tags.replace(/\|/g, "|end"); - var filters = "abs|batch|capitalize|convert_encoding|date|date_modify|default|e|escape|first|format|join|json_encode|keys|last|length|lower|merge|nl2br|number_format|raw|replace|reverse|slice|sort|split|striptags|title|trim|upper|url_encode"; - var functions = "attribute|constant|cycle|date|dump|parent|random|range|template_from_string"; - var tests = "constant|divisibleby|sameas|defined|empty|even|iterable|odd"; - var constants = "null|none|true|false"; - var operators = "b-and|b-xor|b-or|in|is|and|or|not" - - var keywordMapper = this.createKeywordMapper({ - "keyword.control.twig": tags, - "support.function.twig": [filters, functions, tests].join("|"), - "keyword.operator.twig": operators, - "constant.language.twig": constants - }, "identifier"); - for (var rule in this.$rules) { - this.$rules[rule].unshift({ - token : "variable.other.readwrite.local.twig", - regex : "\\{\\{-?", - push : "twig-start" - }, { - token : "meta.tag.twig", - regex : "\\{%-?", - push : "twig-start" - }, { - token : "comment.block.twig", - regex : "\\{#-?", - push : "twig-comment" - }); - } - this.$rules["twig-comment"] = [{ - token : "comment.block.twig", - regex : ".*-?#\\}", - next : "pop" - }]; - - this.$rules["twig-start"] = [{ - token : "variable.other.readwrite.local.twig", - regex : "-?\\}\\}", - next : "pop" - }, { - token : "meta.tag.twig", - regex : "-?%\\}", - next : "pop" - }, { - token : "string", - regex : "'", - next : "twig-qstring" - }, { - token : "string", - regex : '"', - next : "twig-qqstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator.assignment", - regex : "=|~" - }, { - token : "keyword.operator.comparison", - regex : "==|!=|<|>|>=|<=|===" - }, { - token : "keyword.operator.arithmetic", - regex : "\\+|-|/|%|//|\\*|\\*\\*" - }, { - token : "keyword.operator.other", - regex : "\\.\\.|\\|" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./ - }, { - token : "paren.lparen", - regex : /[\[\({]/ - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "text", - regex : "\\s+" - } ]; - - this.$rules["twig-qqstring"] = [{ - token : "constant.language.escape", - regex : /\\[\\"$#ntr]|#{[^"}]*}/ - }, { - token : "string", - regex : '"', - next : "twig-start" - }, { - defaultToken : "string" - } - ]; - - this.$rules["twig-qstring"] = [{ - token : "constant.language.escape", - regex : /\\[\\'ntr]}/ - }, { - token : "string", - regex : "'", - next : "twig-start" - }, { - defaultToken : "string" - } - ]; - - this.normalizeRules(); -}; - -oop.inherits(TwigHighlightRules, TextHighlightRules); - -exports.TwigHighlightRules = TwigHighlightRules; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == '=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(defaultMode, subModes) { - this.defaultMode = defaultMode; - this.subModes = subModes; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - - this.$getMode = function(state) { - if (typeof state != "string") - state = state[0]; - for (var key in this.subModes) { - if (state.indexOf(key) === 0) - return this.subModes[key]; - } - return null; - }; - - this.$tryMode = function(state, session, foldStyle, row) { - var mode = this.$getMode(state); - return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); - }; - - this.getFoldWidget = function(session, foldStyle, row) { - return ( - this.$tryMode(session.getState(row-1), session, foldStyle, row) || - this.$tryMode(session.getState(row), session, foldStyle, row) || - this.defaultMode.getFoldWidget(session, foldStyle, row) - ); - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var mode = this.$getMode(session.getState(row-1)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.$getMode(session.getState(row)); - - if (!mode || !mode.getFoldWidget(session, foldStyle, row)) - mode = this.defaultMode; - - return mode.getFoldWidgetRange(session, foldStyle, row); - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-typescript.js b/util/build-sample-browser/player/vendor/ace/mode-typescript.js deleted file mode 100644 index aabe4eaf95..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-typescript.js +++ /dev/null @@ -1,1048 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/typescript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/typescript_highlight_rules', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/mode/matching_brace_outdent'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var jsMode = require("./javascript").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var TypeScriptHighlightRules = require("./typescript_highlight_rules").TypeScriptHighlightRules; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; - -var Mode = function() { - this.HighlightRules = TypeScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, jsMode); - -(function() { - this.createWorker = function(session) { - return null; - }; - this.$id = "ace/mode/typescript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("jslint", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/javascript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - - -var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {} -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.id; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - if (leftChar == '\\') { - return null; - } - var tokens = session.getTokens(selection.start.row); - var col = 0, token; - var quotepos = -1; // Track whether we're inside an open quote. - - for (var x = 0; x < tokens.length; x++) { - token = tokens[x]; - if (token.type == "string") { - quotepos = -1; - } else if (quotepos < 0) { - quotepos = token.value.indexOf(quote); - } - if ((token.value.length + col) > selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); - } -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - -}).call(FoldMode.prototype); - -}); - - -ace.define('ace/mode/typescript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; - -var TypeScriptHighlightRules = function() { - - var tsRules = [ - { - token: ["keyword.operator.ts", "text", "variable.parameter.function.ts", "text"], - regex: "\\b(module)(\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*\\{)" - }, - { - token: ["storage.type.variable.ts", "text", "keyword.other.ts", "text"], - regex: "(super)(\\s*\\()([a-zA-Z0-9,_?.$\\s]+\\s*)(\\))" - }, - { - token: ["entity.name.function.ts","paren.lparen", "paren.rparen"], - regex: "([a-zA-Z_?.$][\\w?.$]*)(\\()(\\))" - }, - { - token: ["variable.parameter.function.ts", "text", "variable.parameter.function.ts"], - regex: "([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*:\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)" - }, - { - token: ["keyword.operator.ts"], - regex: "(?:\\b(constructor|declare|interface|as|AS|public|private|class|extends|export|super)\\b)" - }, - { - token: ["storage.type.variable.ts"], - regex: "(?:\\b(this\\.|string\\b|bool\\b|number)\\b)" - }, - { - token: ["keyword.operator.ts", "storage.type.variable.ts", "keyword.operator.ts", "storage.type.variable.ts"], - regex: "(class)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)(extends)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)?" - }, - { - token: "keyword", - regex: "(?:super|export|class|extends|import)\\b" - } - ]; - - var JSRules = new JavaScriptHighlightRules().getRules(); - - JSRules.start = tsRules.concat(JSRules.start); - this.$rules = JSRules; -}; - -oop.inherits(TypeScriptHighlightRules, JavaScriptHighlightRules); - -exports.TypeScriptHighlightRules = TypeScriptHighlightRules; -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/mode-vbscript.js b/util/build-sample-browser/player/vendor/ace/mode-vbscript.js deleted file mode 100644 index 85b741d42f..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-vbscript.js +++ /dev/null @@ -1,250 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/vbscript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/vbscript_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var VBScriptHighlightRules = require("./vbscript_highlight_rules").VBScriptHighlightRules; - -var Mode = function() { - this.HighlightRules = VBScriptHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ["'", "REM"]; - - this.$id = "ace/mode/vbscript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - - -ace.define('ace/mode/vbscript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var VBScriptHighlightRules = function() { - - this.$rules = { - "start": [ - { - token: [ - "meta.ending-space" - ], - regex: "$" - }, - { - token: [ - null - ], - regex: "^(?=\\t)", - next: "state_3" - }, - { - token: [null], - regex: "^(?= )", - next: "state_4" - }, - { - token: [ - "text", - "storage.type.function.asp", - "text", - "entity.name.function.asp", - "text", - "punctuation.definition.parameters.asp", - "variable.parameter.function.asp", - "punctuation.definition.parameters.asp" - ], - regex: "^(\\s*)(Function|Sub)(\\s*)([a-zA-Z_]\\w*)(\\s*)(\\()([^)]*)(\\))" - }, - { - token: "punctuation.definition.comment.asp", - regex: "'|REM", - next: "comment" - }, - { - token: [ - "keyword.control.asp" - ], - regex: "\\b(?:If|Then|Else|ElseIf|Else If|End If|While|Wend|For|To|Each|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub|IIf)\\b" - }, - { - token: "keyword.operator.asp", - regex: "\\b(?:Mod|And|Not|Or|Xor|as)\\b" - }, - { - token: "storage.type.asp", - regex: "Dim|Call|Class|Const|Dim|Redim|Function|Sub|Private Sub|Public Sub|End sub|End Function|Set|Let|Get|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo" - }, - { - token: "storage.modifier.asp", - regex: "\\b(?:Private|Public|Default)\\b" - }, - { - token: "constant.language.asp", - regex: "\\b(?:Empty|False|Nothing|Null|True)\\b" - }, - { - token: "punctuation.definition.string.begin.asp", - regex: '"', - next: "string" - }, - { - token: [ - "punctuation.definition.variable.asp" - ], - regex: "(\\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b\\s*" - }, - { - token: "support.class.asp", - regex: "\\b(?:Application|ObjectContext|Request|Response|Server|Session)\\b" - }, - { - token: "support.class.collection.asp", - regex: "\\b(?:Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\\b" - }, - { - token: "support.constant.asp", - regex: "\\b(?:TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\\b" - }, - { - token: "support.function.asp", - regex: "\\b(?:Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\\b" - }, - { - token: "support.function.event.asp", - regex: "\\b(?:Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\\b" - }, - { - token: "support.function.vb.asp", - regex: "\\b(?:Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year)\\b" - }, - { - token: [ - "constant.numeric.asp" - ], - regex: "-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b" - }, - { - token: "support.type.vb.asp", - regex: "\\b(?:vbtrue|vbfalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant|vbDataObject|vbDecimal|vbByte|vbArray)\\b" - }, - { - token: [ - "entity.name.function.asp" - ], - regex: "(?:(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b)(?=\\(\\)?))" - }, - { - token: [ - "keyword.operator.asp" - ], - regex: "\\-|\\+|\\*\\\/|\\>|\\<|\\=|\\&" - } - ], - "state_3": [ - { - token: [ - "meta.odd-tab.tabs", - "meta.even-tab.tabs" - ], - regex: "(\\t)(\\t)?" - }, - { - token: "meta.leading-space", - regex: "(?=[^\\t])", - next: "start" - }, - { - token: "meta.leading-space", - regex: ".", - next: "state_3" - } - ], - "state_4": [ - { - token: ["meta.odd-tab.spaces", "meta.even-tab.spaces"], - regex: "( )( )?" - }, - { - token: "meta.leading-space", - regex: "(?=[^ ])", - next: "start" - }, - { - defaultToken: "meta.leading-space" - } - ], - "comment": [ - { - token: "comment.line.apostrophe.asp", - regex: "$|(?=(?:%>))", - next: "start" - }, - { - defaultToken: "comment.line.apostrophe.asp" - } - ], - "string": [ - { - token: "constant.character.escape.apostrophe.asp", - regex: '""' - }, - { - token: "string.quoted.double.asp", - regex: '"', - next: "start" - }, - { - defaultToken: "string.quoted.double.asp" - } - ] -} - -}; - -oop.inherits(VBScriptHighlightRules, TextHighlightRules); - -exports.VBScriptHighlightRules = VBScriptHighlightRules; -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/mode-velocity.js b/util/build-sample-browser/player/vendor/ace/mode-velocity.js deleted file mode 100644 index 4796abe2e3..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-velocity.js +++ /dev/null @@ -1,1652 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/velocity', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/velocity_highlight_rules', 'ace/mode/folding/velocity', 'ace/mode/behaviour/html'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var VelocityHighlightRules = require("./velocity_highlight_rules").VelocityHighlightRules; -var FoldMode = require("./folding/velocity").FoldMode; -var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; - -var Mode = function() { - this.HighlightRules = VelocityHighlightRules; - this.foldingRules = new FoldMode(); - this.$behaviour = new HtmlBehaviour(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "##"; - this.blockComment = {start: "#*", end: "*#"}; - this.$id = "ace/mode/velocity"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; - -var tagMap = lang.createMap({ - a : 'anchor', - button : 'form', - form : 'form', - img : 'image', - input : 'form', - label : 'form', - option : 'form', - script : 'script', - select : 'form', - textarea : 'form', - style : 'style', - table : 'table', - tbody : 'table', - td : 'table', - tfoot : 'table', - th : 'table', - tr : 'table' -}); - -var HtmlHighlightRules = function() { - XmlHighlightRules.call(this); - - this.addRules({ - attributes: [{ - include : "space" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "keyword.operator.separator", - regex : "=", - push : [{ - include: "space" - }, { - token : "string", - regex : "[^<>='\"`\\s]+", - next : "pop" - }, { - token : "empty", - regex : "", - next : "pop" - }] - }, { - include : "string" - }], - tag: [{ - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(<)([-_a-zA-Z0-9:]+)", - next: "start_tag_stuff" - }, { - token : function(start, tag) { - var group = tagMap[tag]; - return ["meta.tag.punctuation.begin", - "meta.tag.name" + (group ? "." + group : "")]; - }, - regex : "(", next : "start"} - ], - end_tag_stuff: [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next : "start"} - ] - }); - - this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); - - if (this.constructor === HtmlHighlightRules) - this.normalizeRules(); -}; - -oop.inherits(HtmlHighlightRules, XmlHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); - -ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; -var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; -var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; -var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; -var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; - -var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; -var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; -var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; - -var CssHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "support.function": supportFunction, - "support.constant": supportConstant, - "support.type": supportType, - "support.constant.color": supportConstantColor, - "support.constant.fonts": supportConstantFonts - }, "text", true); - - this.$rules = { - "start" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "@.*?{", - push: "media" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "media" : [{ - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token: "paren.lparen", - regex: "\\{", - push: "ruleset" - }, { - token: "string", - regex: "\\}", - next: "pop" - }, { - token: "keyword", - regex: "#[a-z0-9-_]+" - }, { - token: "variable", - regex: "\\.[a-z0-9-_]+" - }, { - token: "string", - regex: ":[a-z0-9-_]+" - }, { - token: "constant", - regex: "[a-z0-9-_]+" - }, { - caseInsensitive: true - }], - - "comment" : [{ - token : "comment", - regex : "\\*\\/", - next : "pop" - }, { - defaultToken : "comment" - }], - - "ruleset" : [ - { - token : "paren.rparen", - regex : "\\}", - next: "pop" - }, { - token : "comment", // multi line comment - regex : "\\/\\*", - push : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : ["constant.numeric", "keyword"], - regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" - }, { - token : "constant.numeric", - regex : numRe - }, { - token : "constant.numeric", // hex6 color - regex : "#[a-f0-9]{6}" - }, { - token : "constant.numeric", // hex3 color - regex : "#[a-f0-9]{3}" - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], - regex : pseudoElements - }, { - token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], - regex : pseudoClasses - }, { - token : ["support.function", "string", "support.function"], - regex : "(url\\()(.*)(\\))" - }, { - token : keywordMapper, - regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" - }, { - caseInsensitive: true - }] - }; - - this.normalizeRules(); -}; - -oop.inherits(CssHighlightRules, TextHighlightRules); - -exports.CssHighlightRules = CssHighlightRules; - -}); - -ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JavaScriptHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-6][0-7]?|" + // oct - "37[0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - { - token : "comment", - regex : "\\/\\/", - next : "line_comment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : ["punctuation.operator", "support.function.dom"], - regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : ["punctuation.operator", "support.constant"], - regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "keyword.operator", - regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/, - next : "start" - }, { - token : "punctuation.operator", - regex : /\?|\:|\,|\;|\./, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token : "keyword.operator", - regex : /\/=?/, - next : "start" - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment_regex_allowed" - }, { - token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" - }, { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "comment_regex_allowed" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment"} - ], - "line_comment_regex_allowed" : [ - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment"} - ], - "line_comment" : [ - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment"} - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); - -ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc.tag", - regex : "\\bTODO\\b" - }, { - defaultToken : "comment.doc" - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); -ace.define('ace/mode/velocity_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/html_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - -var VelocityHighlightRules = function() { - HtmlHighlightRules.call(this); - - var builtinConstants = lang.arrayToMap( - ('true|false|null').split('|') - ); - - var builtinFunctions = lang.arrayToMap( - ("_DateTool|_DisplayTool|_EscapeTool|_FieldTool|_MathTool|_NumberTool|_SerializerTool|_SortTool|_StringTool|_XPathTool").split('|') - ); - - var builtinVariables = lang.arrayToMap( - ('$contentRoot|$foreach').split('|') - ); - - var keywords = lang.arrayToMap( - ("#set|#macro|#include|#parse|" + - "#if|#elseif|#else|#foreach|" + - "#break|#end|#stop" - ).split('|') - ); - - this.$rules.start.push( - { - token : "comment", - regex : "##.*$" - },{ - token : "comment.block", // multi line comment - regex : "#\\*", - next : "vm_comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : function(value) { - if (keywords.hasOwnProperty(value)) - return "keyword"; - else if (builtinConstants.hasOwnProperty(value)) - return "constant.language"; - else if (builtinVariables.hasOwnProperty(value)) - return "variable.language"; - else if (builtinFunctions.hasOwnProperty(value) || builtinFunctions.hasOwnProperty(value.substring(1))) - return "support.function"; - else if (value == "debugger") - return "invalid.deprecated"; - else - if(value.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*)$/)) - return "variable"; - return "identifier"; - }, - regex : "[a-zA-Z$#][a-zA-Z0-9_]*\\b" - }, { - token : "keyword.operator", - regex : "!|&|\\*|\\-|\\+|=|!=|<=|>=|<|>|&&|\\|\\|" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ); - - this.$rules["vm_comment"] = [ - { - token : "comment", // closing comment - regex : "\\*#|-->", - next : "start" - }, { - defaultToken: "comment" - } - ]; - - this.$rules["vm_start"] = [ - { - token: "variable", - regex: "}", - next: "pop" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : function(value) { - if (keywords.hasOwnProperty(value)) - return "keyword"; - else if (builtinConstants.hasOwnProperty(value)) - return "constant.language"; - else if (builtinVariables.hasOwnProperty(value)) - return "variable.language"; - else if (builtinFunctions.hasOwnProperty(value) || builtinFunctions.hasOwnProperty(value.substring(1))) - return "support.function"; - else if (value == "debugger") - return "invalid.deprecated"; - else - if(value.match(/^(\$[a-zA-Z_$][a-zA-Z0-9_]*)$/)) - return "variable"; - return "identifier"; - }, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|&|\\*|\\-|\\+|=|!=|<=|>=|<|>|&&|\\|\\|" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ]; - - for (var i in this.$rules) { - this.$rules[i].unshift({ - token: "variable", - regex: "\\${", - push: "vm_start" - }); - } - - this.normalizeRules(); -}; - -oop.inherits(VelocityHighlightRules, TextHighlightRules); - -exports.VelocityHighlightRules = VelocityHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/folding/velocity', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var BaseFoldMode = require("./fold_mode").FoldMode; -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var range = this.indentationBlock(session, row); - if (range) - return range; - - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1 || line[startLevel] != "##") - return; - - var startColumn = line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.search(re); - - if (level == -1) - continue; - - if (line[level] != "##") - break; - - endRow = row; - } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); - } - }; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - var indent = line.search(/\S/); - var next = session.getLine(row + 1); - var prev = session.getLine(row - 1); - var prevIndent = prev.search(/\S/); - var nextIndent = next.search(/\S/); - - if (indent == -1) { - session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; - return ""; - } - if (prevIndent == -1) { - if (indent == nextIndent && line[indent] == "##" && next[indent] == "##") { - session.foldWidgets[row - 1] = ""; - session.foldWidgets[row + 1] = ""; - return "start"; - } - } else if (prevIndent == indent && line[indent] == "##" && prev[indent] == "##") { - if (session.getLine(row - 2).search(/\S/) == -1) { - session.foldWidgets[row - 1] = "start"; - session.foldWidgets[row + 1] = ""; - return ""; - } - } - - if (prevIndent!= -1 && prevIndent < indent) - session.foldWidgets[row - 1] = "start"; - else - session.foldWidgets[row - 1] = ""; - - if (indent < nextIndent) - return "start"; - else - return ""; - }; - -}).call(FoldMode.prototype); - -}); - -ace.define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var HtmlBehaviour = function () { - - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var element = token.value; - if (atCursor){ - var element = element.substring(0, position.column - token.start); - } - if (voidElements.indexOf(element) !== -1){ - return; - } - return { - text: '>' + '', - selection: [1, 1] - } - } - }); -} -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == ' selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-verilog.js b/util/build-sample-browser/player/vendor/ace/mode-verilog.js deleted file mode 100644 index 2d4bb2bc3c..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-verilog.js +++ /dev/null @@ -1,127 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/verilog', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/verilog_highlight_rules', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var VerilogHighlightRules = require("./verilog_highlight_rules").VerilogHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = VerilogHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.$id = "ace/mode/verilog"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - - -ace.define('ace/mode/verilog_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var VerilogHighlightRules = function() { -var keywords = "always|and|assign|automatic|begin|buf|bufif0|bufif1|case|casex|casez|cell|cmos|config|" + - "deassign|default|defparam|design|disable|edge|else|end|endcase|endconfig|endfunction|endgenerate|endmodule|" + - "endprimitive|endspecify|endtable|endtask|event|for|force|forever|fork|function|generate|genvar|highz0|" + - "highz1|if|ifnone|incdir|include|initial|inout|input|instance|integer|join|large|liblist|library|localparam|" + - "macromodule|medium|module|nand|negedge|nmos|nor|noshowcancelled|not|notif0|notif1|or|output|parameter|pmos|" + - "posedge|primitive|pull0|pull1|pulldown|pullup|pulsestyle_onevent|pulsestyle_ondetect|rcmos|real|realtime|" + - "reg|release|repeat|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|showcancelled|signed|small|specify|specparam|" + - "strong0|strong1|supply0|supply1|table|task|time|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|" + - "unsigned|use|vectored|wait|wand|weak0|weak1|while|wire|wor|xnor|xor" + - "begin|bufif0|bufif1|case|casex|casez|config|else|end|endcase|endconfig|endfunction|" + - "endgenerate|endmodule|endprimitive|endspecify|endtable|endtask|for|forever|function|generate|if|ifnone|" + - "macromodule|module|primitive|repeat|specify|table|task|while"; - - var builtinConstants = ( - "true|false|null" - ); - - var builtinFunctions = ( - "count|min|max|avg|sum|rank|now|coalesce|main" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "keyword": keywords, - "constant.language": builtinConstants - }, "identifier", true); - - this.$rules = { - "start" : [ { - token : "comment", - regex : "//.*$" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "string", // ' string - regex : "'.*?'" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } ] - }; -}; - -oop.inherits(VerilogHighlightRules, TextHighlightRules); - -exports.VerilogHighlightRules = VerilogHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-vhdl.js b/util/build-sample-browser/player/vendor/ace/mode-vhdl.js deleted file mode 100644 index 57137d2451..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-vhdl.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ -ace.define('ace/mode/vhdl', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/vhdl_highlight_rules', 'ace/range'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var VHDLHighlightRules = require("./vhdl_highlight_rules").VHDLHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = VHDLHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - - this.$id = "ace/mode/vhdl"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); -ace.define('ace/mode/vhdl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var VHDLHighlightRules = function() { - - - - var keywords = "access|after|ailas|all|architecture|assert|attribute|"+ - "begin|block|buffer|bus|case|component|configuration|"+ - "disconnect|downto|else|elsif|end|entity|file|for|function|"+ - "generate|generic|guarded|if|impure|in|inertial|inout|is|"+ - "label|linkage|literal|loop|mapnew|next|of|on|open|"+ - "others|out|port|process|pure|range|record|reject|"+ - "report|return|select|shared|subtype|then|to|transport|"+ - "type|unaffected|united|until|wait|when|while|with"; - - var storageType = "bit|bit_vector|boolean|character|integer|line|natural|"+ - "positive|real|register|severity|signal|signed|"+ - "std_logic|std_logic_vector|string||text|time|unsigned|"+ - "variable"; - - var storageModifiers = "array|constant"; - - var keywordOperators = "abs|and|mod|nand|nor|not|rem|rol|ror|sla|sll|sra"+ - "srl|xnor|xor"; - - var builtinConstants = ( - "true|false|null" - ); - - - var keywordMapper = this.createKeywordMapper({ - "keyword.operator": keywordOperators, - "keyword": keywords, - "constant.language": builtinConstants, - "storage.modifier": storageModifiers, - "storage.type": storageType - }, "identifier", true); - - this.$rules = { - "start" : [ { - token : "comment", - regex : "--.*$" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "string", // ' string - regex : "'.*?'" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "keyword", // pre-compiler directives - regex : "\\s*(?:library|package|use)\\b", - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "&|\\*|\\+|\\-|\\/|<|=|>|\\||=>|\\*\\*|:=|\\/=|>=|<=|<>" - }, { - token : "punctuation.operator", - regex : "\\'|\\:|\\,|\\;|\\." - },{ - token : "paren.lparen", - regex : "[[(]" - }, { - token : "paren.rparen", - regex : "[\\])]" - }, { - token : "text", - regex : "\\s+" - } ], - - - }; -}; - -oop.inherits(VHDLHighlightRules, TextHighlightRules); - -exports.VHDLHighlightRules = VHDLHighlightRules; -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-xml.js b/util/build-sample-browser/player/vendor/ace/mode-xml.js deleted file mode 100644 index 18a283fa6c..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-xml.js +++ /dev/null @@ -1,967 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; -var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; -var XmlFoldMode = require("./folding/xml").FoldMode; - -var Mode = function() { - this.HighlightRules = XmlHighlightRules; - this.$behaviour = new XmlBehaviour(); - this.foldingRules = new XmlFoldMode(); -}; - -oop.inherits(Mode, TextMode); - -(function() { - - this.blockComment = {start: ""}; - - this.$id = "ace/mode/xml"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var xmlUtil = require("./xml_util"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function(normalize) { - this.$rules = { - start : [ - {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" - }, - { - token : ["punctuation.instruction.begin", "keyword.instruction"], - regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" - }, - {token : "comment", regex : "<\\!--", next : "comment"}, - { - token : ["punctuation.doctype.begin", "meta.tag.doctype"], - regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" - }, - {include : "tag"}, - {include : "reference"} - ], - - xml_declaration : [ - {include : "attributes"}, - {include : "instruction"} - ], - - instruction : [ - {token : "punctuation.instruction.end", regex : "\\?>", next : "start"} - ], - - doctype : [ - {include : "space"}, - {include : "string"}, - {token : "punctuation.doctype.end", regex : ">", next : "start"}, - {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, - {token : "punctuation.begin", regex : "\\[", push : "declarations"} - ], - - declarations : [{ - token : "text", - regex : "\\s+" - }, { - token: "punctuation.end", - regex: "]", - next: "pop" - }, { - token : ["punctuation.begin", "keyword"], - regex : "(<\\!)([-_a-zA-Z0-9]+)", - push : [{ - token : "text", - regex : "\\s+" - }, - { - token : "punctuation.end", - regex : ">", - next : "pop" - }, - {include : "string"}] - }], - - cdata : [ - {token : "string.end", regex : "\\]\\]>", next : "start"}, - {token : "text", regex : "\\s+"}, - {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} - ], - - comment : [ - {token : "comment", regex : "-->", next : "start"}, - {defaultToken : "comment"} - ], - - tag : [{ - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)", - next: [ - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} - ] - }, { - token : ["meta.tag.punctuation.begin", "meta.tag.name"], - regex : "(", next : "start"} - ] - }], - - space : [ - {token : "text", regex : "\\s+"} - ], - - reference : [{ - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", regex : "&" - }], - - string: [{ - token : "string", - regex : "'", - push : "qstring_inner" - }, { - token : "string", - regex : '"', - push : "qqstring_inner" - }], - - qstring_inner: [ - {token : "string", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - qqstring_inner: [ - {token : "string", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string"} - ], - - attributes: [{ - token : "entity.other.attribute-name", - regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" - }, { - token : "keyword.operator.separator", - regex : "=" - }, { - include : "space" - }, { - include : "string" - }] - }; - - if (this.constructor === XmlHighlightRules) - this.normalizeRules(); -}; - - -(function() { - - this.embedTagRules = function(HighlightRules, prefix, tag){ - this.$rules.tag.unshift({ - token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(<)(" + tag + ")", - next: [ - {include : "space"}, - {include : "attributes"}, - {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} - ] - }); - - this.$rules[tag + "-end"] = [ - {include : "space"}, - {token : "meta.tag.punctuation.end", regex : ">", next: "start", - onMatch : function(value, currentState, stack) { - stack.splice(0); - return this.token; - }} - ] - - this.embedRules(HighlightRules, prefix, [{ - token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], - regex : "(" - }]); - }; - -}).call(TextHighlightRules.prototype); - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; -}); - -ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) { - - -function string(state) { - return [{ - token : "string", - regex : '"', - next : state + "_qqstring" - }, { - token : "string", - regex : "'", - next : state + "_qstring" - }]; -} - -function multiLineString(quote, state) { - return [ - {token : "string", regex : quote, next : state}, - { - token : "constant.language.escape", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {defaultToken : "string"} - ]; -} - -exports.tag = function(states, name, nextState, tagMap) { - states[name] = [{ - token : "text", - regex : "\\s+" - }, { - - token : !tagMap ? "meta.tag.tag-name" : function(value) { - if (tagMap[value]) - return "meta.tag.tag-name." + tagMap[value]; - else - return "meta.tag.tag-name"; - }, - regex : "[-_a-zA-Z0-9:]+", - next : name + "_embed_attribute_list" - }, { - token: "empty", - regex: "", - next : name + "_embed_attribute_list" - }]; - - states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list"); - states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); - - states[name + "_embed_attribute_list"] = [{ - token : "meta.tag.r", - regex : "/?>", - next : nextState - }, { - token : "keyword.operator", - regex : "=" - }, { - token : "entity.other.attribute-name", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "text", - regex : "\\s+" - }].concat(string(name)); -}; - -}); - -ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -function hasType(token, type) { - var tokenTypes = token.type.split('.'); - return type.split('.').every(function(type){ - return (tokenTypes.indexOf(type) !== -1); - }); - return hasType; -} - -var XmlBehaviour = function () { - - this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - - if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) - return; - var atCursor = false; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) { - return; - } - var tag = token.value; - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - this.add('autoindent', 'insertion', function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var rightChars = line.substring(cursor.column, cursor.column + 2); - if (rightChars == ' selection.start.column) { - break; - } - col += tokens[x].value.length; - } - if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) { - if (!CstyleBehaviour.isSaneInsertion(editor, session)) - return; - return { - text: quote + quote, - selection: [1,1] - }; - } else if (token && token.type === "string") { - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == quote) { - return { - text: '', - selection: [1, 1] - }; - } - } - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - -ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) { - - -var oop = require("../../lib/oop"); -var lang = require("../../lib/lang"); -var Range = require("../../range").Range; -var BaseFoldMode = require("./fold_mode").FoldMode; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var FoldMode = exports.FoldMode = function(voidElements) { - BaseFoldMode.call(this); - this.voidElements = voidElements || {}; -}; -oop.inherits(FoldMode, BaseFoldMode); - -(function() { - - this.getFoldWidget = function(session, foldStyle, row) { - var tag = this._getFirstTagInLine(session, row); - - if (tag.closing) - return foldStyle == "markbeginend" ? "end" : ""; - - if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) - return ""; - - if (tag.selfClosing) - return ""; - - if (tag.value.indexOf("/" + tag.tagName) !== -1) - return ""; - - return "start"; - }; - - this._getFirstTagInLine = function(session, row) { - var tokens = session.getTokens(row); - var value = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type.lastIndexOf("meta.tag", 0) === 0) - value += token.value; - else - value += lang.stringRepeat(" ", token.value.length); - } - - return this._parseTag(value); - }; - - this.tagRe = /^(\s*)(?)/; - this._parseTag = function(tag) { - - var match = tag.match(this.tagRe); - var column = 0; - - return { - value: tag, - match: match ? match[2] : "", - closing: match ? !!match[3] : false, - selfClosing: match ? !!match[5] || match[2] == "/>" : false, - tagName: match ? match[4] : "", - column: match[1] ? column + match[1].length : column - }; - }; - this._readTagForward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var start; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!start) { - var start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - } - value += token.value; - if (value.indexOf(">") !== -1) { - var tag = this._parseTag(value); - tag.start = start; - tag.end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - iterator.stepForward(); - return tag; - } - } - } while(token = iterator.stepForward()); - - return null; - }; - - this._readTagBackward = function(iterator) { - var token = iterator.getCurrentToken(); - if (!token) - return null; - - var value = ""; - var end; - - do { - if (token.type.lastIndexOf("meta.tag", 0) === 0) { - if (!end) { - end = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() + token.value.length - }; - } - value = token.value + value; - if (value.indexOf("<") !== -1) { - var tag = this._parseTag(value); - tag.end = end; - tag.start = { - row: iterator.getCurrentTokenRow(), - column: iterator.getCurrentTokenColumn() - }; - iterator.stepBackward(); - return tag; - } - } - } while(token = iterator.stepBackward()); - - return null; - }; - - this._pop = function(stack, tag) { - while (stack.length) { - - var top = stack[stack.length-1]; - if (!tag || top.tagName == tag.tagName) { - return stack.pop(); - } - else if (this.voidElements[tag.tagName]) { - return; - } - else if (this.voidElements[top.tagName]) { - stack.pop(); - continue; - } else { - return null; - } - } - }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - var firstTag = this._getFirstTagInLine(session, row); - - if (!firstTag.match) - return null; - - var isBackward = firstTag.closing || firstTag.selfClosing; - var stack = []; - var tag; - - if (!isBackward) { - var iterator = new TokenIterator(session, row, firstTag.column); - var start = { - row: row, - column: firstTag.column + firstTag.tagName.length + 2 - }; - while (tag = this._readTagForward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) - return Range.fromPoints(start, tag.start); - } - else { - stack.push(tag) - } - } - } - else { - var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); - var end = { - row: row, - column: firstTag.column - }; - - while (tag = this._readTagBackward(iterator)) { - if (tag.selfClosing) { - if (!stack.length) { - tag.start.column += tag.tagName.length + 2; - tag.end.column -= 2; - return Range.fromPoints(tag.start, tag.end); - } else - continue; - } - - if (!tag.closing) { - this._pop(stack, tag); - if (stack.length == 0) { - tag.start.column += tag.tagName.length + 2; - return Range.fromPoints(tag.start, end); - } - } - else { - stack.push(tag) - } - } - } - - }; - -}).call(FoldMode.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/mode-xquery.js b/util/build-sample-browser/player/vendor/ace/mode-xquery.js deleted file mode 100644 index 8d123dc613..0000000000 --- a/util/build-sample-browser/player/vendor/ace/mode-xquery.js +++ /dev/null @@ -1,2825 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ -ace.define('ace/mode/xquery', ['require', 'exports', 'module' , 'ace/worker/worker_client', 'ace/lib/oop', 'ace/mode/text', 'ace/mode/xquery/XQueryLexer', 'ace/range', 'ace/mode/behaviour/xquery', 'ace/mode/folding/cstyle'], function(require, exports, module) { - - -var WorkerClient = require("../worker/worker_client").WorkerClient; -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var XQueryLexer = require("./xquery/XQueryLexer").XQueryLexer; -var Range = require("../range").Range; -var XQueryBehaviour = require("./behaviour/xquery").XQueryBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - - -var Mode = function() { - this.$tokenizer = new XQueryLexer(); - this.$behaviour = new XQueryBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; - -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var match = line.match(/\s*(?:then|else|return|[{\(]|<\w+>)\s*$/); - if (match) - indent += tab; - return indent; - }; - - this.checkOutdent = function(state, line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*[\}\)]/.test(input); - }; - - this.autoOutdent = function(state, doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*[\}\)])/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - var i, line; - var outdent = true; - var re = /^\s*\(:(.*):\)/; - - for (i=startRow; i<= endRow; i++) { - if (!re.test(doc.getLine(i))) { - outdent = false; - break; - } - } - - var range = new Range(0, 0, 0, 0); - for (i=startRow; i<= endRow; i++) { - line = doc.getLine(i); - range.start.row = i; - range.end.row = i; - range.end.column = line.length; - - doc.replace(range, outdent ? line.match(re)[1] : "(:" + line + ":)"); - } - }; - - this.createWorker = function(session) { - - var worker = new WorkerClient(["ace"], "ace/mode/xquery_worker", "XQueryWorker"); - var that = this; - - worker.attachToDocument(session.getDocument()); - - worker.on("error", function(e) { - session.setAnnotations([e.data]); - }); - - worker.on("ok", function(e) { - session.clearAnnotations(); - }); - - worker.on("highlight", function(tokens) { - that.$tokenizer.tokens = tokens.data.tokens; - that.$tokenizer.lines = session.getDocument().getAllLines(); - - var rows = Object.keys(that.$tokenizer.tokens); - for(var i=0; i < rows.length; i++) { - var row = parseInt(rows[i]); - delete session.bgTokenizer.lines[row]; - delete session.bgTokenizer.states[row]; - session.bgTokenizer.fireUpdateEvent(row, row); - } - }); - - return worker; - }; - - this.$id = "ace/mode/xquery"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - -ace.define('ace/mode/xquery/XQueryLexer', ['require', 'exports', 'module' , 'ace/mode/xquery/XQueryTokenizer'], function(require, exports, module) { - - var XQueryTokenizer = require("./XQueryTokenizer").XQueryTokenizer; - - var TokenHandler = function(code) { - - var input = code; - - this.tokens = []; - - this.reset = function(code) { - input = input; - this.tokens = []; - }; - - this.startNonterminal = function(name, begin) {}; - - this.endNonterminal = function(name, end) {}; - - this.terminal = function(name, begin, end) { - this.tokens.push({ - name: name, - value: input.substring(begin, end) - }); - }; - - this.whitespace = function(begin, end) { - this.tokens.push({ - name: "WS", - value: input.substring(begin, end) - }); - }; - }; - - var keys = "after|ancestor|ancestor-or-self|and|as|ascending|attribute|before|case|cast|castable|child|collation|comment|copy|count|declare|default|delete|descendant|descendant-or-self|descending|div|document|document-node|element|else|empty|empty-sequence|end|eq|every|except|first|following|following-sibling|for|function|ge|group|gt|idiv|if|import|insert|instance|intersect|into|is|item|last|le|let|lt|mod|modify|module|namespace|namespace-node|ne|node|only|or|order|ordered|parent|preceding|preceding-sibling|processing-instruction|rename|replace|return|satisfies|schema-attribute|schema-element|self|some|stable|start|switch|text|to|treat|try|typeswitch|union|unordered|validate|where|with|xquery|contains|paragraphs|sentences|times|words|by|collectionreturn|variable|version|option|when|encoding|toswitch|catch|tumbling|sliding|window|at|using|stemming|collection|schema|while|on|nodes|index|external|then|in|updating|value|of|containsbreak|loop|continue|exit|returning|append|json|position|strict".split("|"); - var keywords = keys.map( - function(val) { return { name: "'" + val + "'", token: "keyword" }; } - ); - - var ncnames = keys.map( - function(val) { return { name: "'" + val + "'", token: "text", next: function(stack){ stack.pop(); } }; } - ); - - var cdata = "constant.language"; - var number = "constant"; - var xmlcomment = "comment"; - var pi = "xml-pe"; - var pragma = "constant.buildin"; - - var Rules = { - start: [ - { name: "'(#'", token: pragma, next: function(stack){ stack.push("Pragma"); } }, - { name: "'(:'", token: "comment", next: function(stack){ stack.push("Comment"); } }, - { name: "'(:~'", token: "comment.doc", next: function(stack){ stack.push("CommentDoc"); } }, - { name: "''", token: xmlcomment, next: function(stack){ stack.pop(); } } - ], - CData: [ - { name: "CDataSectionContents", token: cdata }, - { name: "']]>'", token: cdata, next: function(stack){ stack.pop(); } } - ], - PI: [ - { name: "DirPIContents", token: pi }, - { name: "'?'", token: pi }, - { name: "'?>'", token: pi, next: function(stack){ stack.pop(); } } - ], - AposString: [ - { name: "''''", token: "string", next: function(stack){ stack.pop(); } }, - { name: "PredefinedEntityRef", token: "constant.language.escape" }, - { name: "CharRef", token: "constant.language.escape" }, - { name: "EscapeApos", token: "constant.language.escape" }, - { name: "AposChar", token: "string" } - ], - QuotString: [ - { name: "'\"'", token: "string", next: function(stack){ stack.pop(); } }, - { name: "PredefinedEntityRef", token: "constant.language.escape" }, - { name: "CharRef", token: "constant.language.escape" }, - { name: "EscapeQuot", token: "constant.language.escape" }, - { name: "QuotChar", token: "string" } - ] - }; - -exports.XQueryLexer = function() { - - this.tokens = []; - - this.getLineTokens = function(line, state, row) { - state = (state === "start" || !state) ? '["start"]' : state; - var stack = JSON.parse(state); - var h = new TokenHandler(line); - var tokenizer = new XQueryTokenizer(line, h); - var tokens = []; - - while(true) { - var currentState = stack[stack.length - 1]; - try { - - h.tokens = []; - tokenizer["parse_" + currentState](); - var info = null; - - if(h.tokens.length > 1 && h.tokens[0].name === "WS") { - tokens.push({ - type: "text", - value: h.tokens[0].value - }); - h.tokens.splice(0, 1); - } - - var token = h.tokens[0]; - var rules = Rules[currentState]; - for(var k = 0; k < rules.length; k++) { - var rule = Rules[currentState][k]; - if((typeof(rule.name) === "function" && rule.name(token)) || rule.name === token.name) { - info = rule; - break; - } - } - - if(token.name === "EOF") { break; } - if(token.value === "") { throw "Encountered empty string lexical rule."; } - - tokens.push({ - type: info === null ? "text" : (typeof(info.token) === "function" ? info.token(token.value) : info.token), - value: token.value - }); - - if(info && info.next) { - info.next(stack); - } - - } catch(e) { - if(e instanceof tokenizer.ParseException) { - var index = 0; - for(var i=0; i < tokens.length; i++) { - index += tokens[i].value.length; - } - tokens.push({ type: "text", value: line.substring(index) }); - return { - tokens: tokens, - state: JSON.stringify(["start"]) - }; - } else { - throw e; - } - } - } - - - if(this.tokens[row] !== undefined) { - var cachedLine = this.lines[row]; - var begin = sharedStart([line, cachedLine]); - var diff = cachedLine.length - line.length; - var idx = 0; - var col = 0; - for(var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - for(var j = 0; j < this.tokens[row].length; j++) { - var semanticToken = this.tokens[row][j]; - if( - ((col + token.value.length) <= begin.length && semanticToken.sc === col && semanticToken.ec === (col + token.value.length)) || - (semanticToken.sc === (col + diff) && semanticToken.ec === (col + token.value.length + diff)) - ) { - idx = i; - tokens[i].type = semanticToken.type; - } - } - col += token.value.length; - } - } - - return { - tokens: tokens, - state: JSON.stringify(stack) - }; - }; - - function sharedStart(A) { - var tem1, tem2, s, A = A.slice(0).sort(); - tem1 = A[0]; - s = tem1.length; - tem2 = A.pop(); - while(s && tem2.indexOf(tem1) == -1) { - tem1 = tem1.substring(0, --s); - } - return tem1; - } -}; -}); - - ace.define('ace/mode/xquery/XQueryTokenizer', ['require', 'exports', 'module' ], function(require, exports, module) { - var XQueryTokenizer = exports.XQueryTokenizer = function XQueryTokenizer(string, parsingEventHandler) - { - init(string, parsingEventHandler); - var self = this; - - this.ParseException = function(b, e, s, o, x) - { - var - begin = b, - end = e, - state = s, - offending = o, - expected = x; - - this.getBegin = function() {return begin;}; - this.getEnd = function() {return end;}; - this.getState = function() {return state;}; - this.getExpected = function() {return expected;}; - this.getOffending = function() {return offending;}; - - this.getMessage = function() - { - return offending < 0 ? "lexical analysis failed" : "syntax error"; - }; - }; - - function init(string, parsingEventHandler) - { - eventHandler = parsingEventHandler; - input = string; - size = string.length; - reset(0, 0, 0); - } - - this.getInput = function() - { - return input; - }; - - function reset(l, b, e) - { - b0 = b; e0 = b; - l1 = l; b1 = b; e1 = e; - end = e; - eventHandler.reset(input); - } - - this.getOffendingToken = function(e) - { - var o = e.getOffending(); - return o >= 0 ? XQueryTokenizer.TOKEN[o] : null; - }; - - this.getExpectedTokenSet = function(e) - { - var expected; - if (e.getExpected() < 0) - { - expected = XQueryTokenizer.getTokenSet(- e.getState()); - } - else - { - expected = [XQueryTokenizer.TOKEN[e.getExpected()]]; - } - return expected; - }; - - this.getErrorMessage = function(e) - { - var tokenSet = this.getExpectedTokenSet(e); - var found = this.getOffendingToken(e); - var prefix = input.substring(0, e.getBegin()); - var lines = prefix.split("\n"); - var line = lines.length; - var column = lines[line - 1].length + 1; - var size = e.getEnd() - e.getBegin(); - return e.getMessage() - + (found == null ? "" : ", found " + found) - + "\nwhile expecting " - + (tokenSet.length == 1 ? tokenSet[0] : ("[" + tokenSet.join(", ") + "]")) - + "\n" - + (size == 0 || found != null ? "" : "after successfully scanning " + size + " characters beginning ") - + "at line " + line + ", column " + column + ":\n..." - + input.substring(e.getBegin(), Math.min(input.length, e.getBegin() + 64)) - + "..."; - }; - - this.parse_start = function() - { - eventHandler.startNonterminal("start", e0); - lookahead1W(14); // ModuleDecl | Annotation | OptionDecl | Operator | Variable | Tag | AttrTest | - switch (l1) - { - case 55: // '' | '=' | '>' - switch (l1) - { - case 58: // '>' - shift(58); // '>' - break; - case 50: // '/>' - shift(50); // '/>' - break; - case 27: // QName - shift(27); // QName - break; - case 57: // '=' - shift(57); // '=' - break; - case 35: // '"' - shift(35); // '"' - break; - case 38: // "'" - shift(38); // "'" - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("StartTag", e0); - }; - - this.parse_TagContent = function() - { - eventHandler.startNonterminal("TagContent", e0); - lookahead1(11); // Tag | EndTag | PredefinedEntityRef | ElementContentChar | CharRef | EOF | - switch (l1) - { - case 23: // ElementContentChar - shift(23); // ElementContentChar - break; - case 6: // Tag - shift(6); // Tag - break; - case 7: // EndTag - shift(7); // EndTag - break; - case 55: // '' - switch (l1) - { - case 11: // CDataSectionContents - shift(11); // CDataSectionContents - break; - case 64: // ']]>' - shift(64); // ']]>' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("CData", e0); - }; - - this.parse_XMLComment = function() - { - eventHandler.startNonterminal("XMLComment", e0); - lookahead1(0); // DirCommentContents | EOF | '-->' - switch (l1) - { - case 9: // DirCommentContents - shift(9); // DirCommentContents - break; - case 47: // '-->' - shift(47); // '-->' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("XMLComment", e0); - }; - - this.parse_PI = function() - { - eventHandler.startNonterminal("PI", e0); - lookahead1(3); // DirPIContents | EOF | '?' | '?>' - switch (l1) - { - case 10: // DirPIContents - shift(10); // DirPIContents - break; - case 59: // '?' - shift(59); // '?' - break; - case 60: // '?>' - shift(60); // '?>' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("PI", e0); - }; - - this.parse_Pragma = function() - { - eventHandler.startNonterminal("Pragma", e0); - lookahead1(2); // PragmaContents | EOF | '#' | '#)' - switch (l1) - { - case 8: // PragmaContents - shift(8); // PragmaContents - break; - case 36: // '#' - shift(36); // '#' - break; - case 37: // '#)' - shift(37); // '#)' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("Pragma", e0); - }; - - this.parse_Comment = function() - { - eventHandler.startNonterminal("Comment", e0); - lookahead1(4); // CommentContents | EOF | '(:' | ':)' - switch (l1) - { - case 52: // ':)' - shift(52); // ':)' - break; - case 41: // '(:' - shift(41); // '(:' - break; - case 30: // CommentContents - shift(30); // CommentContents - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("Comment", e0); - }; - - this.parse_CommentDoc = function() - { - eventHandler.startNonterminal("CommentDoc", e0); - lookahead1(5); // DocTag | DocCommentContents | EOF | '(:' | ':)' - switch (l1) - { - case 31: // DocTag - shift(31); // DocTag - break; - case 32: // DocCommentContents - shift(32); // DocCommentContents - break; - case 52: // ':)' - shift(52); // ':)' - break; - case 41: // '(:' - shift(41); // '(:' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("CommentDoc", e0); - }; - - this.parse_QuotString = function() - { - eventHandler.startNonterminal("QuotString", e0); - lookahead1(6); // PredefinedEntityRef | EscapeQuot | QuotChar | CharRef | EOF | '"' - switch (l1) - { - case 18: // PredefinedEntityRef - shift(18); // PredefinedEntityRef - break; - case 29: // CharRef - shift(29); // CharRef - break; - case 19: // EscapeQuot - shift(19); // EscapeQuot - break; - case 21: // QuotChar - shift(21); // QuotChar - break; - case 35: // '"' - shift(35); // '"' - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("QuotString", e0); - }; - - this.parse_AposString = function() - { - eventHandler.startNonterminal("AposString", e0); - lookahead1(7); // PredefinedEntityRef | EscapeApos | AposChar | CharRef | EOF | "'" - switch (l1) - { - case 18: // PredefinedEntityRef - shift(18); // PredefinedEntityRef - break; - case 29: // CharRef - shift(29); // CharRef - break; - case 20: // EscapeApos - shift(20); // EscapeApos - break; - case 22: // AposChar - shift(22); // AposChar - break; - case 38: // "'" - shift(38); // "'" - break; - default: - shift(33); // EOF - } - eventHandler.endNonterminal("AposString", e0); - }; - - this.parse_Prefix = function() - { - eventHandler.startNonterminal("Prefix", e0); - lookahead1W(13); // NCName^Token | S^WS | 'after' | 'allowing' | 'ancestor' | 'ancestor-or-self' | - whitespace(); - parse_NCName(); - eventHandler.endNonterminal("Prefix", e0); - }; - - this.parse__EQName = function() - { - eventHandler.startNonterminal("_EQName", e0); - lookahead1W(12); // EQName^Token | S^WS | 'after' | 'allowing' | 'ancestor' | 'ancestor-or-self' | - whitespace(); - parse_EQName(); - eventHandler.endNonterminal("_EQName", e0); - }; - - function parse_EQName() - { - eventHandler.startNonterminal("EQName", e0); - switch (l1) - { - case 77: // 'attribute' - shift(77); // 'attribute' - break; - case 91: // 'comment' - shift(91); // 'comment' - break; - case 115: // 'document-node' - shift(115); // 'document-node' - break; - case 116: // 'element' - shift(116); // 'element' - break; - case 119: // 'empty-sequence' - shift(119); // 'empty-sequence' - break; - case 140: // 'function' - shift(140); // 'function' - break; - case 147: // 'if' - shift(147); // 'if' - break; - case 160: // 'item' - shift(160); // 'item' - break; - case 180: // 'namespace-node' - shift(180); // 'namespace-node' - break; - case 186: // 'node' - shift(186); // 'node' - break; - case 211: // 'processing-instruction' - shift(211); // 'processing-instruction' - break; - case 221: // 'schema-attribute' - shift(221); // 'schema-attribute' - break; - case 222: // 'schema-element' - shift(222); // 'schema-element' - break; - case 238: // 'switch' - shift(238); // 'switch' - break; - case 239: // 'text' - shift(239); // 'text' - break; - case 248: // 'typeswitch' - shift(248); // 'typeswitch' - break; - default: - parse_FunctionName(); - } - eventHandler.endNonterminal("EQName", e0); - } - - function parse_FunctionName() - { - eventHandler.startNonterminal("FunctionName", e0); - switch (l1) - { - case 14: // EQName^Token - shift(14); // EQName^Token - break; - case 65: // 'after' - shift(65); // 'after' - break; - case 68: // 'ancestor' - shift(68); // 'ancestor' - break; - case 69: // 'ancestor-or-self' - shift(69); // 'ancestor-or-self' - break; - case 70: // 'and' - shift(70); // 'and' - break; - case 74: // 'as' - shift(74); // 'as' - break; - case 75: // 'ascending' - shift(75); // 'ascending' - break; - case 79: // 'before' - shift(79); // 'before' - break; - case 83: // 'case' - shift(83); // 'case' - break; - case 84: // 'cast' - shift(84); // 'cast' - break; - case 85: // 'castable' - shift(85); // 'castable' - break; - case 88: // 'child' - shift(88); // 'child' - break; - case 89: // 'collation' - shift(89); // 'collation' - break; - case 98: // 'copy' - shift(98); // 'copy' - break; - case 100: // 'count' - shift(100); // 'count' - break; - case 103: // 'declare' - shift(103); // 'declare' - break; - case 104: // 'default' - shift(104); // 'default' - break; - case 105: // 'delete' - shift(105); // 'delete' - break; - case 106: // 'descendant' - shift(106); // 'descendant' - break; - case 107: // 'descendant-or-self' - shift(107); // 'descendant-or-self' - break; - case 108: // 'descending' - shift(108); // 'descending' - break; - case 113: // 'div' - shift(113); // 'div' - break; - case 114: // 'document' - shift(114); // 'document' - break; - case 117: // 'else' - shift(117); // 'else' - break; - case 118: // 'empty' - shift(118); // 'empty' - break; - case 121: // 'end' - shift(121); // 'end' - break; - case 123: // 'eq' - shift(123); // 'eq' - break; - case 124: // 'every' - shift(124); // 'every' - break; - case 126: // 'except' - shift(126); // 'except' - break; - case 129: // 'first' - shift(129); // 'first' - break; - case 130: // 'following' - shift(130); // 'following' - break; - case 131: // 'following-sibling' - shift(131); // 'following-sibling' - break; - case 132: // 'for' - shift(132); // 'for' - break; - case 141: // 'ge' - shift(141); // 'ge' - break; - case 143: // 'group' - shift(143); // 'group' - break; - case 145: // 'gt' - shift(145); // 'gt' - break; - case 146: // 'idiv' - shift(146); // 'idiv' - break; - case 148: // 'import' - shift(148); // 'import' - break; - case 154: // 'insert' - shift(154); // 'insert' - break; - case 155: // 'instance' - shift(155); // 'instance' - break; - case 157: // 'intersect' - shift(157); // 'intersect' - break; - case 158: // 'into' - shift(158); // 'into' - break; - case 159: // 'is' - shift(159); // 'is' - break; - case 165: // 'last' - shift(165); // 'last' - break; - case 167: // 'le' - shift(167); // 'le' - break; - case 169: // 'let' - shift(169); // 'let' - break; - case 173: // 'lt' - shift(173); // 'lt' - break; - case 175: // 'mod' - shift(175); // 'mod' - break; - case 176: // 'modify' - shift(176); // 'modify' - break; - case 177: // 'module' - shift(177); // 'module' - break; - case 179: // 'namespace' - shift(179); // 'namespace' - break; - case 181: // 'ne' - shift(181); // 'ne' - break; - case 193: // 'only' - shift(193); // 'only' - break; - case 195: // 'or' - shift(195); // 'or' - break; - case 196: // 'order' - shift(196); // 'order' - break; - case 197: // 'ordered' - shift(197); // 'ordered' - break; - case 201: // 'parent' - shift(201); // 'parent' - break; - case 207: // 'preceding' - shift(207); // 'preceding' - break; - case 208: // 'preceding-sibling' - shift(208); // 'preceding-sibling' - break; - case 213: // 'rename' - shift(213); // 'rename' - break; - case 214: // 'replace' - shift(214); // 'replace' - break; - case 215: // 'return' - shift(215); // 'return' - break; - case 219: // 'satisfies' - shift(219); // 'satisfies' - break; - case 224: // 'self' - shift(224); // 'self' - break; - case 230: // 'some' - shift(230); // 'some' - break; - case 231: // 'stable' - shift(231); // 'stable' - break; - case 232: // 'start' - shift(232); // 'start' - break; - case 243: // 'to' - shift(243); // 'to' - break; - case 244: // 'treat' - shift(244); // 'treat' - break; - case 245: // 'try' - shift(245); // 'try' - break; - case 249: // 'union' - shift(249); // 'union' - break; - case 251: // 'unordered' - shift(251); // 'unordered' - break; - case 255: // 'validate' - shift(255); // 'validate' - break; - case 261: // 'where' - shift(261); // 'where' - break; - case 265: // 'with' - shift(265); // 'with' - break; - case 269: // 'xquery' - shift(269); // 'xquery' - break; - case 67: // 'allowing' - shift(67); // 'allowing' - break; - case 76: // 'at' - shift(76); // 'at' - break; - case 78: // 'base-uri' - shift(78); // 'base-uri' - break; - case 80: // 'boundary-space' - shift(80); // 'boundary-space' - break; - case 81: // 'break' - shift(81); // 'break' - break; - case 86: // 'catch' - shift(86); // 'catch' - break; - case 93: // 'construction' - shift(93); // 'construction' - break; - case 96: // 'context' - shift(96); // 'context' - break; - case 97: // 'continue' - shift(97); // 'continue' - break; - case 99: // 'copy-namespaces' - shift(99); // 'copy-namespaces' - break; - case 101: // 'decimal-format' - shift(101); // 'decimal-format' - break; - case 120: // 'encoding' - shift(120); // 'encoding' - break; - case 127: // 'exit' - shift(127); // 'exit' - break; - case 128: // 'external' - shift(128); // 'external' - break; - case 136: // 'ft-option' - shift(136); // 'ft-option' - break; - case 149: // 'in' - shift(149); // 'in' - break; - case 150: // 'index' - shift(150); // 'index' - break; - case 156: // 'integrity' - shift(156); // 'integrity' - break; - case 166: // 'lax' - shift(166); // 'lax' - break; - case 187: // 'nodes' - shift(187); // 'nodes' - break; - case 194: // 'option' - shift(194); // 'option' - break; - case 198: // 'ordering' - shift(198); // 'ordering' - break; - case 217: // 'revalidation' - shift(217); // 'revalidation' - break; - case 220: // 'schema' - shift(220); // 'schema' - break; - case 223: // 'score' - shift(223); // 'score' - break; - case 229: // 'sliding' - shift(229); // 'sliding' - break; - case 235: // 'strict' - shift(235); // 'strict' - break; - case 246: // 'tumbling' - shift(246); // 'tumbling' - break; - case 247: // 'type' - shift(247); // 'type' - break; - case 252: // 'updating' - shift(252); // 'updating' - break; - case 256: // 'value' - shift(256); // 'value' - break; - case 257: // 'variable' - shift(257); // 'variable' - break; - case 258: // 'version' - shift(258); // 'version' - break; - case 262: // 'while' - shift(262); // 'while' - break; - case 92: // 'constraint' - shift(92); // 'constraint' - break; - case 171: // 'loop' - shift(171); // 'loop' - break; - default: - shift(216); // 'returning' - } - eventHandler.endNonterminal("FunctionName", e0); - } - - function parse_NCName() - { - eventHandler.startNonterminal("NCName", e0); - switch (l1) - { - case 26: // NCName^Token - shift(26); // NCName^Token - break; - case 65: // 'after' - shift(65); // 'after' - break; - case 70: // 'and' - shift(70); // 'and' - break; - case 74: // 'as' - shift(74); // 'as' - break; - case 75: // 'ascending' - shift(75); // 'ascending' - break; - case 79: // 'before' - shift(79); // 'before' - break; - case 83: // 'case' - shift(83); // 'case' - break; - case 84: // 'cast' - shift(84); // 'cast' - break; - case 85: // 'castable' - shift(85); // 'castable' - break; - case 89: // 'collation' - shift(89); // 'collation' - break; - case 100: // 'count' - shift(100); // 'count' - break; - case 104: // 'default' - shift(104); // 'default' - break; - case 108: // 'descending' - shift(108); // 'descending' - break; - case 113: // 'div' - shift(113); // 'div' - break; - case 117: // 'else' - shift(117); // 'else' - break; - case 118: // 'empty' - shift(118); // 'empty' - break; - case 121: // 'end' - shift(121); // 'end' - break; - case 123: // 'eq' - shift(123); // 'eq' - break; - case 126: // 'except' - shift(126); // 'except' - break; - case 132: // 'for' - shift(132); // 'for' - break; - case 141: // 'ge' - shift(141); // 'ge' - break; - case 143: // 'group' - shift(143); // 'group' - break; - case 145: // 'gt' - shift(145); // 'gt' - break; - case 146: // 'idiv' - shift(146); // 'idiv' - break; - case 155: // 'instance' - shift(155); // 'instance' - break; - case 157: // 'intersect' - shift(157); // 'intersect' - break; - case 158: // 'into' - shift(158); // 'into' - break; - case 159: // 'is' - shift(159); // 'is' - break; - case 167: // 'le' - shift(167); // 'le' - break; - case 169: // 'let' - shift(169); // 'let' - break; - case 173: // 'lt' - shift(173); // 'lt' - break; - case 175: // 'mod' - shift(175); // 'mod' - break; - case 176: // 'modify' - shift(176); // 'modify' - break; - case 181: // 'ne' - shift(181); // 'ne' - break; - case 193: // 'only' - shift(193); // 'only' - break; - case 195: // 'or' - shift(195); // 'or' - break; - case 196: // 'order' - shift(196); // 'order' - break; - case 215: // 'return' - shift(215); // 'return' - break; - case 219: // 'satisfies' - shift(219); // 'satisfies' - break; - case 231: // 'stable' - shift(231); // 'stable' - break; - case 232: // 'start' - shift(232); // 'start' - break; - case 243: // 'to' - shift(243); // 'to' - break; - case 244: // 'treat' - shift(244); // 'treat' - break; - case 249: // 'union' - shift(249); // 'union' - break; - case 261: // 'where' - shift(261); // 'where' - break; - case 265: // 'with' - shift(265); // 'with' - break; - case 68: // 'ancestor' - shift(68); // 'ancestor' - break; - case 69: // 'ancestor-or-self' - shift(69); // 'ancestor-or-self' - break; - case 77: // 'attribute' - shift(77); // 'attribute' - break; - case 88: // 'child' - shift(88); // 'child' - break; - case 91: // 'comment' - shift(91); // 'comment' - break; - case 98: // 'copy' - shift(98); // 'copy' - break; - case 103: // 'declare' - shift(103); // 'declare' - break; - case 105: // 'delete' - shift(105); // 'delete' - break; - case 106: // 'descendant' - shift(106); // 'descendant' - break; - case 107: // 'descendant-or-self' - shift(107); // 'descendant-or-self' - break; - case 114: // 'document' - shift(114); // 'document' - break; - case 115: // 'document-node' - shift(115); // 'document-node' - break; - case 116: // 'element' - shift(116); // 'element' - break; - case 119: // 'empty-sequence' - shift(119); // 'empty-sequence' - break; - case 124: // 'every' - shift(124); // 'every' - break; - case 129: // 'first' - shift(129); // 'first' - break; - case 130: // 'following' - shift(130); // 'following' - break; - case 131: // 'following-sibling' - shift(131); // 'following-sibling' - break; - case 140: // 'function' - shift(140); // 'function' - break; - case 147: // 'if' - shift(147); // 'if' - break; - case 148: // 'import' - shift(148); // 'import' - break; - case 154: // 'insert' - shift(154); // 'insert' - break; - case 160: // 'item' - shift(160); // 'item' - break; - case 165: // 'last' - shift(165); // 'last' - break; - case 177: // 'module' - shift(177); // 'module' - break; - case 179: // 'namespace' - shift(179); // 'namespace' - break; - case 180: // 'namespace-node' - shift(180); // 'namespace-node' - break; - case 186: // 'node' - shift(186); // 'node' - break; - case 197: // 'ordered' - shift(197); // 'ordered' - break; - case 201: // 'parent' - shift(201); // 'parent' - break; - case 207: // 'preceding' - shift(207); // 'preceding' - break; - case 208: // 'preceding-sibling' - shift(208); // 'preceding-sibling' - break; - case 211: // 'processing-instruction' - shift(211); // 'processing-instruction' - break; - case 213: // 'rename' - shift(213); // 'rename' - break; - case 214: // 'replace' - shift(214); // 'replace' - break; - case 221: // 'schema-attribute' - shift(221); // 'schema-attribute' - break; - case 222: // 'schema-element' - shift(222); // 'schema-element' - break; - case 224: // 'self' - shift(224); // 'self' - break; - case 230: // 'some' - shift(230); // 'some' - break; - case 238: // 'switch' - shift(238); // 'switch' - break; - case 239: // 'text' - shift(239); // 'text' - break; - case 245: // 'try' - shift(245); // 'try' - break; - case 248: // 'typeswitch' - shift(248); // 'typeswitch' - break; - case 251: // 'unordered' - shift(251); // 'unordered' - break; - case 255: // 'validate' - shift(255); // 'validate' - break; - case 257: // 'variable' - shift(257); // 'variable' - break; - case 269: // 'xquery' - shift(269); // 'xquery' - break; - case 67: // 'allowing' - shift(67); // 'allowing' - break; - case 76: // 'at' - shift(76); // 'at' - break; - case 78: // 'base-uri' - shift(78); // 'base-uri' - break; - case 80: // 'boundary-space' - shift(80); // 'boundary-space' - break; - case 81: // 'break' - shift(81); // 'break' - break; - case 86: // 'catch' - shift(86); // 'catch' - break; - case 93: // 'construction' - shift(93); // 'construction' - break; - case 96: // 'context' - shift(96); // 'context' - break; - case 97: // 'continue' - shift(97); // 'continue' - break; - case 99: // 'copy-namespaces' - shift(99); // 'copy-namespaces' - break; - case 101: // 'decimal-format' - shift(101); // 'decimal-format' - break; - case 120: // 'encoding' - shift(120); // 'encoding' - break; - case 127: // 'exit' - shift(127); // 'exit' - break; - case 128: // 'external' - shift(128); // 'external' - break; - case 136: // 'ft-option' - shift(136); // 'ft-option' - break; - case 149: // 'in' - shift(149); // 'in' - break; - case 150: // 'index' - shift(150); // 'index' - break; - case 156: // 'integrity' - shift(156); // 'integrity' - break; - case 166: // 'lax' - shift(166); // 'lax' - break; - case 187: // 'nodes' - shift(187); // 'nodes' - break; - case 194: // 'option' - shift(194); // 'option' - break; - case 198: // 'ordering' - shift(198); // 'ordering' - break; - case 217: // 'revalidation' - shift(217); // 'revalidation' - break; - case 220: // 'schema' - shift(220); // 'schema' - break; - case 223: // 'score' - shift(223); // 'score' - break; - case 229: // 'sliding' - shift(229); // 'sliding' - break; - case 235: // 'strict' - shift(235); // 'strict' - break; - case 246: // 'tumbling' - shift(246); // 'tumbling' - break; - case 247: // 'type' - shift(247); // 'type' - break; - case 252: // 'updating' - shift(252); // 'updating' - break; - case 256: // 'value' - shift(256); // 'value' - break; - case 258: // 'version' - shift(258); // 'version' - break; - case 262: // 'while' - shift(262); // 'while' - break; - case 92: // 'constraint' - shift(92); // 'constraint' - break; - case 171: // 'loop' - shift(171); // 'loop' - break; - default: - shift(216); // 'returning' - } - eventHandler.endNonterminal("NCName", e0); - } - - function shift(t) - { - if (l1 == t) - { - whitespace(); - eventHandler.terminal(XQueryTokenizer.TOKEN[l1], b1, e1 > size ? size : e1); - b0 = b1; e0 = e1; l1 = 0; - } - else - { - error(b1, e1, 0, l1, t); - } - } - - function whitespace() - { - if (e0 != b1) - { - b0 = e0; - e0 = b1; - eventHandler.whitespace(b0, e0); - } - } - - function matchW(set) - { - var code; - for (;;) - { - code = match(set); - if (code != 28) // S^WS - { - break; - } - } - return code; - } - - function lookahead1W(set) - { - if (l1 == 0) - { - l1 = matchW(set); - b1 = begin; - e1 = end; - } - } - - function lookahead1(set) - { - if (l1 == 0) - { - l1 = match(set); - b1 = begin; - e1 = end; - } - } - - function error(b, e, s, l, t) - { - throw new self.ParseException(b, e, s, l, t); - } - - var lk, b0, e0; - var l1, b1, e1; - var eventHandler; - - var input; - var size; - var begin; - var end; - - function match(tokenSetId) - { - var nonbmp = false; - begin = end; - var current = end; - var result = XQueryTokenizer.INITIAL[tokenSetId]; - var state = 0; - - for (var code = result & 4095; code != 0; ) - { - var charclass; - var c0 = current < size ? input.charCodeAt(current) : 0; - ++current; - if (c0 < 0x80) - { - charclass = XQueryTokenizer.MAP0[c0]; - } - else if (c0 < 0xd800) - { - var c1 = c0 >> 4; - charclass = XQueryTokenizer.MAP1[(c0 & 15) + XQueryTokenizer.MAP1[(c1 & 31) + XQueryTokenizer.MAP1[c1 >> 5]]]; - } - else - { - if (c0 < 0xdc00) - { - var c1 = current < size ? input.charCodeAt(current) : 0; - if (c1 >= 0xdc00 && c1 < 0xe000) - { - ++current; - c0 = ((c0 & 0x3ff) << 10) + (c1 & 0x3ff) + 0x10000; - nonbmp = true; - } - } - var lo = 0, hi = 5; - for (var m = 3; ; m = (hi + lo) >> 1) - { - if (XQueryTokenizer.MAP2[m] > c0) hi = m - 1; - else if (XQueryTokenizer.MAP2[6 + m] < c0) lo = m + 1; - else {charclass = XQueryTokenizer.MAP2[12 + m]; break;} - if (lo > hi) {charclass = 0; break;} - } - } - - state = code; - var i0 = (charclass << 12) + code - 1; - code = XQueryTokenizer.TRANSITION[(i0 & 15) + XQueryTokenizer.TRANSITION[i0 >> 4]]; - - if (code > 4095) - { - result = code; - code &= 4095; - end = current; - } - } - - result >>= 12; - if (result == 0) - { - end = current - 1; - var c1 = end < size ? input.charCodeAt(end) : 0; - if (c1 >= 0xdc00 && c1 < 0xe000) --end; - return error(begin, end, state, -1, -1); - } - - if (nonbmp) - { - for (var i = result >> 9; i > 0; --i) - { - --end; - var c1 = end < size ? input.charCodeAt(end) : 0; - if (c1 >= 0xdc00 && c1 < 0xe000) --end; - } - } - else - { - end -= result >> 9; - } - - return (result & 511) - 1; - } -} - -XQueryTokenizer.getTokenSet = function(tokenSetId) -{ - var set = []; - var s = tokenSetId < 0 ? - tokenSetId : INITIAL[tokenSetId] & 4095; - for (var i = 0; i < 276; i += 32) - { - var j = i; - var i0 = (i >> 5) * 2062 + s - 1; - var i1 = i0 >> 2; - var i2 = i1 >> 2; - var f = XQueryTokenizer.EXPECTED[(i0 & 3) + XQueryTokenizer.EXPECTED[(i1 & 3) + XQueryTokenizer.EXPECTED[(i2 & 3) + XQueryTokenizer.EXPECTED[i2 >> 2]]]]; - for ( ; f != 0; f >>>= 1, ++j) - { - if ((f & 1) != 0) - { - set.push(XQueryTokenizer.TOKEN[j]); - } - } - } - return set; -}; - -XQueryTokenizer.MAP0 = -[ 66, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, 33, 31, 31, 31, 31, 31, 31, 34, 35, 36, 35, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 31, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 31, 61, 62, 63, 64, 35 -]; - -XQueryTokenizer.MAP1 = -[ 108, 124, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 156, 181, 181, 181, 181, 181, 214, 215, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 247, 261, 277, 293, 309, 347, 363, 379, 416, 416, 416, 408, 331, 323, 331, 323, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 433, 433, 433, 433, 433, 433, 433, 316, 331, 331, 331, 331, 331, 331, 331, 331, 394, 416, 416, 417, 415, 416, 416, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 330, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 416, 66, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 35, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, 33, 31, 31, 31, 31, 31, 31, 34, 35, 36, 35, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 31, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 31, 61, 62, 63, 64, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 31, 31, 35, 35, 35, 35, 35, 35, 35, 65, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65 -]; - -XQueryTokenizer.MAP2 = -[ 57344, 63744, 64976, 65008, 65536, 983040, 63743, 64975, 65007, 65533, 983039, 1114111, 35, 31, 35, 31, 31, 35 -]; - -XQueryTokenizer.INITIAL = -[ 1, 2, 36867, 45060, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -]; - -XQueryTokenizer.TRANSITION = -[ 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22908, 18836, 17152, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 17365, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 17470, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 18157, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 17848, 17880, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18023, 36545, 18621, 18039, 18056, 18072, 18117, 18143, 18173, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17687, 18805, 18421, 18437, 18101, 17393, 18489, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 18579, 21711, 17152, 19008, 19233, 20367, 19008, 28684, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 17365, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 17470, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 18157, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 17848, 17880, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18023, 36545, 18621, 18039, 18056, 18072, 18117, 18143, 18173, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17687, 18805, 18421, 18437, 18101, 17393, 18489, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 20116, 18836, 18637, 19008, 19233, 21267, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 18763, 18778, 18794, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 18821, 22923, 18906, 19008, 19233, 17431, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18937, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 19054, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 18953, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21843, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21696, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22429, 20131, 18720, 19008, 19233, 20367, 19008, 17173, 23559, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 18087, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 21242, 19111, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 19024, 18836, 18609, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 19081, 22444, 18987, 19008, 19233, 20367, 19008, 19065, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21992, 22007, 18987, 19008, 19233, 20367, 19008, 18690, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22414, 18836, 18987, 19008, 19233, 30651, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 19138, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 19280, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 19172, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21783, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 19218, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21651, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 19249, 19265, 19307, 18888, 27857, 30536, 24401, 31444, 23357, 18888, 19351, 18888, 18890, 27211, 19370, 27211, 27211, 19392, 24401, 31911, 24401, 24401, 25467, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 28537, 19440, 24401, 24401, 24401, 24401, 24036, 17994, 24060, 18888, 18888, 18888, 18890, 19468, 27211, 27211, 27211, 27211, 19484, 35367, 19520, 24401, 24401, 24401, 19628, 18888, 29855, 18888, 18888, 23086, 27211, 19538, 27211, 27211, 30756, 24012, 24401, 19560, 24401, 24401, 26750, 18888, 18888, 19327, 27855, 27211, 27211, 19580, 17590, 24017, 24401, 24401, 19600, 25665, 18888, 18888, 28518, 27211, 27212, 24016, 19620, 19868, 28435, 25722, 18889, 19644, 27211, 32888, 35852, 19868, 31018, 19694, 19376, 19717, 22215, 19735, 22098, 19751, 35203, 19776, 19797, 19817, 19840, 25783, 31738, 24135, 19701, 19856, 31015, 23516, 31008, 28311, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21768, 18836, 19307, 18888, 27857, 27904, 24401, 29183, 28015, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 19888, 24401, 24401, 24401, 24401, 22953, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 28537, 19440, 24401, 24401, 24401, 24401, 24036, 18881, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22399, 18836, 19918, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21666, 18836, 19307, 18888, 27857, 27525, 24401, 29183, 21467, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 19946, 24401, 24401, 24401, 24401, 32382, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 28537, 19998, 24401, 24401, 24401, 24401, 31500, 18467, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 20021, 24401, 24401, 24401, 24401, 24401, 34271, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 32926, 29908, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 20050, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 20101, 19039, 20191, 20412, 20903, 17569, 20309, 20872, 25633, 20623, 20505, 20218, 20242, 17189, 17208, 17281, 20355, 20265, 20306, 20328, 20383, 22490, 20796, 20619, 21354, 20654, 20410, 20956, 21232, 20765, 17421, 20535, 17192, 18127, 22459, 20312, 25531, 22470, 20309, 20428, 18964, 20466, 20491, 21342, 21070, 20521, 20682, 17714, 18326, 17543, 17559, 17585, 22497, 20559, 19504, 20279, 20575, 20290, 20475, 20604, 20639, 20226, 20670, 17661, 21190, 17703, 21176, 17730, 19494, 20698, 20711, 22480, 21046, 21116, 18971, 21130, 20727, 20755, 17675, 17753, 17832, 17590, 25518, 20394, 20781, 20831, 20202, 20847, 21401, 17292, 17934, 17979, 18549, 20863, 20588, 25542, 20888, 20919, 18072, 18117, 20935, 20972, 21032, 21062, 21086, 18239, 21102, 18563, 21146, 21162, 21206, 18351, 20949, 20902, 18340, 21222, 21258, 21283, 18360, 20249, 17405, 21295, 21311, 21327, 20739, 20343, 21370, 21386, 21417, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21977, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 21452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 21504, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 36501, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 28674, 21946, 17617, 36473, 18223, 17237, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 21575, 21534, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 21560, 30628, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21798, 18836, 21612, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21636, 18836, 18987, 19008, 19233, 17902, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21753, 19096, 21903, 19008, 19233, 20367, 19008, 19291, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 17379, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 21931, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 18280, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21962, 18594, 18987, 19008, 19233, 22043, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21681, 21858, 18987, 19008, 19233, 20367, 19008, 21544, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 31500, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 32319, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 22231, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 31500, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 31678, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 31500, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 33588, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 35019, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22248, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 31500, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22324, 18836, 22059, 18888, 27857, 30501, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 34365, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22354, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 27086, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 19930, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21828, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22309, 22513, 18987, 19008, 19233, 20367, 19008, 19122, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 22544, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22608, 18836, 22988, 23004, 27585, 23020, 23036, 23067, 22087, 18888, 18888, 18888, 23083, 27211, 27211, 27211, 23102, 22121, 24401, 24401, 24401, 23122, 31386, 26154, 19674, 18888, 28119, 28232, 19424, 23705, 27211, 27211, 23142, 23173, 23189, 23212, 24401, 24401, 23246, 34427, 31693, 23262, 18888, 23290, 23308, 27783, 27620, 23327, 35263, 35107, 33383, 23346, 18193, 23393, 32748, 23968, 24401, 23414, 35153, 23463, 18888, 33913, 23442, 23482, 27211, 27211, 23532, 23552, 21431, 23575, 24401, 24401, 23604, 26095, 23635, 23657, 18888, 33482, 23685, 33251, 27211, 22187, 18851, 23721, 35536, 24401, 18887, 23750, 32641, 27211, 23769, 23787, 20080, 33012, 24384, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 23803, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 28224, 31826, 23823, 26917, 34978, 23850, 26493, 25782, 23878, 23914, 23516, 31008, 22105, 19419, 27963, 19659, 29781, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22623, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 28909, 25783, 27211, 27211, 27211, 34048, 23933, 22164, 24401, 24401, 24401, 28409, 23949, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 26583, 18888, 18888, 18888, 35585, 23984, 27211, 27211, 27211, 24005, 22201, 24033, 24401, 24401, 24401, 24052, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 26496, 24076, 24126, 24151, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22638, 18836, 22059, 19678, 27857, 24185, 24401, 24201, 24217, 26592, 18888, 18888, 18890, 24252, 24268, 27211, 27211, 22121, 24287, 24303, 24401, 24401, 30613, 19781, 35432, 36007, 32649, 18888, 25783, 24322, 28966, 23771, 27211, 35072, 22164, 24358, 32106, 26829, 24400, 31500, 31693, 18888, 18888, 18888, 24801, 18890, 27211, 27211, 27211, 27211, 24418, 19484, 24401, 24401, 24401, 24401, 20167, 31181, 18888, 18888, 18888, 27833, 23086, 27211, 27211, 33540, 27211, 30756, 21431, 24401, 24401, 22972, 24401, 26095, 18888, 36131, 18888, 27855, 27211, 24440, 27211, 22187, 22968, 24401, 24459, 24401, 31699, 28454, 18888, 34528, 34570, 35779, 24478, 24402, 24494, 25659, 18888, 36228, 27211, 27211, 24515, 30981, 23734, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 24538, 31017, 27856, 31741, 30059, 23377, 24563, 19837, 25782, 19760, 31015, 23516, 25374, 22105, 19419, 29793, 24579, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22653, 18836, 22059, 25756, 19982, 34097, 23196, 29183, 24614, 24110, 23641, 24673, 26103, 24697, 24443, 24713, 28558, 22121, 24748, 24462, 24764, 23398, 30613, 18888, 18888, 18888, 18888, 24798, 25783, 27211, 27211, 27211, 34232, 35072, 22164, 24401, 24401, 24401, 33302, 31500, 22559, 24106, 24232, 18888, 18888, 34970, 24817, 30411, 27211, 27211, 32484, 19484, 29750, 35127, 24401, 24401, 19872, 31181, 24852, 18888, 18888, 24871, 29221, 27211, 27211, 32072, 27211, 30756, 34441, 24401, 24401, 31571, 24401, 26095, 33141, 27802, 27011, 27855, 25295, 25607, 24888, 22187, 22968, 19195, 34593, 24906, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 33663, 27211, 27211, 24924, 24947, 23588, 31018, 18890, 27211, 31833, 22135, 19447, 23086, 23330, 19828, 30904, 31042, 24972, 19840, 25000, 31738, 30898, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 25016, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22668, 18836, 25041, 25057, 31320, 25073, 25089, 25105, 22087, 34796, 24236, 36138, 34870, 34125, 25121, 23106, 35497, 22248, 36613, 25137, 30671, 27365, 30613, 25153, 26447, 25199, 25233, 22574, 23274, 25249, 25265, 25281, 25318, 25344, 25360, 25400, 25428, 25452, 26731, 25504, 31693, 23669, 25558, 27407, 25575, 28599, 25934, 25599, 27211, 28180, 27304, 25623, 25839, 25649, 24401, 34820, 25681, 25698, 22586, 27775, 30190, 25745, 25778, 25799, 25817, 28995, 33569, 30756, 21518, 33443, 25837, 25855, 25893, 26095, 31254, 26677, 30136, 27855, 25930, 25950, 27211, 22187, 22968, 25966, 25986, 24401, 23428, 27763, 36330, 26959, 26002, 26029, 26045, 26085, 26119, 26170, 26203, 26222, 26239, 30527, 26372, 26274, 28404, 31018, 33757, 27211, 34262, 26316, 36729, 26345, 26366, 35337, 31017, 26388, 26407, 30954, 26350, 33861, 26434, 26463, 26479, 26512, 23516, 33189, 26531, 26547, 27963, 31293, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22683, 18836, 26568, 26181, 26608, 34097, 26643, 29183, 22087, 26669, 18888, 18888, 18890, 26693, 27211, 27211, 27211, 22121, 26720, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 26774, 25783, 27211, 27211, 27211, 26619, 35072, 22164, 24401, 24401, 24401, 21596, 31500, 31693, 18888, 18888, 33978, 18888, 18890, 27211, 27211, 25801, 27211, 27211, 19484, 24401, 24401, 24401, 26792, 24401, 31181, 18888, 18888, 18888, 35464, 23086, 27211, 27211, 27211, 26809, 30756, 21431, 24401, 24401, 24401, 26828, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 31948, 18889, 35707, 27211, 19719, 26845, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 26905, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 24984, 31088, 19419, 26945, 27651, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22698, 18836, 26999, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 23051, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 27033, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 27056, 18888, 18890, 27211, 27211, 30320, 27211, 27211, 27075, 24401, 24401, 29032, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 33986, 27855, 27211, 27211, 27102, 17590, 24017, 24401, 24401, 27123, 27144, 36254, 27162, 27210, 27228, 28500, 18187, 34842, 33426, 27244, 35980, 27277, 27302, 27320, 36048, 34013, 20999, 31882, 21478, 27895, 27356, 30287, 27381, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 26329, 30087, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 27406, 27423, 27445, 35294, 27461, 22087, 18888, 18888, 30140, 18890, 27211, 27211, 27989, 27211, 22121, 24401, 24401, 25682, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 34042, 27211, 27211, 27211, 27211, 29700, 22164, 24401, 24401, 24401, 24401, 27128, 31693, 27477, 18888, 18888, 18888, 18890, 27194, 27211, 27211, 27211, 27211, 19484, 35299, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 27059, 23086, 27211, 27211, 27211, 33366, 30756, 24012, 24401, 24401, 24401, 35044, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 20815, 27211, 30818, 19960, 33969, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22713, 18836, 22059, 27496, 27516, 27541, 35231, 27557, 22087, 29662, 26292, 23292, 27573, 24836, 27601, 27211, 27636, 22121, 35544, 27686, 24401, 27721, 18866, 18888, 27799, 18888, 27818, 22071, 27853, 32260, 27211, 26013, 27873, 27920, 22164, 29419, 24401, 29946, 33413, 26742, 27751, 26881, 18888, 18888, 27261, 36776, 27936, 27211, 27211, 27211, 27988, 28005, 28031, 28052, 24401, 24401, 28069, 28088, 28135, 25488, 28152, 26069, 28167, 27211, 28340, 24657, 28196, 30756, 31523, 24401, 28212, 34176, 36174, 24956, 28248, 28266, 28290, 21488, 33077, 28327, 28356, 17590, 20986, 23126, 28391, 28425, 28102, 28451, 28470, 28490, 28516, 28534, 20034, 33728, 25868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 30241, 28274, 28553, 28574, 19406, 28590, 23086, 23330, 19828, 19452, 28615, 28660, 26147, 25783, 31738, 19837, 25782, 19760, 29613, 35958, 29276, 22105, 19419, 27963, 23157, 28700, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 22528, 18888, 18888, 18888, 18888, 18890, 27333, 27211, 27211, 27211, 27211, 19484, 30853, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22728, 18836, 28747, 28782, 28817, 28841, 28857, 28880, 28896, 24161, 28943, 32011, 36261, 27340, 28961, 29492, 28982, 29011, 24522, 29027, 25436, 29048, 23051, 27500, 29090, 29110, 30713, 18888, 23512, 29130, 25183, 27211, 29155, 28927, 27033, 29173, 23230, 24401, 29199, 35373, 31693, 18888, 18888, 25583, 32629, 29218, 27211, 27211, 31461, 30692, 29237, 27075, 24401, 24401, 24401, 29262, 29302, 19628, 18888, 34329, 18888, 18888, 23086, 27211, 29329, 27211, 27211, 30756, 24012, 35933, 24401, 24401, 24401, 27705, 31612, 18888, 18888, 29346, 29374, 27211, 35650, 17590, 21436, 29393, 24401, 25970, 18887, 33895, 18888, 27211, 32528, 27212, 24016, 32769, 19868, 25659, 18888, 26889, 27211, 27211, 29412, 23889, 24371, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31768, 19840, 25783, 31738, 19837, 29435, 29508, 31102, 29550, 29606, 22105, 30300, 29462, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22743, 18836, 22059, 29629, 29473, 34097, 33285, 29183, 29651, 27254, 18888, 29678, 33329, 32535, 27211, 29694, 29716, 22121, 19202, 24401, 32742, 29741, 18866, 26776, 33921, 28474, 18888, 18888, 25783, 29766, 27211, 29809, 27211, 35072, 22164, 35825, 24401, 29828, 24401, 24036, 36769, 25217, 18888, 18888, 29848, 18890, 27211, 29871, 27211, 26258, 27211, 29894, 24401, 29929, 24401, 36587, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 29725, 29962, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18473, 18888, 18888, 19584, 27211, 27212, 24016, 29982, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19902, 19447, 32052, 19544, 19828, 29998, 30097, 30031, 19840, 25783, 30047, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 30075, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22758, 18836, 30121, 30156, 30206, 30257, 30273, 30336, 22087, 35624, 32837, 25762, 18890, 29878, 34934, 26812, 27211, 22121, 24931, 23223, 29202, 24401, 18866, 34373, 30352, 18888, 18888, 18888, 23447, 24828, 27211, 27211, 27211, 35072, 30370, 35052, 24401, 24401, 24401, 24036, 29523, 18888, 18888, 27146, 18888, 31308, 30386, 27211, 27211, 30405, 30558, 19484, 30427, 24401, 24401, 29938, 35686, 19628, 28766, 30447, 34506, 35614, 23086, 28731, 30482, 30517, 30552, 30756, 24012, 20156, 30574, 30598, 30667, 26283, 33464, 28945, 27670, 30687, 32915, 33504, 25328, 17590, 23963, 20450, 33837, 21016, 32397, 26300, 30708, 30729, 27885, 30748, 21588, 36373, 30779, 26653, 24628, 33220, 32514, 30806, 31835, 25412, 25906, 26515, 18890, 28825, 31833, 26133, 19447, 28304, 31730, 23834, 26057, 30869, 30885, 32181, 30920, 30942, 32797, 25782, 30970, 31015, 23516, 31008, 30997, 31034, 27963, 19659, 29450, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22773, 18836, 31058, 31074, 32463, 31125, 31141, 31197, 22087, 18888, 29534, 35471, 36738, 27211, 24342, 31213, 24424, 22121, 24401, 20175, 31229, 31917, 27736, 31245, 34334, 27175, 18888, 29094, 27286, 27211, 31278, 31336, 27211, 31355, 31371, 24401, 31402, 31418, 24401, 31437, 31693, 18888, 31619, 32841, 18888, 18890, 27211, 27211, 31460, 31477, 27211, 19484, 24401, 24401, 31497, 36581, 24401, 33020, 18888, 18888, 18888, 18888, 30007, 27211, 27211, 27211, 27211, 31516, 32310, 24401, 24401, 24401, 24401, 31539, 18888, 28762, 18888, 24651, 35740, 27211, 27211, 28644, 31565, 35796, 24401, 24401, 19318, 32188, 18888, 24334, 28366, 27212, 29966, 29832, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 31587, 19868, 31635, 32435, 33693, 30105, 31663, 20005, 31715, 31757, 31784, 31812, 30015, 31851, 31878, 25783, 31898, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 31933, 30221, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22788, 18836, 22059, 25729, 30466, 31968, 24306, 31984, 32000, 32807, 35160, 27017, 29590, 34941, 19801, 29377, 33700, 22121, 27040, 30431, 29396, 28864, 29565, 18888, 18888, 18888, 32027, 18888, 25783, 27211, 27211, 23698, 27211, 35072, 22164, 24401, 24401, 30845, 24401, 24036, 32045, 18888, 26929, 18888, 18888, 18890, 27211, 31481, 32068, 27211, 27211, 32088, 24401, 33058, 32122, 24401, 24401, 33736, 18888, 18888, 33162, 18888, 23086, 27211, 27211, 29484, 27211, 28375, 32144, 24401, 24401, 33831, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 36704, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 33107, 22171, 33224, 24271, 32169, 31017, 27856, 31741, 19840, 25783, 31738, 30234, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 32204, 32232, 32252, 32677, 33295, 29074, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 23619, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 32276, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 32299, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 33886, 18889, 36065, 27211, 19719, 35326, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22803, 18836, 32335, 31647, 34666, 32351, 32367, 32417, 22087, 18888, 32433, 19335, 32451, 27211, 32479, 27107, 32500, 22121, 24401, 32551, 20085, 32572, 18866, 22287, 23753, 18888, 18888, 32602, 32665, 27211, 32693, 27211, 26972, 32713, 32729, 24401, 32764, 24401, 25877, 32785, 34768, 18888, 27390, 32823, 24594, 24855, 32857, 24890, 32878, 32904, 27211, 32942, 32977, 24401, 33000, 29313, 24401, 30790, 26206, 27666, 33904, 18888, 23086, 36353, 27211, 33036, 27211, 30756, 24012, 32153, 24401, 33056, 24401, 35861, 18888, 18888, 30354, 27972, 27211, 27211, 33800, 17590, 20145, 24401, 24401, 34638, 20811, 18888, 18888, 33074, 27211, 27212, 36167, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 34616, 24169, 33093, 33123, 33157, 27856, 31741, 23862, 26552, 34302, 19837, 25782, 19760, 31015, 23516, 31008, 33178, 19973, 27963, 23497, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22818, 18836, 33205, 28113, 33240, 34097, 33275, 29183, 22087, 33318, 35438, 18888, 18890, 33345, 26391, 33382, 27211, 22121, 33399, 28072, 33442, 24401, 18866, 22232, 18888, 33459, 18888, 18888, 33480, 33498, 25175, 27211, 27211, 26704, 22164, 24775, 35239, 24401, 24401, 25914, 29580, 18888, 18888, 31109, 25211, 33520, 33539, 27211, 27211, 33556, 36284, 19484, 33585, 24401, 24401, 33604, 32556, 19628, 18888, 18888, 31262, 33658, 23086, 27211, 27211, 33679, 27211, 30756, 24012, 24401, 24401, 33716, 24401, 26854, 27480, 18888, 33752, 27855, 33259, 34701, 27211, 17590, 32102, 24782, 23807, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 33773, 36105, 19868, 25659, 18888, 23368, 27211, 29157, 19719, 23889, 34454, 29286, 18890, 33794, 25302, 33816, 19447, 34079, 33853, 31862, 31017, 27856, 31741, 33877, 28920, 33937, 19837, 30461, 34002, 22276, 36041, 34029, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22833, 18836, 34064, 32616, 34113, 34141, 34157, 34192, 34208, 32216, 36013, 31549, 31952, 34224, 34248, 34287, 29330, 34350, 34389, 34413, 34481, 26793, 18866, 26187, 29635, 22293, 18888, 36654, 25783, 34522, 34544, 34566, 25821, 35072, 22164, 34586, 34609, 34632, 19604, 24036, 36644, 36674, 24681, 18888, 32401, 34654, 31339, 34682, 34698, 27211, 34717, 34753, 28053, 34812, 34836, 24401, 33619, 19628, 34858, 32236, 34906, 24598, 33523, 27612, 34890, 34922, 24732, 29246, 36717, 33634, 34465, 32984, 34168, 26750, 34957, 18888, 18888, 34994, 35010, 27211, 33040, 17590, 29913, 35035, 24401, 36304, 25482, 30171, 35883, 35068, 35088, 26627, 20441, 31173, 35123, 35143, 35176, 24640, 30492, 29358, 19719, 35192, 35219, 25384, 28801, 35255, 35279, 32586, 34496, 23086, 23330, 29061, 31017, 27856, 31741, 19840, 25783, 31738, 24547, 25164, 35315, 31796, 35353, 34316, 22105, 19419, 27963, 24091, 28630, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22848, 18836, 22059, 34782, 34088, 35389, 21008, 35405, 35421, 35454, 18888, 18888, 23466, 35487, 27211, 27211, 27211, 35513, 31154, 24401, 24401, 24401, 35560, 18888, 26863, 36664, 35601, 24872, 25783, 30389, 23536, 26250, 35647, 35666, 22164, 19522, 19564, 30582, 35682, 27697, 35575, 29114, 18888, 18888, 18888, 18890, 27211, 35702, 27211, 27211, 27211, 35723, 24401, 35527, 24401, 24401, 24401, 19628, 30184, 18888, 18888, 18888, 23086, 35739, 27211, 27211, 27211, 29139, 22938, 24401, 24401, 24401, 24401, 23898, 35756, 18888, 18888, 25025, 35778, 27211, 27211, 17590, 20064, 35795, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 23917, 18890, 34550, 31833, 22262, 19447, 23086, 23330, 26418, 31017, 27856, 31741, 19840, 25783, 35812, 19837, 27187, 35841, 33135, 23516, 31008, 22105, 22148, 28712, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22863, 18836, 22059, 35877, 28723, 34097, 31164, 29183, 22087, 26758, 18888, 22592, 18890, 23989, 27211, 29812, 27211, 22121, 33778, 24401, 31421, 24401, 18866, 18888, 18888, 26872, 18888, 18888, 25783, 27211, 30732, 27211, 27211, 35072, 22164, 24401, 24908, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22878, 18836, 22059, 27837, 27857, 35899, 24401, 35915, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 31602, 18888, 18888, 18888, 18888, 26223, 27211, 27211, 27211, 27211, 27211, 19484, 35931, 24401, 24401, 24401, 24401, 19628, 18888, 28136, 18888, 18888, 35949, 27211, 32862, 27211, 32697, 30756, 24012, 24401, 32283, 24401, 32128, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22893, 18836, 22059, 35974, 34882, 34097, 33960, 29183, 35996, 18888, 23311, 18888, 36029, 27211, 27211, 36064, 36081, 22121, 24401, 24401, 36104, 33950, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 36121, 18888, 25559, 18888, 18888, 18890, 27211, 27211, 30313, 27211, 27211, 36154, 24401, 24401, 34397, 24401, 24401, 19628, 28250, 18888, 18888, 18888, 23086, 30926, 27211, 27211, 27211, 26983, 24012, 33642, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 19354, 27857, 36190, 24401, 36206, 22087, 18888, 18888, 18888, 18007, 27211, 27211, 27211, 24724, 22121, 24401, 24401, 24401, 30827, 18866, 18888, 36222, 18888, 28795, 18888, 25783, 35100, 27211, 27429, 27211, 35072, 22164, 30836, 24401, 24499, 24401, 24036, 31693, 18888, 36244, 18888, 18888, 18890, 27211, 36088, 27211, 27211, 27211, 19484, 24401, 28036, 24401, 24401, 24401, 19628, 18888, 18888, 35631, 18888, 35762, 27211, 27211, 36277, 27211, 34730, 24012, 24401, 24401, 36300, 24401, 36320, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 25712, 18888, 18888, 36346, 27211, 27212, 19184, 24402, 19868, 25659, 32029, 18889, 27211, 33359, 19719, 23889, 36369, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22384, 18836, 36389, 19008, 19233, 20367, 36434, 17173, 17595, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 36453, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 20362, 21726, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22369, 18836, 18987, 19008, 19233, 20367, 19008, 21737, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21813, 18836, 36489, 19008, 19233, 20367, 19008, 17173, 17737, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17768, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 20543, 22022, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21828, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 36517, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21828, 18836, 19307, 18888, 27857, 30756, 24401, 29183, 28015, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 36567, 24401, 24401, 24401, 24401, 22953, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 28537, 36603, 24401, 24401, 24401, 24401, 24036, 18881, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 36629, 36690, 18720, 19008, 19233, 20367, 19008, 17454, 17595, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17223, 17308, 17327, 17346, 18918, 36754, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 20362, 21726, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 0, 94242, 0, 118820, 0, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2482176, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 2207744, 2404352, 2412544, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3104768, 2605056, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2678784, 2207744, 2695168, 2207744, 2703360, 2207744, 2711552, 2752512, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 3170304, 3174400, 2158592, 0, 139, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 2748416, 2756608, 2777088, 2801664, 2158592, 2158592, 2158592, 2863104, 2891776, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3104768, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2785280, 2207744, 2809856, 2207744, 2207744, 2842624, 2207744, 2207744, 2207744, 2899968, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2473984, 2207744, 2207744, 2494464, 2207744, 2207744, 2207744, 2523136, 2158592, 2404352, 2412544, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2564096, 2158592, 2158592, 2605056, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2678784, 2158592, 2695168, 2158592, 2703360, 2158592, 2711552, 2752512, 2158592, 2158592, 2785280, 2158592, 2158592, 2785280, 2158592, 2809856, 2158592, 2158592, 2842624, 2158592, 2158592, 2158592, 2899968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 641, 0, 2158592, 0, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 32768, 0, 2158592, 0, 2158592, 2158592, 2158592, 2383872, 2158592, 2158592, 2158592, 2158592, 3006464, 2383872, 2207744, 2207744, 2207744, 2207744, 2158877, 2158877, 2158877, 2158877, 0, 0, 0, 2158877, 2572573, 2158877, 2158877, 0, 2207744, 2207744, 2596864, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2641920, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 167936, 0, 0, 2162688, 0, 0, 3104768, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2146304, 2146304, 2224128, 2224128, 2232320, 2232320, 2232320, 641, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2531328, 2158592, 2158592, 2158592, 2158592, 2158592, 2617344, 2158592, 2158592, 2158592, 2158592, 2441216, 2445312, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2502656, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2580480, 2158592, 2158592, 2158592, 2158592, 2621440, 2158592, 2580480, 2158592, 2158592, 2158592, 2158592, 2621440, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2699264, 2158592, 2158592, 2158592, 2158592, 2158592, 2748416, 2756608, 2777088, 2801664, 2207744, 2863104, 2891776, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3018752, 2207744, 3043328, 2207744, 2207744, 2207744, 2207744, 3080192, 2207744, 2207744, 3112960, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 172310, 279, 0, 2162688, 0, 0, 2207744, 2207744, 2207744, 3186688, 2207744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2404352, 2412544, 2158592, 2510848, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2584576, 2158592, 2609152, 2158592, 2158592, 2629632, 2158592, 2158592, 2158592, 2686976, 2158592, 2715648, 2158592, 2158592, 3121152, 2158592, 2158592, 2158592, 3149824, 2158592, 2158592, 3170304, 3174400, 2158592, 2367488, 2207744, 2207744, 2207744, 2207744, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2572288, 2158592, 2158592, 0, 2207744, 2207744, 2207744, 2433024, 2207744, 2453504, 2461696, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2510848, 2207744, 2207744, 2207744, 2207744, 2207744, 2531328, 2207744, 2207744, 2207744, 2207744, 2207744, 2617344, 2207744, 2207744, 2207744, 2207744, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2572288, 2158592, 2158592, 1508, 2715648, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2867200, 2207744, 2904064, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2580480, 2207744, 2207744, 2207744, 2207744, 2621440, 2207744, 2207744, 2207744, 3149824, 2207744, 2207744, 3170304, 3174400, 2207744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 2158592, 2158592, 2158592, 2404352, 2412544, 2707456, 2732032, 2207744, 2207744, 2207744, 2822144, 2826240, 2207744, 2895872, 2207744, 2207744, 2924544, 2207744, 2207744, 2973696, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 285, 2158592, 2158592, 3112960, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 2207744, 2207744, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 0, 0, 2535424, 2543616, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 2990080, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2572288, 2981888, 2207744, 2207744, 3002368, 2207744, 3047424, 3063808, 3076096, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3203072, 2708960, 2732032, 2158592, 2158592, 2158592, 2822144, 2827748, 2158592, 2895872, 2158592, 2158592, 2924544, 2158592, 2158592, 2973696, 2158592, 2981888, 2158592, 2158592, 3002368, 2158592, 3047424, 3063808, 3076096, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3203072, 2981888, 2158592, 2158592, 3003876, 2158592, 3047424, 3063808, 3076096, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3203072, 2207744, 2207744, 2207744, 2207744, 2207744, 2424832, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 20480, 0, 0, 0, 0, 0, 2162688, 20480, 0, 2523136, 2527232, 2158592, 2158592, 2576384, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2908160, 2527232, 2207744, 2207744, 2576384, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2908160, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 286, 2158592, 2158592, 0, 0, 2158592, 2158592, 2158592, 2158592, 2633728, 2658304, 0, 0, 2740224, 2744320, 0, 2834432, 2207744, 2207744, 2977792, 2207744, 2207744, 2207744, 2207744, 3039232, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3158016, 0, 0, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 933, 45, 45, 45, 45, 442, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 2494464, 2158592, 2158592, 2158592, 2524757, 2527232, 2158592, 2158592, 2576384, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 1504, 2158592, 2498560, 2158592, 2158592, 2158592, 2158592, 2568192, 2158592, 2592768, 2625536, 2158592, 2158592, 2674688, 2736128, 2158592, 2158592, 0, 2158592, 2912256, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3108864, 2158592, 2158592, 3133440, 3145728, 3153920, 2375680, 2379776, 2207744, 2207744, 2420736, 2207744, 2449408, 2207744, 2207744, 2207744, 2498560, 2207744, 2207744, 2207744, 2207744, 2568192, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 551, 2158592, 2158592, 2158592, 2158592, 2207744, 2506752, 2207744, 2207744, 2207744, 2207744, 2207744, 2158592, 2506752, 0, 2020, 2158592, 2592768, 2625536, 2207744, 2207744, 2674688, 2736128, 2207744, 2207744, 2207744, 2912256, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 542, 0, 544, 2207744, 3108864, 2207744, 2207744, 3133440, 3145728, 3153920, 2375680, 2379776, 2158592, 2158592, 2420736, 2158592, 2449408, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 641, 0, 0, 0, 0, 0, 0, 2367488, 2158592, 2498560, 2158592, 2158592, 1621, 2158592, 2158592, 2568192, 2158592, 2592768, 2625536, 2158592, 2158592, 2674688, 0, 0, 0, 0, 0, 1608, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1107, 97, 97, 1110, 97, 97, 3133440, 3145728, 3153920, 2158592, 2408448, 2416640, 2158592, 2465792, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3014656, 2158592, 2158592, 3051520, 2158592, 2158592, 3100672, 2158592, 2158592, 3121152, 2158592, 2158592, 2158592, 3149824, 2416640, 2207744, 2465792, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2633728, 2658304, 2740224, 2744320, 2834432, 2949120, 2158592, 2985984, 2158592, 2998272, 2158592, 2158592, 2158592, 3129344, 2207744, 2408448, 2949120, 2207744, 2985984, 2207744, 2998272, 2207744, 2207744, 2207744, 3129344, 2158592, 2408448, 2416640, 2158592, 2465792, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 32768, 0, 0, 0, 0, 0, 0, 2367488, 2949120, 2158592, 2985984, 2158592, 2998272, 2158592, 2158592, 2158592, 3129344, 2158592, 2158592, 2478080, 2158592, 2158592, 2158592, 2535424, 2543616, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3117056, 2207744, 2207744, 2478080, 2207744, 2207744, 2207744, 2207744, 2699264, 2207744, 2207744, 2207744, 2207744, 2207744, 2748416, 2756608, 2777088, 2801664, 2207744, 2207744, 2158877, 2158877, 2158877, 2158877, 2158877, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 0, 0, 2535709, 2543901, 2158877, 2158877, 2158877, 0, 0, 0, 2158877, 2158877, 2158877, 2990365, 2158877, 2158877, 2158730, 2158730, 2158730, 2158730, 2158730, 2572426, 2207744, 2535424, 2543616, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3117056, 2158592, 2158592, 2478080, 2207744, 2207744, 2990080, 2207744, 2207744, 2158592, 2158592, 2482176, 2158592, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 0, 2158592, 2908160, 2158592, 2158592, 2158592, 2977792, 2158592, 2158592, 2158592, 2158592, 3039232, 2158592, 2158592, 3010560, 2207744, 2428928, 2207744, 2514944, 2207744, 2588672, 2207744, 2838528, 2207744, 2207744, 2207744, 3010560, 2158592, 2428928, 2158592, 2514944, 0, 0, 2158592, 2588672, 2158592, 0, 2838528, 2158592, 2158592, 2158592, 3010560, 2158592, 2506752, 2158592, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 0, 29315, 922, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1539, 45, 3006464, 2383872, 0, 2020, 2158592, 2158592, 2158592, 2158592, 3006464, 2158592, 2637824, 2953216, 2158592, 2207744, 2637824, 2953216, 2207744, 0, 0, 2158592, 2637824, 2953216, 2158592, 2539520, 2158592, 2539520, 2207744, 0, 0, 2539520, 2158592, 2158592, 2158592, 2158592, 2207744, 2506752, 2207744, 2207744, 2207744, 2207744, 2207744, 2158592, 2506752, 0, 0, 2158592, 2207744, 0, 2158592, 2158592, 2207744, 0, 2158592, 2158592, 2207744, 0, 2158592, 2965504, 2965504, 2965504, 0, 0, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2474269, 2158877, 2158877, 0, 0, 2158877, 2158877, 2158877, 2158877, 2634013, 2658589, 0, 0, 2740509, 2744605, 0, 2834717, 40976, 18, 36884, 45078, 24, 28, 90143, 94242, 118820, 102439, 106538, 98347, 118820, 118820, 118820, 40976, 18, 18, 36884, 0, 0, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 86016, 0, 0, 2211840, 102439, 0, 0, 0, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 3158016, 0, 2375680, 2379776, 2158592, 2158592, 2420736, 2158592, 2449408, 2158592, 2158592, 0, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 135, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2564096, 2158592, 2158592, 2158592, 2158592, 2158592, 2596864, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2641920, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2781184, 2793472, 2494464, 2158592, 2158592, 2158592, 2523136, 2527232, 2158592, 2158592, 2576384, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 0, 27, 27, 0, 2158592, 2498560, 2158592, 2158592, 0, 2158592, 2158592, 2568192, 2158592, 2592768, 2625536, 2158592, 2158592, 2674688, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2473984, 2158592, 2158592, 2494464, 2158592, 2158592, 2158592, 3006464, 2383872, 0, 0, 2158592, 2158592, 2158592, 2158592, 3006464, 2158592, 2637824, 2953216, 2158592, 2207744, 2637824, 2953216, 40976, 18, 36884, 45078, 24, 27, 147488, 94242, 147456, 147488, 106538, 98347, 0, 0, 147456, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 0, 81920, 0, 94242, 0, 0, 0, 2211840, 0, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2428928, 2158592, 2514944, 2158592, 2588672, 2158592, 2838528, 2158592, 2158592, 40976, 18, 151573, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 0, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 1315, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1487, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 0, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 130, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3096576, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2207744, 2158592, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 644, 2207744, 2207744, 2207744, 3186688, 2207744, 0, 1080, 0, 1084, 0, 1088, 0, 0, 0, 0, 0, 0, 0, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2531466, 2158730, 2158730, 2158730, 2158730, 2158730, 2617482, 0, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2781184, 2793472, 2158592, 2818048, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 40976, 18, 36884, 45078, 24, 27, 90143, 159779, 159744, 102439, 159779, 98347, 0, 0, 159744, 40976, 18, 18, 36884, 0, 45078, 0, 2224253, 172032, 2224253, 2232448, 2232448, 172032, 2232448, 90143, 0, 0, 2170880, 0, 0, 550, 829, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 124, 124, 127, 127, 127, 40976, 18, 36884, 45078, 25, 29, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 163931, 40976, 18, 18, 36884, 0, 45078, 249856, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 2170880, 0, 0, 827, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 4243810, 4243810, 24, 24, 27, 27, 27, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 57344, 286, 2158592, 2158592, 2158592, 2158592, 2707456, 2732032, 2158592, 2158592, 2158592, 2822144, 2826240, 2158592, 2895872, 2158592, 2158592, 2924544, 2158592, 2158592, 2973696, 2158592, 2207744, 2207744, 2207744, 3186688, 2207744, 0, 0, 0, 0, 0, 0, 53248, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 1613, 97, 97, 97, 97, 97, 97, 1495, 97, 97, 97, 97, 97, 97, 97, 97, 97, 566, 97, 97, 97, 97, 97, 97, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 546, 0, 0, 0, 0, 286, 2158592, 2158592, 2158592, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 17, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 20480, 120, 121, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 2170880, 0, 53248, 550, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 196608, 18, 266240, 24, 24, 27, 27, 27, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 0, 45, 45, 45, 45, 45, 45, 45, 1535, 45, 45, 45, 45, 45, 45, 45, 1416, 45, 45, 45, 45, 45, 45, 45, 45, 424, 45, 45, 45, 45, 45, 45, 45, 45, 45, 405, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 199, 45, 45, 67, 67, 67, 67, 67, 491, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1766, 67, 67, 67, 1767, 67, 24850, 24850, 12564, 12564, 0, 0, 2166784, 546, 0, 53531, 53531, 0, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 743, 57889, 0, 2170880, 0, 0, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 1856, 45, 1858, 1859, 67, 67, 67, 1009, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1021, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2367773, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2699549, 2158877, 2158877, 2158877, 2158877, 2158877, 2748701, 2756893, 2777373, 2801949, 97, 1115, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 857, 97, 67, 67, 67, 67, 67, 1258, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1826, 67, 97, 97, 97, 97, 97, 97, 1338, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 870, 97, 97, 67, 67, 67, 1463, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1579, 67, 67, 97, 97, 97, 1518, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 904, 905, 97, 97, 97, 97, 1620, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 0, 0, 0, 0, 0, 45, 1679, 67, 67, 67, 1682, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1690, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 669, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 189, 45, 45, 45, 1748, 45, 45, 45, 1749, 1750, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1959, 67, 67, 67, 67, 1768, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1791, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1802, 67, 1817, 67, 67, 67, 67, 67, 67, 1823, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 97, 1848, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 659, 45, 45, 45, 45, 45, 45, 45, 1863, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 495, 67, 67, 67, 67, 67, 1878, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 0, 1973, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1165, 97, 1167, 67, 24850, 24850, 12564, 12564, 0, 0, 2166784, 0, 0, 53531, 53531, 0, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 1789, 97, 0, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 136, 2158592, 2158592, 2158592, 2158592, 2158592, 3158016, 229376, 2375680, 2379776, 2158592, 2158592, 2420736, 2158592, 2449408, 2158592, 2158592, 67, 24850, 24850, 12564, 12564, 0, 0, 280, 547, 0, 53531, 53531, 0, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 1788, 97, 97, 0, 97, 2024, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 235, 67, 67, 67, 67, 67, 57889, 547, 547, 0, 0, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 1799, 45, 45, 45, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 1092, 0, 0, 0, 0, 0, 97, 97, 97, 97, 1612, 97, 97, 97, 97, 1616, 97, 1297, 1472, 0, 0, 0, 0, 1303, 1474, 0, 0, 0, 0, 1309, 1476, 0, 0, 0, 0, 97, 97, 97, 1481, 97, 97, 97, 97, 97, 97, 1488, 97, 0, 1474, 0, 1476, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 607, 97, 97, 97, 97, 40976, 18, 36884, 45078, 26, 30, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 213080, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 143448, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 0, 0, 0, 0, 97, 97, 97, 97, 1482, 97, 1483, 97, 97, 97, 97, 97, 97, 1326, 97, 97, 1329, 1330, 97, 97, 97, 97, 97, 97, 1159, 1160, 97, 97, 97, 97, 97, 97, 97, 97, 590, 97, 97, 97, 97, 97, 97, 97, 0, 94242, 0, 0, 0, 2211974, 102439, 0, 0, 106538, 98347, 0, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2474122, 2158730, 2158730, 2494602, 2158730, 2158730, 2158730, 2809994, 2158730, 2158730, 2842762, 2158730, 2158730, 2158730, 2900106, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3014794, 2158730, 2158730, 3051658, 2158730, 2158730, 3100810, 2158730, 2158730, 2158730, 2158730, 3096714, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2207744, 2207744, 2207744, 2207744, 2207744, 2572288, 2207744, 2207744, 2207744, 2207744, 541, 541, 543, 543, 0, 0, 2166784, 0, 548, 549, 549, 0, 286, 2158877, 2158877, 2158877, 2863389, 2892061, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3186973, 2158877, 0, 0, 0, 0, 0, 0, 0, 0, 2367626, 2158877, 2404637, 2412829, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2564381, 2158877, 2158877, 2605341, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2679069, 2158877, 2695453, 2158877, 2703645, 2158877, 2711837, 2752797, 2158877, 0, 2158877, 2158877, 2158877, 2384010, 2158730, 2158730, 2158730, 2158730, 3006602, 2383872, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3096576, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 0, 0, 2158877, 2785565, 2158877, 2810141, 2158877, 2158877, 2842909, 2158877, 2158877, 2158877, 2900253, 2158877, 2158877, 2158877, 2158877, 2158877, 2531613, 2158877, 2158877, 2158877, 2158877, 2158877, 2617629, 2158877, 2158877, 2158877, 2158877, 2158730, 2818186, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3105053, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 0, 0, 0, 0, 0, 97, 97, 97, 1611, 97, 97, 97, 97, 97, 97, 97, 1496, 97, 97, 1499, 97, 97, 97, 97, 97, 2441354, 2445450, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2502794, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2433162, 2158730, 2453642, 2461834, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2580618, 2158730, 2158730, 2158730, 2158730, 2621578, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2699402, 2158730, 2158730, 2158730, 2158730, 2678922, 2158730, 2695306, 2158730, 2703498, 2158730, 2711690, 2752650, 2158730, 2158730, 2785418, 2158730, 2158730, 2158730, 3113098, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3186826, 2158730, 2207744, 2207744, 2207744, 2207744, 2781184, 2793472, 2207744, 2818048, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 541, 0, 543, 2158877, 2502941, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2580765, 2158877, 2158877, 2158877, 2158877, 2621725, 2158877, 3019037, 2158877, 3043613, 2158877, 2158877, 2158877, 2158877, 3080477, 2158877, 2158877, 3113245, 2158877, 2158877, 2158877, 2158877, 0, 2158877, 2908445, 2158877, 2158877, 2158877, 2978077, 2158877, 2158877, 2158877, 2158877, 3039517, 2158877, 2158730, 2510986, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2584714, 2158730, 2609290, 2158730, 2158730, 2629770, 2158730, 2158730, 2158730, 2388106, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2605194, 2158730, 2158730, 2158730, 2158730, 2687114, 2158730, 2715786, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2867338, 2158730, 2904202, 2158730, 2158730, 2158730, 2642058, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2781322, 2793610, 2158730, 3121290, 2158730, 2158730, 2158730, 3149962, 2158730, 2158730, 3170442, 3174538, 2158730, 2367488, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2441216, 2445312, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2502656, 2158877, 2433309, 2158877, 2453789, 2461981, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2511133, 2158877, 2158877, 2158877, 2158877, 2584861, 2158877, 2609437, 2158877, 2158877, 2629917, 2158877, 2158877, 2158877, 2687261, 2158877, 2715933, 2158877, 2158730, 2158730, 2973834, 2158730, 2982026, 2158730, 2158730, 3002506, 2158730, 3047562, 3063946, 3076234, 2158730, 2158730, 2158730, 2158730, 2207744, 2506752, 2207744, 2207744, 2207744, 2207744, 2207744, 2158877, 2507037, 0, 0, 2158877, 2158730, 2158730, 2158730, 3203210, 2207744, 2207744, 2207744, 2207744, 2207744, 2424832, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2564096, 2207744, 2207744, 2207744, 2707741, 2732317, 2158877, 2158877, 2158877, 2822429, 2826525, 2158877, 2896157, 2158877, 2158877, 2924829, 2158877, 2158877, 2973981, 2158877, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 642, 0, 2158592, 0, 45, 1529, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1755, 45, 67, 67, 2982173, 2158877, 2158877, 3002653, 2158877, 3047709, 3064093, 3076381, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3203357, 2523274, 2527370, 2158730, 2158730, 2576522, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2908298, 2494749, 2158877, 2158877, 2158877, 2523421, 2527517, 2158877, 2158877, 2576669, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 0, 40976, 0, 18, 18, 4321280, 2224253, 2232448, 4329472, 2232448, 2158730, 2498698, 2158730, 2158730, 2158730, 2158730, 2568330, 2158730, 2592906, 2625674, 2158730, 2158730, 2674826, 2736266, 2158730, 2158730, 2158730, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2158730, 2912394, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3109002, 2158730, 2158730, 3133578, 3145866, 3154058, 2375680, 2207744, 3108864, 2207744, 2207744, 3133440, 3145728, 3153920, 2375965, 2380061, 2158877, 2158877, 2421021, 2158877, 2449693, 2158877, 2158877, 2158877, 3117341, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3104906, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158877, 2498845, 2158877, 2158877, 0, 2158877, 2158877, 2568477, 2158877, 2593053, 2625821, 2158877, 2158877, 2674973, 0, 0, 0, 0, 97, 97, 1480, 97, 97, 97, 97, 97, 1485, 97, 97, 97, 0, 97, 97, 1729, 97, 1731, 97, 97, 97, 97, 97, 97, 97, 311, 97, 97, 97, 97, 97, 97, 97, 97, 1520, 97, 97, 1523, 97, 97, 1526, 97, 2736413, 2158877, 2158877, 0, 2158877, 2912541, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3109149, 2158877, 2158877, 3014941, 2158877, 2158877, 3051805, 2158877, 2158877, 3100957, 2158877, 2158877, 3121437, 2158877, 2158877, 2158877, 3150109, 3133725, 3146013, 3154205, 2158730, 2408586, 2416778, 2158730, 2465930, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3018890, 2158730, 3043466, 2158730, 2158730, 2158730, 2158730, 3080330, 2633866, 2658442, 2740362, 2744458, 2834570, 2949258, 2158730, 2986122, 2158730, 2998410, 2158730, 2158730, 2158730, 3129482, 2207744, 2408448, 2949120, 2207744, 2985984, 2207744, 2998272, 2207744, 2207744, 2207744, 3129344, 2158877, 2408733, 2416925, 2158877, 2466077, 2158877, 2158877, 3170589, 3174685, 2158877, 0, 0, 0, 2158730, 2158730, 2158730, 2158730, 2158730, 2424970, 2158730, 2158730, 2158730, 2158730, 2707594, 2732170, 2158730, 2158730, 2158730, 2822282, 2826378, 2158730, 2896010, 2158730, 2158730, 2924682, 2949405, 2158877, 2986269, 2158877, 2998557, 2158877, 2158877, 2158877, 3129629, 2158730, 2158730, 2478218, 2158730, 2158730, 2158730, 2535562, 2543754, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3117194, 2207744, 2207744, 2478080, 2207744, 2207744, 2207744, 2207744, 3014656, 2207744, 2207744, 3051520, 2207744, 2207744, 3100672, 2207744, 2207744, 3121152, 2207744, 2207744, 2207744, 2207744, 2207744, 2584576, 2207744, 2609152, 2207744, 2207744, 2629632, 2207744, 2207744, 2207744, 2686976, 2207744, 2207744, 2535424, 2543616, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3117056, 2158877, 2158877, 2478365, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158730, 2158730, 2482314, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2207744, 2207744, 2207744, 2387968, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 823, 0, 825, 2158730, 2158730, 2158730, 2990218, 2158730, 2158730, 2207744, 2207744, 2482176, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 135, 0, 2207744, 2207744, 2990080, 2207744, 2207744, 2158877, 2158877, 2482461, 2158877, 2158877, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2158730, 2429066, 2158730, 2515082, 2158730, 2588810, 2158730, 2838666, 2158730, 2158730, 2158730, 3010698, 2207744, 2428928, 2207744, 2514944, 2207744, 2588672, 2207744, 2838528, 2207744, 2207744, 2207744, 3010560, 2158877, 2429213, 2158877, 2515229, 0, 0, 2158877, 2588957, 2158877, 0, 2838813, 2158877, 2158877, 2158877, 3010845, 2158730, 2506890, 2158730, 2158730, 2158730, 2748554, 2756746, 2777226, 2801802, 2158730, 2158730, 2158730, 2863242, 2891914, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2564234, 2158730, 2158730, 2158730, 2158730, 2158730, 2597002, 2158730, 2158730, 2158730, 3006464, 2384157, 0, 0, 2158877, 2158877, 2158877, 2158877, 3006749, 2158730, 2637962, 2953354, 2158730, 2207744, 2637824, 2953216, 2207744, 0, 0, 2158877, 2638109, 2953501, 2158877, 2539658, 2158730, 2539520, 2207744, 0, 0, 2539805, 2158877, 2158730, 2158730, 2158730, 2977930, 2158730, 2158730, 2158730, 2158730, 3039370, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3158154, 2207744, 0, 2158877, 2158730, 2207744, 0, 2158877, 2158730, 2207744, 0, 2158877, 2965642, 2965504, 2965789, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1484, 97, 97, 97, 97, 2158592, 18, 0, 122880, 0, 0, 0, 77824, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 356, 0, 0, 0, 0, 0, 0, 28809, 0, 139, 45, 45, 45, 45, 45, 45, 1751, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1427, 67, 67, 67, 67, 67, 1432, 67, 67, 67, 3104768, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 122880, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 1322, 550, 0, 286, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 24, 4329472, 27, 27, 2207744, 2207744, 2977792, 2207744, 2207744, 2207744, 2207744, 3039232, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3158016, 542, 0, 0, 0, 542, 0, 544, 0, 0, 0, 544, 0, 550, 0, 0, 0, 0, 0, 97, 97, 1610, 97, 97, 97, 97, 97, 97, 97, 97, 898, 97, 97, 97, 97, 97, 97, 97, 0, 94242, 0, 0, 0, 2211840, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 237568, 102439, 106538, 98347, 0, 0, 20480, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 192512, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 94, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 96, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 12378, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 126, 126, 126, 126, 90143, 0, 0, 2170880, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 20480, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 241664, 102439, 106538, 98347, 0, 0, 20568, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 200797, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 20480, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 0, 0, 44, 0, 0, 20575, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 41, 41, 41, 0, 0, 1126400, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 0, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 89, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 131201, 27, 27, 90143, 0, 0, 2170880, 0, 0, 550, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2441216, 2445312, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 94242, 0, 0, 208896, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 0, 0, 0, 0, 0, 0, 0, 2367488, 32768, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2433024, 2158592, 2453504, 2461696, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2510848, 2158592, 2158592, 2158592, 2158592, 40976, 18, 36884, 245783, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 20480, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 221184, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 180224, 40976, 18, 18, 36884, 155648, 45078, 0, 24, 24, 217088, 27, 27, 27, 217088, 90143, 0, 0, 2170880, 0, 0, 828, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2207744, 2207744, 2387968, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 233472, 0, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 45, 45, 718, 45, 45, 45, 45, 45, 45, 45, 45, 45, 727, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 45, 1808, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 97, 97, 0, 0, 97, 67, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 1787, 0, 97, 97, 0, 97, 97, 97, 45, 45, 45, 45, 2029, 45, 67, 67, 67, 67, 2033, 57889, 0, 0, 54074, 54074, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 1798, 45, 45, 1800, 45, 45, 0, 1472, 0, 0, 0, 0, 0, 1474, 0, 0, 0, 0, 0, 1476, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 1320, 97, 97, 0, 0, 97, 97, 97, 97, 1786, 97, 0, 0, 97, 97, 0, 1790, 1527, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 663, 67, 24850, 24850, 12564, 12564, 0, 57889, 281, 0, 0, 53531, 53531, 367, 286, 97, 97, 0, 0, 97, 97, 97, 1785, 97, 97, 0, 0, 97, 97, 0, 97, 97, 1979, 97, 97, 45, 45, 1983, 45, 1984, 45, 45, 45, 45, 45, 652, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 690, 45, 45, 694, 45, 45, 40976, 19, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 262144, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 46, 67, 98, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 45, 67, 97, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 258048, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 1122423, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 1114152, 1114152, 1114152, 0, 0, 1114112, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 37, 102439, 106538, 98347, 0, 0, 204800, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 57436, 40976, 18, 36884, 45078, 24, 27, 33, 33, 0, 33, 33, 33, 0, 0, 0, 40976, 18, 18, 36884, 0, 45078, 0, 124, 124, 124, 127, 127, 127, 127, 90143, 0, 0, 2170880, 0, 0, 550, 0, 2158877, 2158877, 2158877, 2388253, 2158877, 2158877, 2158877, 2158877, 2158877, 2781469, 2793757, 2158877, 2818333, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2867485, 2158877, 2904349, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3096861, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2441501, 2445597, 2158877, 2158877, 2158877, 2158877, 2158877, 40976, 122, 123, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 936, 2158592, 4243810, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 935, 45, 45, 45, 715, 45, 45, 45, 45, 45, 45, 45, 723, 45, 45, 45, 45, 45, 1182, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 430, 45, 45, 45, 45, 45, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 47, 68, 99, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 48, 69, 100, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 49, 70, 101, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 50, 71, 102, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 51, 72, 103, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 52, 73, 104, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 53, 74, 105, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 54, 75, 106, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 55, 76, 107, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 56, 77, 108, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 57, 78, 109, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 58, 79, 110, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 59, 80, 111, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 60, 81, 112, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 61, 82, 113, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 62, 83, 114, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 63, 84, 115, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 64, 85, 116, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 65, 86, 117, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 66, 87, 118, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 118820, 102439, 106538, 98347, 118820, 118820, 118820, 40976, 18, 18, 0, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 1314, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 1321, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 0, 367, 0, 0, 1315, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1360, 97, 97, 131, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 145, 149, 45, 45, 45, 45, 45, 174, 45, 179, 45, 185, 45, 188, 45, 45, 202, 67, 255, 67, 67, 269, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 292, 296, 97, 97, 97, 97, 97, 321, 97, 326, 97, 332, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 646, 335, 97, 97, 349, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 437, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 523, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 511, 67, 67, 67, 97, 97, 97, 620, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1501, 1502, 97, 793, 67, 67, 796, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 808, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 2052, 67, 67, 67, 67, 813, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 830, 97, 97, 97, 97, 97, 97, 97, 97, 97, 315, 97, 97, 97, 97, 97, 97, 841, 97, 97, 97, 97, 97, 97, 97, 97, 97, 854, 97, 97, 97, 97, 97, 97, 589, 97, 97, 97, 97, 97, 97, 97, 97, 97, 867, 97, 97, 97, 97, 97, 97, 97, 891, 97, 97, 894, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 906, 45, 937, 45, 45, 940, 45, 45, 45, 45, 45, 45, 948, 45, 45, 45, 45, 45, 734, 735, 67, 737, 67, 738, 67, 740, 67, 67, 67, 45, 967, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 435, 45, 45, 45, 980, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 415, 45, 45, 67, 67, 1024, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 67, 67, 67, 67, 67, 25398, 1081, 13112, 1085, 54074, 1089, 0, 0, 0, 0, 0, 0, 363, 0, 28809, 0, 139, 45, 45, 45, 45, 45, 45, 1674, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1913, 67, 1914, 67, 67, 67, 1918, 67, 67, 97, 97, 97, 97, 1118, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 630, 97, 97, 97, 97, 97, 1169, 97, 97, 97, 97, 97, 0, 921, 0, 1175, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 1534, 45, 45, 45, 45, 45, 1538, 45, 45, 45, 45, 1233, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 742, 67, 45, 45, 1191, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 454, 67, 67, 67, 67, 1243, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1251, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 2050, 0, 97, 97, 45, 45, 45, 732, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 67, 67, 67, 1284, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 772, 67, 67, 67, 1293, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 368, 2158592, 2158592, 2158592, 2404352, 2412544, 1323, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1331, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1737, 97, 1364, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1373, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 647, 45, 45, 1387, 45, 45, 1391, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 410, 45, 45, 45, 45, 45, 1400, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1407, 45, 45, 45, 45, 45, 941, 45, 943, 45, 45, 45, 45, 45, 45, 951, 45, 67, 1438, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1447, 67, 67, 67, 67, 67, 67, 782, 67, 67, 67, 67, 67, 67, 67, 67, 67, 756, 67, 67, 67, 67, 67, 67, 97, 1491, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1500, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1736, 97, 45, 45, 1541, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 677, 45, 45, 67, 1581, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 791, 792, 67, 67, 67, 67, 1598, 67, 1600, 67, 67, 67, 67, 67, 67, 67, 67, 1472, 97, 97, 97, 1727, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1513, 97, 97, 67, 67, 97, 1879, 97, 1881, 97, 0, 1884, 0, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 1842, 97, 97, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1928, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 1903, 45, 45, 45, 67, 67, 67, 67, 97, 97, 97, 97, 1971, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 1381, 45, 45, 45, 45, 1976, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1747, 809, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 97, 907, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 638, 0, 0, 0, 0, 1478, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1150, 97, 97, 97, 97, 67, 67, 67, 67, 1244, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 477, 67, 67, 67, 67, 67, 67, 1294, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1324, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 1374, 97, 97, 97, 97, 0, 1175, 0, 45, 45, 45, 45, 45, 45, 45, 45, 945, 45, 45, 45, 45, 45, 45, 45, 45, 1908, 45, 45, 1910, 45, 67, 67, 67, 67, 67, 67, 67, 67, 1919, 67, 0, 0, 97, 97, 97, 97, 45, 2048, 67, 2049, 0, 0, 97, 2051, 45, 45, 45, 939, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 397, 45, 45, 45, 1921, 67, 67, 1923, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 1947, 45, 1935, 0, 0, 0, 97, 1939, 97, 97, 1941, 97, 45, 45, 45, 45, 45, 45, 382, 389, 45, 45, 45, 45, 45, 45, 45, 45, 1810, 45, 45, 1812, 67, 67, 67, 67, 67, 256, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 336, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 371, 373, 45, 45, 45, 955, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 413, 45, 45, 45, 457, 459, 67, 67, 67, 67, 67, 67, 67, 67, 473, 67, 478, 67, 67, 482, 67, 67, 485, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 1828, 97, 554, 556, 97, 97, 97, 97, 97, 97, 97, 97, 570, 97, 575, 97, 97, 579, 97, 97, 582, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 330, 97, 97, 67, 746, 67, 67, 67, 67, 67, 67, 67, 67, 67, 758, 67, 67, 67, 67, 67, 67, 67, 1575, 67, 67, 67, 67, 67, 67, 67, 67, 493, 67, 67, 67, 67, 67, 67, 67, 97, 97, 844, 97, 97, 97, 97, 97, 97, 97, 97, 97, 856, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1735, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 1642, 97, 1644, 97, 97, 890, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 67, 67, 67, 67, 1065, 1066, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 532, 67, 67, 67, 67, 67, 67, 67, 1451, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 496, 67, 67, 97, 97, 1505, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 593, 97, 97, 0, 1474, 0, 1476, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1617, 97, 97, 1635, 0, 1637, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 885, 97, 97, 97, 97, 67, 67, 1704, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 565, 572, 97, 97, 97, 97, 97, 97, 97, 97, 1832, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 1946, 45, 45, 67, 67, 67, 67, 67, 97, 1926, 97, 1927, 97, 0, 0, 0, 97, 97, 1934, 2043, 0, 0, 97, 97, 97, 2047, 45, 45, 67, 67, 0, 1832, 97, 97, 45, 45, 45, 981, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1227, 45, 45, 45, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 372, 45, 45, 45, 45, 1661, 1662, 45, 45, 45, 45, 45, 1666, 45, 45, 45, 45, 45, 1673, 45, 1675, 45, 45, 45, 45, 45, 45, 45, 67, 1426, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1275, 67, 67, 67, 67, 67, 45, 418, 45, 45, 420, 45, 45, 423, 45, 45, 45, 45, 45, 45, 45, 45, 959, 45, 45, 962, 45, 45, 45, 45, 458, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 483, 67, 67, 67, 67, 504, 67, 67, 506, 67, 67, 509, 67, 67, 67, 67, 67, 67, 67, 528, 67, 67, 67, 67, 67, 67, 67, 67, 1287, 67, 67, 67, 67, 67, 67, 67, 555, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 580, 97, 97, 97, 97, 601, 97, 97, 603, 97, 97, 606, 97, 97, 97, 97, 97, 97, 848, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1498, 97, 97, 97, 97, 97, 97, 45, 45, 714, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 989, 990, 45, 67, 67, 67, 67, 67, 1011, 67, 67, 67, 67, 1015, 67, 67, 67, 67, 67, 67, 67, 753, 67, 67, 67, 67, 67, 67, 67, 67, 467, 67, 67, 67, 67, 67, 67, 67, 45, 45, 1179, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1003, 1004, 67, 1217, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 728, 67, 1461, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1034, 67, 97, 1516, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 871, 97, 67, 67, 67, 1705, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 567, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1715, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 1380, 45, 45, 45, 45, 45, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 1887, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 2006, 45, 45, 1907, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1920, 67, 97, 0, 2035, 97, 97, 97, 97, 97, 45, 45, 45, 45, 67, 67, 67, 1428, 67, 67, 67, 67, 67, 67, 1435, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 146, 45, 152, 45, 45, 165, 45, 175, 45, 180, 45, 45, 187, 190, 195, 45, 203, 254, 257, 262, 67, 270, 67, 67, 0, 24850, 12564, 0, 0, 0, 281, 28809, 53531, 97, 97, 97, 293, 97, 299, 97, 97, 312, 97, 322, 97, 327, 97, 97, 334, 337, 342, 97, 350, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 67, 484, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 499, 97, 581, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 596, 648, 45, 650, 45, 651, 45, 653, 45, 45, 45, 657, 45, 45, 45, 45, 45, 45, 1954, 67, 67, 67, 1958, 67, 67, 67, 67, 67, 67, 67, 768, 67, 67, 67, 67, 67, 67, 67, 67, 769, 67, 67, 67, 67, 67, 67, 67, 680, 45, 45, 45, 45, 45, 45, 45, 45, 688, 689, 691, 45, 45, 45, 45, 45, 983, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 947, 45, 45, 45, 45, 952, 45, 45, 698, 699, 45, 45, 702, 703, 45, 45, 45, 45, 45, 45, 45, 711, 744, 67, 67, 67, 67, 67, 67, 67, 67, 67, 757, 67, 67, 67, 67, 761, 67, 67, 67, 67, 765, 67, 767, 67, 67, 67, 67, 67, 67, 67, 67, 775, 776, 778, 67, 67, 67, 67, 67, 67, 785, 786, 67, 67, 789, 790, 67, 67, 67, 67, 67, 67, 1442, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1775, 97, 97, 97, 67, 67, 67, 67, 67, 798, 67, 67, 67, 802, 67, 67, 67, 67, 67, 67, 67, 67, 1465, 67, 67, 1468, 67, 67, 1471, 67, 67, 810, 67, 67, 67, 67, 67, 67, 67, 67, 67, 821, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 0, 833, 97, 835, 97, 836, 97, 838, 97, 97, 0, 0, 97, 97, 97, 2002, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 1740, 45, 45, 45, 1744, 45, 45, 45, 97, 842, 97, 97, 97, 97, 97, 97, 97, 97, 97, 855, 97, 97, 97, 97, 0, 1717, 1718, 97, 97, 97, 97, 97, 1722, 97, 0, 0, 859, 97, 97, 97, 97, 863, 97, 865, 97, 97, 97, 97, 97, 97, 97, 97, 604, 97, 97, 97, 97, 97, 97, 97, 873, 874, 876, 97, 97, 97, 97, 97, 97, 883, 884, 97, 97, 887, 888, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 225280, 0, 365, 0, 367, 0, 45, 45, 45, 1531, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1199, 45, 45, 45, 45, 45, 97, 97, 908, 97, 97, 97, 97, 97, 97, 97, 97, 97, 919, 638, 0, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2425117, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2597149, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2642205, 2158877, 2158877, 2158877, 2158877, 2158877, 3158301, 0, 2375818, 2379914, 2158730, 2158730, 2420874, 2158730, 2449546, 2158730, 2158730, 953, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 965, 978, 45, 45, 45, 45, 45, 45, 985, 45, 45, 45, 45, 45, 45, 45, 45, 971, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1027, 67, 1029, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1455, 67, 67, 67, 67, 67, 67, 67, 1077, 1078, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 0, 366, 0, 139, 2158730, 2158730, 2158730, 2404490, 2412682, 1113, 97, 97, 97, 97, 97, 97, 1121, 97, 1123, 97, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1540, 1155, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 615, 1168, 97, 97, 1171, 1172, 97, 97, 0, 921, 0, 1175, 0, 0, 0, 0, 45, 45, 45, 45, 45, 1533, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1663, 45, 45, 45, 45, 45, 45, 45, 45, 45, 183, 45, 45, 45, 45, 201, 45, 45, 45, 1219, 45, 45, 45, 45, 45, 45, 45, 1226, 45, 45, 45, 45, 45, 168, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 427, 45, 45, 45, 45, 45, 45, 45, 1231, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1242, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1046, 67, 67, 1254, 67, 1256, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 806, 807, 67, 67, 97, 1336, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1111, 97, 97, 97, 97, 97, 1351, 97, 97, 97, 1354, 97, 97, 97, 1359, 97, 97, 97, 0, 97, 97, 97, 97, 1640, 97, 97, 97, 97, 97, 97, 97, 897, 97, 97, 97, 902, 97, 97, 97, 97, 97, 97, 97, 97, 1366, 97, 97, 97, 97, 97, 97, 97, 1371, 97, 97, 97, 0, 97, 97, 97, 1730, 97, 97, 97, 97, 97, 97, 97, 97, 915, 97, 97, 97, 97, 0, 360, 0, 67, 67, 67, 1440, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1017, 67, 1019, 67, 67, 67, 67, 67, 1453, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1459, 97, 97, 97, 1493, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1525, 97, 97, 97, 97, 97, 97, 1507, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1514, 67, 67, 67, 67, 1584, 67, 67, 67, 67, 67, 1590, 67, 67, 67, 67, 67, 67, 67, 783, 67, 67, 67, 788, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1599, 1601, 67, 67, 67, 1604, 67, 1606, 1607, 67, 1472, 0, 1474, 0, 1476, 0, 97, 97, 97, 97, 97, 97, 1614, 97, 97, 97, 97, 45, 45, 1850, 45, 45, 45, 45, 1855, 45, 45, 45, 45, 45, 1222, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1229, 97, 1618, 97, 97, 97, 97, 97, 97, 97, 1625, 97, 97, 97, 97, 97, 0, 1175, 0, 45, 45, 45, 45, 45, 45, 45, 45, 447, 45, 45, 45, 45, 45, 67, 67, 1633, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1643, 1645, 97, 97, 0, 0, 97, 97, 1784, 97, 97, 97, 0, 0, 97, 97, 0, 97, 1894, 1895, 97, 1897, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 656, 45, 45, 45, 45, 45, 45, 97, 1648, 97, 1650, 1651, 97, 0, 45, 45, 45, 1654, 45, 45, 45, 45, 45, 169, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 658, 45, 45, 45, 45, 664, 45, 45, 1659, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1187, 45, 45, 1669, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1005, 67, 67, 1681, 67, 67, 67, 67, 67, 67, 67, 1686, 67, 67, 67, 67, 67, 67, 67, 784, 67, 67, 67, 67, 67, 67, 67, 67, 1055, 67, 67, 67, 67, 1060, 67, 67, 97, 97, 1713, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 1378, 45, 45, 45, 45, 45, 45, 45, 408, 45, 45, 45, 45, 45, 45, 45, 45, 1547, 45, 1549, 45, 45, 45, 45, 45, 97, 97, 1780, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 45, 2027, 2028, 45, 45, 67, 67, 2031, 2032, 67, 45, 45, 1804, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1917, 67, 67, 67, 67, 67, 67, 67, 1819, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1708, 97, 97, 97, 97, 97, 45, 45, 1862, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 497, 67, 67, 67, 1877, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 1839, 0, 0, 97, 97, 97, 97, 1936, 0, 0, 97, 97, 97, 97, 97, 97, 1943, 1944, 1945, 45, 45, 45, 45, 670, 45, 45, 45, 45, 674, 45, 45, 45, 45, 678, 45, 1948, 45, 1950, 45, 45, 45, 45, 1955, 1956, 1957, 67, 67, 67, 1960, 67, 1962, 67, 67, 67, 67, 1967, 1968, 1969, 97, 0, 0, 0, 97, 97, 1974, 97, 0, 1936, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 1906, 0, 1977, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1746, 45, 45, 45, 45, 2011, 67, 67, 2013, 67, 67, 67, 2017, 97, 97, 0, 0, 2021, 97, 8192, 97, 97, 2025, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1916, 67, 67, 67, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 140, 45, 45, 45, 1180, 45, 45, 45, 45, 1184, 45, 45, 45, 45, 45, 45, 45, 387, 45, 392, 45, 45, 396, 45, 45, 399, 45, 45, 67, 207, 67, 67, 67, 67, 67, 67, 236, 67, 67, 67, 67, 67, 67, 67, 800, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1603, 67, 67, 67, 67, 67, 0, 97, 97, 287, 97, 97, 97, 97, 97, 97, 316, 97, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 1656, 1657, 45, 376, 45, 45, 45, 45, 45, 388, 45, 45, 45, 45, 45, 45, 45, 45, 1406, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 462, 67, 67, 67, 67, 67, 474, 67, 67, 67, 67, 67, 67, 67, 817, 67, 67, 67, 67, 25398, 542, 13112, 544, 97, 97, 97, 97, 559, 97, 97, 97, 97, 97, 571, 97, 97, 97, 97, 97, 97, 896, 97, 97, 97, 900, 97, 97, 97, 97, 97, 97, 912, 914, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 391, 45, 45, 45, 45, 45, 45, 45, 45, 713, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 662, 45, 1140, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 636, 67, 67, 1283, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 513, 67, 67, 1363, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 889, 97, 97, 97, 1714, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 926, 45, 45, 45, 45, 45, 45, 45, 45, 672, 45, 45, 45, 45, 45, 45, 45, 45, 686, 45, 45, 45, 45, 45, 45, 45, 45, 944, 45, 45, 45, 45, 45, 45, 45, 45, 1676, 45, 45, 45, 45, 45, 45, 67, 97, 97, 97, 1833, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 1902, 45, 45, 45, 45, 45, 957, 45, 45, 45, 45, 961, 45, 963, 45, 45, 45, 67, 97, 2034, 0, 97, 97, 97, 97, 97, 2040, 45, 45, 45, 2042, 67, 67, 67, 67, 67, 67, 1574, 67, 67, 67, 67, 67, 1578, 67, 67, 67, 67, 67, 67, 799, 67, 67, 67, 804, 67, 67, 67, 67, 67, 67, 67, 1298, 0, 0, 0, 1304, 0, 0, 0, 1310, 132, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 45, 45, 1414, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 428, 45, 45, 45, 45, 45, 57889, 0, 0, 54074, 54074, 550, 831, 97, 97, 97, 97, 97, 97, 97, 97, 97, 568, 97, 97, 97, 97, 578, 97, 45, 45, 968, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1228, 45, 45, 67, 67, 67, 67, 67, 25398, 1082, 13112, 1086, 54074, 1090, 0, 0, 0, 0, 0, 0, 364, 0, 0, 0, 139, 2158592, 2158592, 2158592, 2404352, 2412544, 67, 67, 67, 67, 1464, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 510, 67, 67, 67, 67, 97, 97, 97, 97, 1519, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 918, 97, 0, 0, 0, 0, 1528, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 976, 45, 1554, 45, 45, 45, 45, 45, 45, 45, 45, 1562, 45, 45, 1565, 45, 45, 45, 45, 683, 45, 45, 45, 687, 45, 45, 692, 45, 45, 45, 45, 45, 1953, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1014, 67, 67, 67, 67, 67, 67, 1568, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 67, 67, 67, 67, 67, 1585, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1594, 97, 97, 1649, 97, 97, 97, 0, 45, 45, 1653, 45, 45, 45, 45, 45, 45, 383, 45, 45, 45, 45, 45, 45, 45, 45, 45, 986, 45, 45, 45, 45, 45, 45, 45, 45, 1670, 45, 1672, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 736, 67, 67, 67, 67, 67, 741, 67, 67, 67, 1680, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1074, 67, 67, 67, 1692, 67, 67, 67, 67, 67, 67, 67, 1697, 67, 1699, 67, 67, 67, 67, 67, 67, 1012, 67, 67, 67, 67, 67, 67, 67, 67, 67, 468, 475, 67, 67, 67, 67, 67, 67, 1769, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 624, 97, 97, 97, 97, 97, 97, 634, 97, 97, 1792, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 958, 45, 45, 45, 45, 45, 45, 964, 45, 150, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 977, 204, 45, 67, 67, 67, 217, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 787, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 271, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 97, 351, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 45, 938, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1398, 45, 45, 45, 153, 45, 161, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 660, 661, 45, 45, 205, 45, 67, 67, 67, 67, 220, 67, 228, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 280, 94, 0, 0, 67, 67, 67, 67, 67, 272, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 97, 352, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 439, 45, 45, 45, 45, 45, 445, 45, 45, 45, 452, 45, 45, 67, 67, 212, 216, 67, 67, 67, 67, 67, 241, 67, 246, 67, 252, 67, 67, 486, 67, 67, 67, 67, 67, 67, 67, 494, 67, 67, 67, 67, 67, 67, 67, 1245, 67, 67, 67, 67, 67, 67, 67, 67, 1013, 67, 67, 1016, 67, 67, 67, 67, 67, 521, 67, 67, 525, 67, 67, 67, 67, 67, 531, 67, 67, 67, 538, 67, 0, 0, 2046, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 1192, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1418, 45, 45, 1421, 97, 97, 583, 97, 97, 97, 97, 97, 97, 97, 591, 97, 97, 97, 97, 97, 97, 913, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 1384, 97, 618, 97, 97, 622, 97, 97, 97, 97, 97, 628, 97, 97, 97, 635, 97, 18, 131427, 0, 0, 0, 639, 0, 132, 362, 0, 0, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 932, 45, 45, 45, 45, 45, 1544, 45, 45, 45, 45, 45, 1550, 45, 45, 45, 45, 45, 1194, 45, 1196, 45, 45, 45, 45, 45, 45, 45, 45, 999, 45, 45, 45, 45, 45, 67, 67, 45, 45, 667, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1408, 45, 45, 45, 696, 45, 45, 45, 701, 45, 45, 45, 45, 45, 45, 45, 45, 710, 45, 45, 45, 1220, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 194, 45, 45, 45, 729, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 797, 67, 67, 67, 67, 67, 67, 805, 67, 67, 67, 67, 67, 67, 67, 1587, 67, 1589, 67, 67, 67, 67, 67, 67, 67, 67, 1763, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 2162968, 0, 0, 67, 67, 67, 67, 67, 814, 816, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 67, 67, 1008, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1020, 67, 0, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 67, 67, 67, 67, 1429, 67, 1430, 67, 67, 67, 67, 67, 1062, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 518, 1076, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 0, 28809, 0, 139, 45, 45, 45, 45, 45, 97, 97, 97, 97, 1102, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1124, 97, 1126, 97, 97, 1114, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1112, 97, 97, 1156, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 594, 97, 97, 97, 97, 1170, 97, 97, 97, 97, 0, 921, 0, 0, 0, 0, 0, 0, 45, 45, 45, 45, 1532, 45, 45, 45, 45, 1536, 45, 45, 45, 45, 45, 172, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 706, 45, 45, 709, 45, 45, 1177, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1202, 45, 1204, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1215, 45, 45, 45, 1232, 45, 45, 45, 45, 45, 45, 45, 67, 1237, 67, 67, 67, 67, 67, 67, 1053, 1054, 67, 67, 67, 67, 67, 67, 1061, 67, 67, 1282, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1289, 67, 67, 67, 1292, 97, 97, 97, 97, 1339, 97, 97, 97, 97, 97, 97, 1344, 97, 97, 97, 97, 45, 1849, 45, 1851, 45, 45, 45, 45, 45, 45, 45, 45, 721, 45, 45, 45, 45, 45, 726, 45, 1385, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1188, 45, 45, 1401, 1402, 45, 45, 45, 45, 1405, 45, 45, 45, 45, 45, 45, 45, 45, 1752, 45, 45, 45, 45, 45, 67, 67, 1410, 45, 45, 45, 1413, 45, 1415, 45, 45, 45, 45, 45, 45, 1419, 45, 45, 45, 45, 1806, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 97, 97, 2019, 0, 97, 67, 67, 67, 1452, 67, 67, 67, 67, 67, 67, 67, 67, 1457, 67, 67, 67, 67, 67, 67, 1259, 67, 67, 67, 67, 67, 67, 1264, 67, 67, 1460, 67, 1462, 67, 67, 67, 67, 67, 67, 1466, 67, 67, 67, 67, 67, 67, 67, 67, 1588, 67, 67, 67, 67, 67, 67, 67, 0, 1300, 0, 0, 0, 1306, 0, 0, 0, 97, 97, 97, 1506, 97, 97, 97, 97, 97, 97, 97, 97, 1512, 97, 97, 97, 0, 1728, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 901, 97, 97, 97, 97, 1515, 97, 1517, 97, 97, 97, 97, 97, 97, 1521, 97, 97, 97, 97, 97, 97, 0, 45, 1652, 45, 45, 45, 1655, 45, 45, 45, 45, 45, 1542, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1552, 1553, 45, 45, 45, 1556, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 693, 45, 45, 45, 67, 67, 67, 67, 1572, 67, 67, 67, 67, 1576, 67, 67, 67, 67, 67, 67, 67, 67, 1602, 67, 67, 1605, 67, 67, 67, 0, 67, 1582, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1580, 67, 67, 1596, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 542, 0, 544, 67, 67, 67, 67, 1759, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 533, 67, 67, 67, 67, 67, 67, 67, 1770, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 1777, 97, 97, 97, 1793, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 998, 45, 45, 1001, 1002, 45, 45, 67, 67, 45, 1861, 45, 67, 67, 67, 67, 67, 67, 67, 67, 1871, 67, 1873, 1874, 67, 0, 97, 45, 67, 0, 97, 45, 67, 16384, 97, 45, 67, 97, 0, 0, 0, 1473, 0, 1082, 0, 0, 0, 1475, 0, 1086, 0, 0, 0, 1477, 1876, 67, 97, 97, 97, 97, 97, 1883, 0, 1885, 97, 97, 97, 1889, 0, 0, 0, 286, 0, 0, 0, 286, 0, 2367488, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 24, 126, 126, 126, 2053, 0, 2055, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 97, 97, 2039, 97, 45, 45, 45, 45, 67, 67, 67, 67, 67, 226, 67, 67, 67, 67, 67, 67, 67, 67, 1246, 67, 67, 1249, 1250, 67, 67, 67, 132, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 141, 45, 45, 45, 1403, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1186, 45, 45, 1189, 45, 45, 155, 45, 45, 45, 45, 45, 45, 45, 45, 45, 191, 45, 45, 45, 45, 700, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1753, 45, 45, 45, 67, 67, 45, 45, 67, 208, 67, 67, 67, 222, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1764, 67, 67, 67, 67, 67, 67, 67, 258, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 288, 97, 97, 97, 302, 97, 97, 97, 97, 97, 97, 97, 97, 97, 627, 97, 97, 97, 97, 97, 97, 338, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 370, 45, 45, 45, 45, 716, 45, 45, 45, 45, 45, 722, 45, 45, 45, 45, 45, 45, 1912, 67, 67, 67, 67, 67, 67, 67, 67, 67, 819, 67, 67, 25398, 542, 13112, 544, 45, 403, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1409, 45, 67, 67, 67, 67, 489, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 771, 67, 67, 67, 67, 520, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 534, 67, 67, 67, 67, 67, 67, 1271, 67, 67, 67, 1274, 67, 67, 67, 1279, 67, 67, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 97, 553, 97, 97, 97, 97, 586, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1138, 97, 97, 97, 97, 617, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 631, 97, 97, 97, 0, 1834, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 353, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 45, 668, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 724, 45, 45, 45, 45, 45, 682, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 949, 45, 45, 45, 67, 67, 747, 748, 67, 67, 67, 67, 755, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 1302, 0, 0, 0, 1308, 0, 67, 794, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1701, 67, 97, 97, 97, 845, 846, 97, 97, 97, 97, 853, 97, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 97, 97, 892, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 610, 97, 97, 45, 992, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 1239, 67, 67, 67, 1063, 67, 67, 67, 67, 67, 1068, 67, 67, 67, 67, 67, 67, 67, 0, 0, 1301, 0, 0, 0, 1307, 0, 0, 97, 1141, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1152, 97, 97, 0, 0, 97, 97, 2001, 0, 97, 2003, 97, 97, 97, 45, 45, 45, 1739, 45, 45, 45, 1742, 45, 45, 45, 45, 45, 97, 97, 97, 97, 1157, 97, 97, 97, 97, 97, 1162, 97, 97, 97, 97, 97, 97, 1145, 97, 97, 97, 97, 97, 1151, 97, 97, 97, 1253, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 539, 45, 1423, 45, 45, 67, 67, 67, 67, 67, 67, 67, 1431, 67, 67, 67, 67, 67, 67, 67, 1695, 67, 67, 67, 67, 67, 1700, 67, 1702, 67, 67, 1439, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 514, 67, 67, 97, 97, 1492, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 611, 97, 97, 1703, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 852, 97, 97, 97, 97, 97, 97, 45, 1949, 45, 1951, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 1961, 67, 0, 97, 45, 67, 0, 97, 2060, 2061, 0, 2062, 45, 67, 97, 0, 0, 2036, 97, 97, 97, 97, 45, 45, 45, 45, 67, 67, 67, 67, 67, 223, 67, 67, 237, 67, 67, 67, 67, 67, 67, 67, 1272, 67, 67, 67, 67, 67, 67, 67, 67, 507, 67, 67, 67, 67, 67, 67, 67, 1963, 67, 67, 67, 97, 97, 97, 97, 0, 1972, 0, 97, 97, 97, 1975, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 931, 45, 45, 45, 45, 45, 407, 45, 45, 45, 45, 45, 45, 45, 45, 45, 417, 45, 45, 1989, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1996, 97, 18, 131427, 0, 0, 360, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 930, 45, 45, 45, 45, 45, 45, 444, 45, 45, 45, 45, 45, 45, 45, 67, 67, 97, 97, 1998, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1985, 45, 1986, 45, 45, 45, 156, 45, 45, 170, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 675, 45, 45, 45, 45, 679, 131427, 0, 358, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 381, 45, 45, 45, 45, 45, 45, 45, 45, 45, 400, 45, 45, 419, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 436, 67, 67, 67, 67, 67, 505, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 820, 67, 25398, 542, 13112, 544, 67, 67, 522, 67, 67, 67, 67, 67, 529, 67, 67, 67, 67, 67, 67, 67, 0, 1299, 0, 0, 0, 1305, 0, 0, 0, 97, 97, 619, 97, 97, 97, 97, 97, 626, 97, 97, 97, 97, 97, 97, 97, 1105, 97, 97, 97, 97, 1109, 97, 97, 97, 67, 67, 67, 67, 749, 67, 67, 67, 67, 67, 67, 67, 67, 67, 760, 67, 0, 97, 45, 67, 2058, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 97, 97, 97, 97, 45, 45, 45, 2041, 67, 67, 67, 67, 67, 780, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 516, 67, 67, 97, 97, 97, 878, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1629, 97, 0, 45, 979, 45, 45, 45, 45, 984, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1198, 45, 45, 45, 45, 45, 45, 67, 1023, 67, 67, 67, 67, 1028, 67, 67, 67, 67, 67, 67, 67, 67, 67, 470, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 1094, 0, 0, 0, 1092, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1486, 97, 1489, 97, 97, 97, 1117, 97, 97, 97, 97, 1122, 97, 97, 97, 97, 97, 97, 97, 1146, 97, 97, 97, 97, 97, 97, 97, 97, 881, 97, 97, 97, 886, 97, 97, 97, 1311, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1615, 97, 97, 97, 97, 97, 1619, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1631, 97, 97, 1847, 97, 45, 45, 45, 45, 1852, 45, 45, 45, 45, 45, 45, 45, 1235, 45, 45, 45, 67, 67, 67, 67, 67, 1868, 67, 67, 67, 1872, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1882, 0, 0, 0, 97, 97, 97, 97, 0, 1891, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 1929, 0, 0, 97, 97, 97, 97, 97, 97, 45, 1900, 45, 1901, 45, 45, 45, 1905, 45, 67, 2054, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 2037, 2038, 97, 97, 45, 45, 45, 45, 67, 67, 67, 67, 1867, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1774, 97, 97, 97, 97, 97, 97, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 142, 45, 45, 45, 1412, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 432, 45, 45, 45, 45, 45, 157, 45, 45, 171, 45, 45, 45, 182, 45, 45, 45, 45, 200, 45, 45, 45, 1543, 45, 45, 45, 45, 45, 45, 45, 45, 1551, 45, 45, 45, 45, 1181, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1211, 45, 45, 45, 1214, 45, 45, 45, 67, 209, 67, 67, 67, 224, 67, 67, 238, 67, 67, 67, 249, 67, 0, 97, 2056, 2057, 0, 2059, 45, 67, 0, 97, 45, 67, 97, 0, 0, 1937, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1741, 45, 45, 45, 45, 45, 45, 67, 67, 67, 267, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 289, 97, 97, 97, 304, 97, 97, 318, 97, 97, 97, 329, 97, 97, 0, 0, 97, 1783, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 2026, 45, 45, 45, 45, 67, 2030, 67, 67, 67, 67, 67, 67, 1041, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1044, 67, 67, 67, 67, 67, 67, 97, 97, 347, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 666, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1420, 45, 57889, 0, 0, 54074, 54074, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 840, 67, 1007, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 759, 67, 67, 67, 67, 67, 67, 67, 1052, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1031, 67, 67, 67, 67, 67, 97, 97, 97, 1101, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 592, 97, 97, 97, 1190, 45, 45, 45, 45, 45, 1195, 45, 1197, 45, 45, 45, 45, 1201, 45, 45, 45, 45, 1952, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 250, 67, 67, 67, 1255, 67, 1257, 67, 67, 67, 67, 1261, 67, 67, 67, 67, 67, 67, 67, 67, 1685, 67, 67, 67, 67, 67, 67, 67, 0, 24851, 12565, 0, 0, 0, 0, 28809, 53532, 67, 67, 1267, 67, 67, 67, 67, 67, 67, 1273, 67, 67, 67, 67, 67, 67, 67, 67, 1696, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 2162688, 0, 0, 1281, 67, 67, 67, 67, 1285, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1070, 67, 67, 67, 67, 67, 1335, 97, 1337, 97, 97, 97, 97, 1341, 97, 97, 97, 97, 97, 97, 97, 97, 882, 97, 97, 97, 97, 97, 97, 97, 1347, 97, 97, 97, 97, 97, 97, 1353, 97, 97, 97, 97, 97, 97, 1361, 97, 18, 131427, 0, 638, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 544, 0, 550, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2473984, 2158592, 2158592, 2158592, 2990080, 2158592, 2158592, 2207744, 2207744, 2482176, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 0, 53530, 97, 97, 97, 1365, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 608, 97, 97, 97, 45, 45, 1424, 45, 1425, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1058, 67, 67, 67, 67, 45, 1555, 45, 45, 1557, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 707, 45, 45, 45, 45, 67, 67, 1570, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 773, 67, 67, 1595, 67, 67, 1597, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 2158592, 2158592, 2158592, 2404352, 2412544, 97, 97, 97, 1636, 97, 97, 97, 1639, 97, 97, 1641, 97, 97, 97, 97, 97, 97, 1173, 0, 921, 0, 0, 0, 0, 0, 0, 45, 67, 67, 67, 1693, 67, 67, 67, 67, 67, 67, 67, 1698, 67, 67, 67, 67, 67, 67, 67, 1773, 67, 97, 97, 97, 97, 97, 97, 97, 625, 97, 97, 97, 97, 97, 97, 97, 97, 850, 97, 97, 97, 97, 97, 97, 97, 97, 880, 97, 97, 97, 97, 97, 97, 97, 97, 1106, 97, 97, 97, 97, 97, 97, 97, 1860, 45, 45, 67, 67, 1865, 67, 67, 67, 67, 1870, 67, 67, 67, 67, 1875, 67, 67, 97, 97, 1880, 97, 97, 0, 0, 0, 97, 97, 1888, 97, 0, 0, 0, 1938, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1854, 45, 45, 45, 45, 45, 45, 45, 1909, 45, 45, 1911, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1248, 67, 67, 67, 67, 67, 67, 1922, 67, 67, 1924, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 1898, 45, 45, 45, 45, 45, 45, 1904, 45, 45, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 16384, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 1724, 2008, 2009, 45, 45, 67, 67, 67, 2014, 2015, 67, 67, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 2022, 0, 2023, 97, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1869, 67, 67, 67, 67, 67, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 147, 151, 154, 45, 162, 45, 45, 176, 178, 181, 45, 45, 45, 192, 196, 45, 45, 45, 45, 2012, 67, 67, 67, 67, 67, 67, 2018, 97, 0, 0, 97, 1978, 97, 97, 97, 1982, 45, 45, 45, 45, 45, 45, 45, 45, 45, 972, 973, 45, 45, 45, 45, 45, 67, 259, 263, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 294, 298, 301, 97, 309, 97, 97, 323, 325, 328, 97, 97, 97, 97, 97, 560, 97, 97, 97, 569, 97, 97, 97, 97, 97, 97, 306, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1624, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 1175, 0, 0, 0, 0, 45, 339, 343, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 67, 67, 503, 67, 67, 67, 67, 67, 67, 67, 67, 67, 512, 67, 67, 519, 97, 97, 600, 97, 97, 97, 97, 97, 97, 97, 97, 97, 609, 97, 97, 616, 45, 649, 45, 45, 45, 45, 45, 654, 45, 45, 45, 45, 45, 45, 45, 45, 1393, 45, 45, 45, 45, 45, 45, 45, 45, 1209, 45, 45, 45, 45, 45, 45, 45, 67, 763, 67, 67, 67, 67, 67, 67, 67, 67, 770, 67, 67, 67, 774, 67, 0, 2045, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 994, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 213, 67, 219, 67, 67, 232, 67, 242, 67, 247, 67, 67, 67, 779, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1018, 67, 67, 67, 67, 811, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 0, 97, 834, 97, 97, 97, 97, 97, 839, 97, 18, 131427, 0, 638, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 645, 97, 97, 861, 97, 97, 97, 97, 97, 97, 97, 97, 868, 97, 97, 97, 872, 97, 97, 877, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 613, 97, 97, 97, 97, 97, 909, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 18, 18, 24, 24, 27, 27, 27, 1036, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1047, 67, 67, 67, 1050, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1033, 67, 67, 67, 97, 97, 1130, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 638, 0, 0, 67, 67, 67, 1295, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 1317, 97, 97, 97, 97, 97, 97, 1375, 97, 97, 97, 0, 0, 0, 45, 1379, 45, 45, 45, 45, 45, 45, 422, 45, 45, 45, 429, 431, 45, 45, 45, 45, 0, 1090, 0, 0, 97, 1479, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1357, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1716, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1723, 0, 921, 29315, 0, 0, 0, 0, 45, 929, 45, 45, 45, 45, 45, 45, 45, 1392, 45, 45, 45, 45, 45, 45, 45, 45, 45, 960, 45, 45, 45, 45, 45, 45, 97, 97, 97, 1738, 45, 45, 45, 45, 45, 45, 45, 1743, 45, 45, 45, 45, 166, 45, 45, 45, 45, 184, 186, 45, 45, 197, 45, 45, 97, 1779, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 18, 131427, 0, 638, 0, 0, 0, 0, 362, 0, 640, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1537, 45, 45, 45, 45, 45, 1803, 45, 45, 45, 45, 45, 1809, 45, 45, 45, 67, 67, 67, 1814, 67, 67, 67, 67, 67, 67, 1821, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 0, 67, 67, 67, 1818, 67, 67, 67, 67, 67, 1824, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 1890, 0, 1829, 97, 97, 0, 0, 97, 97, 1836, 97, 97, 0, 0, 0, 97, 97, 97, 97, 1981, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1987, 1845, 97, 97, 97, 45, 45, 45, 45, 45, 1853, 45, 45, 45, 1857, 45, 45, 45, 67, 1864, 67, 1866, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 1710, 1711, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 1886, 97, 97, 97, 0, 0, 97, 97, 97, 97, 1838, 0, 0, 0, 97, 1843, 97, 0, 1893, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1745, 45, 45, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 1931, 97, 97, 97, 97, 97, 588, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 629, 97, 97, 97, 97, 97, 67, 2044, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 1660, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 453, 45, 455, 67, 67, 67, 67, 268, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 348, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 359, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 421, 45, 45, 45, 45, 45, 45, 45, 434, 45, 45, 695, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1667, 45, 0, 921, 29315, 0, 925, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1811, 45, 67, 67, 67, 67, 67, 67, 1037, 67, 1039, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1277, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 1095, 0, 0, 0, 1096, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 869, 97, 97, 97, 97, 97, 97, 1131, 97, 1133, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1370, 97, 97, 97, 97, 97, 1312, 0, 0, 0, 0, 1096, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1327, 97, 97, 97, 97, 97, 1332, 97, 97, 97, 1830, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 1896, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1548, 45, 45, 45, 45, 45, 45, 133, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 45, 380, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 401, 45, 45, 158, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1200, 45, 45, 45, 45, 206, 67, 67, 67, 67, 67, 225, 67, 67, 67, 67, 67, 67, 67, 67, 754, 67, 67, 67, 67, 67, 67, 67, 57889, 0, 0, 54074, 54074, 550, 832, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1342, 97, 97, 97, 97, 97, 97, 67, 67, 67, 67, 67, 25398, 1083, 13112, 1087, 54074, 1091, 0, 0, 0, 0, 0, 0, 1316, 0, 831, 97, 97, 97, 97, 97, 97, 97, 1174, 921, 0, 1175, 0, 0, 0, 0, 45, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 148, 67, 67, 264, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 295, 97, 97, 97, 97, 313, 97, 97, 97, 97, 331, 333, 97, 18, 131427, 356, 638, 0, 0, 0, 0, 362, 0, 0, 365, 0, 367, 0, 45, 45, 1530, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 988, 45, 45, 45, 97, 344, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 402, 404, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1756, 67, 438, 45, 45, 45, 45, 45, 45, 45, 45, 449, 450, 45, 45, 45, 67, 67, 214, 218, 221, 67, 229, 67, 67, 243, 245, 248, 67, 67, 67, 67, 67, 488, 490, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1071, 67, 1073, 67, 67, 67, 67, 67, 524, 67, 67, 67, 67, 67, 67, 67, 67, 535, 536, 67, 67, 67, 67, 67, 67, 1683, 1684, 67, 67, 67, 67, 1688, 1689, 67, 67, 67, 67, 67, 67, 1586, 67, 67, 67, 67, 67, 67, 67, 67, 67, 469, 67, 67, 67, 67, 67, 67, 97, 97, 97, 585, 587, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1163, 97, 97, 97, 97, 97, 97, 97, 621, 97, 97, 97, 97, 97, 97, 97, 97, 632, 633, 97, 97, 0, 0, 1782, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 712, 45, 45, 45, 717, 45, 45, 45, 45, 45, 45, 45, 45, 725, 45, 45, 45, 163, 167, 173, 177, 45, 45, 45, 45, 45, 193, 45, 45, 45, 45, 982, 45, 45, 45, 45, 45, 45, 987, 45, 45, 45, 45, 45, 1558, 45, 1560, 45, 45, 45, 45, 45, 45, 45, 45, 704, 705, 45, 45, 45, 45, 45, 45, 45, 45, 731, 45, 45, 45, 67, 67, 67, 67, 67, 739, 67, 67, 67, 67, 67, 67, 273, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 67, 67, 67, 764, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1290, 67, 67, 67, 67, 67, 67, 812, 67, 67, 67, 67, 818, 67, 67, 67, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 0, 97, 97, 97, 97, 97, 837, 97, 97, 97, 97, 97, 602, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1137, 97, 97, 97, 97, 97, 97, 97, 97, 97, 862, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1627, 97, 97, 97, 0, 97, 97, 97, 97, 910, 97, 97, 97, 97, 916, 97, 97, 97, 0, 0, 0, 97, 97, 1940, 97, 97, 1942, 45, 45, 45, 45, 45, 45, 385, 45, 45, 45, 45, 395, 45, 45, 45, 45, 966, 45, 969, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 975, 45, 45, 45, 406, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 974, 45, 45, 45, 67, 67, 67, 67, 1010, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1262, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1040, 67, 1042, 67, 1045, 67, 67, 67, 67, 67, 67, 67, 97, 1706, 97, 97, 97, 1709, 97, 97, 97, 67, 67, 67, 67, 1051, 67, 67, 67, 67, 67, 1057, 67, 67, 67, 67, 67, 67, 67, 1443, 67, 67, 1446, 67, 67, 67, 67, 67, 67, 67, 1297, 0, 0, 0, 1303, 0, 0, 0, 1309, 67, 67, 67, 67, 1079, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2207744, 2207744, 2207744, 2207744, 2572288, 2207744, 2207744, 2207744, 1098, 97, 97, 97, 97, 97, 1104, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1356, 97, 97, 97, 97, 97, 97, 1128, 97, 97, 97, 97, 97, 97, 1134, 97, 1136, 97, 1139, 97, 97, 97, 97, 97, 97, 1622, 97, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 0, 0, 1176, 0, 646, 45, 67, 67, 67, 1268, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1469, 67, 67, 67, 97, 1348, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1127, 97, 67, 1569, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1448, 1449, 67, 1816, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1825, 67, 67, 1827, 97, 97, 0, 1781, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 1831, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 1980, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1395, 45, 45, 45, 45, 45, 97, 1846, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1212, 45, 45, 45, 45, 45, 45, 2010, 45, 67, 67, 67, 67, 67, 2016, 67, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 2007, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 143, 45, 45, 45, 1671, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1813, 67, 67, 1815, 45, 45, 67, 210, 67, 67, 67, 67, 67, 67, 239, 67, 67, 67, 67, 67, 67, 67, 1454, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1445, 67, 67, 67, 67, 67, 67, 97, 97, 290, 97, 97, 97, 97, 97, 97, 319, 97, 97, 97, 97, 97, 97, 303, 97, 97, 317, 97, 97, 97, 97, 97, 97, 305, 97, 97, 97, 97, 97, 97, 97, 97, 97, 899, 97, 97, 97, 97, 97, 97, 375, 45, 45, 45, 379, 45, 45, 390, 45, 45, 394, 45, 45, 45, 45, 45, 443, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 461, 67, 67, 67, 465, 67, 67, 476, 67, 67, 480, 67, 67, 67, 67, 67, 67, 1694, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1288, 67, 67, 67, 67, 67, 67, 500, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1075, 97, 97, 97, 558, 97, 97, 97, 562, 97, 97, 573, 97, 97, 577, 97, 97, 97, 97, 97, 895, 97, 97, 97, 97, 97, 97, 903, 97, 97, 97, 0, 97, 97, 1638, 97, 97, 97, 97, 97, 97, 97, 97, 1646, 597, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1334, 45, 681, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1396, 45, 45, 1399, 45, 45, 730, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1434, 67, 67, 67, 67, 67, 67, 750, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1456, 67, 67, 67, 67, 67, 45, 45, 993, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1238, 67, 67, 1006, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1280, 1048, 1049, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1059, 67, 67, 67, 67, 67, 67, 1286, 67, 67, 67, 67, 67, 67, 67, 1291, 67, 97, 97, 1100, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 638, 0, 920, 97, 97, 1142, 1143, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1153, 97, 97, 97, 97, 97, 1158, 97, 97, 97, 1161, 97, 97, 97, 97, 1166, 97, 97, 97, 97, 97, 1325, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1328, 97, 97, 97, 97, 97, 97, 97, 45, 1218, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1678, 45, 45, 45, 67, 67, 67, 67, 67, 1269, 67, 67, 67, 67, 67, 67, 67, 67, 1278, 67, 67, 67, 67, 67, 67, 1761, 67, 67, 67, 67, 67, 67, 67, 67, 67, 530, 67, 67, 67, 67, 67, 67, 97, 97, 1349, 97, 97, 97, 97, 97, 97, 97, 97, 1358, 97, 97, 97, 97, 97, 97, 1623, 97, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 0, 926, 0, 0, 0, 45, 45, 1411, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1754, 45, 45, 67, 67, 1301, 0, 1307, 0, 1313, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 21054, 97, 97, 97, 97, 67, 1757, 67, 67, 67, 1760, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1467, 67, 67, 67, 67, 67, 1778, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 97, 97, 1352, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1511, 97, 97, 97, 97, 97, 67, 67, 67, 67, 67, 1820, 67, 1822, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 1933, 97, 1892, 97, 97, 97, 97, 97, 97, 1899, 45, 45, 45, 45, 45, 45, 45, 45, 1664, 45, 45, 45, 45, 45, 45, 45, 45, 1546, 45, 45, 45, 45, 45, 45, 45, 45, 1208, 45, 45, 45, 45, 45, 45, 45, 45, 1224, 45, 45, 45, 45, 45, 45, 45, 45, 673, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1925, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 623, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 307, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1796, 97, 45, 45, 45, 45, 45, 45, 45, 970, 45, 45, 45, 45, 45, 45, 45, 45, 1417, 45, 45, 45, 45, 45, 45, 45, 67, 1964, 67, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 1721, 97, 97, 0, 0, 1997, 97, 0, 0, 2000, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 733, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 803, 67, 67, 67, 67, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 144, 45, 45, 45, 1805, 45, 1807, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 231, 67, 67, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 45, 45, 67, 211, 67, 67, 67, 67, 230, 234, 240, 244, 67, 67, 67, 67, 67, 67, 464, 67, 67, 67, 67, 67, 67, 479, 67, 67, 67, 260, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 291, 97, 97, 97, 97, 310, 314, 320, 324, 97, 97, 97, 97, 97, 97, 1367, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1355, 97, 97, 97, 97, 97, 97, 1362, 340, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 360, 0, 362, 0, 365, 28809, 367, 139, 369, 45, 45, 45, 374, 67, 67, 460, 67, 67, 67, 67, 466, 67, 67, 67, 67, 67, 67, 67, 67, 801, 67, 67, 67, 67, 67, 67, 67, 67, 67, 487, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 498, 67, 67, 67, 67, 67, 67, 1772, 67, 67, 97, 97, 97, 97, 97, 97, 97, 0, 921, 922, 1175, 0, 0, 0, 0, 45, 67, 502, 67, 67, 67, 67, 67, 67, 67, 508, 67, 67, 67, 515, 517, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 1932, 97, 97, 0, 1999, 97, 97, 97, 0, 97, 97, 2004, 2005, 97, 45, 45, 45, 45, 1193, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 676, 45, 45, 45, 45, 67, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 552, 97, 97, 97, 97, 97, 1377, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 655, 45, 45, 45, 45, 45, 45, 45, 97, 97, 557, 97, 97, 97, 97, 563, 97, 97, 97, 97, 97, 97, 97, 97, 1135, 97, 97, 97, 97, 97, 97, 97, 97, 97, 584, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 595, 97, 97, 97, 97, 97, 911, 97, 97, 97, 97, 97, 97, 97, 638, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 1319, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 1733, 97, 97, 97, 97, 97, 97, 1340, 97, 97, 97, 1343, 97, 97, 1345, 97, 1346, 97, 599, 97, 97, 97, 97, 97, 97, 97, 605, 97, 97, 97, 612, 614, 97, 97, 97, 97, 97, 1794, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 1207, 45, 45, 45, 45, 45, 45, 1213, 45, 45, 745, 67, 67, 67, 67, 751, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1577, 67, 67, 67, 67, 67, 762, 67, 67, 67, 67, 766, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1765, 67, 67, 67, 67, 67, 777, 67, 67, 781, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1592, 1593, 67, 67, 97, 843, 97, 97, 97, 97, 849, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1510, 97, 97, 97, 97, 97, 97, 97, 860, 97, 97, 97, 97, 864, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1797, 45, 45, 45, 45, 1801, 45, 97, 875, 97, 97, 879, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1522, 97, 97, 97, 97, 97, 991, 45, 45, 45, 45, 996, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 215, 67, 67, 67, 67, 233, 67, 67, 67, 67, 251, 253, 1022, 67, 67, 67, 1026, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1035, 67, 67, 1038, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1458, 67, 67, 67, 67, 67, 1064, 67, 67, 67, 1067, 67, 67, 67, 67, 1072, 67, 67, 67, 67, 67, 67, 1296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2367488, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 1096, 0, 921, 29315, 0, 0, 0, 0, 928, 45, 45, 45, 45, 45, 934, 45, 45, 45, 164, 45, 45, 45, 45, 45, 45, 45, 45, 45, 198, 45, 45, 45, 378, 45, 45, 45, 45, 45, 45, 393, 45, 45, 45, 398, 45, 97, 97, 1116, 97, 97, 97, 1120, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1147, 1148, 97, 97, 97, 97, 97, 97, 97, 1129, 97, 97, 1132, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1626, 97, 97, 97, 97, 0, 45, 1178, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1185, 45, 45, 45, 45, 441, 45, 45, 45, 45, 45, 45, 451, 45, 45, 67, 67, 67, 67, 67, 227, 67, 67, 67, 67, 67, 67, 67, 67, 1260, 67, 67, 67, 1263, 67, 67, 1265, 1203, 45, 45, 1205, 45, 1206, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1216, 67, 1266, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1276, 67, 67, 67, 67, 67, 67, 492, 67, 67, 67, 67, 67, 67, 67, 67, 67, 471, 67, 67, 67, 67, 481, 67, 45, 1386, 45, 1389, 45, 45, 45, 45, 1394, 45, 45, 45, 1397, 45, 45, 45, 45, 995, 45, 997, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1915, 67, 67, 67, 67, 67, 1422, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1433, 67, 1436, 67, 67, 67, 67, 1441, 67, 67, 67, 1444, 67, 67, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 281, 28809, 53531, 97, 97, 97, 97, 1494, 97, 97, 97, 1497, 97, 97, 97, 97, 97, 97, 97, 1368, 97, 97, 97, 97, 97, 97, 97, 97, 851, 97, 97, 97, 97, 97, 97, 97, 67, 67, 67, 1571, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 67, 67, 1583, 67, 67, 67, 67, 67, 67, 67, 67, 1591, 67, 67, 67, 67, 67, 67, 752, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1056, 67, 67, 67, 67, 67, 67, 97, 1634, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1125, 97, 97, 97, 1647, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1183, 45, 45, 45, 45, 45, 45, 45, 45, 45, 409, 45, 45, 45, 45, 45, 45, 1658, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1668, 1712, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 1835, 97, 97, 97, 97, 0, 0, 0, 97, 97, 1844, 97, 97, 1726, 0, 97, 97, 97, 97, 97, 1732, 97, 1734, 97, 97, 97, 97, 97, 300, 97, 308, 97, 97, 97, 97, 97, 97, 97, 97, 866, 97, 97, 97, 97, 97, 97, 97, 67, 67, 67, 1758, 67, 67, 67, 1762, 67, 67, 67, 67, 67, 67, 67, 67, 1043, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1771, 67, 67, 67, 97, 97, 97, 97, 97, 1776, 97, 97, 97, 97, 297, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1108, 97, 97, 97, 97, 67, 67, 67, 1966, 97, 97, 97, 1970, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 1720, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 1837, 97, 0, 1840, 1841, 97, 97, 97, 1988, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1994, 1995, 67, 97, 97, 97, 97, 97, 1103, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 917, 97, 97, 0, 0, 0, 67, 67, 265, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 345, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 0, 361, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 671, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 411, 45, 45, 414, 45, 45, 45, 45, 377, 45, 45, 45, 386, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1223, 45, 45, 45, 45, 45, 45, 45, 45, 45, 426, 45, 45, 433, 45, 45, 45, 67, 67, 67, 67, 67, 463, 67, 67, 67, 472, 67, 67, 67, 67, 67, 67, 67, 527, 67, 67, 67, 67, 67, 67, 537, 67, 540, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 97, 97, 97, 97, 97, 1119, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1509, 97, 97, 97, 97, 97, 97, 97, 97, 564, 97, 97, 97, 97, 97, 97, 97, 637, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 927, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1234, 45, 45, 45, 45, 67, 67, 67, 67, 1240, 45, 697, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 708, 45, 45, 45, 45, 1221, 45, 45, 45, 45, 1225, 45, 45, 45, 45, 45, 45, 384, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1210, 45, 45, 45, 45, 45, 45, 67, 67, 795, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1470, 67, 67, 67, 67, 67, 67, 67, 815, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 97, 97, 97, 893, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1164, 97, 97, 97, 67, 67, 67, 1025, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1687, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 1097, 1241, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1450, 45, 45, 1388, 45, 1390, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1236, 67, 67, 67, 67, 67, 1437, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1472, 1490, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1503, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 1930, 0, 97, 97, 97, 97, 97, 847, 97, 97, 97, 97, 97, 97, 97, 97, 97, 858, 67, 67, 1965, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 1719, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 1382, 45, 1383, 45, 45, 45, 159, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1563, 45, 45, 45, 45, 45, 67, 261, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 341, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 97, 1099, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1333, 97, 1230, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1992, 67, 1993, 67, 67, 67, 97, 97, 45, 45, 160, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1665, 45, 45, 45, 45, 45, 131427, 357, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 684, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 412, 45, 45, 45, 416, 45, 45, 45, 440, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1990, 67, 1991, 67, 67, 67, 67, 67, 67, 67, 97, 97, 1707, 97, 97, 97, 97, 97, 97, 501, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1691, 67, 67, 67, 67, 67, 526, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1030, 67, 1032, 67, 67, 67, 67, 598, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1632, 0, 921, 29315, 923, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1404, 45, 45, 45, 45, 45, 45, 45, 45, 45, 425, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 1093, 0, 0, 0, 0, 0, 97, 1609, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1369, 97, 97, 97, 1372, 97, 97, 67, 67, 266, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 346, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 665, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1677, 45, 45, 45, 45, 67, 45, 45, 954, 45, 956, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1545, 45, 45, 45, 45, 45, 45, 45, 45, 45, 448, 45, 45, 45, 45, 67, 456, 67, 67, 67, 67, 67, 1270, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1069, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1350, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1524, 97, 97, 97, 97, 97, 97, 97, 1376, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 1559, 1561, 45, 45, 45, 1564, 45, 1566, 1567, 45, 67, 67, 67, 67, 67, 1573, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1247, 67, 67, 67, 67, 67, 1252, 97, 1725, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1628, 97, 1630, 0, 0, 94242, 0, 0, 0, 2211840, 0, 1118208, 0, 0, 0, 0, 2158592, 2158731, 2158592, 2158592, 2158592, 3117056, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3018752, 2158592, 3043328, 2158592, 2158592, 2158592, 2158592, 3080192, 2158592, 2158592, 3112960, 2158592, 2158592, 2158592, 2158592, 2158592, 2158878, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2605056, 2158592, 2158592, 2207744, 0, 542, 0, 544, 0, 0, 2166784, 0, 0, 0, 550, 0, 0, 2158592, 2158592, 2686976, 2158592, 2715648, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2867200, 2158592, 2904064, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 94242, 0, 0, 0, 2211840, 0, 0, 1130496, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 0, 139, 0, 0, 0, 139, 0, 2367488, 2207744, 0, 0, 0, 0, 176128, 0, 2166784, 0, 0, 0, 0, 0, 286, 2158592, 2158592, 3170304, 3174400, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 1508, 2158592, 2908160, 2158592, 2158592, 2158592, 2977792, 2158592, 2158592, 2158592, 2158592, 3039232, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3158016, 67, 24850, 24850, 12564, 12564, 0, 0, 0, 0, 0, 53531, 53531, 0, 286, 97, 97, 97, 97, 97, 1144, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1149, 97, 97, 97, 97, 1154, 57889, 0, 0, 0, 0, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 561, 97, 97, 97, 97, 97, 97, 576, 97, 97, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 0, 0, 139264, 0, 921, 29315, 0, 0, 926, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 719, 720, 45, 45, 45, 45, 45, 45, 45, 45, 685, 45, 45, 45, 45, 45, 45, 45, 45, 45, 942, 45, 45, 946, 45, 45, 45, 950, 45, 45, 0, 2146304, 2146304, 0, 0, 0, 0, 2224128, 2224128, 2224128, 2232320, 2232320, 2232320, 2232320, 0, 0, 1301, 0, 0, 0, 0, 0, 1307, 0, 0, 0, 0, 0, 1313, 0, 0, 0, 0, 0, 0, 0, 97, 97, 1318, 97, 97, 97, 97, 97, 97, 1795, 97, 97, 45, 45, 45, 45, 45, 45, 45, 446, 45, 45, 45, 45, 45, 45, 67, 67, 2158592, 2146304, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 921, 29315, 0, 924, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1000, 45, 45, 45, 45, 67, 67 -]; - -XQueryTokenizer.EXPECTED = -[ 290, 300, 304, 353, 296, 309, 305, 319, 315, 324, 328, 352, 354, 334, 338, 330, 320, 345, 349, 293, 358, 362, 341, 366, 312, 370, 374, 378, 382, 386, 390, 394, 398, 737, 402, 634, 439, 604, 634, 634, 634, 634, 408, 634, 634, 634, 404, 634, 634, 634, 457, 634, 634, 963, 634, 634, 413, 634, 634, 634, 634, 634, 634, 634, 663, 418, 422, 903, 902, 426, 431, 548, 634, 437, 521, 919, 443, 615, 409, 449, 455, 624, 731, 751, 634, 461, 465, 672, 470, 469, 474, 481, 485, 477, 489, 493, 629, 542, 497, 505, 603, 602, 991, 648, 510, 804, 634, 515, 958, 526, 525, 530, 768, 634, 546, 552, 711, 710, 593, 558, 562, 618, 566, 570, 574, 578, 582, 586, 590, 608, 612, 660, 822, 821, 634, 622, 596, 444, 628, 533, 724, 633, 640, 653, 647, 652, 536, 1008, 451, 450, 445, 657, 670, 676, 685, 689, 693, 697, 701, 704, 707, 715, 719, 798, 815, 634, 723, 762, 996, 634, 728, 969, 730, 735, 908, 634, 741, 679, 889, 511, 747, 634, 750, 755, 499, 666, 499, 501, 759, 772, 776, 780, 634, 787, 784, 797, 802, 809, 808, 427, 814, 1006, 517, 634, 519, 853, 634, 813, 850, 793, 634, 819, 826, 833, 832, 837, 843, 847, 857, 861, 863, 867, 871, 875, 879, 883, 643, 887, 539, 980, 979, 634, 893, 944, 634, 900, 896, 634, 907, 933, 506, 912, 917, 828, 433, 636, 635, 554, 961, 923, 930, 927, 937, 941, 634, 634, 634, 974, 948, 952, 985, 913, 968, 967, 743, 634, 973, 839, 634, 978, 599, 634, 984, 989, 765, 444, 995, 1000, 634, 1003, 790, 955, 1012, 681, 634, 634, 634, 634, 634, 414, 1016, 1020, 1024, 1085, 1027, 1090, 1090, 1046, 1080, 1137, 1108, 1215, 1049, 1032, 1039, 1085, 1085, 1085, 1085, 1058, 1062, 1068, 1085, 1086, 1090, 1090, 1091, 1072, 1064, 1107, 1090, 1090, 1090, 1118, 1123, 1138, 1078, 1074, 1084, 1085, 1085, 1085, 1087, 1090, 1062, 1052, 1060, 1114, 1062, 1104, 1085, 1085, 1090, 1090, 1028, 1122, 1063, 1128, 1139, 1127, 1158, 1085, 1085, 1151, 1090, 1090, 1090, 1095, 1090, 1132, 1073, 1136, 1143, 1061, 1150, 1085, 1155, 1098, 1101, 1146, 1162, 1169, 1101, 1185, 1151, 1090, 1110, 1173, 1054, 1087, 1109, 1177, 1165, 1089, 1204, 1184, 1107, 1189, 1193, 1088, 1197, 1180, 1201, 1208, 1042, 1212, 1219, 1223, 1227, 1231, 1235, 1245, 1777, 1527, 1686, 1686, 1238, 1686, 1254, 1686, 1686, 1686, 1294, 1669, 1686, 1686, 1686, 1322, 1625, 1534, 1268, 1624, 1275, 1281, 1443, 1292, 1300, 1686, 1686, 1686, 1350, 1826, 1306, 1686, 1686, 1240, 2032, 1317, 1321, 1686, 1686, 1253, 1686, 1326, 1686, 1686, 1686, 1418, 1709, 1446, 1686, 1686, 1686, 1492, 1686, 1295, 1447, 1686, 1686, 1258, 1686, 1736, 1686, 1686, 1520, 1355, 1686, 1288, 1348, 1361, 1686, 1359, 1686, 1364, 1498, 1368, 1302, 1362, 1381, 1389, 1395, 1486, 1686, 1371, 1377, 1370, 1686, 1375, 1382, 1384, 1402, 1408, 1385, 1383, 1619, 1413, 1423, 1428, 1433, 1686, 1686, 1270, 1686, 1338, 1686, 1440, 1686, 1686, 1686, 1499, 1465, 1686, 1686, 1686, 1639, 1473, 1884, 1686, 1686, 1293, 1864, 1686, 1686, 1296, 1321, 1483, 1686, 1686, 1686, 1646, 1686, 1748, 1496, 1686, 1418, 1675, 1686, 1418, 1702, 1686, 1418, 1981, 1686, 1429, 1409, 1427, 1504, 1692, 1686, 1686, 1313, 1448, 1651, 1508, 1686, 1686, 1340, 1686, 1903, 1686, 1686, 1435, 1513, 1686, 1283, 1287, 1519, 1686, 1524, 1363, 1568, 1938, 1539, 1566, 1579, 1479, 1533, 1538, 1553, 1544, 1552, 1557, 1563, 1574, 1557, 1583, 1589, 1590, 1759, 1594, 1603, 1607, 1611, 1686, 1436, 1514, 1686, 1434, 1656, 1686, 1434, 1680, 1686, 1453, 1686, 1686, 1686, 1559, 1617, 1686, 1770, 1418, 1623, 1769, 1629, 1686, 1515, 1335, 1686, 1285, 1686, 1671, 1921, 1650, 1686, 1686, 1344, 1308, 1666, 1686, 1686, 1686, 1659, 1685, 1686, 1686, 1686, 1686, 1241, 1686, 1686, 1844, 1691, 1686, 1630, 1977, 1970, 1362, 1686, 1686, 1686, 1693, 1698, 1686, 1686, 1686, 1697, 1686, 1764, 1715, 1686, 1634, 1638, 1686, 1599, 1585, 1686, 1271, 1686, 1269, 1686, 1721, 1686, 1686, 1354, 1686, 1801, 1686, 1799, 1686, 1640, 1686, 1686, 1461, 1686, 1686, 1732, 1686, 1944, 1686, 1740, 1686, 1746, 1415, 1396, 1686, 1598, 1547, 1417, 1597, 1416, 1577, 1546, 1397, 1577, 1547, 1548, 1570, 1398, 1753, 1686, 1652, 1509, 1686, 1686, 1686, 1757, 1686, 1419, 1686, 1763, 1418, 1768, 1781, 1686, 1686, 1686, 1705, 1686, 2048, 1792, 1686, 1686, 1686, 1735, 1686, 1797, 1686, 1686, 1404, 1686, 1639, 1815, 1686, 1686, 1418, 2017, 1820, 1686, 1686, 1803, 1686, 1686, 1686, 1736, 1489, 1686, 1686, 1825, 1338, 1260, 1263, 1686, 1686, 1785, 1686, 1686, 1728, 1686, 1686, 1749, 1497, 1830, 1830, 1262, 1248, 1261, 1329, 1260, 1264, 1329, 1248, 1249, 1259, 1540, 1849, 1842, 1686, 1686, 1835, 1686, 1686, 1816, 1686, 1686, 1831, 1882, 1848, 1686, 1686, 1686, 1774, 2071, 1854, 1686, 1686, 1469, 1884, 1686, 1821, 1859, 1686, 1686, 1350, 1883, 1686, 1686, 1686, 1781, 1391, 1875, 1686, 1686, 1613, 1644, 1686, 1686, 1889, 1686, 1686, 1662, 1884, 1686, 1885, 1890, 1686, 1686, 1686, 1894, 1686, 1686, 1678, 1686, 1907, 1686, 1686, 1529, 1914, 1686, 1838, 1686, 1686, 1881, 1686, 1686, 1872, 1876, 1836, 1919, 1686, 1837, 1692, 1910, 1686, 1925, 1928, 1742, 1686, 1811, 1811, 1930, 1810, 1929, 1935, 1928, 1900, 1942, 1867, 1868, 1931, 1035, 1788, 1948, 1952, 1956, 1960, 1964, 1686, 1976, 1686, 1686, 1686, 2065, 1686, 1992, 2037, 1686, 1686, 1998, 2009, 1972, 2002, 1686, 1686, 1686, 2077, 1300, 2023, 1686, 1686, 1686, 1807, 2031, 1686, 1686, 1686, 1860, 1500, 2032, 1686, 1686, 1686, 2083, 1686, 2036, 1686, 1277, 1276, 2042, 1877, 1686, 1686, 2041, 1686, 1686, 2027, 2037, 2012, 1686, 2012, 1855, 1850, 1686, 2046, 1686, 1686, 2054, 1996, 1686, 1897, 1309, 2059, 2052, 1686, 2058, 1686, 1686, 2081, 1686, 1717, 1477, 1686, 1331, 1686, 1686, 1687, 1686, 1860, 1681, 1686, 1686, 1686, 1966, 1724, 1686, 1686, 1686, 1984, 2015, 1686, 1686, 1686, 1988, 1686, 2063, 1686, 1686, 1686, 2005, 1686, 1727, 1686, 1686, 1711, 1457, 2069, 1686, 1686, 1686, 2019, 2075, 1686, 1686, 1915, 1686, 1686, 1793, 1874, 1686, 1686, 1491, 1362, 1449, 1686, 1686, 1460, 2098, 2087, 2091, 2095, 2184, 2102, 2113, 2780, 2117, 2134, 2142, 2281, 2146, 2146, 2146, 2304, 2296, 2181, 2639, 2591, 2872, 2592, 2873, 2313, 2195, 2200, 2281, 2146, 2273, 2226, 2204, 2152, 2219, 2276, 2167, 2177, 2276, 2235, 2276, 2276, 2230, 2281, 2276, 2296, 2276, 2293, 2276, 2276, 2276, 2276, 2234, 2276, 2311, 2314, 2210, 2199, 2217, 2222, 2276, 2276, 2276, 2240, 2276, 2294, 2276, 2276, 2173, 2276, 2198, 2281, 2281, 2281, 2281, 2282, 2146, 2146, 2146, 2146, 2205, 2146, 2204, 2248, 2276, 2235, 2276, 2297, 2276, 2276, 2276, 2277, 2256, 2281, 2283, 2146, 2146, 2146, 2275, 2276, 2295, 2276, 2276, 2293, 2146, 2304, 2264, 2269, 2221, 2276, 2276, 2276, 2293, 2295, 2276, 2276, 2276, 2295, 2263, 2205, 2268, 2220, 2172, 2276, 2276, 2276, 2296, 2276, 2276, 2296, 2294, 2276, 2276, 2278, 2281, 2281, 2280, 2281, 2281, 2281, 2283, 2206, 2223, 2276, 2276, 2279, 2281, 2281, 2146, 2273, 2276, 2276, 2281, 2281, 2281, 2276, 2292, 2276, 2298, 2225, 2276, 2298, 2169, 2224, 2292, 2298, 2171, 2229, 2281, 2281, 2171, 2236, 2281, 2281, 2281, 2146, 2275, 2225, 2292, 2299, 2276, 2229, 2281, 2146, 2276, 2290, 2297, 2283, 2146, 2146, 2274, 2224, 2227, 2298, 2225, 2297, 2276, 2230, 2170, 2230, 2282, 2146, 2147, 2151, 2156, 2288, 2276, 2230, 2303, 2308, 2236, 2284, 2228, 2318, 2318, 2318, 2326, 2335, 2339, 2343, 2349, 2416, 2693, 2357, 2592, 2109, 2592, 2592, 2162, 2943, 2823, 2646, 2592, 2361, 2592, 2122, 2592, 2592, 2122, 2470, 2592, 2592, 2592, 2109, 2107, 2592, 2592, 2592, 2123, 2592, 2592, 2592, 2125, 2592, 2413, 2592, 2592, 2592, 2127, 2592, 2592, 2414, 2592, 2592, 2592, 2130, 2952, 2592, 2594, 2592, 2592, 2212, 2609, 2252, 2592, 2592, 2592, 2446, 2434, 2592, 2592, 2592, 2212, 2446, 2450, 2456, 2431, 2435, 2592, 2592, 2243, 2478, 2448, 2439, 2946, 2592, 2592, 2592, 2368, 2809, 2813, 2450, 2441, 2212, 2812, 2449, 2440, 2947, 2592, 2592, 2592, 2345, 2451, 2457, 2948, 2592, 2124, 2592, 2592, 2650, 2823, 2449, 2455, 2946, 2592, 2128, 2592, 2592, 2649, 2952, 2592, 2810, 2448, 2461, 2991, 2467, 2592, 2592, 2329, 2817, 2474, 2990, 2466, 2592, 2592, 2373, 2447, 2992, 2469, 2592, 2592, 2592, 2373, 2447, 2477, 2468, 2592, 2592, 2353, 2469, 2592, 2495, 2592, 2592, 2415, 2483, 2592, 2415, 2496, 2592, 2592, 2352, 2592, 2592, 2352, 2352, 2469, 2592, 2592, 2363, 2331, 2494, 2592, 2592, 2592, 2375, 2592, 2375, 2415, 2504, 2592, 2592, 2367, 2372, 2503, 2592, 2592, 2592, 2389, 2418, 2415, 2592, 2592, 2373, 2592, 2592, 2592, 2593, 2732, 2417, 2415, 2592, 2417, 2520, 2592, 2592, 2592, 2390, 2521, 2521, 2592, 2592, 2592, 2401, 2599, 2585, 2526, 2531, 2120, 2592, 2212, 2426, 2450, 2463, 2948, 2592, 2592, 2592, 2213, 2389, 2527, 2532, 2121, 2542, 2551, 2105, 2592, 2213, 2592, 2592, 2592, 2558, 2538, 2544, 2553, 2557, 2537, 2543, 2552, 2421, 2572, 2576, 2546, 2543, 2547, 2592, 2592, 2373, 2615, 2575, 2545, 2105, 2592, 2244, 2479, 2592, 2129, 2592, 2592, 2628, 2690, 2469, 2562, 2566, 2592, 2592, 2592, 2415, 2928, 2934, 2401, 2570, 2574, 2564, 2572, 2585, 2590, 2592, 2592, 2585, 2965, 2592, 2592, 2592, 2445, 2251, 2592, 2592, 2592, 2474, 2592, 2609, 2892, 2592, 2362, 2592, 2592, 2138, 2851, 2159, 2592, 2592, 2592, 2509, 2888, 2892, 2592, 2592, 2592, 2490, 2418, 2891, 2592, 2592, 2376, 2592, 2592, 2374, 2592, 2889, 2388, 2592, 2373, 2373, 2890, 2592, 2592, 2387, 2592, 2887, 2505, 2892, 2592, 2373, 2610, 2388, 2592, 2592, 2376, 2373, 2592, 2887, 2891, 2592, 2374, 2592, 2592, 2608, 2159, 2614, 2620, 2592, 2592, 2394, 2594, 2887, 2399, 2592, 2887, 2397, 2508, 2374, 2507, 2592, 2375, 2592, 2592, 2592, 2595, 2508, 2506, 2592, 2506, 2505, 2505, 2592, 2507, 2637, 2505, 2592, 2592, 2401, 2661, 2592, 2643, 2592, 2592, 2417, 2592, 2655, 2592, 2592, 2592, 2510, 2414, 2656, 2592, 2592, 2592, 2516, 2592, 2593, 2660, 2665, 2880, 2592, 2592, 2592, 2522, 2767, 2666, 2881, 2592, 2592, 2420, 2571, 2696, 2592, 2592, 2592, 2580, 2572, 2686, 2632, 2698, 2592, 2383, 2514, 2592, 2163, 2932, 2465, 2685, 2631, 2697, 2592, 2388, 2592, 2592, 2212, 2604, 2671, 2632, 2678, 2592, 2401, 2405, 2409, 2592, 2592, 2592, 2679, 2592, 2592, 2592, 2592, 2108, 2677, 2591, 2592, 2592, 2592, 2419, 2592, 2683, 2187, 2191, 2469, 2671, 2189, 2467, 2592, 2401, 2629, 2633, 2702, 2468, 2592, 2592, 2421, 2536, 2703, 2469, 2592, 2592, 2422, 2573, 2593, 2672, 2467, 2592, 2402, 2406, 2592, 2402, 2979, 2592, 2592, 2626, 2673, 2467, 2592, 2446, 2259, 2947, 2592, 2377, 2709, 2592, 2592, 2522, 2862, 2713, 2468, 2592, 2592, 2581, 2572, 2562, 2374, 2374, 2592, 2376, 2721, 2724, 2592, 2592, 2624, 2373, 2731, 2592, 2592, 2592, 2626, 2732, 2592, 2592, 2592, 2755, 2656, 2726, 2736, 2741, 2592, 2486, 2593, 2381, 2592, 2727, 2737, 2742, 2715, 2747, 2753, 2592, 2498, 2469, 2873, 2743, 2592, 2592, 2592, 2791, 2759, 2763, 2592, 2592, 2627, 2704, 2592, 2592, 2522, 2789, 2593, 2761, 2753, 2592, 2498, 2863, 2592, 2592, 2767, 2592, 2592, 2592, 2792, 2789, 2592, 2592, 2592, 2803, 2126, 2592, 2592, 2592, 2811, 2122, 2592, 2592, 2592, 2834, 2777, 2592, 2592, 2592, 2848, 2936, 2591, 2489, 2797, 2592, 2592, 2670, 2631, 2490, 2798, 2592, 2592, 2592, 2963, 2807, 2592, 2592, 2592, 2965, 2838, 2592, 2592, 2592, 2975, 2330, 2818, 2829, 2592, 2498, 2939, 2592, 2498, 2592, 2791, 2331, 2819, 2830, 2592, 2592, 2592, 2982, 2834, 2817, 2828, 2106, 2592, 2592, 2592, 2405, 2405, 2817, 2828, 2592, 2592, 2415, 2849, 2842, 2592, 2522, 2773, 2592, 2522, 2868, 2592, 2580, 2600, 2586, 2137, 2850, 2843, 2592, 2592, 2855, 2937, 2844, 2592, 2592, 2592, 2987, 2936, 2591, 2592, 2592, 2684, 2630, 2592, 2856, 2938, 2592, 2592, 2860, 2939, 2592, 2592, 2872, 2592, 2861, 2591, 2592, 2592, 2887, 2616, 2592, 2867, 2592, 2592, 2708, 2592, 2498, 2469, 2498, 2497, 2785, 2773, 2499, 2783, 2770, 2877, 2877, 2877, 2772, 2592, 2592, 2345, 2885, 2592, 2592, 2592, 2715, 2762, 2515, 2896, 2592, 2592, 2715, 2917, 2516, 2897, 2592, 2592, 2592, 2901, 2906, 2911, 2592, 2592, 2956, 2960, 2715, 2902, 2907, 2912, 2593, 2916, 2920, 2820, 2922, 2822, 2592, 2592, 2715, 2927, 2921, 2821, 2106, 2592, 2592, 2974, 2408, 2321, 2821, 2106, 2592, 2592, 2983, 2592, 2593, 2404, 2408, 2592, 2592, 2717, 2749, 2716, 2928, 2322, 2822, 2593, 2926, 2919, 2820, 2934, 2823, 2592, 2592, 2592, 2651, 2824, 2592, 2592, 2592, 2130, 2952, 2592, 2592, 2592, 2592, 2964, 2592, 2592, 2716, 2748, 2592, 2969, 2592, 2592, 2716, 2918, 2368, 2970, 2592, 2592, 2592, 2403, 2407, 2592, 2592, 2787, 2211, 2404, 2409, 2592, 2592, 2802, 2837, 2987, 2592, 2592, 2592, 2809, 2427, 2592, 2793, 2592, 2592, 2809, 2447, 1073741824, 0x80000000, 539754496, 542375936, 402653184, 554434560, 571736064, 545521856, 268451840, 335544320, 268693630, 512, 2048, 256, 1024, 0, 1024, 0, 1073741824, 0x80000000, 0, 0, 0, 8388608, 0, 0, 1073741824, 1073741824, 0, 0x80000000, 537133056, 4194304, 1048576, 268435456, -1073741824, 0, 0, 0, 1048576, 0, 0, 0, 1572864, 0, 0, 0, 4194304, 0, 134217728, 16777216, 0, 0, 32, 64, 98304, 0, 33554432, 8388608, 192, 67108864, 67108864, 67108864, 67108864, 16, 32, 4, 0, 8192, 196608, 196608, 229376, 80, 4096, 524288, 8388608, 0, 0, 32, 128, 256, 24576, 24600, 24576, 24576, 2, 24576, 24576, 24576, 24584, 24592, 24576, 24578, 24576, 24578, 24576, 24576, 16, 512, 2048, 2048, 256, 4096, 32768, 1048576, 4194304, 67108864, 134217728, 268435456, 262144, 134217728, 0, 128, 128, 64, 16384, 16384, 16384, 67108864, 32, 32, 4, 4, 4096, 262144, 134217728, 0, 0, 0, 2, 0, 8192, 131072, 131072, 4096, 4096, 4096, 4096, 24576, 24576, 24576, 8, 8, 24576, 24576, 16384, 16384, 16384, 24576, 24584, 24576, 24576, 24576, 16384, 24576, 536870912, 262144, 0, 0, 32, 2048, 8192, 4, 4096, 4096, 4096, 786432, 8388608, 16777216, 0, 128, 16384, 16384, 16384, 32768, 65536, 2097152, 32, 32, 32, 32, 4, 4, 4, 4, 4, 4096, 67108864, 67108864, 67108864, 24576, 24576, 24576, 24576, 0, 16384, 16384, 16384, 16384, 67108864, 67108864, 8, 67108864, 24576, 8, 8, 8, 24576, 24576, 24576, 24578, 24576, 24576, 24576, 2, 2, 2, 16384, 67108864, 67108864, 67108864, 32, 67108864, 8, 8, 24576, 2048, 0x80000000, 536870912, 262144, 262144, 262144, 67108864, 8, 24576, 16384, 32768, 1048576, 4194304, 25165824, 67108864, 24576, 32770, 2, 4, 112, 512, 98304, 524288, 50, 402653186, 1049090, 1049091, 10, 66, 100925514, 10, 66, 12582914, 0, 0, -1678194207, -1678194207, -1041543218, 0, 32768, 0, 0, 32, 65536, 268435456, 1, 1, 513, 1048577, 0, 12582912, 0, 0, 0, 4, 1792, 0, 0, 0, 7, 29360128, 0, 0, 0, 8, 0, 0, 0, 12, 1, 1, 0, 0, -604102721, -604102721, 4194304, 8388608, 0, 0, 0, 31, 925600, 997981306, 997981306, 997981306, 0, 0, 2048, 8388608, 0, 0, 1, 2, 4, 32, 64, 512, 8192, 0, 0, 0, 245760, 997720064, 0, 0, 0, 32, 0, 0, 0, 3, 12, 16, 32, 8, 112, 3072, 12288, 16384, 32768, 65536, 131072, 7864320, 16777216, 973078528, 0, 0, 65536, 131072, 3670016, 4194304, 16777216, 33554432, 2, 8, 48, 2048, 8192, 16384, 32768, 65536, 131072, 524288, 131072, 524288, 3145728, 4194304, 16777216, 33554432, 65536, 131072, 2097152, 4194304, 16777216, 33554432, 134217728, 268435456, 536870912, 0, 0, 0, 1024, 0, 8, 48, 2048, 8192, 65536, 33554432, 268435456, 536870912, 65536, 268435456, 536870912, 0, 0, 32768, 0, 0, 126, 623104, 65011712, 0, 32, 65536, 536870912, 0, 0, 65536, 524288, 0, 32, 65536, 0, 0, 0, 2048, 0, 0, 0, 15482, 245760, -604102721, 0, 0, 0, 18913, 33062912, 925600, -605028352, 0, 0, 0, 65536, 31, 8096, 131072, 786432, 3145728, 3145728, 12582912, 50331648, 134217728, 268435456, 160, 256, 512, 7168, 131072, 786432, 131072, 786432, 1048576, 2097152, 12582912, 16777216, 268435456, 1073741824, 0x80000000, 12582912, 16777216, 33554432, 268435456, 1073741824, 0x80000000, 3, 12, 16, 160, 256, 7168, 786432, 1048576, 12582912, 16777216, 268435456, 1073741824, 0, 8, 16, 32, 128, 256, 512, 7168, 786432, 1048576, 2097152, 0, 1, 2, 8, 16, 7168, 786432, 1048576, 8388608, 16777216, 16777216, 1073741824, 0, 0, 0, 0, 1, 0, 0, 8, 32, 128, 256, 7168, 8, 32, 0, 3072, 0, 8, 32, 3072, 4096, 524288, 8, 32, 0, 0, 3072, 4096, 0, 2048, 524288, 8388608, 8, 2048, 0, 0, 1, 12, 256, 4096, 32768, 262144, 1048576, 4194304, 67108864, 0, 2048, 0, 2048, 2048, 1073741824, -58805985, -58805985, -58805985, 0, 0, 262144, 0, 0, 32, 4194304, 16777216, 134217728, 4382, 172032, -58982400, 0, 0, 2, 28, 256, 4096, 8192, 8192, 32768, 131072, 262144, 524288, 1, 2, 12, 256, 4096, 0, 0, 4194304, 67108864, 134217728, 805306368, 1073741824, 0, 0, 1, 2, 12, 16, 256, 4096, 1048576, 67108864, 134217728, 268435456, 0, 512, 1048576, 4194304, 201326592, 1879048192, 0, 0, 12, 256, 4096, 134217728, 268435456, 536870912, 12, 256, 268435456, 536870912, 0, 12, 256, 0, 0, 1, 32, 64, 512, 0, 0, 205236961, 205236961, 0, 0, 0, 1, 96, 640, 1, 10976, 229376, 204996608, 0, 640, 2048, 8192, 229376, 1572864, 1572864, 2097152, 201326592, 0, 0, 0, 64, 512, 2048, 229376, 1572864, 201326592, 1572864, 201326592, 0, 0, 1, 4382, 0, 1, 32, 2048, 65536, 131072, 1572864, 201326592, 131072, 1572864, 134217728, 0, 0, 524288, 524288, 0, 0, 0, -68582786, -68582786, -68582786, 0, 0, 2097152, 524288, 0, 524288, 0, 0, 65536, 131072, 1572864, 0, 0, 2, 4, 0, 0, 65011712, -134217728, 0, 0, 0, 0, 2, 4, 120, 512, -268435456, 0, 0, 0, 2, 8, 48, 64, 2048, 8192, 98304, 524288, 2097152, 4194304, 25165824, 33554432, 134217728, 268435456, 0x80000000, 0, 0, 25165824, 33554432, 134217728, 1879048192, 0x80000000, 0, 0, 4, 112, 512, 622592, 65011712, 134217728, -268435456, 16777216, 33554432, 134217728, 1610612736, 0, 0, 0, 64, 98304, 524288, 4194304, 16777216, 33554432, 0, 98304, 524288, 16777216, 33554432, 0, 65536, 524288, 33554432, 536870912, 1073741824, 0, 65536, 524288, 536870912, 1073741824, 0, 0, 65536, 524288, 536870912, 0, 524288, 0, 524288, 524288, 1048576, 2086666240, 0x80000000, 0, -1678194207, 0, 0, 0, 8, 32, 2048, 524288, 8388608, 0, 0, 33062912, 436207616, 0x80000000, 0, 0, 32, 64, 2432, 16384, 32768, 32768, 524288, 3145728, 4194304, 25165824, 25165824, 167772160, 268435456, 0x80000000, 0, 32, 64, 384, 2048, 16384, 32768, 1048576, 2097152, 4194304, 25165824, 32, 64, 128, 256, 2048, 16384, 2048, 16384, 1048576, 4194304, 16777216, 33554432, 134217728, 536870912, 1073741824, 0, 0, 2048, 16384, 4194304, 16777216, 33554432, 134217728, 805306368, 0, 0, 16777216, 134217728, 268435456, 0x80000000, 0, 622592, 622592, 622592, 8807, 8807, 434791, 0, 0, 16777216, 0, 0, 0, 7, 608, 8192, 0, 0, 0, 3, 4, 96, 512, 32, 64, 8192, 0, 0, 16777216, 134217728, 0, 0, 2, 4, 8192, 16384, 65536, 2097152, 33554432, 268435456 -]; - -XQueryTokenizer.TOKEN = -[ - "(0)", - "ModuleDecl", - "Annotation", - "OptionDecl", - "Operator", - "Variable", - "Tag", - "EndTag", - "PragmaContents", - "DirCommentContents", - "DirPIContents", - "CDataSectionContents", - "AttrTest", - "Wildcard", - "EQName", - "IntegerLiteral", - "DecimalLiteral", - "DoubleLiteral", - "PredefinedEntityRef", - "'\"\"'", - "EscapeApos", - "QuotChar", - "AposChar", - "ElementContentChar", - "QuotAttrContentChar", - "AposAttrContentChar", - "NCName", - "QName", - "S", - "CharRef", - "CommentContents", - "DocTag", - "DocCommentContents", - "EOF", - "'!'", - "'\"'", - "'#'", - "'#)'", - "''''", - "'('", - "'(#'", - "'(:'", - "'(:~'", - "')'", - "'*'", - "'*'", - "','", - "'-->'", - "'.'", - "'/'", - "'/>'", - "':'", - "':)'", - "';'", - "'}\n\ - \n\ -snippet ife\n\ - if (${1:/* condition */}) {\n\ - ${2:// code...}\n\ - } else {\n\ - ${3:// code...}\n\ - }\n\ - ${4}\n\ -snippet ifeil\n\ - \n\ - ${2:}\n\ - \n\ - ${3:}\n\ - \n\ - ${4}\n\ -snippet else\n\ - else {\n\ - ${1:// code...}\n\ - }\n\ -snippet elseif\n\ - elseif (${1:/* condition */}) {\n\ - ${2:// code...}\n\ - }\n\ -snippet switch\n\ - switch ($${1:variable}) {\n\ - case '${2:value}':\n\ - ${3:// code...}\n\ - break;\n\ - ${5}\n\ - default:\n\ - ${4:// code...}\n\ - break;\n\ - }\n\ -snippet case\n\ - case '${1:value}':\n\ - ${2:// code...}\n\ - break;${3}\n\ -snippet for\n\ - for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {\n\ - ${4: // code...}\n\ - }\n\ -snippet foreach\n\ - foreach ($${1:variable} as $${2:value}) {\n\ - ${3:// code...}\n\ - }\n\ -snippet foreachil\n\ - \n\ - ${3:}\n\ - \n\ -snippet foreachk\n\ - foreach ($${1:variable} as $${2:key} => $${3:value}) {\n\ - ${4:// code...}\n\ - }\n\ -snippet foreachkil\n\ - $${3:value}): ?>\n\ - ${4:}\n\ - \n\ -# $... = array (...)\n\ -snippet array\n\ - $${1:arrayName} = array('${2}' => ${3});${4}\n\ -snippet try\n\ - try {\n\ - ${2}\n\ - } catch (${1:Exception} $e) {\n\ - }\n\ -# lambda with closure\n\ -snippet lambda\n\ - ${1:static }function (${2:args}) use (${3:&$x, $y /*put vars in scope (closure) */}) {\n\ - ${4}\n\ - };\n\ -# pre_dump();\n\ -snippet pd\n\ - echo '
    '; var_dump(${1}); echo '
    ';\n\ -# pre_dump(); die();\n\ -snippet pdd\n\ - echo '
    '; var_dump(${1}); echo '
    '; die(${2:});\n\ -snippet vd\n\ - var_dump(${1});\n\ -snippet vdd\n\ - var_dump(${1}); die(${2:});\n\ -snippet http_redirect\n\ - header (\"HTTP/1.1 301 Moved Permanently\"); \n\ - header (\"Location: \".URL); \n\ - exit();\n\ -# Getters & Setters\n\ -snippet gs\n\ - /**\n\ - * Gets the value of ${1:foo}\n\ - *\n\ - * @return ${2:$1}\n\ - */\n\ - public function get${3:$2}()\n\ - {\n\ - return $this->${4:$1};\n\ - }\n\ -\n\ - /**\n\ - * Sets the value of $1\n\ - *\n\ - * @param $2 $$1 ${5:description}\n\ - *\n\ - * @return ${6:$FILENAME}\n\ - */\n\ - public function set$3(${7:$2 }$$1)\n\ - {\n\ - $this->$4 = $$1;\n\ - return $this;\n\ - }${8}\n\ -# anotation, get, and set, useful for doctrine\n\ -snippet ags\n\ - /**\n\ - * ${1:description}\n\ - * \n\ - * @${7}\n\ - */\n\ - ${2:protected} $${3:foo};\n\ -\n\ - public function get${4:$3}()\n\ - {\n\ - return $this->$3;\n\ - }\n\ -\n\ - public function set$4(${5:$4 }$${6:$3})\n\ - {\n\ - $this->$3 = $$6;\n\ - return $this;\n\ - }\n\ -snippet rett\n\ - return true;\n\ -snippet retf\n\ - return false;\n\ -"; -exports.scope = "php"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/plain_text.js b/util/build-sample-browser/player/vendor/ace/snippets/plain_text.js deleted file mode 100644 index 1c76fdd7d3..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/plain_text.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/plain_text', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "plain_text"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/powershell.js b/util/build-sample-browser/player/vendor/ace/snippets/powershell.js deleted file mode 100644 index c7bc2d306d..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/powershell.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/powershell', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "powershell"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/prolog.js b/util/build-sample-browser/player/vendor/ace/snippets/prolog.js deleted file mode 100644 index 7e75d510de..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/prolog.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/prolog', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "prolog"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/properties.js b/util/build-sample-browser/player/vendor/ace/snippets/properties.js deleted file mode 100644 index ec389d5da6..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/properties.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/properties', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "properties"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/protobuf.js b/util/build-sample-browser/player/vendor/ace/snippets/protobuf.js deleted file mode 100644 index cea6aa2d8b..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/protobuf.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/protobuf', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "protobuf"; - -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/snippets/python.js b/util/build-sample-browser/player/vendor/ace/snippets/python.js deleted file mode 100644 index 008f8cc011..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/python.js +++ /dev/null @@ -1,165 +0,0 @@ -ace.define('ace/snippets/python', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "snippet #!\n\ - #!/usr/bin/env python\n\ -snippet imp\n\ - import ${1:module}\n\ -snippet from\n\ - from ${1:package} import ${2:module}\n\ -# Module Docstring\n\ -snippet docs\n\ - '''\n\ - File: ${1:FILENAME:file_name}\n\ - Author: ${2:author}\n\ - Description: ${3}\n\ - '''\n\ -snippet wh\n\ - while ${1:condition}:\n\ - ${2:# TODO: write code...}\n\ -# dowh - does the same as do...while in other languages\n\ -snippet dowh\n\ - while True:\n\ - ${1:# TODO: write code...}\n\ - if ${2:condition}:\n\ - break\n\ -snippet with\n\ - with ${1:expr} as ${2:var}:\n\ - ${3:# TODO: write code...}\n\ -# New Class\n\ -snippet cl\n\ - class ${1:ClassName}(${2:object}):\n\ - \"\"\"${3:docstring for $1}\"\"\"\n\ - def __init__(self, ${4:arg}):\n\ - ${5:super($1, self).__init__()}\n\ - self.$4 = $4\n\ - ${6}\n\ -# New Function\n\ -snippet def\n\ - def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):\n\ - \"\"\"${3:docstring for $1}\"\"\"\n\ - ${4:# TODO: write code...}\n\ -snippet deff\n\ - def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):\n\ - ${3:# TODO: write code...}\n\ -# New Method\n\ -snippet defs\n\ - def ${1:mname}(self, ${2:arg}):\n\ - ${3:# TODO: write code...}\n\ -# New Property\n\ -snippet property\n\ - def ${1:foo}():\n\ - doc = \"${2:The $1 property.}\"\n\ - def fget(self):\n\ - ${3:return self._$1}\n\ - def fset(self, value):\n\ - ${4:self._$1 = value}\n\ -# Ifs\n\ -snippet if\n\ - if ${1:condition}:\n\ - ${2:# TODO: write code...}\n\ -snippet el\n\ - else:\n\ - ${1:# TODO: write code...}\n\ -snippet ei\n\ - elif ${1:condition}:\n\ - ${2:# TODO: write code...}\n\ -# For\n\ -snippet for\n\ - for ${1:item} in ${2:items}:\n\ - ${3:# TODO: write code...}\n\ -# Encodes\n\ -snippet cutf8\n\ - # -*- coding: utf-8 -*-\n\ -snippet clatin1\n\ - # -*- coding: latin-1 -*-\n\ -snippet cascii\n\ - # -*- coding: ascii -*-\n\ -# Lambda\n\ -snippet ld\n\ - ${1:var} = lambda ${2:vars} : ${3:action}\n\ -snippet .\n\ - self.\n\ -snippet try Try/Except\n\ - try:\n\ - ${1:# TODO: write code...}\n\ - except ${2:Exception}, ${3:e}:\n\ - ${4:raise $3}\n\ -snippet try Try/Except/Else\n\ - try:\n\ - ${1:# TODO: write code...}\n\ - except ${2:Exception}, ${3:e}:\n\ - ${4:raise $3}\n\ - else:\n\ - ${5:# TODO: write code...}\n\ -snippet try Try/Except/Finally\n\ - try:\n\ - ${1:# TODO: write code...}\n\ - except ${2:Exception}, ${3:e}:\n\ - ${4:raise $3}\n\ - finally:\n\ - ${5:# TODO: write code...}\n\ -snippet try Try/Except/Else/Finally\n\ - try:\n\ - ${1:# TODO: write code...}\n\ - except ${2:Exception}, ${3:e}:\n\ - ${4:raise $3}\n\ - else:\n\ - ${5:# TODO: write code...}\n\ - finally:\n\ - ${6:# TODO: write code...}\n\ -# if __name__ == '__main__':\n\ -snippet ifmain\n\ - if __name__ == '__main__':\n\ - ${1:main()}\n\ -# __magic__\n\ -snippet _\n\ - __${1:init}__${2}\n\ -# python debugger (pdb)\n\ -snippet pdb\n\ - import pdb; pdb.set_trace()\n\ -# ipython debugger (ipdb)\n\ -snippet ipdb\n\ - import ipdb; ipdb.set_trace()\n\ -# ipython debugger (pdbbb)\n\ -snippet pdbbb\n\ - import pdbpp; pdbpp.set_trace()\n\ -snippet pprint\n\ - import pprint; pprint.pprint(${1})${2}\n\ -snippet \"\n\ - \"\"\"\n\ - ${1:doc}\n\ - \"\"\"\n\ -# test function/method\n\ -snippet test\n\ - def test_${1:description}(${2:self}):\n\ - ${3:# TODO: write code...}\n\ -# test case\n\ -snippet testcase\n\ - class ${1:ExampleCase}(unittest.TestCase):\n\ - \n\ - def test_${2:description}(self):\n\ - ${3:# TODO: write code...}\n\ -snippet fut\n\ - from __future__ import ${1}\n\ -#getopt\n\ -snippet getopt\n\ - try:\n\ - # Short option syntax: \"hv:\"\n\ - # Long option syntax: \"help\" or \"verbose=\"\n\ - opts, args = getopt.getopt(sys.argv[1:], \"${1:short_options}\", [${2:long_options}])\n\ - \n\ - except getopt.GetoptError, err:\n\ - # Print debug info\n\ - print str(err)\n\ - ${3:error_action}\n\ -\n\ - for option, argument in opts:\n\ - if option in (\"-h\", \"--help\"):\n\ - ${4}\n\ - elif option in (\"-v\", \"--verbose\"):\n\ - verbose = argument\n\ -"; -exports.scope = "python"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/r.js b/util/build-sample-browser/player/vendor/ace/snippets/r.js deleted file mode 100644 index 636ccc4e26..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/r.js +++ /dev/null @@ -1,128 +0,0 @@ -ace.define('ace/snippets/r', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "snippet #!\n\ - #!/usr/bin/env Rscript\n\ -\n\ -# includes\n\ -snippet lib\n\ - library(${1:package})\n\ -snippet req\n\ - require(${1:package})\n\ -snippet source\n\ - source('${1:file}')\n\ -\n\ -# conditionals\n\ -snippet if\n\ - if (${1:condition}) {\n\ - ${2:code}\n\ - }\n\ -snippet el\n\ - else {\n\ - ${1:code}\n\ - }\n\ -snippet ei\n\ - else if (${1:condition}) {\n\ - ${2:code}\n\ - }\n\ -\n\ -# functions\n\ -snippet fun\n\ - ${1:name} = function (${2:variables}) {\n\ - ${3:code}\n\ - }\n\ -snippet ret\n\ - return(${1:code})\n\ -\n\ -# dataframes, lists, etc\n\ -snippet df\n\ - ${1:name}[${2:rows}, ${3:cols}]\n\ -snippet c\n\ - c(${1:items})\n\ -snippet li\n\ - list(${1:items})\n\ -snippet mat\n\ - matrix(${1:data}, nrow=${2:rows}, ncol=${3:cols})\n\ -\n\ -# apply functions\n\ -snippet apply\n\ - apply(${1:array}, ${2:margin}, ${3:function})\n\ -snippet lapply\n\ - lapply(${1:list}, ${2:function})\n\ -snippet sapply\n\ - lapply(${1:list}, ${2:function})\n\ -snippet vapply\n\ - vapply(${1:list}, ${2:function}, ${3:type})\n\ -snippet mapply\n\ - mapply(${1:function}, ${2:...})\n\ -snippet tapply\n\ - tapply(${1:vector}, ${2:index}, ${3:function})\n\ -snippet rapply\n\ - rapply(${1:list}, ${2:function})\n\ -\n\ -# plyr functions\n\ -snippet dd\n\ - ddply(${1:frame}, ${2:variables}, ${3:function})\n\ -snippet dl\n\ - dlply(${1:frame}, ${2:variables}, ${3:function})\n\ -snippet da\n\ - daply(${1:frame}, ${2:variables}, ${3:function})\n\ -snippet d_\n\ - d_ply(${1:frame}, ${2:variables}, ${3:function})\n\ -\n\ -snippet ad\n\ - adply(${1:array}, ${2:margin}, ${3:function})\n\ -snippet al\n\ - alply(${1:array}, ${2:margin}, ${3:function})\n\ -snippet aa\n\ - aaply(${1:array}, ${2:margin}, ${3:function})\n\ -snippet a_\n\ - a_ply(${1:array}, ${2:margin}, ${3:function})\n\ -\n\ -snippet ld\n\ - ldply(${1:list}, ${2:function})\n\ -snippet ll\n\ - llply(${1:list}, ${2:function})\n\ -snippet la\n\ - laply(${1:list}, ${2:function})\n\ -snippet l_\n\ - l_ply(${1:list}, ${2:function})\n\ -\n\ -snippet md\n\ - mdply(${1:matrix}, ${2:function})\n\ -snippet ml\n\ - mlply(${1:matrix}, ${2:function})\n\ -snippet ma\n\ - maply(${1:matrix}, ${2:function})\n\ -snippet m_\n\ - m_ply(${1:matrix}, ${2:function})\n\ -\n\ -# plot functions\n\ -snippet pl\n\ - plot(${1:x}, ${2:y})\n\ -snippet ggp\n\ - ggplot(${1:data}, aes(${2:aesthetics}))\n\ -snippet img\n\ - ${1:(jpeg,bmp,png,tiff)}(filename=\"${2:filename}\", width=${3}, height=${4}, unit=\"${5}\")\n\ - ${6:plot}\n\ - dev.off()\n\ -\n\ -# statistical test functions\n\ -snippet fis\n\ - fisher.test(${1:x}, ${2:y})\n\ -snippet chi\n\ - chisq.test(${1:x}, ${2:y})\n\ -snippet tt\n\ - t.test(${1:x}, ${2:y})\n\ -snippet wil\n\ - wilcox.test(${1:x}, ${2:y})\n\ -snippet cor\n\ - cor.test(${1:x}, ${2:y})\n\ -snippet fte\n\ - var.test(${1:x}, ${2:y})\n\ -snippet kvt \n\ - kv.test(${1:x}, ${2:y})\n\ -"; -exports.scope = "r"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/rdoc.js b/util/build-sample-browser/player/vendor/ace/snippets/rdoc.js deleted file mode 100644 index 6cc1df9732..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/rdoc.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/rdoc', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "rdoc"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/rhtml.js b/util/build-sample-browser/player/vendor/ace/snippets/rhtml.js deleted file mode 100644 index 3323ea687c..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/rhtml.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/rhtml', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "rhtml"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/ruby.js b/util/build-sample-browser/player/vendor/ace/snippets/ruby.js deleted file mode 100644 index 7830e20acc..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/ruby.js +++ /dev/null @@ -1,935 +0,0 @@ -ace.define('ace/snippets/ruby', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "########################################\n\ -# Ruby snippets - for Rails, see below #\n\ -########################################\n\ -\n\ -# encoding for Ruby 1.9\n\ -snippet enc\n\ - # encoding: utf-8\n\ -\n\ -# #!/usr/bin/env ruby\n\ -snippet #!\n\ - #!/usr/bin/env ruby\n\ - # encoding: utf-8\n\ -\n\ -# New Block\n\ -snippet =b\n\ - =begin rdoc\n\ - ${1}\n\ - =end\n\ -snippet y\n\ - :yields: ${1:arguments}\n\ -snippet rb\n\ - #!/usr/bin/env ruby -wKU\n\ -snippet beg\n\ - begin\n\ - ${3}\n\ - rescue ${1:Exception} => ${2:e}\n\ - end\n\ -\n\ -snippet req require\n\ - require \"${1}\"${2}\n\ -snippet #\n\ - # =>\n\ -snippet end\n\ - __END__\n\ -snippet case\n\ - case ${1:object}\n\ - when ${2:condition}\n\ - ${3}\n\ - end\n\ -snippet when\n\ - when ${1:condition}\n\ - ${2}\n\ -snippet def\n\ - def ${1:method_name}\n\ - ${2}\n\ - end\n\ -snippet deft\n\ - def test_${1:case_name}\n\ - ${2}\n\ - end\n\ -snippet if\n\ - if ${1:condition}\n\ - ${2}\n\ - end\n\ -snippet ife\n\ - if ${1:condition}\n\ - ${2}\n\ - else\n\ - ${3}\n\ - end\n\ -snippet elsif\n\ - elsif ${1:condition}\n\ - ${2}\n\ -snippet unless\n\ - unless ${1:condition}\n\ - ${2}\n\ - end\n\ -snippet while\n\ - while ${1:condition}\n\ - ${2}\n\ - end\n\ -snippet for\n\ - for ${1:e} in ${2:c}\n\ - ${3}\n\ - end\n\ -snippet until\n\ - until ${1:condition}\n\ - ${2}\n\ - end\n\ -snippet cla class .. end\n\ - class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ - ${2}\n\ - end\n\ -snippet cla class .. initialize .. end\n\ - class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ - def initialize(${2:args})\n\ - ${3}\n\ - end\n\ - end\n\ -snippet cla class .. < ParentClass .. initialize .. end\n\ - class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} < ${2:ParentClass}\n\ - def initialize(${3:args})\n\ - ${4}\n\ - end\n\ - end\n\ -snippet cla ClassName = Struct .. do .. end\n\ - ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} = Struct.new(:${2:attr_names}) do\n\ - def ${3:method_name}\n\ - ${4}\n\ - end\n\ - end\n\ -snippet cla class BlankSlate .. initialize .. end\n\ - class ${1:BlankSlate}\n\ - instance_methods.each { |meth| undef_method(meth) unless meth =~ /\\A__/ }\n\ - end\n\ -snippet cla class << self .. end\n\ - class << ${1:self}\n\ - ${2}\n\ - end\n\ -# class .. < DelegateClass .. initialize .. end\n\ -snippet cla-\n\ - class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} < DelegateClass(${2:ParentClass})\n\ - def initialize(${3:args})\n\ - super(${4:del_obj})\n\ -\n\ - ${5}\n\ - end\n\ - end\n\ -snippet mod module .. end\n\ - module ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ - ${2}\n\ - end\n\ -snippet mod module .. module_function .. end\n\ - module ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ - module_function\n\ -\n\ - ${2}\n\ - end\n\ -snippet mod module .. ClassMethods .. end\n\ - module ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ - module ClassMethods\n\ - ${2}\n\ - end\n\ -\n\ - module InstanceMethods\n\ -\n\ - end\n\ -\n\ - def self.included(receiver)\n\ - receiver.extend ClassMethods\n\ - receiver.send :include, InstanceMethods\n\ - end\n\ - end\n\ -# attr_reader\n\ -snippet r\n\ - attr_reader :${1:attr_names}\n\ -# attr_writer\n\ -snippet w\n\ - attr_writer :${1:attr_names}\n\ -# attr_accessor\n\ -snippet rw\n\ - attr_accessor :${1:attr_names}\n\ -snippet atp\n\ - attr_protected :${1:attr_names}\n\ -snippet ata\n\ - attr_accessible :${1:attr_names}\n\ -# include Enumerable\n\ -snippet Enum\n\ - include Enumerable\n\ -\n\ - def each(&block)\n\ - ${1}\n\ - end\n\ -# include Comparable\n\ -snippet Comp\n\ - include Comparable\n\ -\n\ - def <=>(other)\n\ - ${1}\n\ - end\n\ -# extend Forwardable\n\ -snippet Forw-\n\ - extend Forwardable\n\ -# def self\n\ -snippet defs\n\ - def self.${1:class_method_name}\n\ - ${2}\n\ - end\n\ -# def method_missing\n\ -snippet defmm\n\ - def method_missing(meth, *args, &blk)\n\ - ${1}\n\ - end\n\ -snippet defd\n\ - def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name}\n\ -snippet defds\n\ - def_delegators :${1:@del_obj}, :${2:del_methods}\n\ -snippet am\n\ - alias_method :${1:new_name}, :${2:old_name}\n\ -snippet app\n\ - if __FILE__ == $PROGRAM_NAME\n\ - ${1}\n\ - end\n\ -# usage_if()\n\ -snippet usai\n\ - if ARGV.${1}\n\ - abort \"Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}\"${3}\n\ - end\n\ -# usage_unless()\n\ -snippet usau\n\ - unless ARGV.${1}\n\ - abort \"Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}\"${3}\n\ - end\n\ -snippet array\n\ - Array.new(${1:10}) { |${2:i}| ${3} }\n\ -snippet hash\n\ - Hash.new { |${1:hash}, ${2:key}| $1[$2] = ${3} }\n\ -snippet file File.foreach() { |line| .. }\n\ - File.foreach(${1:\"path/to/file\"}) { |${2:line}| ${3} }\n\ -snippet file File.read()\n\ - File.read(${1:\"path/to/file\"})${2}\n\ -snippet Dir Dir.global() { |file| .. }\n\ - Dir.glob(${1:\"dir/glob/*\"}) { |${2:file}| ${3} }\n\ -snippet Dir Dir[\"..\"]\n\ - Dir[${1:\"glob/**/*.rb\"}]${2}\n\ -snippet dir\n\ - Filename.dirname(__FILE__)\n\ -snippet deli\n\ - delete_if { |${1:e}| ${2} }\n\ -snippet fil\n\ - fill(${1:range}) { |${2:i}| ${3} }\n\ -# flatten_once()\n\ -snippet flao\n\ - inject(Array.new) { |${1:arr}, ${2:a}| $1.push(*$2)}${3}\n\ -snippet zip\n\ - zip(${1:enums}) { |${2:row}| ${3} }\n\ -# downto(0) { |n| .. }\n\ -snippet dow\n\ - downto(${1:0}) { |${2:n}| ${3} }\n\ -snippet ste\n\ - step(${1:2}) { |${2:n}| ${3} }\n\ -snippet tim\n\ - times { |${1:n}| ${2} }\n\ -snippet upt\n\ - upto(${1:1.0/0.0}) { |${2:n}| ${3} }\n\ -snippet loo\n\ - loop { ${1} }\n\ -snippet ea\n\ - each { |${1:e}| ${2} }\n\ -snippet ead\n\ - each do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet eab\n\ - each_byte { |${1:byte}| ${2} }\n\ -snippet eac- each_char { |chr| .. }\n\ - each_char { |${1:chr}| ${2} }\n\ -snippet eac- each_cons(..) { |group| .. }\n\ - each_cons(${1:2}) { |${2:group}| ${3} }\n\ -snippet eai\n\ - each_index { |${1:i}| ${2} }\n\ -snippet eaid\n\ - each_index do |${1:i}|\n\ - ${2}\n\ - end\n\ -snippet eak\n\ - each_key { |${1:key}| ${2} }\n\ -snippet eakd\n\ - each_key do |${1:key}|\n\ - ${2}\n\ - end\n\ -snippet eal\n\ - each_line { |${1:line}| ${2} }\n\ -snippet eald\n\ - each_line do |${1:line}|\n\ - ${2}\n\ - end\n\ -snippet eap\n\ - each_pair { |${1:name}, ${2:val}| ${3} }\n\ -snippet eapd\n\ - each_pair do |${1:name}, ${2:val}|\n\ - ${3}\n\ - end\n\ -snippet eas-\n\ - each_slice(${1:2}) { |${2:group}| ${3} }\n\ -snippet easd-\n\ - each_slice(${1:2}) do |${2:group}|\n\ - ${3}\n\ - end\n\ -snippet eav\n\ - each_value { |${1:val}| ${2} }\n\ -snippet eavd\n\ - each_value do |${1:val}|\n\ - ${2}\n\ - end\n\ -snippet eawi\n\ - each_with_index { |${1:e}, ${2:i}| ${3} }\n\ -snippet eawid\n\ - each_with_index do |${1:e},${2:i}|\n\ - ${3}\n\ - end\n\ -snippet reve\n\ - reverse_each { |${1:e}| ${2} }\n\ -snippet reved\n\ - reverse_each do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet inj\n\ - inject(${1:init}) { |${2:mem}, ${3:var}| ${4} }\n\ -snippet injd\n\ - inject(${1:init}) do |${2:mem}, ${3:var}|\n\ - ${4}\n\ - end\n\ -snippet map\n\ - map { |${1:e}| ${2} }\n\ -snippet mapd\n\ - map do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet mapwi-\n\ - enum_with_index.map { |${1:e}, ${2:i}| ${3} }\n\ -snippet sor\n\ - sort { |a, b| ${1} }\n\ -snippet sorb\n\ - sort_by { |${1:e}| ${2} }\n\ -snippet ran\n\ - sort_by { rand }\n\ -snippet all\n\ - all? { |${1:e}| ${2} }\n\ -snippet any\n\ - any? { |${1:e}| ${2} }\n\ -snippet cl\n\ - classify { |${1:e}| ${2} }\n\ -snippet col\n\ - collect { |${1:e}| ${2} }\n\ -snippet cold\n\ - collect do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet det\n\ - detect { |${1:e}| ${2} }\n\ -snippet detd\n\ - detect do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet fet\n\ - fetch(${1:name}) { |${2:key}| ${3} }\n\ -snippet fin\n\ - find { |${1:e}| ${2} }\n\ -snippet find\n\ - find do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet fina\n\ - find_all { |${1:e}| ${2} }\n\ -snippet finad\n\ - find_all do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet gre\n\ - grep(${1:/pattern/}) { |${2:match}| ${3} }\n\ -snippet sub\n\ - ${1:g}sub(${2:/pattern/}) { |${3:match}| ${4} }\n\ -snippet sca\n\ - scan(${1:/pattern/}) { |${2:match}| ${3} }\n\ -snippet scad\n\ - scan(${1:/pattern/}) do |${2:match}|\n\ - ${3}\n\ - end\n\ -snippet max\n\ - max { |a, b| ${1} }\n\ -snippet min\n\ - min { |a, b| ${1} }\n\ -snippet par\n\ - partition { |${1:e}| ${2} }\n\ -snippet pard\n\ - partition do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet rej\n\ - reject { |${1:e}| ${2} }\n\ -snippet rejd\n\ - reject do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet sel\n\ - select { |${1:e}| ${2} }\n\ -snippet seld\n\ - select do |${1:e}|\n\ - ${2}\n\ - end\n\ -snippet lam\n\ - lambda { |${1:args}| ${2} }\n\ -snippet doo\n\ - do\n\ - ${1}\n\ - end\n\ -snippet dov\n\ - do |${1:variable}|\n\ - ${2}\n\ - end\n\ -snippet :\n\ - :${1:key} => ${2:\"value\"}${3}\n\ -snippet ope\n\ - open(${1:\"path/or/url/or/pipe\"}, \"${2:w}\") { |${3:io}| ${4} }\n\ -# path_from_here()\n\ -snippet fpath\n\ - File.join(File.dirname(__FILE__), *%2[${1:rel path here}])${2}\n\ -# unix_filter {}\n\ -snippet unif\n\ - ARGF.each_line${1} do |${2:line}|\n\ - ${3}\n\ - end\n\ -# option_parse {}\n\ -snippet optp\n\ - require \"optparse\"\n\ -\n\ - options = {${1:default => \"args\"}}\n\ -\n\ - ARGV.options do |opts|\n\ - opts.banner = \"Usage: #{File.basename($PROGRAM_NAME)}\n\ -snippet opt\n\ - opts.on( \"-${1:o}\", \"--${2:long-option-name}\", ${3:String},\n\ - \"${4:Option description.}\") do |${5:opt}|\n\ - ${6}\n\ - end\n\ -snippet tc\n\ - require \"test/unit\"\n\ -\n\ - require \"${1:library_file_name}\"\n\ -\n\ - class Test${2:$1} < Test::Unit::TestCase\n\ - def test_${3:case_name}\n\ - ${4}\n\ - end\n\ - end\n\ -snippet ts\n\ - require \"test/unit\"\n\ -\n\ - require \"tc_${1:test_case_file}\"\n\ - require \"tc_${2:test_case_file}\"${3}\n\ -snippet as\n\ - assert ${1:test}, \"${2:Failure message.}\"${3}\n\ -snippet ase\n\ - assert_equal ${1:expected}, ${2:actual}${3}\n\ -snippet asne\n\ - assert_not_equal ${1:unexpected}, ${2:actual}${3}\n\ -snippet asid\n\ - assert_in_delta ${1:expected_float}, ${2:actual_float}, ${3:2 ** -20}${4}\n\ -snippet asio\n\ - assert_instance_of ${1:ExpectedClass}, ${2:actual_instance}${3}\n\ -snippet asko\n\ - assert_kind_of ${1:ExpectedKind}, ${2:actual_instance}${3}\n\ -snippet asn\n\ - assert_nil ${1:instance}${2}\n\ -snippet asnn\n\ - assert_not_nil ${1:instance}${2}\n\ -snippet asm\n\ - assert_match /${1:expected_pattern}/, ${2:actual_string}${3}\n\ -snippet asnm\n\ - assert_no_match /${1:unexpected_pattern}/, ${2:actual_string}${3}\n\ -snippet aso\n\ - assert_operator ${1:left}, :${2:operator}, ${3:right}${4}\n\ -snippet asr\n\ - assert_raise ${1:Exception} { ${2} }\n\ -snippet asrd\n\ - assert_raise ${1:Exception} do\n\ - ${2}\n\ - end\n\ -snippet asnr\n\ - assert_nothing_raised ${1:Exception} { ${2} }\n\ -snippet asnrd\n\ - assert_nothing_raised ${1:Exception} do\n\ - ${2}\n\ - end\n\ -snippet asrt\n\ - assert_respond_to ${1:object}, :${2:method}${3}\n\ -snippet ass assert_same(..)\n\ - assert_same ${1:expected}, ${2:actual}${3}\n\ -snippet ass assert_send(..)\n\ - assert_send [${1:object}, :${2:message}, ${3:args}]${4}\n\ -snippet asns\n\ - assert_not_same ${1:unexpected}, ${2:actual}${3}\n\ -snippet ast\n\ - assert_throws :${1:expected} { ${2} }\n\ -snippet astd\n\ - assert_throws :${1:expected} do\n\ - ${2}\n\ - end\n\ -snippet asnt\n\ - assert_nothing_thrown { ${1} }\n\ -snippet asntd\n\ - assert_nothing_thrown do\n\ - ${1}\n\ - end\n\ -snippet fl\n\ - flunk \"${1:Failure message.}\"${2}\n\ -# Benchmark.bmbm do .. end\n\ -snippet bm-\n\ - TESTS = ${1:10_000}\n\ - Benchmark.bmbm do |results|\n\ - ${2}\n\ - end\n\ -snippet rep\n\ - results.report(\"${1:name}:\") { TESTS.times { ${2} }}\n\ -# Marshal.dump(.., file)\n\ -snippet Md\n\ - File.open(${1:\"path/to/file.dump\"}, \"wb\") { |${2:file}| Marshal.dump(${3:obj}, $2) }${4}\n\ -# Mashal.load(obj)\n\ -snippet Ml\n\ - File.open(${1:\"path/to/file.dump\"}, \"rb\") { |${2:file}| Marshal.load($2) }${3}\n\ -# deep_copy(..)\n\ -snippet deec\n\ - Marshal.load(Marshal.dump(${1:obj_to_copy}))${2}\n\ -snippet Pn-\n\ - PStore.new(${1:\"file_name.pstore\"})${2}\n\ -snippet tra\n\ - transaction(${1:true}) { ${2} }\n\ -# xmlread(..)\n\ -snippet xml-\n\ - REXML::Document.new(File.read(${1:\"path/to/file\"}))${2}\n\ -# xpath(..) { .. }\n\ -snippet xpa\n\ - elements.each(${1:\"//Xpath\"}) do |${2:node}|\n\ - ${3}\n\ - end\n\ -# class_from_name()\n\ -snippet clafn\n\ - split(\"::\").inject(Object) { |par, const| par.const_get(const) }\n\ -# singleton_class()\n\ -snippet sinc\n\ - class << self; self end\n\ -snippet nam\n\ - namespace :${1:`Filename()`} do\n\ - ${2}\n\ - end\n\ -snippet tas\n\ - desc \"${1:Task description}\"\n\ - task :${2:task_name => [:dependent, :tasks]} do\n\ - ${3}\n\ - end\n\ -# block\n\ -snippet b\n\ - { |${1:var}| ${2} }\n\ -snippet begin\n\ - begin\n\ - raise 'A test exception.'\n\ - rescue Exception => e\n\ - puts e.message\n\ - puts e.backtrace.inspect\n\ - else\n\ - # other exception\n\ - ensure\n\ - # always executed\n\ - end\n\ -\n\ -#debugging\n\ -snippet debug\n\ - require 'ruby-debug'; debugger; true;\n\ -snippet pry\n\ - require 'pry'; binding.pry\n\ -\n\ -#############################################\n\ -# Rails snippets - for pure Ruby, see above #\n\ -#############################################\n\ -snippet art\n\ - assert_redirected_to ${1::action => \"${2:index}\"}\n\ -snippet artnp\n\ - assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1}, ${4:@$2})\n\ -snippet artnpp\n\ - assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1})\n\ -snippet artp\n\ - assert_redirected_to ${1:model}_path(${2:@$1})\n\ -snippet artpp\n\ - assert_redirected_to ${1:model}s_path\n\ -snippet asd\n\ - assert_difference \"${1:Model}.${2:count}\", $1 do\n\ - ${3}\n\ - end\n\ -snippet asnd\n\ - assert_no_difference \"${1:Model}.${2:count}\" do\n\ - ${3}\n\ - end\n\ -snippet asre\n\ - assert_response :${1:success}, @response.body${2}\n\ -snippet asrj\n\ - assert_rjs :${1:replace}, \"${2:dom id}\"\n\ -snippet ass assert_select(..)\n\ - assert_select '${1:path}', :${2:text} => '${3:inner_html' ${4:do}\n\ -snippet bf\n\ - before_filter :${1:method}\n\ -snippet bt\n\ - belongs_to :${1:association}\n\ -snippet crw\n\ - cattr_accessor :${1:attr_names}\n\ -snippet defcreate\n\ - def create\n\ - @${1:model_class_name} = ${2:ModelClassName}.new(params[:$1])\n\ -\n\ - respond_to do |wants|\n\ - if @$1.save\n\ - flash[:notice] = '$2 was successfully created.'\n\ - wants.html { redirect_to(@$1) }\n\ - wants.xml { render :xml => @$1, :status => :created, :location => @$1 }\n\ - else\n\ - wants.html { render :action => \"new\" }\n\ - wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity }\n\ - end\n\ - end\n\ - end${3}\n\ -snippet defdestroy\n\ - def destroy\n\ - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])\n\ - @$1.destroy\n\ -\n\ - respond_to do |wants|\n\ - wants.html { redirect_to($1s_url) }\n\ - wants.xml { head :ok }\n\ - end\n\ - end${3}\n\ -snippet defedit\n\ - def edit\n\ - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])\n\ - end\n\ -snippet defindex\n\ - def index\n\ - @${1:model_class_name} = ${2:ModelClassName}.all\n\ -\n\ - respond_to do |wants|\n\ - wants.html # index.html.erb\n\ - wants.xml { render :xml => @$1s }\n\ - end\n\ - end${3}\n\ -snippet defnew\n\ - def new\n\ - @${1:model_class_name} = ${2:ModelClassName}.new\n\ -\n\ - respond_to do |wants|\n\ - wants.html # new.html.erb\n\ - wants.xml { render :xml => @$1 }\n\ - end\n\ - end${3}\n\ -snippet defshow\n\ - def show\n\ - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])\n\ -\n\ - respond_to do |wants|\n\ - wants.html # show.html.erb\n\ - wants.xml { render :xml => @$1 }\n\ - end\n\ - end${3}\n\ -snippet defupdate\n\ - def update\n\ - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])\n\ -\n\ - respond_to do |wants|\n\ - if @$1.update_attributes(params[:$1])\n\ - flash[:notice] = '$2 was successfully updated.'\n\ - wants.html { redirect_to(@$1) }\n\ - wants.xml { head :ok }\n\ - else\n\ - wants.html { render :action => \"edit\" }\n\ - wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity }\n\ - end\n\ - end\n\ - end${3}\n\ -snippet flash\n\ - flash[:${1:notice}] = \"${2}\"\n\ -snippet habtm\n\ - has_and_belongs_to_many :${1:object}, :join_table => \"${2:table_name}\", :foreign_key => \"${3}_id\"${4}\n\ -snippet hm\n\ - has_many :${1:object}\n\ -snippet hmd\n\ - has_many :${1:other}s, :class_name => \"${2:$1}\", :foreign_key => \"${3:$1}_id\", :dependent => :destroy${4}\n\ -snippet hmt\n\ - has_many :${1:object}, :through => :${2:object}\n\ -snippet ho\n\ - has_one :${1:object}\n\ -snippet i18\n\ - I18n.t('${1:type.key}')${2}\n\ -snippet ist\n\ - <%= image_submit_tag(\"${1:agree.png}\", :id => \"${2:id}\"${3} %>\n\ -snippet log\n\ - Rails.logger.${1:debug} ${2}\n\ -snippet log2\n\ - RAILS_DEFAULT_LOGGER.${1:debug} ${2}\n\ -snippet logd\n\ - logger.debug { \"${1:message}\" }${2}\n\ -snippet loge\n\ - logger.error { \"${1:message}\" }${2}\n\ -snippet logf\n\ - logger.fatal { \"${1:message}\" }${2}\n\ -snippet logi\n\ - logger.info { \"${1:message}\" }${2}\n\ -snippet logw\n\ - logger.warn { \"${1:message}\" }${2}\n\ -snippet mapc\n\ - ${1:map}.${2:connect} '${3:controller/:action/:id}'\n\ -snippet mapca\n\ - ${1:map}.catch_all \"*${2:anything}\", :controller => \"${3:default}\", :action => \"${4:error}\"${5}\n\ -snippet mapr\n\ - ${1:map}.resource :${2:resource}\n\ -snippet maprs\n\ - ${1:map}.resources :${2:resource}\n\ -snippet mapwo\n\ - ${1:map}.with_options :${2:controller} => '${3:thing}' do |$3|\n\ - ${4}\n\ - end\n\ -snippet mbs\n\ - before_save :${1:method}\n\ -snippet mcht\n\ - change_table :${1:table_name} do |t|\n\ - ${2}\n\ - end\n\ -snippet mp\n\ - map(&:${1:id})\n\ -snippet mrw\n\ - mattr_accessor :${1:attr_names}\n\ -snippet oa\n\ - order(\"${1:field}\")\n\ -snippet od\n\ - order(\"${1:field} DESC\")\n\ -snippet pa\n\ - params[:${1:id}]${2}\n\ -snippet ra\n\ - render :action => \"${1:action}\"\n\ -snippet ral\n\ - render :action => \"${1:action}\", :layout => \"${2:layoutname}\"\n\ -snippet rest\n\ - respond_to do |wants|\n\ - wants.${1:html} { ${2} }\n\ - end\n\ -snippet rf\n\ - render :file => \"${1:filepath}\"\n\ -snippet rfu\n\ - render :file => \"${1:filepath}\", :use_full_path => ${2:false}\n\ -snippet ri\n\ - render :inline => \"${1:<%= 'hello' %>}\"\n\ -snippet ril\n\ - render :inline => \"${1:<%= 'hello' %>}\", :locals => { ${2::name} => \"${3:value}\"${4} }\n\ -snippet rit\n\ - render :inline => \"${1:<%= 'hello' %>}\", :type => ${2::rxml}\n\ -snippet rjson\n\ - render :json => ${1:text to render}\n\ -snippet rl\n\ - render :layout => \"${1:layoutname}\"\n\ -snippet rn\n\ - render :nothing => ${1:true}\n\ -snippet rns\n\ - render :nothing => ${1:true}, :status => ${2:401}\n\ -snippet rp\n\ - render :partial => \"${1:item}\"\n\ -snippet rpc\n\ - render :partial => \"${1:item}\", :collection => ${2:@$1s}\n\ -snippet rpl\n\ - render :partial => \"${1:item}\", :locals => { :${2:$1} => ${3:@$1}\n\ -snippet rpo\n\ - render :partial => \"${1:item}\", :object => ${2:@$1}\n\ -snippet rps\n\ - render :partial => \"${1:item}\", :status => ${2:500}\n\ -snippet rt\n\ - render :text => \"${1:text to render}\"\n\ -snippet rtl\n\ - render :text => \"${1:text to render}\", :layout => \"${2:layoutname}\"\n\ -snippet rtlt\n\ - render :text => \"${1:text to render}\", :layout => ${2:true}\n\ -snippet rts\n\ - render :text => \"${1:text to render}\", :status => ${2:401}\n\ -snippet ru\n\ - render :update do |${1:page}|\n\ - $1.${2}\n\ - end\n\ -snippet rxml\n\ - render :xml => ${1:text to render}\n\ -snippet sc\n\ - scope :${1:name}, :where(:@${2:field} => ${3:value})\n\ -snippet sl\n\ - scope :${1:name}, lambda do |${2:value}|\n\ - where(\"${3:field = ?}\", ${4:bind var})\n\ - end\n\ -snippet sha1\n\ - Digest::SHA1.hexdigest(${1:string})\n\ -snippet sweeper\n\ - class ${1:ModelClassName}Sweeper < ActionController::Caching::Sweeper\n\ - observe $1\n\ -\n\ - def after_save(${2:model_class_name})\n\ - expire_cache($2)\n\ - end\n\ -\n\ - def after_destroy($2)\n\ - expire_cache($2)\n\ - end\n\ -\n\ - def expire_cache($2)\n\ - expire_page\n\ - end\n\ - end\n\ -snippet tcb\n\ - t.boolean :${1:title}\n\ - ${2}\n\ -snippet tcbi\n\ - t.binary :${1:title}, :limit => ${2:2}.megabytes\n\ - ${3}\n\ -snippet tcd\n\ - t.decimal :${1:title}, :precision => ${2:10}, :scale => ${3:2}\n\ - ${4}\n\ -snippet tcda\n\ - t.date :${1:title}\n\ - ${2}\n\ -snippet tcdt\n\ - t.datetime :${1:title}\n\ - ${2}\n\ -snippet tcf\n\ - t.float :${1:title}\n\ - ${2}\n\ -snippet tch\n\ - t.change :${1:name}, :${2:string}, :${3:limit} => ${4:80}\n\ - ${5}\n\ -snippet tci\n\ - t.integer :${1:title}\n\ - ${2}\n\ -snippet tcl\n\ - t.integer :lock_version, :null => false, :default => 0\n\ - ${1}\n\ -snippet tcr\n\ - t.references :${1:taggable}, :polymorphic => { :default => '${2:Photo}' }\n\ - ${3}\n\ -snippet tcs\n\ - t.string :${1:title}\n\ - ${2}\n\ -snippet tct\n\ - t.text :${1:title}\n\ - ${2}\n\ -snippet tcti\n\ - t.time :${1:title}\n\ - ${2}\n\ -snippet tcts\n\ - t.timestamp :${1:title}\n\ - ${2}\n\ -snippet tctss\n\ - t.timestamps\n\ - ${1}\n\ -snippet va\n\ - validates_associated :${1:attribute}\n\ -snippet vao\n\ - validates_acceptance_of :${1:terms}\n\ -snippet vc\n\ - validates_confirmation_of :${1:attribute}\n\ -snippet ve\n\ - validates_exclusion_of :${1:attribute}, :in => ${2:%w( mov avi )}\n\ -snippet vf\n\ - validates_format_of :${1:attribute}, :with => /${2:regex}/\n\ -snippet vi\n\ - validates_inclusion_of :${1:attribute}, :in => %w(${2: mov avi })\n\ -snippet vl\n\ - validates_length_of :${1:attribute}, :within => ${2:3}..${3:20}\n\ -snippet vn\n\ - validates_numericality_of :${1:attribute}\n\ -snippet vpo\n\ - validates_presence_of :${1:attribute}\n\ -snippet vu\n\ - validates_uniqueness_of :${1:attribute}\n\ -snippet wants\n\ - wants.${1:js|xml|html} { ${2} }\n\ -snippet wc\n\ - where(${1:\"conditions\"}${2:, bind_var})\n\ -snippet wh\n\ - where(${1:field} => ${2:value})\n\ -snippet xdelete\n\ - xhr :delete, :${1:destroy}, :id => ${2:1}${3}\n\ -snippet xget\n\ - xhr :get, :${1:show}, :id => ${2:1}${3}\n\ -snippet xpost\n\ - xhr :post, :${1:create}, :${2:object} => { ${3} }\n\ -snippet xput\n\ - xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { ${4} }${5}\n\ -snippet test\n\ - test \"should ${1:do something}\" do\n\ - ${2}\n\ - end\n\ -#migrations\n\ -snippet mac\n\ - add_column :${1:table_name}, :${2:column_name}, :${3:data_type}\n\ -snippet mrc\n\ - remove_column :${1:table_name}, :${2:column_name}\n\ -snippet mrnc\n\ - rename_column :${1:table_name}, :${2:old_column_name}, :${3:new_column_name}\n\ -snippet mcc\n\ - change_column :${1:table}, :${2:column}, :${3:type}\n\ -snippet mccc\n\ - t.column :${1:title}, :${2:string}\n\ -snippet mct\n\ - create_table :${1:table_name} do |t|\n\ - t.column :${2:name}, :${3:type}\n\ - end\n\ -snippet migration\n\ - class ${1:class_name} < ActiveRecord::Migration\n\ - def self.up\n\ - ${2}\n\ - end\n\ -\n\ - def self.down\n\ - end\n\ - end\n\ -\n\ -snippet trc\n\ - t.remove :${1:column}\n\ -snippet tre\n\ - t.rename :${1:old_column_name}, :${2:new_column_name}\n\ - ${3}\n\ -snippet tref\n\ - t.references :${1:model}\n\ -\n\ -#rspec\n\ -snippet it\n\ - it \"${1:spec_name}\" do\n\ - ${2}\n\ - end\n\ -snippet itp\n\ - it \"${1:spec_name}\"\n\ - ${2}\n\ -snippet desc\n\ - describe ${1:class_name} do\n\ - ${2}\n\ - end\n\ -snippet cont\n\ - context \"${1:message}\" do\n\ - ${2}\n\ - end\n\ -snippet bef\n\ - before :${1:each} do\n\ - ${2}\n\ - end\n\ -snippet aft\n\ - after :${1:each} do\n\ - ${2}\n\ - end\n\ -"; -exports.scope = "ruby"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/rust.js b/util/build-sample-browser/player/vendor/ace/snippets/rust.js deleted file mode 100644 index 5936843487..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/rust.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/rust', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "rust"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/sass.js b/util/build-sample-browser/player/vendor/ace/snippets/sass.js deleted file mode 100644 index b17eb4d7eb..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/sass.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/sass', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "sass"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/scad.js b/util/build-sample-browser/player/vendor/ace/snippets/scad.js deleted file mode 100644 index 10aecfa733..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/scad.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/scad', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "scad"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/scala.js b/util/build-sample-browser/player/vendor/ace/snippets/scala.js deleted file mode 100644 index e9f7d0330a..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/scala.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/scala', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "scala"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/scheme.js b/util/build-sample-browser/player/vendor/ace/snippets/scheme.js deleted file mode 100644 index d275591425..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/scheme.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/scheme', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "scheme"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/scss.js b/util/build-sample-browser/player/vendor/ace/snippets/scss.js deleted file mode 100644 index 14b77def2b..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/scss.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/scss', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "scss"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/sh.js b/util/build-sample-browser/player/vendor/ace/snippets/sh.js deleted file mode 100644 index b052e85845..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/sh.js +++ /dev/null @@ -1,90 +0,0 @@ -ace.define('ace/snippets/sh', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "# Shebang. Executing bash via /usr/bin/env makes scripts more portable.\n\ -snippet #!\n\ - #!/usr/bin/env bash\n\ - \n\ -snippet if\n\ - if [[ ${1:condition} ]]; then\n\ - ${2:#statements}\n\ - fi\n\ -snippet elif\n\ - elif [[ ${1:condition} ]]; then\n\ - ${2:#statements}\n\ -snippet for\n\ - for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do\n\ - ${3:#statements}\n\ - done\n\ -snippet fori\n\ - for ${1:needle} in ${2:haystack} ; do\n\ - ${3:#statements}\n\ - done\n\ -snippet wh\n\ - while [[ ${1:condition} ]]; do\n\ - ${2:#statements}\n\ - done\n\ -snippet until\n\ - until [[ ${1:condition} ]]; do\n\ - ${2:#statements}\n\ - done\n\ -snippet case\n\ - case ${1:word} in\n\ - ${2:pattern})\n\ - ${3};;\n\ - esac\n\ -snippet go \n\ - while getopts '${1:o}' ${2:opts} \n\ - do \n\ - case $$2 in\n\ - ${3:o0})\n\ - ${4:#staments};;\n\ - esac\n\ - done\n\ -# Set SCRIPT_DIR variable to directory script is located.\n\ -snippet sdir\n\ - SCRIPT_DIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n\ -# getopt\n\ -snippet getopt\n\ - __ScriptVersion=\"${1:version}\"\n\ -\n\ - #=== FUNCTION ================================================================\n\ - # NAME: usage\n\ - # DESCRIPTION: Display usage information.\n\ - #===============================================================================\n\ - function usage ()\n\ - {\n\ - cat <<- EOT\n\ -\n\ - Usage : $${0:0} [options] [--] \n\ -\n\ - Options: \n\ - -h|help Display this message\n\ - -v|version Display script version\n\ -\n\ - EOT\n\ - } # ---------- end of function usage ----------\n\ -\n\ - #-----------------------------------------------------------------------\n\ - # Handle command line arguments\n\ - #-----------------------------------------------------------------------\n\ -\n\ - while getopts \":hv\" opt\n\ - do\n\ - case $opt in\n\ -\n\ - h|help ) usage; exit 0 ;;\n\ -\n\ - v|version ) echo \"$${0:0} -- Version $__ScriptVersion\"; exit 0 ;;\n\ -\n\ - \\? ) echo -e \"\\n Option does not exist : $OPTARG\\n\"\n\ - usage; exit 1 ;;\n\ -\n\ - esac # --- end of case ---\n\ - done\n\ - shift $(($OPTIND-1))\n\ -\n\ -"; -exports.scope = "sh"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/sjs.js b/util/build-sample-browser/player/vendor/ace/snippets/sjs.js deleted file mode 100644 index 6a03c5f0c7..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/sjs.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/sjs', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "sjs"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/smarty.js b/util/build-sample-browser/player/vendor/ace/snippets/smarty.js deleted file mode 100644 index 7c2e992b86..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/smarty.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/smarty', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "smarty"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/snippets.js b/util/build-sample-browser/player/vendor/ace/snippets/snippets.js deleted file mode 100644 index 25b10ecd2b..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/snippets.js +++ /dev/null @@ -1,16 +0,0 @@ -ace.define('ace/snippets/snippets', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "# snippets for making snippets :)\n\ -snippet snip\n\ - snippet ${1:trigger}\n\ - ${2}\n\ -snippet msnip\n\ - snippet ${1:trigger} ${2:description}\n\ - ${3}\n\ -snippet v\n\ - {VISUAL}\n\ -"; -exports.scope = "snippets"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/soy_template.js b/util/build-sample-browser/player/vendor/ace/snippets/soy_template.js deleted file mode 100644 index 6545d9bfd8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/soy_template.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/soy_template', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "soy_template"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/space.js b/util/build-sample-browser/player/vendor/ace/snippets/space.js deleted file mode 100644 index 712c842711..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/space.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/space', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "space"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/sql.js b/util/build-sample-browser/player/vendor/ace/snippets/sql.js deleted file mode 100644 index a9b359ba33..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/sql.js +++ /dev/null @@ -1,33 +0,0 @@ -ace.define('ace/snippets/sql', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "snippet tbl\n\ - create table ${1:table} (\n\ - ${2:columns}\n\ - );\n\ -snippet col\n\ - ${1:name} ${2:type} ${3:default ''} ${4:not null}\n\ -snippet ccol\n\ - ${1:name} varchar2(${2:size}) ${3:default ''} ${4:not null}\n\ -snippet ncol\n\ - ${1:name} number ${3:default 0} ${4:not null}\n\ -snippet dcol\n\ - ${1:name} date ${3:default sysdate} ${4:not null}\n\ -snippet ind\n\ - create index ${3:$1_$2} on ${1:table}(${2:column});\n\ -snippet uind\n\ - create unique index ${1:name} on ${2:table}(${3:column});\n\ -snippet tblcom\n\ - comment on table ${1:table} is '${2:comment}';\n\ -snippet colcom\n\ - comment on column ${1:table}.${2:column} is '${3:comment}';\n\ -snippet addcol\n\ - alter table ${1:table} add (${2:column} ${3:type});\n\ -snippet seq\n\ - create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1};\n\ -snippet s*\n\ - select * from ${1:table}\n\ -"; -exports.scope = "sql"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/stylus.js b/util/build-sample-browser/player/vendor/ace/snippets/stylus.js deleted file mode 100644 index 3369c4c340..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/stylus.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/stylus', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "stylus"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/svg.js b/util/build-sample-browser/player/vendor/ace/snippets/svg.js deleted file mode 100644 index 24ff8ed007..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/svg.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/svg', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "svg"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/tcl.js b/util/build-sample-browser/player/vendor/ace/snippets/tcl.js deleted file mode 100644 index 4347cbc9b2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/tcl.js +++ /dev/null @@ -1,99 +0,0 @@ -ace.define('ace/snippets/tcl', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "# #!/usr/bin/env tclsh\n\ -snippet #!\n\ - #!/usr/bin/env tclsh\n\ - \n\ -# Process\n\ -snippet pro\n\ - proc ${1:function_name} {${2:args}} {\n\ - ${3:#body ...}\n\ - }\n\ -#xif\n\ -snippet xif\n\ - ${1:expr}? ${2:true} : ${3:false}\n\ -# Conditional\n\ -snippet if\n\ - if {${1}} {\n\ - ${2:# body...}\n\ - }\n\ -# Conditional if..else\n\ -snippet ife\n\ - if {${1}} {\n\ - ${2:# body...}\n\ - } else {\n\ - ${3:# else...}\n\ - }\n\ -# Conditional if..elsif..else\n\ -snippet ifee\n\ - if {${1}} {\n\ - ${2:# body...}\n\ - } elseif {${3}} {\n\ - ${4:# elsif...}\n\ - } else {\n\ - ${5:# else...}\n\ - }\n\ -# If catch then\n\ -snippet ifc\n\ - if { [catch {${1:#do something...}} ${2:err}] } {\n\ - ${3:# handle failure...}\n\ - }\n\ -# Catch\n\ -snippet catch\n\ - catch {${1}} ${2:err} ${3:options}\n\ -# While Loop\n\ -snippet wh\n\ - while {${1}} {\n\ - ${2:# body...}\n\ - }\n\ -# For Loop\n\ -snippet for\n\ - for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} {\n\ - ${4:# body...}\n\ - }\n\ -# Foreach Loop\n\ -snippet fore\n\ - foreach ${1:x} {${2:#list}} {\n\ - ${3:# body...}\n\ - }\n\ -# after ms script...\n\ -snippet af\n\ - after ${1:ms} ${2:#do something}\n\ -# after cancel id\n\ -snippet afc\n\ - after cancel ${1:id or script}\n\ -# after idle\n\ -snippet afi\n\ - after idle ${1:script}\n\ -# after info id\n\ -snippet afin\n\ - after info ${1:id}\n\ -# Expr\n\ -snippet exp\n\ - expr {${1:#expression here}}\n\ -# Switch\n\ -snippet sw\n\ - switch ${1:var} {\n\ - ${3:pattern 1} {\n\ - ${4:#do something}\n\ - }\n\ - default {\n\ - ${2:#do something}\n\ - }\n\ - }\n\ -# Case\n\ -snippet ca\n\ - ${1:pattern} {\n\ - ${2:#do something}\n\ - }${3}\n\ -# Namespace eval\n\ -snippet ns\n\ - namespace eval ${1:path} {${2:#script...}}\n\ -# Namespace current\n\ -snippet nsc\n\ - namespace current\n\ -"; -exports.scope = "tcl"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/tex.js b/util/build-sample-browser/player/vendor/ace/snippets/tex.js deleted file mode 100644 index ce49077824..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/tex.js +++ /dev/null @@ -1,197 +0,0 @@ -ace.define('ace/snippets/tex', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "#PREAMBLE\n\ -#newcommand\n\ -snippet nc\n\ - \\newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}}${4}\n\ -#usepackage\n\ -snippet up\n\ - \\usepackage[${1:[options}]{${2:package}}\n\ -#newunicodechar\n\ -snippet nuc\n\ - \\newunicodechar{${1}}{${2:\\ensuremath}${3:tex-substitute}}}\n\ -#DeclareMathOperator\n\ -snippet dmo\n\ - \\DeclareMathOperator{${1}}{${2}}\n\ -\n\ -#DOCUMENT\n\ -# \\begin{}...\\end{}\n\ -snippet begin\n\ - \\begin{${1:env}}\n\ - ${2}\n\ - \\end{$1}\n\ -# Tabular\n\ -snippet tab\n\ - \\begin{${1:tabular}}{${2:c}}\n\ - ${3}\n\ - \\end{$1}\n\ -snippet thm\n\ - \\begin[${1:author}]{${2:thm}}\n\ - ${3}\n\ - \\end{$1}\n\ -snippet center\n\ - \\begin{center}\n\ - ${1}\n\ - \\end{center}\n\ -# Align(ed)\n\ -snippet ali\n\ - \\begin{align${1:ed}}\n\ - ${2}\n\ - \\end{align$1}\n\ -# Gather(ed)\n\ -snippet gat\n\ - \\begin{gather${1:ed}}\n\ - ${2}\n\ - \\end{gather$1}\n\ -# Equation\n\ -snippet eq\n\ - \\begin{equation}\n\ - ${1}\n\ - \\end{equation}\n\ -# Equation\n\ -snippet eq*\n\ - \\begin{equation*}\n\ - ${1}\n\ - \\end{equation*}\n\ -# Unnumbered Equation\n\ -snippet \\\n\ - \\[\n\ - ${1}\n\ - \\]\n\ -# Enumerate\n\ -snippet enum\n\ - \\begin{enumerate}\n\ - \\item ${1}\n\ - \\end{enumerate}\n\ -# Itemize\n\ -snippet itemize\n\ - \\begin{itemize}\n\ - \\item ${1}\n\ - \\end{itemize}\n\ -# Description\n\ -snippet desc\n\ - \\begin{description}\n\ - \\item[${1}] ${2}\n\ - \\end{description}\n\ -# Matrix\n\ -snippet mat\n\ - \\begin{${1:p/b/v/V/B/small}matrix}\n\ - ${2}\n\ - \\end{$1matrix}\n\ -# Cases\n\ -snippet cas\n\ - \\begin{cases}\n\ - ${1:equation}, &\\text{ if }${2:case}\\\\\n\ - ${3}\n\ - \\end{cases}\n\ -# Split\n\ -snippet spl\n\ - \\begin{split}\n\ - ${1}\n\ - \\end{split}\n\ -# Part\n\ -snippet part\n\ - \\part{${1:part name}} % (fold)\n\ - \\label{prt:${2:$1}}\n\ - ${3}\n\ - % part $2 (end)\n\ -# Chapter\n\ -snippet cha\n\ - \\chapter{${1:chapter name}}\n\ - \\label{cha:${2:$1}}\n\ - ${3}\n\ -# Section\n\ -snippet sec\n\ - \\section{${1:section name}}\n\ - \\label{sec:${2:$1}}\n\ - ${3}\n\ -# Sub Section\n\ -snippet sub\n\ - \\subsection{${1:subsection name}}\n\ - \\label{sub:${2:$1}}\n\ - ${3}\n\ -# Sub Sub Section\n\ -snippet subs\n\ - \\subsubsection{${1:subsubsection name}}\n\ - \\label{ssub:${2:$1}}\n\ - ${3}\n\ -# Paragraph\n\ -snippet par\n\ - \\paragraph{${1:paragraph name}}\n\ - \\label{par:${2:$1}}\n\ - ${3}\n\ -# Sub Paragraph\n\ -snippet subp\n\ - \\subparagraph{${1:subparagraph name}}\n\ - \\label{subp:${2:$1}}\n\ - ${3}\n\ -#References\n\ -snippet itd\n\ - \\item[${1:description}] ${2:item}\n\ -snippet figure\n\ - ${1:Figure}~\\ref{${2:fig:}}${3}\n\ -snippet table\n\ - ${1:Table}~\\ref{${2:tab:}}${3}\n\ -snippet listing\n\ - ${1:Listing}~\\ref{${2:list}}${3}\n\ -snippet section\n\ - ${1:Section}~\\ref{${2:sec:}}${3}\n\ -snippet page\n\ - ${1:page}~\\pageref{${2}}${3}\n\ -snippet index\n\ - \\index{${1:index}}${2}\n\ -#Citations\n\ -snippet cite\n\ - \\cite[${1}]{${2}}${3}\n\ -snippet fcite\n\ - \\footcite[${1}]{${2}}${3}\n\ -#Formating text: italic, bold, underline, small capital, emphase ..\n\ -snippet it\n\ - \\textit{${1:text}}\n\ -snippet bf\n\ - \\textbf{${1:text}}\n\ -snippet under\n\ - \\underline{${1:text}}\n\ -snippet emp\n\ - \\emph{${1:text}}\n\ -snippet sc\n\ - \\textsc{${1:text}}\n\ -#Choosing font\n\ -snippet sf\n\ - \\textsf{${1:text}}\n\ -snippet rm\n\ - \\textrm{${1:text}}\n\ -snippet tt\n\ - \\texttt{${1:text}}\n\ -#misc\n\ -snippet ft\n\ - \\footnote{${1:text}}\n\ -snippet fig\n\ - \\begin{figure}\n\ - \\begin{center}\n\ - \\includegraphics[scale=${1}]{Figures/${2}}\n\ - \\end{center}\n\ - \\caption{${3}}\n\ - \\label{fig:${4}}\n\ - \\end{figure}\n\ -snippet tikz\n\ - \\begin{figure}\n\ - \\begin{center}\n\ - \\begin{tikzpicture}[scale=${1:1}]\n\ - ${2}\n\ - \\end{tikzpicture}\n\ - \\end{center}\n\ - \\caption{${3}}\n\ - \\label{fig:${4}}\n\ - \\end{figure}\n\ -#math\n\ -snippet stackrel\n\ - \\stackrel{${1:above}}{${2:below}} ${3}\n\ -snippet frac\n\ - \\frac{${1:num}}{${2:denom}}\n\ -snippet sum\n\ - \\sum^{${1:n}}_{${2:i=1}}{${3}}"; -exports.scope = "tex"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/text.js b/util/build-sample-browser/player/vendor/ace/snippets/text.js deleted file mode 100644 index 0834cfcaf8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/text.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/text', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "text"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/textile.js b/util/build-sample-browser/player/vendor/ace/snippets/textile.js deleted file mode 100644 index 106849b71b..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/textile.js +++ /dev/null @@ -1,37 +0,0 @@ -ace.define('ace/snippets/textile', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "# Jekyll post header\n\ -snippet header\n\ - ---\n\ - title: ${1:title}\n\ - layout: post\n\ - date: ${2:date} ${3:hour:minute:second} -05:00\n\ - ---\n\ -\n\ -# Image\n\ -snippet img\n\ - !${1:url}(${2:title}):${3:link}!\n\ -\n\ -# Table\n\ -snippet |\n\ - |${1}|${2}\n\ -\n\ -# Link\n\ -snippet link\n\ - \"${1:link text}\":${2:url}\n\ -\n\ -# Acronym\n\ -snippet (\n\ - (${1:Expand acronym})${2}\n\ -\n\ -# Footnote\n\ -snippet fn\n\ - [${1:ref number}] ${3}\n\ -\n\ - fn$1. ${2:footnote}\n\ - \n\ -"; -exports.scope = "textile"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/toml.js b/util/build-sample-browser/player/vendor/ace/snippets/toml.js deleted file mode 100644 index 724bea9417..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/toml.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/toml', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "toml"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/twig.js b/util/build-sample-browser/player/vendor/ace/snippets/twig.js deleted file mode 100644 index 0d8b680d63..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/twig.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/twig', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "twig"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/typescript.js b/util/build-sample-browser/player/vendor/ace/snippets/typescript.js deleted file mode 100644 index 0c0affd4b2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/typescript.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/typescript', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "typescript"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/vbscript.js b/util/build-sample-browser/player/vendor/ace/snippets/vbscript.js deleted file mode 100644 index c05c1f8637..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/vbscript.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/vbscript', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "vbscript"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/velocity.js b/util/build-sample-browser/player/vendor/ace/snippets/velocity.js deleted file mode 100644 index c2e8b17311..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/velocity.js +++ /dev/null @@ -1,36 +0,0 @@ -ace.define('ace/snippets/velocity', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = "# macro\n\ -snippet #macro\n\ - #macro ( ${1:macroName} ${2:\\$var1, [\\$var2, ...]} )\n\ - ${3:## macro code}\n\ - #end\n\ -# foreach\n\ -snippet #foreach\n\ - #foreach ( ${1:\\$item} in ${2:\\$collection} )\n\ - ${3:## foreach code}\n\ - #end\n\ -# if\n\ -snippet #if\n\ - #if ( ${1:true} )\n\ - ${0}\n\ - #end\n\ -# if ... else\n\ -snippet #ife\n\ - #if ( ${1:true} )\n\ - ${2}\n\ - #else\n\ - ${0}\n\ - #end\n\ -#import\n\ -snippet #import\n\ - #import ( \"${1:path/to/velocity/format}\" )\n\ -# set\n\ -snippet #set\n\ - #set ( $${1:var} = ${0} )\n\ -"; -exports.scope = "velocity"; -exports.includeScopes = ["html", "javascript", "css"]; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/verilog.js b/util/build-sample-browser/player/vendor/ace/snippets/verilog.js deleted file mode 100644 index ad123a3740..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/verilog.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/verilog', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "verilog"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/vhdl.js b/util/build-sample-browser/player/vendor/ace/snippets/vhdl.js deleted file mode 100644 index cf6994e568..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/vhdl.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/vhdl', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "vhdl"; - -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/snippets/xml.js b/util/build-sample-browser/player/vendor/ace/snippets/xml.js deleted file mode 100644 index d26f8fdf48..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/xml.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/xml', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "xml"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/xquery.js b/util/build-sample-browser/player/vendor/ace/snippets/xquery.js deleted file mode 100644 index aeb24d86a5..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/xquery.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/xquery', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "xquery"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/snippets/yaml.js b/util/build-sample-browser/player/vendor/ace/snippets/yaml.js deleted file mode 100644 index 1c2df806da..0000000000 --- a/util/build-sample-browser/player/vendor/ace/snippets/yaml.js +++ /dev/null @@ -1,7 +0,0 @@ -ace.define('ace/snippets/yaml', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.snippetText = ""; -exports.scope = "yaml"; - -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-ambiance.js b/util/build-sample-browser/player/vendor/ace/theme-ambiance.js deleted file mode 100644 index 3efcee7bf8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-ambiance.js +++ /dev/null @@ -1,202 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright 2011 Irakli Gozalishvili. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/ambiance', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-ambiance"; -exports.cssText = ".ace-ambiance .ace_gutter {\ -background-color: #3d3d3d;\ -background-image: -moz-linear-gradient(left, #3D3D3D, #333);\ -background-image: -ms-linear-gradient(left, #3D3D3D, #333);\ -background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#3D3D3D), to(#333));\ -background-image: -webkit-linear-gradient(left, #3D3D3D, #333);\ -background-image: -o-linear-gradient(left, #3D3D3D, #333);\ -background-image: linear-gradient(left, #3D3D3D, #333);\ -background-repeat: repeat-x;\ -border-right: 1px solid #4d4d4d;\ -text-shadow: 0px 1px 1px #4d4d4d;\ -color: #222;\ -}\ -.ace-ambiance .ace_gutter-layer {\ -background: repeat left top;\ -}\ -.ace-ambiance .ace_fold-widget {\ -text-align: center;\ -}\ -.ace-ambiance .ace_fold-widget:hover {\ -color: #777;\ -}\ -.ace-ambiance .ace_fold-widget.ace_start,\ -.ace-ambiance .ace_fold-widget.ace_end,\ -.ace-ambiance .ace_fold-widget.ace_closed{\ -background: none;\ -border: none;\ -box-shadow: none;\ -}\ -.ace-ambiance .ace_fold-widget.ace_start:after {\ -content: '\u25be'\ -}\ -.ace-ambiance .ace_fold-widget.ace_end:after {\ -content: '\u25b4'\ -}\ -.ace-ambiance .ace_fold-widget.ace_closed:after {\ -content: '\u2023'\ -}\ -.ace-ambiance .ace_print-margin {\ -border-left: 1px dotted #2D2D2D;\ -right: 0;\ -background: #262626;\ -}\ -.ace-ambiance .ace_scroller {\ --webkit-box-shadow: inset 0 0 10px black;\ --moz-box-shadow: inset 0 0 10px black;\ --o-box-shadow: inset 0 0 10px black;\ -box-shadow: inset 0 0 10px black;\ -}\ -.ace-ambiance {\ -color: #E6E1DC;\ -background-color: #202020;\ -}\ -.ace-ambiance .ace_cursor {\ -border-left: 1px solid #7991E8;\ -}\ -.ace-ambiance .ace_overwrite-cursors .ace_cursor {\ -border: 1px solid #FFE300;\ -background: #766B13;\ -}\ -.ace-ambiance.normal-mode .ace_cursor-layer {\ -z-index: 0;\ -}\ -.ace-ambiance .ace_marker-layer .ace_selection {\ -background: rgba(221, 240, 255, 0.20);\ -}\ -.ace-ambiance .ace_marker-layer .ace_selected-word {\ -border-radius: 4px;\ -border: 8px solid #3f475d;\ -box-shadow: 0 0 4px black;\ -}\ -.ace-ambiance .ace_marker-layer .ace_step {\ -background: rgb(198, 219, 174);\ -}\ -.ace-ambiance .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(255, 255, 255, 0.25);\ -}\ -.ace-ambiance .ace_marker-layer .ace_active-line {\ -background: rgba(255, 255, 255, 0.031);\ -}\ -.ace-ambiance .ace_invisible {\ -color: #333;\ -}\ -.ace-ambiance .ace_paren {\ -color: #24C2C7;\ -}\ -.ace-ambiance .ace_keyword {\ -color: #cda869;\ -}\ -.ace-ambiance .ace_keyword.ace_operator {\ -color: #fa8d6a;\ -}\ -.ace-ambiance .ace_punctuation.ace_operator {\ -color: #fa8d6a;\ -}\ -.ace-ambiance .ace_identifier {\ -}\ -.ace-ambiance .ace-statement {\ -color: #cda869;\ -}\ -.ace-ambiance .ace_constant {\ -color: #CF7EA9;\ -}\ -.ace-ambiance .ace_constant.ace_language {\ -color: #CF7EA9;\ -}\ -.ace-ambiance .ace_constant.ace_library {\ -}\ -.ace-ambiance .ace_constant.ace_numeric {\ -color: #78CF8A;\ -}\ -.ace-ambiance .ace_invalid {\ -text-decoration: underline;\ -}\ -.ace-ambiance .ace_invalid.ace_illegal {\ -color:#F8F8F8;\ -background-color: rgba(86, 45, 86, 0.75);\ -}\ -.ace-ambiance .ace_invalid,\ -.ace-ambiance .ace_deprecated {\ -text-decoration: underline;\ -font-style: italic;\ -color: #D2A8A1;\ -}\ -.ace-ambiance .ace_support {\ -color: #9B859D;\ -}\ -.ace-ambiance .ace_support.ace_function {\ -color: #DAD085;\ -}\ -.ace-ambiance .ace_function.ace_buildin {\ -color: #9b859d;\ -}\ -.ace-ambiance .ace_string {\ -color: #8f9d6a;\ -}\ -.ace-ambiance .ace_string.ace_regexp {\ -color: #DAD085;\ -}\ -.ace-ambiance .ace_comment {\ -font-style: italic;\ -color: #555;\ -}\ -.ace-ambiance .ace_comment.ace_doc {\ -}\ -.ace-ambiance .ace_comment.ace_doc.ace_tag {\ -color: #666;\ -font-style: normal;\ -}\ -.ace-ambiance .ace_definition,\ -.ace-ambiance .ace_type {\ -color: #aac6e3;\ -}\ -.ace-ambiance .ace_variable {\ -color: #9999cc;\ -}\ -.ace-ambiance .ace_variable.ace_language {\ -color: #9b859d;\ -}\ -.ace-ambiance .ace_xml-pe {\ -color: #494949;\ -}\ -.ace-ambiance .ace_gutter-layer,\ -.ace-ambiance .ace_text-layer {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC\");\ -}\ -.ace-ambiance .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQUFD4z6Crq/sfAAuYAuYl+7lfAAAAAElFTkSuQmCC\") right repeat-y;\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-chaos.js b/util/build-sample-browser/player/vendor/ace/theme-chaos.js deleted file mode 100644 index c1cd1bf0d1..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-chaos.js +++ /dev/null @@ -1,179 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright 2011 Irakli Gozalishvili. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/chaos', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-chaos"; -exports.cssText = ".ace-chaos .ace_gutter {\ -background: #141414;\ -color: #595959;\ -border-right: 1px solid #282828;\ -}\ -.ace-chaos .ace_gutter-cell.ace_warning {\ -background-image: none;\ -background: #FC0;\ -border-left: none;\ -padding-left: 0;\ -color: #000;\ -}\ -.ace-chaos .ace_gutter-cell.ace_error {\ -background-position: -6px center;\ -background-image: none;\ -background: #F10;\ -border-left: none;\ -padding-left: 0;\ -color: #000;\ -}\ -.ace-chaos .ace_print-margin {\ -border-left: 1px solid #555;\ -right: 0;\ -background: #1D1D1D;\ -}\ -.ace-chaos {\ -background-color: #161616;\ -color: #E6E1DC;\ -}\ -.ace-chaos .ace_cursor {\ -border-left: 2px solid #FFFFFF;\ -}\ -.ace-chaos .ace_cursor.ace_overwrite {\ -border-left: 0px;\ -border-bottom: 1px solid #FFFFFF;\ -}\ -.ace-chaos .ace_marker-layer .ace_selection {\ -background: #494836;\ -}\ -.ace-chaos .ace_marker-layer .ace_step {\ -background: rgb(198, 219, 174);\ -}\ -.ace-chaos .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #FCE94F;\ -}\ -.ace-chaos .ace_marker-layer .ace_active-line {\ -background: #333;\ -}\ -.ace-chaos .ace_gutter-active-line {\ -background-color: #222;\ -}\ -.ace-chaos .ace_invisible {\ -color: #404040;\ -}\ -.ace-chaos .ace_keyword {\ -color:#00698F;\ -}\ -.ace-chaos .ace_keyword.ace_operator {\ -color:#FF308F;\ -}\ -.ace-chaos .ace_constant {\ -color:#1EDAFB;\ -}\ -.ace-chaos .ace_constant.ace_language {\ -color:#FDC251;\ -}\ -.ace-chaos .ace_constant.ace_library {\ -color:#8DFF0A;\ -}\ -.ace-chaos .ace_constant.ace_numeric {\ -color:#58C554;\ -}\ -.ace-chaos .ace_invalid {\ -color:#FFFFFF;\ -background-color:#990000;\ -}\ -.ace-chaos .ace_invalid.ace_deprecated {\ -color:#FFFFFF;\ -background-color:#990000;\ -}\ -.ace-chaos .ace_support {\ -color: #999;\ -}\ -.ace-chaos .ace_support.ace_function {\ -color:#00AEEF;\ -}\ -.ace-chaos .ace_function {\ -color:#00AEEF;\ -}\ -.ace-chaos .ace_string {\ -color:#58C554;\ -}\ -.ace-chaos .ace_comment {\ -color:#555;\ -font-style:italic;\ -padding-bottom: 0px;\ -}\ -.ace-chaos .ace_variable {\ -color:#997744;\ -}\ -.ace-chaos .ace_meta.ace_tag {\ -color:#BE53E6;\ -}\ -.ace-chaos .ace_entity.ace_other.ace_attribute-name {\ -color:#FFFF89;\ -}\ -.ace-chaos .ace_markup.ace_underline {\ -text-decoration: underline;\ -}\ -.ace-chaos .ace_fold-widget {\ -text-align: center;\ -}\ -.ace-chaos .ace_fold-widget:hover {\ -color: #777;\ -}\ -.ace-chaos .ace_fold-widget.ace_start,\ -.ace-chaos .ace_fold-widget.ace_end,\ -.ace-chaos .ace_fold-widget.ace_closed{\ -background: none;\ -border: none;\ -box-shadow: none;\ -}\ -.ace-chaos .ace_fold-widget.ace_start:after {\ -content: '\u25be'\ -}\ -.ace-chaos .ace_fold-widget.ace_end:after {\ -content: '\u25b4'\ -}\ -.ace-chaos .ace_fold-widget.ace_closed:after {\ -content: '\u2023'\ -}\ -.ace-chaos .ace_indent-guide {\ -border-right:1px dotted #333;\ -margin-right:-1px;\ -}\ -.ace-chaos .ace_fold { \ -background: #222; \ -border-radius: 3px; \ -color: #7AF; \ -border: none; \ -}\ -.ace-chaos .ace_fold:hover {\ -background: #CCC; \ -color: #000;\ -}\ -"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); - -}); \ No newline at end of file diff --git a/util/build-sample-browser/player/vendor/ace/theme-chrome.js b/util/build-sample-browser/player/vendor/ace/theme-chrome.js deleted file mode 100644 index 4ec820f958..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-chrome.js +++ /dev/null @@ -1,158 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/chrome', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-chrome"; -exports.cssText = ".ace-chrome .ace_gutter {\ -background: #ebebeb;\ -color: #333;\ -overflow : hidden;\ -}\ -.ace-chrome .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8;\ -}\ -.ace-chrome {\ -background-color: #FFFFFF;\ -color: black;\ -}\ -.ace-chrome .ace_cursor {\ -color: black;\ -}\ -.ace-chrome .ace_invisible {\ -color: rgb(191, 191, 191);\ -}\ -.ace-chrome .ace_constant.ace_buildin {\ -color: rgb(88, 72, 246);\ -}\ -.ace-chrome .ace_constant.ace_language {\ -color: rgb(88, 92, 246);\ -}\ -.ace-chrome .ace_constant.ace_library {\ -color: rgb(6, 150, 14);\ -}\ -.ace-chrome .ace_invalid {\ -background-color: rgb(153, 0, 0);\ -color: white;\ -}\ -.ace-chrome .ace_fold {\ -}\ -.ace-chrome .ace_support.ace_function {\ -color: rgb(60, 76, 114);\ -}\ -.ace-chrome .ace_support.ace_constant {\ -color: rgb(6, 150, 14);\ -}\ -.ace-chrome .ace_support.ace_type,\ -.ace-chrome .ace_support.ace_class\ -.ace-chrome .ace_support.ace_other {\ -color: rgb(109, 121, 222);\ -}\ -.ace-chrome .ace_variable.ace_parameter {\ -font-style:italic;\ -color:#FD971F;\ -}\ -.ace-chrome .ace_keyword.ace_operator {\ -color: rgb(104, 118, 135);\ -}\ -.ace-chrome .ace_comment {\ -color: #236e24;\ -}\ -.ace-chrome .ace_comment.ace_doc {\ -color: #236e24;\ -}\ -.ace-chrome .ace_comment.ace_doc.ace_tag {\ -color: #236e24;\ -}\ -.ace-chrome .ace_constant.ace_numeric {\ -color: rgb(0, 0, 205);\ -}\ -.ace-chrome .ace_variable {\ -color: rgb(49, 132, 149);\ -}\ -.ace-chrome .ace_xml-pe {\ -color: rgb(104, 104, 91);\ -}\ -.ace-chrome .ace_entity.ace_name.ace_function {\ -color: #0000A2;\ -}\ -.ace-chrome .ace_heading {\ -color: rgb(12, 7, 255);\ -}\ -.ace-chrome .ace_list {\ -color:rgb(185, 6, 144);\ -}\ -.ace-chrome .ace_marker-layer .ace_selection {\ -background: rgb(181, 213, 255);\ -}\ -.ace-chrome .ace_marker-layer .ace_step {\ -background: rgb(252, 255, 0);\ -}\ -.ace-chrome .ace_marker-layer .ace_stack {\ -background: rgb(164, 229, 101);\ -}\ -.ace-chrome .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgb(192, 192, 192);\ -}\ -.ace-chrome .ace_marker-layer .ace_active-line {\ -background: rgba(0, 0, 0, 0.07);\ -}\ -.ace-chrome .ace_gutter-active-line {\ -background-color : #dcdcdc;\ -}\ -.ace-chrome .ace_marker-layer .ace_selected-word {\ -background: rgb(250, 250, 255);\ -border: 1px solid rgb(200, 200, 250);\ -}\ -.ace-chrome .ace_storage,\ -.ace-chrome .ace_keyword,\ -.ace-chrome .ace_meta.ace_tag {\ -color: rgb(147, 15, 128);\ -}\ -.ace-chrome .ace_string.ace_regex {\ -color: rgb(255, 0, 0)\ -}\ -.ace-chrome .ace_string {\ -color: #1A1AA6;\ -}\ -.ace-chrome .ace_entity.ace_other.ace_attribute-name {\ -color: #994409;\ -}\ -.ace-chrome .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ -}\ -"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-clouds.js b/util/build-sample-browser/player/vendor/ace/theme-clouds.js deleted file mode 100644 index 14202bdc1a..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-clouds.js +++ /dev/null @@ -1,126 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/clouds', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-clouds"; -exports.cssText = ".ace-clouds .ace_gutter {\ -background: #ebebeb;\ -color: #333\ -}\ -.ace-clouds .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8\ -}\ -.ace-clouds {\ -background-color: #FFFFFF;\ -color: #000000\ -}\ -.ace-clouds .ace_cursor {\ -color: #000000\ -}\ -.ace-clouds .ace_marker-layer .ace_selection {\ -background: #BDD5FC\ -}\ -.ace-clouds.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #FFFFFF;\ -border-radius: 2px\ -}\ -.ace-clouds .ace_marker-layer .ace_step {\ -background: rgb(255, 255, 0)\ -}\ -.ace-clouds .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #BFBFBF\ -}\ -.ace-clouds .ace_marker-layer .ace_active-line {\ -background: #FFFBD1\ -}\ -.ace-clouds .ace_gutter-active-line {\ -background-color : #dcdcdc\ -}\ -.ace-clouds .ace_marker-layer .ace_selected-word {\ -border: 1px solid #BDD5FC\ -}\ -.ace-clouds .ace_invisible {\ -color: #BFBFBF\ -}\ -.ace-clouds .ace_keyword,\ -.ace-clouds .ace_meta,\ -.ace-clouds .ace_support.ace_constant.ace_property-value {\ -color: #AF956F\ -}\ -.ace-clouds .ace_keyword.ace_operator {\ -color: #484848\ -}\ -.ace-clouds .ace_keyword.ace_other.ace_unit {\ -color: #96DC5F\ -}\ -.ace-clouds .ace_constant.ace_language {\ -color: #39946A\ -}\ -.ace-clouds .ace_constant.ace_numeric {\ -color: #46A609\ -}\ -.ace-clouds .ace_constant.ace_character.ace_entity {\ -color: #BF78CC\ -}\ -.ace-clouds .ace_invalid {\ -background-color: #FF002A\ -}\ -.ace-clouds .ace_fold {\ -background-color: #AF956F;\ -border-color: #000000\ -}\ -.ace-clouds .ace_storage,\ -.ace-clouds .ace_support.ace_class,\ -.ace-clouds .ace_support.ace_function,\ -.ace-clouds .ace_support.ace_other,\ -.ace-clouds .ace_support.ace_type {\ -color: #C52727\ -}\ -.ace-clouds .ace_string {\ -color: #5D90CD\ -}\ -.ace-clouds .ace_comment {\ -color: #BCC8BA\ -}\ -.ace-clouds .ace_entity.ace_name.ace_tag,\ -.ace-clouds .ace_entity.ace_other.ace_attribute-name {\ -color: #606060\ -}\ -.ace-clouds .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-clouds_midnight.js b/util/build-sample-browser/player/vendor/ace/theme-clouds_midnight.js deleted file mode 100644 index 6aca24bec8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-clouds_midnight.js +++ /dev/null @@ -1,127 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/clouds_midnight', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-clouds-midnight"; -exports.cssText = ".ace-clouds-midnight .ace_gutter {\ -background: #232323;\ -color: #929292\ -}\ -.ace-clouds-midnight .ace_print-margin {\ -width: 1px;\ -background: #232323\ -}\ -.ace-clouds-midnight {\ -background-color: #191919;\ -color: #929292\ -}\ -.ace-clouds-midnight .ace_cursor {\ -color: #7DA5DC\ -}\ -.ace-clouds-midnight .ace_marker-layer .ace_selection {\ -background: #000000\ -}\ -.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #191919;\ -border-radius: 2px\ -}\ -.ace-clouds-midnight .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-clouds-midnight .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #BFBFBF\ -}\ -.ace-clouds-midnight .ace_marker-layer .ace_active-line {\ -background: rgba(215, 215, 215, 0.031)\ -}\ -.ace-clouds-midnight .ace_gutter-active-line {\ -background-color: rgba(215, 215, 215, 0.031)\ -}\ -.ace-clouds-midnight .ace_marker-layer .ace_selected-word {\ -border: 1px solid #000000\ -}\ -.ace-clouds-midnight .ace_invisible {\ -color: #BFBFBF\ -}\ -.ace-clouds-midnight .ace_keyword,\ -.ace-clouds-midnight .ace_meta,\ -.ace-clouds-midnight .ace_support.ace_constant.ace_property-value {\ -color: #927C5D\ -}\ -.ace-clouds-midnight .ace_keyword.ace_operator {\ -color: #4B4B4B\ -}\ -.ace-clouds-midnight .ace_keyword.ace_other.ace_unit {\ -color: #366F1A\ -}\ -.ace-clouds-midnight .ace_constant.ace_language {\ -color: #39946A\ -}\ -.ace-clouds-midnight .ace_constant.ace_numeric {\ -color: #46A609\ -}\ -.ace-clouds-midnight .ace_constant.ace_character.ace_entity {\ -color: #A165AC\ -}\ -.ace-clouds-midnight .ace_invalid {\ -color: #FFFFFF;\ -background-color: #E92E2E\ -}\ -.ace-clouds-midnight .ace_fold {\ -background-color: #927C5D;\ -border-color: #929292\ -}\ -.ace-clouds-midnight .ace_storage,\ -.ace-clouds-midnight .ace_support.ace_class,\ -.ace-clouds-midnight .ace_support.ace_function,\ -.ace-clouds-midnight .ace_support.ace_other,\ -.ace-clouds-midnight .ace_support.ace_type {\ -color: #E92E2E\ -}\ -.ace-clouds-midnight .ace_string {\ -color: #5D90CD\ -}\ -.ace-clouds-midnight .ace_comment {\ -color: #3C403B\ -}\ -.ace-clouds-midnight .ace_entity.ace_name.ace_tag,\ -.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {\ -color: #606060\ -}\ -.ace-clouds-midnight .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-cobalt.js b/util/build-sample-browser/player/vendor/ace/theme-cobalt.js deleted file mode 100644 index 34fed3418c..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-cobalt.js +++ /dev/null @@ -1,143 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/cobalt', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-cobalt"; -exports.cssText = ".ace-cobalt .ace_gutter {\ -background: #011e3a;\ -color: #fff\ -}\ -.ace-cobalt .ace_print-margin {\ -width: 1px;\ -background: #011e3a\ -}\ -.ace-cobalt {\ -background-color: #002240;\ -color: #FFFFFF\ -}\ -.ace-cobalt .ace_cursor {\ -color: #FFFFFF\ -}\ -.ace-cobalt .ace_marker-layer .ace_selection {\ -background: rgba(179, 101, 57, 0.75)\ -}\ -.ace-cobalt.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #002240;\ -border-radius: 2px\ -}\ -.ace-cobalt .ace_marker-layer .ace_step {\ -background: rgb(127, 111, 19)\ -}\ -.ace-cobalt .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(255, 255, 255, 0.15)\ -}\ -.ace-cobalt .ace_marker-layer .ace_active-line {\ -background: rgba(0, 0, 0, 0.35)\ -}\ -.ace-cobalt .ace_gutter-active-line {\ -background-color: rgba(0, 0, 0, 0.35)\ -}\ -.ace-cobalt .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgba(179, 101, 57, 0.75)\ -}\ -.ace-cobalt .ace_invisible {\ -color: rgba(255, 255, 255, 0.15)\ -}\ -.ace-cobalt .ace_keyword,\ -.ace-cobalt .ace_meta {\ -color: #FF9D00\ -}\ -.ace-cobalt .ace_constant,\ -.ace-cobalt .ace_constant.ace_character,\ -.ace-cobalt .ace_constant.ace_character.ace_escape,\ -.ace-cobalt .ace_constant.ace_other {\ -color: #FF628C\ -}\ -.ace-cobalt .ace_invalid {\ -color: #F8F8F8;\ -background-color: #800F00\ -}\ -.ace-cobalt .ace_support {\ -color: #80FFBB\ -}\ -.ace-cobalt .ace_support.ace_constant {\ -color: #EB939A\ -}\ -.ace-cobalt .ace_fold {\ -background-color: #FF9D00;\ -border-color: #FFFFFF\ -}\ -.ace-cobalt .ace_support.ace_function {\ -color: #FFB054\ -}\ -.ace-cobalt .ace_storage {\ -color: #FFEE80\ -}\ -.ace-cobalt .ace_entity {\ -color: #FFDD00\ -}\ -.ace-cobalt .ace_string {\ -color: #3AD900\ -}\ -.ace-cobalt .ace_string.ace_regexp {\ -color: #80FFC2\ -}\ -.ace-cobalt .ace_comment {\ -font-style: italic;\ -color: #0088FF\ -}\ -.ace-cobalt .ace_heading,\ -.ace-cobalt .ace_markup.ace_heading {\ -color: #C8E4FD;\ -background-color: #001221\ -}\ -.ace-cobalt .ace_list,\ -.ace-cobalt .ace_markup.ace_list {\ -background-color: #130D26\ -}\ -.ace-cobalt .ace_variable {\ -color: #CCCCCC\ -}\ -.ace-cobalt .ace_variable.ace_language {\ -color: #FF80E1\ -}\ -.ace-cobalt .ace_meta.ace_tag {\ -color: #9EFFFF\ -}\ -.ace-cobalt .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-crimson_editor.js b/util/build-sample-browser/player/vendor/ace/theme-crimson_editor.js deleted file mode 100644 index e07c2da2e2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-crimson_editor.js +++ /dev/null @@ -1,148 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/crimson_editor', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { -exports.isDark = false; -exports.cssText = ".ace-crimson-editor .ace_gutter {\ -background: #ebebeb;\ -color: #333;\ -overflow : hidden;\ -}\ -.ace-crimson-editor .ace_gutter-layer {\ -width: 100%;\ -text-align: right;\ -}\ -.ace-crimson-editor .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8;\ -}\ -.ace-crimson-editor {\ -background-color: #FFFFFF;\ -color: rgb(64, 64, 64);\ -}\ -.ace-crimson-editor .ace_cursor {\ -color: black;\ -}\ -.ace-crimson-editor .ace_invisible {\ -color: rgb(191, 191, 191);\ -}\ -.ace-crimson-editor .ace_identifier {\ -color: black;\ -}\ -.ace-crimson-editor .ace_keyword {\ -color: blue;\ -}\ -.ace-crimson-editor .ace_constant.ace_buildin {\ -color: rgb(88, 72, 246);\ -}\ -.ace-crimson-editor .ace_constant.ace_language {\ -color: rgb(255, 156, 0);\ -}\ -.ace-crimson-editor .ace_constant.ace_library {\ -color: rgb(6, 150, 14);\ -}\ -.ace-crimson-editor .ace_invalid {\ -text-decoration: line-through;\ -color: rgb(224, 0, 0);\ -}\ -.ace-crimson-editor .ace_fold {\ -}\ -.ace-crimson-editor .ace_support.ace_function {\ -color: rgb(192, 0, 0);\ -}\ -.ace-crimson-editor .ace_support.ace_constant {\ -color: rgb(6, 150, 14);\ -}\ -.ace-crimson-editor .ace_support.ace_type,\ -.ace-crimson-editor .ace_support.ace_class {\ -color: rgb(109, 121, 222);\ -}\ -.ace-crimson-editor .ace_keyword.ace_operator {\ -color: rgb(49, 132, 149);\ -}\ -.ace-crimson-editor .ace_string {\ -color: rgb(128, 0, 128);\ -}\ -.ace-crimson-editor .ace_comment {\ -color: rgb(76, 136, 107);\ -}\ -.ace-crimson-editor .ace_comment.ace_doc {\ -color: rgb(0, 102, 255);\ -}\ -.ace-crimson-editor .ace_comment.ace_doc.ace_tag {\ -color: rgb(128, 159, 191);\ -}\ -.ace-crimson-editor .ace_constant.ace_numeric {\ -color: rgb(0, 0, 64);\ -}\ -.ace-crimson-editor .ace_variable {\ -color: rgb(0, 64, 128);\ -}\ -.ace-crimson-editor .ace_xml-pe {\ -color: rgb(104, 104, 91);\ -}\ -.ace-crimson-editor .ace_marker-layer .ace_selection {\ -background: rgb(181, 213, 255);\ -}\ -.ace-crimson-editor .ace_marker-layer .ace_step {\ -background: rgb(252, 255, 0);\ -}\ -.ace-crimson-editor .ace_marker-layer .ace_stack {\ -background: rgb(164, 229, 101);\ -}\ -.ace-crimson-editor .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgb(192, 192, 192);\ -}\ -.ace-crimson-editor .ace_marker-layer .ace_active-line {\ -background: rgb(232, 242, 254);\ -}\ -.ace-crimson-editor .ace_gutter-active-line {\ -background-color : #dcdcdc;\ -}\ -.ace-crimson-editor .ace_meta.ace_tag {\ -color:rgb(28, 2, 255);\ -}\ -.ace-crimson-editor .ace_marker-layer .ace_selected-word {\ -background: rgb(250, 250, 255);\ -border: 1px solid rgb(200, 200, 250);\ -}\ -.ace-crimson-editor .ace_string.ace_regex {\ -color: rgb(192, 0, 192);\ -}\ -.ace-crimson-editor .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ -}"; - -exports.cssClass = "ace-crimson-editor"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-dawn.js b/util/build-sample-browser/player/vendor/ace/theme-dawn.js deleted file mode 100644 index b6b51dbe04..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-dawn.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/dawn', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-dawn"; -exports.cssText = ".ace-dawn .ace_gutter {\ -background: #ebebeb;\ -color: #333\ -}\ -.ace-dawn .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8\ -}\ -.ace-dawn {\ -background-color: #F9F9F9;\ -color: #080808\ -}\ -.ace-dawn .ace_cursor {\ -color: #000000\ -}\ -.ace-dawn .ace_marker-layer .ace_selection {\ -background: rgba(39, 95, 255, 0.30)\ -}\ -.ace-dawn.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #F9F9F9;\ -border-radius: 2px\ -}\ -.ace-dawn .ace_marker-layer .ace_step {\ -background: rgb(255, 255, 0)\ -}\ -.ace-dawn .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(75, 75, 126, 0.50)\ -}\ -.ace-dawn .ace_marker-layer .ace_active-line {\ -background: rgba(36, 99, 180, 0.12)\ -}\ -.ace-dawn .ace_gutter-active-line {\ -background-color : #dcdcdc\ -}\ -.ace-dawn .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgba(39, 95, 255, 0.30)\ -}\ -.ace-dawn .ace_invisible {\ -color: rgba(75, 75, 126, 0.50)\ -}\ -.ace-dawn .ace_keyword,\ -.ace-dawn .ace_meta {\ -color: #794938\ -}\ -.ace-dawn .ace_constant,\ -.ace-dawn .ace_constant.ace_character,\ -.ace-dawn .ace_constant.ace_character.ace_escape,\ -.ace-dawn .ace_constant.ace_other {\ -color: #811F24\ -}\ -.ace-dawn .ace_invalid.ace_illegal {\ -text-decoration: underline;\ -font-style: italic;\ -color: #F8F8F8;\ -background-color: #B52A1D\ -}\ -.ace-dawn .ace_invalid.ace_deprecated {\ -text-decoration: underline;\ -font-style: italic;\ -color: #B52A1D\ -}\ -.ace-dawn .ace_support {\ -color: #691C97\ -}\ -.ace-dawn .ace_support.ace_constant {\ -color: #B4371F\ -}\ -.ace-dawn .ace_fold {\ -background-color: #794938;\ -border-color: #080808\ -}\ -.ace-dawn .ace_list,\ -.ace-dawn .ace_markup.ace_list,\ -.ace-dawn .ace_support.ace_function {\ -color: #693A17\ -}\ -.ace-dawn .ace_storage {\ -font-style: italic;\ -color: #A71D5D\ -}\ -.ace-dawn .ace_string {\ -color: #0B6125\ -}\ -.ace-dawn .ace_string.ace_regexp {\ -color: #CF5628\ -}\ -.ace-dawn .ace_comment {\ -font-style: italic;\ -color: #5A525F\ -}\ -.ace-dawn .ace_heading,\ -.ace-dawn .ace_markup.ace_heading {\ -color: #19356D\ -}\ -.ace-dawn .ace_variable {\ -color: #234A97\ -}\ -.ace-dawn .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-dreamweaver.js b/util/build-sample-browser/player/vendor/ace/theme-dreamweaver.js deleted file mode 100644 index 371b23393b..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-dreamweaver.js +++ /dev/null @@ -1,168 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/dreamweaver', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { -exports.isDark = false; -exports.cssClass = "ace-dreamweaver"; -exports.cssText = ".ace-dreamweaver .ace_gutter {\ -background: #e8e8e8;\ -color: #333;\ -}\ -.ace-dreamweaver .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8;\ -}\ -.ace-dreamweaver {\ -background-color: #FFFFFF;\ -color: black;\ -}\ -.ace-dreamweaver .ace_fold {\ -background-color: #757AD8;\ -}\ -.ace-dreamweaver .ace_cursor {\ -color: black;\ -}\ -.ace-dreamweaver .ace_invisible {\ -color: rgb(191, 191, 191);\ -}\ -.ace-dreamweaver .ace_storage,\ -.ace-dreamweaver .ace_keyword {\ -color: blue;\ -}\ -.ace-dreamweaver .ace_constant.ace_buildin {\ -color: rgb(88, 72, 246);\ -}\ -.ace-dreamweaver .ace_constant.ace_language {\ -color: rgb(88, 92, 246);\ -}\ -.ace-dreamweaver .ace_constant.ace_library {\ -color: rgb(6, 150, 14);\ -}\ -.ace-dreamweaver .ace_invalid {\ -background-color: rgb(153, 0, 0);\ -color: white;\ -}\ -.ace-dreamweaver .ace_support.ace_function {\ -color: rgb(60, 76, 114);\ -}\ -.ace-dreamweaver .ace_support.ace_constant {\ -color: rgb(6, 150, 14);\ -}\ -.ace-dreamweaver .ace_support.ace_type,\ -.ace-dreamweaver .ace_support.ace_class {\ -color: #009;\ -}\ -.ace-dreamweaver .ace_support.ace_php_tag {\ -color: #f00;\ -}\ -.ace-dreamweaver .ace_keyword.ace_operator {\ -color: rgb(104, 118, 135);\ -}\ -.ace-dreamweaver .ace_string {\ -color: #00F;\ -}\ -.ace-dreamweaver .ace_comment {\ -color: rgb(76, 136, 107);\ -}\ -.ace-dreamweaver .ace_comment.ace_doc {\ -color: rgb(0, 102, 255);\ -}\ -.ace-dreamweaver .ace_comment.ace_doc.ace_tag {\ -color: rgb(128, 159, 191);\ -}\ -.ace-dreamweaver .ace_constant.ace_numeric {\ -color: rgb(0, 0, 205);\ -}\ -.ace-dreamweaver .ace_variable {\ -color: #06F\ -}\ -.ace-dreamweaver .ace_xml-pe {\ -color: rgb(104, 104, 91);\ -}\ -.ace-dreamweaver .ace_entity.ace_name.ace_function {\ -color: #00F;\ -}\ -.ace-dreamweaver .ace_heading {\ -color: rgb(12, 7, 255);\ -}\ -.ace-dreamweaver .ace_list {\ -color:rgb(185, 6, 144);\ -}\ -.ace-dreamweaver .ace_marker-layer .ace_selection {\ -background: rgb(181, 213, 255);\ -}\ -.ace-dreamweaver .ace_marker-layer .ace_step {\ -background: rgb(252, 255, 0);\ -}\ -.ace-dreamweaver .ace_marker-layer .ace_stack {\ -background: rgb(164, 229, 101);\ -}\ -.ace-dreamweaver .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgb(192, 192, 192);\ -}\ -.ace-dreamweaver .ace_marker-layer .ace_active-line {\ -background: rgba(0, 0, 0, 0.07);\ -}\ -.ace-dreamweaver .ace_marker-layer .ace_selected-word {\ -background: rgb(250, 250, 255);\ -border: 1px solid rgb(200, 200, 250);\ -}\ -.ace-dreamweaver .ace_meta.ace_tag {\ -color:#009;\ -}\ -.ace-dreamweaver .ace_meta.ace_tag.ace_anchor {\ -color:#060;\ -}\ -.ace-dreamweaver .ace_meta.ace_tag.ace_form {\ -color:#F90;\ -}\ -.ace-dreamweaver .ace_meta.ace_tag.ace_image {\ -color:#909;\ -}\ -.ace-dreamweaver .ace_meta.ace_tag.ace_script {\ -color:#900;\ -}\ -.ace-dreamweaver .ace_meta.ace_tag.ace_style {\ -color:#909;\ -}\ -.ace-dreamweaver .ace_meta.ace_tag.ace_table {\ -color:#099;\ -}\ -.ace-dreamweaver .ace_string.ace_regex {\ -color: rgb(255, 0, 0)\ -}\ -.ace-dreamweaver .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-eclipse.js b/util/build-sample-browser/player/vendor/ace/theme-eclipse.js deleted file mode 100644 index 167ba6e922..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-eclipse.js +++ /dev/null @@ -1,125 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/eclipse', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - - -exports.isDark = false; -exports.cssText = ".ace-eclipse .ace_gutter {\ -background: #ebebeb;\ -border-right: 1px solid rgb(159, 159, 159);\ -color: rgb(136, 136, 136);\ -}\ -.ace-eclipse .ace_print-margin {\ -width: 1px;\ -background: #ebebeb;\ -}\ -.ace-eclipse {\ -background-color: #FFFFFF;\ -color: black;\ -}\ -.ace-eclipse .ace_fold {\ -background-color: rgb(60, 76, 114);\ -}\ -.ace-eclipse .ace_cursor {\ -color: black;\ -}\ -.ace-eclipse .ace_storage,\ -.ace-eclipse .ace_keyword,\ -.ace-eclipse .ace_variable {\ -color: rgb(127, 0, 85);\ -}\ -.ace-eclipse .ace_constant.ace_buildin {\ -color: rgb(88, 72, 246);\ -}\ -.ace-eclipse .ace_constant.ace_library {\ -color: rgb(6, 150, 14);\ -}\ -.ace-eclipse .ace_function {\ -color: rgb(60, 76, 114);\ -}\ -.ace-eclipse .ace_string {\ -color: rgb(42, 0, 255);\ -}\ -.ace-eclipse .ace_comment {\ -color: rgb(113, 150, 130);\ -}\ -.ace-eclipse .ace_comment.ace_doc {\ -color: rgb(63, 95, 191);\ -}\ -.ace-eclipse .ace_comment.ace_doc.ace_tag {\ -color: rgb(127, 159, 191);\ -}\ -.ace-eclipse .ace_constant.ace_numeric {\ -color: darkblue;\ -}\ -.ace-eclipse .ace_tag {\ -color: rgb(25, 118, 116);\ -}\ -.ace-eclipse .ace_type {\ -color: rgb(127, 0, 127);\ -}\ -.ace-eclipse .ace_xml-pe {\ -color: rgb(104, 104, 91);\ -}\ -.ace-eclipse .ace_marker-layer .ace_selection {\ -background: rgb(181, 213, 255);\ -}\ -.ace-eclipse .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgb(192, 192, 192);\ -}\ -.ace-eclipse .ace_meta.ace_tag {\ -color:rgb(25, 118, 116);\ -}\ -.ace-eclipse .ace_invisible {\ -color: #ddd;\ -}\ -.ace-eclipse .ace_entity.ace_other.ace_attribute-name {\ -color:rgb(127, 0, 127);\ -}\ -.ace-eclipse .ace_marker-layer .ace_step {\ -background: rgb(255, 255, 0);\ -}\ -.ace-eclipse .ace_marker-layer .ace_active-line {\ -background: rgb(232, 242, 254);\ -}\ -.ace-eclipse .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgb(181, 213, 255);\ -}\ -.ace-eclipse .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ -}"; - -exports.cssClass = "ace-eclipse"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-github.js b/util/build-sample-browser/player/vendor/ace/theme-github.js deleted file mode 100644 index 072c5e14d2..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-github.js +++ /dev/null @@ -1,131 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/github', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-github"; -exports.cssText = "/* CSS style content from github's default pygments highlighter template.\ -Cursor and selection styles from textmate.css. */\ -.ace-github .ace_gutter {\ -background: #e8e8e8;\ -color: #AAA;\ -}\ -.ace-github {\ -background: #fff;\ -color: #000;\ -}\ -.ace-github .ace_keyword {\ -font-weight: bold;\ -}\ -.ace-github .ace_string {\ -color: #D14;\ -}\ -.ace-github .ace_variable.ace_class {\ -color: teal;\ -}\ -.ace-github .ace_constant.ace_numeric {\ -color: #099;\ -}\ -.ace-github .ace_constant.ace_buildin {\ -color: #0086B3;\ -}\ -.ace-github .ace_support.ace_function {\ -color: #0086B3;\ -}\ -.ace-github .ace_comment {\ -color: #998;\ -font-style: italic;\ -}\ -.ace-github .ace_variable.ace_language {\ -color: #0086B3;\ -}\ -.ace-github .ace_paren {\ -font-weight: bold;\ -}\ -.ace-github .ace_boolean {\ -font-weight: bold;\ -}\ -.ace-github .ace_string.ace_regexp {\ -color: #009926;\ -font-weight: normal;\ -}\ -.ace-github .ace_variable.ace_instance {\ -color: teal;\ -}\ -.ace-github .ace_constant.ace_language {\ -font-weight: bold;\ -}\ -.ace-github .ace_cursor {\ -color: black;\ -}\ -.ace-github .ace_marker-layer .ace_active-line {\ -background: rgb(255, 255, 204);\ -}\ -.ace-github .ace_marker-layer .ace_selection {\ -background: rgb(181, 213, 255);\ -}\ -.ace-github.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px white;\ -border-radius: 2px;\ -}\ -/* bold keywords cause cursor issues for some fonts */\ -/* this disables bold style for editor and keeps for static highlighter */\ -.ace-github.ace_nobold .ace_line > span {\ -font-weight: normal !important;\ -}\ -.ace-github .ace_marker-layer .ace_step {\ -background: rgb(252, 255, 0);\ -}\ -.ace-github .ace_marker-layer .ace_stack {\ -background: rgb(164, 229, 101);\ -}\ -.ace-github .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgb(192, 192, 192);\ -}\ -.ace-github .ace_gutter-active-line {\ -background-color : rgba(0, 0, 0, 0.07);\ -}\ -.ace-github .ace_marker-layer .ace_selected-word {\ -background: rgb(250, 250, 255);\ -border: 1px solid rgb(200, 200, 250);\ -}\ -.ace-github .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8;\ -}\ -.ace-github .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ -}"; - - var dom = require("../lib/dom"); - dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-idle_fingers.js b/util/build-sample-browser/player/vendor/ace/theme-idle_fingers.js deleted file mode 100644 index 0c02d31ddb..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-idle_fingers.js +++ /dev/null @@ -1,127 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/idle_fingers', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-idle-fingers"; -exports.cssText = ".ace-idle-fingers .ace_gutter {\ -background: #3b3b3b;\ -color: #fff\ -}\ -.ace-idle-fingers .ace_print-margin {\ -width: 1px;\ -background: #3b3b3b\ -}\ -.ace-idle-fingers {\ -background-color: #323232;\ -color: #FFFFFF\ -}\ -.ace-idle-fingers .ace_cursor {\ -color: #91FF00\ -}\ -.ace-idle-fingers .ace_marker-layer .ace_selection {\ -background: rgba(90, 100, 126, 0.88)\ -}\ -.ace-idle-fingers.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #323232;\ -border-radius: 2px\ -}\ -.ace-idle-fingers .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-idle-fingers .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #404040\ -}\ -.ace-idle-fingers .ace_marker-layer .ace_active-line {\ -background: #353637\ -}\ -.ace-idle-fingers .ace_gutter-active-line {\ -background-color: #353637\ -}\ -.ace-idle-fingers .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgba(90, 100, 126, 0.88)\ -}\ -.ace-idle-fingers .ace_invisible {\ -color: #404040\ -}\ -.ace-idle-fingers .ace_keyword,\ -.ace-idle-fingers .ace_meta {\ -color: #CC7833\ -}\ -.ace-idle-fingers .ace_constant,\ -.ace-idle-fingers .ace_constant.ace_character,\ -.ace-idle-fingers .ace_constant.ace_character.ace_escape,\ -.ace-idle-fingers .ace_constant.ace_other,\ -.ace-idle-fingers .ace_support.ace_constant {\ -color: #6C99BB\ -}\ -.ace-idle-fingers .ace_invalid {\ -color: #FFFFFF;\ -background-color: #FF0000\ -}\ -.ace-idle-fingers .ace_fold {\ -background-color: #CC7833;\ -border-color: #FFFFFF\ -}\ -.ace-idle-fingers .ace_support.ace_function {\ -color: #B83426\ -}\ -.ace-idle-fingers .ace_variable.ace_parameter {\ -font-style: italic\ -}\ -.ace-idle-fingers .ace_string {\ -color: #A5C261\ -}\ -.ace-idle-fingers .ace_string.ace_regexp {\ -color: #CCCC33\ -}\ -.ace-idle-fingers .ace_comment {\ -font-style: italic;\ -color: #BC9458\ -}\ -.ace-idle-fingers .ace_meta.ace_tag {\ -color: #FFE5BB\ -}\ -.ace-idle-fingers .ace_entity.ace_name {\ -color: #FFC66D\ -}\ -.ace-idle-fingers .ace_collab.ace_user1 {\ -color: #323232;\ -background-color: #FFF980\ -}\ -.ace-idle-fingers .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjLyZYiPj/8PAAreAwAI1+g0AAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-katzenmilch.js b/util/build-sample-browser/player/vendor/ace/theme-katzenmilch.js deleted file mode 100644 index 25dca278b8..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-katzenmilch.js +++ /dev/null @@ -1,150 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/katzenmilch', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-katzenmilch"; -exports.cssText = ".ace-katzenmilch .ace_gutter,\ -/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: ) */\ -.ace-katzenmilch .ace_gutter {\ -background: #e8e8e8;\ -color: #333\ -}\ -.ace-katzenmilch .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8\ -}\ -.ace-katzenmilch {\ -background-color: #f3f2f3;\ -color: rgba(15, 0, 9, 1.0)\ -}\ -.ace-katzenmilch .ace_cursor {\ -border-left: 2px solid #100011\ -}\ -.ace-katzenmilch .ace_overwrite-cursors .ace_cursor {\ -border-left: 0px;\ -border-bottom: 1px solid #100011\ -}\ -.ace-katzenmilch .ace_marker-layer .ace_selection {\ -background: rgba(100, 5, 208, 0.27)\ -}\ -.ace-katzenmilch.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #f3f2f3;\ -border-radius: 2px\ -}\ -.ace-katzenmilch .ace_marker-layer .ace_step {\ -background: rgb(198, 219, 174)\ -}\ -.ace-katzenmilch .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #000000\ -}\ -.ace-katzenmilch .ace_marker-layer .ace_active-line {\ -background: rgb(232, 242, 254)\ -}\ -.ace-katzenmilch .ace_gutter-active-line {\ -background-color: rgb(232, 242, 254)\ -}\ -.ace-katzenmilch .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgba(100, 5, 208, 0.27)\ -}\ -.ace-katzenmilch .ace_fold {\ -background-color: rgba(2, 95, 73, 0.97);\ -border-color: rgba(15, 0, 9, 1.0)\ -}\ -.ace-katzenmilch .ace_keyword {\ -color: #674Aa8;\ -rbackground-color: rgba(163, 170, 216, 0.055)\ -}\ -.ace-katzenmilch .ace_constant.ace_language {\ -color: #7D7e52;\ -rbackground-color: rgba(189, 190, 130, 0.059)\ -}\ -.ace-katzenmilch .ace_constant.ace_numeric {\ -color: rgba(79, 130, 123, 0.93);\ -rbackground-color: rgba(119, 194, 187, 0.059)\ -}\ -.ace-katzenmilch .ace_constant.ace_character,\ -.ace-katzenmilch .ace_constant.ace_other {\ -color: rgba(2, 95, 105, 1.0);\ -rbackground-color: rgba(127, 34, 153, 0.063)\ -}\ -.ace-katzenmilch .ace_support.ace_function {\ -color: #9D7e62;\ -rbackground-color: rgba(189, 190, 130, 0.039)\ -}\ -.ace-katzenmilch .ace_support.ace_class {\ -color: rgba(239, 106, 167, 1.0);\ -rbackground-color: rgba(239, 106, 167, 0.063)\ -}\ -.ace-katzenmilch .ace_storage {\ -color: rgba(123, 92, 191, 1.0);\ -rbackground-color: rgba(139, 93, 223, 0.051)\ -}\ -.ace-katzenmilch .ace_invalid {\ -color: #DFDFD5;\ -rbackground-color: #CC1B27\ -}\ -.ace-katzenmilch .ace_string {\ -color: #5a5f9b;\ -rbackground-color: rgba(170, 175, 219, 0.035)\ -}\ -.ace-katzenmilch .ace_comment {\ -font-style: italic;\ -color: rgba(64, 79, 80, 0.67);\ -rbackground-color: rgba(95, 15, 255, 0.0078)\ -}\ -.ace-katzenmilch .ace_entity.ace_name.ace_function,\ -.ace-katzenmilch .ace_variable {\ -color: rgba(2, 95, 73, 0.97);\ -rbackground-color: rgba(34, 255, 73, 0.12)\ -}\ -.ace-katzenmilch .ace_variable.ace_language {\ -color: #316fcf;\ -rbackground-color: rgba(58, 175, 255, 0.039)\ -}\ -.ace-katzenmilch .ace_variable.ace_parameter {\ -font-style: italic;\ -color: rgba(51, 150, 159, 0.87);\ -rbackground-color: rgba(5, 214, 249, 0.043)\ -}\ -.ace-katzenmilch .ace_entity.ace_other.ace_attribute-name {\ -color: rgba(73, 70, 194, 0.93);\ -rbackground-color: rgba(73, 134, 194, 0.035)\ -}\ -.ace-katzenmilch .ace_entity.ace_name.ace_tag {\ -color: #3976a2;\ -rbackground-color: rgba(73, 166, 210, 0.039)\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-kr.js b/util/build-sample-browser/player/vendor/ace/theme-kr.js deleted file mode 100644 index 97c6cd0649..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-kr.js +++ /dev/null @@ -1,135 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/kr_theme', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-kr-theme"; -exports.cssText = ".ace-kr-theme .ace_gutter {\ -background: #1c1917;\ -color: #FCFFE0\ -}\ -.ace-kr-theme .ace_print-margin {\ -width: 1px;\ -background: #1c1917\ -}\ -.ace-kr-theme {\ -background-color: #0B0A09;\ -color: #FCFFE0\ -}\ -.ace-kr-theme .ace_cursor {\ -color: #FF9900\ -}\ -.ace-kr-theme .ace_marker-layer .ace_selection {\ -background: rgba(170, 0, 255, 0.45)\ -}\ -.ace-kr-theme.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #0B0A09;\ -border-radius: 2px\ -}\ -.ace-kr-theme .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-kr-theme .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(255, 177, 111, 0.32)\ -}\ -.ace-kr-theme .ace_marker-layer .ace_active-line {\ -background: #38403D\ -}\ -.ace-kr-theme .ace_gutter-active-line {\ -background-color : #38403D\ -}\ -.ace-kr-theme .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgba(170, 0, 255, 0.45)\ -}\ -.ace-kr-theme .ace_invisible {\ -color: rgba(255, 177, 111, 0.32)\ -}\ -.ace-kr-theme .ace_keyword,\ -.ace-kr-theme .ace_meta {\ -color: #949C8B\ -}\ -.ace-kr-theme .ace_constant,\ -.ace-kr-theme .ace_constant.ace_character,\ -.ace-kr-theme .ace_constant.ace_character.ace_escape,\ -.ace-kr-theme .ace_constant.ace_other {\ -color: rgba(210, 117, 24, 0.76)\ -}\ -.ace-kr-theme .ace_invalid {\ -color: #F8F8F8;\ -background-color: #A41300\ -}\ -.ace-kr-theme .ace_support {\ -color: #9FC28A\ -}\ -.ace-kr-theme .ace_support.ace_constant {\ -color: #C27E66\ -}\ -.ace-kr-theme .ace_fold {\ -background-color: #949C8B;\ -border-color: #FCFFE0\ -}\ -.ace-kr-theme .ace_support.ace_function {\ -color: #85873A\ -}\ -.ace-kr-theme .ace_storage {\ -color: #FFEE80\ -}\ -.ace-kr-theme .ace_string {\ -color: rgba(164, 161, 181, 0.8)\ -}\ -.ace-kr-theme .ace_string.ace_regexp {\ -color: rgba(125, 255, 192, 0.65)\ -}\ -.ace-kr-theme .ace_comment {\ -font-style: italic;\ -color: #706D5B\ -}\ -.ace-kr-theme .ace_variable {\ -color: #D1A796\ -}\ -.ace-kr-theme .ace_list,\ -.ace-kr-theme .ace_markup.ace_list {\ -background-color: #0F0040\ -}\ -.ace-kr-theme .ace_variable.ace_language {\ -color: #FF80E1\ -}\ -.ace-kr-theme .ace_meta.ace_tag {\ -color: #BABD9C\ -}\ -.ace-kr-theme .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-kuroir.js b/util/build-sample-browser/player/vendor/ace/theme-kuroir.js deleted file mode 100644 index 41dbdb8d00..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-kuroir.js +++ /dev/null @@ -1,89 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/kuroir', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-kuroir"; -exports.cssText = "/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: 467560D0-6ACE-4409-82FD-4791420837AC) */\ -.ace-kuroir .ace_gutter {\ -background: #e8e8e8;\ -color: #333;\ -}\ -.ace-kuroir .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8;\ -}\ -.ace-kuroir {\ -background-color: #E8E9E8;\ -color: #363636;\ -}\ -.ace-kuroir .ace_cursor {\ -color: #202020;\ -}\ -.ace-kuroir .ace_marker-layer .ace_selection {\ -background: rgba(245, 170, 0, 0.57);\ -}\ -.ace-kuroir.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #E8E9E8;\ -border-radius: 2px;\ -}\ -.ace-kuroir .ace_marker-layer .ace_step {\ -background: rgb(198, 219, 174);\ -}\ -.ace-kuroir .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(0, 0, 0, 0.29);\ -}\ -.ace-kuroir .ace_marker-layer .ace_active-line {\ -background: rgba(203, 220, 47, 0.22);\ -}\ -.ace-kuroir .ace_gutter-active-line {\ -background-color: rgba(203, 220, 47, 0.22);\ -}\ -.ace-kuroir .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgba(245, 170, 0, 0.57);\ -}\ -.ace-kuroir .ace_fold {\ -border-color: #363636;\ -}\ -.ace-kuroir .ace_constant{color:#CD6839;}.ace-kuroir .ace_constant.ace_numeric{color:#9A5925;}.ace-kuroir .ace_support{color:#104E8B;}.ace-kuroir .ace_support.ace_function{color:#005273;}.ace-kuroir .ace_support.ace_constant{color:#CF6A4C;}.ace-kuroir .ace_storage{color:#A52A2A;}.ace-kuroir .ace_invalid.ace_illegal{color:#FD1224;\ -background-color:rgba(255, 6, 0, 0.15);}.ace-kuroir .ace_invalid.ace_deprecated{text-decoration:underline;\ -font-style:italic;\ -color:#FD1732;\ -background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00;\ -background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91);\ -background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D;\ -background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;}\ -"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-merbivore.js b/util/build-sample-browser/player/vendor/ace/theme-merbivore.js deleted file mode 100644 index 21b95b6319..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-merbivore.js +++ /dev/null @@ -1,126 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/merbivore', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-merbivore"; -exports.cssText = ".ace-merbivore .ace_gutter {\ -background: #202020;\ -color: #E6E1DC\ -}\ -.ace-merbivore .ace_print-margin {\ -width: 1px;\ -background: #555651\ -}\ -.ace-merbivore {\ -background-color: #161616;\ -color: #E6E1DC\ -}\ -.ace-merbivore .ace_cursor {\ -color: #FFFFFF\ -}\ -.ace-merbivore .ace_marker-layer .ace_selection {\ -background: #454545\ -}\ -.ace-merbivore.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #161616;\ -border-radius: 2px\ -}\ -.ace-merbivore .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-merbivore .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #404040\ -}\ -.ace-merbivore .ace_marker-layer .ace_active-line {\ -background: #333435\ -}\ -.ace-merbivore .ace_gutter-active-line {\ -background-color: #333435\ -}\ -.ace-merbivore .ace_marker-layer .ace_selected-word {\ -border: 1px solid #454545\ -}\ -.ace-merbivore .ace_invisible {\ -color: #404040\ -}\ -.ace-merbivore .ace_entity.ace_name.ace_tag,\ -.ace-merbivore .ace_keyword,\ -.ace-merbivore .ace_meta,\ -.ace-merbivore .ace_meta.ace_tag,\ -.ace-merbivore .ace_storage,\ -.ace-merbivore .ace_support.ace_function {\ -color: #FC6F09\ -}\ -.ace-merbivore .ace_constant,\ -.ace-merbivore .ace_constant.ace_character,\ -.ace-merbivore .ace_constant.ace_character.ace_escape,\ -.ace-merbivore .ace_constant.ace_other,\ -.ace-merbivore .ace_support.ace_type {\ -color: #1EDAFB\ -}\ -.ace-merbivore .ace_constant.ace_character.ace_escape {\ -color: #519F50\ -}\ -.ace-merbivore .ace_constant.ace_language {\ -color: #FDC251\ -}\ -.ace-merbivore .ace_constant.ace_library,\ -.ace-merbivore .ace_string,\ -.ace-merbivore .ace_support.ace_constant {\ -color: #8DFF0A\ -}\ -.ace-merbivore .ace_constant.ace_numeric {\ -color: #58C554\ -}\ -.ace-merbivore .ace_invalid {\ -color: #FFFFFF;\ -background-color: #990000\ -}\ -.ace-merbivore .ace_fold {\ -background-color: #FC6F09;\ -border-color: #E6E1DC\ -}\ -.ace-merbivore .ace_comment {\ -font-style: italic;\ -color: #AD2EA4\ -}\ -.ace-merbivore .ace_entity.ace_other.ace_attribute-name {\ -color: #FFFF89\ -}\ -.ace-merbivore .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQFxf3ZXB1df0PAAdsAmERTkEHAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-merbivore_soft.js b/util/build-sample-browser/player/vendor/ace/theme-merbivore_soft.js deleted file mode 100644 index fa8bac886f..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-merbivore_soft.js +++ /dev/null @@ -1,127 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/merbivore_soft', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-merbivore-soft"; -exports.cssText = ".ace-merbivore-soft .ace_gutter {\ -background: #262424;\ -color: #E6E1DC\ -}\ -.ace-merbivore-soft .ace_print-margin {\ -width: 1px;\ -background: #262424\ -}\ -.ace-merbivore-soft {\ -background-color: #1C1C1C;\ -color: #E6E1DC\ -}\ -.ace-merbivore-soft .ace_cursor {\ -color: #FFFFFF\ -}\ -.ace-merbivore-soft .ace_marker-layer .ace_selection {\ -background: #494949\ -}\ -.ace-merbivore-soft.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #1C1C1C;\ -border-radius: 2px\ -}\ -.ace-merbivore-soft .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-merbivore-soft .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #404040\ -}\ -.ace-merbivore-soft .ace_marker-layer .ace_active-line {\ -background: #333435\ -}\ -.ace-merbivore-soft .ace_gutter-active-line {\ -background-color: #333435\ -}\ -.ace-merbivore-soft .ace_marker-layer .ace_selected-word {\ -border: 1px solid #494949\ -}\ -.ace-merbivore-soft .ace_invisible {\ -color: #404040\ -}\ -.ace-merbivore-soft .ace_entity.ace_name.ace_tag,\ -.ace-merbivore-soft .ace_keyword,\ -.ace-merbivore-soft .ace_meta,\ -.ace-merbivore-soft .ace_meta.ace_tag,\ -.ace-merbivore-soft .ace_storage {\ -color: #FC803A\ -}\ -.ace-merbivore-soft .ace_constant,\ -.ace-merbivore-soft .ace_constant.ace_character,\ -.ace-merbivore-soft .ace_constant.ace_character.ace_escape,\ -.ace-merbivore-soft .ace_constant.ace_other,\ -.ace-merbivore-soft .ace_support.ace_type {\ -color: #68C1D8\ -}\ -.ace-merbivore-soft .ace_constant.ace_character.ace_escape {\ -color: #B3E5B4\ -}\ -.ace-merbivore-soft .ace_constant.ace_language {\ -color: #E1C582\ -}\ -.ace-merbivore-soft .ace_constant.ace_library,\ -.ace-merbivore-soft .ace_string,\ -.ace-merbivore-soft .ace_support.ace_constant {\ -color: #8EC65F\ -}\ -.ace-merbivore-soft .ace_constant.ace_numeric {\ -color: #7FC578\ -}\ -.ace-merbivore-soft .ace_invalid,\ -.ace-merbivore-soft .ace_invalid.ace_deprecated {\ -color: #FFFFFF;\ -background-color: #FE3838\ -}\ -.ace-merbivore-soft .ace_fold {\ -background-color: #FC803A;\ -border-color: #E6E1DC\ -}\ -.ace-merbivore-soft .ace_comment,\ -.ace-merbivore-soft .ace_meta {\ -font-style: italic;\ -color: #AC4BB8\ -}\ -.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {\ -color: #EAF1A3\ -}\ -.ace-merbivore-soft .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkpLyZfD09PwPAAfYAnaStpHRAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-mono_industrial.js b/util/build-sample-browser/player/vendor/ace/theme-mono_industrial.js deleted file mode 100644 index fcc84de115..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-mono_industrial.js +++ /dev/null @@ -1,138 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/mono_industrial', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-mono-industrial"; -exports.cssText = ".ace-mono-industrial .ace_gutter {\ -background: #1d2521;\ -color: #C5C9C9\ -}\ -.ace-mono-industrial .ace_print-margin {\ -width: 1px;\ -background: #555651\ -}\ -.ace-mono-industrial {\ -background-color: #222C28;\ -color: #FFFFFF\ -}\ -.ace-mono-industrial .ace_cursor {\ -color: #FFFFFF\ -}\ -.ace-mono-industrial .ace_marker-layer .ace_selection {\ -background: rgba(145, 153, 148, 0.40)\ -}\ -.ace-mono-industrial.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #222C28;\ -border-radius: 2px\ -}\ -.ace-mono-industrial .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-mono-industrial .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(102, 108, 104, 0.50)\ -}\ -.ace-mono-industrial .ace_marker-layer .ace_active-line {\ -background: rgba(12, 13, 12, 0.25)\ -}\ -.ace-mono-industrial .ace_gutter-active-line {\ -background-color: rgba(12, 13, 12, 0.25)\ -}\ -.ace-mono-industrial .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgba(145, 153, 148, 0.40)\ -}\ -.ace-mono-industrial .ace_invisible {\ -color: rgba(102, 108, 104, 0.50)\ -}\ -.ace-mono-industrial .ace_string {\ -background-color: #151C19;\ -color: #FFFFFF\ -}\ -.ace-mono-industrial .ace_keyword,\ -.ace-mono-industrial .ace_meta {\ -color: #A39E64\ -}\ -.ace-mono-industrial .ace_constant,\ -.ace-mono-industrial .ace_constant.ace_character,\ -.ace-mono-industrial .ace_constant.ace_character.ace_escape,\ -.ace-mono-industrial .ace_constant.ace_numeric,\ -.ace-mono-industrial .ace_constant.ace_other {\ -color: #E98800\ -}\ -.ace-mono-industrial .ace_entity.ace_name.ace_function,\ -.ace-mono-industrial .ace_keyword.ace_operator,\ -.ace-mono-industrial .ace_variable {\ -color: #A8B3AB\ -}\ -.ace-mono-industrial .ace_invalid {\ -color: #FFFFFF;\ -background-color: rgba(153, 0, 0, 0.68)\ -}\ -.ace-mono-industrial .ace_support.ace_constant {\ -color: #C87500\ -}\ -.ace-mono-industrial .ace_fold {\ -background-color: #A8B3AB;\ -border-color: #FFFFFF\ -}\ -.ace-mono-industrial .ace_support.ace_function {\ -color: #588E60\ -}\ -.ace-mono-industrial .ace_entity.ace_name,\ -.ace-mono-industrial .ace_support.ace_class,\ -.ace-mono-industrial .ace_support.ace_type {\ -color: #5778B6\ -}\ -.ace-mono-industrial .ace_storage {\ -color: #C23B00\ -}\ -.ace-mono-industrial .ace_variable.ace_language,\ -.ace-mono-industrial .ace_variable.ace_parameter {\ -color: #648BD2\ -}\ -.ace-mono-industrial .ace_comment {\ -color: #666C68;\ -background-color: #151C19\ -}\ -.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {\ -color: #909993\ -}\ -.ace-mono-industrial .ace_entity.ace_name.ace_tag {\ -color: #A65EFF\ -}\ -.ace-mono-industrial .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-monokai.js b/util/build-sample-browser/player/vendor/ace/theme-monokai.js deleted file mode 100644 index 1166adf100..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-monokai.js +++ /dev/null @@ -1,136 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/monokai', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-monokai"; -exports.cssText = ".ace-monokai .ace_gutter {\ -background: #2F3129;\ -color: #8F908A\ -}\ -.ace-monokai .ace_print-margin {\ -width: 1px;\ -background: #555651\ -}\ -.ace-monokai {\ -background-color: #272822;\ -color: #F8F8F2\ -}\ -.ace-monokai .ace_cursor {\ -color: #F8F8F0\ -}\ -.ace-monokai .ace_marker-layer .ace_selection {\ -background: #49483E\ -}\ -.ace-monokai.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #272822;\ -border-radius: 2px\ -}\ -.ace-monokai .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-monokai .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #49483E\ -}\ -.ace-monokai .ace_marker-layer .ace_active-line {\ -background: #202020\ -}\ -.ace-monokai .ace_gutter-active-line {\ -background-color: #272727\ -}\ -.ace-monokai .ace_marker-layer .ace_selected-word {\ -border: 1px solid #49483E\ -}\ -.ace-monokai .ace_invisible {\ -color: #52524d\ -}\ -.ace-monokai .ace_entity.ace_name.ace_tag,\ -.ace-monokai .ace_keyword,\ -.ace-monokai .ace_meta.ace_tag,\ -.ace-monokai .ace_storage {\ -color: #F92672\ -}\ -.ace-monokai .ace_punctuation,\ -.ace-monokai .ace_punctuation.ace_tag {\ -color: #fff\ -}\ -.ace-monokai .ace_constant.ace_character,\ -.ace-monokai .ace_constant.ace_language,\ -.ace-monokai .ace_constant.ace_numeric,\ -.ace-monokai .ace_constant.ace_other {\ -color: #AE81FF\ -}\ -.ace-monokai .ace_invalid {\ -color: #F8F8F0;\ -background-color: #F92672\ -}\ -.ace-monokai .ace_invalid.ace_deprecated {\ -color: #F8F8F0;\ -background-color: #AE81FF\ -}\ -.ace-monokai .ace_support.ace_constant,\ -.ace-monokai .ace_support.ace_function {\ -color: #66D9EF\ -}\ -.ace-monokai .ace_fold {\ -background-color: #A6E22E;\ -border-color: #F8F8F2\ -}\ -.ace-monokai .ace_storage.ace_type,\ -.ace-monokai .ace_support.ace_class,\ -.ace-monokai .ace_support.ace_type {\ -font-style: italic;\ -color: #66D9EF\ -}\ -.ace-monokai .ace_entity.ace_name.ace_function,\ -.ace-monokai .ace_entity.ace_other,\ -.ace-monokai .ace_entity.ace_other.ace_attribute-name,\ -.ace-monokai .ace_variable {\ -color: #A6E22E\ -}\ -.ace-monokai .ace_variable.ace_parameter {\ -font-style: italic;\ -color: #FD971F\ -}\ -.ace-monokai .ace_string {\ -color: #E6DB74\ -}\ -.ace-monokai .ace_comment {\ -color: #75715E\ -}\ -.ace-monokai .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-pastel_on_dark.js b/util/build-sample-browser/player/vendor/ace/theme-pastel_on_dark.js deleted file mode 100644 index 73a871becb..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-pastel_on_dark.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/pastel_on_dark', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-pastel-on-dark"; -exports.cssText = ".ace-pastel-on-dark .ace_gutter {\ -background: #353030;\ -color: #8F938F\ -}\ -.ace-pastel-on-dark .ace_print-margin {\ -width: 1px;\ -background: #353030\ -}\ -.ace-pastel-on-dark {\ -background-color: #2C2828;\ -color: #8F938F\ -}\ -.ace-pastel-on-dark .ace_cursor {\ -color: #A7A7A7\ -}\ -.ace-pastel-on-dark .ace_marker-layer .ace_selection {\ -background: rgba(221, 240, 255, 0.20)\ -}\ -.ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #2C2828;\ -border-radius: 2px\ -}\ -.ace-pastel-on-dark .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-pastel-on-dark .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(255, 255, 255, 0.25)\ -}\ -.ace-pastel-on-dark .ace_marker-layer .ace_active-line {\ -background: rgba(255, 255, 255, 0.031)\ -}\ -.ace-pastel-on-dark .ace_gutter-active-line {\ -background-color: rgba(255, 255, 255, 0.031)\ -}\ -.ace-pastel-on-dark .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgba(221, 240, 255, 0.20)\ -}\ -.ace-pastel-on-dark .ace_invisible {\ -color: rgba(255, 255, 255, 0.25)\ -}\ -.ace-pastel-on-dark .ace_keyword,\ -.ace-pastel-on-dark .ace_meta {\ -color: #757aD8\ -}\ -.ace-pastel-on-dark .ace_constant,\ -.ace-pastel-on-dark .ace_constant.ace_character,\ -.ace-pastel-on-dark .ace_constant.ace_character.ace_escape,\ -.ace-pastel-on-dark .ace_constant.ace_other {\ -color: #4FB7C5\ -}\ -.ace-pastel-on-dark .ace_keyword.ace_operator {\ -color: #797878\ -}\ -.ace-pastel-on-dark .ace_constant.ace_character {\ -color: #AFA472\ -}\ -.ace-pastel-on-dark .ace_constant.ace_language {\ -color: #DE8E30\ -}\ -.ace-pastel-on-dark .ace_constant.ace_numeric {\ -color: #CCCCCC\ -}\ -.ace-pastel-on-dark .ace_invalid,\ -.ace-pastel-on-dark .ace_invalid.ace_illegal {\ -color: #F8F8F8;\ -background-color: rgba(86, 45, 86, 0.75)\ -}\ -.ace-pastel-on-dark .ace_invalid.ace_deprecated {\ -text-decoration: underline;\ -font-style: italic;\ -color: #D2A8A1\ -}\ -.ace-pastel-on-dark .ace_fold {\ -background-color: #757aD8;\ -border-color: #8F938F\ -}\ -.ace-pastel-on-dark .ace_support.ace_function {\ -color: #AEB2F8\ -}\ -.ace-pastel-on-dark .ace_string {\ -color: #66A968\ -}\ -.ace-pastel-on-dark .ace_string.ace_regexp {\ -color: #E9C062\ -}\ -.ace-pastel-on-dark .ace_comment {\ -color: #A6C6FF\ -}\ -.ace-pastel-on-dark .ace_variable {\ -color: #BEBF55\ -}\ -.ace-pastel-on-dark .ace_variable.ace_language {\ -color: #C1C144\ -}\ -.ace-pastel-on-dark .ace_xml-pe {\ -color: #494949\ -}\ -.ace-pastel-on-dark .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYIiPj/8PAARgAh2NTMh8AAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-solarized_dark.js b/util/build-sample-browser/player/vendor/ace/theme-solarized_dark.js deleted file mode 100644 index 693d171be1..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-solarized_dark.js +++ /dev/null @@ -1,119 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/solarized_dark', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-solarized-dark"; -exports.cssText = ".ace-solarized-dark .ace_gutter {\ -background: #01313f;\ -color: #d0edf7\ -}\ -.ace-solarized-dark .ace_print-margin {\ -width: 1px;\ -background: #33555E\ -}\ -.ace-solarized-dark {\ -background-color: #002B36;\ -color: #93A1A1\ -}\ -.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name,\ -.ace-solarized-dark .ace_storage {\ -color: #93A1A1\ -}\ -.ace-solarized-dark .ace_cursor,\ -.ace-solarized-dark .ace_string.ace_regexp {\ -color: #D30102\ -}\ -.ace-solarized-dark .ace_marker-layer .ace_active-line,\ -.ace-solarized-dark .ace_marker-layer .ace_selection {\ -background: rgba(255, 255, 255, 0.1)\ -}\ -.ace-solarized-dark.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #002B36;\ -border-radius: 2px\ -}\ -.ace-solarized-dark .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-solarized-dark .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(147, 161, 161, 0.50)\ -}\ -.ace-solarized-dark .ace_gutter-active-line {\ -background-color: #0d3440\ -}\ -.ace-solarized-dark .ace_marker-layer .ace_selected-word {\ -border: 1px solid #073642\ -}\ -.ace-solarized-dark .ace_invisible {\ -color: rgba(147, 161, 161, 0.50)\ -}\ -.ace-solarized-dark .ace_keyword,\ -.ace-solarized-dark .ace_meta,\ -.ace-solarized-dark .ace_support.ace_class,\ -.ace-solarized-dark .ace_support.ace_type {\ -color: #859900\ -}\ -.ace-solarized-dark .ace_constant.ace_character,\ -.ace-solarized-dark .ace_constant.ace_other {\ -color: #CB4B16\ -}\ -.ace-solarized-dark .ace_constant.ace_language {\ -color: #B58900\ -}\ -.ace-solarized-dark .ace_constant.ace_numeric {\ -color: #D33682\ -}\ -.ace-solarized-dark .ace_fold {\ -background-color: #268BD2;\ -border-color: #93A1A1\ -}\ -.ace-solarized-dark .ace_entity.ace_name.ace_function,\ -.ace-solarized-dark .ace_entity.ace_name.ace_tag,\ -.ace-solarized-dark .ace_support.ace_function,\ -.ace-solarized-dark .ace_variable,\ -.ace-solarized-dark .ace_variable.ace_language {\ -color: #268BD2\ -}\ -.ace-solarized-dark .ace_string {\ -color: #2AA198\ -}\ -.ace-solarized-dark .ace_comment {\ -font-style: italic;\ -color: #657B83\ -}\ -.ace-solarized-dark .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db1ZVCxc/sPAAd4AlUHlLenAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-solarized_light.js b/util/build-sample-browser/player/vendor/ace/theme-solarized_light.js deleted file mode 100644 index b27f76b41e..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-solarized_light.js +++ /dev/null @@ -1,122 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/solarized_light', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-solarized-light"; -exports.cssText = ".ace-solarized-light .ace_gutter {\ -background: #fbf1d3;\ -color: #333\ -}\ -.ace-solarized-light .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8\ -}\ -.ace-solarized-light {\ -background-color: #FDF6E3;\ -color: #586E75\ -}\ -.ace-solarized-light .ace_cursor {\ -color: #000000\ -}\ -.ace-solarized-light .ace_marker-layer .ace_selection {\ -background: rgba(7, 54, 67, 0.09)\ -}\ -.ace-solarized-light.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #FDF6E3;\ -border-radius: 2px\ -}\ -.ace-solarized-light .ace_marker-layer .ace_step {\ -background: rgb(255, 255, 0)\ -}\ -.ace-solarized-light .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(147, 161, 161, 0.50)\ -}\ -.ace-solarized-light .ace_marker-layer .ace_active-line {\ -background: #EEE8D5\ -}\ -.ace-solarized-light .ace_gutter-active-line {\ -background-color : #EDE5C1\ -}\ -.ace-solarized-light .ace_marker-layer .ace_selected-word {\ -border: 1px solid #073642\ -}\ -.ace-solarized-light .ace_invisible {\ -color: rgba(147, 161, 161, 0.50)\ -}\ -.ace-solarized-light .ace_keyword,\ -.ace-solarized-light .ace_meta,\ -.ace-solarized-light .ace_support.ace_class,\ -.ace-solarized-light .ace_support.ace_type {\ -color: #859900\ -}\ -.ace-solarized-light .ace_constant.ace_character,\ -.ace-solarized-light .ace_constant.ace_other {\ -color: #CB4B16\ -}\ -.ace-solarized-light .ace_constant.ace_language {\ -color: #B58900\ -}\ -.ace-solarized-light .ace_constant.ace_numeric {\ -color: #D33682\ -}\ -.ace-solarized-light .ace_fold {\ -background-color: #268BD2;\ -border-color: #586E75\ -}\ -.ace-solarized-light .ace_entity.ace_name.ace_function,\ -.ace-solarized-light .ace_entity.ace_name.ace_tag,\ -.ace-solarized-light .ace_support.ace_function,\ -.ace-solarized-light .ace_variable,\ -.ace-solarized-light .ace_variable.ace_language {\ -color: #268BD2\ -}\ -.ace-solarized-light .ace_storage {\ -color: #073642\ -}\ -.ace-solarized-light .ace_string {\ -color: #2AA198\ -}\ -.ace-solarized-light .ace_string.ace_regexp {\ -color: #D30102\ -}\ -.ace-solarized-light .ace_comment,\ -.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {\ -color: #93A1A1\ -}\ -.ace-solarized-light .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-terminal.js b/util/build-sample-browser/player/vendor/ace/theme-terminal.js deleted file mode 100644 index ae70fa2bd0..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-terminal.js +++ /dev/null @@ -1,145 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/terminal', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-terminal-theme"; -exports.cssText = ".ace-terminal-theme .ace_gutter {\ -background: #1a0005;\ -color: steelblue\ -}\ -.ace-terminal-theme .ace_print-margin {\ -width: 1px;\ -background: #1a1a1a\ -}\ -.ace-terminal-theme {\ -background-color: black;\ -color: #DEDEDE\ -}\ -.ace-terminal-theme .ace_cursor {\ -color: #9F9F9F\ -}\ -.ace-terminal-theme .ace_marker-layer .ace_selection {\ -background: #424242\ -}\ -.ace-terminal-theme.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px black;\ -border-radius: 2px\ -}\ -.ace-terminal-theme .ace_marker-layer .ace_step {\ -background: rgb(0, 0, 0)\ -}\ -.ace-terminal-theme .ace_marker-layer .ace_bracket {\ -background: #090;\ -}\ -.ace-terminal-theme .ace_marker-layer .ace_bracket-start {\ -background: #090;\ -}\ -.ace-terminal-theme .ace_marker-layer .ace_bracket-unmatched {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #900\ -}\ -.ace-terminal-theme .ace_marker-layer .ace_active-line {\ -background: #2A2A2A\ -}\ -.ace-terminal-theme .ace_gutter-active-line {\ -background-color: #2A112A\ -}\ -.ace-terminal-theme .ace_marker-layer .ace_selected-word {\ -border: 1px solid #424242\ -}\ -.ace-terminal-theme .ace_invisible {\ -color: #343434\ -}\ -.ace-terminal-theme .ace_keyword,\ -.ace-terminal-theme .ace_meta,\ -.ace-terminal-theme .ace_storage,\ -.ace-terminal-theme .ace_storage.ace_type,\ -.ace-terminal-theme .ace_support.ace_type {\ -color: tomato\ -}\ -.ace-terminal-theme .ace_keyword.ace_operator {\ -color: deeppink\ -}\ -.ace-terminal-theme .ace_constant.ace_character,\ -.ace-terminal-theme .ace_constant.ace_language,\ -.ace-terminal-theme .ace_constant.ace_numeric,\ -.ace-terminal-theme .ace_keyword.ace_other.ace_unit,\ -.ace-terminal-theme .ace_support.ace_constant,\ -.ace-terminal-theme .ace_variable.ace_parameter {\ -color: #E78C45\ -}\ -.ace-terminal-theme .ace_constant.ace_other {\ -color: gold\ -}\ -.ace-terminal-theme .ace_invalid {\ -color: yellow;\ -background-color: red\ -}\ -.ace-terminal-theme .ace_invalid.ace_deprecated {\ -color: #CED2CF;\ -background-color: #B798BF\ -}\ -.ace-terminal-theme .ace_fold {\ -background-color: #7AA6DA;\ -border-color: #DEDEDE\ -}\ -.ace-terminal-theme .ace_entity.ace_name.ace_function,\ -.ace-terminal-theme .ace_support.ace_function,\ -.ace-terminal-theme .ace_variable {\ -color: #7AA6DA\ -}\ -.ace-terminal-theme .ace_support.ace_class,\ -.ace-terminal-theme .ace_support.ace_type {\ -color: #E7C547\ -}\ -.ace-terminal-theme .ace_heading,\ -.ace-terminal-theme .ace_string {\ -color: #B9CA4A\ -}\ -.ace-terminal-theme .ace_entity.ace_name.ace_tag,\ -.ace-terminal-theme .ace_entity.ace_other.ace_attribute-name,\ -.ace-terminal-theme .ace_meta.ace_tag,\ -.ace-terminal-theme .ace_string.ace_regexp,\ -.ace-terminal-theme .ace_variable {\ -color: #D54E53\ -}\ -.ace-terminal-theme .ace_comment {\ -color: orangered\ -}\ -.ace-terminal-theme .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLBWV/8PAAK4AYnhiq+xAAAAAElFTkSuQmCC) right repeat-y;\ -}\ -"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-textmate.js b/util/build-sample-browser/player/vendor/ace/theme-textmate.js deleted file mode 100644 index 01f49dc3bf..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-textmate.js +++ /dev/null @@ -1,160 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/textmate', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - - -exports.isDark = false; -exports.cssClass = "ace-tm"; -exports.cssText = ".ace-tm .ace_gutter {\ -background: #f0f0f0;\ -color: #333;\ -}\ -.ace-tm .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8;\ -}\ -.ace-tm .ace_fold {\ -background-color: #6B72E6;\ -}\ -.ace-tm {\ -background-color: #FFFFFF;\ -color: black;\ -}\ -.ace-tm .ace_cursor {\ -color: black;\ -}\ -.ace-tm .ace_invisible {\ -color: rgb(191, 191, 191);\ -}\ -.ace-tm .ace_storage,\ -.ace-tm .ace_keyword {\ -color: blue;\ -}\ -.ace-tm .ace_constant {\ -color: rgb(197, 6, 11);\ -}\ -.ace-tm .ace_constant.ace_buildin {\ -color: rgb(88, 72, 246);\ -}\ -.ace-tm .ace_constant.ace_language {\ -color: rgb(88, 92, 246);\ -}\ -.ace-tm .ace_constant.ace_library {\ -color: rgb(6, 150, 14);\ -}\ -.ace-tm .ace_invalid {\ -background-color: rgba(255, 0, 0, 0.1);\ -color: red;\ -}\ -.ace-tm .ace_support.ace_function {\ -color: rgb(60, 76, 114);\ -}\ -.ace-tm .ace_support.ace_constant {\ -color: rgb(6, 150, 14);\ -}\ -.ace-tm .ace_support.ace_type,\ -.ace-tm .ace_support.ace_class {\ -color: rgb(109, 121, 222);\ -}\ -.ace-tm .ace_keyword.ace_operator {\ -color: rgb(104, 118, 135);\ -}\ -.ace-tm .ace_string {\ -color: rgb(3, 106, 7);\ -}\ -.ace-tm .ace_comment {\ -color: rgb(76, 136, 107);\ -}\ -.ace-tm .ace_comment.ace_doc {\ -color: rgb(0, 102, 255);\ -}\ -.ace-tm .ace_comment.ace_doc.ace_tag {\ -color: rgb(128, 159, 191);\ -}\ -.ace-tm .ace_constant.ace_numeric {\ -color: rgb(0, 0, 205);\ -}\ -.ace-tm .ace_variable {\ -color: rgb(49, 132, 149);\ -}\ -.ace-tm .ace_xml-pe {\ -color: rgb(104, 104, 91);\ -}\ -.ace-tm .ace_entity.ace_name.ace_function {\ -color: #0000A2;\ -}\ -.ace-tm .ace_heading {\ -color: rgb(12, 7, 255);\ -}\ -.ace-tm .ace_list {\ -color:rgb(185, 6, 144);\ -}\ -.ace-tm .ace_meta.ace_tag {\ -color:rgb(0, 22, 142);\ -}\ -.ace-tm .ace_string.ace_regex {\ -color: rgb(255, 0, 0)\ -}\ -.ace-tm .ace_marker-layer .ace_selection {\ -background: rgb(181, 213, 255);\ -}\ -.ace-tm.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px white;\ -border-radius: 2px;\ -}\ -.ace-tm .ace_marker-layer .ace_step {\ -background: rgb(252, 255, 0);\ -}\ -.ace-tm .ace_marker-layer .ace_stack {\ -background: rgb(164, 229, 101);\ -}\ -.ace-tm .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgb(192, 192, 192);\ -}\ -.ace-tm .ace_marker-layer .ace_active-line {\ -background: rgba(0, 0, 0, 0.07);\ -}\ -.ace-tm .ace_gutter-active-line {\ -background-color : #dcdcdc;\ -}\ -.ace-tm .ace_marker-layer .ace_selected-word {\ -background: rgb(250, 250, 255);\ -border: 1px solid rgb(200, 200, 250);\ -}\ -.ace-tm .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ -}\ -"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-tomorrow.js b/util/build-sample-browser/player/vendor/ace/theme-tomorrow.js deleted file mode 100644 index 32482766ce..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-tomorrow.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/tomorrow', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-tomorrow"; -exports.cssText = ".ace-tomorrow .ace_gutter {\ -background: #f6f6f6;\ -color: #4D4D4C\ -}\ -.ace-tomorrow .ace_print-margin {\ -width: 1px;\ -background: #f6f6f6\ -}\ -.ace-tomorrow {\ -background-color: #FFFFFF;\ -color: #4D4D4C\ -}\ -.ace-tomorrow .ace_cursor {\ -color: #AEAFAD\ -}\ -.ace-tomorrow .ace_marker-layer .ace_selection {\ -background: #D6D6D6\ -}\ -.ace-tomorrow.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #FFFFFF;\ -border-radius: 2px\ -}\ -.ace-tomorrow .ace_marker-layer .ace_step {\ -background: rgb(255, 255, 0)\ -}\ -.ace-tomorrow .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #D1D1D1\ -}\ -.ace-tomorrow .ace_marker-layer .ace_active-line {\ -background: #EFEFEF\ -}\ -.ace-tomorrow .ace_gutter-active-line {\ -background-color : #dcdcdc\ -}\ -.ace-tomorrow .ace_marker-layer .ace_selected-word {\ -border: 1px solid #D6D6D6\ -}\ -.ace-tomorrow .ace_invisible {\ -color: #D1D1D1\ -}\ -.ace-tomorrow .ace_keyword,\ -.ace-tomorrow .ace_meta,\ -.ace-tomorrow .ace_storage,\ -.ace-tomorrow .ace_storage.ace_type,\ -.ace-tomorrow .ace_support.ace_type {\ -color: #8959A8\ -}\ -.ace-tomorrow .ace_keyword.ace_operator {\ -color: #3E999F\ -}\ -.ace-tomorrow .ace_constant.ace_character,\ -.ace-tomorrow .ace_constant.ace_language,\ -.ace-tomorrow .ace_constant.ace_numeric,\ -.ace-tomorrow .ace_keyword.ace_other.ace_unit,\ -.ace-tomorrow .ace_support.ace_constant,\ -.ace-tomorrow .ace_variable.ace_parameter {\ -color: #F5871F\ -}\ -.ace-tomorrow .ace_constant.ace_other {\ -color: #666969\ -}\ -.ace-tomorrow .ace_invalid {\ -color: #FFFFFF;\ -background-color: #C82829\ -}\ -.ace-tomorrow .ace_invalid.ace_deprecated {\ -color: #FFFFFF;\ -background-color: #8959A8\ -}\ -.ace-tomorrow .ace_fold {\ -background-color: #4271AE;\ -border-color: #4D4D4C\ -}\ -.ace-tomorrow .ace_entity.ace_name.ace_function,\ -.ace-tomorrow .ace_support.ace_function,\ -.ace-tomorrow .ace_variable {\ -color: #4271AE\ -}\ -.ace-tomorrow .ace_support.ace_class,\ -.ace-tomorrow .ace_support.ace_type {\ -color: #C99E00\ -}\ -.ace-tomorrow .ace_heading,\ -.ace-tomorrow .ace_markup.ace_heading,\ -.ace-tomorrow .ace_string {\ -color: #718C00\ -}\ -.ace-tomorrow .ace_entity.ace_name.ace_tag,\ -.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,\ -.ace-tomorrow .ace_meta.ace_tag,\ -.ace-tomorrow .ace_string.ace_regexp,\ -.ace-tomorrow .ace_variable {\ -color: #C82829\ -}\ -.ace-tomorrow .ace_comment {\ -color: #8E908C\ -}\ -.ace-tomorrow .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night.js b/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night.js deleted file mode 100644 index b23370ffb7..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/tomorrow_night', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-tomorrow-night"; -exports.cssText = ".ace-tomorrow-night .ace_gutter {\ -background: #25282c;\ -color: #C5C8C6\ -}\ -.ace-tomorrow-night .ace_print-margin {\ -width: 1px;\ -background: #25282c\ -}\ -.ace-tomorrow-night {\ -background-color: #1D1F21;\ -color: #C5C8C6\ -}\ -.ace-tomorrow-night .ace_cursor {\ -color: #AEAFAD\ -}\ -.ace-tomorrow-night .ace_marker-layer .ace_selection {\ -background: #373B41\ -}\ -.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #1D1F21;\ -border-radius: 2px\ -}\ -.ace-tomorrow-night .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-tomorrow-night .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #4B4E55\ -}\ -.ace-tomorrow-night .ace_marker-layer .ace_active-line {\ -background: #282A2E\ -}\ -.ace-tomorrow-night .ace_gutter-active-line {\ -background-color: #282A2E\ -}\ -.ace-tomorrow-night .ace_marker-layer .ace_selected-word {\ -border: 1px solid #373B41\ -}\ -.ace-tomorrow-night .ace_invisible {\ -color: #4B4E55\ -}\ -.ace-tomorrow-night .ace_keyword,\ -.ace-tomorrow-night .ace_meta,\ -.ace-tomorrow-night .ace_storage,\ -.ace-tomorrow-night .ace_storage.ace_type,\ -.ace-tomorrow-night .ace_support.ace_type {\ -color: #B294BB\ -}\ -.ace-tomorrow-night .ace_keyword.ace_operator {\ -color: #8ABEB7\ -}\ -.ace-tomorrow-night .ace_constant.ace_character,\ -.ace-tomorrow-night .ace_constant.ace_language,\ -.ace-tomorrow-night .ace_constant.ace_numeric,\ -.ace-tomorrow-night .ace_keyword.ace_other.ace_unit,\ -.ace-tomorrow-night .ace_support.ace_constant,\ -.ace-tomorrow-night .ace_variable.ace_parameter {\ -color: #DE935F\ -}\ -.ace-tomorrow-night .ace_constant.ace_other {\ -color: #CED1CF\ -}\ -.ace-tomorrow-night .ace_invalid {\ -color: #CED2CF;\ -background-color: #DF5F5F\ -}\ -.ace-tomorrow-night .ace_invalid.ace_deprecated {\ -color: #CED2CF;\ -background-color: #B798BF\ -}\ -.ace-tomorrow-night .ace_fold {\ -background-color: #81A2BE;\ -border-color: #C5C8C6\ -}\ -.ace-tomorrow-night .ace_entity.ace_name.ace_function,\ -.ace-tomorrow-night .ace_support.ace_function,\ -.ace-tomorrow-night .ace_variable {\ -color: #81A2BE\ -}\ -.ace-tomorrow-night .ace_support.ace_class,\ -.ace-tomorrow-night .ace_support.ace_type {\ -color: #F0C674\ -}\ -.ace-tomorrow-night .ace_heading,\ -.ace-tomorrow-night .ace_markup.ace_heading,\ -.ace-tomorrow-night .ace_string {\ -color: #B5BD68\ -}\ -.ace-tomorrow-night .ace_entity.ace_name.ace_tag,\ -.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name,\ -.ace-tomorrow-night .ace_meta.ace_tag,\ -.ace-tomorrow-night .ace_string.ace_regexp,\ -.ace-tomorrow-night .ace_variable {\ -color: #CC6666\ -}\ -.ace-tomorrow-night .ace_comment {\ -color: #969896\ -}\ -.ace-tomorrow-night .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night_blue.js b/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night_blue.js deleted file mode 100644 index 6dc17e5c2a..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night_blue.js +++ /dev/null @@ -1,137 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/tomorrow_night_blue', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-tomorrow-night-blue"; -exports.cssText = ".ace-tomorrow-night-blue .ace_gutter {\ -background: #00204b;\ -color: #7388b5\ -}\ -.ace-tomorrow-night-blue .ace_print-margin {\ -width: 1px;\ -background: #00204b\ -}\ -.ace-tomorrow-night-blue {\ -background-color: #002451;\ -color: #FFFFFF\ -}\ -.ace-tomorrow-night-blue .ace_constant.ace_other,\ -.ace-tomorrow-night-blue .ace_cursor {\ -color: #FFFFFF\ -}\ -.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\ -background: #003F8E\ -}\ -.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #002451;\ -border-radius: 2px\ -}\ -.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\ -background: rgb(127, 111, 19)\ -}\ -.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #404F7D\ -}\ -.ace-tomorrow-night-blue .ace_marker-layer .ace_active-line {\ -background: #00346E\ -}\ -.ace-tomorrow-night-blue .ace_gutter-active-line {\ -background-color: #022040\ -}\ -.ace-tomorrow-night-blue .ace_marker-layer .ace_selected-word {\ -border: 1px solid #003F8E\ -}\ -.ace-tomorrow-night-blue .ace_invisible {\ -color: #404F7D\ -}\ -.ace-tomorrow-night-blue .ace_keyword,\ -.ace-tomorrow-night-blue .ace_meta,\ -.ace-tomorrow-night-blue .ace_storage,\ -.ace-tomorrow-night-blue .ace_storage.ace_type,\ -.ace-tomorrow-night-blue .ace_support.ace_type {\ -color: #EBBBFF\ -}\ -.ace-tomorrow-night-blue .ace_keyword.ace_operator {\ -color: #99FFFF\ -}\ -.ace-tomorrow-night-blue .ace_constant.ace_character,\ -.ace-tomorrow-night-blue .ace_constant.ace_language,\ -.ace-tomorrow-night-blue .ace_constant.ace_numeric,\ -.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit,\ -.ace-tomorrow-night-blue .ace_support.ace_constant,\ -.ace-tomorrow-night-blue .ace_variable.ace_parameter {\ -color: #FFC58F\ -}\ -.ace-tomorrow-night-blue .ace_invalid {\ -color: #FFFFFF;\ -background-color: #F99DA5\ -}\ -.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {\ -color: #FFFFFF;\ -background-color: #EBBBFF\ -}\ -.ace-tomorrow-night-blue .ace_fold {\ -background-color: #BBDAFF;\ -border-color: #FFFFFF\ -}\ -.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function,\ -.ace-tomorrow-night-blue .ace_support.ace_function,\ -.ace-tomorrow-night-blue .ace_variable {\ -color: #BBDAFF\ -}\ -.ace-tomorrow-night-blue .ace_support.ace_class,\ -.ace-tomorrow-night-blue .ace_support.ace_type {\ -color: #FFEEAD\ -}\ -.ace-tomorrow-night-blue .ace_heading,\ -.ace-tomorrow-night-blue .ace_markup.ace_heading,\ -.ace-tomorrow-night-blue .ace_string {\ -color: #D1F1A9\ -}\ -.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag,\ -.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name,\ -.ace-tomorrow-night-blue .ace_meta.ace_tag,\ -.ace-tomorrow-night-blue .ace_string.ace_regexp,\ -.ace-tomorrow-night-blue .ace_variable {\ -color: #FF9DA4\ -}\ -.ace-tomorrow-night-blue .ace_comment {\ -color: #7285B7\ -}\ -.ace-tomorrow-night-blue .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYJDzqfwPAANXAeNsiA+ZAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night_bright.js b/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night_bright.js deleted file mode 100644 index 7763677fb0..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night_bright.js +++ /dev/null @@ -1,152 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/tomorrow_night_bright', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-tomorrow-night-bright"; -exports.cssText = ".ace-tomorrow-night-bright .ace_gutter {\ -background: #1a1a1a;\ -color: #DEDEDE\ -}\ -.ace-tomorrow-night-bright .ace_print-margin {\ -width: 1px;\ -background: #1a1a1a\ -}\ -.ace-tomorrow-night-bright {\ -background-color: #000000;\ -color: #DEDEDE\ -}\ -.ace-tomorrow-night-bright .ace_cursor {\ -color: #9F9F9F\ -}\ -.ace-tomorrow-night-bright .ace_marker-layer .ace_selection {\ -background: #424242\ -}\ -.ace-tomorrow-night-bright.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #000000;\ -border-radius: 2px\ -}\ -.ace-tomorrow-night-bright .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #888888\ -}\ -.ace-tomorrow-night-bright .ace_marker-layer .ace_highlight {\ -border: 1px solid rgb(110, 119, 0);\ -border-bottom: 0;\ -box-shadow: inset 0 -1px rgb(110, 119, 0);\ -margin: -1px 0 0 -1px;\ -background: rgba(255, 235, 0, 0.1);\ -}\ -.ace-tomorrow-night-bright .ace_marker-layer .ace_active-line {\ -background: #2A2A2A\ -}\ -.ace-tomorrow-night-bright .ace_gutter-active-line {\ -background-color: #2A2A2A\ -}\ -.ace-tomorrow-night-bright .ace_stack {\ -background-color: rgb(66, 90, 44)\ -}\ -.ace-tomorrow-night-bright .ace_marker-layer .ace_selected-word {\ -border: 1px solid #888888\ -}\ -.ace-tomorrow-night-bright .ace_invisible {\ -color: #343434\ -}\ -.ace-tomorrow-night-bright .ace_keyword,\ -.ace-tomorrow-night-bright .ace_meta,\ -.ace-tomorrow-night-bright .ace_storage,\ -.ace-tomorrow-night-bright .ace_storage.ace_type,\ -.ace-tomorrow-night-bright .ace_support.ace_type {\ -color: #C397D8\ -}\ -.ace-tomorrow-night-bright .ace_keyword.ace_operator {\ -color: #70C0B1\ -}\ -.ace-tomorrow-night-bright .ace_constant.ace_character,\ -.ace-tomorrow-night-bright .ace_constant.ace_language,\ -.ace-tomorrow-night-bright .ace_constant.ace_numeric,\ -.ace-tomorrow-night-bright .ace_keyword.ace_other.ace_unit,\ -.ace-tomorrow-night-bright .ace_support.ace_constant,\ -.ace-tomorrow-night-bright .ace_variable.ace_parameter {\ -color: #E78C45\ -}\ -.ace-tomorrow-night-bright .ace_constant.ace_other {\ -color: #EEEEEE\ -}\ -.ace-tomorrow-night-bright .ace_invalid {\ -color: #CED2CF;\ -background-color: #DF5F5F\ -}\ -.ace-tomorrow-night-bright .ace_invalid.ace_deprecated {\ -color: #CED2CF;\ -background-color: #B798BF\ -}\ -.ace-tomorrow-night-bright .ace_fold {\ -background-color: #7AA6DA;\ -border-color: #DEDEDE\ -}\ -.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function,\ -.ace-tomorrow-night-bright .ace_support.ace_function,\ -.ace-tomorrow-night-bright .ace_variable {\ -color: #7AA6DA\ -}\ -.ace-tomorrow-night-bright .ace_support.ace_class,\ -.ace-tomorrow-night-bright .ace_support.ace_type {\ -color: #E7C547\ -}\ -.ace-tomorrow-night-bright .ace_heading,\ -.ace-tomorrow-night-bright .ace_markup.ace_heading,\ -.ace-tomorrow-night-bright .ace_string {\ -color: #B9CA4A\ -}\ -.ace-tomorrow-night-bright .ace_entity.ace_name.ace_tag,\ -.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name,\ -.ace-tomorrow-night-bright .ace_meta.ace_tag,\ -.ace-tomorrow-night-bright .ace_string.ace_regexp,\ -.ace-tomorrow-night-bright .ace_variable {\ -color: #D54E53\ -}\ -.ace-tomorrow-night-bright .ace_comment {\ -color: #969896\ -}\ -.ace-tomorrow-night-bright .ace_c9searchresults.ace_keyword {\ -color: #C2C280;\ -}\ -.ace-tomorrow-night-bright .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night_eighties.js b/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night_eighties.js deleted file mode 100644 index 3146147fac..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-tomorrow_night_eighties.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/tomorrow_night_eighties', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-tomorrow-night-eighties"; -exports.cssText = ".ace-tomorrow-night-eighties .ace_gutter {\ -background: #272727;\ -color: #CCC\ -}\ -.ace-tomorrow-night-eighties .ace_print-margin {\ -width: 1px;\ -background: #272727\ -}\ -.ace-tomorrow-night-eighties {\ -background-color: #2D2D2D;\ -color: #CCCCCC\ -}\ -.ace-tomorrow-night-eighties .ace_constant.ace_other,\ -.ace-tomorrow-night-eighties .ace_cursor {\ -color: #CCCCCC\ -}\ -.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {\ -background: #515151\ -}\ -.ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #2D2D2D;\ -border-radius: 2px\ -}\ -.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #6A6A6A\ -}\ -.ace-tomorrow-night-bright .ace_stack {\ -background: rgb(66, 90, 44)\ -}\ -.ace-tomorrow-night-eighties .ace_marker-layer .ace_active-line {\ -background: #393939\ -}\ -.ace-tomorrow-night-eighties .ace_gutter-active-line {\ -background-color: #393939\ -}\ -.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected-word {\ -border: 1px solid #515151\ -}\ -.ace-tomorrow-night-eighties .ace_invisible {\ -color: #6A6A6A\ -}\ -.ace-tomorrow-night-eighties .ace_keyword,\ -.ace-tomorrow-night-eighties .ace_meta,\ -.ace-tomorrow-night-eighties .ace_storage,\ -.ace-tomorrow-night-eighties .ace_storage.ace_type,\ -.ace-tomorrow-night-eighties .ace_support.ace_type {\ -color: #CC99CC\ -}\ -.ace-tomorrow-night-eighties .ace_keyword.ace_operator {\ -color: #66CCCC\ -}\ -.ace-tomorrow-night-eighties .ace_constant.ace_character,\ -.ace-tomorrow-night-eighties .ace_constant.ace_language,\ -.ace-tomorrow-night-eighties .ace_constant.ace_numeric,\ -.ace-tomorrow-night-eighties .ace_keyword.ace_other.ace_unit,\ -.ace-tomorrow-night-eighties .ace_support.ace_constant,\ -.ace-tomorrow-night-eighties .ace_variable.ace_parameter {\ -color: #F99157\ -}\ -.ace-tomorrow-night-eighties .ace_invalid {\ -color: #CDCDCD;\ -background-color: #F2777A\ -}\ -.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated {\ -color: #CDCDCD;\ -background-color: #CC99CC\ -}\ -.ace-tomorrow-night-eighties .ace_fold {\ -background-color: #6699CC;\ -border-color: #CCCCCC\ -}\ -.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function,\ -.ace-tomorrow-night-eighties .ace_support.ace_function,\ -.ace-tomorrow-night-eighties .ace_variable {\ -color: #6699CC\ -}\ -.ace-tomorrow-night-eighties .ace_support.ace_class,\ -.ace-tomorrow-night-eighties .ace_support.ace_type {\ -color: #FFCC66\ -}\ -.ace-tomorrow-night-eighties .ace_heading,\ -.ace-tomorrow-night-eighties .ace_markup.ace_heading,\ -.ace-tomorrow-night-eighties .ace_string {\ -color: #99CC99\ -}\ -.ace-tomorrow-night-eighties .ace_comment {\ -color: #999999\ -}\ -.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_tag,\ -.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name,\ -.ace-tomorrow-night-eighties .ace_meta.ace_tag,\ -.ace-tomorrow-night-eighties .ace_variable {\ -color: #F2777A\ -}\ -.ace-tomorrow-night-eighties .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-twilight.js b/util/build-sample-browser/player/vendor/ace/theme-twilight.js deleted file mode 100644 index 59af501695..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-twilight.js +++ /dev/null @@ -1,140 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/twilight', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-twilight"; -exports.cssText = ".ace-twilight .ace_gutter {\ -background: #232323;\ -color: #E2E2E2\ -}\ -.ace-twilight .ace_print-margin {\ -width: 1px;\ -background: #232323\ -}\ -.ace-twilight {\ -background-color: #141414;\ -color: #F8F8F8\ -}\ -.ace-twilight .ace_cursor {\ -color: #A7A7A7\ -}\ -.ace-twilight .ace_marker-layer .ace_selection {\ -background: rgba(221, 240, 255, 0.20)\ -}\ -.ace-twilight.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #141414;\ -border-radius: 2px\ -}\ -.ace-twilight .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-twilight .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgba(255, 255, 255, 0.25)\ -}\ -.ace-twilight .ace_marker-layer .ace_active-line {\ -background: rgba(255, 255, 255, 0.031)\ -}\ -.ace-twilight .ace_gutter-active-line {\ -background-color: rgba(255, 255, 255, 0.031)\ -}\ -.ace-twilight .ace_marker-layer .ace_selected-word {\ -border: 1px solid rgba(221, 240, 255, 0.20)\ -}\ -.ace-twilight .ace_invisible {\ -color: rgba(255, 255, 255, 0.25)\ -}\ -.ace-twilight .ace_keyword,\ -.ace-twilight .ace_meta {\ -color: #CDA869\ -}\ -.ace-twilight .ace_constant,\ -.ace-twilight .ace_constant.ace_character,\ -.ace-twilight .ace_constant.ace_character.ace_escape,\ -.ace-twilight .ace_constant.ace_other,\ -.ace-twilight .ace_heading,\ -.ace-twilight .ace_markup.ace_heading,\ -.ace-twilight .ace_support.ace_constant {\ -color: #CF6A4C\ -}\ -.ace-twilight .ace_invalid.ace_illegal {\ -color: #F8F8F8;\ -background-color: rgba(86, 45, 86, 0.75)\ -}\ -.ace-twilight .ace_invalid.ace_deprecated {\ -text-decoration: underline;\ -font-style: italic;\ -color: #D2A8A1\ -}\ -.ace-twilight .ace_support {\ -color: #9B859D\ -}\ -.ace-twilight .ace_fold {\ -background-color: #AC885B;\ -border-color: #F8F8F8\ -}\ -.ace-twilight .ace_support.ace_function {\ -color: #DAD085\ -}\ -.ace-twilight .ace_list,\ -.ace-twilight .ace_markup.ace_list,\ -.ace-twilight .ace_storage {\ -color: #F9EE98\ -}\ -.ace-twilight .ace_entity.ace_name.ace_function,\ -.ace-twilight .ace_meta.ace_tag,\ -.ace-twilight .ace_variable {\ -color: #AC885B\ -}\ -.ace-twilight .ace_string {\ -color: #8F9D6A\ -}\ -.ace-twilight .ace_string.ace_regexp {\ -color: #E9C062\ -}\ -.ace-twilight .ace_comment {\ -font-style: italic;\ -color: #5F5A60\ -}\ -.ace-twilight .ace_variable {\ -color: #7587A6\ -}\ -.ace-twilight .ace_xml-pe {\ -color: #494949\ -}\ -.ace-twilight .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-vibrant_ink.js b/util/build-sample-browser/player/vendor/ace/theme-vibrant_ink.js deleted file mode 100644 index eb9152c8f6..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-vibrant_ink.js +++ /dev/null @@ -1,125 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/vibrant_ink', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-vibrant-ink"; -exports.cssText = ".ace-vibrant-ink .ace_gutter {\ -background: #1a1a1a;\ -color: #BEBEBE\ -}\ -.ace-vibrant-ink .ace_print-margin {\ -width: 1px;\ -background: #1a1a1a\ -}\ -.ace-vibrant-ink {\ -background-color: #0F0F0F;\ -color: #FFFFFF\ -}\ -.ace-vibrant-ink .ace_cursor {\ -color: #FFFFFF\ -}\ -.ace-vibrant-ink .ace_marker-layer .ace_selection {\ -background: #6699CC\ -}\ -.ace-vibrant-ink.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #0F0F0F;\ -border-radius: 2px\ -}\ -.ace-vibrant-ink .ace_marker-layer .ace_step {\ -background: rgb(102, 82, 0)\ -}\ -.ace-vibrant-ink .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #404040\ -}\ -.ace-vibrant-ink .ace_marker-layer .ace_active-line {\ -background: #333333\ -}\ -.ace-vibrant-ink .ace_gutter-active-line {\ -background-color: #333333\ -}\ -.ace-vibrant-ink .ace_marker-layer .ace_selected-word {\ -border: 1px solid #6699CC\ -}\ -.ace-vibrant-ink .ace_invisible {\ -color: #404040\ -}\ -.ace-vibrant-ink .ace_keyword,\ -.ace-vibrant-ink .ace_meta {\ -color: #FF6600\ -}\ -.ace-vibrant-ink .ace_constant,\ -.ace-vibrant-ink .ace_constant.ace_character,\ -.ace-vibrant-ink .ace_constant.ace_character.ace_escape,\ -.ace-vibrant-ink .ace_constant.ace_other {\ -color: #339999\ -}\ -.ace-vibrant-ink .ace_constant.ace_numeric {\ -color: #99CC99\ -}\ -.ace-vibrant-ink .ace_invalid,\ -.ace-vibrant-ink .ace_invalid.ace_deprecated {\ -color: #CCFF33;\ -background-color: #000000\ -}\ -.ace-vibrant-ink .ace_fold {\ -background-color: #FFCC00;\ -border-color: #FFFFFF\ -}\ -.ace-vibrant-ink .ace_entity.ace_name.ace_function,\ -.ace-vibrant-ink .ace_support.ace_function,\ -.ace-vibrant-ink .ace_variable {\ -color: #FFCC00\ -}\ -.ace-vibrant-ink .ace_variable.ace_parameter {\ -font-style: italic\ -}\ -.ace-vibrant-ink .ace_string {\ -color: #66FF00\ -}\ -.ace-vibrant-ink .ace_string.ace_regexp {\ -color: #44B4CC\ -}\ -.ace-vibrant-ink .ace_comment {\ -color: #9933CC\ -}\ -.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {\ -font-style: italic;\ -color: #99CC99\ -}\ -.ace-vibrant-ink .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYNDTc/oPAALPAZ7hxlbYAAAAAElFTkSuQmCC) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/theme-xcode.js b/util/build-sample-browser/player/vendor/ace/theme-xcode.js deleted file mode 100644 index d4018eaf0a..0000000000 --- a/util/build-sample-browser/player/vendor/ace/theme-xcode.js +++ /dev/null @@ -1,119 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -ace.define('ace/theme/xcode', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-xcode"; -exports.cssText = "/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */\ -.ace-xcode .ace_gutter {\ -background: #e8e8e8;\ -color: #333\ -}\ -.ace-xcode .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8\ -}\ -.ace-xcode {\ -background-color: #FFFFFF;\ -color: #000000\ -}\ -.ace-xcode .ace_cursor {\ -color: #000000\ -}\ -.ace-xcode .ace_marker-layer .ace_selection {\ -background: #B5D5FF\ -}\ -.ace-xcode.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px #FFFFFF;\ -border-radius: 2px\ -}\ -.ace-xcode .ace_marker-layer .ace_step {\ -background: rgb(198, 219, 174)\ -}\ -.ace-xcode .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid #BFBFBF\ -}\ -.ace-xcode .ace_marker-layer .ace_active-line {\ -background: rgba(0, 0, 0, 0.071)\ -}\ -.ace-xcode .ace_gutter-active-line {\ -background-color: rgba(0, 0, 0, 0.071)\ -}\ -.ace-xcode .ace_marker-layer .ace_selected-word {\ -border: 1px solid #B5D5FF\ -}\ -.ace-xcode .ace_constant.ace_language,\ -.ace-xcode .ace_keyword,\ -.ace-xcode .ace_meta,\ -.ace-xcode .ace_variable.ace_language {\ -color: #C800A4\ -}\ -.ace-xcode .ace_invisible {\ -color: #BFBFBF\ -}\ -.ace-xcode .ace_constant.ace_character,\ -.ace-xcode .ace_constant.ace_other {\ -color: #275A5E\ -}\ -.ace-xcode .ace_constant.ace_numeric {\ -color: #3A00DC\ -}\ -.ace-xcode .ace_entity.ace_other.ace_attribute-name,\ -.ace-xcode .ace_support.ace_constant,\ -.ace-xcode .ace_support.ace_function {\ -color: #450084\ -}\ -.ace-xcode .ace_fold {\ -background-color: #C800A4;\ -border-color: #000000\ -}\ -.ace-xcode .ace_entity.ace_name.ace_tag,\ -.ace-xcode .ace_support.ace_class,\ -.ace-xcode .ace_support.ace_type {\ -color: #790EAD\ -}\ -.ace-xcode .ace_storage {\ -color: #C900A4\ -}\ -.ace-xcode .ace_string {\ -color: #DF0002\ -}\ -.ace-xcode .ace_comment {\ -color: #008E00\ -}\ -.ace-xcode .ace_indent-guide {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y\ -}"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/util/build-sample-browser/player/vendor/ace/worker-coffee.js b/util/build-sample-browser/player/vendor/ace/worker-coffee.js deleted file mode 100644 index fa7e171ea7..0000000000 --- a/util/build-sample-browser/player/vendor/ace/worker-coffee.js +++ /dev/null @@ -1,7578 +0,0 @@ -"no use strict"; -;(function(window) { -if (typeof window.window != "undefined" && window.document) { - return; -} - -window.console = function() { - var msgs = Array.prototype.slice.call(arguments, 0); - postMessage({type: "log", data: msgs}); -}; -window.console.error = -window.console.warn = -window.console.log = -window.console.trace = window.console; - -window.window = window; -window.ace = window; - -window.onerror = function(message, file, line, col, err) { - console.error("Worker " + (err ? err.stack : message)); -}; - -window.normalizeModule = function(parentId, moduleName) { - if (moduleName.indexOf("!") !== -1) { - var chunks = moduleName.split("!"); - return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); - } - if (moduleName.charAt(0) == ".") { - var base = parentId.split("/").slice(0, -1).join("/"); - moduleName = (base ? base + "/" : "") + moduleName; - - while(moduleName.indexOf(".") !== -1 && previous != moduleName) { - var previous = moduleName; - moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); - } - } - - return moduleName; -}; - -window.require = function(parentId, id) { - if (!id) { - id = parentId; - parentId = null; - } - if (!id.charAt) - throw new Error("worker.js require() accepts only (parentId, id) as arguments"); - - id = window.normalizeModule(parentId, id); - - var module = window.require.modules[id]; - if (module) { - if (!module.initialized) { - module.initialized = true; - module.exports = module.factory().exports; - } - return module.exports; - } - - var chunks = id.split("/"); - if (!window.require.tlns) - return console.log("unable to load " + id); - chunks[0] = window.require.tlns[chunks[0]] || chunks[0]; - var path = chunks.join("/") + ".js"; - - window.require.id = id; - importScripts(path); - return window.require(parentId, id); -}; -window.require.modules = {}; -window.require.tlns = {}; - -window.define = function(id, deps, factory) { - if (arguments.length == 2) { - factory = deps; - if (typeof id != "string") { - deps = id; - id = window.require.id; - } - } else if (arguments.length == 1) { - factory = id; - deps = []; - id = window.require.id; - } - - if (!deps.length) - deps = ['require', 'exports', 'module']; - - if (id.indexOf("text!") === 0) - return; - - var req = function(childId) { - return window.require(id, childId); - }; - - window.require.modules[id] = { - exports: {}, - factory: function() { - var module = this; - var returnExports = factory.apply(this, deps.map(function(dep) { - switch(dep) { - case 'require': return req; - case 'exports': return module.exports; - case 'module': return module; - default: return req(dep); - } - })); - if (returnExports) - module.exports = returnExports; - return module; - } - }; -}; -window.define.amd = {}; - -window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { - require.tlns = topLevelNamespaces; -}; - -window.initSender = function initSender() { - - var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; - var oop = window.require("ace/lib/oop"); - - var Sender = function() {}; - - (function() { - - oop.implement(this, EventEmitter); - - this.callback = function(data, callbackId) { - postMessage({ - type: "call", - id: callbackId, - data: data - }); - }; - - this.emit = function(name, data) { - postMessage({ - type: "event", - name: name, - data: data - }); - }; - - }).call(Sender.prototype); - - return new Sender(); -}; - -var main = window.main = null; -var sender = window.sender = null; - -window.onmessage = function(e) { - var msg = e.data; - if (msg.command) { - if (main[msg.command]) - main[msg.command].apply(main, msg.args); - else - throw new Error("Unknown command:" + msg.command); - } - else if (msg.init) { - initBaseUrls(msg.tlns); - require("ace/lib/es5-shim"); - sender = window.sender = initSender(); - var clazz = require(msg.module)[msg.classname]; - main = window.main = new clazz(sender); - } - else if (msg.event && sender) { - sender._signal(msg.event, msg.data); - } -}; -})(this); - -ace.define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var Range = require("./range").Range; -var Anchor = require("./anchor").Anchor; - -var Document = function(text) { - this.$lines = []; - if (text.length === 0) { - this.$lines = [""]; - } else if (Array.isArray(text)) { - this._insertLines(0, text); - } else { - this.insert({row: 0, column:0}, text); - } -}; - -(function() { - - oop.implement(this, EventEmitter); - this.setValue = function(text) { - var len = this.getLength(); - this.remove(new Range(0, 0, len, this.getLine(len-1).length)); - this.insert({row: 0, column:0}, text); - }; - this.getValue = function() { - return this.getAllLines().join(this.getNewLineCharacter()); - }; - this.createAnchor = function(row, column) { - return new Anchor(this, row, column); - }; - if ("aaa".split(/a/).length === 0) - this.$split = function(text) { - return text.replace(/\r\n|\r/g, "\n").split("\n"); - }; - else - this.$split = function(text) { - return text.split(/\r\n|\r|\n/); - }; - - - this.$detectNewLine = function(text) { - var match = text.match(/^.*?(\r\n|\r|\n)/m); - this.$autoNewLine = match ? match[1] : "\n"; - this._signal("changeNewLineMode"); - }; - this.getNewLineCharacter = function() { - switch (this.$newLineMode) { - case "windows": - return "\r\n"; - case "unix": - return "\n"; - default: - return this.$autoNewLine || "\n"; - } - }; - - this.$autoNewLine = ""; - this.$newLineMode = "auto"; - this.setNewLineMode = function(newLineMode) { - if (this.$newLineMode === newLineMode) - return; - - this.$newLineMode = newLineMode; - this._signal("changeNewLineMode"); - }; - this.getNewLineMode = function() { - return this.$newLineMode; - }; - this.isNewLine = function(text) { - return (text == "\r\n" || text == "\r" || text == "\n"); - }; - this.getLine = function(row) { - return this.$lines[row] || ""; - }; - this.getLines = function(firstRow, lastRow) { - return this.$lines.slice(firstRow, lastRow + 1); - }; - this.getAllLines = function() { - return this.getLines(0, this.getLength()); - }; - this.getLength = function() { - return this.$lines.length; - }; - this.getTextRange = function(range) { - if (range.start.row == range.end.row) { - return this.getLine(range.start.row) - .substring(range.start.column, range.end.column); - } - var lines = this.getLines(range.start.row, range.end.row); - lines[0] = (lines[0] || "").substring(range.start.column); - var l = lines.length - 1; - if (range.end.row - range.start.row == l) - lines[l] = lines[l].substring(0, range.end.column); - return lines.join(this.getNewLineCharacter()); - }; - - this.$clipPosition = function(position) { - var length = this.getLength(); - if (position.row >= length) { - position.row = Math.max(0, length - 1); - position.column = this.getLine(length-1).length; - } else if (position.row < 0) - position.row = 0; - return position; - }; - this.insert = function(position, text) { - if (!text || text.length === 0) - return position; - - position = this.$clipPosition(position); - if (this.getLength() <= 1) - this.$detectNewLine(text); - - var lines = this.$split(text); - var firstLine = lines.splice(0, 1)[0]; - var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; - - position = this.insertInLine(position, firstLine); - if (lastLine !== null) { - position = this.insertNewLine(position); // terminate first line - position = this._insertLines(position.row, lines); - position = this.insertInLine(position, lastLine || ""); - } - return position; - }; - this.insertLines = function(row, lines) { - if (row >= this.getLength()) - return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); - return this._insertLines(Math.max(row, 0), lines); - }; - this._insertLines = function(row, lines) { - if (lines.length == 0) - return {row: row, column: 0}; - while (lines.length > 0xF000) { - var end = this._insertLines(row, lines.slice(0, 0xF000)); - lines = lines.slice(0xF000); - row = end.row; - } - - var args = [row, 0]; - args.push.apply(args, lines); - this.$lines.splice.apply(this.$lines, args); - - var range = new Range(row, 0, row + lines.length, 0); - var delta = { - action: "insertLines", - range: range, - lines: lines - }; - this._signal("change", { data: delta }); - return range.end; - }; - this.insertNewLine = function(position) { - position = this.$clipPosition(position); - var line = this.$lines[position.row] || ""; - - this.$lines[position.row] = line.substring(0, position.column); - this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); - - var end = { - row : position.row + 1, - column : 0 - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: this.getNewLineCharacter() - }; - this._signal("change", { data: delta }); - - return end; - }; - this.insertInLine = function(position, text) { - if (text.length == 0) - return position; - - var line = this.$lines[position.row] || ""; - - this.$lines[position.row] = line.substring(0, position.column) + text - + line.substring(position.column); - - var end = { - row : position.row, - column : position.column + text.length - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: text - }; - this._signal("change", { data: delta }); - - return end; - }; - this.remove = function(range) { - if (!(range instanceof Range)) - range = Range.fromPoints(range.start, range.end); - range.start = this.$clipPosition(range.start); - range.end = this.$clipPosition(range.end); - - if (range.isEmpty()) - return range.start; - - var firstRow = range.start.row; - var lastRow = range.end.row; - - if (range.isMultiLine()) { - var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; - var lastFullRow = lastRow - 1; - - if (range.end.column > 0) - this.removeInLine(lastRow, 0, range.end.column); - - if (lastFullRow >= firstFullRow) - this._removeLines(firstFullRow, lastFullRow); - - if (firstFullRow != firstRow) { - this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); - this.removeNewLine(range.start.row); - } - } - else { - this.removeInLine(firstRow, range.start.column, range.end.column); - } - return range.start; - }; - this.removeInLine = function(row, startColumn, endColumn) { - if (startColumn == endColumn) - return; - - var range = new Range(row, startColumn, row, endColumn); - var line = this.getLine(row); - var removed = line.substring(startColumn, endColumn); - var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); - this.$lines.splice(row, 1, newLine); - - var delta = { - action: "removeText", - range: range, - text: removed - }; - this._signal("change", { data: delta }); - return range.start; - }; - this.removeLines = function(firstRow, lastRow) { - if (firstRow < 0 || lastRow >= this.getLength()) - return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); - return this._removeLines(firstRow, lastRow); - }; - - this._removeLines = function(firstRow, lastRow) { - var range = new Range(firstRow, 0, lastRow + 1, 0); - var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); - - var delta = { - action: "removeLines", - range: range, - nl: this.getNewLineCharacter(), - lines: removed - }; - this._signal("change", { data: delta }); - return removed; - }; - this.removeNewLine = function(row) { - var firstLine = this.getLine(row); - var secondLine = this.getLine(row+1); - - var range = new Range(row, firstLine.length, row+1, 0); - var line = firstLine + secondLine; - - this.$lines.splice(row, 2, line); - - var delta = { - action: "removeText", - range: range, - text: this.getNewLineCharacter() - }; - this._signal("change", { data: delta }); - }; - this.replace = function(range, text) { - if (!(range instanceof Range)) - range = Range.fromPoints(range.start, range.end); - if (text.length == 0 && range.isEmpty()) - return range.start; - if (text == this.getTextRange(range)) - return range.end; - - this.remove(range); - if (text) { - var end = this.insert(range.start, text); - } - else { - end = range.start; - } - - return end; - }; - this.applyDeltas = function(deltas) { - for (var i=0; i=0; i--) { - var delta = deltas[i]; - - var range = Range.fromPoints(delta.range.start, delta.range.end); - - if (delta.action == "insertLines") - this._removeLines(range.start.row, range.end.row - 1); - else if (delta.action == "insertText") - this.remove(range); - else if (delta.action == "removeLines") - this._insertLines(range.start.row, delta.lines); - else if (delta.action == "removeText") - this.insert(range.start, delta.text); - } - }; - this.indexToPosition = function(index, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - for (var i = startRow || 0, l = lines.length; i < l; i++) { - index -= lines[i].length + newlineLength; - if (index < 0) - return {row: i, column: index + lines[i].length + newlineLength}; - } - return {row: l-1, column: lines[l-1].length}; - }; - this.positionToIndex = function(pos, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - var index = 0; - var row = Math.min(pos.row, lines.length); - for (var i = startRow || 0; i < row; ++i) - index += lines[i].length + newlineLength; - - return index + pos.column; - }; - -}).call(Document.prototype); - -exports.Document = Document; -}); - -ace.define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) { - - -var EventEmitter = {}; -var stopPropagation = function() { this.propagationStopped = true; }; -var preventDefault = function() { this.defaultPrevented = true; }; - -EventEmitter._emit = -EventEmitter._dispatchEvent = function(eventName, e) { - this._eventRegistry || (this._eventRegistry = {}); - this._defaultHandlers || (this._defaultHandlers = {}); - - var listeners = this._eventRegistry[eventName] || []; - var defaultHandler = this._defaultHandlers[eventName]; - if (!listeners.length && !defaultHandler) - return; - - if (typeof e != "object" || !e) - e = {}; - - if (!e.type) - e.type = eventName; - if (!e.stopPropagation) - e.stopPropagation = stopPropagation; - if (!e.preventDefault) - e.preventDefault = preventDefault; - - listeners = listeners.slice(); - for (var i=0; i [" + this.end.row + "/" + this.end.column + "]"); - }; - - this.contains = function(row, column) { - return this.compare(row, column) == 0; - }; - this.compareRange = function(range) { - var cmp, - end = range.end, - start = range.start; - - cmp = this.compare(end.row, end.column); - if (cmp == 1) { - cmp = this.compare(start.row, start.column); - if (cmp == 1) { - return 2; - } else if (cmp == 0) { - return 1; - } else { - return 0; - } - } else if (cmp == -1) { - return -2; - } else { - cmp = this.compare(start.row, start.column); - if (cmp == -1) { - return -1; - } else if (cmp == 1) { - return 42; - } else { - return 0; - } - } - }; - this.comparePoint = function(p) { - return this.compare(p.row, p.column); - }; - this.containsRange = function(range) { - return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; - }; - this.intersects = function(range) { - var cmp = this.compareRange(range); - return (cmp == -1 || cmp == 0 || cmp == 1); - }; - this.isEnd = function(row, column) { - return this.end.row == row && this.end.column == column; - }; - this.isStart = function(row, column) { - return this.start.row == row && this.start.column == column; - }; - this.setStart = function(row, column) { - if (typeof row == "object") { - this.start.column = row.column; - this.start.row = row.row; - } else { - this.start.row = row; - this.start.column = column; - } - }; - this.setEnd = function(row, column) { - if (typeof row == "object") { - this.end.column = row.column; - this.end.row = row.row; - } else { - this.end.row = row; - this.end.column = column; - } - }; - this.inside = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column) || this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - }; - this.insideStart = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column)) { - return false; - } else { - return true; - } - } - return false; - }; - this.insideEnd = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - }; - this.compare = function(row, column) { - if (!this.isMultiLine()) { - if (row === this.start.row) { - return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); - }; - } - - if (row < this.start.row) - return -1; - - if (row > this.end.row) - return 1; - - if (this.start.row === row) - return column >= this.start.column ? 0 : -1; - - if (this.end.row === row) - return column <= this.end.column ? 0 : 1; - - return 0; - }; - this.compareStart = function(row, column) { - if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - }; - this.compareEnd = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else { - return this.compare(row, column); - } - }; - this.compareInside = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - }; - this.clipRows = function(firstRow, lastRow) { - if (this.end.row > lastRow) - var end = {row: lastRow + 1, column: 0}; - else if (this.end.row < firstRow) - var end = {row: firstRow, column: 0}; - - if (this.start.row > lastRow) - var start = {row: lastRow + 1, column: 0}; - else if (this.start.row < firstRow) - var start = {row: firstRow, column: 0}; - - return Range.fromPoints(start || this.start, end || this.end); - }; - this.extend = function(row, column) { - var cmp = this.compare(row, column); - - if (cmp == 0) - return this; - else if (cmp == -1) - var start = {row: row, column: column}; - else - var end = {row: row, column: column}; - - return Range.fromPoints(start || this.start, end || this.end); - }; - - this.isEmpty = function() { - return (this.start.row === this.end.row && this.start.column === this.end.column); - }; - this.isMultiLine = function() { - return (this.start.row !== this.end.row); - }; - this.clone = function() { - return Range.fromPoints(this.start, this.end); - }; - this.collapseRows = function() { - if (this.end.column == 0) - return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) - else - return new Range(this.start.row, 0, this.end.row, 0) - }; - this.toScreenRange = function(session) { - var screenPosStart = session.documentToScreenPosition(this.start); - var screenPosEnd = session.documentToScreenPosition(this.end); - - return new Range( - screenPosStart.row, screenPosStart.column, - screenPosEnd.row, screenPosEnd.column - ); - }; - this.moveBy = function(row, column) { - this.start.row += row; - this.start.column += column; - this.end.row += row; - this.end.column += column; - }; - -}).call(Range.prototype); -Range.fromPoints = function(start, end) { - return new Range(start.row, start.column, end.row, end.column); -}; -Range.comparePoints = comparePoints; - -Range.comparePoints = function(p1, p2) { - return p1.row - p2.row || p1.column - p2.column; -}; - - -exports.Range = Range; -}); -ace.define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { - - -var Document = require("../document").Document; -var lang = require("../lib/lang"); - -var Mirror = exports.Mirror = function(sender) { - this.sender = sender; - var doc = this.doc = new Document(""); - - var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this)); - - var _self = this; - sender.on("change", function(e) { - doc.applyDeltas(e.data); - if (_self.$timeout) - return deferredUpdate.schedule(_self.$timeout); - _self.onUpdate(); - }); -}; - -(function() { - - this.$timeout = 500; - - this.setTimeout = function(timeout) { - this.$timeout = timeout; - }; - - this.setValue = function(value) { - this.doc.setValue(value); - this.deferredUpdate.schedule(this.$timeout); - }; - - this.getValue = function(callbackId) { - this.sender.callback(this.doc.getValue(), callbackId); - }; - - this.onUpdate = function() { - }; - - this.isPending = function() { - return this.deferredUpdate.isPending(); - }; - -}).call(Mirror.prototype); - -}); - -ace.define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.last = function(a) { - return a[a.length - 1]; -}; - -exports.stringReverse = function(string) { - return string.split("").reverse().join(""); -}; - -exports.stringRepeat = function (string, count) { - var result = ''; - while (count > 0) { - if (count & 1) - result += string; - - if (count >>= 1) - string += string; - } - return result; -}; - -var trimBeginRegexp = /^\s\s*/; -var trimEndRegexp = /\s\s*$/; - -exports.stringTrimLeft = function (string) { - return string.replace(trimBeginRegexp, ''); -}; - -exports.stringTrimRight = function (string) { - return string.replace(trimEndRegexp, ''); -}; - -exports.copyObject = function(obj) { - var copy = {}; - for (var key in obj) { - copy[key] = obj[key]; - } - return copy; -}; - -exports.copyArray = function(array){ - var copy = []; - for (var i=0, l=array.length; i= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) { - tag = id.toUpperCase(); - if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) { - tag = 'LEADING_WHEN'; - } else if (tag === 'FOR') { - this.seenFor = true; - } else if (tag === 'UNLESS') { - tag = 'IF'; - } else if (__indexOf.call(UNARY, tag) >= 0) { - tag = 'UNARY'; - } else if (__indexOf.call(RELATION, tag) >= 0) { - if (tag !== 'INSTANCEOF' && this.seenFor) { - tag = 'FOR' + tag; - this.seenFor = false; - } else { - tag = 'RELATION'; - if (this.value() === '!') { - poppedToken = this.tokens.pop(); - id = '!' + id; - } - } - } - } - if (__indexOf.call(JS_FORBIDDEN, id) >= 0) { - if (forcedIdentifier) { - tag = 'IDENTIFIER'; - id = new String(id); - id.reserved = true; - } else if (__indexOf.call(RESERVED, id) >= 0) { - this.error("reserved word \"" + id + "\""); - } - } - if (!forcedIdentifier) { - if (__indexOf.call(COFFEE_ALIASES, id) >= 0) { - id = COFFEE_ALIAS_MAP[id]; - } - tag = (function() { - switch (id) { - case '!': - return 'UNARY'; - case '==': - case '!=': - return 'COMPARE'; - case '&&': - case '||': - return 'LOGIC'; - case 'true': - case 'false': - return 'BOOL'; - case 'break': - case 'continue': - return 'STATEMENT'; - default: - return tag; - } - })(); - } - tagToken = this.token(tag, id, 0, idLength); - if (poppedToken) { - _ref4 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = _ref4[0], tagToken[2].first_column = _ref4[1]; - } - if (colon) { - colonOffset = input.lastIndexOf(':'); - this.token(':', ':', colonOffset, colon.length); - } - return input.length; - }; - - Lexer.prototype.numberToken = function() { - var binaryLiteral, lexedLength, match, number, octalLiteral; - if (!(match = NUMBER.exec(this.chunk))) { - return 0; - } - number = match[0]; - if (/^0[BOX]/.test(number)) { - this.error("radix prefix '" + number + "' must be lowercase"); - } else if (/E/.test(number) && !/^0x/.test(number)) { - this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'"); - } else if (/^0\d*[89]/.test(number)) { - this.error("decimal literal '" + number + "' must not be prefixed with '0'"); - } else if (/^0\d+/.test(number)) { - this.error("octal literal '" + number + "' must be prefixed with '0o'"); - } - lexedLength = number.length; - if (octalLiteral = /^0o([0-7]+)/.exec(number)) { - number = '0x' + parseInt(octalLiteral[1], 8).toString(16); - } - if (binaryLiteral = /^0b([01]+)/.exec(number)) { - number = '0x' + parseInt(binaryLiteral[1], 2).toString(16); - } - this.token('NUMBER', number, 0, lexedLength); - return lexedLength; - }; - - Lexer.prototype.stringToken = function() { - var octalEsc, quote, string, trimmed; - switch (quote = this.chunk.charAt(0)) { - case "'": - string = SIMPLESTR.exec(this.chunk)[0]; - break; - case '"': - string = this.balancedString(this.chunk, '"'); - } - if (!string) { - return 0; - } - trimmed = this.removeNewlines(string.slice(1, -1)); - if (quote === '"' && 0 < string.indexOf('#{', 1)) { - this.interpolateString(trimmed, { - strOffset: 1, - lexedLength: string.length - }); - } else { - this.token('STRING', quote + this.escapeLines(trimmed) + quote, 0, string.length); - } - if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) { - this.error("octal escape sequences " + string + " are not allowed"); - } - return string.length; - }; - - Lexer.prototype.heredocToken = function() { - var doc, heredoc, match, quote; - if (!(match = HEREDOC.exec(this.chunk))) { - return 0; - } - heredoc = match[0]; - quote = heredoc.charAt(0); - doc = this.sanitizeHeredoc(match[2], { - quote: quote, - indent: null - }); - if (quote === '"' && 0 <= doc.indexOf('#{')) { - this.interpolateString(doc, { - heredoc: true, - strOffset: 3, - lexedLength: heredoc.length - }); - } else { - this.token('STRING', this.makeString(doc, quote, true), 0, heredoc.length); - } - return heredoc.length; - }; - - Lexer.prototype.commentToken = function() { - var comment, here, match; - if (!(match = this.chunk.match(COMMENT))) { - return 0; - } - comment = match[0], here = match[1]; - if (here) { - this.token('HERECOMMENT', this.sanitizeHeredoc(here, { - herecomment: true, - indent: repeat(' ', this.indent) - }), 0, comment.length); - } - return comment.length; - }; - - Lexer.prototype.jsToken = function() { - var match, script; - if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) { - return 0; - } - this.token('JS', (script = match[0]).slice(1, -1), 0, script.length); - return script.length; - }; - - Lexer.prototype.regexToken = function() { - var flags, length, match, prev, regex, _ref2, _ref3; - if (this.chunk.charAt(0) !== '/') { - return 0; - } - if (match = HEREGEX.exec(this.chunk)) { - length = this.heregexToken(match); - return length; - } - prev = last(this.tokens); - if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) { - return 0; - } - if (!(match = REGEX.exec(this.chunk))) { - return 0; - } - _ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2]; - if (regex.slice(0, 2) === '/*') { - this.error('regular expressions cannot begin with `*`'); - } - if (regex === '//') { - regex = '/(?:)/'; - } - this.token('REGEX', "" + regex + flags, 0, match.length); - return match.length; - }; - - Lexer.prototype.heregexToken = function(match) { - var body, flags, flagsOffset, heregex, plusToken, prev, re, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4; - heregex = match[0], body = match[1], flags = match[2]; - if (0 > body.indexOf('#{')) { - re = this.escapeLines(body.replace(HEREGEX_OMIT, '$1$2').replace(/\//g, '\\/'), true); - if (re.match(/^\*/)) { - this.error('regular expressions cannot begin with `*`'); - } - this.token('REGEX', "/" + (re || '(?:)') + "/" + flags, 0, heregex.length); - return heregex.length; - } - this.token('IDENTIFIER', 'RegExp', 0, 0); - this.token('CALL_START', '(', 0, 0); - tokens = []; - _ref2 = this.interpolateString(body, { - regex: true - }); - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - token = _ref2[_i]; - tag = token[0], value = token[1]; - if (tag === 'TOKENS') { - tokens.push.apply(tokens, value); - } else if (tag === 'NEOSTRING') { - if (!(value = value.replace(HEREGEX_OMIT, '$1$2'))) { - continue; - } - value = value.replace(/\\/g, '\\\\'); - token[0] = 'STRING'; - token[1] = this.makeString(value, '"', true); - tokens.push(token); - } else { - this.error("Unexpected " + tag); - } - prev = last(this.tokens); - plusToken = ['+', '+']; - plusToken[2] = prev[2]; - tokens.push(plusToken); - } - tokens.pop(); - if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') { - this.token('STRING', '""', 0, 0); - this.token('+', '+', 0, 0); - } - (_ref4 = this.tokens).push.apply(_ref4, tokens); - if (flags) { - flagsOffset = heregex.lastIndexOf(flags); - this.token(',', ',', flagsOffset, 0); - this.token('STRING', '"' + flags + '"', flagsOffset, flags.length); - } - this.token(')', ')', heregex.length - 1, 0); - return heregex.length; - }; - - Lexer.prototype.lineToken = function() { - var diff, indent, match, noNewlines, size; - if (!(match = MULTI_DENT.exec(this.chunk))) { - return 0; - } - indent = match[0]; - this.seenFor = false; - size = indent.length - 1 - indent.lastIndexOf('\n'); - noNewlines = this.unfinished(); - if (size - this.indebt === this.indent) { - if (noNewlines) { - this.suppressNewlines(); - } else { - this.newlineToken(0); - } - return indent.length; - } - if (size > this.indent) { - if (noNewlines) { - this.indebt = size - this.indent; - this.suppressNewlines(); - return indent.length; - } - if (!this.tokens.length) { - this.baseIndent = this.indent = size; - return indent.length; - } - diff = size - this.indent + this.outdebt; - this.token('INDENT', diff, indent.length - size, size); - this.indents.push(diff); - this.ends.push('OUTDENT'); - this.outdebt = this.indebt = 0; - } else if (size < this.baseIndent) { - this.error('missing indentation', indent.length); - } else { - this.indebt = 0; - this.outdentToken(this.indent - size, noNewlines, indent.length); - } - this.indent = size; - return indent.length; - }; - - Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) { - var dent, len; - while (moveOut > 0) { - len = this.indents.length - 1; - if (this.indents[len] === void 0) { - moveOut = 0; - } else if (this.indents[len] === this.outdebt) { - moveOut -= this.outdebt; - this.outdebt = 0; - } else if (this.indents[len] < this.outdebt) { - this.outdebt -= this.indents[len]; - moveOut -= this.indents[len]; - } else { - dent = this.indents.pop() + this.outdebt; - moveOut -= dent; - this.outdebt = 0; - this.pair('OUTDENT'); - this.token('OUTDENT', dent, 0, outdentLength); - } - } - if (dent) { - this.outdebt -= moveOut; - } - while (this.value() === ';') { - this.tokens.pop(); - } - if (!(this.tag() === 'TERMINATOR' || noNewlines)) { - this.token('TERMINATOR', '\n', outdentLength, 0); - } - return this; - }; - - Lexer.prototype.whitespaceToken = function() { - var match, nline, prev; - if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) { - return 0; - } - prev = last(this.tokens); - if (prev) { - prev[match ? 'spaced' : 'newLine'] = true; - } - if (match) { - return match[0].length; - } else { - return 0; - } - }; - - Lexer.prototype.newlineToken = function(offset) { - while (this.value() === ';') { - this.tokens.pop(); - } - if (this.tag() !== 'TERMINATOR') { - this.token('TERMINATOR', '\n', offset, 0); - } - return this; - }; - - Lexer.prototype.suppressNewlines = function() { - if (this.value() === '\\') { - this.tokens.pop(); - } - return this; - }; - - Lexer.prototype.literalToken = function() { - var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5; - if (match = OPERATOR.exec(this.chunk)) { - value = match[0]; - if (CODE.test(value)) { - this.tagParameters(); - } - } else { - value = this.chunk.charAt(0); - } - tag = value; - prev = last(this.tokens); - if (value === '=' && prev) { - if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) { - this.error("reserved word \"" + (this.value()) + "\" can't be assigned"); - } - if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') { - prev[0] = 'COMPOUND_ASSIGN'; - prev[1] += '='; - return value.length; - } - } - if (value === ';') { - this.seenFor = false; - tag = 'TERMINATOR'; - } else if (__indexOf.call(MATH, value) >= 0) { - tag = 'MATH'; - } else if (__indexOf.call(COMPARE, value) >= 0) { - tag = 'COMPARE'; - } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) { - tag = 'COMPOUND_ASSIGN'; - } else if (__indexOf.call(UNARY, value) >= 0) { - tag = 'UNARY'; - } else if (__indexOf.call(SHIFT, value) >= 0) { - tag = 'SHIFT'; - } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) { - tag = 'LOGIC'; - } else if (prev && !prev.spaced) { - if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) { - if (prev[0] === '?') { - prev[0] = 'FUNC_EXIST'; - } - tag = 'CALL_START'; - } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) { - tag = 'INDEX_START'; - switch (prev[0]) { - case '?': - prev[0] = 'INDEX_SOAK'; - } - } - } - switch (value) { - case '(': - case '{': - case '[': - this.ends.push(INVERSES[value]); - break; - case ')': - case '}': - case ']': - this.pair(value); - } - this.token(tag, value); - return value.length; - }; - - Lexer.prototype.sanitizeHeredoc = function(doc, options) { - var attempt, herecomment, indent, match, _ref2; - indent = options.indent, herecomment = options.herecomment; - if (herecomment) { - if (HEREDOC_ILLEGAL.test(doc)) { - this.error("block comment cannot contain \"*/\", starting"); - } - if (doc.indexOf('\n') < 0) { - return doc; - } - } else { - while (match = HEREDOC_INDENT.exec(doc)) { - attempt = match[1]; - if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) { - indent = attempt; - } - } - } - if (indent) { - doc = doc.replace(RegExp("\\n" + indent, "g"), '\n'); - } - if (!herecomment) { - doc = doc.replace(/^\n/, ''); - } - return doc; - }; - - Lexer.prototype.tagParameters = function() { - var i, stack, tok, tokens; - if (this.tag() !== ')') { - return this; - } - stack = []; - tokens = this.tokens; - i = tokens.length; - tokens[--i][0] = 'PARAM_END'; - while (tok = tokens[--i]) { - switch (tok[0]) { - case ')': - stack.push(tok); - break; - case '(': - case 'CALL_START': - if (stack.length) { - stack.pop(); - } else if (tok[0] === '(') { - tok[0] = 'PARAM_START'; - return this; - } else { - return this; - } - } - } - return this; - }; - - Lexer.prototype.closeIndentation = function() { - return this.outdentToken(this.indent); - }; - - Lexer.prototype.balancedString = function(str, end) { - var continueCount, i, letter, match, prev, stack, _i, _ref2; - continueCount = 0; - stack = [end]; - for (i = _i = 1, _ref2 = str.length; 1 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 1 <= _ref2 ? ++_i : --_i) { - if (continueCount) { - --continueCount; - continue; - } - switch (letter = str.charAt(i)) { - case '\\': - ++continueCount; - continue; - case end: - stack.pop(); - if (!stack.length) { - return str.slice(0, +i + 1 || 9e9); - } - end = stack[stack.length - 1]; - continue; - } - if (end === '}' && (letter === '"' || letter === "'")) { - stack.push(end = letter); - } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) { - continueCount += match[0].length - 1; - } else if (end === '}' && letter === '{') { - stack.push(end = '}'); - } else if (end === '"' && prev === '#' && letter === '{') { - stack.push(end = '}'); - } - prev = letter; - } - return this.error("missing " + (stack.pop()) + ", starting"); - }; - - Lexer.prototype.interpolateString = function(str, options) { - var column, expr, heredoc, i, inner, interpolated, len, letter, lexedLength, line, locationToken, nested, offsetInChunk, pi, plusToken, popped, regex, rparen, strOffset, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4; - if (options == null) { - options = {}; - } - heredoc = options.heredoc, regex = options.regex, offsetInChunk = options.offsetInChunk, strOffset = options.strOffset, lexedLength = options.lexedLength; - offsetInChunk = offsetInChunk || 0; - strOffset = strOffset || 0; - lexedLength = lexedLength || str.length; - tokens = []; - pi = 0; - i = -1; - while (letter = str.charAt(i += 1)) { - if (letter === '\\') { - i += 1; - continue; - } - if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) { - continue; - } - if (pi < i) { - tokens.push(this.makeToken('NEOSTRING', str.slice(pi, i), strOffset + pi)); - } - inner = expr.slice(1, -1); - if (inner.length) { - _ref2 = this.getLineAndColumnFromChunk(strOffset + i + 1), line = _ref2[0], column = _ref2[1]; - nested = new Lexer().tokenize(inner, { - line: line, - column: column, - rewrite: false - }); - popped = nested.pop(); - if (((_ref3 = nested[0]) != null ? _ref3[0] : void 0) === 'TERMINATOR') { - popped = nested.shift(); - } - if (len = nested.length) { - if (len > 1) { - nested.unshift(this.makeToken('(', '(', strOffset + i + 1, 0)); - nested.push(this.makeToken(')', ')', strOffset + i + 1 + inner.length, 0)); - } - tokens.push(['TOKENS', nested]); - } - } - i += expr.length; - pi = i + 1; - } - if ((i > pi && pi < str.length)) { - tokens.push(this.makeToken('NEOSTRING', str.slice(pi), strOffset + pi)); - } - if (regex) { - return tokens; - } - if (!tokens.length) { - return this.token('STRING', '""', offsetInChunk, lexedLength); - } - if (tokens[0][0] !== 'NEOSTRING') { - tokens.unshift(this.makeToken('NEOSTRING', '', offsetInChunk)); - } - if (interpolated = tokens.length > 1) { - this.token('(', '(', offsetInChunk, 0); - } - for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) { - token = tokens[i]; - tag = token[0], value = token[1]; - if (i) { - if (i) { - plusToken = this.token('+', '+'); - } - locationToken = tag === 'TOKENS' ? value[0] : token; - plusToken[2] = { - first_line: locationToken[2].first_line, - first_column: locationToken[2].first_column, - last_line: locationToken[2].first_line, - last_column: locationToken[2].first_column - }; - } - if (tag === 'TOKENS') { - (_ref4 = this.tokens).push.apply(_ref4, value); - } else if (tag === 'NEOSTRING') { - token[0] = 'STRING'; - token[1] = this.makeString(value, '"', heredoc); - this.tokens.push(token); - } else { - this.error("Unexpected " + tag); - } - } - if (interpolated) { - rparen = this.makeToken(')', ')', offsetInChunk + lexedLength, 0); - rparen.stringEnd = true; - this.tokens.push(rparen); - } - return tokens; - }; - - Lexer.prototype.pair = function(tag) { - var size, wanted; - if (tag !== (wanted = last(this.ends))) { - if ('OUTDENT' !== wanted) { - this.error("unmatched " + tag); - } - this.indent -= size = last(this.indents); - this.outdentToken(size, true); - return this.pair(tag); - } - return this.ends.pop(); - }; - - Lexer.prototype.getLineAndColumnFromChunk = function(offset) { - var column, lineCount, lines, string; - if (offset === 0) { - return [this.chunkLine, this.chunkColumn]; - } - if (offset >= this.chunk.length) { - string = this.chunk; - } else { - string = this.chunk.slice(0, +(offset - 1) + 1 || 9e9); - } - lineCount = count(string, '\n'); - column = this.chunkColumn; - if (lineCount > 0) { - lines = string.split('\n'); - column = last(lines).length; - } else { - column += string.length; - } - return [this.chunkLine + lineCount, column]; - }; - - Lexer.prototype.makeToken = function(tag, value, offsetInChunk, length) { - var lastCharacter, locationData, token, _ref2, _ref3; - if (offsetInChunk == null) { - offsetInChunk = 0; - } - if (length == null) { - length = value.length; - } - locationData = {}; - _ref2 = this.getLineAndColumnFromChunk(offsetInChunk), locationData.first_line = _ref2[0], locationData.first_column = _ref2[1]; - lastCharacter = Math.max(0, length - 1); - _ref3 = this.getLineAndColumnFromChunk(offsetInChunk + lastCharacter), locationData.last_line = _ref3[0], locationData.last_column = _ref3[1]; - token = [tag, value, locationData]; - return token; - }; - - Lexer.prototype.token = function(tag, value, offsetInChunk, length) { - var token; - token = this.makeToken(tag, value, offsetInChunk, length); - this.tokens.push(token); - return token; - }; - - Lexer.prototype.tag = function(index, tag) { - var tok; - return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]); - }; - - Lexer.prototype.value = function(index, val) { - var tok; - return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]); - }; - - Lexer.prototype.unfinished = function() { - var _ref2; - return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === '?::' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS'); - }; - - Lexer.prototype.removeNewlines = function(str) { - return str.replace(/^\s*\n\s*/, '').replace(/([^\\]|\\\\)\s*\n\s*$/, '$1'); - }; - - Lexer.prototype.escapeLines = function(str, heredoc) { - str = str.replace(/\\[^\S\n]*(\n|\\)\s*/g, function(escaped, character) { - if (character === '\n') { - return ''; - } else { - return escaped; - } - }); - if (heredoc) { - return str.replace(MULTILINER, '\\n'); - } else { - return str.replace(/\s*\n\s*/g, ' '); - } - }; - - Lexer.prototype.makeString = function(body, quote, heredoc) { - if (!body) { - return quote + quote; - } - body = body.replace(RegExp("\\\\(" + quote + "|\\\\)", "g"), function(match, contents) { - if (contents === quote) { - return contents; - } else { - return match; - } - }); - body = body.replace(RegExp("" + quote, "g"), '\\$&'); - return quote + this.escapeLines(body, heredoc) + quote; - }; - - Lexer.prototype.error = function(message, offset) { - var first_column, first_line, _ref2; - if (offset == null) { - offset = 0; - } - _ref2 = this.getLineAndColumnFromChunk(offset), first_line = _ref2[0], first_column = _ref2[1]; - return throwSyntaxError(message, { - first_line: first_line, - first_column: first_column - }); - }; - - return Lexer; - - })(); - - JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super']; - - COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when']; - - COFFEE_ALIAS_MAP = { - and: '&&', - or: '||', - is: '==', - isnt: '!=', - not: '!', - yes: 'true', - no: 'false', - on: 'true', - off: 'false' - }; - - COFFEE_ALIASES = (function() { - var _results; - _results = []; - for (key in COFFEE_ALIAS_MAP) { - _results.push(key); - } - return _results; - })(); - - COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES); - - RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield']; - - STRICT_PROSCRIBED = ['arguments', 'eval']; - - JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED).concat(STRICT_PROSCRIBED); - - exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS).concat(STRICT_PROSCRIBED); - - exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED; - - BOM = 65279; - - IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/; - - NUMBER = /^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i; - - HEREDOC = /^("""|''')((?:\\[\s\S]|[^\\])*?)(?:\n[^\n\S]*)?\1/; - - OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?(\.|::)|\.{2,3})/; - - WHITESPACE = /^[^\n\S]+/; - - COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/; - - CODE = /^[-=]>/; - - MULTI_DENT = /^(?:\n[^\n\S]*)+/; - - SIMPLESTR = /^'[^\\']*(?:\\[\s\S][^\\']*)*'/; - - JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/; - - REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/; - - HEREGEX = /^\/{3}((?:\\?[\s\S])+?)\/{3}([imgy]{0,4})(?!\w)/; - - HEREGEX_OMIT = /((?:\\\\)+)|\\(\s|\/)|\s+(?:#.*)?/g; - - MULTILINER = /\n/g; - - HEREDOC_INDENT = /\n+([^\n\S]*)/g; - - HEREDOC_ILLEGAL = /\*\//; - - LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/; - - TRAILING_SPACES = /\s+$/; - - COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|=']; - - UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO']; - - LOGIC = ['&&', '||', '&', '|', '^']; - - SHIFT = ['<<', '>>', '>>>']; - - COMPARE = ['==', '!=', '<', '>', '<=', '>=']; - - MATH = ['*', '/', '%']; - - RELATION = ['IN', 'OF', 'INSTANCEOF']; - - BOOL = ['TRUE', 'FALSE']; - - NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--']; - - NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING', ']'); - - CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER']; - - INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED'); - - LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR']; - - -}); - -ace.define('ace/mode/coffee/rewriter', ['require', 'exports', 'module' ], function(require, exports, module) { - - var BALANCED_PAIRS, CALL_CLOSERS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, left, rite, _i, _len, _ref, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - __slice = [].slice; - - generate = function(tag, value) { - var tok; - tok = [tag, value]; - tok.generated = true; - return tok; - }; - - exports.Rewriter = (function() { - function Rewriter() {} - - Rewriter.prototype.rewrite = function(tokens) { - this.tokens = tokens; - this.removeLeadingNewlines(); - this.closeOpenCalls(); - this.closeOpenIndexes(); - this.normalizeLines(); - this.tagPostfixConditionals(); - this.addImplicitBracesAndParens(); - this.addLocationDataToGeneratedTokens(); - return this.tokens; - }; - - Rewriter.prototype.scanTokens = function(block) { - var i, token, tokens; - tokens = this.tokens; - i = 0; - while (token = tokens[i]) { - i += block.call(this, token, i, tokens); - } - return true; - }; - - Rewriter.prototype.detectEnd = function(i, condition, action) { - var levels, token, tokens, _ref, _ref1; - tokens = this.tokens; - levels = 0; - while (token = tokens[i]) { - if (levels === 0 && condition.call(this, token, i)) { - return action.call(this, token, i); - } - if (!token || levels < 0) { - return action.call(this, token, i - 1); - } - if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) { - levels += 1; - } else if (_ref1 = token[0], __indexOf.call(EXPRESSION_END, _ref1) >= 0) { - levels -= 1; - } - i += 1; - } - return i - 1; - }; - - Rewriter.prototype.removeLeadingNewlines = function() { - var i, tag, _i, _len, _ref; - _ref = this.tokens; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - tag = _ref[i][0]; - if (tag !== 'TERMINATOR') { - break; - } - } - if (i) { - return this.tokens.splice(0, i); - } - }; - - Rewriter.prototype.closeOpenCalls = function() { - var action, condition; - condition = function(token, i) { - var _ref; - return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')'; - }; - action = function(token, i) { - return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END'; - }; - return this.scanTokens(function(token, i) { - if (token[0] === 'CALL_START') { - this.detectEnd(i + 1, condition, action); - } - return 1; - }); - }; - - Rewriter.prototype.closeOpenIndexes = function() { - var action, condition; - condition = function(token, i) { - var _ref; - return (_ref = token[0]) === ']' || _ref === 'INDEX_END'; - }; - action = function(token, i) { - return token[0] = 'INDEX_END'; - }; - return this.scanTokens(function(token, i) { - if (token[0] === 'INDEX_START') { - this.detectEnd(i + 1, condition, action); - } - return 1; - }); - }; - - Rewriter.prototype.matchTags = function() { - var fuzz, i, j, pattern, _i, _ref, _ref1; - i = arguments[0], pattern = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - fuzz = 0; - for (j = _i = 0, _ref = pattern.length; 0 <= _ref ? _i < _ref : _i > _ref; j = 0 <= _ref ? ++_i : --_i) { - while (this.tag(i + j + fuzz) === 'HERECOMMENT') { - fuzz += 2; - } - if (pattern[j] == null) { - continue; - } - if (typeof pattern[j] === 'string') { - pattern[j] = [pattern[j]]; - } - if (_ref1 = this.tag(i + j + fuzz), __indexOf.call(pattern[j], _ref1) < 0) { - return false; - } - } - return true; - }; - - Rewriter.prototype.looksObjectish = function(j) { - return this.matchTags(j, '@', null, ':') || this.matchTags(j, null, ':'); - }; - - Rewriter.prototype.findTagsBackwards = function(i, tags) { - var backStack, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - backStack = []; - while (i >= 0 && (backStack.length || (_ref2 = this.tag(i), __indexOf.call(tags, _ref2) < 0) && ((_ref3 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref3) < 0) || this.tokens[i].generated) && (_ref4 = this.tag(i), __indexOf.call(LINEBREAKS, _ref4) < 0))) { - if (_ref = this.tag(i), __indexOf.call(EXPRESSION_END, _ref) >= 0) { - backStack.push(this.tag(i)); - } - if ((_ref1 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref1) >= 0) && backStack.length) { - backStack.pop(); - } - i -= 1; - } - return _ref5 = this.tag(i), __indexOf.call(tags, _ref5) >= 0; - }; - - Rewriter.prototype.addImplicitBracesAndParens = function() { - var stack; - stack = []; - return this.scanTokens(function(token, i, tokens) { - var endAllImplicitCalls, endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, nextTag, offset, prevTag, prevToken, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - tag = token[0]; - prevTag = (prevToken = i > 0 ? tokens[i - 1] : [])[0]; - nextTag = (i < tokens.length - 1 ? tokens[i + 1] : [])[0]; - stackTop = function() { - return stack[stack.length - 1]; - }; - startIdx = i; - forward = function(n) { - return i - startIdx + n; - }; - inImplicit = function() { - var _ref, _ref1; - return (_ref = stackTop()) != null ? (_ref1 = _ref[2]) != null ? _ref1.ours : void 0 : void 0; - }; - inImplicitCall = function() { - var _ref; - return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '('; - }; - inImplicitObject = function() { - var _ref; - return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '{'; - }; - inImplicitControl = function() { - var _ref; - return inImplicit && ((_ref = stackTop()) != null ? _ref[0] : void 0) === 'CONTROL'; - }; - startImplicitCall = function(j) { - var idx; - idx = j != null ? j : i; - stack.push([ - '(', idx, { - ours: true - } - ]); - tokens.splice(idx, 0, generate('CALL_START', '(')); - if (j == null) { - return i += 1; - } - }; - endImplicitCall = function() { - stack.pop(); - tokens.splice(i, 0, generate('CALL_END', ')')); - return i += 1; - }; - endAllImplicitCalls = function() { - while (inImplicitCall()) { - endImplicitCall(); - } - }; - startImplicitObject = function(j, startsLine) { - var idx; - if (startsLine == null) { - startsLine = true; - } - idx = j != null ? j : i; - stack.push([ - '{', idx, { - sameLine: true, - startsLine: startsLine, - ours: true - } - ]); - tokens.splice(idx, 0, generate('{', generate(new String('{')))); - if (j == null) { - return i += 1; - } - }; - endImplicitObject = function(j) { - j = j != null ? j : i; - stack.pop(); - tokens.splice(j, 0, generate('}', '}')); - return i += 1; - }; - if (inImplicitCall() && (tag === 'IF' || tag === 'TRY' || tag === 'FINALLY' || tag === 'CATCH' || tag === 'CLASS' || tag === 'SWITCH')) { - stack.push([ - 'CONTROL', i, { - ours: true - } - ]); - return forward(1); - } - if (tag === 'INDENT' && inImplicit()) { - if (prevTag !== '=>' && prevTag !== '->' && prevTag !== '[' && prevTag !== '(' && prevTag !== ',' && prevTag !== '{' && prevTag !== 'TRY' && prevTag !== 'ELSE' && prevTag !== '=') { - while (inImplicitCall()) { - endImplicitCall(); - } - } - if (inImplicitControl()) { - stack.pop(); - } - stack.push([tag, i]); - return forward(1); - } - if (__indexOf.call(EXPRESSION_START, tag) >= 0) { - stack.push([tag, i]); - return forward(1); - } - if (__indexOf.call(EXPRESSION_END, tag) >= 0) { - while (inImplicit()) { - if (inImplicitCall()) { - endImplicitCall(); - } else if (inImplicitObject()) { - endImplicitObject(); - } else { - stack.pop(); - } - } - stack.pop(); - } - if ((__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && token.spaced && !token.stringEnd || tag === '?' && i > 0 && !tokens[i - 1].spaced) && (__indexOf.call(IMPLICIT_CALL, nextTag) >= 0 || __indexOf.call(IMPLICIT_UNSPACED_CALL, nextTag) >= 0 && !((_ref = tokens[i + 1]) != null ? _ref.spaced : void 0) && !((_ref1 = tokens[i + 1]) != null ? _ref1.newLine : void 0))) { - if (tag === '?') { - tag = token[0] = 'FUNC_EXIST'; - } - startImplicitCall(i + 1); - return forward(2); - } - if (__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && this.matchTags(i + 1, 'INDENT', null, ':') && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) { - startImplicitCall(i + 1); - stack.push(['INDENT', i + 2]); - return forward(3); - } - if (tag === ':') { - if (this.tag(i - 2) === '@') { - s = i - 2; - } else { - s = i - 1; - } - while (this.tag(s - 2) === 'HERECOMMENT') { - s -= 2; - } - startsLine = s === 0 || (_ref2 = this.tag(s - 1), __indexOf.call(LINEBREAKS, _ref2) >= 0) || tokens[s - 1].newLine; - if (stackTop()) { - _ref3 = stackTop(), stackTag = _ref3[0], stackIdx = _ref3[1]; - if ((stackTag === '{' || stackTag === 'INDENT' && this.tag(stackIdx - 1) === '{') && (startsLine || this.tag(s - 1) === ',' || this.tag(s - 1) === '{')) { - return forward(1); - } - } - startImplicitObject(s, !!startsLine); - return forward(2); - } - if (inImplicitCall() && __indexOf.call(CALL_CLOSERS, tag) >= 0) { - if (prevTag === 'OUTDENT') { - endImplicitCall(); - return forward(1); - } - if (prevToken.newLine) { - endAllImplicitCalls(); - return forward(1); - } - } - if (inImplicitObject() && __indexOf.call(LINEBREAKS, tag) >= 0) { - stackTop()[2].sameLine = false; - } - if (__indexOf.call(IMPLICIT_END, tag) >= 0) { - while (inImplicit()) { - _ref4 = stackTop(), stackTag = _ref4[0], stackIdx = _ref4[1], (_ref5 = _ref4[2], sameLine = _ref5.sameLine, startsLine = _ref5.startsLine); - if (inImplicitCall() && prevTag !== ',') { - endImplicitCall(); - } else if (inImplicitObject() && sameLine && !startsLine) { - endImplicitObject(); - } else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) { - endImplicitObject(); - } else { - break; - } - } - } - if (tag === ',' && !this.looksObjectish(i + 1) && inImplicitObject() && (nextTag !== 'TERMINATOR' || !this.looksObjectish(i + 2))) { - offset = nextTag === 'OUTDENT' ? 1 : 0; - while (inImplicitObject()) { - endImplicitObject(i + offset); - } - } - return forward(1); - }); - }; - - Rewriter.prototype.addLocationDataToGeneratedTokens = function() { - return this.scanTokens(function(token, i, tokens) { - var column, line, nextLocation, prevLocation, _ref, _ref1; - if (token[2]) { - return 1; - } - if (!(token.generated || token.explicit)) { - return 1; - } - if (token[0] === '{' && (nextLocation = (_ref = tokens[i + 1]) != null ? _ref[2] : void 0)) { - line = nextLocation.first_line, column = nextLocation.first_column; - } else if (prevLocation = (_ref1 = tokens[i - 1]) != null ? _ref1[2] : void 0) { - line = prevLocation.last_line, column = prevLocation.last_column; - } else { - line = column = 0; - } - token[2] = { - first_line: line, - first_column: column, - last_line: line, - last_column: column - }; - return 1; - }); - }; - - Rewriter.prototype.normalizeLines = function() { - var action, condition, indent, outdent, starter; - starter = indent = outdent = null; - condition = function(token, i) { - var _ref, _ref1, _ref2, _ref3; - return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'TERMINATOR' && (_ref1 = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref1) >= 0)) && !(token[0] === 'ELSE' && starter !== 'THEN') && !(((_ref2 = token[0]) === 'CATCH' || _ref2 === 'FINALLY') && (starter === '->' || starter === '=>')) || (_ref3 = token[0], __indexOf.call(CALL_CLOSERS, _ref3) >= 0) && this.tokens[i - 1].newLine; - }; - action = function(token, i) { - return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent); - }; - return this.scanTokens(function(token, i, tokens) { - var j, tag, _i, _ref, _ref1, _ref2; - tag = token[0]; - if (tag === 'TERMINATOR') { - if (this.tag(i + 1) === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') { - tokens.splice.apply(tokens, [i, 1].concat(__slice.call(this.indentation()))); - return 1; - } - if (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0) { - tokens.splice(i, 1); - return 0; - } - } - if (tag === 'CATCH') { - for (j = _i = 1; _i <= 2; j = ++_i) { - if (!((_ref1 = this.tag(i + j)) === 'OUTDENT' || _ref1 === 'TERMINATOR' || _ref1 === 'FINALLY')) { - continue; - } - tokens.splice.apply(tokens, [i + j, 0].concat(__slice.call(this.indentation()))); - return 2 + j; - } - } - if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) { - starter = tag; - _ref2 = this.indentation(true), indent = _ref2[0], outdent = _ref2[1]; - if (starter === 'THEN') { - indent.fromThen = true; - } - tokens.splice(i + 1, 0, indent); - this.detectEnd(i + 2, condition, action); - if (tag === 'THEN') { - tokens.splice(i, 1); - } - return 1; - } - return 1; - }); - }; - - Rewriter.prototype.tagPostfixConditionals = function() { - var action, condition, original; - original = null; - condition = function(token, i) { - var prevTag, tag; - tag = token[0]; - prevTag = this.tokens[i - 1][0]; - return tag === 'TERMINATOR' || (tag === 'INDENT' && __indexOf.call(SINGLE_LINERS, prevTag) < 0); - }; - action = function(token, i) { - if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) { - return original[0] = 'POST_' + original[0]; - } - }; - return this.scanTokens(function(token, i) { - if (token[0] !== 'IF') { - return 1; - } - original = token; - this.detectEnd(i + 1, condition, action); - return 1; - }); - }; - - Rewriter.prototype.indentation = function(implicit) { - var indent, outdent; - if (implicit == null) { - implicit = false; - } - indent = ['INDENT', 2]; - outdent = ['OUTDENT', 2]; - if (implicit) { - indent.generated = outdent.generated = true; - } - if (!implicit) { - indent.explicit = outdent.explicit = true; - } - return [indent, outdent]; - }; - - Rewriter.prototype.generate = generate; - - Rewriter.prototype.tag = function(i) { - var _ref; - return (_ref = this.tokens[i]) != null ? _ref[0] : void 0; - }; - - return Rewriter; - - })(); - - BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']]; - - exports.INVERSES = INVERSES = {}; - - EXPRESSION_START = []; - - EXPRESSION_END = []; - - for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) { - _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1]; - EXPRESSION_START.push(INVERSES[rite] = left); - EXPRESSION_END.push(INVERSES[left] = rite); - } - - EXPRESSION_CLOSE = ['CATCH', 'THEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END); - - IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS']; - - IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', 'THROW', '@', '->', '=>', '[', '(', '{', '--', '++']; - - IMPLICIT_UNSPACED_CALL = ['+', '-']; - - IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR']; - - SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN']; - - SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN']; - - LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT']; - - CALL_CLOSERS = ['.', '?.', '::', '?::']; - - -}); - -ace.define('ace/mode/coffee/helpers', ['require', 'exports', 'module' ], function(require, exports, module) { - - var buildLocationData, extend, flatten, last, repeat, syntaxErrorToString, _ref; - - exports.starts = function(string, literal, start) { - return literal === string.substr(start, literal.length); - }; - - exports.ends = function(string, literal, back) { - var len; - len = literal.length; - return literal === string.substr(string.length - len - (back || 0), len); - }; - - exports.repeat = repeat = function(str, n) { - var res; - res = ''; - while (n > 0) { - if (n & 1) { - res += str; - } - n >>>= 1; - str += str; - } - return res; - }; - - exports.compact = function(array) { - var item, _i, _len, _results; - _results = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - item = array[_i]; - if (item) { - _results.push(item); - } - } - return _results; - }; - - exports.count = function(string, substr) { - var num, pos; - num = pos = 0; - if (!substr.length) { - return 1 / 0; - } - while (pos = 1 + string.indexOf(substr, pos)) { - num++; - } - return num; - }; - - exports.merge = function(options, overrides) { - return extend(extend({}, options), overrides); - }; - - extend = exports.extend = function(object, properties) { - var key, val; - for (key in properties) { - val = properties[key]; - object[key] = val; - } - return object; - }; - - exports.flatten = flatten = function(array) { - var element, flattened, _i, _len; - flattened = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - element = array[_i]; - if (element instanceof Array) { - flattened = flattened.concat(flatten(element)); - } else { - flattened.push(element); - } - } - return flattened; - }; - - exports.del = function(obj, key) { - var val; - val = obj[key]; - delete obj[key]; - return val; - }; - - exports.last = last = function(array, back) { - return array[array.length - (back || 0) - 1]; - }; - - exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) { - var e, _i, _len; - for (_i = 0, _len = this.length; _i < _len; _i++) { - e = this[_i]; - if (fn(e)) { - return true; - } - } - return false; - }; - - exports.invertLiterate = function(code) { - var line, lines, maybe_code; - maybe_code = true; - lines = (function() { - var _i, _len, _ref1, _results; - _ref1 = code.split('\n'); - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - line = _ref1[_i]; - if (maybe_code && /^([ ]{4}|[ ]{0,3}\t)/.test(line)) { - _results.push(line); - } else if (maybe_code = /^\s*$/.test(line)) { - _results.push(line); - } else { - _results.push('# ' + line); - } - } - return _results; - })(); - return lines.join('\n'); - }; - - buildLocationData = function(first, last) { - if (!last) { - return first; - } else { - return { - first_line: first.first_line, - first_column: first.first_column, - last_line: last.last_line, - last_column: last.last_column - }; - } - }; - - exports.addLocationDataFn = function(first, last) { - return function(obj) { - if (((typeof obj) === 'object') && (!!obj['updateLocationDataIfMissing'])) { - obj.updateLocationDataIfMissing(buildLocationData(first, last)); - } - return obj; - }; - }; - - exports.locationDataToString = function(obj) { - var locationData; - if (("2" in obj) && ("first_line" in obj[2])) { - locationData = obj[2]; - } else if ("first_line" in obj) { - locationData = obj; - } - if (locationData) { - return ("" + (locationData.first_line + 1) + ":" + (locationData.first_column + 1) + "-") + ("" + (locationData.last_line + 1) + ":" + (locationData.last_column + 1)); - } else { - return "No location data"; - } - }; - - exports.baseFileName = function(file, stripExt, useWinPathSep) { - var parts, pathSep; - if (stripExt == null) { - stripExt = false; - } - if (useWinPathSep == null) { - useWinPathSep = false; - } - pathSep = useWinPathSep ? /\\|\// : /\//; - parts = file.split(pathSep); - file = parts[parts.length - 1]; - if (!(stripExt && file.indexOf('.') >= 0)) { - return file; - } - parts = file.split('.'); - parts.pop(); - if (parts[parts.length - 1] === 'coffee' && parts.length > 1) { - parts.pop(); - } - return parts.join('.'); - }; - - exports.isCoffee = function(file) { - return /\.((lit)?coffee|coffee\.md)$/.test(file); - }; - - exports.isLiterate = function(file) { - return /\.(litcoffee|coffee\.md)$/.test(file); - }; - - exports.throwSyntaxError = function(message, location) { - var error; - if (location.last_line == null) { - location.last_line = location.first_line; - } - if (location.last_column == null) { - location.last_column = location.first_column; - } - error = new SyntaxError(message); - error.location = location; - error.toString = syntaxErrorToString; - error.stack = error.toString(); - throw error; - }; - - exports.updateSyntaxError = function(error, code, filename) { - if (error.toString === syntaxErrorToString) { - error.code || (error.code = code); - error.filename || (error.filename = filename); - error.stack = error.toString(); - } - return error; - }; - - syntaxErrorToString = function() { - var codeLine, colorize, colorsEnabled, end, filename, first_column, first_line, last_column, last_line, marker, start, _ref1, _ref2; - if (!(this.code && this.location)) { - return Error.prototype.toString.call(this); - } - _ref1 = this.location, first_line = _ref1.first_line, first_column = _ref1.first_column, last_line = _ref1.last_line, last_column = _ref1.last_column; - if (last_line == null) { - last_line = first_line; - } - if (last_column == null) { - last_column = first_column; - } - filename = this.filename || '[stdin]'; - codeLine = this.code.split('\n')[first_line]; - start = first_column; - end = first_line === last_line ? last_column + 1 : codeLine.length; - marker = repeat(' ', start) + repeat('^', end - start); - if (typeof process !== "undefined" && process !== null) { - colorsEnabled = process.stdout.isTTY && !process.env.NODE_DISABLE_COLORS; - } - if ((_ref2 = this.colorful) != null ? _ref2 : colorsEnabled) { - colorize = function(str) { - return "\x1B[1;31m" + str + "\x1B[0m"; - }; - codeLine = codeLine.slice(0, start) + colorize(codeLine.slice(start, end)) + codeLine.slice(end); - marker = colorize(marker); - } - return "" + filename + ":" + (first_line + 1) + ":" + (first_column + 1) + ": error: " + this.message + "\n" + codeLine + "\n" + marker; - }; - - -}); - -ace.define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -exports.mixin = function(obj, mixin) { - for (var key in mixin) { - obj[key] = mixin[key]; - } - return obj; -}; - -exports.implement = function(proto, mixin) { - exports.mixin(proto, mixin); -}; - -}); - -ace.define('ace/mode/coffee/parser', ['require', 'exports', 'module' ], function(require, exports, module) { - -var parser = {trace: function trace() { }, -yy: {}, -symbols_: {"error":2,"Root":3,"Body":4,"Line":5,"TERMINATOR":6,"Expression":7,"Statement":8,"Return":9,"Comment":10,"STATEMENT":11,"Value":12,"Invocation":13,"Code":14,"Operation":15,"Assign":16,"If":17,"Try":18,"While":19,"For":20,"Switch":21,"Class":22,"Throw":23,"Block":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"?::":69,"Index":70,"INDEX_START":71,"IndexValue":72,"INDEX_END":73,"INDEX_SOAK":74,"Slice":75,"{":76,"AssignList":77,"}":78,"CLASS":79,"EXTENDS":80,"OptFuncExist":81,"Arguments":82,"SUPER":83,"FUNC_EXIST":84,"CALL_START":85,"CALL_END":86,"ArgList":87,"THIS":88,"@":89,"[":90,"]":91,"RangeDots":92,"..":93,"Arg":94,"SimpleArgs":95,"TRY":96,"Catch":97,"FINALLY":98,"CATCH":99,"THROW":100,"(":101,")":102,"WhileSource":103,"WHILE":104,"WHEN":105,"UNTIL":106,"Loop":107,"LOOP":108,"ForBody":109,"FOR":110,"ForStart":111,"ForSource":112,"ForVariables":113,"OWN":114,"ForValue":115,"FORIN":116,"FOROF":117,"BY":118,"SWITCH":119,"Whens":120,"ELSE":121,"When":122,"LEADING_WHEN":123,"IfBlock":124,"IF":125,"POST_IF":126,"UNARY":127,"-":128,"+":129,"--":130,"++":131,"?":132,"MATH":133,"SHIFT":134,"COMPARE":135,"LOGIC":136,"RELATION":137,"COMPOUND_ASSIGN":138,"$accept":0,"$end":1}, -terminals_: {2:"error",6:"TERMINATOR",11:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",69:"?::",71:"INDEX_START",73:"INDEX_END",74:"INDEX_SOAK",76:"{",78:"}",79:"CLASS",80:"EXTENDS",83:"SUPER",84:"FUNC_EXIST",85:"CALL_START",86:"CALL_END",88:"THIS",89:"@",90:"[",91:"]",93:"..",96:"TRY",98:"FINALLY",99:"CATCH",100:"THROW",101:"(",102:")",104:"WHILE",105:"WHEN",106:"UNTIL",108:"LOOP",110:"FOR",114:"OWN",116:"FORIN",117:"FOROF",118:"BY",119:"SWITCH",121:"ELSE",123:"LEADING_WHEN",125:"IF",126:"POST_IF",127:"UNARY",128:"-",129:"+",130:"--",131:"++",132:"?",133:"MATH",134:"SHIFT",135:"COMPARE",136:"LOGIC",137:"RELATION",138:"COMPOUND_ASSIGN"}, -productions_: [0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[8,1],[8,1],[8,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[24,2],[24,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[16,3],[16,4],[16,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[9,2],[9,1],[10,1],[14,5],[14,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[12,1],[12,1],[12,1],[12,1],[12,1],[62,2],[62,2],[62,2],[62,2],[62,1],[62,1],[70,3],[70,2],[72,1],[72,1],[59,4],[77,0],[77,1],[77,3],[77,4],[77,6],[22,1],[22,2],[22,3],[22,4],[22,2],[22,3],[22,4],[22,5],[13,3],[13,3],[13,1],[13,2],[81,0],[81,1],[82,2],[82,4],[65,1],[65,1],[44,2],[58,2],[58,4],[92,1],[92,1],[64,5],[75,3],[75,2],[75,2],[75,1],[87,1],[87,3],[87,4],[87,4],[87,6],[94,1],[94,1],[95,1],[95,3],[18,2],[18,3],[18,4],[18,5],[97,3],[97,3],[97,2],[23,2],[63,3],[63,5],[103,2],[103,4],[103,2],[103,4],[19,2],[19,2],[19,2],[19,1],[107,2],[107,2],[20,2],[20,2],[20,2],[109,2],[109,2],[111,2],[111,3],[115,1],[115,1],[115,1],[115,1],[113,1],[113,3],[112,2],[112,2],[112,4],[112,4],[112,4],[112,6],[112,6],[21,5],[21,7],[21,4],[21,6],[120,1],[120,2],[122,3],[122,4],[124,3],[124,5],[17,1],[17,3],[17,3],[17,3],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,5],[15,4],[15,3]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { - -var $0 = $$.length - 1; -switch (yystate) { -case 1:return this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Block); -break; -case 2:return this.$ = $$[$0]; -break; -case 3:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(yy.Block.wrap([$$[$0]])); -break; -case 4:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].push($$[$0])); -break; -case 5:this.$ = $$[$0-1]; -break; -case 6:this.$ = $$[$0]; -break; -case 7:this.$ = $$[$0]; -break; -case 8:this.$ = $$[$0]; -break; -case 9:this.$ = $$[$0]; -break; -case 10:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 11:this.$ = $$[$0]; -break; -case 12:this.$ = $$[$0]; -break; -case 13:this.$ = $$[$0]; -break; -case 14:this.$ = $$[$0]; -break; -case 15:this.$ = $$[$0]; -break; -case 16:this.$ = $$[$0]; -break; -case 17:this.$ = $$[$0]; -break; -case 18:this.$ = $$[$0]; -break; -case 19:this.$ = $$[$0]; -break; -case 20:this.$ = $$[$0]; -break; -case 21:this.$ = $$[$0]; -break; -case 22:this.$ = $$[$0]; -break; -case 23:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Block); -break; -case 24:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]); -break; -case 25:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 26:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 27:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 28:this.$ = $$[$0]; -break; -case 29:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 30:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 31:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 32:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Undefined); -break; -case 33:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Null); -break; -case 34:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Bool($$[$0])); -break; -case 35:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0])); -break; -case 36:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0])); -break; -case 37:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1])); -break; -case 38:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 39:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-2])(new yy.Value($$[$0-2])), $$[$0], 'object')); -break; -case 40:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-4])(new yy.Value($$[$0-4])), $$[$0-1], 'object')); -break; -case 41:this.$ = $$[$0]; -break; -case 42:this.$ = $$[$0]; -break; -case 43:this.$ = $$[$0]; -break; -case 44:this.$ = $$[$0]; -break; -case 45:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Return($$[$0])); -break; -case 46:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Return); -break; -case 47:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Comment($$[$0])); -break; -case 48:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Code($$[$0-3], $$[$0], $$[$0-1])); -break; -case 49:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Code([], $$[$0], $$[$0-1])); -break; -case 50:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('func'); -break; -case 51:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('boundfunc'); -break; -case 52:this.$ = $$[$0]; -break; -case 53:this.$ = $$[$0]; -break; -case 54:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); -break; -case 55:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 56:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); -break; -case 57:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); -break; -case 58:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); -break; -case 59:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Param($$[$0])); -break; -case 60:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Param($$[$0-1], null, true)); -break; -case 61:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Param($$[$0-2], $$[$0])); -break; -case 62:this.$ = $$[$0]; -break; -case 63:this.$ = $$[$0]; -break; -case 64:this.$ = $$[$0]; -break; -case 65:this.$ = $$[$0]; -break; -case 66:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Splat($$[$0-1])); -break; -case 67:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 68:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].add($$[$0])); -break; -case 69:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value($$[$0-1], [].concat($$[$0]))); -break; -case 70:this.$ = $$[$0]; -break; -case 71:this.$ = $$[$0]; -break; -case 72:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 73:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 74:this.$ = $$[$0]; -break; -case 75:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 76:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 77:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 78:this.$ = $$[$0]; -break; -case 79:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0])); -break; -case 80:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0], 'soak')); -break; -case 81:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'))), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]); -break; -case 82:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'), 'soak')), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]); -break; -case 83:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Access(new yy.Literal('prototype'))); -break; -case 84:this.$ = $$[$0]; -break; -case 85:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]); -break; -case 86:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(yy.extend($$[$0], { - soak: true - })); -break; -case 87:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Index($$[$0])); -break; -case 88:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Slice($$[$0])); -break; -case 89:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Obj($$[$0-2], $$[$0-3].generated)); -break; -case 90:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); -break; -case 91:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 92:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); -break; -case 93:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); -break; -case 94:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); -break; -case 95:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Class); -break; -case 96:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class(null, null, $$[$0])); -break; -case 97:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class(null, $$[$0])); -break; -case 98:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class(null, $$[$0-1], $$[$0])); -break; -case 99:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class($$[$0])); -break; -case 100:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class($$[$0-1], null, $$[$0])); -break; -case 101:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class($$[$0-2], $$[$0])); -break; -case 102:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Class($$[$0-3], $$[$0-1], $$[$0])); -break; -case 103:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1])); -break; -case 104:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1])); -break; -case 105:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))])); -break; -case 106:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Call('super', $$[$0])); -break; -case 107:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(false); -break; -case 108:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(true); -break; -case 109:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([]); -break; -case 110:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); -break; -case 111:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); -break; -case 112:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); -break; -case 113:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('this')), [yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))], 'this')); -break; -case 114:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Arr([])); -break; -case 115:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Arr($$[$0-2])); -break; -case 116:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('inclusive'); -break; -case 117:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('exclusive'); -break; -case 118:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Range($$[$0-3], $$[$0-1], $$[$0-2])); -break; -case 119:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Range($$[$0-2], $$[$0], $$[$0-1])); -break; -case 120:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range($$[$0-1], null, $$[$0])); -break; -case 121:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range(null, $$[$0], $$[$0-1])); -break; -case 122:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Range(null, null, $$[$0])); -break; -case 123:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 124:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); -break; -case 125:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); -break; -case 126:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); -break; -case 127:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); -break; -case 128:this.$ = $$[$0]; -break; -case 129:this.$ = $$[$0]; -break; -case 130:this.$ = $$[$0]; -break; -case 131:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([].concat($$[$0-2], $$[$0])); -break; -case 132:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Try($$[$0])); -break; -case 133:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Try($$[$0-1], $$[$0][0], $$[$0][1])); -break; -case 134:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Try($$[$0-2], null, null, $$[$0])); -break; -case 135:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0])); -break; -case 136:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-1], $$[$0]]); -break; -case 137:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Value($$[$0-1])), $$[$0]]); -break; -case 138:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([null, $$[$0]]); -break; -case 139:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Throw($$[$0])); -break; -case 140:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Parens($$[$0-1])); -break; -case 141:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Parens($$[$0-2])); -break; -case 142:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0])); -break; -case 143:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], { - guard: $$[$0] - })); -break; -case 144:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0], { - invert: true - })); -break; -case 145:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], { - invert: true, - guard: $$[$0] - })); -break; -case 146:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].addBody($$[$0])); -break; -case 147:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]])))); -break; -case 148:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]])))); -break; -case 149:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])($$[$0]); -break; -case 150:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody($$[$0])); -break; -case 151:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody(yy.addLocationDataFn(_$[$0])(yy.Block.wrap([$$[$0]])))); -break; -case 152:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0])); -break; -case 153:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0])); -break; -case 154:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0], $$[$0-1])); -break; -case 155:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ - source: yy.addLocationDataFn(_$[$0])(new yy.Value($$[$0])) - }); -break; -case 156:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])((function () { - $$[$0].own = $$[$0-1].own; - $$[$0].name = $$[$0-1][0]; - $$[$0].index = $$[$0-1][1]; - return $$[$0]; - }())); -break; -case 157:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0]); -break; -case 158:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { - $$[$0].own = true; - return $$[$0]; - }())); -break; -case 159:this.$ = $$[$0]; -break; -case 160:this.$ = $$[$0]; -break; -case 161:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 162:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 163:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 164:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-2], $$[$0]]); -break; -case 165:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ - source: $$[$0] - }); -break; -case 166:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ - source: $$[$0], - object: true - }); -break; -case 167:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ - source: $$[$0-2], - guard: $$[$0] - }); -break; -case 168:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ - source: $$[$0-2], - guard: $$[$0], - object: true - }); -break; -case 169:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ - source: $$[$0-2], - step: $$[$0] - }); -break; -case 170:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ - source: $$[$0-4], - guard: $$[$0-2], - step: $$[$0] - }); -break; -case 171:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ - source: $$[$0-4], - step: $$[$0-2], - guard: $$[$0] - }); -break; -case 172:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Switch($$[$0-3], $$[$0-1])); -break; -case 173:this.$ = yy.addLocationDataFn(_$[$0-6], _$[$0])(new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1])); -break; -case 174:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Switch(null, $$[$0-1])); -break; -case 175:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])(new yy.Switch(null, $$[$0-3], $$[$0-1])); -break; -case 176:this.$ = $$[$0]; -break; -case 177:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].concat($$[$0])); -break; -case 178:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([[$$[$0-1], $$[$0]]]); -break; -case 179:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])([[$$[$0-2], $$[$0-1]]]); -break; -case 180:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], { - type: $$[$0-2] - })); -break; -case 181:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])($$[$0-4].addElse(yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], { - type: $$[$0-2] - })))); -break; -case 182:this.$ = $$[$0]; -break; -case 183:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].addElse($$[$0])); -break; -case 184:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), { - type: $$[$0-1], - statement: true - })); -break; -case 185:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), { - type: $$[$0-1], - statement: true - })); -break; -case 186:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op($$[$0-1], $$[$0])); -break; -case 187:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('-', $$[$0])); -break; -case 188:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('+', $$[$0])); -break; -case 189:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0])); -break; -case 190:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0])); -break; -case 191:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0-1], null, true)); -break; -case 192:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0-1], null, true)); -break; -case 193:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Existence($$[$0-1])); -break; -case 194:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('+', $$[$0-2], $$[$0])); -break; -case 195:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('-', $$[$0-2], $$[$0])); -break; -case 196:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); -break; -case 197:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); -break; -case 198:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); -break; -case 199:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); -break; -case 200:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { - if ($$[$0-1].charAt(0) === '!') { - return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert(); - } else { - return new yy.Op($$[$0-1], $$[$0-2], $$[$0]); - } - }())); -break; -case 201:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0], $$[$0-1])); -break; -case 202:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3])); -break; -case 203:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0], $$[$0-2])); -break; -case 204:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Extends($$[$0-2], $$[$0])); -break; -} -}, -table: [{1:[2,1],3:1,4:2,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[3]},{1:[2,2],6:[1,72]},{1:[2,3],6:[2,3],26:[2,3],102:[2,3]},{1:[2,6],6:[2,6],26:[2,6],102:[2,6],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,7],6:[2,7],26:[2,7],102:[2,7],103:85,104:[1,63],106:[1,64],109:86,110:[1,66],111:67,126:[1,84]},{1:[2,11],6:[2,11],25:[2,11],26:[2,11],49:[2,11],54:[2,11],57:[2,11],62:88,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],73:[2,11],74:[1,96],78:[2,11],81:87,84:[1,89],85:[2,107],86:[2,11],91:[2,11],93:[2,11],102:[2,11],104:[2,11],105:[2,11],106:[2,11],110:[2,11],118:[2,11],126:[2,11],128:[2,11],129:[2,11],132:[2,11],133:[2,11],134:[2,11],135:[2,11],136:[2,11],137:[2,11]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:98,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],73:[2,12],74:[1,96],78:[2,12],81:97,84:[1,89],85:[2,107],86:[2,12],91:[2,12],93:[2,12],102:[2,12],104:[2,12],105:[2,12],106:[2,12],110:[2,12],118:[2,12],126:[2,12],128:[2,12],129:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12],137:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],73:[2,13],78:[2,13],86:[2,13],91:[2,13],93:[2,13],102:[2,13],104:[2,13],105:[2,13],106:[2,13],110:[2,13],118:[2,13],126:[2,13],128:[2,13],129:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13],137:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],73:[2,14],78:[2,14],86:[2,14],91:[2,14],93:[2,14],102:[2,14],104:[2,14],105:[2,14],106:[2,14],110:[2,14],118:[2,14],126:[2,14],128:[2,14],129:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14],137:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],73:[2,15],78:[2,15],86:[2,15],91:[2,15],93:[2,15],102:[2,15],104:[2,15],105:[2,15],106:[2,15],110:[2,15],118:[2,15],126:[2,15],128:[2,15],129:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15],137:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],73:[2,16],78:[2,16],86:[2,16],91:[2,16],93:[2,16],102:[2,16],104:[2,16],105:[2,16],106:[2,16],110:[2,16],118:[2,16],126:[2,16],128:[2,16],129:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16],137:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],73:[2,17],78:[2,17],86:[2,17],91:[2,17],93:[2,17],102:[2,17],104:[2,17],105:[2,17],106:[2,17],110:[2,17],118:[2,17],126:[2,17],128:[2,17],129:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17],137:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],73:[2,18],78:[2,18],86:[2,18],91:[2,18],93:[2,18],102:[2,18],104:[2,18],105:[2,18],106:[2,18],110:[2,18],118:[2,18],126:[2,18],128:[2,18],129:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18],137:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],73:[2,19],78:[2,19],86:[2,19],91:[2,19],93:[2,19],102:[2,19],104:[2,19],105:[2,19],106:[2,19],110:[2,19],118:[2,19],126:[2,19],128:[2,19],129:[2,19],132:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19],137:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],73:[2,20],78:[2,20],86:[2,20],91:[2,20],93:[2,20],102:[2,20],104:[2,20],105:[2,20],106:[2,20],110:[2,20],118:[2,20],126:[2,20],128:[2,20],129:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20],137:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],73:[2,21],78:[2,21],86:[2,21],91:[2,21],93:[2,21],102:[2,21],104:[2,21],105:[2,21],106:[2,21],110:[2,21],118:[2,21],126:[2,21],128:[2,21],129:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21],137:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],73:[2,22],78:[2,22],86:[2,22],91:[2,22],93:[2,22],102:[2,22],104:[2,22],105:[2,22],106:[2,22],110:[2,22],118:[2,22],126:[2,22],128:[2,22],129:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22],137:[2,22]},{1:[2,8],6:[2,8],26:[2,8],102:[2,8],104:[2,8],106:[2,8],110:[2,8],126:[2,8]},{1:[2,9],6:[2,9],26:[2,9],102:[2,9],104:[2,9],106:[2,9],110:[2,9],126:[2,9]},{1:[2,10],6:[2,10],26:[2,10],102:[2,10],104:[2,10],106:[2,10],110:[2,10],126:[2,10]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[1,99],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],69:[2,74],71:[2,74],73:[2,74],74:[2,74],78:[2,74],84:[2,74],85:[2,74],86:[2,74],91:[2,74],93:[2,74],102:[2,74],104:[2,74],105:[2,74],106:[2,74],110:[2,74],118:[2,74],126:[2,74],128:[2,74],129:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74],137:[2,74]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],69:[2,75],71:[2,75],73:[2,75],74:[2,75],78:[2,75],84:[2,75],85:[2,75],86:[2,75],91:[2,75],93:[2,75],102:[2,75],104:[2,75],105:[2,75],106:[2,75],110:[2,75],118:[2,75],126:[2,75],128:[2,75],129:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75],137:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],69:[2,76],71:[2,76],73:[2,76],74:[2,76],78:[2,76],84:[2,76],85:[2,76],86:[2,76],91:[2,76],93:[2,76],102:[2,76],104:[2,76],105:[2,76],106:[2,76],110:[2,76],118:[2,76],126:[2,76],128:[2,76],129:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76],137:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],69:[2,77],71:[2,77],73:[2,77],74:[2,77],78:[2,77],84:[2,77],85:[2,77],86:[2,77],91:[2,77],93:[2,77],102:[2,77],104:[2,77],105:[2,77],106:[2,77],110:[2,77],118:[2,77],126:[2,77],128:[2,77],129:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77],137:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],69:[2,78],71:[2,78],73:[2,78],74:[2,78],78:[2,78],84:[2,78],85:[2,78],86:[2,78],91:[2,78],93:[2,78],102:[2,78],104:[2,78],105:[2,78],106:[2,78],110:[2,78],118:[2,78],126:[2,78],128:[2,78],129:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78],137:[2,78]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],69:[2,105],71:[2,105],73:[2,105],74:[2,105],78:[2,105],82:100,84:[2,105],85:[1,101],86:[2,105],91:[2,105],93:[2,105],102:[2,105],104:[2,105],105:[2,105],106:[2,105],110:[2,105],118:[2,105],126:[2,105],128:[2,105],129:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105],137:[2,105]},{6:[2,54],25:[2,54],27:105,28:[1,71],44:106,48:102,49:[2,54],54:[2,54],55:103,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{24:111,25:[1,112]},{7:113,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:115,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:116,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{12:118,13:119,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:120,44:61,58:45,59:46,61:117,63:23,64:24,65:25,76:[1,68],83:[1,26],88:[1,56],89:[1,57],90:[1,55],101:[1,54]},{12:118,13:119,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:120,44:61,58:45,59:46,61:121,63:23,64:24,65:25,76:[1,68],83:[1,26],88:[1,56],89:[1,57],90:[1,55],101:[1,54]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,71],74:[2,71],78:[2,71],80:[1,125],84:[2,71],85:[2,71],86:[2,71],91:[2,71],93:[2,71],102:[2,71],104:[2,71],105:[2,71],106:[2,71],110:[2,71],118:[2,71],126:[2,71],128:[2,71],129:[2,71],130:[1,122],131:[1,123],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71],138:[1,124]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],73:[2,182],78:[2,182],86:[2,182],91:[2,182],93:[2,182],102:[2,182],104:[2,182],105:[2,182],106:[2,182],110:[2,182],118:[2,182],121:[1,126],126:[2,182],128:[2,182],129:[2,182],132:[2,182],133:[2,182],134:[2,182],135:[2,182],136:[2,182],137:[2,182]},{24:127,25:[1,112]},{24:128,25:[1,112]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],73:[2,149],78:[2,149],86:[2,149],91:[2,149],93:[2,149],102:[2,149],104:[2,149],105:[2,149],106:[2,149],110:[2,149],118:[2,149],126:[2,149],128:[2,149],129:[2,149],132:[2,149],133:[2,149],134:[2,149],135:[2,149],136:[2,149],137:[2,149]},{24:129,25:[1,112]},{7:130,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,131],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,95],6:[2,95],12:118,13:119,24:132,25:[1,112],26:[2,95],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:120,44:61,49:[2,95],54:[2,95],57:[2,95],58:45,59:46,61:134,63:23,64:24,65:25,73:[2,95],76:[1,68],78:[2,95],80:[1,133],83:[1,26],86:[2,95],88:[1,56],89:[1,57],90:[1,55],91:[2,95],93:[2,95],101:[1,54],102:[2,95],104:[2,95],105:[2,95],106:[2,95],110:[2,95],118:[2,95],126:[2,95],128:[2,95],129:[2,95],132:[2,95],133:[2,95],134:[2,95],135:[2,95],136:[2,95],137:[2,95]},{7:135,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,46],6:[2,46],7:136,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[2,46],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],102:[2,46],103:37,104:[2,46],106:[2,46],107:38,108:[1,65],109:39,110:[2,46],111:67,119:[1,40],124:35,125:[1,62],126:[2,46],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,47],6:[2,47],25:[2,47],26:[2,47],54:[2,47],78:[2,47],102:[2,47],104:[2,47],106:[2,47],110:[2,47],126:[2,47]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,72],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,72],74:[2,72],78:[2,72],84:[2,72],85:[2,72],86:[2,72],91:[2,72],93:[2,72],102:[2,72],104:[2,72],105:[2,72],106:[2,72],110:[2,72],118:[2,72],126:[2,72],128:[2,72],129:[2,72],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[2,72]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],69:[2,73],71:[2,73],73:[2,73],74:[2,73],78:[2,73],84:[2,73],85:[2,73],86:[2,73],91:[2,73],93:[2,73],102:[2,73],104:[2,73],105:[2,73],106:[2,73],110:[2,73],118:[2,73],126:[2,73],128:[2,73],129:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73],137:[2,73]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],69:[2,28],71:[2,28],73:[2,28],74:[2,28],78:[2,28],84:[2,28],85:[2,28],86:[2,28],91:[2,28],93:[2,28],102:[2,28],104:[2,28],105:[2,28],106:[2,28],110:[2,28],118:[2,28],126:[2,28],128:[2,28],129:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28],137:[2,28]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],69:[2,29],71:[2,29],73:[2,29],74:[2,29],78:[2,29],84:[2,29],85:[2,29],86:[2,29],91:[2,29],93:[2,29],102:[2,29],104:[2,29],105:[2,29],106:[2,29],110:[2,29],118:[2,29],126:[2,29],128:[2,29],129:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29],137:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],69:[2,30],71:[2,30],73:[2,30],74:[2,30],78:[2,30],84:[2,30],85:[2,30],86:[2,30],91:[2,30],93:[2,30],102:[2,30],104:[2,30],105:[2,30],106:[2,30],110:[2,30],118:[2,30],126:[2,30],128:[2,30],129:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30],137:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],69:[2,31],71:[2,31],73:[2,31],74:[2,31],78:[2,31],84:[2,31],85:[2,31],86:[2,31],91:[2,31],93:[2,31],102:[2,31],104:[2,31],105:[2,31],106:[2,31],110:[2,31],118:[2,31],126:[2,31],128:[2,31],129:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31],137:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],69:[2,32],71:[2,32],73:[2,32],74:[2,32],78:[2,32],84:[2,32],85:[2,32],86:[2,32],91:[2,32],93:[2,32],102:[2,32],104:[2,32],105:[2,32],106:[2,32],110:[2,32],118:[2,32],126:[2,32],128:[2,32],129:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32],137:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],69:[2,33],71:[2,33],73:[2,33],74:[2,33],78:[2,33],84:[2,33],85:[2,33],86:[2,33],91:[2,33],93:[2,33],102:[2,33],104:[2,33],105:[2,33],106:[2,33],110:[2,33],118:[2,33],126:[2,33],128:[2,33],129:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33],137:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],69:[2,34],71:[2,34],73:[2,34],74:[2,34],78:[2,34],84:[2,34],85:[2,34],86:[2,34],91:[2,34],93:[2,34],102:[2,34],104:[2,34],105:[2,34],106:[2,34],110:[2,34],118:[2,34],126:[2,34],128:[2,34],129:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34],137:[2,34]},{4:137,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,138],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:139,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:141,88:[1,56],89:[1,57],90:[1,55],91:[1,140],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],69:[2,111],71:[2,111],73:[2,111],74:[2,111],78:[2,111],84:[2,111],85:[2,111],86:[2,111],91:[2,111],93:[2,111],102:[2,111],104:[2,111],105:[2,111],106:[2,111],110:[2,111],118:[2,111],126:[2,111],128:[2,111],129:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111],137:[2,111]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],27:145,28:[1,71],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],69:[2,112],71:[2,112],73:[2,112],74:[2,112],78:[2,112],84:[2,112],85:[2,112],86:[2,112],91:[2,112],93:[2,112],102:[2,112],104:[2,112],105:[2,112],106:[2,112],110:[2,112],118:[2,112],126:[2,112],128:[2,112],129:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112],137:[2,112]},{25:[2,50]},{25:[2,51]},{1:[2,67],6:[2,67],25:[2,67],26:[2,67],40:[2,67],49:[2,67],54:[2,67],57:[2,67],66:[2,67],67:[2,67],68:[2,67],69:[2,67],71:[2,67],73:[2,67],74:[2,67],78:[2,67],80:[2,67],84:[2,67],85:[2,67],86:[2,67],91:[2,67],93:[2,67],102:[2,67],104:[2,67],105:[2,67],106:[2,67],110:[2,67],118:[2,67],126:[2,67],128:[2,67],129:[2,67],130:[2,67],131:[2,67],132:[2,67],133:[2,67],134:[2,67],135:[2,67],136:[2,67],137:[2,67],138:[2,67]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],69:[2,70],71:[2,70],73:[2,70],74:[2,70],78:[2,70],80:[2,70],84:[2,70],85:[2,70],86:[2,70],91:[2,70],93:[2,70],102:[2,70],104:[2,70],105:[2,70],106:[2,70],110:[2,70],118:[2,70],126:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70],138:[2,70]},{7:146,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:147,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:148,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:150,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:149,25:[1,112],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{27:155,28:[1,71],44:156,58:157,59:158,64:151,76:[1,68],89:[1,109],90:[1,55],113:152,114:[1,153],115:154},{112:159,116:[1,160],117:[1,161]},{6:[2,90],10:165,25:[2,90],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:163,42:164,44:168,46:[1,44],54:[2,90],77:162,78:[2,90],89:[1,109]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],69:[2,26],71:[2,26],73:[2,26],74:[2,26],78:[2,26],84:[2,26],85:[2,26],86:[2,26],91:[2,26],93:[2,26],102:[2,26],104:[2,26],105:[2,26],106:[2,26],110:[2,26],118:[2,26],126:[2,26],128:[2,26],129:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],69:[2,27],71:[2,27],73:[2,27],74:[2,27],78:[2,27],84:[2,27],85:[2,27],86:[2,27],91:[2,27],93:[2,27],102:[2,27],104:[2,27],105:[2,27],106:[2,27],110:[2,27],118:[2,27],126:[2,27],128:[2,27],129:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27],137:[2,27]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],40:[2,25],43:[2,25],49:[2,25],54:[2,25],57:[2,25],66:[2,25],67:[2,25],68:[2,25],69:[2,25],71:[2,25],73:[2,25],74:[2,25],78:[2,25],80:[2,25],84:[2,25],85:[2,25],86:[2,25],91:[2,25],93:[2,25],102:[2,25],104:[2,25],105:[2,25],106:[2,25],110:[2,25],116:[2,25],117:[2,25],118:[2,25],126:[2,25],128:[2,25],129:[2,25],130:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25],137:[2,25],138:[2,25]},{1:[2,5],5:169,6:[2,5],7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[2,5],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],102:[2,5],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],73:[2,193],78:[2,193],86:[2,193],91:[2,193],93:[2,193],102:[2,193],104:[2,193],105:[2,193],106:[2,193],110:[2,193],118:[2,193],126:[2,193],128:[2,193],129:[2,193],132:[2,193],133:[2,193],134:[2,193],135:[2,193],136:[2,193],137:[2,193]},{7:170,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:171,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:172,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:173,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:174,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:175,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:176,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:177,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],73:[2,148],78:[2,148],86:[2,148],91:[2,148],93:[2,148],102:[2,148],104:[2,148],105:[2,148],106:[2,148],110:[2,148],118:[2,148],126:[2,148],128:[2,148],129:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148],137:[2,148]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],73:[2,153],78:[2,153],86:[2,153],91:[2,153],93:[2,153],102:[2,153],104:[2,153],105:[2,153],106:[2,153],110:[2,153],118:[2,153],126:[2,153],128:[2,153],129:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153],137:[2,153]},{7:178,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],73:[2,147],78:[2,147],86:[2,147],91:[2,147],93:[2,147],102:[2,147],104:[2,147],105:[2,147],106:[2,147],110:[2,147],118:[2,147],126:[2,147],128:[2,147],129:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:[2,147],137:[2,147]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],73:[2,152],78:[2,152],86:[2,152],91:[2,152],93:[2,152],102:[2,152],104:[2,152],105:[2,152],106:[2,152],110:[2,152],118:[2,152],126:[2,152],128:[2,152],129:[2,152],132:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152],137:[2,152]},{82:179,85:[1,101]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],69:[2,68],71:[2,68],73:[2,68],74:[2,68],78:[2,68],80:[2,68],84:[2,68],85:[2,68],86:[2,68],91:[2,68],93:[2,68],102:[2,68],104:[2,68],105:[2,68],106:[2,68],110:[2,68],118:[2,68],126:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68],138:[2,68]},{85:[2,108]},{27:180,28:[1,71]},{27:181,28:[1,71]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],27:182,28:[1,71],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],69:[2,83],71:[2,83],73:[2,83],74:[2,83],78:[2,83],80:[2,83],84:[2,83],85:[2,83],86:[2,83],91:[2,83],93:[2,83],102:[2,83],104:[2,83],105:[2,83],106:[2,83],110:[2,83],118:[2,83],126:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83],138:[2,83]},{27:183,28:[1,71]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],69:[2,84],71:[2,84],73:[2,84],74:[2,84],78:[2,84],80:[2,84],84:[2,84],85:[2,84],86:[2,84],91:[2,84],93:[2,84],102:[2,84],104:[2,84],105:[2,84],106:[2,84],110:[2,84],118:[2,84],126:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84],138:[2,84]},{7:185,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],57:[1,189],58:45,59:46,61:34,63:23,64:24,65:25,72:184,75:186,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],92:187,93:[1,188],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{70:190,71:[1,95],74:[1,96]},{82:191,85:[1,101]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],69:[2,69],71:[2,69],73:[2,69],74:[2,69],78:[2,69],80:[2,69],84:[2,69],85:[2,69],86:[2,69],91:[2,69],93:[2,69],102:[2,69],104:[2,69],105:[2,69],106:[2,69],110:[2,69],118:[2,69],126:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69],138:[2,69]},{6:[1,193],7:192,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,194],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],69:[2,106],71:[2,106],73:[2,106],74:[2,106],78:[2,106],84:[2,106],85:[2,106],86:[2,106],91:[2,106],93:[2,106],102:[2,106],104:[2,106],105:[2,106],106:[2,106],110:[2,106],118:[2,106],126:[2,106],128:[2,106],129:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106],137:[2,106]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],86:[1,195],87:196,88:[1,56],89:[1,57],90:[1,55],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,52],25:[2,52],49:[1,198],53:200,54:[1,199]},{6:[2,55],25:[2,55],26:[2,55],49:[2,55],54:[2,55]},{6:[2,59],25:[2,59],26:[2,59],40:[1,202],49:[2,59],54:[2,59],57:[1,201]},{6:[2,62],25:[2,62],26:[2,62],40:[2,62],49:[2,62],54:[2,62],57:[2,62]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{27:145,28:[1,71]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:141,88:[1,56],89:[1,57],90:[1,55],91:[1,140],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],73:[2,49],78:[2,49],86:[2,49],91:[2,49],93:[2,49],102:[2,49],104:[2,49],105:[2,49],106:[2,49],110:[2,49],118:[2,49],126:[2,49],128:[2,49],129:[2,49],132:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49],137:[2,49]},{4:204,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[1,203],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],73:[2,186],78:[2,186],86:[2,186],91:[2,186],93:[2,186],102:[2,186],103:82,104:[2,186],105:[2,186],106:[2,186],109:83,110:[2,186],111:67,118:[2,186],126:[2,186],128:[2,186],129:[2,186],132:[1,73],133:[2,186],134:[2,186],135:[2,186],136:[2,186],137:[2,186]},{103:85,104:[1,63],106:[1,64],109:86,110:[1,66],111:67,126:[1,84]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],73:[2,187],78:[2,187],86:[2,187],91:[2,187],93:[2,187],102:[2,187],103:82,104:[2,187],105:[2,187],106:[2,187],109:83,110:[2,187],111:67,118:[2,187],126:[2,187],128:[2,187],129:[2,187],132:[1,73],133:[2,187],134:[2,187],135:[2,187],136:[2,187],137:[2,187]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],73:[2,188],78:[2,188],86:[2,188],91:[2,188],93:[2,188],102:[2,188],103:82,104:[2,188],105:[2,188],106:[2,188],109:83,110:[2,188],111:67,118:[2,188],126:[2,188],128:[2,188],129:[2,188],132:[1,73],133:[2,188],134:[2,188],135:[2,188],136:[2,188],137:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,189],74:[2,71],78:[2,189],84:[2,71],85:[2,71],86:[2,189],91:[2,189],93:[2,189],102:[2,189],104:[2,189],105:[2,189],106:[2,189],110:[2,189],118:[2,189],126:[2,189],128:[2,189],129:[2,189],132:[2,189],133:[2,189],134:[2,189],135:[2,189],136:[2,189],137:[2,189]},{62:88,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],74:[1,96],81:87,84:[1,89],85:[2,107]},{62:98,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],74:[1,96],81:97,84:[1,89],85:[2,107]},{66:[2,74],67:[2,74],68:[2,74],69:[2,74],71:[2,74],74:[2,74],84:[2,74],85:[2,74]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,190],74:[2,71],78:[2,190],84:[2,71],85:[2,71],86:[2,190],91:[2,190],93:[2,190],102:[2,190],104:[2,190],105:[2,190],106:[2,190],110:[2,190],118:[2,190],126:[2,190],128:[2,190],129:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190],137:[2,190]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],73:[2,191],78:[2,191],86:[2,191],91:[2,191],93:[2,191],102:[2,191],104:[2,191],105:[2,191],106:[2,191],110:[2,191],118:[2,191],126:[2,191],128:[2,191],129:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191],137:[2,191]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],73:[2,192],78:[2,192],86:[2,192],91:[2,192],93:[2,192],102:[2,192],104:[2,192],105:[2,192],106:[2,192],110:[2,192],118:[2,192],126:[2,192],128:[2,192],129:[2,192],132:[2,192],133:[2,192],134:[2,192],135:[2,192],136:[2,192],137:[2,192]},{6:[1,207],7:205,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,206],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:208,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{24:209,25:[1,112],125:[1,210]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],49:[2,132],54:[2,132],57:[2,132],73:[2,132],78:[2,132],86:[2,132],91:[2,132],93:[2,132],97:211,98:[1,212],99:[1,213],102:[2,132],104:[2,132],105:[2,132],106:[2,132],110:[2,132],118:[2,132],126:[2,132],128:[2,132],129:[2,132],132:[2,132],133:[2,132],134:[2,132],135:[2,132],136:[2,132],137:[2,132]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],73:[2,146],78:[2,146],86:[2,146],91:[2,146],93:[2,146],102:[2,146],104:[2,146],105:[2,146],106:[2,146],110:[2,146],118:[2,146],126:[2,146],128:[2,146],129:[2,146],132:[2,146],133:[2,146],134:[2,146],135:[2,146],136:[2,146],137:[2,146]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],73:[2,154],78:[2,154],86:[2,154],91:[2,154],93:[2,154],102:[2,154],104:[2,154],105:[2,154],106:[2,154],110:[2,154],118:[2,154],126:[2,154],128:[2,154],129:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154],137:[2,154]},{25:[1,214],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{120:215,122:216,123:[1,217]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],49:[2,96],54:[2,96],57:[2,96],73:[2,96],78:[2,96],86:[2,96],91:[2,96],93:[2,96],102:[2,96],104:[2,96],105:[2,96],106:[2,96],110:[2,96],118:[2,96],126:[2,96],128:[2,96],129:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96],137:[2,96]},{7:218,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,99],6:[2,99],24:219,25:[1,112],26:[2,99],49:[2,99],54:[2,99],57:[2,99],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,99],74:[2,71],78:[2,99],80:[1,220],84:[2,71],85:[2,71],86:[2,99],91:[2,99],93:[2,99],102:[2,99],104:[2,99],105:[2,99],106:[2,99],110:[2,99],118:[2,99],126:[2,99],128:[2,99],129:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99],137:[2,99]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],73:[2,139],78:[2,139],86:[2,139],91:[2,139],93:[2,139],102:[2,139],103:82,104:[2,139],105:[2,139],106:[2,139],109:83,110:[2,139],111:67,118:[2,139],126:[2,139],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,45],6:[2,45],26:[2,45],102:[2,45],103:82,104:[2,45],106:[2,45],109:83,110:[2,45],111:67,126:[2,45],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,72],102:[1,221]},{4:222,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,128],25:[2,128],54:[2,128],57:[1,224],91:[2,128],92:223,93:[1,188],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],69:[2,114],71:[2,114],73:[2,114],74:[2,114],78:[2,114],84:[2,114],85:[2,114],86:[2,114],91:[2,114],93:[2,114],102:[2,114],104:[2,114],105:[2,114],106:[2,114],110:[2,114],116:[2,114],117:[2,114],118:[2,114],126:[2,114],128:[2,114],129:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114],137:[2,114]},{6:[2,52],25:[2,52],53:225,54:[1,226],91:[2,52]},{6:[2,123],25:[2,123],26:[2,123],54:[2,123],86:[2,123],91:[2,123]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:227,88:[1,56],89:[1,57],90:[1,55],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],86:[2,129],91:[2,129]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],40:[2,113],43:[2,113],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],69:[2,113],71:[2,113],73:[2,113],74:[2,113],78:[2,113],80:[2,113],84:[2,113],85:[2,113],86:[2,113],91:[2,113],93:[2,113],102:[2,113],104:[2,113],105:[2,113],106:[2,113],110:[2,113],116:[2,113],117:[2,113],118:[2,113],126:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113],138:[2,113]},{24:228,25:[1,112],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],73:[2,142],78:[2,142],86:[2,142],91:[2,142],93:[2,142],102:[2,142],103:82,104:[1,63],105:[1,229],106:[1,64],109:83,110:[1,66],111:67,118:[2,142],126:[2,142],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],73:[2,144],78:[2,144],86:[2,144],91:[2,144],93:[2,144],102:[2,144],103:82,104:[1,63],105:[1,230],106:[1,64],109:83,110:[1,66],111:67,118:[2,144],126:[2,144],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],73:[2,150],78:[2,150],86:[2,150],91:[2,150],93:[2,150],102:[2,150],104:[2,150],105:[2,150],106:[2,150],110:[2,150],118:[2,150],126:[2,150],128:[2,150],129:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150],137:[2,150]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],73:[2,151],78:[2,151],86:[2,151],91:[2,151],93:[2,151],102:[2,151],103:82,104:[1,63],105:[2,151],106:[1,64],109:83,110:[1,66],111:67,118:[2,151],126:[2,151],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,155],6:[2,155],25:[2,155],26:[2,155],49:[2,155],54:[2,155],57:[2,155],73:[2,155],78:[2,155],86:[2,155],91:[2,155],93:[2,155],102:[2,155],104:[2,155],105:[2,155],106:[2,155],110:[2,155],118:[2,155],126:[2,155],128:[2,155],129:[2,155],132:[2,155],133:[2,155],134:[2,155],135:[2,155],136:[2,155],137:[2,155]},{116:[2,157],117:[2,157]},{27:155,28:[1,71],44:156,58:157,59:158,76:[1,68],89:[1,109],90:[1,110],113:231,115:154},{54:[1,232],116:[2,163],117:[2,163]},{54:[2,159],116:[2,159],117:[2,159]},{54:[2,160],116:[2,160],117:[2,160]},{54:[2,161],116:[2,161],117:[2,161]},{54:[2,162],116:[2,162],117:[2,162]},{1:[2,156],6:[2,156],25:[2,156],26:[2,156],49:[2,156],54:[2,156],57:[2,156],73:[2,156],78:[2,156],86:[2,156],91:[2,156],93:[2,156],102:[2,156],104:[2,156],105:[2,156],106:[2,156],110:[2,156],118:[2,156],126:[2,156],128:[2,156],129:[2,156],132:[2,156],133:[2,156],134:[2,156],135:[2,156],136:[2,156],137:[2,156]},{7:233,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:234,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,52],25:[2,52],53:235,54:[1,236],78:[2,52]},{6:[2,91],25:[2,91],26:[2,91],54:[2,91],78:[2,91]},{6:[2,38],25:[2,38],26:[2,38],43:[1,237],54:[2,38],78:[2,38]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],78:[2,41]},{6:[2,42],25:[2,42],26:[2,42],43:[2,42],54:[2,42],78:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],78:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],78:[2,44]},{1:[2,4],6:[2,4],26:[2,4],102:[2,4]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],73:[2,194],78:[2,194],86:[2,194],91:[2,194],93:[2,194],102:[2,194],103:82,104:[2,194],105:[2,194],106:[2,194],109:83,110:[2,194],111:67,118:[2,194],126:[2,194],128:[2,194],129:[2,194],132:[1,73],133:[1,76],134:[2,194],135:[2,194],136:[2,194],137:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],73:[2,195],78:[2,195],86:[2,195],91:[2,195],93:[2,195],102:[2,195],103:82,104:[2,195],105:[2,195],106:[2,195],109:83,110:[2,195],111:67,118:[2,195],126:[2,195],128:[2,195],129:[2,195],132:[1,73],133:[1,76],134:[2,195],135:[2,195],136:[2,195],137:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],73:[2,196],78:[2,196],86:[2,196],91:[2,196],93:[2,196],102:[2,196],103:82,104:[2,196],105:[2,196],106:[2,196],109:83,110:[2,196],111:67,118:[2,196],126:[2,196],128:[2,196],129:[2,196],132:[1,73],133:[2,196],134:[2,196],135:[2,196],136:[2,196],137:[2,196]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],73:[2,197],78:[2,197],86:[2,197],91:[2,197],93:[2,197],102:[2,197],103:82,104:[2,197],105:[2,197],106:[2,197],109:83,110:[2,197],111:67,118:[2,197],126:[2,197],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[2,197],135:[2,197],136:[2,197],137:[2,197]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],73:[2,198],78:[2,198],86:[2,198],91:[2,198],93:[2,198],102:[2,198],103:82,104:[2,198],105:[2,198],106:[2,198],109:83,110:[2,198],111:67,118:[2,198],126:[2,198],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[2,198],136:[2,198],137:[1,80]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],73:[2,199],78:[2,199],86:[2,199],91:[2,199],93:[2,199],102:[2,199],103:82,104:[2,199],105:[2,199],106:[2,199],109:83,110:[2,199],111:67,118:[2,199],126:[2,199],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[2,199],137:[1,80]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],73:[2,200],78:[2,200],86:[2,200],91:[2,200],93:[2,200],102:[2,200],103:82,104:[2,200],105:[2,200],106:[2,200],109:83,110:[2,200],111:67,118:[2,200],126:[2,200],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[2,200],136:[2,200],137:[2,200]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],73:[2,185],78:[2,185],86:[2,185],91:[2,185],93:[2,185],102:[2,185],103:82,104:[1,63],105:[2,185],106:[1,64],109:83,110:[1,66],111:67,118:[2,185],126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],73:[2,184],78:[2,184],86:[2,184],91:[2,184],93:[2,184],102:[2,184],103:82,104:[1,63],105:[2,184],106:[1,64],109:83,110:[1,66],111:67,118:[2,184],126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],66:[2,103],67:[2,103],68:[2,103],69:[2,103],71:[2,103],73:[2,103],74:[2,103],78:[2,103],84:[2,103],85:[2,103],86:[2,103],91:[2,103],93:[2,103],102:[2,103],104:[2,103],105:[2,103],106:[2,103],110:[2,103],118:[2,103],126:[2,103],128:[2,103],129:[2,103],132:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103],137:[2,103]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],40:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],69:[2,79],71:[2,79],73:[2,79],74:[2,79],78:[2,79],80:[2,79],84:[2,79],85:[2,79],86:[2,79],91:[2,79],93:[2,79],102:[2,79],104:[2,79],105:[2,79],106:[2,79],110:[2,79],118:[2,79],126:[2,79],128:[2,79],129:[2,79],130:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79],137:[2,79],138:[2,79]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],40:[2,80],49:[2,80],54:[2,80],57:[2,80],66:[2,80],67:[2,80],68:[2,80],69:[2,80],71:[2,80],73:[2,80],74:[2,80],78:[2,80],80:[2,80],84:[2,80],85:[2,80],86:[2,80],91:[2,80],93:[2,80],102:[2,80],104:[2,80],105:[2,80],106:[2,80],110:[2,80],118:[2,80],126:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80],136:[2,80],137:[2,80],138:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],40:[2,81],49:[2,81],54:[2,81],57:[2,81],66:[2,81],67:[2,81],68:[2,81],69:[2,81],71:[2,81],73:[2,81],74:[2,81],78:[2,81],80:[2,81],84:[2,81],85:[2,81],86:[2,81],91:[2,81],93:[2,81],102:[2,81],104:[2,81],105:[2,81],106:[2,81],110:[2,81],118:[2,81],126:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81],136:[2,81],137:[2,81],138:[2,81]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],40:[2,82],49:[2,82],54:[2,82],57:[2,82],66:[2,82],67:[2,82],68:[2,82],69:[2,82],71:[2,82],73:[2,82],74:[2,82],78:[2,82],80:[2,82],84:[2,82],85:[2,82],86:[2,82],91:[2,82],93:[2,82],102:[2,82],104:[2,82],105:[2,82],106:[2,82],110:[2,82],118:[2,82],126:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82],136:[2,82],137:[2,82],138:[2,82]},{73:[1,238]},{57:[1,189],73:[2,87],92:239,93:[1,188],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{73:[2,88]},{7:240,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,73:[2,122],76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{11:[2,116],28:[2,116],30:[2,116],31:[2,116],33:[2,116],34:[2,116],35:[2,116],36:[2,116],37:[2,116],38:[2,116],45:[2,116],46:[2,116],47:[2,116],51:[2,116],52:[2,116],73:[2,116],76:[2,116],79:[2,116],83:[2,116],88:[2,116],89:[2,116],90:[2,116],96:[2,116],100:[2,116],101:[2,116],104:[2,116],106:[2,116],108:[2,116],110:[2,116],119:[2,116],125:[2,116],127:[2,116],128:[2,116],129:[2,116],130:[2,116],131:[2,116]},{11:[2,117],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],73:[2,117],76:[2,117],79:[2,117],83:[2,117],88:[2,117],89:[2,117],90:[2,117],96:[2,117],100:[2,117],101:[2,117],104:[2,117],106:[2,117],108:[2,117],110:[2,117],119:[2,117],125:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117],131:[2,117]},{1:[2,86],6:[2,86],25:[2,86],26:[2,86],40:[2,86],49:[2,86],54:[2,86],57:[2,86],66:[2,86],67:[2,86],68:[2,86],69:[2,86],71:[2,86],73:[2,86],74:[2,86],78:[2,86],80:[2,86],84:[2,86],85:[2,86],86:[2,86],91:[2,86],93:[2,86],102:[2,86],104:[2,86],105:[2,86],106:[2,86],110:[2,86],118:[2,86],126:[2,86],128:[2,86],129:[2,86],130:[2,86],131:[2,86],132:[2,86],133:[2,86],134:[2,86],135:[2,86],136:[2,86],137:[2,86],138:[2,86]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],49:[2,104],54:[2,104],57:[2,104],66:[2,104],67:[2,104],68:[2,104],69:[2,104],71:[2,104],73:[2,104],74:[2,104],78:[2,104],84:[2,104],85:[2,104],86:[2,104],91:[2,104],93:[2,104],102:[2,104],104:[2,104],105:[2,104],106:[2,104],110:[2,104],118:[2,104],126:[2,104],128:[2,104],129:[2,104],132:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104],137:[2,104]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],73:[2,35],78:[2,35],86:[2,35],91:[2,35],93:[2,35],102:[2,35],103:82,104:[2,35],105:[2,35],106:[2,35],109:83,110:[2,35],111:67,118:[2,35],126:[2,35],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{7:241,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:242,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],49:[2,109],54:[2,109],57:[2,109],66:[2,109],67:[2,109],68:[2,109],69:[2,109],71:[2,109],73:[2,109],74:[2,109],78:[2,109],84:[2,109],85:[2,109],86:[2,109],91:[2,109],93:[2,109],102:[2,109],104:[2,109],105:[2,109],106:[2,109],110:[2,109],118:[2,109],126:[2,109],128:[2,109],129:[2,109],132:[2,109],133:[2,109],134:[2,109],135:[2,109],136:[2,109],137:[2,109]},{6:[2,52],25:[2,52],53:243,54:[1,226],86:[2,52]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],57:[1,244],86:[2,128],91:[2,128],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{50:245,51:[1,58],52:[1,59]},{6:[2,53],25:[2,53],26:[2,53],27:105,28:[1,71],44:106,55:246,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{6:[1,247],25:[1,248]},{6:[2,60],25:[2,60],26:[2,60],49:[2,60],54:[2,60]},{7:249,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],73:[2,23],78:[2,23],86:[2,23],91:[2,23],93:[2,23],98:[2,23],99:[2,23],102:[2,23],104:[2,23],105:[2,23],106:[2,23],110:[2,23],118:[2,23],121:[2,23],123:[2,23],126:[2,23],128:[2,23],129:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23],137:[2,23]},{6:[1,72],26:[1,250]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],73:[2,201],78:[2,201],86:[2,201],91:[2,201],93:[2,201],102:[2,201],103:82,104:[2,201],105:[2,201],106:[2,201],109:83,110:[2,201],111:67,118:[2,201],126:[2,201],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{7:251,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:252,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,204],6:[2,204],25:[2,204],26:[2,204],49:[2,204],54:[2,204],57:[2,204],73:[2,204],78:[2,204],86:[2,204],91:[2,204],93:[2,204],102:[2,204],103:82,104:[2,204],105:[2,204],106:[2,204],109:83,110:[2,204],111:67,118:[2,204],126:[2,204],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],73:[2,183],78:[2,183],86:[2,183],91:[2,183],93:[2,183],102:[2,183],104:[2,183],105:[2,183],106:[2,183],110:[2,183],118:[2,183],126:[2,183],128:[2,183],129:[2,183],132:[2,183],133:[2,183],134:[2,183],135:[2,183],136:[2,183],137:[2,183]},{7:253,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],49:[2,133],54:[2,133],57:[2,133],73:[2,133],78:[2,133],86:[2,133],91:[2,133],93:[2,133],98:[1,254],102:[2,133],104:[2,133],105:[2,133],106:[2,133],110:[2,133],118:[2,133],126:[2,133],128:[2,133],129:[2,133],132:[2,133],133:[2,133],134:[2,133],135:[2,133],136:[2,133],137:[2,133]},{24:255,25:[1,112]},{24:258,25:[1,112],27:256,28:[1,71],59:257,76:[1,68]},{120:259,122:216,123:[1,217]},{26:[1,260],121:[1,261],122:262,123:[1,217]},{26:[2,176],121:[2,176],123:[2,176]},{7:264,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],95:263,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,97],6:[2,97],24:265,25:[1,112],26:[2,97],49:[2,97],54:[2,97],57:[2,97],73:[2,97],78:[2,97],86:[2,97],91:[2,97],93:[2,97],102:[2,97],103:82,104:[1,63],105:[2,97],106:[1,64],109:83,110:[1,66],111:67,118:[2,97],126:[2,97],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],49:[2,100],54:[2,100],57:[2,100],73:[2,100],78:[2,100],86:[2,100],91:[2,100],93:[2,100],102:[2,100],104:[2,100],105:[2,100],106:[2,100],110:[2,100],118:[2,100],126:[2,100],128:[2,100],129:[2,100],132:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100],137:[2,100]},{7:266,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],66:[2,140],67:[2,140],68:[2,140],69:[2,140],71:[2,140],73:[2,140],74:[2,140],78:[2,140],84:[2,140],85:[2,140],86:[2,140],91:[2,140],93:[2,140],102:[2,140],104:[2,140],105:[2,140],106:[2,140],110:[2,140],118:[2,140],126:[2,140],128:[2,140],129:[2,140],132:[2,140],133:[2,140],134:[2,140],135:[2,140],136:[2,140],137:[2,140]},{6:[1,72],26:[1,267]},{7:268,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,66],11:[2,117],25:[2,66],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],54:[2,66],76:[2,117],79:[2,117],83:[2,117],88:[2,117],89:[2,117],90:[2,117],91:[2,66],96:[2,117],100:[2,117],101:[2,117],104:[2,117],106:[2,117],108:[2,117],110:[2,117],119:[2,117],125:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117],131:[2,117]},{6:[1,270],25:[1,271],91:[1,269]},{6:[2,53],7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[2,53],26:[2,53],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],86:[2,53],88:[1,56],89:[1,57],90:[1,55],91:[2,53],94:272,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,52],25:[2,52],26:[2,52],53:273,54:[1,226]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],49:[2,180],54:[2,180],57:[2,180],73:[2,180],78:[2,180],86:[2,180],91:[2,180],93:[2,180],102:[2,180],104:[2,180],105:[2,180],106:[2,180],110:[2,180],118:[2,180],121:[2,180],126:[2,180],128:[2,180],129:[2,180],132:[2,180],133:[2,180],134:[2,180],135:[2,180],136:[2,180],137:[2,180]},{7:274,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:275,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{116:[2,158],117:[2,158]},{27:155,28:[1,71],44:156,58:157,59:158,76:[1,68],89:[1,109],90:[1,110],115:276},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],49:[2,165],54:[2,165],57:[2,165],73:[2,165],78:[2,165],86:[2,165],91:[2,165],93:[2,165],102:[2,165],103:82,104:[2,165],105:[1,277],106:[2,165],109:83,110:[2,165],111:67,118:[1,278],126:[2,165],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],49:[2,166],54:[2,166],57:[2,166],73:[2,166],78:[2,166],86:[2,166],91:[2,166],93:[2,166],102:[2,166],103:82,104:[2,166],105:[1,279],106:[2,166],109:83,110:[2,166],111:67,118:[2,166],126:[2,166],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,281],25:[1,282],78:[1,280]},{6:[2,53],10:165,25:[2,53],26:[2,53],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:283,42:164,44:168,46:[1,44],78:[2,53],89:[1,109]},{7:284,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,285],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],40:[2,85],49:[2,85],54:[2,85],57:[2,85],66:[2,85],67:[2,85],68:[2,85],69:[2,85],71:[2,85],73:[2,85],74:[2,85],78:[2,85],80:[2,85],84:[2,85],85:[2,85],86:[2,85],91:[2,85],93:[2,85],102:[2,85],104:[2,85],105:[2,85],106:[2,85],110:[2,85],118:[2,85],126:[2,85],128:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85],135:[2,85],136:[2,85],137:[2,85],138:[2,85]},{7:286,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,73:[2,120],76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{73:[2,121],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],73:[2,36],78:[2,36],86:[2,36],91:[2,36],93:[2,36],102:[2,36],103:82,104:[2,36],105:[2,36],106:[2,36],109:83,110:[2,36],111:67,118:[2,36],126:[2,36],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{26:[1,287],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,270],25:[1,271],86:[1,288]},{6:[2,66],25:[2,66],26:[2,66],54:[2,66],86:[2,66],91:[2,66]},{24:289,25:[1,112]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{27:105,28:[1,71],44:106,55:290,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{6:[2,54],25:[2,54],26:[2,54],27:105,28:[1,71],44:106,48:291,54:[2,54],55:103,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],73:[2,24],78:[2,24],86:[2,24],91:[2,24],93:[2,24],98:[2,24],99:[2,24],102:[2,24],104:[2,24],105:[2,24],106:[2,24],110:[2,24],118:[2,24],121:[2,24],123:[2,24],126:[2,24],128:[2,24],129:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24],137:[2,24]},{26:[1,292],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,203],6:[2,203],25:[2,203],26:[2,203],49:[2,203],54:[2,203],57:[2,203],73:[2,203],78:[2,203],86:[2,203],91:[2,203],93:[2,203],102:[2,203],103:82,104:[2,203],105:[2,203],106:[2,203],109:83,110:[2,203],111:67,118:[2,203],126:[2,203],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{24:293,25:[1,112],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{24:294,25:[1,112]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],73:[2,134],78:[2,134],86:[2,134],91:[2,134],93:[2,134],102:[2,134],104:[2,134],105:[2,134],106:[2,134],110:[2,134],118:[2,134],126:[2,134],128:[2,134],129:[2,134],132:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134],137:[2,134]},{24:295,25:[1,112]},{24:296,25:[1,112]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],73:[2,138],78:[2,138],86:[2,138],91:[2,138],93:[2,138],98:[2,138],102:[2,138],104:[2,138],105:[2,138],106:[2,138],110:[2,138],118:[2,138],126:[2,138],128:[2,138],129:[2,138],132:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138],137:[2,138]},{26:[1,297],121:[1,298],122:262,123:[1,217]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],49:[2,174],54:[2,174],57:[2,174],73:[2,174],78:[2,174],86:[2,174],91:[2,174],93:[2,174],102:[2,174],104:[2,174],105:[2,174],106:[2,174],110:[2,174],118:[2,174],126:[2,174],128:[2,174],129:[2,174],132:[2,174],133:[2,174],134:[2,174],135:[2,174],136:[2,174],137:[2,174]},{24:299,25:[1,112]},{26:[2,177],121:[2,177],123:[2,177]},{24:300,25:[1,112],54:[1,301]},{25:[2,130],54:[2,130],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],49:[2,98],54:[2,98],57:[2,98],73:[2,98],78:[2,98],86:[2,98],91:[2,98],93:[2,98],102:[2,98],104:[2,98],105:[2,98],106:[2,98],110:[2,98],118:[2,98],126:[2,98],128:[2,98],129:[2,98],132:[2,98],133:[2,98],134:[2,98],135:[2,98],136:[2,98],137:[2,98]},{1:[2,101],6:[2,101],24:302,25:[1,112],26:[2,101],49:[2,101],54:[2,101],57:[2,101],73:[2,101],78:[2,101],86:[2,101],91:[2,101],93:[2,101],102:[2,101],103:82,104:[1,63],105:[2,101],106:[1,64],109:83,110:[1,66],111:67,118:[2,101],126:[2,101],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{102:[1,303]},{91:[1,304],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],40:[2,115],49:[2,115],54:[2,115],57:[2,115],66:[2,115],67:[2,115],68:[2,115],69:[2,115],71:[2,115],73:[2,115],74:[2,115],78:[2,115],84:[2,115],85:[2,115],86:[2,115],91:[2,115],93:[2,115],102:[2,115],104:[2,115],105:[2,115],106:[2,115],110:[2,115],116:[2,115],117:[2,115],118:[2,115],126:[2,115],128:[2,115],129:[2,115],132:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115],137:[2,115]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],94:305,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:306,88:[1,56],89:[1,57],90:[1,55],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],86:[2,124],91:[2,124]},{6:[1,270],25:[1,271],26:[1,307]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],73:[2,143],78:[2,143],86:[2,143],91:[2,143],93:[2,143],102:[2,143],103:82,104:[1,63],105:[2,143],106:[1,64],109:83,110:[1,66],111:67,118:[2,143],126:[2,143],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],73:[2,145],78:[2,145],86:[2,145],91:[2,145],93:[2,145],102:[2,145],103:82,104:[1,63],105:[2,145],106:[1,64],109:83,110:[1,66],111:67,118:[2,145],126:[2,145],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{116:[2,164],117:[2,164]},{7:308,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:309,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:310,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,89],6:[2,89],25:[2,89],26:[2,89],40:[2,89],49:[2,89],54:[2,89],57:[2,89],66:[2,89],67:[2,89],68:[2,89],69:[2,89],71:[2,89],73:[2,89],74:[2,89],78:[2,89],84:[2,89],85:[2,89],86:[2,89],91:[2,89],93:[2,89],102:[2,89],104:[2,89],105:[2,89],106:[2,89],110:[2,89],116:[2,89],117:[2,89],118:[2,89],126:[2,89],128:[2,89],129:[2,89],132:[2,89],133:[2,89],134:[2,89],135:[2,89],136:[2,89],137:[2,89]},{10:165,27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:311,42:164,44:168,46:[1,44],89:[1,109]},{6:[2,90],10:165,25:[2,90],26:[2,90],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:163,42:164,44:168,46:[1,44],54:[2,90],77:312,89:[1,109]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],78:[2,92]},{6:[2,39],25:[2,39],26:[2,39],54:[2,39],78:[2,39],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{7:313,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{73:[2,119],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],73:[2,37],78:[2,37],86:[2,37],91:[2,37],93:[2,37],102:[2,37],104:[2,37],105:[2,37],106:[2,37],110:[2,37],118:[2,37],126:[2,37],128:[2,37],129:[2,37],132:[2,37],133:[2,37],134:[2,37],135:[2,37],136:[2,37],137:[2,37]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],49:[2,110],54:[2,110],57:[2,110],66:[2,110],67:[2,110],68:[2,110],69:[2,110],71:[2,110],73:[2,110],74:[2,110],78:[2,110],84:[2,110],85:[2,110],86:[2,110],91:[2,110],93:[2,110],102:[2,110],104:[2,110],105:[2,110],106:[2,110],110:[2,110],118:[2,110],126:[2,110],128:[2,110],129:[2,110],132:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110],137:[2,110]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],49:[2,48],54:[2,48],57:[2,48],73:[2,48],78:[2,48],86:[2,48],91:[2,48],93:[2,48],102:[2,48],104:[2,48],105:[2,48],106:[2,48],110:[2,48],118:[2,48],126:[2,48],128:[2,48],129:[2,48],132:[2,48],133:[2,48],134:[2,48],135:[2,48],136:[2,48],137:[2,48]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{6:[2,52],25:[2,52],26:[2,52],53:314,54:[1,199]},{1:[2,202],6:[2,202],25:[2,202],26:[2,202],49:[2,202],54:[2,202],57:[2,202],73:[2,202],78:[2,202],86:[2,202],91:[2,202],93:[2,202],102:[2,202],104:[2,202],105:[2,202],106:[2,202],110:[2,202],118:[2,202],126:[2,202],128:[2,202],129:[2,202],132:[2,202],133:[2,202],134:[2,202],135:[2,202],136:[2,202],137:[2,202]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],49:[2,181],54:[2,181],57:[2,181],73:[2,181],78:[2,181],86:[2,181],91:[2,181],93:[2,181],102:[2,181],104:[2,181],105:[2,181],106:[2,181],110:[2,181],118:[2,181],121:[2,181],126:[2,181],128:[2,181],129:[2,181],132:[2,181],133:[2,181],134:[2,181],135:[2,181],136:[2,181],137:[2,181]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],73:[2,135],78:[2,135],86:[2,135],91:[2,135],93:[2,135],102:[2,135],104:[2,135],105:[2,135],106:[2,135],110:[2,135],118:[2,135],126:[2,135],128:[2,135],129:[2,135],132:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135],137:[2,135]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],73:[2,136],78:[2,136],86:[2,136],91:[2,136],93:[2,136],98:[2,136],102:[2,136],104:[2,136],105:[2,136],106:[2,136],110:[2,136],118:[2,136],126:[2,136],128:[2,136],129:[2,136],132:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136],137:[2,136]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],73:[2,137],78:[2,137],86:[2,137],91:[2,137],93:[2,137],98:[2,137],102:[2,137],104:[2,137],105:[2,137],106:[2,137],110:[2,137],118:[2,137],126:[2,137],128:[2,137],129:[2,137],132:[2,137],133:[2,137],134:[2,137],135:[2,137],136:[2,137],137:[2,137]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],73:[2,172],78:[2,172],86:[2,172],91:[2,172],93:[2,172],102:[2,172],104:[2,172],105:[2,172],106:[2,172],110:[2,172],118:[2,172],126:[2,172],128:[2,172],129:[2,172],132:[2,172],133:[2,172],134:[2,172],135:[2,172],136:[2,172],137:[2,172]},{24:315,25:[1,112]},{26:[1,316]},{6:[1,317],26:[2,178],121:[2,178],123:[2,178]},{7:318,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,102],6:[2,102],25:[2,102],26:[2,102],49:[2,102],54:[2,102],57:[2,102],73:[2,102],78:[2,102],86:[2,102],91:[2,102],93:[2,102],102:[2,102],104:[2,102],105:[2,102],106:[2,102],110:[2,102],118:[2,102],126:[2,102],128:[2,102],129:[2,102],132:[2,102],133:[2,102],134:[2,102],135:[2,102],136:[2,102],137:[2,102]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],66:[2,141],67:[2,141],68:[2,141],69:[2,141],71:[2,141],73:[2,141],74:[2,141],78:[2,141],84:[2,141],85:[2,141],86:[2,141],91:[2,141],93:[2,141],102:[2,141],104:[2,141],105:[2,141],106:[2,141],110:[2,141],118:[2,141],126:[2,141],128:[2,141],129:[2,141],132:[2,141],133:[2,141],134:[2,141],135:[2,141],136:[2,141],137:[2,141]},{1:[2,118],6:[2,118],25:[2,118],26:[2,118],49:[2,118],54:[2,118],57:[2,118],66:[2,118],67:[2,118],68:[2,118],69:[2,118],71:[2,118],73:[2,118],74:[2,118],78:[2,118],84:[2,118],85:[2,118],86:[2,118],91:[2,118],93:[2,118],102:[2,118],104:[2,118],105:[2,118],106:[2,118],110:[2,118],118:[2,118],126:[2,118],128:[2,118],129:[2,118],132:[2,118],133:[2,118],134:[2,118],135:[2,118],136:[2,118],137:[2,118]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],86:[2,125],91:[2,125]},{6:[2,52],25:[2,52],26:[2,52],53:319,54:[1,226]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],86:[2,126],91:[2,126]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],73:[2,167],78:[2,167],86:[2,167],91:[2,167],93:[2,167],102:[2,167],103:82,104:[2,167],105:[2,167],106:[2,167],109:83,110:[2,167],111:67,118:[1,320],126:[2,167],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],73:[2,169],78:[2,169],86:[2,169],91:[2,169],93:[2,169],102:[2,169],103:82,104:[2,169],105:[1,321],106:[2,169],109:83,110:[2,169],111:67,118:[2,169],126:[2,169],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],73:[2,168],78:[2,168],86:[2,168],91:[2,168],93:[2,168],102:[2,168],103:82,104:[2,168],105:[2,168],106:[2,168],109:83,110:[2,168],111:67,118:[2,168],126:[2,168],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],78:[2,93]},{6:[2,52],25:[2,52],26:[2,52],53:322,54:[1,236]},{26:[1,323],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,247],25:[1,248],26:[1,324]},{26:[1,325]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],49:[2,175],54:[2,175],57:[2,175],73:[2,175],78:[2,175],86:[2,175],91:[2,175],93:[2,175],102:[2,175],104:[2,175],105:[2,175],106:[2,175],110:[2,175],118:[2,175],126:[2,175],128:[2,175],129:[2,175],132:[2,175],133:[2,175],134:[2,175],135:[2,175],136:[2,175],137:[2,175]},{26:[2,179],121:[2,179],123:[2,179]},{25:[2,131],54:[2,131],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,270],25:[1,271],26:[1,326]},{7:327,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:328,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[1,281],25:[1,282],26:[1,329]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],78:[2,40]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],73:[2,173],78:[2,173],86:[2,173],91:[2,173],93:[2,173],102:[2,173],104:[2,173],105:[2,173],106:[2,173],110:[2,173],118:[2,173],126:[2,173],128:[2,173],129:[2,173],132:[2,173],133:[2,173],134:[2,173],135:[2,173],136:[2,173],137:[2,173]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],86:[2,127],91:[2,127]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],73:[2,170],78:[2,170],86:[2,170],91:[2,170],93:[2,170],102:[2,170],103:82,104:[2,170],105:[2,170],106:[2,170],109:83,110:[2,170],111:67,118:[2,170],126:[2,170],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],73:[2,171],78:[2,171],86:[2,171],91:[2,171],93:[2,171],102:[2,171],103:82,104:[2,171],105:[2,171],106:[2,171],109:83,110:[2,171],111:67,118:[2,171],126:[2,171],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],78:[2,94]}], -defaultActions: {58:[2,50],59:[2,51],89:[2,108],186:[2,88]}, -parseError: function parseError(str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var e = new Error(str) - e.location = hash.loc - throw e; - } -}, -parse: function parse(input) { - var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - this.lexer.setInput(input); - this.lexer.yy = this.yy; - this.yy.lexer = this.lexer; - this.yy.parser = this; - if (typeof this.lexer.yylloc == 'undefined') { - this.lexer.yylloc = {}; - } - var yyloc = this.lexer.yylloc; - lstack.push(yyloc); - var ranges = this.lexer.options && this.lexer.options.ranges; - if (typeof this.yy.parseError === 'function') { - this.parseError = this.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = self.lexer.lex() || EOF; - if (typeof token !== 'number') { - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (this.lexer.showPosition) { - errStr = 'Expecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - if (this.lexer.yylloc.first_line !== yyloc.first_line) yyloc = this.lexer.yylloc; - this.parseError(errStr, { - text: this.lexer.match, - token: this.terminals_[symbol] || symbol, - line: this.lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(this.lexer.yytext); - lstack.push(this.lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = this.lexer.yyleng; - yytext = this.lexer.yytext; - yylineno = this.lexer.yylineno; - yyloc = this.lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; -undefined -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; - -module.exports = new Parser; - - -}); - -ace.define('ace/mode/coffee_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/coffee/coffee-script'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var Mirror = require("../worker/mirror").Mirror; -var coffee = require("../mode/coffee/coffee-script"); - -window.addEventListener = function() {}; - - -var Worker = exports.Worker = function(sender) { - Mirror.call(this, sender); - this.setTimeout(250); -}; - -oop.inherits(Worker, Mirror); - -(function() { - - this.onUpdate = function() { - var value = this.doc.getValue(); - - try { - coffee.parse(value).compile(); - } catch(e) { - var loc = e.location; - if (loc) { - this.sender.emit("error", { - row: loc.first_line, - column: loc.first_column, - endRow: loc.last_line, - endColumn: loc.last_column, - text: e.message, - type: "error" - }); - } - return; - } - this.sender.emit("ok"); - }; - -}).call(Worker.prototype); - -}); - -ace.define('ace/mode/coffee/nodes', ['require', 'exports', 'module' , 'ace/mode/coffee/scope', 'ace/mode/coffee/lexer', 'ace/mode/coffee/helpers'], function(require, exports, module) { - - var Access, Arr, Assign, Base, Block, Call, Class, Code, CodeFragment, Comment, Existence, Extends, For, HEXNUM, IDENTIFIER, IDENTIFIER_STR, IS_REGEX, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, NUMBER, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, addLocationDataFn, compact, del, ends, extend, flatten, fragmentsToText, isLiteralArguments, isLiteralThis, last, locationDataToString, merge, multident, parseNum, some, starts, throwSyntaxError, unfoldSoak, utility, _ref, _ref1, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - __slice = [].slice; - - Error.stackTraceLimit = Infinity; - - Scope = require('./scope').Scope; - - _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED; - - _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last, some = _ref1.some, addLocationDataFn = _ref1.addLocationDataFn, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError; - - exports.extend = extend; - - exports.addLocationDataFn = addLocationDataFn; - - YES = function() { - return true; - }; - - NO = function() { - return false; - }; - - THIS = function() { - return this; - }; - - NEGATE = function() { - this.negated = !this.negated; - return this; - }; - - exports.CodeFragment = CodeFragment = (function() { - function CodeFragment(parent, code) { - var _ref2; - this.code = "" + code; - this.locationData = parent != null ? parent.locationData : void 0; - this.type = (parent != null ? (_ref2 = parent.constructor) != null ? _ref2.name : void 0 : void 0) || 'unknown'; - } - - CodeFragment.prototype.toString = function() { - return "" + this.code + (this.locationData ? ": " + locationDataToString(this.locationData) : ''); - }; - - return CodeFragment; - - })(); - - fragmentsToText = function(fragments) { - var fragment; - return ((function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = fragments.length; _i < _len; _i++) { - fragment = fragments[_i]; - _results.push(fragment.code); - } - return _results; - })()).join(''); - }; - - exports.Base = Base = (function() { - function Base() {} - - Base.prototype.compile = function(o, lvl) { - return fragmentsToText(this.compileToFragments(o, lvl)); - }; - - Base.prototype.compileToFragments = function(o, lvl) { - var node; - o = extend({}, o); - if (lvl) { - o.level = lvl; - } - node = this.unfoldSoak(o) || this; - node.tab = o.indent; - if (o.level === LEVEL_TOP || !node.isStatement(o)) { - return node.compileNode(o); - } else { - return node.compileClosure(o); - } - }; - - Base.prototype.compileClosure = function(o) { - var args, argumentsNode, func, jumpNode, meth; - if (jumpNode = this.jumps()) { - jumpNode.error('cannot use a pure statement in an expression'); - } - o.sharedScope = true; - func = new Code([], Block.wrap([this])); - args = []; - if ((argumentsNode = this.contains(isLiteralArguments)) || this.contains(isLiteralThis)) { - args = [new Literal('this')]; - if (argumentsNode) { - meth = 'apply'; - args.push(new Literal('arguments')); - } else { - meth = 'call'; - } - func = new Value(func, [new Access(new Literal(meth))]); - } - return (new Call(func, args)).compileNode(o); - }; - - Base.prototype.cache = function(o, level, reused) { - var ref, sub; - if (!this.isComplex()) { - ref = level ? this.compileToFragments(o, level) : this; - return [ref, ref]; - } else { - ref = new Literal(reused || o.scope.freeVariable('ref')); - sub = new Assign(ref, this); - if (level) { - return [sub.compileToFragments(o, level), [this.makeCode(ref.value)]]; - } else { - return [sub, ref]; - } - } - }; - - Base.prototype.cacheToCodeFragments = function(cacheValues) { - return [fragmentsToText(cacheValues[0]), fragmentsToText(cacheValues[1])]; - }; - - Base.prototype.makeReturn = function(res) { - var me; - me = this.unwrapAll(); - if (res) { - return new Call(new Literal("" + res + ".push"), [me]); - } else { - return new Return(me); - } - }; - - Base.prototype.contains = function(pred) { - var node; - node = void 0; - this.traverseChildren(false, function(n) { - if (pred(n)) { - node = n; - return false; - } - }); - return node; - }; - - Base.prototype.lastNonComment = function(list) { - var i; - i = list.length; - while (i--) { - if (!(list[i] instanceof Comment)) { - return list[i]; - } - } - return null; - }; - - Base.prototype.toString = function(idt, name) { - var tree; - if (idt == null) { - idt = ''; - } - if (name == null) { - name = this.constructor.name; - } - tree = '\n' + idt + name; - if (this.soak) { - tree += '?'; - } - this.eachChild(function(node) { - return tree += node.toString(idt + TAB); - }); - return tree; - }; - - Base.prototype.eachChild = function(func) { - var attr, child, _i, _j, _len, _len1, _ref2, _ref3; - if (!this.children) { - return this; - } - _ref2 = this.children; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - attr = _ref2[_i]; - if (this[attr]) { - _ref3 = flatten([this[attr]]); - for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { - child = _ref3[_j]; - if (func(child) === false) { - return this; - } - } - } - } - return this; - }; - - Base.prototype.traverseChildren = function(crossScope, func) { - return this.eachChild(function(child) { - var recur; - recur = func(child); - if (recur !== false) { - return child.traverseChildren(crossScope, func); - } - }); - }; - - Base.prototype.invert = function() { - return new Op('!', this); - }; - - Base.prototype.unwrapAll = function() { - var node; - node = this; - while (node !== (node = node.unwrap())) { - continue; - } - return node; - }; - - Base.prototype.children = []; - - Base.prototype.isStatement = NO; - - Base.prototype.jumps = NO; - - Base.prototype.isComplex = YES; - - Base.prototype.isChainable = NO; - - Base.prototype.isAssignable = NO; - - Base.prototype.unwrap = THIS; - - Base.prototype.unfoldSoak = NO; - - Base.prototype.assigns = NO; - - Base.prototype.updateLocationDataIfMissing = function(locationData) { - if (this.locationData) { - return this; - } - this.locationData = locationData; - return this.eachChild(function(child) { - return child.updateLocationDataIfMissing(locationData); - }); - }; - - Base.prototype.error = function(message) { - return throwSyntaxError(message, this.locationData); - }; - - Base.prototype.makeCode = function(code) { - return new CodeFragment(this, code); - }; - - Base.prototype.wrapInBraces = function(fragments) { - return [].concat(this.makeCode('('), fragments, this.makeCode(')')); - }; - - Base.prototype.joinFragmentArrays = function(fragmentsList, joinStr) { - var answer, fragments, i, _i, _len; - answer = []; - for (i = _i = 0, _len = fragmentsList.length; _i < _len; i = ++_i) { - fragments = fragmentsList[i]; - if (i) { - answer.push(this.makeCode(joinStr)); - } - answer = answer.concat(fragments); - } - return answer; - }; - - return Base; - - })(); - - exports.Block = Block = (function(_super) { - __extends(Block, _super); - - function Block(nodes) { - this.expressions = compact(flatten(nodes || [])); - } - - Block.prototype.children = ['expressions']; - - Block.prototype.push = function(node) { - this.expressions.push(node); - return this; - }; - - Block.prototype.pop = function() { - return this.expressions.pop(); - }; - - Block.prototype.unshift = function(node) { - this.expressions.unshift(node); - return this; - }; - - Block.prototype.unwrap = function() { - if (this.expressions.length === 1) { - return this.expressions[0]; - } else { - return this; - } - }; - - Block.prototype.isEmpty = function() { - return !this.expressions.length; - }; - - Block.prototype.isStatement = function(o) { - var exp, _i, _len, _ref2; - _ref2 = this.expressions; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - exp = _ref2[_i]; - if (exp.isStatement(o)) { - return true; - } - } - return false; - }; - - Block.prototype.jumps = function(o) { - var exp, jumpNode, _i, _len, _ref2; - _ref2 = this.expressions; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - exp = _ref2[_i]; - if (jumpNode = exp.jumps(o)) { - return jumpNode; - } - } - }; - - Block.prototype.makeReturn = function(res) { - var expr, len; - len = this.expressions.length; - while (len--) { - expr = this.expressions[len]; - if (!(expr instanceof Comment)) { - this.expressions[len] = expr.makeReturn(res); - if (expr instanceof Return && !expr.expression) { - this.expressions.splice(len, 1); - } - break; - } - } - return this; - }; - - Block.prototype.compileToFragments = function(o, level) { - if (o == null) { - o = {}; - } - if (o.scope) { - return Block.__super__.compileToFragments.call(this, o, level); - } else { - return this.compileRoot(o); - } - }; - - Block.prototype.compileNode = function(o) { - var answer, compiledNodes, fragments, index, node, top, _i, _len, _ref2; - this.tab = o.indent; - top = o.level === LEVEL_TOP; - compiledNodes = []; - _ref2 = this.expressions; - for (index = _i = 0, _len = _ref2.length; _i < _len; index = ++_i) { - node = _ref2[index]; - node = node.unwrapAll(); - node = node.unfoldSoak(o) || node; - if (node instanceof Block) { - compiledNodes.push(node.compileNode(o)); - } else if (top) { - node.front = true; - fragments = node.compileToFragments(o); - if (!node.isStatement(o)) { - fragments.unshift(this.makeCode("" + this.tab)); - fragments.push(this.makeCode(";")); - } - compiledNodes.push(fragments); - } else { - compiledNodes.push(node.compileToFragments(o, LEVEL_LIST)); - } - } - if (top) { - if (this.spaced) { - return [].concat(this.joinFragmentArrays(compiledNodes, '\n\n'), this.makeCode("\n")); - } else { - return this.joinFragmentArrays(compiledNodes, '\n'); - } - } - if (compiledNodes.length) { - answer = this.joinFragmentArrays(compiledNodes, ', '); - } else { - answer = [this.makeCode("void 0")]; - } - if (compiledNodes.length > 1 && o.level >= LEVEL_LIST) { - return this.wrapInBraces(answer); - } else { - return answer; - } - }; - - Block.prototype.compileRoot = function(o) { - var exp, fragments, i, name, prelude, preludeExps, rest, _i, _len, _ref2; - o.indent = o.bare ? '' : TAB; - o.level = LEVEL_TOP; - this.spaced = true; - o.scope = new Scope(null, this, null); - _ref2 = o.locals || []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - name = _ref2[_i]; - o.scope.parameter(name); - } - prelude = []; - if (!o.bare) { - preludeExps = (function() { - var _j, _len1, _ref3, _results; - _ref3 = this.expressions; - _results = []; - for (i = _j = 0, _len1 = _ref3.length; _j < _len1; i = ++_j) { - exp = _ref3[i]; - if (!(exp.unwrap() instanceof Comment)) { - break; - } - _results.push(exp); - } - return _results; - }).call(this); - rest = this.expressions.slice(preludeExps.length); - this.expressions = preludeExps; - if (preludeExps.length) { - prelude = this.compileNode(merge(o, { - indent: '' - })); - prelude.push(this.makeCode("\n")); - } - this.expressions = rest; - } - fragments = this.compileWithDeclarations(o); - if (o.bare) { - return fragments; - } - return [].concat(prelude, this.makeCode("(function() {\n"), fragments, this.makeCode("\n}).call(this);\n")); - }; - - Block.prototype.compileWithDeclarations = function(o) { - var assigns, declars, exp, fragments, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4; - fragments = []; - post = []; - _ref2 = this.expressions; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - exp = _ref2[i]; - exp = exp.unwrap(); - if (!(exp instanceof Comment || exp instanceof Literal)) { - break; - } - } - o = merge(o, { - level: LEVEL_TOP - }); - if (i) { - rest = this.expressions.splice(i, 9e9); - _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1]; - _ref4 = [this.compileNode(o), spaced], fragments = _ref4[0], this.spaced = _ref4[1]; - this.expressions = rest; - } - post = this.compileNode(o); - scope = o.scope; - if (scope.expressions === this) { - declars = o.scope.hasDeclarations(); - assigns = scope.hasAssignments; - if (declars || assigns) { - if (i) { - fragments.push(this.makeCode('\n')); - } - fragments.push(this.makeCode("" + this.tab + "var ")); - if (declars) { - fragments.push(this.makeCode(scope.declaredVariables().join(', '))); - } - if (assigns) { - if (declars) { - fragments.push(this.makeCode(",\n" + (this.tab + TAB))); - } - fragments.push(this.makeCode(scope.assignedVariables().join(",\n" + (this.tab + TAB)))); - } - fragments.push(this.makeCode(";\n" + (this.spaced ? '\n' : ''))); - } else if (fragments.length && post.length) { - fragments.push(this.makeCode("\n")); - } - } - return fragments.concat(post); - }; - - Block.wrap = function(nodes) { - if (nodes.length === 1 && nodes[0] instanceof Block) { - return nodes[0]; - } - return new Block(nodes); - }; - - return Block; - - })(Base); - - exports.Literal = Literal = (function(_super) { - __extends(Literal, _super); - - function Literal(value) { - this.value = value; - } - - Literal.prototype.makeReturn = function() { - if (this.isStatement()) { - return this; - } else { - return Literal.__super__.makeReturn.apply(this, arguments); - } - }; - - Literal.prototype.isAssignable = function() { - return IDENTIFIER.test(this.value); - }; - - Literal.prototype.isStatement = function() { - var _ref2; - return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger'; - }; - - Literal.prototype.isComplex = NO; - - Literal.prototype.assigns = function(name) { - return name === this.value; - }; - - Literal.prototype.jumps = function(o) { - if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) { - return this; - } - if (this.value === 'continue' && !(o != null ? o.loop : void 0)) { - return this; - } - }; - - Literal.prototype.compileNode = function(o) { - var answer, code, _ref2; - code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value; - answer = this.isStatement() ? "" + this.tab + code + ";" : code; - return [this.makeCode(answer)]; - }; - - Literal.prototype.toString = function() { - return ' "' + this.value + '"'; - }; - - return Literal; - - })(Base); - - exports.Undefined = (function(_super) { - __extends(Undefined, _super); - - function Undefined() { - return Undefined.__super__.constructor.apply(this, arguments); - } - - Undefined.prototype.isAssignable = NO; - - Undefined.prototype.isComplex = NO; - - Undefined.prototype.compileNode = function(o) { - return [this.makeCode(o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0')]; - }; - - return Undefined; - - })(Base); - - exports.Null = (function(_super) { - __extends(Null, _super); - - function Null() { - return Null.__super__.constructor.apply(this, arguments); - } - - Null.prototype.isAssignable = NO; - - Null.prototype.isComplex = NO; - - Null.prototype.compileNode = function() { - return [this.makeCode("null")]; - }; - - return Null; - - })(Base); - - exports.Bool = (function(_super) { - __extends(Bool, _super); - - Bool.prototype.isAssignable = NO; - - Bool.prototype.isComplex = NO; - - Bool.prototype.compileNode = function() { - return [this.makeCode(this.val)]; - }; - - function Bool(val) { - this.val = val; - } - - return Bool; - - })(Base); - - exports.Return = Return = (function(_super) { - __extends(Return, _super); - - function Return(expr) { - if (expr && !expr.unwrap().isUndefined) { - this.expression = expr; - } - } - - Return.prototype.children = ['expression']; - - Return.prototype.isStatement = YES; - - Return.prototype.makeReturn = THIS; - - Return.prototype.jumps = THIS; - - Return.prototype.compileToFragments = function(o, level) { - var expr, _ref2; - expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0; - if (expr && !(expr instanceof Return)) { - return expr.compileToFragments(o, level); - } else { - return Return.__super__.compileToFragments.call(this, o, level); - } - }; - - Return.prototype.compileNode = function(o) { - var answer; - answer = []; - answer.push(this.makeCode(this.tab + ("return" + (this.expression ? " " : "")))); - if (this.expression) { - answer = answer.concat(this.expression.compileToFragments(o, LEVEL_PAREN)); - } - answer.push(this.makeCode(";")); - return answer; - }; - - return Return; - - })(Base); - - exports.Value = Value = (function(_super) { - __extends(Value, _super); - - function Value(base, props, tag) { - if (!props && base instanceof Value) { - return base; - } - this.base = base; - this.properties = props || []; - if (tag) { - this[tag] = true; - } - return this; - } - - Value.prototype.children = ['base', 'properties']; - - Value.prototype.add = function(props) { - this.properties = this.properties.concat(props); - return this; - }; - - Value.prototype.hasProperties = function() { - return !!this.properties.length; - }; - - Value.prototype.bareLiteral = function(type) { - return !this.properties.length && this.base instanceof type; - }; - - Value.prototype.isArray = function() { - return this.bareLiteral(Arr); - }; - - Value.prototype.isRange = function() { - return this.bareLiteral(Range); - }; - - Value.prototype.isComplex = function() { - return this.hasProperties() || this.base.isComplex(); - }; - - Value.prototype.isAssignable = function() { - return this.hasProperties() || this.base.isAssignable(); - }; - - Value.prototype.isSimpleNumber = function() { - return this.bareLiteral(Literal) && SIMPLENUM.test(this.base.value); - }; - - Value.prototype.isString = function() { - return this.bareLiteral(Literal) && IS_STRING.test(this.base.value); - }; - - Value.prototype.isRegex = function() { - return this.bareLiteral(Literal) && IS_REGEX.test(this.base.value); - }; - - Value.prototype.isAtomic = function() { - var node, _i, _len, _ref2; - _ref2 = this.properties.concat(this.base); - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - node = _ref2[_i]; - if (node.soak || node instanceof Call) { - return false; - } - } - return true; - }; - - Value.prototype.isNotCallable = function() { - return this.isSimpleNumber() || this.isString() || this.isRegex() || this.isArray() || this.isRange() || this.isSplice() || this.isObject(); - }; - - Value.prototype.isStatement = function(o) { - return !this.properties.length && this.base.isStatement(o); - }; - - Value.prototype.assigns = function(name) { - return !this.properties.length && this.base.assigns(name); - }; - - Value.prototype.jumps = function(o) { - return !this.properties.length && this.base.jumps(o); - }; - - Value.prototype.isObject = function(onlyGenerated) { - if (this.properties.length) { - return false; - } - return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated); - }; - - Value.prototype.isSplice = function() { - return last(this.properties) instanceof Slice; - }; - - Value.prototype.looksStatic = function(className) { - var _ref2; - return this.base.value === className && this.properties.length && ((_ref2 = this.properties[0].name) != null ? _ref2.value : void 0) !== 'prototype'; - }; - - Value.prototype.unwrap = function() { - if (this.properties.length) { - return this; - } else { - return this.base; - } - }; - - Value.prototype.cacheReference = function(o) { - var base, bref, name, nref; - name = last(this.properties); - if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) { - return [this, this]; - } - base = new Value(this.base, this.properties.slice(0, -1)); - if (base.isComplex()) { - bref = new Literal(o.scope.freeVariable('base')); - base = new Value(new Parens(new Assign(bref, base))); - } - if (!name) { - return [base, bref]; - } - if (name.isComplex()) { - nref = new Literal(o.scope.freeVariable('name')); - name = new Index(new Assign(nref, name.index)); - nref = new Index(nref); - } - return [base.add(name), new Value(bref || base.base, [nref || name])]; - }; - - Value.prototype.compileNode = function(o) { - var fragments, prop, props, _i, _len; - this.base.front = this.front; - props = this.properties; - fragments = this.base.compileToFragments(o, (props.length ? LEVEL_ACCESS : null)); - if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(fragmentsToText(fragments))) { - fragments.push(this.makeCode('.')); - } - for (_i = 0, _len = props.length; _i < _len; _i++) { - prop = props[_i]; - fragments.push.apply(fragments, prop.compileToFragments(o)); - } - return fragments; - }; - - Value.prototype.unfoldSoak = function(o) { - return this.unfoldedSoak != null ? this.unfoldedSoak : this.unfoldedSoak = (function(_this) { - return function() { - var fst, i, ifn, prop, ref, snd, _i, _len, _ref2, _ref3; - if (ifn = _this.base.unfoldSoak(o)) { - (_ref2 = ifn.body.properties).push.apply(_ref2, _this.properties); - return ifn; - } - _ref3 = _this.properties; - for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) { - prop = _ref3[i]; - if (!prop.soak) { - continue; - } - prop.soak = false; - fst = new Value(_this.base, _this.properties.slice(0, i)); - snd = new Value(_this.base, _this.properties.slice(i)); - if (fst.isComplex()) { - ref = new Literal(o.scope.freeVariable('ref')); - fst = new Parens(new Assign(ref, fst)); - snd.base = ref; - } - return new If(new Existence(fst), snd, { - soak: true - }); - } - return false; - }; - })(this)(); - }; - - return Value; - - })(Base); - - exports.Comment = Comment = (function(_super) { - __extends(Comment, _super); - - function Comment(comment) { - this.comment = comment; - } - - Comment.prototype.isStatement = YES; - - Comment.prototype.makeReturn = THIS; - - Comment.prototype.compileNode = function(o, level) { - var code, comment; - comment = this.comment.replace(/^(\s*)#/gm, "$1 *"); - code = "/*" + (multident(comment, this.tab)) + (__indexOf.call(comment, '\n') >= 0 ? "\n" + this.tab : '') + " */"; - if ((level || o.level) === LEVEL_TOP) { - code = o.indent + code; - } - return [this.makeCode("\n"), this.makeCode(code)]; - }; - - return Comment; - - })(Base); - - exports.Call = Call = (function(_super) { - __extends(Call, _super); - - function Call(variable, args, soak) { - this.args = args != null ? args : []; - this.soak = soak; - this.isNew = false; - this.isSuper = variable === 'super'; - this.variable = this.isSuper ? null : variable; - if (variable instanceof Value && variable.isNotCallable()) { - variable.error("literal is not a function"); - } - } - - Call.prototype.children = ['variable', 'args']; - - Call.prototype.newInstance = function() { - var base, _ref2; - base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable; - if (base instanceof Call && !base.isNew) { - base.newInstance(); - } else { - this.isNew = true; - } - return this; - }; - - Call.prototype.superReference = function(o) { - var accesses, method; - method = o.scope.namedMethod(); - if (method != null ? method.klass : void 0) { - accesses = [new Access(new Literal('__super__'))]; - if (method["static"]) { - accesses.push(new Access(new Literal('constructor'))); - } - accesses.push(new Access(new Literal(method.name))); - return (new Value(new Literal(method.klass), accesses)).compile(o); - } else if (method != null ? method.ctor : void 0) { - return "" + method.name + ".__super__.constructor"; - } else { - return this.error('cannot call super outside of an instance method.'); - } - }; - - Call.prototype.superThis = function(o) { - var method; - method = o.scope.method; - return (method && !method.klass && method.context) || "this"; - }; - - Call.prototype.unfoldSoak = function(o) { - var call, ifn, left, list, rite, _i, _len, _ref2, _ref3; - if (this.soak) { - if (this.variable) { - if (ifn = unfoldSoak(o, this, 'variable')) { - return ifn; - } - _ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1]; - } else { - left = new Literal(this.superReference(o)); - rite = new Value(left); - } - rite = new Call(rite, this.args); - rite.isNew = this.isNew; - left = new Literal("typeof " + (left.compile(o)) + " === \"function\""); - return new If(left, new Value(rite), { - soak: true - }); - } - call = this; - list = []; - while (true) { - if (call.variable instanceof Call) { - list.push(call); - call = call.variable; - continue; - } - if (!(call.variable instanceof Value)) { - break; - } - list.push(call); - if (!((call = call.variable.base) instanceof Call)) { - break; - } - } - _ref3 = list.reverse(); - for (_i = 0, _len = _ref3.length; _i < _len; _i++) { - call = _ref3[_i]; - if (ifn) { - if (call.variable instanceof Call) { - call.variable = ifn; - } else { - call.variable.base = ifn; - } - } - ifn = unfoldSoak(o, call, 'variable'); - } - return ifn; - }; - - Call.prototype.compileNode = function(o) { - var arg, argIndex, compiledArgs, compiledArray, fragments, preface, _i, _len, _ref2, _ref3; - if ((_ref2 = this.variable) != null) { - _ref2.front = this.front; - } - compiledArray = Splat.compileSplattedArray(o, this.args, true); - if (compiledArray.length) { - return this.compileSplat(o, compiledArray); - } - compiledArgs = []; - _ref3 = this.args; - for (argIndex = _i = 0, _len = _ref3.length; _i < _len; argIndex = ++_i) { - arg = _ref3[argIndex]; - if (argIndex) { - compiledArgs.push(this.makeCode(", ")); - } - compiledArgs.push.apply(compiledArgs, arg.compileToFragments(o, LEVEL_LIST)); - } - fragments = []; - if (this.isSuper) { - preface = this.superReference(o) + (".call(" + (this.superThis(o))); - if (compiledArgs.length) { - preface += ", "; - } - fragments.push(this.makeCode(preface)); - } else { - if (this.isNew) { - fragments.push(this.makeCode('new ')); - } - fragments.push.apply(fragments, this.variable.compileToFragments(o, LEVEL_ACCESS)); - fragments.push(this.makeCode("(")); - } - fragments.push.apply(fragments, compiledArgs); - fragments.push(this.makeCode(")")); - return fragments; - }; - - Call.prototype.compileSplat = function(o, splatArgs) { - var answer, base, fun, idt, name, ref; - if (this.isSuper) { - return [].concat(this.makeCode("" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", "), splatArgs, this.makeCode(")")); - } - if (this.isNew) { - idt = this.tab + TAB; - return [].concat(this.makeCode("(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return Object(result) === result ? result : child;\n" + this.tab + "})("), this.variable.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), splatArgs, this.makeCode(", function(){})")); - } - answer = []; - base = new Value(this.variable); - if ((name = base.properties.pop()) && base.isComplex()) { - ref = o.scope.freeVariable('ref'); - answer = answer.concat(this.makeCode("(" + ref + " = "), base.compileToFragments(o, LEVEL_LIST), this.makeCode(")"), name.compileToFragments(o)); - } else { - fun = base.compileToFragments(o, LEVEL_ACCESS); - if (SIMPLENUM.test(fragmentsToText(fun))) { - fun = this.wrapInBraces(fun); - } - if (name) { - ref = fragmentsToText(fun); - fun.push.apply(fun, name.compileToFragments(o)); - } else { - ref = 'null'; - } - answer = answer.concat(fun); - } - return answer = answer.concat(this.makeCode(".apply(" + ref + ", "), splatArgs, this.makeCode(")")); - }; - - return Call; - - })(Base); - - exports.Extends = Extends = (function(_super) { - __extends(Extends, _super); - - function Extends(child, parent) { - this.child = child; - this.parent = parent; - } - - Extends.prototype.children = ['child', 'parent']; - - Extends.prototype.compileToFragments = function(o) { - return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compileToFragments(o); - }; - - return Extends; - - })(Base); - - exports.Access = Access = (function(_super) { - __extends(Access, _super); - - function Access(name, tag) { - this.name = name; - this.name.asKey = true; - this.soak = tag === 'soak'; - } - - Access.prototype.children = ['name']; - - Access.prototype.compileToFragments = function(o) { - var name; - name = this.name.compileToFragments(o); - if (IDENTIFIER.test(fragmentsToText(name))) { - name.unshift(this.makeCode(".")); - } else { - name.unshift(this.makeCode("[")); - name.push(this.makeCode("]")); - } - return name; - }; - - Access.prototype.isComplex = NO; - - return Access; - - })(Base); - - exports.Index = Index = (function(_super) { - __extends(Index, _super); - - function Index(index) { - this.index = index; - } - - Index.prototype.children = ['index']; - - Index.prototype.compileToFragments = function(o) { - return [].concat(this.makeCode("["), this.index.compileToFragments(o, LEVEL_PAREN), this.makeCode("]")); - }; - - Index.prototype.isComplex = function() { - return this.index.isComplex(); - }; - - return Index; - - })(Base); - - exports.Range = Range = (function(_super) { - __extends(Range, _super); - - Range.prototype.children = ['from', 'to']; - - function Range(from, to, tag) { - this.from = from; - this.to = to; - this.exclusive = tag === 'exclusive'; - this.equals = this.exclusive ? '' : '='; - } - - Range.prototype.compileVariables = function(o) { - var step, _ref2, _ref3, _ref4, _ref5; - o = merge(o, { - top: true - }); - _ref2 = this.cacheToCodeFragments(this.from.cache(o, LEVEL_LIST)), this.fromC = _ref2[0], this.fromVar = _ref2[1]; - _ref3 = this.cacheToCodeFragments(this.to.cache(o, LEVEL_LIST)), this.toC = _ref3[0], this.toVar = _ref3[1]; - if (step = del(o, 'step')) { - _ref4 = this.cacheToCodeFragments(step.cache(o, LEVEL_LIST)), this.step = _ref4[0], this.stepVar = _ref4[1]; - } - _ref5 = [this.fromVar.match(NUMBER), this.toVar.match(NUMBER)], this.fromNum = _ref5[0], this.toNum = _ref5[1]; - if (this.stepVar) { - return this.stepNum = this.stepVar.match(NUMBER); - } - }; - - Range.prototype.compileNode = function(o) { - var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, stepPart, to, varPart, _ref2, _ref3; - if (!this.fromVar) { - this.compileVariables(o); - } - if (!o.index) { - return this.compileArray(o); - } - known = this.fromNum && this.toNum; - idx = del(o, 'index'); - idxName = del(o, 'name'); - namedIndex = idxName && idxName !== idx; - varPart = "" + idx + " = " + this.fromC; - if (this.toC !== this.toVar) { - varPart += ", " + this.toC; - } - if (this.step !== this.stepVar) { - varPart += ", " + this.step; - } - _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1]; - condPart = this.stepNum ? parseNum(this.stepNum[0]) > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [parseNum(this.fromNum[0]), parseNum(this.toNum[0])], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = this.stepVar ? "" + this.stepVar + " > 0" : "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar); - stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--"; - if (namedIndex) { - varPart = "" + idxName + " = " + varPart; - } - if (namedIndex) { - stepPart = "" + idxName + " = " + stepPart; - } - return [this.makeCode("" + varPart + "; " + condPart + "; " + stepPart)]; - }; - - Range.prototype.compileArray = function(o) { - var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results; - if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) { - range = (function() { - _results = []; - for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); } - return _results; - }).apply(this); - if (this.exclusive) { - range.pop(); - } - return [this.makeCode("[" + (range.join(', ')) + "]")]; - } - idt = this.tab + TAB; - i = o.scope.freeVariable('i'); - result = o.scope.freeVariable('results'); - pre = "\n" + idt + result + " = [];"; - if (this.fromNum && this.toNum) { - o.index = i; - body = fragmentsToText(this.compileNode(o)); - } else { - vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : ''); - cond = "" + this.fromVar + " <= " + this.toVar; - body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--"; - } - post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent; - hasArgs = function(node) { - return node != null ? node.contains(isLiteralArguments) : void 0; - }; - if (hasArgs(this.from) || hasArgs(this.to)) { - args = ', arguments'; - } - return [this.makeCode("(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")")]; - }; - - return Range; - - })(Base); - - exports.Slice = Slice = (function(_super) { - __extends(Slice, _super); - - Slice.prototype.children = ['range']; - - function Slice(range) { - this.range = range; - Slice.__super__.constructor.call(this); - } - - Slice.prototype.compileNode = function(o) { - var compiled, compiledText, from, fromCompiled, to, toStr, _ref2; - _ref2 = this.range, to = _ref2.to, from = _ref2.from; - fromCompiled = from && from.compileToFragments(o, LEVEL_PAREN) || [this.makeCode('0')]; - if (to) { - compiled = to.compileToFragments(o, LEVEL_PAREN); - compiledText = fragmentsToText(compiled); - if (!(!this.range.exclusive && +compiledText === -1)) { - toStr = ', ' + (this.range.exclusive ? compiledText : SIMPLENUM.test(compiledText) ? "" + (+compiledText + 1) : (compiled = to.compileToFragments(o, LEVEL_ACCESS), "+" + (fragmentsToText(compiled)) + " + 1 || 9e9")); - } - } - return [this.makeCode(".slice(" + (fragmentsToText(fromCompiled)) + (toStr || '') + ")")]; - }; - - return Slice; - - })(Base); - - exports.Obj = Obj = (function(_super) { - __extends(Obj, _super); - - function Obj(props, generated) { - this.generated = generated != null ? generated : false; - this.objects = this.properties = props || []; - } - - Obj.prototype.children = ['properties']; - - Obj.prototype.compileNode = function(o) { - var answer, i, idt, indent, join, lastNoncom, node, prop, props, _i, _j, _len, _len1; - props = this.properties; - if (!props.length) { - return [this.makeCode(this.front ? '({})' : '{}')]; - } - if (this.generated) { - for (_i = 0, _len = props.length; _i < _len; _i++) { - node = props[_i]; - if (node instanceof Value) { - node.error('cannot have an implicit value in an implicit object'); - } - } - } - idt = o.indent += TAB; - lastNoncom = this.lastNonComment(this.properties); - answer = []; - for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) { - prop = props[i]; - join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n'; - indent = prop instanceof Comment ? '' : idt; - if (prop instanceof Assign && prop.variable instanceof Value && prop.variable.hasProperties()) { - prop.variable.error('Invalid object key'); - } - if (prop instanceof Value && prop["this"]) { - prop = new Assign(prop.properties[0].name, prop, 'object'); - } - if (!(prop instanceof Comment)) { - if (!(prop instanceof Assign)) { - prop = new Assign(prop, prop, 'object'); - } - (prop.variable.base || prop.variable).asKey = true; - } - if (indent) { - answer.push(this.makeCode(indent)); - } - answer.push.apply(answer, prop.compileToFragments(o, LEVEL_TOP)); - if (join) { - answer.push(this.makeCode(join)); - } - } - answer.unshift(this.makeCode("{" + (props.length && '\n'))); - answer.push(this.makeCode("" + (props.length && '\n' + this.tab) + "}")); - if (this.front) { - return this.wrapInBraces(answer); - } else { - return answer; - } - }; - - Obj.prototype.assigns = function(name) { - var prop, _i, _len, _ref2; - _ref2 = this.properties; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - prop = _ref2[_i]; - if (prop.assigns(name)) { - return true; - } - } - return false; - }; - - return Obj; - - })(Base); - - exports.Arr = Arr = (function(_super) { - __extends(Arr, _super); - - function Arr(objs) { - this.objects = objs || []; - } - - Arr.prototype.children = ['objects']; - - Arr.prototype.compileNode = function(o) { - var answer, compiledObjs, fragments, index, obj, _i, _len; - if (!this.objects.length) { - return [this.makeCode('[]')]; - } - o.indent += TAB; - answer = Splat.compileSplattedArray(o, this.objects); - if (answer.length) { - return answer; - } - answer = []; - compiledObjs = (function() { - var _i, _len, _ref2, _results; - _ref2 = this.objects; - _results = []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - _results.push(obj.compileToFragments(o, LEVEL_LIST)); - } - return _results; - }).call(this); - for (index = _i = 0, _len = compiledObjs.length; _i < _len; index = ++_i) { - fragments = compiledObjs[index]; - if (index) { - answer.push(this.makeCode(", ")); - } - answer.push.apply(answer, fragments); - } - if (fragmentsToText(answer).indexOf('\n') >= 0) { - answer.unshift(this.makeCode("[\n" + o.indent)); - answer.push(this.makeCode("\n" + this.tab + "]")); - } else { - answer.unshift(this.makeCode("[")); - answer.push(this.makeCode("]")); - } - return answer; - }; - - Arr.prototype.assigns = function(name) { - var obj, _i, _len, _ref2; - _ref2 = this.objects; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - if (obj.assigns(name)) { - return true; - } - } - return false; - }; - - return Arr; - - })(Base); - - exports.Class = Class = (function(_super) { - __extends(Class, _super); - - function Class(variable, parent, body) { - this.variable = variable; - this.parent = parent; - this.body = body != null ? body : new Block; - this.boundFuncs = []; - this.body.classBody = true; - } - - Class.prototype.children = ['variable', 'parent', 'body']; - - Class.prototype.determineName = function() { - var decl, tail; - if (!this.variable) { - return null; - } - decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value; - if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) { - this.variable.error("class variable name may not be " + decl); - } - return decl && (decl = IDENTIFIER.test(decl) && decl); - }; - - Class.prototype.setContext = function(name) { - return this.body.traverseChildren(false, function(node) { - if (node.classBody) { - return false; - } - if (node instanceof Literal && node.value === 'this') { - return node.value = name; - } else if (node instanceof Code) { - node.klass = name; - if (node.bound) { - return node.context = name; - } - } - }); - }; - - Class.prototype.addBoundFunctions = function(o) { - var bvar, lhs, _i, _len, _ref2; - _ref2 = this.boundFuncs; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - bvar = _ref2[_i]; - lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o); - this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)")); - } - }; - - Class.prototype.addProperties = function(node, name, o) { - var assign, base, exprs, func, props; - props = node.base.properties.slice(0); - exprs = (function() { - var _results; - _results = []; - while (assign = props.shift()) { - if (assign instanceof Assign) { - base = assign.variable.base; - delete assign.context; - func = assign.value; - if (base.value === 'constructor') { - if (this.ctor) { - assign.error('cannot define more than one constructor in a class'); - } - if (func.bound) { - assign.error('cannot define a constructor as a bound function'); - } - if (func instanceof Code) { - assign = this.ctor = func; - } else { - this.externalCtor = o.classScope.freeVariable('class'); - assign = new Assign(new Literal(this.externalCtor), func); - } - } else { - if (assign.variable["this"]) { - func["static"] = true; - } else { - assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]); - if (func instanceof Code && func.bound) { - this.boundFuncs.push(base); - func.bound = false; - } - } - } - } - _results.push(assign); - } - return _results; - }).call(this); - return compact(exprs); - }; - - Class.prototype.walkBody = function(name, o) { - return this.traverseChildren(false, (function(_this) { - return function(child) { - var cont, exps, i, node, _i, _len, _ref2; - cont = true; - if (child instanceof Class) { - return false; - } - if (child instanceof Block) { - _ref2 = exps = child.expressions; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - node = _ref2[i]; - if (node instanceof Assign && node.variable.looksStatic(name)) { - node.value["static"] = true; - } else if (node instanceof Value && node.isObject(true)) { - cont = false; - exps[i] = _this.addProperties(node, name, o); - } - } - child.expressions = exps = flatten(exps); - } - return cont && !(child instanceof Class); - }; - })(this)); - }; - - Class.prototype.hoistDirectivePrologue = function() { - var expressions, index, node; - index = 0; - expressions = this.body.expressions; - while ((node = expressions[index]) && node instanceof Comment || node instanceof Value && node.isString()) { - ++index; - } - return this.directives = expressions.splice(0, index); - }; - - Class.prototype.ensureConstructor = function(name) { - if (!this.ctor) { - this.ctor = new Code; - if (this.externalCtor) { - this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)")); - } else if (this.parent) { - this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)")); - } - this.ctor.body.makeReturn(); - this.body.expressions.unshift(this.ctor); - } - this.ctor.ctor = this.ctor.name = name; - this.ctor.klass = null; - return this.ctor.noReturn = true; - }; - - Class.prototype.compileNode = function(o) { - var args, argumentsNode, func, jumpNode, klass, lname, name, superClass, _ref2; - if (jumpNode = this.body.jumps()) { - jumpNode.error('Class bodies cannot contain pure statements'); - } - if (argumentsNode = this.body.contains(isLiteralArguments)) { - argumentsNode.error("Class bodies shouldn't reference arguments"); - } - name = this.determineName() || '_Class'; - if (name.reserved) { - name = "_" + name; - } - lname = new Literal(name); - func = new Code([], Block.wrap([this.body])); - args = []; - o.classScope = func.makeScope(o.scope); - this.hoistDirectivePrologue(); - this.setContext(name); - this.walkBody(name, o); - this.ensureConstructor(name); - this.addBoundFunctions(o); - this.body.spaced = true; - this.body.expressions.push(lname); - if (this.parent) { - superClass = new Literal(o.classScope.freeVariable('super', false)); - this.body.expressions.unshift(new Extends(lname, superClass)); - func.params.push(new Param(superClass)); - args.push(this.parent); - } - (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives); - klass = new Parens(new Call(func, args)); - if (this.variable) { - klass = new Assign(this.variable, klass); - } - return klass.compileToFragments(o); - }; - - return Class; - - })(Base); - - exports.Assign = Assign = (function(_super) { - __extends(Assign, _super); - - function Assign(variable, value, context, options) { - var forbidden, name, _ref2; - this.variable = variable; - this.value = value; - this.context = context; - this.param = options && options.param; - this.subpattern = options && options.subpattern; - forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0); - if (forbidden && this.context !== 'object') { - this.variable.error("variable name may not be \"" + name + "\""); - } - } - - Assign.prototype.children = ['variable', 'value']; - - Assign.prototype.isStatement = function(o) { - return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0; - }; - - Assign.prototype.assigns = function(name) { - return this[this.context === 'object' ? 'value' : 'variable'].assigns(name); - }; - - Assign.prototype.unfoldSoak = function(o) { - return unfoldSoak(o, this, 'variable'); - }; - - Assign.prototype.compileNode = function(o) { - var answer, compiledName, isValue, match, name, val, varBase, _ref2, _ref3, _ref4; - if (isValue = this.variable instanceof Value) { - if (this.variable.isArray() || this.variable.isObject()) { - return this.compilePatternMatch(o); - } - if (this.variable.isSplice()) { - return this.compileSplice(o); - } - if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') { - return this.compileConditional(o); - } - } - compiledName = this.variable.compileToFragments(o, LEVEL_LIST); - name = fragmentsToText(compiledName); - if (!this.context) { - varBase = this.variable.unwrapAll(); - if (!varBase.isAssignable()) { - this.variable.error("\"" + (this.variable.compile(o)) + "\" cannot be assigned"); - } - if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) { - if (this.param) { - o.scope.add(name, 'var'); - } else { - o.scope.find(name); - } - } - } - if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) { - if (match[2]) { - this.value.klass = match[1]; - } - this.value.name = (_ref3 = (_ref4 = match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5]; - } - val = this.value.compileToFragments(o, LEVEL_LIST); - if (this.context === 'object') { - return compiledName.concat(this.makeCode(": "), val); - } - answer = compiledName.concat(this.makeCode(" " + (this.context || '=') + " "), val); - if (o.level <= LEVEL_LIST) { - return answer; - } else { - return this.wrapInBraces(answer); - } - }; - - Assign.prototype.compilePatternMatch = function(o) { - var acc, assigns, code, fragments, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, vvarText, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; - top = o.level === LEVEL_TOP; - value = this.value; - objects = this.variable.base.objects; - if (!(olen = objects.length)) { - code = value.compileToFragments(o); - if (o.level >= LEVEL_OP) { - return this.wrapInBraces(code); - } else { - return code; - } - } - isObject = this.variable.isObject(); - if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) { - if (obj instanceof Assign) { - _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value; - } else { - idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0); - } - acc = IDENTIFIER.test(idx.unwrap().value || 0); - value = new Value(value); - value.properties.push(new (acc ? Access : Index)(idx)); - if (_ref4 = obj.unwrap().value, __indexOf.call(RESERVED, _ref4) >= 0) { - obj.error("assignment to a reserved word: " + (obj.compile(o))); - } - return new Assign(obj, value, null, { - param: this.param - }).compileToFragments(o, LEVEL_TOP); - } - vvar = value.compileToFragments(o, LEVEL_LIST); - vvarText = fragmentsToText(vvar); - assigns = []; - splat = false; - if (!IDENTIFIER.test(vvarText) || this.variable.assigns(vvarText)) { - assigns.push([this.makeCode("" + (ref = o.scope.freeVariable('ref')) + " = ")].concat(__slice.call(vvar))); - vvar = [this.makeCode(ref)]; - vvarText = ref; - } - for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) { - obj = objects[i]; - idx = i; - if (isObject) { - if (obj instanceof Assign) { - _ref5 = obj, (_ref6 = _ref5.variable, idx = _ref6.base), obj = _ref5.value; - } else { - if (obj.base instanceof Parens) { - _ref7 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref7[0], idx = _ref7[1]; - } else { - idx = obj["this"] ? obj.properties[0].name : obj; - } - } - } - if (!splat && obj instanceof Splat) { - name = obj.name.unwrap().value; - obj = obj.unwrap(); - val = "" + olen + " <= " + vvarText + ".length ? " + (utility('slice')) + ".call(" + vvarText + ", " + i; - if (rest = olen - i - 1) { - ivar = o.scope.freeVariable('i'); - val += ", " + ivar + " = " + vvarText + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])"; - } else { - val += ") : []"; - } - val = new Literal(val); - splat = "" + ivar + "++"; - } else { - name = obj.unwrap().value; - if (obj instanceof Splat) { - obj.error("multiple splats are disallowed in an assignment"); - } - if (typeof idx === 'number') { - idx = new Literal(splat || idx); - acc = false; - } else { - acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0); - } - val = new Value(new Literal(vvarText), [new (acc ? Access : Index)(idx)]); - } - if ((name != null) && __indexOf.call(RESERVED, name) >= 0) { - obj.error("assignment to a reserved word: " + (obj.compile(o))); - } - assigns.push(new Assign(obj, val, null, { - param: this.param, - subpattern: true - }).compileToFragments(o, LEVEL_LIST)); - } - if (!(top || this.subpattern)) { - assigns.push(vvar); - } - fragments = this.joinFragmentArrays(assigns, ', '); - if (o.level < LEVEL_LIST) { - return fragments; - } else { - return this.wrapInBraces(fragments); - } - }; - - Assign.prototype.compileConditional = function(o) { - var fragments, left, right, _ref2; - _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1]; - if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) { - this.variable.error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been declared before"); - } - if (__indexOf.call(this.context, "?") >= 0) { - o.isExistentialEquals = true; - return new If(new Existence(left), right, { - type: 'if' - }).addElse(new Assign(right, this.value, '=')).compileToFragments(o); - } else { - fragments = new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compileToFragments(o); - if (o.level <= LEVEL_LIST) { - return fragments; - } else { - return this.wrapInBraces(fragments); - } - } - }; - - Assign.prototype.compileSplice = function(o) { - var answer, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4; - _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive; - name = this.variable.compile(o); - if (from) { - _ref3 = this.cacheToCodeFragments(from.cache(o, LEVEL_OP)), fromDecl = _ref3[0], fromRef = _ref3[1]; - } else { - fromDecl = fromRef = '0'; - } - if (to) { - if (from instanceof Value && from.isSimpleNumber() && to instanceof Value && to.isSimpleNumber()) { - to = to.compile(o) - fromRef; - if (!exclusive) { - to += 1; - } - } else { - to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef; - if (!exclusive) { - to += ' + 1'; - } - } - } else { - to = "9e9"; - } - _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1]; - answer = [].concat(this.makeCode("[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat("), valDef, this.makeCode(")), "), valRef); - if (o.level > LEVEL_TOP) { - return this.wrapInBraces(answer); - } else { - return answer; - } - }; - - return Assign; - - })(Base); - - exports.Code = Code = (function(_super) { - __extends(Code, _super); - - function Code(params, body, tag) { - this.params = params || []; - this.body = body || new Block; - this.bound = tag === 'boundfunc'; - } - - Code.prototype.children = ['params', 'body']; - - Code.prototype.isStatement = function() { - return !!this.ctor; - }; - - Code.prototype.jumps = NO; - - Code.prototype.makeScope = function(parentScope) { - return new Scope(parentScope, this.body, this); - }; - - Code.prototype.compileNode = function(o) { - var answer, boundfunc, code, exprs, i, lit, p, param, params, ref, splats, uniqs, val, wasEmpty, wrapper, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; - if (this.bound && ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0)) { - this.context = o.scope.method.context; - } - if (this.bound && !this.context) { - this.context = '_this'; - wrapper = new Code([new Param(new Literal(this.context))], new Block([this])); - boundfunc = new Call(wrapper, [new Literal('this')]); - boundfunc.updateLocationDataIfMissing(this.locationData); - return boundfunc.compileNode(o); - } - o.scope = del(o, 'classScope') || this.makeScope(o.scope); - o.scope.shared = del(o, 'sharedScope'); - o.indent += TAB; - delete o.bare; - delete o.isExistentialEquals; - params = []; - exprs = []; - _ref3 = this.params; - for (_i = 0, _len = _ref3.length; _i < _len; _i++) { - param = _ref3[_i]; - o.scope.parameter(param.asReference(o)); - } - _ref4 = this.params; - for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { - param = _ref4[_j]; - if (!param.splat) { - continue; - } - _ref5 = this.params; - for (_k = 0, _len2 = _ref5.length; _k < _len2; _k++) { - p = _ref5[_k].name; - if (p["this"]) { - p = p.properties[0].name; - } - if (p.value) { - o.scope.add(p.value, 'var', true); - } - } - splats = new Assign(new Value(new Arr((function() { - var _l, _len3, _ref6, _results; - _ref6 = this.params; - _results = []; - for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) { - p = _ref6[_l]; - _results.push(p.asReference(o)); - } - return _results; - }).call(this))), new Value(new Literal('arguments'))); - break; - } - _ref6 = this.params; - for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) { - param = _ref6[_l]; - if (param.isComplex()) { - val = ref = param.asReference(o); - if (param.value) { - val = new Op('?', ref, param.value); - } - exprs.push(new Assign(new Value(param.name), val, '=', { - param: true - })); - } else { - ref = param; - if (param.value) { - lit = new Literal(ref.name.value + ' == null'); - val = new Assign(new Value(param.name), param.value, '='); - exprs.push(new If(lit, val)); - } - } - if (!splats) { - params.push(ref); - } - } - wasEmpty = this.body.isEmpty(); - if (splats) { - exprs.unshift(splats); - } - if (exprs.length) { - (_ref7 = this.body.expressions).unshift.apply(_ref7, exprs); - } - for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) { - p = params[i]; - params[i] = p.compileToFragments(o); - o.scope.parameter(fragmentsToText(params[i])); - } - uniqs = []; - this.eachParamName(function(name, node) { - if (__indexOf.call(uniqs, name) >= 0) { - node.error("multiple parameters named '" + name + "'"); - } - return uniqs.push(name); - }); - if (!(wasEmpty || this.noReturn)) { - this.body.makeReturn(); - } - code = 'function'; - if (this.ctor) { - code += ' ' + this.name; - } - code += '('; - answer = [this.makeCode(code)]; - for (i = _n = 0, _len5 = params.length; _n < _len5; i = ++_n) { - p = params[i]; - if (i) { - answer.push(this.makeCode(", ")); - } - answer.push.apply(answer, p); - } - answer.push(this.makeCode(') {')); - if (!this.body.isEmpty()) { - answer = answer.concat(this.makeCode("\n"), this.body.compileWithDeclarations(o), this.makeCode("\n" + this.tab)); - } - answer.push(this.makeCode('}')); - if (this.ctor) { - return [this.makeCode(this.tab)].concat(__slice.call(answer)); - } - if (this.front || (o.level >= LEVEL_ACCESS)) { - return this.wrapInBraces(answer); - } else { - return answer; - } - }; - - Code.prototype.eachParamName = function(iterator) { - var param, _i, _len, _ref2, _results; - _ref2 = this.params; - _results = []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - param = _ref2[_i]; - _results.push(param.eachName(iterator)); - } - return _results; - }; - - Code.prototype.traverseChildren = function(crossScope, func) { - if (crossScope) { - return Code.__super__.traverseChildren.call(this, crossScope, func); - } - }; - - return Code; - - })(Base); - - exports.Param = Param = (function(_super) { - __extends(Param, _super); - - function Param(name, value, splat) { - var _ref2; - this.name = name; - this.value = value; - this.splat = splat; - if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) { - this.name.error("parameter name \"" + name + "\" is not allowed"); - } - } - - Param.prototype.children = ['name', 'value']; - - Param.prototype.compileToFragments = function(o) { - return this.name.compileToFragments(o, LEVEL_LIST); - }; - - Param.prototype.asReference = function(o) { - var node; - if (this.reference) { - return this.reference; - } - node = this.name; - if (node["this"]) { - node = node.properties[0].name; - if (node.value.reserved) { - node = new Literal(o.scope.freeVariable(node.value)); - } - } else if (node.isComplex()) { - node = new Literal(o.scope.freeVariable('arg')); - } - node = new Value(node); - if (this.splat) { - node = new Splat(node); - } - node.updateLocationDataIfMissing(this.locationData); - return this.reference = node; - }; - - Param.prototype.isComplex = function() { - return this.name.isComplex(); - }; - - Param.prototype.eachName = function(iterator, name) { - var atParam, node, obj, _i, _len, _ref2; - if (name == null) { - name = this.name; - } - atParam = function(obj) { - var node; - node = obj.properties[0].name; - if (!node.value.reserved) { - return iterator(node.value, node); - } - }; - if (name instanceof Literal) { - return iterator(name.value, name); - } - if (name instanceof Value) { - return atParam(name); - } - _ref2 = name.objects; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - if (obj instanceof Assign) { - this.eachName(iterator, obj.value.unwrap()); - } else if (obj instanceof Splat) { - node = obj.name.unwrap(); - iterator(node.value, node); - } else if (obj instanceof Value) { - if (obj.isArray() || obj.isObject()) { - this.eachName(iterator, obj.base); - } else if (obj["this"]) { - atParam(obj); - } else { - iterator(obj.base.value, obj.base); - } - } else { - obj.error("illegal parameter " + (obj.compile())); - } - } - }; - - return Param; - - })(Base); - - exports.Splat = Splat = (function(_super) { - __extends(Splat, _super); - - Splat.prototype.children = ['name']; - - Splat.prototype.isAssignable = YES; - - function Splat(name) { - this.name = name.compile ? name : new Literal(name); - } - - Splat.prototype.assigns = function(name) { - return this.name.assigns(name); - }; - - Splat.prototype.compileToFragments = function(o) { - return this.name.compileToFragments(o); - }; - - Splat.prototype.unwrap = function() { - return this.name; - }; - - Splat.compileSplattedArray = function(o, list, apply) { - var args, base, compiledNode, concatPart, fragments, i, index, node, _i, _len; - index = -1; - while ((node = list[++index]) && !(node instanceof Splat)) { - continue; - } - if (index >= list.length) { - return []; - } - if (list.length === 1) { - node = list[0]; - fragments = node.compileToFragments(o, LEVEL_LIST); - if (apply) { - return fragments; - } - return [].concat(node.makeCode("" + (utility('slice')) + ".call("), fragments, node.makeCode(")")); - } - args = list.slice(index); - for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) { - node = args[i]; - compiledNode = node.compileToFragments(o, LEVEL_LIST); - args[i] = node instanceof Splat ? [].concat(node.makeCode("" + (utility('slice')) + ".call("), compiledNode, node.makeCode(")")) : [].concat(node.makeCode("["), compiledNode, node.makeCode("]")); - } - if (index === 0) { - node = list[0]; - concatPart = node.joinFragmentArrays(args.slice(1), ', '); - return args[0].concat(node.makeCode(".concat("), concatPart, node.makeCode(")")); - } - base = (function() { - var _j, _len1, _ref2, _results; - _ref2 = list.slice(0, index); - _results = []; - for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { - node = _ref2[_j]; - _results.push(node.compileToFragments(o, LEVEL_LIST)); - } - return _results; - })(); - base = list[0].joinFragmentArrays(base, ', '); - concatPart = list[index].joinFragmentArrays(args, ', '); - return [].concat(list[0].makeCode("["), base, list[index].makeCode("].concat("), concatPart, (last(list)).makeCode(")")); - }; - - return Splat; - - })(Base); - - exports.While = While = (function(_super) { - __extends(While, _super); - - function While(condition, options) { - this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition; - this.guard = options != null ? options.guard : void 0; - } - - While.prototype.children = ['condition', 'guard', 'body']; - - While.prototype.isStatement = YES; - - While.prototype.makeReturn = function(res) { - if (res) { - return While.__super__.makeReturn.apply(this, arguments); - } else { - this.returns = !this.jumps({ - loop: true - }); - return this; - } - }; - - While.prototype.addBody = function(body) { - this.body = body; - return this; - }; - - While.prototype.jumps = function() { - var expressions, jumpNode, node, _i, _len; - expressions = this.body.expressions; - if (!expressions.length) { - return false; - } - for (_i = 0, _len = expressions.length; _i < _len; _i++) { - node = expressions[_i]; - if (jumpNode = node.jumps({ - loop: true - })) { - return jumpNode; - } - } - return false; - }; - - While.prototype.compileNode = function(o) { - var answer, body, rvar, set; - o.indent += TAB; - set = ''; - body = this.body; - if (body.isEmpty()) { - body = this.makeCode(''); - } else { - if (this.returns) { - body.makeReturn(rvar = o.scope.freeVariable('results')); - set = "" + this.tab + rvar + " = [];\n"; - } - if (this.guard) { - if (body.expressions.length > 1) { - body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); - } else { - if (this.guard) { - body = Block.wrap([new If(this.guard, body)]); - } - } - } - body = [].concat(this.makeCode("\n"), body.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab)); - } - answer = [].concat(this.makeCode(set + this.tab + "while ("), this.condition.compileToFragments(o, LEVEL_PAREN), this.makeCode(") {"), body, this.makeCode("}")); - if (this.returns) { - answer.push(this.makeCode("\n" + this.tab + "return " + rvar + ";")); - } - return answer; - }; - - return While; - - })(Base); - - exports.Op = Op = (function(_super) { - var CONVERSIONS, INVERSIONS; - - __extends(Op, _super); - - function Op(op, first, second, flip) { - if (op === 'in') { - return new In(first, second); - } - if (op === 'do') { - return this.generateDo(first); - } - if (op === 'new') { - if (first instanceof Call && !first["do"] && !first.isNew) { - return first.newInstance(); - } - if (first instanceof Code && first.bound || first["do"]) { - first = new Parens(first); - } - } - this.operator = CONVERSIONS[op] || op; - this.first = first; - this.second = second; - this.flip = !!flip; - return this; - } - - CONVERSIONS = { - '==': '===', - '!=': '!==', - 'of': 'in' - }; - - INVERSIONS = { - '!==': '===', - '===': '!==' - }; - - Op.prototype.children = ['first', 'second']; - - Op.prototype.isSimpleNumber = NO; - - Op.prototype.isUnary = function() { - return !this.second; - }; - - Op.prototype.isComplex = function() { - var _ref2; - return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex(); - }; - - Op.prototype.isChainable = function() { - var _ref2; - return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!=='; - }; - - Op.prototype.invert = function() { - var allInvertable, curr, fst, op, _ref2; - if (this.isChainable() && this.first.isChainable()) { - allInvertable = true; - curr = this; - while (curr && curr.operator) { - allInvertable && (allInvertable = curr.operator in INVERSIONS); - curr = curr.first; - } - if (!allInvertable) { - return new Parens(this).invert(); - } - curr = this; - while (curr && curr.operator) { - curr.invert = !curr.invert; - curr.operator = INVERSIONS[curr.operator]; - curr = curr.first; - } - return this; - } else if (op = INVERSIONS[this.operator]) { - this.operator = op; - if (this.first.unwrap() instanceof Op) { - this.first.invert(); - } - return this; - } else if (this.second) { - return new Parens(this).invert(); - } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) { - return fst; - } else { - return new Op('!', this); - } - }; - - Op.prototype.unfoldSoak = function(o) { - var _ref2; - return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first'); - }; - - Op.prototype.generateDo = function(exp) { - var call, func, param, passedParams, ref, _i, _len, _ref2; - passedParams = []; - func = exp instanceof Assign && (ref = exp.value.unwrap()) instanceof Code ? ref : exp; - _ref2 = func.params || []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - param = _ref2[_i]; - if (param.value) { - passedParams.push(param.value); - delete param.value; - } else { - passedParams.push(param); - } - } - call = new Call(exp, passedParams); - call["do"] = true; - return call; - }; - - Op.prototype.compileNode = function(o) { - var answer, isChain, _ref2, _ref3; - isChain = this.isChainable() && this.first.isChainable(); - if (!isChain) { - this.first.front = this.front; - } - if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) { - this.error('delete operand may not be argument or var'); - } - if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) { - this.error("cannot increment/decrement \"" + (this.first.unwrapAll().value) + "\""); - } - if (this.isUnary()) { - return this.compileUnary(o); - } - if (isChain) { - return this.compileChain(o); - } - if (this.operator === '?') { - return this.compileExistence(o); - } - answer = [].concat(this.first.compileToFragments(o, LEVEL_OP), this.makeCode(' ' + this.operator + ' '), this.second.compileToFragments(o, LEVEL_OP)); - if (o.level <= LEVEL_OP) { - return answer; - } else { - return this.wrapInBraces(answer); - } - }; - - Op.prototype.compileChain = function(o) { - var fragments, fst, shared, _ref2; - _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1]; - fst = this.first.compileToFragments(o, LEVEL_OP); - fragments = fst.concat(this.makeCode(" " + (this.invert ? '&&' : '||') + " "), shared.compileToFragments(o), this.makeCode(" " + this.operator + " "), this.second.compileToFragments(o, LEVEL_OP)); - return this.wrapInBraces(fragments); - }; - - Op.prototype.compileExistence = function(o) { - var fst, ref; - if (this.first.isComplex()) { - ref = new Literal(o.scope.freeVariable('ref')); - fst = new Parens(new Assign(ref, this.first)); - } else { - fst = this.first; - ref = fst; - } - return new If(new Existence(fst), ref, { - type: 'if' - }).addElse(this.second).compileToFragments(o); - }; - - Op.prototype.compileUnary = function(o) { - var op, parts, plusMinus; - parts = []; - op = this.operator; - parts.push([this.makeCode(op)]); - if (op === '!' && this.first instanceof Existence) { - this.first.negated = !this.first.negated; - return this.first.compileToFragments(o); - } - if (o.level >= LEVEL_ACCESS) { - return (new Parens(this)).compileToFragments(o); - } - plusMinus = op === '+' || op === '-'; - if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) { - parts.push([this.makeCode(' ')]); - } - if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) { - this.first = new Parens(this.first); - } - parts.push(this.first.compileToFragments(o, LEVEL_OP)); - if (this.flip) { - parts.reverse(); - } - return this.joinFragmentArrays(parts, ''); - }; - - Op.prototype.toString = function(idt) { - return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator); - }; - - return Op; - - })(Base); - - exports.In = In = (function(_super) { - __extends(In, _super); - - function In(object, array) { - this.object = object; - this.array = array; - } - - In.prototype.children = ['object', 'array']; - - In.prototype.invert = NEGATE; - - In.prototype.compileNode = function(o) { - var hasSplat, obj, _i, _len, _ref2; - if (this.array instanceof Value && this.array.isArray()) { - _ref2 = this.array.base.objects; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - if (!(obj instanceof Splat)) { - continue; - } - hasSplat = true; - break; - } - if (!hasSplat) { - return this.compileOrTest(o); - } - } - return this.compileLoopTest(o); - }; - - In.prototype.compileOrTest = function(o) { - var cmp, cnj, i, item, ref, sub, tests, _i, _len, _ref2, _ref3, _ref4; - if (this.array.base.objects.length === 0) { - return [this.makeCode("" + (!!this.negated))]; - } - _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1]; - _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1]; - tests = []; - _ref4 = this.array.base.objects; - for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) { - item = _ref4[i]; - if (i) { - tests.push(this.makeCode(cnj)); - } - tests = tests.concat((i ? ref : sub), this.makeCode(cmp), item.compileToFragments(o, LEVEL_ACCESS)); - } - if (o.level < LEVEL_OP) { - return tests; - } else { - return this.wrapInBraces(tests); - } - }; - - In.prototype.compileLoopTest = function(o) { - var fragments, ref, sub, _ref2; - _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1]; - fragments = [].concat(this.makeCode(utility('indexOf') + ".call("), this.array.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), ref, this.makeCode(") " + (this.negated ? '< 0' : '>= 0'))); - if (fragmentsToText(sub) === fragmentsToText(ref)) { - return fragments; - } - fragments = sub.concat(this.makeCode(', '), fragments); - if (o.level < LEVEL_LIST) { - return fragments; - } else { - return this.wrapInBraces(fragments); - } - }; - - In.prototype.toString = function(idt) { - return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : '')); - }; - - return In; - - })(Base); - - exports.Try = Try = (function(_super) { - __extends(Try, _super); - - function Try(attempt, errorVariable, recovery, ensure) { - this.attempt = attempt; - this.errorVariable = errorVariable; - this.recovery = recovery; - this.ensure = ensure; - } - - Try.prototype.children = ['attempt', 'recovery', 'ensure']; - - Try.prototype.isStatement = YES; - - Try.prototype.jumps = function(o) { - var _ref2; - return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0); - }; - - Try.prototype.makeReturn = function(res) { - if (this.attempt) { - this.attempt = this.attempt.makeReturn(res); - } - if (this.recovery) { - this.recovery = this.recovery.makeReturn(res); - } - return this; - }; - - Try.prototype.compileNode = function(o) { - var catchPart, ensurePart, placeholder, tryPart; - o.indent += TAB; - tryPart = this.attempt.compileToFragments(o, LEVEL_TOP); - catchPart = this.recovery ? (placeholder = new Literal('_error'), this.errorVariable ? this.recovery.unshift(new Assign(this.errorVariable, placeholder)) : void 0, [].concat(this.makeCode(" catch ("), placeholder.compileToFragments(o), this.makeCode(") {\n"), this.recovery.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}"))) : !(this.ensure || this.recovery) ? [this.makeCode(' catch (_error) {}')] : []; - ensurePart = this.ensure ? [].concat(this.makeCode(" finally {\n"), this.ensure.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}")) : []; - return [].concat(this.makeCode("" + this.tab + "try {\n"), tryPart, this.makeCode("\n" + this.tab + "}"), catchPart, ensurePart); - }; - - return Try; - - })(Base); - - exports.Throw = Throw = (function(_super) { - __extends(Throw, _super); - - function Throw(expression) { - this.expression = expression; - } - - Throw.prototype.children = ['expression']; - - Throw.prototype.isStatement = YES; - - Throw.prototype.jumps = NO; - - Throw.prototype.makeReturn = THIS; - - Throw.prototype.compileNode = function(o) { - return [].concat(this.makeCode(this.tab + "throw "), this.expression.compileToFragments(o), this.makeCode(";")); - }; - - return Throw; - - })(Base); - - exports.Existence = Existence = (function(_super) { - __extends(Existence, _super); - - function Existence(expression) { - this.expression = expression; - } - - Existence.prototype.children = ['expression']; - - Existence.prototype.invert = NEGATE; - - Existence.prototype.compileNode = function(o) { - var cmp, cnj, code, _ref2; - this.expression.front = this.front; - code = this.expression.compile(o, LEVEL_OP); - if (IDENTIFIER.test(code) && !o.scope.check(code)) { - _ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1]; - code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null"; - } else { - code = "" + code + " " + (this.negated ? '==' : '!=') + " null"; - } - return [this.makeCode(o.level <= LEVEL_COND ? code : "(" + code + ")")]; - }; - - return Existence; - - })(Base); - - exports.Parens = Parens = (function(_super) { - __extends(Parens, _super); - - function Parens(body) { - this.body = body; - } - - Parens.prototype.children = ['body']; - - Parens.prototype.unwrap = function() { - return this.body; - }; - - Parens.prototype.isComplex = function() { - return this.body.isComplex(); - }; - - Parens.prototype.compileNode = function(o) { - var bare, expr, fragments; - expr = this.body.unwrap(); - if (expr instanceof Value && expr.isAtomic()) { - expr.front = this.front; - return expr.compileToFragments(o); - } - fragments = expr.compileToFragments(o, LEVEL_PAREN); - bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns)); - if (bare) { - return fragments; - } else { - return this.wrapInBraces(fragments); - } - }; - - return Parens; - - })(Base); - - exports.For = For = (function(_super) { - __extends(For, _super); - - function For(body, source) { - var _ref2; - this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index; - this.body = Block.wrap([body]); - this.own = !!source.own; - this.object = !!source.object; - if (this.object) { - _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1]; - } - if (this.index instanceof Value) { - this.index.error('index cannot be a pattern matching expression'); - } - this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length; - this.pattern = this.name instanceof Value; - if (this.range && this.index) { - this.index.error('indexes do not apply to range loops'); - } - if (this.range && this.pattern) { - this.name.error('cannot pattern match over range loops'); - } - if (this.own && !this.object) { - this.name.error('cannot use own with for-in'); - } - this.returns = false; - } - - For.prototype.children = ['body', 'source', 'guard', 'step']; - - For.prototype.compileNode = function(o) { - var body, bodyFragments, compare, compareDown, declare, declareDown, defPart, defPartFragments, down, forPartFragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart, _ref2, _ref3; - body = Block.wrap([this.body]); - lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0; - if (lastJumps && lastJumps instanceof Return) { - this.returns = false; - } - source = this.range ? this.source.base : this.source; - scope = o.scope; - name = this.name && (this.name.compile(o, LEVEL_LIST)); - index = this.index && (this.index.compile(o, LEVEL_LIST)); - if (name && !this.pattern) { - scope.find(name); - } - if (index) { - scope.find(index); - } - if (this.returns) { - rvar = scope.freeVariable('results'); - } - ivar = (this.object && index) || scope.freeVariable('i'); - kvar = (this.range && name) || index || ivar; - kvarAssign = kvar !== ivar ? "" + kvar + " = " : ""; - if (this.step && !this.range) { - _ref3 = this.cacheToCodeFragments(this.step.cache(o, LEVEL_LIST)), step = _ref3[0], stepVar = _ref3[1]; - stepNum = stepVar.match(NUMBER); - } - if (this.pattern) { - name = ivar; - } - varPart = ''; - guardPart = ''; - defPart = ''; - idt1 = this.tab + TAB; - if (this.range) { - forPartFragments = source.compileToFragments(merge(o, { - index: ivar, - name: name, - step: this.step - })); - } else { - svar = this.source.compile(o, LEVEL_LIST); - if ((name || this.own) && !IDENTIFIER.test(svar)) { - defPart += "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n"; - svar = ref; - } - if (name && !this.pattern) { - namePart = "" + name + " = " + svar + "[" + kvar + "]"; - } - if (!this.object) { - if (step !== stepVar) { - defPart += "" + this.tab + step + ";\n"; - } - if (!(this.step && stepNum && (down = parseNum(stepNum[0]) < 0))) { - lvar = scope.freeVariable('len'); - } - declare = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length"; - declareDown = "" + kvarAssign + ivar + " = " + svar + ".length - 1"; - compare = "" + ivar + " < " + lvar; - compareDown = "" + ivar + " >= 0"; - if (this.step) { - if (stepNum) { - if (down) { - compare = compareDown; - declare = declareDown; - } - } else { - compare = "" + stepVar + " > 0 ? " + compare + " : " + compareDown; - declare = "(" + stepVar + " > 0 ? (" + declare + ") : " + declareDown + ")"; - } - increment = "" + ivar + " += " + stepVar; - } else { - increment = "" + (kvar !== ivar ? "++" + ivar : "" + ivar + "++"); - } - forPartFragments = [this.makeCode("" + declare + "; " + compare + "; " + kvarAssign + increment)]; - } - } - if (this.returns) { - resultPart = "" + this.tab + rvar + " = [];\n"; - returnResult = "\n" + this.tab + "return " + rvar + ";"; - body.makeReturn(rvar); - } - if (this.guard) { - if (body.expressions.length > 1) { - body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); - } else { - if (this.guard) { - body = Block.wrap([new If(this.guard, body)]); - } - } - } - if (this.pattern) { - body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]"))); - } - defPartFragments = [].concat(this.makeCode(defPart), this.pluckDirectCall(o, body)); - if (namePart) { - varPart = "\n" + idt1 + namePart + ";"; - } - if (this.object) { - forPartFragments = [this.makeCode("" + kvar + " in " + svar)]; - if (this.own) { - guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;"; - } - } - bodyFragments = body.compileToFragments(merge(o, { - indent: idt1 - }), LEVEL_TOP); - if (bodyFragments && (bodyFragments.length > 0)) { - bodyFragments = [].concat(this.makeCode("\n"), bodyFragments, this.makeCode("\n")); - } - return [].concat(defPartFragments, this.makeCode("" + (resultPart || '') + this.tab + "for ("), forPartFragments, this.makeCode(") {" + guardPart + varPart), bodyFragments, this.makeCode("" + this.tab + "}" + (returnResult || ''))); - }; - - For.prototype.pluckDirectCall = function(o, body) { - var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; - defs = []; - _ref2 = body.expressions; - for (idx = _i = 0, _len = _ref2.length; _i < _len; idx = ++_i) { - expr = _ref2[idx]; - expr = expr.unwrapAll(); - if (!(expr instanceof Call)) { - continue; - } - val = (_ref3 = expr.variable) != null ? _ref3.unwrapAll() : void 0; - if (!((val instanceof Code) || (val instanceof Value && ((_ref4 = val.base) != null ? _ref4.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref5 = (_ref6 = val.properties[0].name) != null ? _ref6.value : void 0) === 'call' || _ref5 === 'apply')))) { - continue; - } - fn = ((_ref7 = val.base) != null ? _ref7.unwrapAll() : void 0) || val; - ref = new Literal(o.scope.freeVariable('fn')); - base = new Value(ref); - if (val.base) { - _ref8 = [base, val], val.base = _ref8[0], base = _ref8[1]; - } - body.expressions[idx] = new Call(base, expr.args); - defs = defs.concat(this.makeCode(this.tab), new Assign(ref, fn).compileToFragments(o, LEVEL_TOP), this.makeCode(';\n')); - } - return defs; - }; - - return For; - - })(While); - - exports.Switch = Switch = (function(_super) { - __extends(Switch, _super); - - function Switch(subject, cases, otherwise) { - this.subject = subject; - this.cases = cases; - this.otherwise = otherwise; - } - - Switch.prototype.children = ['subject', 'cases', 'otherwise']; - - Switch.prototype.isStatement = YES; - - Switch.prototype.jumps = function(o) { - var block, conds, jumpNode, _i, _len, _ref2, _ref3, _ref4; - if (o == null) { - o = { - block: true - }; - } - _ref2 = this.cases; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1]; - if (jumpNode = block.jumps(o)) { - return jumpNode; - } - } - return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0; - }; - - Switch.prototype.makeReturn = function(res) { - var pair, _i, _len, _ref2, _ref3; - _ref2 = this.cases; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - pair = _ref2[_i]; - pair[1].makeReturn(res); - } - if (res) { - this.otherwise || (this.otherwise = new Block([new Literal('void 0')])); - } - if ((_ref3 = this.otherwise) != null) { - _ref3.makeReturn(res); - } - return this; - }; - - Switch.prototype.compileNode = function(o) { - var block, body, cond, conditions, expr, fragments, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4; - idt1 = o.indent + TAB; - idt2 = o.indent = idt1 + TAB; - fragments = [].concat(this.makeCode(this.tab + "switch ("), (this.subject ? this.subject.compileToFragments(o, LEVEL_PAREN) : this.makeCode("false")), this.makeCode(") {\n")); - _ref2 = this.cases; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - _ref3 = _ref2[i], conditions = _ref3[0], block = _ref3[1]; - _ref4 = flatten([conditions]); - for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { - cond = _ref4[_j]; - if (!this.subject) { - cond = cond.invert(); - } - fragments = fragments.concat(this.makeCode(idt1 + "case "), cond.compileToFragments(o, LEVEL_PAREN), this.makeCode(":\n")); - } - if ((body = block.compileToFragments(o, LEVEL_TOP)).length > 0) { - fragments = fragments.concat(body, this.makeCode('\n')); - } - if (i === this.cases.length - 1 && !this.otherwise) { - break; - } - expr = this.lastNonComment(block.expressions); - if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) { - continue; - } - fragments.push(cond.makeCode(idt2 + 'break;\n')); - } - if (this.otherwise && this.otherwise.expressions.length) { - fragments.push.apply(fragments, [this.makeCode(idt1 + "default:\n")].concat(__slice.call(this.otherwise.compileToFragments(o, LEVEL_TOP)), [this.makeCode("\n")])); - } - fragments.push(this.makeCode(this.tab + '}')); - return fragments; - }; - - return Switch; - - })(Base); - - exports.If = If = (function(_super) { - __extends(If, _super); - - function If(condition, body, options) { - this.body = body; - if (options == null) { - options = {}; - } - this.condition = options.type === 'unless' ? condition.invert() : condition; - this.elseBody = null; - this.isChain = false; - this.soak = options.soak; - } - - If.prototype.children = ['condition', 'body', 'elseBody']; - - If.prototype.bodyNode = function() { - var _ref2; - return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0; - }; - - If.prototype.elseBodyNode = function() { - var _ref2; - return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0; - }; - - If.prototype.addElse = function(elseBody) { - if (this.isChain) { - this.elseBodyNode().addElse(elseBody); - } else { - this.isChain = elseBody instanceof If; - this.elseBody = this.ensureBlock(elseBody); - this.elseBody.updateLocationDataIfMissing(elseBody.locationData); - } - return this; - }; - - If.prototype.isStatement = function(o) { - var _ref2; - return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0); - }; - - If.prototype.jumps = function(o) { - var _ref2; - return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0); - }; - - If.prototype.compileNode = function(o) { - if (this.isStatement(o)) { - return this.compileStatement(o); - } else { - return this.compileExpression(o); - } - }; - - If.prototype.makeReturn = function(res) { - if (res) { - this.elseBody || (this.elseBody = new Block([new Literal('void 0')])); - } - this.body && (this.body = new Block([this.body.makeReturn(res)])); - this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn(res)])); - return this; - }; - - If.prototype.ensureBlock = function(node) { - if (node instanceof Block) { - return node; - } else { - return new Block([node]); - } - }; - - If.prototype.compileStatement = function(o) { - var answer, body, child, cond, exeq, ifPart, indent; - child = del(o, 'chainChild'); - exeq = del(o, 'isExistentialEquals'); - if (exeq) { - return new If(this.condition.invert(), this.elseBodyNode(), { - type: 'if' - }).compileToFragments(o); - } - indent = o.indent + TAB; - cond = this.condition.compileToFragments(o, LEVEL_PAREN); - body = this.ensureBlock(this.body).compileToFragments(merge(o, { - indent: indent - })); - ifPart = [].concat(this.makeCode("if ("), cond, this.makeCode(") {\n"), body, this.makeCode("\n" + this.tab + "}")); - if (!child) { - ifPart.unshift(this.makeCode(this.tab)); - } - if (!this.elseBody) { - return ifPart; - } - answer = ifPart.concat(this.makeCode(' else ')); - if (this.isChain) { - o.chainChild = true; - answer = answer.concat(this.elseBody.unwrap().compileToFragments(o, LEVEL_TOP)); - } else { - answer = answer.concat(this.makeCode("{\n"), this.elseBody.compileToFragments(merge(o, { - indent: indent - }), LEVEL_TOP), this.makeCode("\n" + this.tab + "}")); - } - return answer; - }; - - If.prototype.compileExpression = function(o) { - var alt, body, cond, fragments; - cond = this.condition.compileToFragments(o, LEVEL_COND); - body = this.bodyNode().compileToFragments(o, LEVEL_LIST); - alt = this.elseBodyNode() ? this.elseBodyNode().compileToFragments(o, LEVEL_LIST) : [this.makeCode('void 0')]; - fragments = cond.concat(this.makeCode(" ? "), body, this.makeCode(" : "), alt); - if (o.level >= LEVEL_COND) { - return this.wrapInBraces(fragments); - } else { - return fragments; - } - }; - - If.prototype.unfoldSoak = function() { - return this.soak && this; - }; - - return If; - - })(Base); - - UTILITIES = { - "extends": function() { - return "function(child, parent) { for (var key in parent) { if (" + (utility('hasProp')) + ".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }"; - }, - bind: function() { - return 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }'; - }, - indexOf: function() { - return "[].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }"; - }, - hasProp: function() { - return '{}.hasOwnProperty'; - }, - slice: function() { - return '[].slice'; - } - }; - - LEVEL_TOP = 1; - - LEVEL_PAREN = 2; - - LEVEL_LIST = 3; - - LEVEL_COND = 4; - - LEVEL_OP = 5; - - LEVEL_ACCESS = 6; - - TAB = ' '; - - IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; - - IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$"); - - SIMPLENUM = /^[+-]?\d+$/; - - HEXNUM = /^[+-]?0x[\da-f]+/i; - - NUMBER = /^[+-]?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)$/i; - - METHOD_DEF = RegExp("^(" + IDENTIFIER_STR + ")(\\.prototype)?(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\])$"); - - IS_STRING = /^['"]/; - - IS_REGEX = /^\//; - - utility = function(name) { - var ref; - ref = "__" + name; - Scope.root.assign(ref, UTILITIES[name]()); - return ref; - }; - - multident = function(code, tab) { - code = code.replace(/\n/g, '$&' + tab); - return code.replace(/\s+$/, ''); - }; - - parseNum = function(x) { - if (x == null) { - return 0; - } else if (x.match(HEXNUM)) { - return parseInt(x, 16); - } else { - return parseFloat(x); - } - }; - - isLiteralArguments = function(node) { - return node instanceof Literal && node.value === 'arguments' && !node.asKey; - }; - - isLiteralThis = function(node) { - return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper); - }; - - unfoldSoak = function(o, parent, name) { - var ifn; - if (!(ifn = parent[name].unfoldSoak(o))) { - return; - } - parent[name] = ifn.body; - ifn.body = new Value(parent); - return ifn; - }; - - -});// https://github.com/kriskowal/es5-shim - -ace.define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) { - -function Empty() {} - -if (!Function.prototype.bind) { - Function.prototype.bind = function bind(that) { // .length is 1 - var target = this; - if (typeof target != "function") { - throw new TypeError("Function.prototype.bind called on incompatible " + target); - } - var args = slice.call(arguments, 1); // for normal call - var bound = function () { - - if (this instanceof bound) { - - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - - } - - }; - if(target.prototype) { - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; -} -var call = Function.prototype.call; -var prototypeOfArray = Array.prototype; -var prototypeOfObject = Object.prototype; -var slice = prototypeOfArray.slice; -var _toString = call.bind(prototypeOfObject.toString); -var owns = call.bind(prototypeOfObject.hasOwnProperty); -var defineGetter; -var defineSetter; -var lookupGetter; -var lookupSetter; -var supportsAccessors; -if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { - defineGetter = call.bind(prototypeOfObject.__defineGetter__); - defineSetter = call.bind(prototypeOfObject.__defineSetter__); - lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); - lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); -} -if ([1,2].splice(0).length != 2) { - if(function() { // test IE < 9 to splice bug - see issue #138 - function makeArray(l) { - var a = new Array(l+2); - a[0] = a[1] = 0; - return a; - } - var array = [], lengthBefore; - - array.splice.apply(array, makeArray(20)); - array.splice.apply(array, makeArray(26)); - - lengthBefore = array.length; //46 - array.splice(5, 0, "XXX"); // add one element - - lengthBefore + 1 == array.length - - if (lengthBefore + 1 == array.length) { - return true;// has right splice implementation without bugs - } - }()) {//IE 6/7 - var array_splice = Array.prototype.splice; - Array.prototype.splice = function(start, deleteCount) { - if (!arguments.length) { - return []; - } else { - return array_splice.apply(this, [ - start === void 0 ? 0 : start, - deleteCount === void 0 ? (this.length - start) : deleteCount - ].concat(slice.call(arguments, 2))) - } - }; - } else {//IE8 - Array.prototype.splice = function(pos, removeCount){ - var length = this.length; - if (pos > 0) { - if (pos > length) - pos = length; - } else if (pos == void 0) { - pos = 0; - } else if (pos < 0) { - pos = Math.max(length + pos, 0); - } - - if (!(pos+removeCount < length)) - removeCount = length - pos; - - var removed = this.slice(pos, pos+removeCount); - var insert = slice.call(arguments, 2); - var add = insert.length; - if (pos === length) { - if (add) { - this.push.apply(this, insert); - } - } else { - var remove = Math.min(removeCount, length - pos); - var tailOldPos = pos + remove; - var tailNewPos = tailOldPos + add - remove; - var tailCount = length - tailOldPos; - var lengthAfterRemove = length - remove; - - if (tailNewPos < tailOldPos) { // case A - for (var i = 0; i < tailCount; ++i) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } else if (tailNewPos > tailOldPos) { // case B - for (i = tailCount; i--; ) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } // else, add == remove (nothing to do) - - if (add && pos === lengthAfterRemove) { - this.length = lengthAfterRemove; // truncate array - this.push.apply(this, insert); - } else { - this.length = lengthAfterRemove + add; // reserves space - for (i = 0; i < add; ++i) { - this[pos+i] = insert[i]; - } - } - } - return removed; - }; - } -} -if (!Array.isArray) { - Array.isArray = function isArray(obj) { - return _toString(obj) == "[object Array]"; - }; -} -var boxedString = Object("a"), - splitString = boxedString[0] != "a" || !(0 in boxedString); - -if (!Array.prototype.forEach) { - Array.prototype.forEach = function forEach(fun /*, thisp*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - thisp = arguments[1], - i = -1, - length = self.length >>> 0; - if (_toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - while (++i < length) { - if (i in self) { - fun.call(thisp, self[i], i, object); - } - } - }; -} -if (!Array.prototype.map) { - Array.prototype.map = function map(fun /*, thisp*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - result = Array(length), - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self) - result[i] = fun.call(thisp, self[i], i, object); - } - return result; - }; -} -if (!Array.prototype.filter) { - Array.prototype.filter = function filter(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - result = [], - value, - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self) { - value = self[i]; - if (fun.call(thisp, value, i, object)) { - result.push(value); - } - } - } - return result; - }; -} -if (!Array.prototype.every) { - Array.prototype.every = function every(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self && !fun.call(thisp, self[i], i, object)) { - return false; - } - } - return true; - }; -} -if (!Array.prototype.some) { - Array.prototype.some = function some(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self && fun.call(thisp, self[i], i, object)) { - return true; - } - } - return false; - }; -} -if (!Array.prototype.reduce) { - Array.prototype.reduce = function reduce(fun /*, initial*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - if (!length && arguments.length == 1) { - throw new TypeError("reduce of empty array with no initial value"); - } - - var i = 0; - var result; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i++]; - break; - } - if (++i >= length) { - throw new TypeError("reduce of empty array with no initial value"); - } - } while (true); - } - - for (; i < length; i++) { - if (i in self) { - result = fun.call(void 0, result, self[i], i, object); - } - } - - return result; - }; -} -if (!Array.prototype.reduceRight) { - Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - if (!length && arguments.length == 1) { - throw new TypeError("reduceRight of empty array with no initial value"); - } - - var result, i = length - 1; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i--]; - break; - } - if (--i < 0) { - throw new TypeError("reduceRight of empty array with no initial value"); - } - } while (true); - } - - do { - if (i in this) { - result = fun.call(void 0, result, self[i], i, object); - } - } while (i--); - - return result; - }; -} -if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { - Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - toObject(this), - length = self.length >>> 0; - - if (!length) { - return -1; - } - - var i = 0; - if (arguments.length > 1) { - i = toInteger(arguments[1]); - } - i = i >= 0 ? i : Math.max(0, length + i); - for (; i < length; i++) { - if (i in self && self[i] === sought) { - return i; - } - } - return -1; - }; -} -if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { - Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - toObject(this), - length = self.length >>> 0; - - if (!length) { - return -1; - } - var i = length - 1; - if (arguments.length > 1) { - i = Math.min(i, toInteger(arguments[1])); - } - i = i >= 0 ? i : length - Math.abs(i); - for (; i >= 0; i--) { - if (i in self && sought === self[i]) { - return i; - } - } - return -1; - }; -} -if (!Object.getPrototypeOf) { - Object.getPrototypeOf = function getPrototypeOf(object) { - return object.__proto__ || ( - object.constructor ? - object.constructor.prototype : - prototypeOfObject - ); - }; -} -if (!Object.getOwnPropertyDescriptor) { - var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + - "non-object: "; - Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { - if ((typeof object != "object" && typeof object != "function") || object === null) - throw new TypeError(ERR_NON_OBJECT + object); - if (!owns(object, property)) - return; - - var descriptor, getter, setter; - descriptor = { enumerable: true, configurable: true }; - if (supportsAccessors) { - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - - var getter = lookupGetter(object, property); - var setter = lookupSetter(object, property); - object.__proto__ = prototype; - - if (getter || setter) { - if (getter) descriptor.get = getter; - if (setter) descriptor.set = setter; - return descriptor; - } - } - descriptor.value = object[property]; - return descriptor; - }; -} -if (!Object.getOwnPropertyNames) { - Object.getOwnPropertyNames = function getOwnPropertyNames(object) { - return Object.keys(object); - }; -} -if (!Object.create) { - var createEmpty; - if (Object.prototype.__proto__ === null) { - createEmpty = function () { - return { "__proto__": null }; - }; - } else { - createEmpty = function () { - var empty = {}; - for (var i in empty) - empty[i] = null; - empty.constructor = - empty.hasOwnProperty = - empty.propertyIsEnumerable = - empty.isPrototypeOf = - empty.toLocaleString = - empty.toString = - empty.valueOf = - empty.__proto__ = null; - return empty; - } - } - - Object.create = function create(prototype, properties) { - var object; - if (prototype === null) { - object = createEmpty(); - } else { - if (typeof prototype != "object") - throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); - var Type = function () {}; - Type.prototype = prototype; - object = new Type(); - object.__proto__ = prototype; - } - if (properties !== void 0) - Object.defineProperties(object, properties); - return object; - }; -} - -function doesDefinePropertyWork(object) { - try { - Object.defineProperty(object, "sentinel", {}); - return "sentinel" in object; - } catch (exception) { - } -} -if (Object.defineProperty) { - var definePropertyWorksOnObject = doesDefinePropertyWork({}); - var definePropertyWorksOnDom = typeof document == "undefined" || - doesDefinePropertyWork(document.createElement("div")); - if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { - var definePropertyFallback = Object.defineProperty; - } -} - -if (!Object.defineProperty || definePropertyFallback) { - var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; - var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " - var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + - "on this javascript engine"; - - Object.defineProperty = function defineProperty(object, property, descriptor) { - if ((typeof object != "object" && typeof object != "function") || object === null) - throw new TypeError(ERR_NON_OBJECT_TARGET + object); - if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) - throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); - if (definePropertyFallback) { - try { - return definePropertyFallback.call(Object, object, property, descriptor); - } catch (exception) { - } - } - if (owns(descriptor, "value")) { - - if (supportsAccessors && (lookupGetter(object, property) || - lookupSetter(object, property))) - { - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - delete object[property]; - object[property] = descriptor.value; - object.__proto__ = prototype; - } else { - object[property] = descriptor.value; - } - } else { - if (!supportsAccessors) - throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); - if (owns(descriptor, "get")) - defineGetter(object, property, descriptor.get); - if (owns(descriptor, "set")) - defineSetter(object, property, descriptor.set); - } - - return object; - }; -} -if (!Object.defineProperties) { - Object.defineProperties = function defineProperties(object, properties) { - for (var property in properties) { - if (owns(properties, property)) - Object.defineProperty(object, property, properties[property]); - } - return object; - }; -} -if (!Object.seal) { - Object.seal = function seal(object) { - return object; - }; -} -if (!Object.freeze) { - Object.freeze = function freeze(object) { - return object; - }; -} -try { - Object.freeze(function () {}); -} catch (exception) { - Object.freeze = (function freeze(freezeObject) { - return function freeze(object) { - if (typeof object == "function") { - return object; - } else { - return freezeObject(object); - } - }; - })(Object.freeze); -} -if (!Object.preventExtensions) { - Object.preventExtensions = function preventExtensions(object) { - return object; - }; -} -if (!Object.isSealed) { - Object.isSealed = function isSealed(object) { - return false; - }; -} -if (!Object.isFrozen) { - Object.isFrozen = function isFrozen(object) { - return false; - }; -} -if (!Object.isExtensible) { - Object.isExtensible = function isExtensible(object) { - if (Object(object) === object) { - throw new TypeError(); // TODO message - } - var name = ''; - while (owns(object, name)) { - name += '?'; - } - object[name] = true; - var returnValue = owns(object, name); - delete object[name]; - return returnValue; - }; -} -if (!Object.keys) { - var hasDontEnumBug = true, - dontEnums = [ - "toString", - "toLocaleString", - "valueOf", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "constructor" - ], - dontEnumsLength = dontEnums.length; - - for (var key in {"toString": null}) { - hasDontEnumBug = false; - } - - Object.keys = function keys(object) { - - if ( - (typeof object != "object" && typeof object != "function") || - object === null - ) { - throw new TypeError("Object.keys called on a non-object"); - } - - var keys = []; - for (var name in object) { - if (owns(object, name)) { - keys.push(name); - } - } - - if (hasDontEnumBug) { - for (var i = 0, ii = dontEnumsLength; i < ii; i++) { - var dontEnum = dontEnums[i]; - if (owns(object, dontEnum)) { - keys.push(dontEnum); - } - } - } - return keys; - }; - -} -if (!Date.now) { - Date.now = function now() { - return new Date().getTime(); - }; -} -var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + - "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + - "\u2029\uFEFF"; -if (!String.prototype.trim || ws.trim()) { - ws = "[" + ws + "]"; - var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), - trimEndRegexp = new RegExp(ws + ws + "*$"); - String.prototype.trim = function trim() { - return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); - }; -} - -function toInteger(n) { - n = +n; - if (n !== n) { // isNaN - n = 0; - } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { - n = (n > 0 || -1) * Math.floor(Math.abs(n)); - } - return n; -} - -function isPrimitive(input) { - var type = typeof input; - return ( - input === null || - type === "undefined" || - type === "boolean" || - type === "number" || - type === "string" - ); -} - -function toPrimitive(input) { - var val, valueOf, toString; - if (isPrimitive(input)) { - return input; - } - valueOf = input.valueOf; - if (typeof valueOf === "function") { - val = valueOf.call(input); - if (isPrimitive(val)) { - return val; - } - } - toString = input.toString; - if (typeof toString === "function") { - val = toString.call(input); - if (isPrimitive(val)) { - return val; - } - } - throw new TypeError(); -} -var toObject = function (o) { - if (o == null) { // this matches both null and undefined - throw new TypeError("can't convert "+o+" to object"); - } - return Object(o); -}; - -}); - -ace.define('ace/mode/coffee/scope', ['require', 'exports', 'module' , 'ace/mode/coffee/helpers'], function(require, exports, module) { - - var Scope, extend, last, _ref; - - _ref = require('./helpers'), extend = _ref.extend, last = _ref.last; - - exports.Scope = Scope = (function() { - Scope.root = null; - - function Scope(parent, expressions, method) { - this.parent = parent; - this.expressions = expressions; - this.method = method; - this.variables = [ - { - name: 'arguments', - type: 'arguments' - } - ]; - this.positions = {}; - if (!this.parent) { - Scope.root = this; - } - } - - Scope.prototype.add = function(name, type, immediate) { - if (this.shared && !immediate) { - return this.parent.add(name, type, immediate); - } - if (Object.prototype.hasOwnProperty.call(this.positions, name)) { - return this.variables[this.positions[name]].type = type; - } else { - return this.positions[name] = this.variables.push({ - name: name, - type: type - }) - 1; - } - }; - - Scope.prototype.namedMethod = function() { - var _ref1; - if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) { - return this.method; - } - return this.parent.namedMethod(); - }; - - Scope.prototype.find = function(name) { - if (this.check(name)) { - return true; - } - this.add(name, 'var'); - return false; - }; - - Scope.prototype.parameter = function(name) { - if (this.shared && this.parent.check(name, true)) { - return; - } - return this.add(name, 'param'); - }; - - Scope.prototype.check = function(name) { - var _ref1; - return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0)); - }; - - Scope.prototype.temporary = function(name, index) { - if (name.length > 1) { - return '_' + name + (index > 1 ? index - 1 : ''); - } else { - return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a'); - } - }; - - Scope.prototype.type = function(name) { - var v, _i, _len, _ref1; - _ref1 = this.variables; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - v = _ref1[_i]; - if (v.name === name) { - return v.type; - } - } - return null; - }; - - Scope.prototype.freeVariable = function(name, reserve) { - var index, temp; - if (reserve == null) { - reserve = true; - } - index = 0; - while (this.check((temp = this.temporary(name, index)))) { - index++; - } - if (reserve) { - this.add(temp, 'var', true); - } - return temp; - }; - - Scope.prototype.assign = function(name, value) { - this.add(name, { - value: value, - assigned: true - }, true); - return this.hasAssignments = true; - }; - - Scope.prototype.hasDeclarations = function() { - return !!this.declaredVariables().length; - }; - - Scope.prototype.declaredVariables = function() { - var realVars, tempVars, v, _i, _len, _ref1; - realVars = []; - tempVars = []; - _ref1 = this.variables; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - v = _ref1[_i]; - if (v.type === 'var') { - (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name); - } - } - return realVars.sort().concat(tempVars.sort()); - }; - - Scope.prototype.assignedVariables = function() { - var v, _i, _len, _ref1, _results; - _ref1 = this.variables; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - v = _ref1[_i]; - if (v.type.assigned) { - _results.push("" + v.name + " = " + v.type.value); - } - } - return _results; - }; - - return Scope; - - })(); - - -}); - -ace.define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - -var Anchor = exports.Anchor = function(doc, row, column) { - this.$onChange = this.onChange.bind(this); - this.attach(doc); - - if (typeof column == "undefined") - this.setPosition(row.row, row.column); - else - this.setPosition(row, column); -}; - -(function() { - - oop.implement(this, EventEmitter); - this.getPosition = function() { - return this.$clipPositionToDocument(this.row, this.column); - }; - this.getDocument = function() { - return this.document; - }; - this.$insertRight = false; - this.onChange = function(e) { - var delta = e.data; - var range = delta.range; - - if (range.start.row == range.end.row && range.start.row != this.row) - return; - - if (range.start.row > this.row) - return; - - if (range.start.row == this.row && range.start.column > this.column) - return; - - var row = this.row; - var column = this.column; - var start = range.start; - var end = range.end; - - if (delta.action === "insertText") { - if (start.row === row && start.column <= column) { - if (start.column === column && this.$insertRight) { - } else if (start.row === end.row) { - column += end.column - start.column; - } else { - column -= start.column; - row += end.row - start.row; - } - } else if (start.row !== end.row && start.row < row) { - row += end.row - start.row; - } - } else if (delta.action === "insertLines") { - if (start.row <= row) { - row += end.row - start.row; - } - } else if (delta.action === "removeText") { - if (start.row === row && start.column < column) { - if (end.column >= column) - column = start.column; - else - column = Math.max(0, column - (end.column - start.column)); - - } else if (start.row !== end.row && start.row < row) { - if (end.row === row) - column = Math.max(0, column - end.column) + start.column; - row -= (end.row - start.row); - } else if (end.row === row) { - row -= end.row - start.row; - column = Math.max(0, column - end.column) + start.column; - } - } else if (delta.action == "removeLines") { - if (start.row <= row) { - if (end.row <= row) - row -= end.row - start.row; - else { - row = start.row; - column = 0; - } - } - } - - this.setPosition(row, column, true); - }; - this.setPosition = function(row, column, noClip) { - var pos; - if (noClip) { - pos = { - row: row, - column: column - }; - } else { - pos = this.$clipPositionToDocument(row, column); - } - - if (this.row == pos.row && this.column == pos.column) - return; - - var old = { - row: this.row, - column: this.column - }; - - this.row = pos.row; - this.column = pos.column; - this._signal("change", { - old: old, - value: pos - }); - }; - this.detach = function() { - this.document.removeEventListener("change", this.$onChange); - }; - this.attach = function(doc) { - this.document = doc || this.document; - this.document.on("change", this.$onChange); - }; - this.$clipPositionToDocument = function(row, column) { - var pos = {}; - - if (row >= this.document.getLength()) { - pos.row = Math.max(0, this.document.getLength() - 1); - pos.column = this.document.getLine(pos.row).length; - } - else if (row < 0) { - pos.row = 0; - pos.column = 0; - } - else { - pos.row = row; - pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); - } - - if (column < 0) - pos.column = 0; - - return pos; - }; - -}).call(Anchor.prototype); - -}); diff --git a/util/build-sample-browser/player/vendor/ace/worker-css.js b/util/build-sample-browser/player/vendor/ace/worker-css.js deleted file mode 100644 index 31eea7758a..0000000000 --- a/util/build-sample-browser/player/vendor/ace/worker-css.js +++ /dev/null @@ -1,8323 +0,0 @@ -"no use strict"; -;(function(window) { -if (typeof window.window != "undefined" && window.document) { - return; -} - -window.console = function() { - var msgs = Array.prototype.slice.call(arguments, 0); - postMessage({type: "log", data: msgs}); -}; -window.console.error = -window.console.warn = -window.console.log = -window.console.trace = window.console; - -window.window = window; -window.ace = window; - -window.onerror = function(message, file, line, col, err) { - console.error("Worker " + (err ? err.stack : message)); -}; - -window.normalizeModule = function(parentId, moduleName) { - if (moduleName.indexOf("!") !== -1) { - var chunks = moduleName.split("!"); - return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); - } - if (moduleName.charAt(0) == ".") { - var base = parentId.split("/").slice(0, -1).join("/"); - moduleName = (base ? base + "/" : "") + moduleName; - - while(moduleName.indexOf(".") !== -1 && previous != moduleName) { - var previous = moduleName; - moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); - } - } - - return moduleName; -}; - -window.require = function(parentId, id) { - if (!id) { - id = parentId; - parentId = null; - } - if (!id.charAt) - throw new Error("worker.js require() accepts only (parentId, id) as arguments"); - - id = window.normalizeModule(parentId, id); - - var module = window.require.modules[id]; - if (module) { - if (!module.initialized) { - module.initialized = true; - module.exports = module.factory().exports; - } - return module.exports; - } - - var chunks = id.split("/"); - if (!window.require.tlns) - return console.log("unable to load " + id); - chunks[0] = window.require.tlns[chunks[0]] || chunks[0]; - var path = chunks.join("/") + ".js"; - - window.require.id = id; - importScripts(path); - return window.require(parentId, id); -}; -window.require.modules = {}; -window.require.tlns = {}; - -window.define = function(id, deps, factory) { - if (arguments.length == 2) { - factory = deps; - if (typeof id != "string") { - deps = id; - id = window.require.id; - } - } else if (arguments.length == 1) { - factory = id; - deps = []; - id = window.require.id; - } - - if (!deps.length) - deps = ['require', 'exports', 'module']; - - if (id.indexOf("text!") === 0) - return; - - var req = function(childId) { - return window.require(id, childId); - }; - - window.require.modules[id] = { - exports: {}, - factory: function() { - var module = this; - var returnExports = factory.apply(this, deps.map(function(dep) { - switch(dep) { - case 'require': return req; - case 'exports': return module.exports; - case 'module': return module; - default: return req(dep); - } - })); - if (returnExports) - module.exports = returnExports; - return module; - } - }; -}; -window.define.amd = {}; - -window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { - require.tlns = topLevelNamespaces; -}; - -window.initSender = function initSender() { - - var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; - var oop = window.require("ace/lib/oop"); - - var Sender = function() {}; - - (function() { - - oop.implement(this, EventEmitter); - - this.callback = function(data, callbackId) { - postMessage({ - type: "call", - id: callbackId, - data: data - }); - }; - - this.emit = function(name, data) { - postMessage({ - type: "event", - name: name, - data: data - }); - }; - - }).call(Sender.prototype); - - return new Sender(); -}; - -var main = window.main = null; -var sender = window.sender = null; - -window.onmessage = function(e) { - var msg = e.data; - if (msg.command) { - if (main[msg.command]) - main[msg.command].apply(main, msg.args); - else - throw new Error("Unknown command:" + msg.command); - } - else if (msg.init) { - initBaseUrls(msg.tlns); - require("ace/lib/es5-shim"); - sender = window.sender = initSender(); - var clazz = require(msg.module)[msg.classname]; - main = window.main = new clazz(sender); - } - else if (msg.event && sender) { - sender._signal(msg.event, msg.data); - } -}; -})(this); - -ace.define('ace/mode/css_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/worker/mirror', 'ace/mode/css/csslint'], function(require, exports, module) { - - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var Mirror = require("../worker/mirror").Mirror; -var CSSLint = require("./css/csslint").CSSLint; - -var Worker = exports.Worker = function(sender) { - Mirror.call(this, sender); - this.setTimeout(400); - this.ruleset = null; - this.setDisabledRules("ids"); - this.setInfoRules("adjoining-classes|qualified-headings|zero-units|gradients|import|outline-none"); -}; - -oop.inherits(Worker, Mirror); - -(function() { - this.setInfoRules = function(ruleNames) { - if (typeof ruleNames == "string") - ruleNames = ruleNames.split("|"); - this.infoRules = lang.arrayToMap(ruleNames); - this.doc.getValue() && this.deferredUpdate.schedule(100); - }; - - this.setDisabledRules = function(ruleNames) { - if (!ruleNames) { - this.ruleset = null; - } else { - if (typeof ruleNames == "string") - ruleNames = ruleNames.split("|"); - var all = {}; - - CSSLint.getRules().forEach(function(x){ - all[x.id] = true; - }); - ruleNames.forEach(function(x) { - delete all[x]; - }); - - this.ruleset = all; - } - this.doc.getValue() && this.deferredUpdate.schedule(100); - }; - - this.onUpdate = function() { - var value = this.doc.getValue(); - var infoRules = this.infoRules; - - var result = CSSLint.verify(value, this.ruleset); - this.sender.emit("csslint", result.messages.map(function(msg) { - return { - row: msg.line - 1, - column: msg.col - 1, - text: msg.message, - type: infoRules[msg.rule.id] ? "info" : msg.type, - rule: msg.rule.name - } - })); - }; - -}).call(Worker.prototype); - -}); - -ace.define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -exports.mixin = function(obj, mixin) { - for (var key in mixin) { - obj[key] = mixin[key]; - } - return obj; -}; - -exports.implement = function(proto, mixin) { - exports.mixin(proto, mixin); -}; - -}); - -ace.define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) { - - -exports.last = function(a) { - return a[a.length - 1]; -}; - -exports.stringReverse = function(string) { - return string.split("").reverse().join(""); -}; - -exports.stringRepeat = function (string, count) { - var result = ''; - while (count > 0) { - if (count & 1) - result += string; - - if (count >>= 1) - string += string; - } - return result; -}; - -var trimBeginRegexp = /^\s\s*/; -var trimEndRegexp = /\s\s*$/; - -exports.stringTrimLeft = function (string) { - return string.replace(trimBeginRegexp, ''); -}; - -exports.stringTrimRight = function (string) { - return string.replace(trimEndRegexp, ''); -}; - -exports.copyObject = function(obj) { - var copy = {}; - for (var key in obj) { - copy[key] = obj[key]; - } - return copy; -}; - -exports.copyArray = function(array){ - var copy = []; - for (var i=0, l=array.length; i 0) { - if (pos > length) - pos = length; - } else if (pos == void 0) { - pos = 0; - } else if (pos < 0) { - pos = Math.max(length + pos, 0); - } - - if (!(pos+removeCount < length)) - removeCount = length - pos; - - var removed = this.slice(pos, pos+removeCount); - var insert = slice.call(arguments, 2); - var add = insert.length; - if (pos === length) { - if (add) { - this.push.apply(this, insert); - } - } else { - var remove = Math.min(removeCount, length - pos); - var tailOldPos = pos + remove; - var tailNewPos = tailOldPos + add - remove; - var tailCount = length - tailOldPos; - var lengthAfterRemove = length - remove; - - if (tailNewPos < tailOldPos) { // case A - for (var i = 0; i < tailCount; ++i) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } else if (tailNewPos > tailOldPos) { // case B - for (i = tailCount; i--; ) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } // else, add == remove (nothing to do) - - if (add && pos === lengthAfterRemove) { - this.length = lengthAfterRemove; // truncate array - this.push.apply(this, insert); - } else { - this.length = lengthAfterRemove + add; // reserves space - for (i = 0; i < add; ++i) { - this[pos+i] = insert[i]; - } - } - } - return removed; - }; - } -} -if (!Array.isArray) { - Array.isArray = function isArray(obj) { - return _toString(obj) == "[object Array]"; - }; -} -var boxedString = Object("a"), - splitString = boxedString[0] != "a" || !(0 in boxedString); - -if (!Array.prototype.forEach) { - Array.prototype.forEach = function forEach(fun /*, thisp*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - thisp = arguments[1], - i = -1, - length = self.length >>> 0; - if (_toString(fun) != "[object Function]") { - throw new TypeError(); // TODO message - } - - while (++i < length) { - if (i in self) { - fun.call(thisp, self[i], i, object); - } - } - }; -} -if (!Array.prototype.map) { - Array.prototype.map = function map(fun /*, thisp*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - result = Array(length), - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self) - result[i] = fun.call(thisp, self[i], i, object); - } - return result; - }; -} -if (!Array.prototype.filter) { - Array.prototype.filter = function filter(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - result = [], - value, - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self) { - value = self[i]; - if (fun.call(thisp, value, i, object)) { - result.push(value); - } - } - } - return result; - }; -} -if (!Array.prototype.every) { - Array.prototype.every = function every(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self && !fun.call(thisp, self[i], i, object)) { - return false; - } - } - return true; - }; -} -if (!Array.prototype.some) { - Array.prototype.some = function some(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - thisp = arguments[1]; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self && fun.call(thisp, self[i], i, object)) { - return true; - } - } - return false; - }; -} -if (!Array.prototype.reduce) { - Array.prototype.reduce = function reduce(fun /*, initial*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - if (!length && arguments.length == 1) { - throw new TypeError("reduce of empty array with no initial value"); - } - - var i = 0; - var result; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i++]; - break; - } - if (++i >= length) { - throw new TypeError("reduce of empty array with no initial value"); - } - } while (true); - } - - for (; i < length; i++) { - if (i in self) { - result = fun.call(void 0, result, self[i], i, object); - } - } - - return result; - }; -} -if (!Array.prototype.reduceRight) { - Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0; - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - if (!length && arguments.length == 1) { - throw new TypeError("reduceRight of empty array with no initial value"); - } - - var result, i = length - 1; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i--]; - break; - } - if (--i < 0) { - throw new TypeError("reduceRight of empty array with no initial value"); - } - } while (true); - } - - do { - if (i in this) { - result = fun.call(void 0, result, self[i], i, object); - } - } while (i--); - - return result; - }; -} -if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { - Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - toObject(this), - length = self.length >>> 0; - - if (!length) { - return -1; - } - - var i = 0; - if (arguments.length > 1) { - i = toInteger(arguments[1]); - } - i = i >= 0 ? i : Math.max(0, length + i); - for (; i < length; i++) { - if (i in self && self[i] === sought) { - return i; - } - } - return -1; - }; -} -if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { - Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - toObject(this), - length = self.length >>> 0; - - if (!length) { - return -1; - } - var i = length - 1; - if (arguments.length > 1) { - i = Math.min(i, toInteger(arguments[1])); - } - i = i >= 0 ? i : length - Math.abs(i); - for (; i >= 0; i--) { - if (i in self && sought === self[i]) { - return i; - } - } - return -1; - }; -} -if (!Object.getPrototypeOf) { - Object.getPrototypeOf = function getPrototypeOf(object) { - return object.__proto__ || ( - object.constructor ? - object.constructor.prototype : - prototypeOfObject - ); - }; -} -if (!Object.getOwnPropertyDescriptor) { - var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + - "non-object: "; - Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { - if ((typeof object != "object" && typeof object != "function") || object === null) - throw new TypeError(ERR_NON_OBJECT + object); - if (!owns(object, property)) - return; - - var descriptor, getter, setter; - descriptor = { enumerable: true, configurable: true }; - if (supportsAccessors) { - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - - var getter = lookupGetter(object, property); - var setter = lookupSetter(object, property); - object.__proto__ = prototype; - - if (getter || setter) { - if (getter) descriptor.get = getter; - if (setter) descriptor.set = setter; - return descriptor; - } - } - descriptor.value = object[property]; - return descriptor; - }; -} -if (!Object.getOwnPropertyNames) { - Object.getOwnPropertyNames = function getOwnPropertyNames(object) { - return Object.keys(object); - }; -} -if (!Object.create) { - var createEmpty; - if (Object.prototype.__proto__ === null) { - createEmpty = function () { - return { "__proto__": null }; - }; - } else { - createEmpty = function () { - var empty = {}; - for (var i in empty) - empty[i] = null; - empty.constructor = - empty.hasOwnProperty = - empty.propertyIsEnumerable = - empty.isPrototypeOf = - empty.toLocaleString = - empty.toString = - empty.valueOf = - empty.__proto__ = null; - return empty; - } - } - - Object.create = function create(prototype, properties) { - var object; - if (prototype === null) { - object = createEmpty(); - } else { - if (typeof prototype != "object") - throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); - var Type = function () {}; - Type.prototype = prototype; - object = new Type(); - object.__proto__ = prototype; - } - if (properties !== void 0) - Object.defineProperties(object, properties); - return object; - }; -} - -function doesDefinePropertyWork(object) { - try { - Object.defineProperty(object, "sentinel", {}); - return "sentinel" in object; - } catch (exception) { - } -} -if (Object.defineProperty) { - var definePropertyWorksOnObject = doesDefinePropertyWork({}); - var definePropertyWorksOnDom = typeof document == "undefined" || - doesDefinePropertyWork(document.createElement("div")); - if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { - var definePropertyFallback = Object.defineProperty; - } -} - -if (!Object.defineProperty || definePropertyFallback) { - var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; - var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " - var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + - "on this javascript engine"; - - Object.defineProperty = function defineProperty(object, property, descriptor) { - if ((typeof object != "object" && typeof object != "function") || object === null) - throw new TypeError(ERR_NON_OBJECT_TARGET + object); - if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) - throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); - if (definePropertyFallback) { - try { - return definePropertyFallback.call(Object, object, property, descriptor); - } catch (exception) { - } - } - if (owns(descriptor, "value")) { - - if (supportsAccessors && (lookupGetter(object, property) || - lookupSetter(object, property))) - { - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - delete object[property]; - object[property] = descriptor.value; - object.__proto__ = prototype; - } else { - object[property] = descriptor.value; - } - } else { - if (!supportsAccessors) - throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); - if (owns(descriptor, "get")) - defineGetter(object, property, descriptor.get); - if (owns(descriptor, "set")) - defineSetter(object, property, descriptor.set); - } - - return object; - }; -} -if (!Object.defineProperties) { - Object.defineProperties = function defineProperties(object, properties) { - for (var property in properties) { - if (owns(properties, property)) - Object.defineProperty(object, property, properties[property]); - } - return object; - }; -} -if (!Object.seal) { - Object.seal = function seal(object) { - return object; - }; -} -if (!Object.freeze) { - Object.freeze = function freeze(object) { - return object; - }; -} -try { - Object.freeze(function () {}); -} catch (exception) { - Object.freeze = (function freeze(freezeObject) { - return function freeze(object) { - if (typeof object == "function") { - return object; - } else { - return freezeObject(object); - } - }; - })(Object.freeze); -} -if (!Object.preventExtensions) { - Object.preventExtensions = function preventExtensions(object) { - return object; - }; -} -if (!Object.isSealed) { - Object.isSealed = function isSealed(object) { - return false; - }; -} -if (!Object.isFrozen) { - Object.isFrozen = function isFrozen(object) { - return false; - }; -} -if (!Object.isExtensible) { - Object.isExtensible = function isExtensible(object) { - if (Object(object) === object) { - throw new TypeError(); // TODO message - } - var name = ''; - while (owns(object, name)) { - name += '?'; - } - object[name] = true; - var returnValue = owns(object, name); - delete object[name]; - return returnValue; - }; -} -if (!Object.keys) { - var hasDontEnumBug = true, - dontEnums = [ - "toString", - "toLocaleString", - "valueOf", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "constructor" - ], - dontEnumsLength = dontEnums.length; - - for (var key in {"toString": null}) { - hasDontEnumBug = false; - } - - Object.keys = function keys(object) { - - if ( - (typeof object != "object" && typeof object != "function") || - object === null - ) { - throw new TypeError("Object.keys called on a non-object"); - } - - var keys = []; - for (var name in object) { - if (owns(object, name)) { - keys.push(name); - } - } - - if (hasDontEnumBug) { - for (var i = 0, ii = dontEnumsLength; i < ii; i++) { - var dontEnum = dontEnums[i]; - if (owns(object, dontEnum)) { - keys.push(dontEnum); - } - } - } - return keys; - }; - -} -if (!Date.now) { - Date.now = function now() { - return new Date().getTime(); - }; -} -var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + - "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + - "\u2029\uFEFF"; -if (!String.prototype.trim || ws.trim()) { - ws = "[" + ws + "]"; - var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), - trimEndRegexp = new RegExp(ws + ws + "*$"); - String.prototype.trim = function trim() { - return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); - }; -} - -function toInteger(n) { - n = +n; - if (n !== n) { // isNaN - n = 0; - } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { - n = (n > 0 || -1) * Math.floor(Math.abs(n)); - } - return n; -} - -function isPrimitive(input) { - var type = typeof input; - return ( - input === null || - type === "undefined" || - type === "boolean" || - type === "number" || - type === "string" - ); -} - -function toPrimitive(input) { - var val, valueOf, toString; - if (isPrimitive(input)) { - return input; - } - valueOf = input.valueOf; - if (typeof valueOf === "function") { - val = valueOf.call(input); - if (isPrimitive(val)) { - return val; - } - } - toString = input.toString; - if (typeof toString === "function") { - val = toString.call(input); - if (isPrimitive(val)) { - return val; - } - } - throw new TypeError(); -} -var toObject = function (o) { - if (o == null) { // this matches both null and undefined - throw new TypeError("can't convert "+o+" to object"); - } - return Object(o); -}; - -}); - -ace.define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var Range = require("./range").Range; -var Anchor = require("./anchor").Anchor; - -var Document = function(text) { - this.$lines = []; - if (text.length === 0) { - this.$lines = [""]; - } else if (Array.isArray(text)) { - this._insertLines(0, text); - } else { - this.insert({row: 0, column:0}, text); - } -}; - -(function() { - - oop.implement(this, EventEmitter); - this.setValue = function(text) { - var len = this.getLength(); - this.remove(new Range(0, 0, len, this.getLine(len-1).length)); - this.insert({row: 0, column:0}, text); - }; - this.getValue = function() { - return this.getAllLines().join(this.getNewLineCharacter()); - }; - this.createAnchor = function(row, column) { - return new Anchor(this, row, column); - }; - if ("aaa".split(/a/).length === 0) - this.$split = function(text) { - return text.replace(/\r\n|\r/g, "\n").split("\n"); - }; - else - this.$split = function(text) { - return text.split(/\r\n|\r|\n/); - }; - - - this.$detectNewLine = function(text) { - var match = text.match(/^.*?(\r\n|\r|\n)/m); - this.$autoNewLine = match ? match[1] : "\n"; - this._signal("changeNewLineMode"); - }; - this.getNewLineCharacter = function() { - switch (this.$newLineMode) { - case "windows": - return "\r\n"; - case "unix": - return "\n"; - default: - return this.$autoNewLine || "\n"; - } - }; - - this.$autoNewLine = ""; - this.$newLineMode = "auto"; - this.setNewLineMode = function(newLineMode) { - if (this.$newLineMode === newLineMode) - return; - - this.$newLineMode = newLineMode; - this._signal("changeNewLineMode"); - }; - this.getNewLineMode = function() { - return this.$newLineMode; - }; - this.isNewLine = function(text) { - return (text == "\r\n" || text == "\r" || text == "\n"); - }; - this.getLine = function(row) { - return this.$lines[row] || ""; - }; - this.getLines = function(firstRow, lastRow) { - return this.$lines.slice(firstRow, lastRow + 1); - }; - this.getAllLines = function() { - return this.getLines(0, this.getLength()); - }; - this.getLength = function() { - return this.$lines.length; - }; - this.getTextRange = function(range) { - if (range.start.row == range.end.row) { - return this.getLine(range.start.row) - .substring(range.start.column, range.end.column); - } - var lines = this.getLines(range.start.row, range.end.row); - lines[0] = (lines[0] || "").substring(range.start.column); - var l = lines.length - 1; - if (range.end.row - range.start.row == l) - lines[l] = lines[l].substring(0, range.end.column); - return lines.join(this.getNewLineCharacter()); - }; - - this.$clipPosition = function(position) { - var length = this.getLength(); - if (position.row >= length) { - position.row = Math.max(0, length - 1); - position.column = this.getLine(length-1).length; - } else if (position.row < 0) - position.row = 0; - return position; - }; - this.insert = function(position, text) { - if (!text || text.length === 0) - return position; - - position = this.$clipPosition(position); - if (this.getLength() <= 1) - this.$detectNewLine(text); - - var lines = this.$split(text); - var firstLine = lines.splice(0, 1)[0]; - var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; - - position = this.insertInLine(position, firstLine); - if (lastLine !== null) { - position = this.insertNewLine(position); // terminate first line - position = this._insertLines(position.row, lines); - position = this.insertInLine(position, lastLine || ""); - } - return position; - }; - this.insertLines = function(row, lines) { - if (row >= this.getLength()) - return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); - return this._insertLines(Math.max(row, 0), lines); - }; - this._insertLines = function(row, lines) { - if (lines.length == 0) - return {row: row, column: 0}; - while (lines.length > 0xF000) { - var end = this._insertLines(row, lines.slice(0, 0xF000)); - lines = lines.slice(0xF000); - row = end.row; - } - - var args = [row, 0]; - args.push.apply(args, lines); - this.$lines.splice.apply(this.$lines, args); - - var range = new Range(row, 0, row + lines.length, 0); - var delta = { - action: "insertLines", - range: range, - lines: lines - }; - this._signal("change", { data: delta }); - return range.end; - }; - this.insertNewLine = function(position) { - position = this.$clipPosition(position); - var line = this.$lines[position.row] || ""; - - this.$lines[position.row] = line.substring(0, position.column); - this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); - - var end = { - row : position.row + 1, - column : 0 - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: this.getNewLineCharacter() - }; - this._signal("change", { data: delta }); - - return end; - }; - this.insertInLine = function(position, text) { - if (text.length == 0) - return position; - - var line = this.$lines[position.row] || ""; - - this.$lines[position.row] = line.substring(0, position.column) + text - + line.substring(position.column); - - var end = { - row : position.row, - column : position.column + text.length - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: text - }; - this._signal("change", { data: delta }); - - return end; - }; - this.remove = function(range) { - if (!(range instanceof Range)) - range = Range.fromPoints(range.start, range.end); - range.start = this.$clipPosition(range.start); - range.end = this.$clipPosition(range.end); - - if (range.isEmpty()) - return range.start; - - var firstRow = range.start.row; - var lastRow = range.end.row; - - if (range.isMultiLine()) { - var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; - var lastFullRow = lastRow - 1; - - if (range.end.column > 0) - this.removeInLine(lastRow, 0, range.end.column); - - if (lastFullRow >= firstFullRow) - this._removeLines(firstFullRow, lastFullRow); - - if (firstFullRow != firstRow) { - this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); - this.removeNewLine(range.start.row); - } - } - else { - this.removeInLine(firstRow, range.start.column, range.end.column); - } - return range.start; - }; - this.removeInLine = function(row, startColumn, endColumn) { - if (startColumn == endColumn) - return; - - var range = new Range(row, startColumn, row, endColumn); - var line = this.getLine(row); - var removed = line.substring(startColumn, endColumn); - var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); - this.$lines.splice(row, 1, newLine); - - var delta = { - action: "removeText", - range: range, - text: removed - }; - this._signal("change", { data: delta }); - return range.start; - }; - this.removeLines = function(firstRow, lastRow) { - if (firstRow < 0 || lastRow >= this.getLength()) - return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); - return this._removeLines(firstRow, lastRow); - }; - - this._removeLines = function(firstRow, lastRow) { - var range = new Range(firstRow, 0, lastRow + 1, 0); - var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); - - var delta = { - action: "removeLines", - range: range, - nl: this.getNewLineCharacter(), - lines: removed - }; - this._signal("change", { data: delta }); - return removed; - }; - this.removeNewLine = function(row) { - var firstLine = this.getLine(row); - var secondLine = this.getLine(row+1); - - var range = new Range(row, firstLine.length, row+1, 0); - var line = firstLine + secondLine; - - this.$lines.splice(row, 2, line); - - var delta = { - action: "removeText", - range: range, - text: this.getNewLineCharacter() - }; - this._signal("change", { data: delta }); - }; - this.replace = function(range, text) { - if (!(range instanceof Range)) - range = Range.fromPoints(range.start, range.end); - if (text.length == 0 && range.isEmpty()) - return range.start; - if (text == this.getTextRange(range)) - return range.end; - - this.remove(range); - if (text) { - var end = this.insert(range.start, text); - } - else { - end = range.start; - } - - return end; - }; - this.applyDeltas = function(deltas) { - for (var i=0; i=0; i--) { - var delta = deltas[i]; - - var range = Range.fromPoints(delta.range.start, delta.range.end); - - if (delta.action == "insertLines") - this._removeLines(range.start.row, range.end.row - 1); - else if (delta.action == "insertText") - this.remove(range); - else if (delta.action == "removeLines") - this._insertLines(range.start.row, delta.lines); - else if (delta.action == "removeText") - this.insert(range.start, delta.text); - } - }; - this.indexToPosition = function(index, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - for (var i = startRow || 0, l = lines.length; i < l; i++) { - index -= lines[i].length + newlineLength; - if (index < 0) - return {row: i, column: index + lines[i].length + newlineLength}; - } - return {row: l-1, column: lines[l-1].length}; - }; - this.positionToIndex = function(pos, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - var index = 0; - var row = Math.min(pos.row, lines.length); - for (var i = startRow || 0; i < row; ++i) - index += lines[i].length + newlineLength; - - return index + pos.column; - }; - -}).call(Document.prototype); - -exports.Document = Document; -}); - -ace.define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) { - - -var EventEmitter = {}; -var stopPropagation = function() { this.propagationStopped = true; }; -var preventDefault = function() { this.defaultPrevented = true; }; - -EventEmitter._emit = -EventEmitter._dispatchEvent = function(eventName, e) { - this._eventRegistry || (this._eventRegistry = {}); - this._defaultHandlers || (this._defaultHandlers = {}); - - var listeners = this._eventRegistry[eventName] || []; - var defaultHandler = this._defaultHandlers[eventName]; - if (!listeners.length && !defaultHandler) - return; - - if (typeof e != "object" || !e) - e = {}; - - if (!e.type) - e.type = eventName; - if (!e.stopPropagation) - e.stopPropagation = stopPropagation; - if (!e.preventDefault) - e.preventDefault = preventDefault; - - listeners = listeners.slice(); - for (var i=0; i [" + this.end.row + "/" + this.end.column + "]"); - }; - - this.contains = function(row, column) { - return this.compare(row, column) == 0; - }; - this.compareRange = function(range) { - var cmp, - end = range.end, - start = range.start; - - cmp = this.compare(end.row, end.column); - if (cmp == 1) { - cmp = this.compare(start.row, start.column); - if (cmp == 1) { - return 2; - } else if (cmp == 0) { - return 1; - } else { - return 0; - } - } else if (cmp == -1) { - return -2; - } else { - cmp = this.compare(start.row, start.column); - if (cmp == -1) { - return -1; - } else if (cmp == 1) { - return 42; - } else { - return 0; - } - } - }; - this.comparePoint = function(p) { - return this.compare(p.row, p.column); - }; - this.containsRange = function(range) { - return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; - }; - this.intersects = function(range) { - var cmp = this.compareRange(range); - return (cmp == -1 || cmp == 0 || cmp == 1); - }; - this.isEnd = function(row, column) { - return this.end.row == row && this.end.column == column; - }; - this.isStart = function(row, column) { - return this.start.row == row && this.start.column == column; - }; - this.setStart = function(row, column) { - if (typeof row == "object") { - this.start.column = row.column; - this.start.row = row.row; - } else { - this.start.row = row; - this.start.column = column; - } - }; - this.setEnd = function(row, column) { - if (typeof row == "object") { - this.end.column = row.column; - this.end.row = row.row; - } else { - this.end.row = row; - this.end.column = column; - } - }; - this.inside = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column) || this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - }; - this.insideStart = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column)) { - return false; - } else { - return true; - } - } - return false; - }; - this.insideEnd = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - }; - this.compare = function(row, column) { - if (!this.isMultiLine()) { - if (row === this.start.row) { - return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); - }; - } - - if (row < this.start.row) - return -1; - - if (row > this.end.row) - return 1; - - if (this.start.row === row) - return column >= this.start.column ? 0 : -1; - - if (this.end.row === row) - return column <= this.end.column ? 0 : 1; - - return 0; - }; - this.compareStart = function(row, column) { - if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - }; - this.compareEnd = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else { - return this.compare(row, column); - } - }; - this.compareInside = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - }; - this.clipRows = function(firstRow, lastRow) { - if (this.end.row > lastRow) - var end = {row: lastRow + 1, column: 0}; - else if (this.end.row < firstRow) - var end = {row: firstRow, column: 0}; - - if (this.start.row > lastRow) - var start = {row: lastRow + 1, column: 0}; - else if (this.start.row < firstRow) - var start = {row: firstRow, column: 0}; - - return Range.fromPoints(start || this.start, end || this.end); - }; - this.extend = function(row, column) { - var cmp = this.compare(row, column); - - if (cmp == 0) - return this; - else if (cmp == -1) - var start = {row: row, column: column}; - else - var end = {row: row, column: column}; - - return Range.fromPoints(start || this.start, end || this.end); - }; - - this.isEmpty = function() { - return (this.start.row === this.end.row && this.start.column === this.end.column); - }; - this.isMultiLine = function() { - return (this.start.row !== this.end.row); - }; - this.clone = function() { - return Range.fromPoints(this.start, this.end); - }; - this.collapseRows = function() { - if (this.end.column == 0) - return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) - else - return new Range(this.start.row, 0, this.end.row, 0) - }; - this.toScreenRange = function(session) { - var screenPosStart = session.documentToScreenPosition(this.start); - var screenPosEnd = session.documentToScreenPosition(this.end); - - return new Range( - screenPosStart.row, screenPosStart.column, - screenPosEnd.row, screenPosEnd.column - ); - }; - this.moveBy = function(row, column) { - this.start.row += row; - this.start.column += column; - this.end.row += row; - this.end.column += column; - }; - -}).call(Range.prototype); -Range.fromPoints = function(start, end) { - return new Range(start.row, start.column, end.row, end.column); -}; -Range.comparePoints = comparePoints; - -Range.comparePoints = function(p1, p2) { - return p1.row - p2.row || p1.column - p2.column; -}; - - -exports.Range = Range; -}); - -ace.define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) { - - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - -var Anchor = exports.Anchor = function(doc, row, column) { - this.$onChange = this.onChange.bind(this); - this.attach(doc); - - if (typeof column == "undefined") - this.setPosition(row.row, row.column); - else - this.setPosition(row, column); -}; - -(function() { - - oop.implement(this, EventEmitter); - this.getPosition = function() { - return this.$clipPositionToDocument(this.row, this.column); - }; - this.getDocument = function() { - return this.document; - }; - this.$insertRight = false; - this.onChange = function(e) { - var delta = e.data; - var range = delta.range; - - if (range.start.row == range.end.row && range.start.row != this.row) - return; - - if (range.start.row > this.row) - return; - - if (range.start.row == this.row && range.start.column > this.column) - return; - - var row = this.row; - var column = this.column; - var start = range.start; - var end = range.end; - - if (delta.action === "insertText") { - if (start.row === row && start.column <= column) { - if (start.column === column && this.$insertRight) { - } else if (start.row === end.row) { - column += end.column - start.column; - } else { - column -= start.column; - row += end.row - start.row; - } - } else if (start.row !== end.row && start.row < row) { - row += end.row - start.row; - } - } else if (delta.action === "insertLines") { - if (start.row <= row) { - row += end.row - start.row; - } - } else if (delta.action === "removeText") { - if (start.row === row && start.column < column) { - if (end.column >= column) - column = start.column; - else - column = Math.max(0, column - (end.column - start.column)); - - } else if (start.row !== end.row && start.row < row) { - if (end.row === row) - column = Math.max(0, column - end.column) + start.column; - row -= (end.row - start.row); - } else if (end.row === row) { - row -= end.row - start.row; - column = Math.max(0, column - end.column) + start.column; - } - } else if (delta.action == "removeLines") { - if (start.row <= row) { - if (end.row <= row) - row -= end.row - start.row; - else { - row = start.row; - column = 0; - } - } - } - - this.setPosition(row, column, true); - }; - this.setPosition = function(row, column, noClip) { - var pos; - if (noClip) { - pos = { - row: row, - column: column - }; - } else { - pos = this.$clipPositionToDocument(row, column); - } - - if (this.row == pos.row && this.column == pos.column) - return; - - var old = { - row: this.row, - column: this.column - }; - - this.row = pos.row; - this.column = pos.column; - this._signal("change", { - old: old, - value: pos - }); - }; - this.detach = function() { - this.document.removeEventListener("change", this.$onChange); - }; - this.attach = function(doc) { - this.document = doc || this.document; - this.document.on("change", this.$onChange); - }; - this.$clipPositionToDocument = function(row, column) { - var pos = {}; - - if (row >= this.document.getLength()) { - pos.row = Math.max(0, this.document.getLength() - 1); - pos.column = this.document.getLine(pos.row).length; - } - else if (row < 0) { - pos.row = 0; - pos.column = 0; - } - else { - pos.row = row; - pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); - } - - if (column < 0) - pos.column = 0; - - return pos; - }; - -}).call(Anchor.prototype); - -}); -ace.define('ace/mode/css/csslint', ['require', 'exports', 'module' ], function(require, exports, module) { -var parserlib = {}; -(function(){ -function EventTarget(){ - this._listeners = {}; -} - -EventTarget.prototype = { - constructor: EventTarget, - addListener: function(type, listener){ - if (!this._listeners[type]){ - this._listeners[type] = []; - } - - this._listeners[type].push(listener); - }, - fire: function(event){ - if (typeof event == "string"){ - event = { type: event }; - } - if (typeof event.target != "undefined"){ - event.target = this; - } - - if (typeof event.type == "undefined"){ - throw new Error("Event object missing 'type' property."); - } - - if (this._listeners[event.type]){ - var listeners = this._listeners[event.type].concat(); - for (var i=0, len=listeners.length; i < len; i++){ - listeners[i].call(this, event); - } - } - }, - removeListener: function(type, listener){ - if (this._listeners[type]){ - var listeners = this._listeners[type]; - for (var i=0, len=listeners.length; i < len; i++){ - if (listeners[i] === listener){ - listeners.splice(i, 1); - break; - } - } - - - } - } -}; -function StringReader(text){ - this._input = text.replace(/\n\r?/g, "\n"); - this._line = 1; - this._col = 1; - this._cursor = 0; -} - -StringReader.prototype = { - constructor: StringReader, - getCol: function(){ - return this._col; - }, - getLine: function(){ - return this._line ; - }, - eof: function(){ - return (this._cursor == this._input.length); - }, - peek: function(count){ - var c = null; - count = (typeof count == "undefined" ? 1 : count); - if (this._cursor < this._input.length){ - c = this._input.charAt(this._cursor + count - 1); - } - - return c; - }, - read: function(){ - var c = null; - if (this._cursor < this._input.length){ - if (this._input.charAt(this._cursor) == "\n"){ - this._line++; - this._col=1; - } else { - this._col++; - } - c = this._input.charAt(this._cursor++); - } - - return c; - }, - mark: function(){ - this._bookmark = { - cursor: this._cursor, - line: this._line, - col: this._col - }; - }, - - reset: function(){ - if (this._bookmark){ - this._cursor = this._bookmark.cursor; - this._line = this._bookmark.line; - this._col = this._bookmark.col; - delete this._bookmark; - } - }, - readTo: function(pattern){ - - var buffer = "", - c; - while (buffer.length < pattern.length || buffer.lastIndexOf(pattern) != buffer.length - pattern.length){ - c = this.read(); - if (c){ - buffer += c; - } else { - throw new Error("Expected \"" + pattern + "\" at line " + this._line + ", col " + this._col + "."); - } - } - - return buffer; - - }, - readWhile: function(filter){ - - var buffer = "", - c = this.read(); - - while(c !== null && filter(c)){ - buffer += c; - c = this.read(); - } - - return buffer; - - }, - readMatch: function(matcher){ - - var source = this._input.substring(this._cursor), - value = null; - if (typeof matcher == "string"){ - if (source.indexOf(matcher) === 0){ - value = this.readCount(matcher.length); - } - } else if (matcher instanceof RegExp){ - if (matcher.test(source)){ - value = this.readCount(RegExp.lastMatch.length); - } - } - - return value; - }, - readCount: function(count){ - var buffer = ""; - - while(count--){ - buffer += this.read(); - } - - return buffer; - } - -}; -function SyntaxError(message, line, col){ - this.col = col; - this.line = line; - this.message = message; - -} -SyntaxError.prototype = new Error(); -function SyntaxUnit(text, line, col, type){ - this.col = col; - this.line = line; - this.text = text; - this.type = type; -} -SyntaxUnit.fromToken = function(token){ - return new SyntaxUnit(token.value, token.startLine, token.startCol); -}; - -SyntaxUnit.prototype = { - constructor: SyntaxUnit, - valueOf: function(){ - return this.toString(); - }, - toString: function(){ - return this.text; - } - -}; -function TokenStreamBase(input, tokenData){ - this._reader = input ? new StringReader(input.toString()) : null; - this._token = null; - this._tokenData = tokenData; - this._lt = []; - this._ltIndex = 0; - - this._ltIndexCache = []; -} -TokenStreamBase.createTokenData = function(tokens){ - - var nameMap = [], - typeMap = {}, - tokenData = tokens.concat([]), - i = 0, - len = tokenData.length+1; - - tokenData.UNKNOWN = -1; - tokenData.unshift({name:"EOF"}); - - for (; i < len; i++){ - nameMap.push(tokenData[i].name); - tokenData[tokenData[i].name] = i; - if (tokenData[i].text){ - typeMap[tokenData[i].text] = i; - } - } - - tokenData.name = function(tt){ - return nameMap[tt]; - }; - - tokenData.type = function(c){ - return typeMap[c]; - }; - - return tokenData; -}; - -TokenStreamBase.prototype = { - constructor: TokenStreamBase, - match: function(tokenTypes, channel){ - if (!(tokenTypes instanceof Array)){ - tokenTypes = [tokenTypes]; - } - - var tt = this.get(channel), - i = 0, - len = tokenTypes.length; - - while(i < len){ - if (tt == tokenTypes[i++]){ - return true; - } - } - this.unget(); - return false; - }, - mustMatch: function(tokenTypes, channel){ - - var token; - if (!(tokenTypes instanceof Array)){ - tokenTypes = [tokenTypes]; - } - - if (!this.match.apply(this, arguments)){ - token = this.LT(1); - throw new SyntaxError("Expected " + this._tokenData[tokenTypes[0]].name + - " at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); - } - }, - advance: function(tokenTypes, channel){ - - while(this.LA(0) !== 0 && !this.match(tokenTypes, channel)){ - this.get(); - } - - return this.LA(0); - }, - get: function(channel){ - - var tokenInfo = this._tokenData, - reader = this._reader, - value, - i =0, - len = tokenInfo.length, - found = false, - token, - info; - if (this._lt.length && this._ltIndex >= 0 && this._ltIndex < this._lt.length){ - - i++; - this._token = this._lt[this._ltIndex++]; - info = tokenInfo[this._token.type]; - while((info.channel !== undefined && channel !== info.channel) && - this._ltIndex < this._lt.length){ - this._token = this._lt[this._ltIndex++]; - info = tokenInfo[this._token.type]; - i++; - } - if ((info.channel === undefined || channel === info.channel) && - this._ltIndex <= this._lt.length){ - this._ltIndexCache.push(i); - return this._token.type; - } - } - token = this._getToken(); - if (token.type > -1 && !tokenInfo[token.type].hide){ - token.channel = tokenInfo[token.type].channel; - this._token = token; - this._lt.push(token); - this._ltIndexCache.push(this._lt.length - this._ltIndex + i); - if (this._lt.length > 5){ - this._lt.shift(); - } - if (this._ltIndexCache.length > 5){ - this._ltIndexCache.shift(); - } - this._ltIndex = this._lt.length; - } - info = tokenInfo[token.type]; - if (info && - (info.hide || - (info.channel !== undefined && channel !== info.channel))){ - return this.get(channel); - } else { - return token.type; - } - }, - LA: function(index){ - var total = index, - tt; - if (index > 0){ - if (index > 5){ - throw new Error("Too much lookahead."); - } - while(total){ - tt = this.get(); - total--; - } - while(total < index){ - this.unget(); - total++; - } - } else if (index < 0){ - - if(this._lt[this._ltIndex+index]){ - tt = this._lt[this._ltIndex+index].type; - } else { - throw new Error("Too much lookbehind."); - } - - } else { - tt = this._token.type; - } - - return tt; - - }, - LT: function(index){ - this.LA(index); - return this._lt[this._ltIndex+index-1]; - }, - peek: function(){ - return this.LA(1); - }, - token: function(){ - return this._token; - }, - tokenName: function(tokenType){ - if (tokenType < 0 || tokenType > this._tokenData.length){ - return "UNKNOWN_TOKEN"; - } else { - return this._tokenData[tokenType].name; - } - }, - tokenType: function(tokenName){ - return this._tokenData[tokenName] || -1; - }, - unget: function(){ - if (this._ltIndexCache.length){ - this._ltIndex -= this._ltIndexCache.pop();//--; - this._token = this._lt[this._ltIndex - 1]; - } else { - throw new Error("Too much lookahead."); - } - } - -}; - - - - -parserlib.util = { -StringReader: StringReader, -SyntaxError : SyntaxError, -SyntaxUnit : SyntaxUnit, -EventTarget : EventTarget, -TokenStreamBase : TokenStreamBase -}; -})(); -(function(){ -var EventTarget = parserlib.util.EventTarget, -TokenStreamBase = parserlib.util.TokenStreamBase, -StringReader = parserlib.util.StringReader, -SyntaxError = parserlib.util.SyntaxError, -SyntaxUnit = parserlib.util.SyntaxUnit; - - -var Colors = { - aliceblue :"#f0f8ff", - antiquewhite :"#faebd7", - aqua :"#00ffff", - aquamarine :"#7fffd4", - azure :"#f0ffff", - beige :"#f5f5dc", - bisque :"#ffe4c4", - black :"#000000", - blanchedalmond :"#ffebcd", - blue :"#0000ff", - blueviolet :"#8a2be2", - brown :"#a52a2a", - burlywood :"#deb887", - cadetblue :"#5f9ea0", - chartreuse :"#7fff00", - chocolate :"#d2691e", - coral :"#ff7f50", - cornflowerblue :"#6495ed", - cornsilk :"#fff8dc", - crimson :"#dc143c", - cyan :"#00ffff", - darkblue :"#00008b", - darkcyan :"#008b8b", - darkgoldenrod :"#b8860b", - darkgray :"#a9a9a9", - darkgreen :"#006400", - darkkhaki :"#bdb76b", - darkmagenta :"#8b008b", - darkolivegreen :"#556b2f", - darkorange :"#ff8c00", - darkorchid :"#9932cc", - darkred :"#8b0000", - darksalmon :"#e9967a", - darkseagreen :"#8fbc8f", - darkslateblue :"#483d8b", - darkslategray :"#2f4f4f", - darkturquoise :"#00ced1", - darkviolet :"#9400d3", - deeppink :"#ff1493", - deepskyblue :"#00bfff", - dimgray :"#696969", - dodgerblue :"#1e90ff", - firebrick :"#b22222", - floralwhite :"#fffaf0", - forestgreen :"#228b22", - fuchsia :"#ff00ff", - gainsboro :"#dcdcdc", - ghostwhite :"#f8f8ff", - gold :"#ffd700", - goldenrod :"#daa520", - gray :"#808080", - green :"#008000", - greenyellow :"#adff2f", - honeydew :"#f0fff0", - hotpink :"#ff69b4", - indianred :"#cd5c5c", - indigo :"#4b0082", - ivory :"#fffff0", - khaki :"#f0e68c", - lavender :"#e6e6fa", - lavenderblush :"#fff0f5", - lawngreen :"#7cfc00", - lemonchiffon :"#fffacd", - lightblue :"#add8e6", - lightcoral :"#f08080", - lightcyan :"#e0ffff", - lightgoldenrodyellow :"#fafad2", - lightgray :"#d3d3d3", - lightgreen :"#90ee90", - lightpink :"#ffb6c1", - lightsalmon :"#ffa07a", - lightseagreen :"#20b2aa", - lightskyblue :"#87cefa", - lightslategray :"#778899", - lightsteelblue :"#b0c4de", - lightyellow :"#ffffe0", - lime :"#00ff00", - limegreen :"#32cd32", - linen :"#faf0e6", - magenta :"#ff00ff", - maroon :"#800000", - mediumaquamarine:"#66cdaa", - mediumblue :"#0000cd", - mediumorchid :"#ba55d3", - mediumpurple :"#9370d8", - mediumseagreen :"#3cb371", - mediumslateblue :"#7b68ee", - mediumspringgreen :"#00fa9a", - mediumturquoise :"#48d1cc", - mediumvioletred :"#c71585", - midnightblue :"#191970", - mintcream :"#f5fffa", - mistyrose :"#ffe4e1", - moccasin :"#ffe4b5", - navajowhite :"#ffdead", - navy :"#000080", - oldlace :"#fdf5e6", - olive :"#808000", - olivedrab :"#6b8e23", - orange :"#ffa500", - orangered :"#ff4500", - orchid :"#da70d6", - palegoldenrod :"#eee8aa", - palegreen :"#98fb98", - paleturquoise :"#afeeee", - palevioletred :"#d87093", - papayawhip :"#ffefd5", - peachpuff :"#ffdab9", - peru :"#cd853f", - pink :"#ffc0cb", - plum :"#dda0dd", - powderblue :"#b0e0e6", - purple :"#800080", - red :"#ff0000", - rosybrown :"#bc8f8f", - royalblue :"#4169e1", - saddlebrown :"#8b4513", - salmon :"#fa8072", - sandybrown :"#f4a460", - seagreen :"#2e8b57", - seashell :"#fff5ee", - sienna :"#a0522d", - silver :"#c0c0c0", - skyblue :"#87ceeb", - slateblue :"#6a5acd", - slategray :"#708090", - snow :"#fffafa", - springgreen :"#00ff7f", - steelblue :"#4682b4", - tan :"#d2b48c", - teal :"#008080", - thistle :"#d8bfd8", - tomato :"#ff6347", - turquoise :"#40e0d0", - violet :"#ee82ee", - wheat :"#f5deb3", - white :"#ffffff", - whitesmoke :"#f5f5f5", - yellow :"#ffff00", - yellowgreen :"#9acd32", - activeBorder :"Active window border.", - activecaption :"Active window caption.", - appworkspace :"Background color of multiple document interface.", - background :"Desktop background.", - buttonface :"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.", - buttonhighlight :"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.", - buttonshadow :"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.", - buttontext :"Text on push buttons.", - captiontext :"Text in caption, size box, and scrollbar arrow box.", - graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.", - highlight :"Item(s) selected in a control.", - highlighttext :"Text of item(s) selected in a control.", - inactiveborder :"Inactive window border.", - inactivecaption :"Inactive window caption.", - inactivecaptiontext :"Color of text in an inactive caption.", - infobackground :"Background color for tooltip controls.", - infotext :"Text color for tooltip controls.", - menu :"Menu background.", - menutext :"Text in menus.", - scrollbar :"Scroll bar gray area.", - threeddarkshadow :"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedface :"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedhighlight :"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedlightshadow :"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedshadow :"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - window :"Window background.", - windowframe :"Window frame.", - windowtext :"Text in windows." -}; -function Combinator(text, line, col){ - - SyntaxUnit.call(this, text, line, col, Parser.COMBINATOR_TYPE); - this.type = "unknown"; - if (/^\s+$/.test(text)){ - this.type = "descendant"; - } else if (text == ">"){ - this.type = "child"; - } else if (text == "+"){ - this.type = "adjacent-sibling"; - } else if (text == "~"){ - this.type = "sibling"; - } - -} - -Combinator.prototype = new SyntaxUnit(); -Combinator.prototype.constructor = Combinator; -function MediaFeature(name, value){ - - SyntaxUnit.call(this, "(" + name + (value !== null ? ":" + value : "") + ")", name.startLine, name.startCol, Parser.MEDIA_FEATURE_TYPE); - this.name = name; - this.value = value; -} - -MediaFeature.prototype = new SyntaxUnit(); -MediaFeature.prototype.constructor = MediaFeature; -function MediaQuery(modifier, mediaType, features, line, col){ - - SyntaxUnit.call(this, (modifier ? modifier + " ": "") + (mediaType ? mediaType : "") + (mediaType && features.length > 0 ? " and " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE); - this.modifier = modifier; - this.mediaType = mediaType; - this.features = features; - -} - -MediaQuery.prototype = new SyntaxUnit(); -MediaQuery.prototype.constructor = MediaQuery; -function Parser(options){ - EventTarget.call(this); - - - this.options = options || {}; - - this._tokenStream = null; -} -Parser.DEFAULT_TYPE = 0; -Parser.COMBINATOR_TYPE = 1; -Parser.MEDIA_FEATURE_TYPE = 2; -Parser.MEDIA_QUERY_TYPE = 3; -Parser.PROPERTY_NAME_TYPE = 4; -Parser.PROPERTY_VALUE_TYPE = 5; -Parser.PROPERTY_VALUE_PART_TYPE = 6; -Parser.SELECTOR_TYPE = 7; -Parser.SELECTOR_PART_TYPE = 8; -Parser.SELECTOR_SUB_PART_TYPE = 9; - -Parser.prototype = function(){ - - var proto = new EventTarget(), //new prototype - prop, - additions = { - constructor: Parser, - DEFAULT_TYPE : 0, - COMBINATOR_TYPE : 1, - MEDIA_FEATURE_TYPE : 2, - MEDIA_QUERY_TYPE : 3, - PROPERTY_NAME_TYPE : 4, - PROPERTY_VALUE_TYPE : 5, - PROPERTY_VALUE_PART_TYPE : 6, - SELECTOR_TYPE : 7, - SELECTOR_PART_TYPE : 8, - SELECTOR_SUB_PART_TYPE : 9, - - _stylesheet: function(){ - - var tokenStream = this._tokenStream, - charset = null, - count, - token, - tt; - - this.fire("startstylesheet"); - this._charset(); - - this._skipCruft(); - while (tokenStream.peek() == Tokens.IMPORT_SYM){ - this._import(); - this._skipCruft(); - } - while (tokenStream.peek() == Tokens.NAMESPACE_SYM){ - this._namespace(); - this._skipCruft(); - } - tt = tokenStream.peek(); - while(tt > Tokens.EOF){ - - try { - - switch(tt){ - case Tokens.MEDIA_SYM: - this._media(); - this._skipCruft(); - break; - case Tokens.PAGE_SYM: - this._page(); - this._skipCruft(); - break; - case Tokens.FONT_FACE_SYM: - this._font_face(); - this._skipCruft(); - break; - case Tokens.KEYFRAMES_SYM: - this._keyframes(); - this._skipCruft(); - break; - case Tokens.VIEWPORT_SYM: - this._viewport(); - this._skipCruft(); - break; - case Tokens.UNKNOWN_SYM: //unknown @ rule - tokenStream.get(); - if (!this.options.strict){ - this.fire({ - type: "error", - error: null, - message: "Unknown @ rule: " + tokenStream.LT(0).value + ".", - line: tokenStream.LT(0).startLine, - col: tokenStream.LT(0).startCol - }); - count=0; - while (tokenStream.advance([Tokens.LBRACE, Tokens.RBRACE]) == Tokens.LBRACE){ - count++; //keep track of nesting depth - } - - while(count){ - tokenStream.advance([Tokens.RBRACE]); - count--; - } - - } else { - throw new SyntaxError("Unknown @ rule.", tokenStream.LT(0).startLine, tokenStream.LT(0).startCol); - } - break; - case Tokens.S: - this._readWhitespace(); - break; - default: - if(!this._ruleset()){ - switch(tt){ - case Tokens.CHARSET_SYM: - token = tokenStream.LT(1); - this._charset(false); - throw new SyntaxError("@charset not allowed here.", token.startLine, token.startCol); - case Tokens.IMPORT_SYM: - token = tokenStream.LT(1); - this._import(false); - throw new SyntaxError("@import not allowed here.", token.startLine, token.startCol); - case Tokens.NAMESPACE_SYM: - token = tokenStream.LT(1); - this._namespace(false); - throw new SyntaxError("@namespace not allowed here.", token.startLine, token.startCol); - default: - tokenStream.get(); //get the last token - this._unexpectedToken(tokenStream.token()); - } - - } - } - } catch(ex) { - if (ex instanceof SyntaxError && !this.options.strict){ - this.fire({ - type: "error", - error: ex, - message: ex.message, - line: ex.line, - col: ex.col - }); - } else { - throw ex; - } - } - - tt = tokenStream.peek(); - } - - if (tt != Tokens.EOF){ - this._unexpectedToken(tokenStream.token()); - } - - this.fire("endstylesheet"); - }, - - _charset: function(emit){ - var tokenStream = this._tokenStream, - charset, - token, - line, - col; - - if (tokenStream.match(Tokens.CHARSET_SYM)){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - tokenStream.mustMatch(Tokens.STRING); - - token = tokenStream.token(); - charset = token.value; - - this._readWhitespace(); - tokenStream.mustMatch(Tokens.SEMICOLON); - - if (emit !== false){ - this.fire({ - type: "charset", - charset:charset, - line: line, - col: col - }); - } - } - }, - - _import: function(emit){ - - var tokenStream = this._tokenStream, - tt, - uri, - importToken, - mediaList = []; - tokenStream.mustMatch(Tokens.IMPORT_SYM); - importToken = tokenStream.token(); - this._readWhitespace(); - - tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); - uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1"); - - this._readWhitespace(); - - mediaList = this._media_query_list(); - tokenStream.mustMatch(Tokens.SEMICOLON); - this._readWhitespace(); - - if (emit !== false){ - this.fire({ - type: "import", - uri: uri, - media: mediaList, - line: importToken.startLine, - col: importToken.startCol - }); - } - - }, - - _namespace: function(emit){ - - var tokenStream = this._tokenStream, - line, - col, - prefix, - uri; - tokenStream.mustMatch(Tokens.NAMESPACE_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - this._readWhitespace(); - if (tokenStream.match(Tokens.IDENT)){ - prefix = tokenStream.token().value; - this._readWhitespace(); - } - - tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); - uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1"); - - this._readWhitespace(); - tokenStream.mustMatch(Tokens.SEMICOLON); - this._readWhitespace(); - - if (emit !== false){ - this.fire({ - type: "namespace", - prefix: prefix, - uri: uri, - line: line, - col: col - }); - } - - }, - - _media: function(){ - var tokenStream = this._tokenStream, - line, - col, - mediaList;// = []; - tokenStream.mustMatch(Tokens.MEDIA_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - - mediaList = this._media_query_list(); - - tokenStream.mustMatch(Tokens.LBRACE); - this._readWhitespace(); - - this.fire({ - type: "startmedia", - media: mediaList, - line: line, - col: col - }); - - while(true) { - if (tokenStream.peek() == Tokens.PAGE_SYM){ - this._page(); - } else if (tokenStream.peek() == Tokens.FONT_FACE_SYM){ - this._font_face(); - } else if (!this._ruleset()){ - break; - } - } - - tokenStream.mustMatch(Tokens.RBRACE); - this._readWhitespace(); - - this.fire({ - type: "endmedia", - media: mediaList, - line: line, - col: col - }); - }, - _media_query_list: function(){ - var tokenStream = this._tokenStream, - mediaList = []; - - - this._readWhitespace(); - - if (tokenStream.peek() == Tokens.IDENT || tokenStream.peek() == Tokens.LPAREN){ - mediaList.push(this._media_query()); - } - - while(tokenStream.match(Tokens.COMMA)){ - this._readWhitespace(); - mediaList.push(this._media_query()); - } - - return mediaList; - }, - _media_query: function(){ - var tokenStream = this._tokenStream, - type = null, - ident = null, - token = null, - expressions = []; - - if (tokenStream.match(Tokens.IDENT)){ - ident = tokenStream.token().value.toLowerCase(); - if (ident != "only" && ident != "not"){ - tokenStream.unget(); - ident = null; - } else { - token = tokenStream.token(); - } - } - - this._readWhitespace(); - - if (tokenStream.peek() == Tokens.IDENT){ - type = this._media_type(); - if (token === null){ - token = tokenStream.token(); - } - } else if (tokenStream.peek() == Tokens.LPAREN){ - if (token === null){ - token = tokenStream.LT(1); - } - expressions.push(this._media_expression()); - } - - if (type === null && expressions.length === 0){ - return null; - } else { - this._readWhitespace(); - while (tokenStream.match(Tokens.IDENT)){ - if (tokenStream.token().value.toLowerCase() != "and"){ - this._unexpectedToken(tokenStream.token()); - } - - this._readWhitespace(); - expressions.push(this._media_expression()); - } - } - - return new MediaQuery(ident, type, expressions, token.startLine, token.startCol); - }, - _media_type: function(){ - return this._media_feature(); - }, - _media_expression: function(){ - var tokenStream = this._tokenStream, - feature = null, - token, - expression = null; - - tokenStream.mustMatch(Tokens.LPAREN); - - feature = this._media_feature(); - this._readWhitespace(); - - if (tokenStream.match(Tokens.COLON)){ - this._readWhitespace(); - token = tokenStream.LT(1); - expression = this._expression(); - } - - tokenStream.mustMatch(Tokens.RPAREN); - this._readWhitespace(); - - return new MediaFeature(feature, (expression ? new SyntaxUnit(expression, token.startLine, token.startCol) : null)); - }, - _media_feature: function(){ - var tokenStream = this._tokenStream; - - tokenStream.mustMatch(Tokens.IDENT); - - return SyntaxUnit.fromToken(tokenStream.token()); - }, - _page: function(){ - var tokenStream = this._tokenStream, - line, - col, - identifier = null, - pseudoPage = null; - tokenStream.mustMatch(Tokens.PAGE_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - - if (tokenStream.match(Tokens.IDENT)){ - identifier = tokenStream.token().value; - if (identifier.toLowerCase() === "auto"){ - this._unexpectedToken(tokenStream.token()); - } - } - if (tokenStream.peek() == Tokens.COLON){ - pseudoPage = this._pseudo_page(); - } - - this._readWhitespace(); - - this.fire({ - type: "startpage", - id: identifier, - pseudo: pseudoPage, - line: line, - col: col - }); - - this._readDeclarations(true, true); - - this.fire({ - type: "endpage", - id: identifier, - pseudo: pseudoPage, - line: line, - col: col - }); - - }, - _margin: function(){ - var tokenStream = this._tokenStream, - line, - col, - marginSym = this._margin_sym(); - - if (marginSym){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this.fire({ - type: "startpagemargin", - margin: marginSym, - line: line, - col: col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endpagemargin", - margin: marginSym, - line: line, - col: col - }); - return true; - } else { - return false; - } - }, - _margin_sym: function(){ - - var tokenStream = this._tokenStream; - - if(tokenStream.match([Tokens.TOPLEFTCORNER_SYM, Tokens.TOPLEFT_SYM, - Tokens.TOPCENTER_SYM, Tokens.TOPRIGHT_SYM, Tokens.TOPRIGHTCORNER_SYM, - Tokens.BOTTOMLEFTCORNER_SYM, Tokens.BOTTOMLEFT_SYM, - Tokens.BOTTOMCENTER_SYM, Tokens.BOTTOMRIGHT_SYM, - Tokens.BOTTOMRIGHTCORNER_SYM, Tokens.LEFTTOP_SYM, - Tokens.LEFTMIDDLE_SYM, Tokens.LEFTBOTTOM_SYM, Tokens.RIGHTTOP_SYM, - Tokens.RIGHTMIDDLE_SYM, Tokens.RIGHTBOTTOM_SYM])) - { - return SyntaxUnit.fromToken(tokenStream.token()); - } else { - return null; - } - - }, - - _pseudo_page: function(){ - - var tokenStream = this._tokenStream; - - tokenStream.mustMatch(Tokens.COLON); - tokenStream.mustMatch(Tokens.IDENT); - - return tokenStream.token().value; - }, - - _font_face: function(){ - var tokenStream = this._tokenStream, - line, - col; - tokenStream.mustMatch(Tokens.FONT_FACE_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - - this.fire({ - type: "startfontface", - line: line, - col: col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endfontface", - line: line, - col: col - }); - }, - - _viewport: function(){ - var tokenStream = this._tokenStream, - line, - col; - - tokenStream.mustMatch(Tokens.VIEWPORT_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - - this.fire({ - type: "startviewport", - line: line, - col: col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endviewport", - line: line, - col: col - }); - - }, - - _operator: function(inFunction){ - - var tokenStream = this._tokenStream, - token = null; - - if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) || - (inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS]))){ - token = tokenStream.token(); - this._readWhitespace(); - } - return token ? PropertyValuePart.fromToken(token) : null; - - }, - - _combinator: function(){ - - var tokenStream = this._tokenStream, - value = null, - token; - - if(tokenStream.match([Tokens.PLUS, Tokens.GREATER, Tokens.TILDE])){ - token = tokenStream.token(); - value = new Combinator(token.value, token.startLine, token.startCol); - this._readWhitespace(); - } - - return value; - }, - - _unary_operator: function(){ - - var tokenStream = this._tokenStream; - - if (tokenStream.match([Tokens.MINUS, Tokens.PLUS])){ - return tokenStream.token().value; - } else { - return null; - } - }, - - _property: function(){ - - var tokenStream = this._tokenStream, - value = null, - hack = null, - tokenValue, - token, - line, - col; - if (tokenStream.peek() == Tokens.STAR && this.options.starHack){ - tokenStream.get(); - token = tokenStream.token(); - hack = token.value; - line = token.startLine; - col = token.startCol; - } - - if(tokenStream.match(Tokens.IDENT)){ - token = tokenStream.token(); - tokenValue = token.value; - if (tokenValue.charAt(0) == "_" && this.options.underscoreHack){ - hack = "_"; - tokenValue = tokenValue.substring(1); - } - - value = new PropertyName(tokenValue, hack, (line||token.startLine), (col||token.startCol)); - this._readWhitespace(); - } - - return value; - }, - _ruleset: function(){ - - var tokenStream = this._tokenStream, - tt, - selectors; - try { - selectors = this._selectors_group(); - } catch (ex){ - if (ex instanceof SyntaxError && !this.options.strict){ - this.fire({ - type: "error", - error: ex, - message: ex.message, - line: ex.line, - col: ex.col - }); - tt = tokenStream.advance([Tokens.RBRACE]); - if (tt == Tokens.RBRACE){ - } else { - throw ex; - } - - } else { - throw ex; - } - return true; - } - if (selectors){ - - this.fire({ - type: "startrule", - selectors: selectors, - line: selectors[0].line, - col: selectors[0].col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endrule", - selectors: selectors, - line: selectors[0].line, - col: selectors[0].col - }); - - } - - return selectors; - - }, - _selectors_group: function(){ - var tokenStream = this._tokenStream, - selectors = [], - selector; - - selector = this._selector(); - if (selector !== null){ - - selectors.push(selector); - while(tokenStream.match(Tokens.COMMA)){ - this._readWhitespace(); - selector = this._selector(); - if (selector !== null){ - selectors.push(selector); - } else { - this._unexpectedToken(tokenStream.LT(1)); - } - } - } - - return selectors.length ? selectors : null; - }, - _selector: function(){ - - var tokenStream = this._tokenStream, - selector = [], - nextSelector = null, - combinator = null, - ws = null; - nextSelector = this._simple_selector_sequence(); - if (nextSelector === null){ - return null; - } - - selector.push(nextSelector); - - do { - combinator = this._combinator(); - - if (combinator !== null){ - selector.push(combinator); - nextSelector = this._simple_selector_sequence(); - if (nextSelector === null){ - this._unexpectedToken(tokenStream.LT(1)); - } else { - selector.push(nextSelector); - } - } else { - if (this._readWhitespace()){ - ws = new Combinator(tokenStream.token().value, tokenStream.token().startLine, tokenStream.token().startCol); - combinator = this._combinator(); - nextSelector = this._simple_selector_sequence(); - if (nextSelector === null){ - if (combinator !== null){ - this._unexpectedToken(tokenStream.LT(1)); - } - } else { - - if (combinator !== null){ - selector.push(combinator); - } else { - selector.push(ws); - } - - selector.push(nextSelector); - } - } else { - break; - } - - } - } while(true); - - return new Selector(selector, selector[0].line, selector[0].col); - }, - _simple_selector_sequence: function(){ - - var tokenStream = this._tokenStream, - elementName = null, - modifiers = [], - selectorText= "", - components = [ - function(){ - return tokenStream.match(Tokens.HASH) ? - new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : - null; - }, - this._class, - this._attrib, - this._pseudo, - this._negation - ], - i = 0, - len = components.length, - component = null, - found = false, - line, - col; - line = tokenStream.LT(1).startLine; - col = tokenStream.LT(1).startCol; - - elementName = this._type_selector(); - if (!elementName){ - elementName = this._universal(); - } - - if (elementName !== null){ - selectorText += elementName; - } - - while(true){ - if (tokenStream.peek() === Tokens.S){ - break; - } - while(i < len && component === null){ - component = components[i++].call(this); - } - - if (component === null){ - if (selectorText === ""){ - return null; - } else { - break; - } - } else { - i = 0; - modifiers.push(component); - selectorText += component.toString(); - component = null; - } - } - - - return selectorText !== "" ? - new SelectorPart(elementName, modifiers, selectorText, line, col) : - null; - }, - _type_selector: function(){ - - var tokenStream = this._tokenStream, - ns = this._namespace_prefix(), - elementName = this._element_name(); - - if (!elementName){ - if (ns){ - tokenStream.unget(); - if (ns.length > 1){ - tokenStream.unget(); - } - } - - return null; - } else { - if (ns){ - elementName.text = ns + elementName.text; - elementName.col -= ns.length; - } - return elementName; - } - }, - _class: function(){ - - var tokenStream = this._tokenStream, - token; - - if (tokenStream.match(Tokens.DOT)){ - tokenStream.mustMatch(Tokens.IDENT); - token = tokenStream.token(); - return new SelectorSubPart("." + token.value, "class", token.startLine, token.startCol - 1); - } else { - return null; - } - - }, - _element_name: function(){ - - var tokenStream = this._tokenStream, - token; - - if (tokenStream.match(Tokens.IDENT)){ - token = tokenStream.token(); - return new SelectorSubPart(token.value, "elementName", token.startLine, token.startCol); - - } else { - return null; - } - }, - _namespace_prefix: function(){ - var tokenStream = this._tokenStream, - value = ""; - if (tokenStream.LA(1) === Tokens.PIPE || tokenStream.LA(2) === Tokens.PIPE){ - - if(tokenStream.match([Tokens.IDENT, Tokens.STAR])){ - value += tokenStream.token().value; - } - - tokenStream.mustMatch(Tokens.PIPE); - value += "|"; - - } - - return value.length ? value : null; - }, - _universal: function(){ - var tokenStream = this._tokenStream, - value = "", - ns; - - ns = this._namespace_prefix(); - if(ns){ - value += ns; - } - - if(tokenStream.match(Tokens.STAR)){ - value += "*"; - } - - return value.length ? value : null; - - }, - _attrib: function(){ - - var tokenStream = this._tokenStream, - value = null, - ns, - token; - - if (tokenStream.match(Tokens.LBRACKET)){ - token = tokenStream.token(); - value = token.value; - value += this._readWhitespace(); - - ns = this._namespace_prefix(); - - if (ns){ - value += ns; - } - - tokenStream.mustMatch(Tokens.IDENT); - value += tokenStream.token().value; - value += this._readWhitespace(); - - if(tokenStream.match([Tokens.PREFIXMATCH, Tokens.SUFFIXMATCH, Tokens.SUBSTRINGMATCH, - Tokens.EQUALS, Tokens.INCLUDES, Tokens.DASHMATCH])){ - - value += tokenStream.token().value; - value += this._readWhitespace(); - - tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); - value += tokenStream.token().value; - value += this._readWhitespace(); - } - - tokenStream.mustMatch(Tokens.RBRACKET); - - return new SelectorSubPart(value + "]", "attribute", token.startLine, token.startCol); - } else { - return null; - } - }, - _pseudo: function(){ - - var tokenStream = this._tokenStream, - pseudo = null, - colons = ":", - line, - col; - - if (tokenStream.match(Tokens.COLON)){ - - if (tokenStream.match(Tokens.COLON)){ - colons += ":"; - } - - if (tokenStream.match(Tokens.IDENT)){ - pseudo = tokenStream.token().value; - line = tokenStream.token().startLine; - col = tokenStream.token().startCol - colons.length; - } else if (tokenStream.peek() == Tokens.FUNCTION){ - line = tokenStream.LT(1).startLine; - col = tokenStream.LT(1).startCol - colons.length; - pseudo = this._functional_pseudo(); - } - - if (pseudo){ - pseudo = new SelectorSubPart(colons + pseudo, "pseudo", line, col); - } - } - - return pseudo; - }, - _functional_pseudo: function(){ - - var tokenStream = this._tokenStream, - value = null; - - if(tokenStream.match(Tokens.FUNCTION)){ - value = tokenStream.token().value; - value += this._readWhitespace(); - value += this._expression(); - tokenStream.mustMatch(Tokens.RPAREN); - value += ")"; - } - - return value; - }, - _expression: function(){ - - var tokenStream = this._tokenStream, - value = ""; - - while(tokenStream.match([Tokens.PLUS, Tokens.MINUS, Tokens.DIMENSION, - Tokens.NUMBER, Tokens.STRING, Tokens.IDENT, Tokens.LENGTH, - Tokens.FREQ, Tokens.ANGLE, Tokens.TIME, - Tokens.RESOLUTION, Tokens.SLASH])){ - - value += tokenStream.token().value; - value += this._readWhitespace(); - } - - return value.length ? value : null; - - }, - _negation: function(){ - - var tokenStream = this._tokenStream, - line, - col, - value = "", - arg, - subpart = null; - - if (tokenStream.match(Tokens.NOT)){ - value = tokenStream.token().value; - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - value += this._readWhitespace(); - arg = this._negation_arg(); - value += arg; - value += this._readWhitespace(); - tokenStream.match(Tokens.RPAREN); - value += tokenStream.token().value; - - subpart = new SelectorSubPart(value, "not", line, col); - subpart.args.push(arg); - } - - return subpart; - }, - _negation_arg: function(){ - - var tokenStream = this._tokenStream, - args = [ - this._type_selector, - this._universal, - function(){ - return tokenStream.match(Tokens.HASH) ? - new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : - null; - }, - this._class, - this._attrib, - this._pseudo - ], - arg = null, - i = 0, - len = args.length, - elementName, - line, - col, - part; - - line = tokenStream.LT(1).startLine; - col = tokenStream.LT(1).startCol; - - while(i < len && arg === null){ - - arg = args[i].call(this); - i++; - } - if (arg === null){ - this._unexpectedToken(tokenStream.LT(1)); - } - if (arg.type == "elementName"){ - part = new SelectorPart(arg, [], arg.toString(), line, col); - } else { - part = new SelectorPart(null, [arg], arg.toString(), line, col); - } - - return part; - }, - - _declaration: function(){ - - var tokenStream = this._tokenStream, - property = null, - expr = null, - prio = null, - error = null, - invalid = null, - propertyName= ""; - - property = this._property(); - if (property !== null){ - - tokenStream.mustMatch(Tokens.COLON); - this._readWhitespace(); - - expr = this._expr(); - if (!expr || expr.length === 0){ - this._unexpectedToken(tokenStream.LT(1)); - } - - prio = this._prio(); - propertyName = property.toString(); - if (this.options.starHack && property.hack == "*" || - this.options.underscoreHack && property.hack == "_") { - - propertyName = property.text; - } - - try { - this._validateProperty(propertyName, expr); - } catch (ex) { - invalid = ex; - } - - this.fire({ - type: "property", - property: property, - value: expr, - important: prio, - line: property.line, - col: property.col, - invalid: invalid - }); - - return true; - } else { - return false; - } - }, - - _prio: function(){ - - var tokenStream = this._tokenStream, - result = tokenStream.match(Tokens.IMPORTANT_SYM); - - this._readWhitespace(); - return result; - }, - - _expr: function(inFunction){ - - var tokenStream = this._tokenStream, - values = [], - value = null, - operator = null; - - value = this._term(); - if (value !== null){ - - values.push(value); - - do { - operator = this._operator(inFunction); - if (operator){ - values.push(operator); - } /*else { - values.push(new PropertyValue(valueParts, valueParts[0].line, valueParts[0].col)); - valueParts = []; - }*/ - - value = this._term(); - - if (value === null){ - break; - } else { - values.push(value); - } - } while(true); - } - - return values.length > 0 ? new PropertyValue(values, values[0].line, values[0].col) : null; - }, - - _term: function(){ - - var tokenStream = this._tokenStream, - unary = null, - value = null, - token, - line, - col; - unary = this._unary_operator(); - if (unary !== null){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - } - if (tokenStream.peek() == Tokens.IE_FUNCTION && this.options.ieFilters){ - - value = this._ie_function(); - if (unary === null){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - } - } else if (tokenStream.match([Tokens.NUMBER, Tokens.PERCENTAGE, Tokens.LENGTH, - Tokens.ANGLE, Tokens.TIME, - Tokens.FREQ, Tokens.STRING, Tokens.IDENT, Tokens.URI, Tokens.UNICODE_RANGE])){ - - value = tokenStream.token().value; - if (unary === null){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - } - this._readWhitespace(); - } else { - token = this._hexcolor(); - if (token === null){ - if (unary === null){ - line = tokenStream.LT(1).startLine; - col = tokenStream.LT(1).startCol; - } - if (value === null){ - if (tokenStream.LA(3) == Tokens.EQUALS && this.options.ieFilters){ - value = this._ie_function(); - } else { - value = this._function(); - } - } - - } else { - value = token.value; - if (unary === null){ - line = token.startLine; - col = token.startCol; - } - } - - } - - return value !== null ? - new PropertyValuePart(unary !== null ? unary + value : value, line, col) : - null; - - }, - - _function: function(){ - - var tokenStream = this._tokenStream, - functionText = null, - expr = null, - lt; - - if (tokenStream.match(Tokens.FUNCTION)){ - functionText = tokenStream.token().value; - this._readWhitespace(); - expr = this._expr(true); - functionText += expr; - if (this.options.ieFilters && tokenStream.peek() == Tokens.EQUALS){ - do { - - if (this._readWhitespace()){ - functionText += tokenStream.token().value; - } - if (tokenStream.LA(0) == Tokens.COMMA){ - functionText += tokenStream.token().value; - } - - tokenStream.match(Tokens.IDENT); - functionText += tokenStream.token().value; - - tokenStream.match(Tokens.EQUALS); - functionText += tokenStream.token().value; - lt = tokenStream.peek(); - while(lt != Tokens.COMMA && lt != Tokens.S && lt != Tokens.RPAREN){ - tokenStream.get(); - functionText += tokenStream.token().value; - lt = tokenStream.peek(); - } - } while(tokenStream.match([Tokens.COMMA, Tokens.S])); - } - - tokenStream.match(Tokens.RPAREN); - functionText += ")"; - this._readWhitespace(); - } - - return functionText; - }, - - _ie_function: function(){ - - var tokenStream = this._tokenStream, - functionText = null, - expr = null, - lt; - if (tokenStream.match([Tokens.IE_FUNCTION, Tokens.FUNCTION])){ - functionText = tokenStream.token().value; - - do { - - if (this._readWhitespace()){ - functionText += tokenStream.token().value; - } - if (tokenStream.LA(0) == Tokens.COMMA){ - functionText += tokenStream.token().value; - } - - tokenStream.match(Tokens.IDENT); - functionText += tokenStream.token().value; - - tokenStream.match(Tokens.EQUALS); - functionText += tokenStream.token().value; - lt = tokenStream.peek(); - while(lt != Tokens.COMMA && lt != Tokens.S && lt != Tokens.RPAREN){ - tokenStream.get(); - functionText += tokenStream.token().value; - lt = tokenStream.peek(); - } - } while(tokenStream.match([Tokens.COMMA, Tokens.S])); - - tokenStream.match(Tokens.RPAREN); - functionText += ")"; - this._readWhitespace(); - } - - return functionText; - }, - - _hexcolor: function(){ - - var tokenStream = this._tokenStream, - token = null, - color; - - if(tokenStream.match(Tokens.HASH)){ - - token = tokenStream.token(); - color = token.value; - if (!/#[a-f0-9]{3,6}/i.test(color)){ - throw new SyntaxError("Expected a hex color but found '" + color + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); - } - this._readWhitespace(); - } - - return token; - }, - - _keyframes: function(){ - var tokenStream = this._tokenStream, - token, - tt, - name, - prefix = ""; - - tokenStream.mustMatch(Tokens.KEYFRAMES_SYM); - token = tokenStream.token(); - if (/^@\-([^\-]+)\-/.test(token.value)) { - prefix = RegExp.$1; - } - - this._readWhitespace(); - name = this._keyframe_name(); - - this._readWhitespace(); - tokenStream.mustMatch(Tokens.LBRACE); - - this.fire({ - type: "startkeyframes", - name: name, - prefix: prefix, - line: token.startLine, - col: token.startCol - }); - - this._readWhitespace(); - tt = tokenStream.peek(); - while(tt == Tokens.IDENT || tt == Tokens.PERCENTAGE) { - this._keyframe_rule(); - this._readWhitespace(); - tt = tokenStream.peek(); - } - - this.fire({ - type: "endkeyframes", - name: name, - prefix: prefix, - line: token.startLine, - col: token.startCol - }); - - this._readWhitespace(); - tokenStream.mustMatch(Tokens.RBRACE); - - }, - - _keyframe_name: function(){ - var tokenStream = this._tokenStream, - token; - - tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); - return SyntaxUnit.fromToken(tokenStream.token()); - }, - - _keyframe_rule: function(){ - var tokenStream = this._tokenStream, - token, - keyList = this._key_list(); - - this.fire({ - type: "startkeyframerule", - keys: keyList, - line: keyList[0].line, - col: keyList[0].col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endkeyframerule", - keys: keyList, - line: keyList[0].line, - col: keyList[0].col - }); - - }, - - _key_list: function(){ - var tokenStream = this._tokenStream, - token, - key, - keyList = []; - keyList.push(this._key()); - - this._readWhitespace(); - - while(tokenStream.match(Tokens.COMMA)){ - this._readWhitespace(); - keyList.push(this._key()); - this._readWhitespace(); - } - - return keyList; - }, - - _key: function(){ - - var tokenStream = this._tokenStream, - token; - - if (tokenStream.match(Tokens.PERCENTAGE)){ - return SyntaxUnit.fromToken(tokenStream.token()); - } else if (tokenStream.match(Tokens.IDENT)){ - token = tokenStream.token(); - - if (/from|to/i.test(token.value)){ - return SyntaxUnit.fromToken(token); - } - - tokenStream.unget(); - } - this._unexpectedToken(tokenStream.LT(1)); - }, - _skipCruft: function(){ - while(this._tokenStream.match([Tokens.S, Tokens.CDO, Tokens.CDC])){ - } - }, - _readDeclarations: function(checkStart, readMargins){ - var tokenStream = this._tokenStream, - tt; - - - this._readWhitespace(); - - if (checkStart){ - tokenStream.mustMatch(Tokens.LBRACE); - } - - this._readWhitespace(); - - try { - - while(true){ - - if (tokenStream.match(Tokens.SEMICOLON) || (readMargins && this._margin())){ - } else if (this._declaration()){ - if (!tokenStream.match(Tokens.SEMICOLON)){ - break; - } - } else { - break; - } - this._readWhitespace(); - } - - tokenStream.mustMatch(Tokens.RBRACE); - this._readWhitespace(); - - } catch (ex) { - if (ex instanceof SyntaxError && !this.options.strict){ - this.fire({ - type: "error", - error: ex, - message: ex.message, - line: ex.line, - col: ex.col - }); - tt = tokenStream.advance([Tokens.SEMICOLON, Tokens.RBRACE]); - if (tt == Tokens.SEMICOLON){ - this._readDeclarations(false, readMargins); - } else if (tt != Tokens.RBRACE){ - throw ex; - } - - } else { - throw ex; - } - } - - }, - _readWhitespace: function(){ - - var tokenStream = this._tokenStream, - ws = ""; - - while(tokenStream.match(Tokens.S)){ - ws += tokenStream.token().value; - } - - return ws; - }, - _unexpectedToken: function(token){ - throw new SyntaxError("Unexpected token '" + token.value + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); - }, - _verifyEnd: function(){ - if (this._tokenStream.LA(1) != Tokens.EOF){ - this._unexpectedToken(this._tokenStream.LT(1)); - } - }, - _validateProperty: function(property, value){ - Validation.validate(property, value); - }, - - parse: function(input){ - this._tokenStream = new TokenStream(input, Tokens); - this._stylesheet(); - }, - - parseStyleSheet: function(input){ - return this.parse(input); - }, - - parseMediaQuery: function(input){ - this._tokenStream = new TokenStream(input, Tokens); - var result = this._media_query(); - this._verifyEnd(); - return result; - }, - parsePropertyValue: function(input){ - - this._tokenStream = new TokenStream(input, Tokens); - this._readWhitespace(); - - var result = this._expr(); - this._readWhitespace(); - this._verifyEnd(); - return result; - }, - parseRule: function(input){ - this._tokenStream = new TokenStream(input, Tokens); - this._readWhitespace(); - - var result = this._ruleset(); - this._readWhitespace(); - this._verifyEnd(); - return result; - }, - parseSelector: function(input){ - - this._tokenStream = new TokenStream(input, Tokens); - this._readWhitespace(); - - var result = this._selector(); - this._readWhitespace(); - this._verifyEnd(); - return result; - }, - parseStyleAttribute: function(input){ - input += "}"; // for error recovery in _readDeclarations() - this._tokenStream = new TokenStream(input, Tokens); - this._readDeclarations(); - } - }; - for (prop in additions){ - if (additions.hasOwnProperty(prop)){ - proto[prop] = additions[prop]; - } - } - - return proto; -}(); -var Properties = { - "alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | | ", - "alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", - "animation" : 1, - "animation-delay" : { multi: "