Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partiql fixes #4686

Merged
merged 2 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions demo/kitchen-sink/docs/ion.ion
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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
null, null.int, null.bool, null.list,
true, false,
nan, -inf, +inf,
"str",
Expand All @@ -33,15 +33,15 @@ states::{

// https://amzn.github.io/ion-docs/docs/spec.html#string
string: rules::[
match::{
match :: {
regex: "(\\\")((?:\\\\\"|[^\"])*)(\\\")",
token: ['string.dblq.punc.start', 'string.dblq', 'string.dblq.punc.end']
},
push::{
regex: "\'{3}",
token: 'string.trpq.punc.start',
states: rules::[
pop::{
pop :: {
regex: "\'{3}",
token: 'string.trpq.punc.end',
},
Expand All @@ -58,7 +58,7 @@ states::{
*/
}
{
"json": {
"json": {
"compatibility": true,
"open sourced": "2016-04-21T08:10:46Z",
"foo": 9,
Expand Down
7 changes: 2 additions & 5 deletions demo/kitchen-sink/docs/partiql.partiql
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
line
comment */

SELECT a, b, c FROM stuff s INNER CROSS JOIN @s WHERE f(s) -- 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
Expand All @@ -30,6 +29,7 @@ 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
WHERE v.b

SELECT u.id, feedbackId, commentId, upvoteId
FROM users as u, u.feedbacks as feedback at feedbackId
Expand All @@ -52,9 +52,6 @@ SELECT (

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
Expand Down
45 changes: 27 additions & 18 deletions lib/ace/mode/_test/tokens_ion.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
],[
["punctuation.definition.list.begin.ion","punctuation.definition.sexp.begin.ion"],
["text.ion"," "],
["constant.other.symbol.quoted.ion","'a'"],
["storage.type.symbol.quoted.ion","'a'"],
["punctuation.definition.list.separator.ion",","],
["text.ion"," "],
["constant.other.symbol.quoted.ion","'b'"],
["storage.type.symbol.quoted.ion","'b'"],
["punctuation.definition.list.separator.ion",","]
],[
["punctuation.definition.list.begin.ion","punctuation.definition.sexp.begin.ion"],
Expand Down Expand Up @@ -163,7 +163,8 @@
"start"
],[
"punctuation.definition.struct.begin.ion",
["variable.language.annotation.ion","states::"],
["variable.language.annotation.ion","states"],
["punctuation.definition.annotation.ion","::"],
["punctuation.definition.struct.begin.ion","{"]
],[
"punctuation.definition.struct.begin.ion",
Expand All @@ -175,13 +176,15 @@
["constant.other.symbol.identifier.ion","root"],
["punctuation.definition.struct.separator.ion",":"],
["text.ion"," "],
["variable.language.annotation.ion","rules::"],
["variable.language.annotation.ion","rules"],
["punctuation.definition.annotation.ion","::"],
["punctuation.definition.list.begin.ion","["]
],[
["punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
["text.ion"," "],
["variable.language.annotation.ion","include::"],
["constant.other.symbol.quoted.ion","'value'"]
["variable.language.annotation.ion","include"],
["punctuation.definition.annotation.ion","::"],
["storage.type.symbol.quoted.ion","'value'"]
],[
"punctuation.definition.struct.begin.ion",
["text.ion"," "],
Expand All @@ -199,12 +202,14 @@
["constant.other.symbol.identifier.ion","string"],
["punctuation.definition.struct.separator.ion",":"],
["text.ion"," "],
["variable.language.annotation.ion","rules::"],
["variable.language.annotation.ion","rules"],
["punctuation.definition.annotation.ion","::"],
["punctuation.definition.list.begin.ion","["]
],[
["punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
["text.ion"," "],
["variable.language.annotation.ion","match::"],
["variable.language.annotation.ion","match"],
["punctuation.definition.annotation.ion","::"],
["punctuation.definition.struct.begin.ion","{"]
],[
["punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
Expand All @@ -223,13 +228,13 @@
["punctuation.definition.struct.separator.ion",":"],
["text.ion"," "],
["punctuation.definition.list.begin.ion","["],
["constant.other.symbol.quoted.ion","'string.dblq.punc.start'"],
["storage.type.symbol.quoted.ion","'string.dblq.punc.start'"],
["punctuation.definition.list.separator.ion",","],
["text.ion"," "],
["constant.other.symbol.quoted.ion","'string.dblq'"],
["storage.type.symbol.quoted.ion","'string.dblq'"],
["punctuation.definition.list.separator.ion",","],
["text.ion"," "],
["constant.other.symbol.quoted.ion","'string.dblq.punc.end'"],
["storage.type.symbol.quoted.ion","'string.dblq.punc.end'"],
["punctuation.definition.list.end.ion","]"]
],[
["punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
Expand All @@ -239,7 +244,8 @@
],[
["punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
["text.ion"," "],
["variable.language.annotation.ion","push::"],
["variable.language.annotation.ion","push"],
["punctuation.definition.annotation.ion","::"],
["punctuation.definition.struct.begin.ion","{"]
],[
["punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
Expand All @@ -257,20 +263,22 @@
["constant.other.symbol.identifier.ion","token"],
["punctuation.definition.struct.separator.ion",":"],
["text.ion"," "],
["constant.other.symbol.quoted.ion","'string.trpq.punc.start'"],
["storage.type.symbol.quoted.ion","'string.trpq.punc.start'"],
["punctuation.definition.struct.separator.ion",","]
],[
["punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
["text.ion"," "],
["constant.other.symbol.identifier.ion","states"],
["punctuation.definition.struct.separator.ion",":"],
["text.ion"," "],
["variable.language.annotation.ion","rules::"],
["variable.language.annotation.ion","rules"],
["punctuation.definition.annotation.ion","::"],
["punctuation.definition.list.begin.ion","["]
],[
["punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
["text.ion"," "],
["variable.language.annotation.ion","pop::"],
["variable.language.annotation.ion","pop"],
["punctuation.definition.annotation.ion","::"],
["punctuation.definition.struct.begin.ion","{"]
],[
["punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
Expand All @@ -288,7 +296,7 @@
["constant.other.symbol.identifier.ion","token"],
["punctuation.definition.struct.separator.ion",":"],
["text.ion"," "],
["constant.other.symbol.quoted.ion","'string.trpq.punc.end'"],
["storage.type.symbol.quoted.ion","'string.trpq.punc.end'"],
["punctuation.definition.struct.separator.ion",","]
],[
["punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
Expand All @@ -298,7 +306,8 @@
],[
["punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
["text.ion"," "],
["variable.language.annotation.ion","match::"],
["variable.language.annotation.ion","match"],
["punctuation.definition.annotation.ion","::"],
["punctuation.definition.struct.begin.ion","{"]
],[
["punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
Expand All @@ -316,7 +325,7 @@
["constant.other.symbol.identifier.ion","token"],
["punctuation.definition.struct.separator.ion",":"],
["text.ion"," "],
["constant.other.symbol.quoted.ion","'string.trpq'"]
["storage.type.symbol.quoted.ion","'string.trpq'"]
],[
["punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.struct.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.list.begin.ion","punctuation.definition.struct.begin.ion"],
["text.ion"," "],
Expand Down
Loading