Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Yaxel Perez
jio
Commits
498c67f7
Commit
498c67f7
authored
Feb 08, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jio.js and complex_queries.js updated
parent
e2fdf56b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
44 deletions
+58
-44
complex_queries.js
complex_queries.js
+44
-38
jio.js
jio.js
+14
-6
No files found.
complex_queries.js
View file @
498c67f7
/*
* Copyright 2013, Nexedi SA
* Released under the LGPL license.
* http://www.gnu.org/licenses/lgpl.html
*/
(
function
(
scope
)
{
(
function
(
scope
)
{
"
use strict
"
;
"
use strict
"
;
Object
.
defineProperty
(
scope
,
"
ComplexQueries
"
,
{
Object
.
defineProperty
(
scope
,
"
ComplexQueries
"
,
{
...
@@ -29,15 +35,15 @@ Object.defineProperty(scope.ComplexQueries, "parse", {
...
@@ -29,15 +35,15 @@ Object.defineProperty(scope.ComplexQueries, "parse", {
This is in the public domain.
This is in the public domain.
*/
*/
var
_dbg_withtrace
=
false
;
var
NODEJS_
_dbg_withtrace
=
false
;
var
_dbg_string
=
new
String
();
var
NODEJS_
_dbg_string
=
new
String
();
function
__dbg_print
(
text
)
function
__
NODEJS_
dbg_print
(
text
)
{
{
_dbg_string
+=
text
+
"
\n
"
;
NODEJS_
_dbg_string
+=
text
+
"
\n
"
;
}
}
function
__lex
(
info
)
function
__
NODEJS_
lex
(
info
)
{
{
var
state
=
0
;
var
state
=
0
;
var
match
=
-
1
;
var
match
=
-
1
;
...
@@ -243,7 +249,7 @@ switch( state )
...
@@ -243,7 +249,7 @@ switch( state )
}
}
function
__parse
(
src
,
err_off
,
err_la
)
function
__
NODEJS_
parse
(
src
,
err_off
,
err_la
)
{
{
var
sstack
=
new
Array
();
var
sstack
=
new
Array
();
var
vstack
=
new
Array
();
var
vstack
=
new
Array
();
...
@@ -371,7 +377,7 @@ var labels = new Array(
...
@@ -371,7 +377,7 @@ var labels = new Array(
sstack
.
push
(
0
);
sstack
.
push
(
0
);
vstack
.
push
(
0
);
vstack
.
push
(
0
);
la
=
__lex
(
info
);
la
=
__
NODEJS_
lex
(
info
);
while
(
true
)
while
(
true
)
{
{
...
@@ -385,9 +391,9 @@ var labels = new Array(
...
@@ -385,9 +391,9 @@ var labels = new Array(
}
}
}
}
if
(
_dbg_withtrace
&&
sstack
.
length
>
0
)
if
(
NODEJS_
_dbg_withtrace
&&
sstack
.
length
>
0
)
{
{
__dbg_print
(
"
\n
State
"
+
sstack
[
sstack
.
length
-
1
]
+
"
\n
"
+
__
NODEJS_
dbg_print
(
"
\n
State
"
+
sstack
[
sstack
.
length
-
1
]
+
"
\n
"
+
"
\t
Lookahead:
"
+
labels
[
la
]
+
"
(
\"
"
+
info
.
att
+
"
\"
)
\n
"
+
"
\t
Lookahead:
"
+
labels
[
la
]
+
"
(
\"
"
+
info
.
att
+
"
\"
)
\n
"
+
"
\t
Action:
"
+
act
+
"
\n
"
+
"
\t
Action:
"
+
act
+
"
\n
"
+
"
\t
Source:
\"
"
+
info
.
src
.
substr
(
info
.
offset
,
30
)
+
(
(
info
.
offset
+
30
<
info
.
src
.
length
)
?
"
\t
Source:
\"
"
+
info
.
src
.
substr
(
info
.
offset
,
30
)
+
(
(
info
.
offset
+
30
<
info
.
src
.
length
)
?
...
@@ -400,8 +406,8 @@ var labels = new Array(
...
@@ -400,8 +406,8 @@ var labels = new Array(
//Panic-mode: Try recovery when parse-error occurs!
//Panic-mode: Try recovery when parse-error occurs!
if
(
act
==
25
)
if
(
act
==
25
)
{
{
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
Error detected: There is no reduce or shift on the symbol
"
+
labels
[
la
]
);
__
NODEJS_
dbg_print
(
"
Error detected: There is no reduce or shift on the symbol
"
+
labels
[
la
]
);
err_cnt
++
;
err_cnt
++
;
err_off
.
push
(
info
.
offset
-
info
.
att
.
length
);
err_off
.
push
(
info
.
offset
-
info
.
att
.
length
);
...
@@ -420,8 +426,8 @@ var labels = new Array(
...
@@ -420,8 +426,8 @@ var labels = new Array(
while
(
act
==
25
&&
la
!=
19
)
while
(
act
==
25
&&
la
!=
19
)
{
{
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
\t
Error recovery
\n
"
+
__
NODEJS_
dbg_print
(
"
\t
Error recovery
\n
"
+
"
Current lookahead:
"
+
labels
[
la
]
+
"
(
"
+
info
.
att
+
"
)
\n
"
+
"
Current lookahead:
"
+
labels
[
la
]
+
"
(
"
+
info
.
att
+
"
)
\n
"
+
"
Action:
"
+
act
+
"
\n\n
"
);
"
Action:
"
+
act
+
"
\n\n
"
);
if
(
la
==
-
1
)
if
(
la
==
-
1
)
...
@@ -455,19 +461,19 @@ var labels = new Array(
...
@@ -455,19 +461,19 @@ var labels = new Array(
vstack
.
push
(
rvstack
[
i
]
);
vstack
.
push
(
rvstack
[
i
]
);
}
}
la
=
__lex
(
info
);
la
=
__
NODEJS_
lex
(
info
);
}
}
if
(
act
==
25
)
if
(
act
==
25
)
{
{
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
\t
Error recovery failed, terminating parse process...
"
);
__
NODEJS_
dbg_print
(
"
\t
Error recovery failed, terminating parse process...
"
);
break
;
break
;
}
}
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
\t
Error recovery succeeded, continuing
"
);
__
NODEJS_
dbg_print
(
"
\t
Error recovery succeeded, continuing
"
);
}
}
/*
/*
...
@@ -479,29 +485,29 @@ var labels = new Array(
...
@@ -479,29 +485,29 @@ var labels = new Array(
//Shift
//Shift
if
(
act
>
0
)
if
(
act
>
0
)
{
{
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
Shifting symbol:
"
+
labels
[
la
]
+
"
(
"
+
info
.
att
+
"
)
"
);
__
NODEJS_
dbg_print
(
"
Shifting symbol:
"
+
labels
[
la
]
+
"
(
"
+
info
.
att
+
"
)
"
);
sstack
.
push
(
act
);
sstack
.
push
(
act
);
vstack
.
push
(
info
.
att
);
vstack
.
push
(
info
.
att
);
la
=
__lex
(
info
);
la
=
__
NODEJS_
lex
(
info
);
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
\t
New lookahead symbol:
"
+
labels
[
la
]
+
"
(
"
+
info
.
att
+
"
)
"
);
__
NODEJS_
dbg_print
(
"
\t
New lookahead symbol:
"
+
labels
[
la
]
+
"
(
"
+
info
.
att
+
"
)
"
);
}
}
//Reduce
//Reduce
else
else
{
{
act
*=
-
1
;
act
*=
-
1
;
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
Reducing by producution:
"
+
act
);
__
NODEJS_
dbg_print
(
"
Reducing by producution:
"
+
act
);
rval
=
void
(
0
);
rval
=
void
(
0
);
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
\t
Performing semantic action...
"
);
__
NODEJS_
dbg_print
(
"
\t
Performing semantic action...
"
);
switch
(
act
)
switch
(
act
)
{
{
...
@@ -589,8 +595,8 @@ switch( act )
...
@@ -589,8 +595,8 @@ switch( act )
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
\t
Popping
"
+
pop_tab
[
act
][
1
]
+
"
off the stack...
"
);
__
NODEJS_
dbg_print
(
"
\t
Popping
"
+
pop_tab
[
act
][
1
]
+
"
off the stack...
"
);
for
(
var
i
=
0
;
i
<
pop_tab
[
act
][
1
];
i
++
)
for
(
var
i
=
0
;
i
<
pop_tab
[
act
][
1
];
i
++
)
{
{
...
@@ -611,24 +617,24 @@ switch( act )
...
@@ -611,24 +617,24 @@ switch( act )
if
(
act
==
0
)
if
(
act
==
0
)
break
;
break
;
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
__dbg_print
(
"
\t
Pushing non-terminal
"
+
labels
[
pop_tab
[
act
][
0
]
]
);
__
NODEJS_
dbg_print
(
"
\t
Pushing non-terminal
"
+
labels
[
pop_tab
[
act
][
0
]
]
);
sstack
.
push
(
go
);
sstack
.
push
(
go
);
vstack
.
push
(
rval
);
vstack
.
push
(
rval
);
}
}
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
{
{
alert
(
_dbg_string
);
alert
(
NODEJS_
_dbg_string
);
_dbg_string
=
new
String
();
NODEJS_
_dbg_string
=
new
String
();
}
}
}
}
if
(
_dbg_withtrace
)
if
(
NODEJS_
_dbg_withtrace
)
{
{
__dbg_print
(
"
\n
Parse complete.
"
);
__
NODEJS_
dbg_print
(
"
\n
Parse complete.
"
);
alert
(
_dbg_string
);
alert
(
NODEJS_
_dbg_string
);
}
}
return
err_cnt
;
return
err_cnt
;
...
@@ -683,7 +689,7 @@ var error_offsets = [];
...
@@ -683,7 +689,7 @@ var error_offsets = [];
var
error_lookaheads
=
[];
var
error_lookaheads
=
[];
var
error_count
=
0
;
var
error_count
=
0
;
var
result
;
var
result
;
if
(
(
error_count
=
__parse
(
string
,
error_offsets
,
error_lookaheads
)
)
>
0
)
{
if
(
(
error_count
=
__
NODEJS_
parse
(
string
,
error_offsets
,
error_lookaheads
)
)
>
0
)
{
var
i
;
var
i
;
for
(
i
=
0
;
i
<
error_count
;
++
i
)
{
for
(
i
=
0
;
i
<
error_count
;
++
i
)
{
throw
new
Error
(
"
Parse error near
\"
"
+
throw
new
Error
(
"
Parse error near
\"
"
+
...
...
jio.js
View file @
498c67f7
/*
* Copyright 2013, Nexedi SA
* Released under the LGPL license.
* http://www.gnu.org/licenses/lgpl.html
*/
(
function
(
scope
,
hex_md5
)
{
(
function
(
scope
,
hex_md5
)
{
"
use strict
"
;
"
use strict
"
;
var
localstorage
;
var
localstorage
;
...
@@ -1794,12 +1800,14 @@ var jobRules = (function () {
...
@@ -1794,12 +1800,14 @@ var jobRules = (function () {
that
.
default_action
=
that
.
none
;
that
.
default_action
=
that
.
none
;
that
.
default_compare
=
function
(
job1
,
job2
)
{
that
.
default_compare
=
function
(
job1
,
job2
)
{
return
(
job1
.
getCommand
().
getDocId
()
===
job2
.
getCommand
().
getDocId
()
&&
return
(
job1
.
getCommand
().
getDocId
()
===
job2
.
getCommand
().
getDocId
()
&&
job1
.
getCommand
().
getDocInfo
(
'
_rev
'
)
===
job1
.
getCommand
().
getAttachmentId
()
===
job2
.
getCommand
().
getDocInfo
(
'
_rev
'
)
&&
job2
.
getCommand
().
getAttachmentId
()
&&
job1
.
getCommand
().
getOption
(
'
rev
'
)
===
job1
.
getCommand
().
getDocInfo
(
'
_rev
'
)
===
job2
.
getCommand
().
getOption
(
'
rev
'
)
&&
job2
.
getCommand
().
getDocInfo
(
'
_rev
'
)
&&
JSON
.
stringify
(
job1
.
getStorage
().
serialized
())
===
job1
.
getCommand
().
getOption
(
'
rev
'
)
===
JSON
.
stringify
(
job2
.
getStorage
().
serialized
()));
job2
.
getCommand
().
getOption
(
'
rev
'
)
&&
JSON
.
stringify
(
job1
.
getStorage
().
serialized
())
===
JSON
.
stringify
(
job2
.
getStorage
().
serialized
()));
};
};
// Methods //
// Methods //
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment