mbrevoort / codemirror2-xquery Goto Github PK
View Code? Open in Web Editor NEWThis project forked from codemirror/codemirror5
In-browser code editor
Home Page: http://codemirror.net/
License: Other
This project forked from codemirror/codemirror5
In-browser code editor
Home Page: http://codemirror.net/
License: Other
This is of lower priority. I don’t think I’ve seen EQNames in the wild, but we’d need to verify that.
http://mbrevoort.github.com/CodeMirror2/#!Construct/DirectConElem/K2-DirectConElem-49.xq
This is a corner case and of low priority.
let $rootfolder := "c:\builds\winnt\HEAD\qa\scripts"
let $keysfolder := concat($rootfolder, "keys")
return
$keysfolder
Thanks,
Scott D Brooks
The issue was first reported when this XQuery code was being typed into QConsole:
fn:replace("^/([\w\d_-])/?(update|create|delete).?(\w)/?$"
--> add a second double quotes after fn:replace( and watch the browser lock
after some testing, I have simplified the symptom of the bug. Type the following:
type $
type "
browser will lock.
The offending line is the while loop on 297
// a variable may start with a quoted EQName so if the next character is quote, consume to the next quote
if(stream.eat(""")) {
while(stream.next() !== '"'){};
let $s :=
'import module namespace a = "http://marklogic.com/roxy/models/alert-lib" at "/app/models/alert-lib.xqy";
define variable $my:doc as node() external
a:fire-event($my:doc)'
return
xdmp:eval($s, (xs:QName("my:doc"), fn:doc($cpf-document-uri)),
{xdmp:database("Alerting-content")}
)
and it will be all red.
The second through nth FLOWR statements are not highlighted correctly in the sample below.
xquery version "1.0-ml";
declare namespace bt="http://cerisent.com/bugtrack";
declare namespace local="local";
declare default collation "http://marklogic.com/collation/codepoint";
declare function local:asdf($name as xs:string, $parent-query as cts:query) {
for $ev in cts:element-values(xs:QName($name), (), (), $parent-query)
return element group {
attribute value {
$ev
},
cts:frequency($ev)
}
};
(:
{
local:asdf("bt:category", cts:and-query(()))
},
:)
{
let $q := cts:and-query((
cts:element-value-query(xs:QName("bt:submitted-by"), "jmakeig"),
cts:field-value-query("to-be-fixed-in-versions", "5.0-1"),
cts:element-value-query(xs:QName("bt:status"), ("new", "verify", "fix", "external"))
))
(: categories :)
for $c in cts:element-values(xs:QName("bt:category"), (), (), $q)
return {
let $q2 := cts:and-query((
$q,
cts:element-value-query(xs:QName("bt:category"), $c)
))
(: categories > versions :)
for $v in cts:field-values("to-be-fixed-in-versions", (), (), $q2)
return {
let $q3 := cts:and-query((
$q2,
cts:field-value-query("to-be-fixed-in-versions", $v)
))
(: categories > versions > assigned-to :)
for $at in cts:element-values(xs:QName("bt:assigned-to"), (), (), $q3)
return {
let $q4 := cts:and-query((
$q3,
cts:element-value-query(xs:QName("bt:assigned-to"), $at)
))
for $s in cts:element-values(xs:QName("bt:status"), (), (), $q4)
return {cts:frequency($s)}
}
}
}
}
The keyword empty-sequence does not highlight properly
"foo" instance of empty-sequence()
This is a corner case and of low priority.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.