Skip to content

Commit

Permalink
package 12.05.22
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnester committed May 12, 2022
1 parent afd1806 commit 61015eb
Show file tree
Hide file tree
Showing 83 changed files with 4,628 additions and 188 deletions.
540 changes: 540 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions ace-modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ declare module 'ace-builds/src-noconflict/mode-assembly_x86';
declare module 'ace-builds/src-noconflict/mode-autohotkey';
declare module 'ace-builds/src-noconflict/mode-batchfile';
declare module 'ace-builds/src-noconflict/mode-c9search';
declare module 'ace-builds/src-noconflict/mode-c_cpp';
declare module 'ace-builds/src-noconflict/mode-cirru';
declare module 'ace-builds/src-noconflict/mode-clojure';
declare module 'ace-builds/src-noconflict/mode-cobol';
Expand All @@ -54,7 +55,6 @@ declare module 'ace-builds/src-noconflict/mode-csound_score';
declare module 'ace-builds/src-noconflict/mode-csp';
declare module 'ace-builds/src-noconflict/mode-css';
declare module 'ace-builds/src-noconflict/mode-curly';
declare module 'ace-builds/src-noconflict/mode-c_cpp';
declare module 'ace-builds/src-noconflict/mode-d';
declare module 'ace-builds/src-noconflict/mode-dart';
declare module 'ace-builds/src-noconflict/mode-diff';
Expand Down Expand Up @@ -222,8 +222,8 @@ declare module 'ace-builds/src-noconflict/theme-kr_theme';
declare module 'ace-builds/src-noconflict/theme-kuroir';
declare module 'ace-builds/src-noconflict/theme-merbivore';
declare module 'ace-builds/src-noconflict/theme-merbivore_soft';
declare module 'ace-builds/src-noconflict/theme-monokai';
declare module 'ace-builds/src-noconflict/theme-mono_industrial';
declare module 'ace-builds/src-noconflict/theme-monokai';
declare module 'ace-builds/src-noconflict/theme-nord_dark';
declare module 'ace-builds/src-noconflict/theme-one_dark';
declare module 'ace-builds/src-noconflict/theme-pastel_on_dark';
Expand Down Expand Up @@ -255,6 +255,7 @@ declare module 'ace-builds/src-noconflict/snippets/assembly_x86';
declare module 'ace-builds/src-noconflict/snippets/autohotkey';
declare module 'ace-builds/src-noconflict/snippets/batchfile';
declare module 'ace-builds/src-noconflict/snippets/c9search';
declare module 'ace-builds/src-noconflict/snippets/c_cpp';
declare module 'ace-builds/src-noconflict/snippets/cirru';
declare module 'ace-builds/src-noconflict/snippets/clojure';
declare module 'ace-builds/src-noconflict/snippets/cobol';
Expand All @@ -268,7 +269,6 @@ declare module 'ace-builds/src-noconflict/snippets/csound_score';
declare module 'ace-builds/src-noconflict/snippets/csp';
declare module 'ace-builds/src-noconflict/snippets/css';
declare module 'ace-builds/src-noconflict/snippets/curly';
declare module 'ace-builds/src-noconflict/snippets/c_cpp';
declare module 'ace-builds/src-noconflict/snippets/d';
declare module 'ace-builds/src-noconflict/snippets/dart';
declare module 'ace-builds/src-noconflict/snippets/diff';
Expand Down
2 changes: 1 addition & 1 deletion ace.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ export namespace Ace {
setStyle(style: string): void;
unsetStyle(style: string): void;
getFontSize(): string;
setFontSize(size: string): void;
setFontSize(size: number): void;
focus(): void;
isFocused(): boolean;
blur(): void;
Expand Down
41 changes: 31 additions & 10 deletions demo/kitchen-sink/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,7 @@ var supportedModes = {
HTML_Ruby: ["erb|rhtml|html.erb"],
INI: ["ini|conf|cfg|prefs"],
Io: ["io"],
Ion: ["ion"],
Jack: ["jack"],
Jade: ["jade|pug"],
Java: ["java"],
Expand Down Expand Up @@ -1821,11 +1822,12 @@ var supportedModes = {
Nunjucks: ["nunjucks|nunjs|nj|njk"],
ObjectiveC: ["m|mm"],
OCaml: ["ml|mli"],
PartiQL: ["partiql|pql"],
Pascal: ["pas|p"],
Perl: ["pl|pm"],
pgSQL: ["pgsql"],
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
PHP_Laravel_blade: ["blade.php"],
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
Pig: ["pig"],
Powershell: ["ps1"],
Praat: ["praat|praatscript|psc|proc"],
Expand All @@ -1845,6 +1847,7 @@ var supportedModes = {
RST: ["rst"],
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
Rust: ["rs"],
SaC: ["sac"],
SASS: ["sass"],
SCAD: ["scad"],
Scala: ["scala|sbt"],
Expand Down Expand Up @@ -6831,6 +6834,15 @@ var keyWordCompleter = {
}
};

var transformSnippetTooltip = function(str) {
var record = {};
return str.replace(/\${(\d+)(:(.*?))?}/g, function(_, p1, p2, p3) {
return (record[p1] = p3 || '');
}).replace(/\$(\d+?)/g, function (_, p1) {
return record[p1];
});
};

var snippetCompleter = {
getCompletions: function(editor, session, pos, prefix, callback) {
var scopes = [];
Expand Down Expand Up @@ -6863,7 +6875,7 @@ var snippetCompleter = {
if (item.type == "snippet" && !item.docHTML) {
item.docHTML = [
"<b>", lang.escapeHTML(item.caption), "</b>", "<hr></hr>",
lang.escapeHTML(item.snippet)
lang.escapeHTML(transformSnippetTooltip(item.snippet))
].join("");
}
}
Expand Down Expand Up @@ -6994,12 +7006,17 @@ function is(token, type) {
exports.singletonTags = ["area", "base", "br", "col", "command", "embed", "hr", "html", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
exports.blockTags = ["article", "aside", "blockquote", "body", "div", "dl", "fieldset", "footer", "form", "head", "header", "html", "nav", "ol", "p", "script", "section", "style", "table", "tbody", "tfoot", "thead", "ul"];

exports.formatOptions = {
lineBreaksAfterCommasInCurlyBlock: true
};

exports.beautify = function(session) {
var iterator = new TokenIterator(session, 0, 0);
var token = iterator.getCurrentToken();
var tabString = session.getTabString();
var singletonTags = exports.singletonTags;
var blockTags = exports.blockTags;
var formatOptions = exports.formatOptions || {};
var nextToken;
var breakBefore = false;
var spaceBefore = false;
Expand Down Expand Up @@ -7181,7 +7198,7 @@ exports.beautify = function(session) {
} else if (token.type === "punctuation.operator" && value.match(/^(:|,)$/)) {
trimCode();
trimNext();
if (value.match(/^(,)$/) && curlyDepth>0 && roundDepth===0) {
if (value.match(/^(,)$/) && curlyDepth>0 && roundDepth===0 && formatOptions.lineBreaksAfterCommasInCurlyBlock) {
rowsToAdd++;
} else {
spaceAfter = true;
Expand Down Expand Up @@ -7288,14 +7305,18 @@ exports.beautify = function(session) {
else
rowsToAdd = 1;
}
if (is(token, "tag-open") && value === "</") {
depth--;
} else if (is(token, "tag-open") && value === "<" && singletonTags.indexOf(nextToken.value) === -1) {
depth++;
} else if (is(token, "tag-name")) {
if (nextToken && singletonTags.indexOf(nextToken.value) === -1) {
if (is(token, "tag-open") && value === "</") {
depth--;
} else if (is(token, "tag-open") && value === "<") {
depth++;
} else if (is(token, "tag-close") && value === "/>"){
depth--;
}
}

if (is(token, "tag-name")) {
tagName = value;
} else if (is(token, "tag-close") && value === "/>" && singletonTags.indexOf(tagName) === -1){
depth--;
}

row = curRow;
Expand Down
68 changes: 68 additions & 0 deletions demo/kitchen-sink/docs/ion.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Comment
/*
Multi
Line
Comment
*/
[1,2,3,45 /*TODO: should be 42, obviously*/, 2016-04-21T08:10:46Z, 2016-04-21T08:10:46-08:00, 2016-04-21, 2016, 0x5, 0b0110]
(5 7 1 3 [
'a', 'b',
null, null.int, null.bool, null.list
true, false,
nan, -inf, +inf,
"str",
"str with embedded \" ",
'''str with embedded \''' ''',
{{"clob content"}},
{{ AB/ }}
])

'''

multi
line
string

'''

states::{
// https://amzn.github.io/ion-docs/docs/spec.html
root: rules::[
include::'value'
],

// https://amzn.github.io/ion-docs/docs/spec.html#string
string: rules::[
match::{
regex: "(\\\")((?:\\\\\"|[^\"])*)(\\\")",
token: ['string.dblq.punc.start', 'string.dblq', 'string.dblq.punc.end']
},
push::{
regex: "\'{3}",
token: 'string.trpq.punc.start',
states: rules::[
pop::{
regex: "\'{3}",
token: 'string.trpq.punc.end',
},
match::{
regex: "(?:\\\\'*|.|[^']*)",
token: 'string.trpq'
}
]
},
],

/*
...
*/
}
{
"json": {
"compatibility": true,
"open sourced": "2016-04-21T08:10:46Z",
"foo": 9,
"bar": 1.1,
"baz": [{"id": 1}, {"id":2}]
}
}
62 changes: 62 additions & 0 deletions demo/kitchen-sink/docs/partiql.partiql
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
-- comment
/* multi
line
comment */

SELECT a, b, c FROM stuff s INNER CROSS JOIN @s WHERE f(s) -- comment
-- comment
SELECT "a", b FROM stuff s, @s WHERE f(s)

SELECT VALUE {'sensor': s.sensor,
'readings': (SELECT VALUE l.co
FROM logs as l
WHERE l.sensor = s.sensor
)
}
FROM sensors AS s

SELECT VALUE (PIVOT v AT g
FROM UNPIVOT r as v At g
WHERE g LIKE 'co%')
FROM sensors AS r


SELECT x.*
FROM [{'a':1, 'b':1}, {'a':2}, 'foo'] AS x

-- NOTE: the embedded ion values parse as ion (inside the backticks "`")
SELECT x.*
FROM `[{'a':1, 'b':1}, {'a':2}, "foo"]` AS x

SELECT VALUE {v.a: v.b, v.c: v.d}
FROM <<{'a':'same', 'b':1, 'c':'same', 'd':2}>> AS v

SELECT u.id, feedbackId, commentId, upvoteId
FROM users as u, u.feedbacks as feedback at feedbackId
LEFT CROSS JOIN feedback.comments as comment AT commentId
LEFT CROSS JOIN UNPIVOT comment.upvotes as upvote at upvoteId


SELECT (
SELECT numRec, tabulated
FROM committed.changes changes,
(SELECT u.id, feedbackId, commentId, upvoteId
FROM changes.tabulated as u,
u.feedbacks as feedback at feedbackId LEFT CROSS JOIN feedback.comments as comment AT commentId
LEFT CROSS JOIN UNPIVOT comment.upvotes as upvote at upvoteId
) as tabulated,
changes.numRec as numRec
)
AS changes
FROM incoming_committed committed

SELECT SUM(AVG(n)) FROM <<numbers, numbers>> AS n

SELECT VALUES v.a
FROM [{'a':1, 'b':true}, {'a':2, 'b':null}, {'a':3}] v
WHERE v.b

SELECT attributeId, COUNT(*) as the_count
FROM repeating_things
GROUP BY attributeId GROUP AS g
HAVING 1 = 0
16 changes: 15 additions & 1 deletion demo/kitchen-sink/docs/php_laravel_blade.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,18 @@
@yield('content')
</div>
</body>
</html>
</html>


{{-- comment --}}

@if (
{{-- comment --}}
/*block comment*/
#another comment
$user->type == 1
// c comment
/* comment*/
)
# not a comment <div id="#//x"></div>
@endif
75 changes: 75 additions & 0 deletions demo/kitchen-sink/docs/sac.sac
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*****************************************************************************
*
* SAC demo program
*
* This SAC demo program implements 2-dimensional relaxation on double
* precision floating point numbers applying a 4-point stencil and fixed
* boundary conditions.
*
* The vertical (SIZE1) and the horizontal (SIZE2) array size as well as
* the number of iterations to be performed (LOOP) may be set at compile
* time.
*
*****************************************************************************/

#ifndef LOOP
#define LOOP 100
#endif

#ifndef SIZE1
#define SIZE1 1000
#endif

#ifndef SIZE2
#define SIZE2 1000
#endif

use Array: all;
use StdIO: all;

inline
double[+] onestep(double[+] B)
{
A = with {
( . < x < . ) : 0.25*(B[x+[1,0]]
+ B[x-[1,0]]
+ B[x+[0,1]]
+ B[x-[0,1]]);
} : modarray( B );

return(A);
}

inline
double[+] relax(double[+] A, int steps)
{
for (k=0; k<steps; k++) {
A = onestep(A);
}

return(A);
}

int main ()
{
A = with {
( . <= x <= . ) : 0.0d;
} : genarray( [SIZE1,SIZE2] );

A = modarray(A, [0,1], 500.0d);
A = relax( A, LOOP);

z = with {
( 0*shape(A) <= x < shape(A) ) : A[x];
} : fold( +, 0d );

#if 0
printf("%.10g\n", z);
return(0);
#else
print( z);
return( 0);
#endif
}


2 changes: 1 addition & 1 deletion kitchen-sink.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="author" content="Fabian Jakobs">
<!--
Ace
version 1.4.14
version 1.5.0
commit
-->

Expand Down
Loading

0 comments on commit 61015eb

Please sign in to comment.