mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-28 18:40:09 +00:00
notes and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
f36b40cdec
commit
d88179a0b3
16
format.js
16
format.js
@ -17,7 +17,7 @@ var {
|
|||||||
OR, AND, NOT,
|
OR, AND, NOT,
|
||||||
AT, OF, IN,
|
AT, OF, IN,
|
||||||
VAR, LIKE, TEST,
|
VAR, LIKE, TEST,
|
||||||
|
// non-pattern values...
|
||||||
EMPTY, NONE,
|
EMPTY, NONE,
|
||||||
} = diff
|
} = diff
|
||||||
|
|
||||||
@ -25,7 +25,8 @@ var {
|
|||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
// helpers...
|
// helpers...
|
||||||
|
|
||||||
// OPT(key, value) -> true if key matches value or does not exist...
|
// OPT(key, value)
|
||||||
|
// -> true if key matches value or does not exist...
|
||||||
var OPT = function(key, value){
|
var OPT = function(key, value){
|
||||||
return OR(
|
return OR(
|
||||||
NOT(AT(key)),
|
NOT(AT(key)),
|
||||||
@ -35,6 +36,9 @@ var OPT = function(key, value){
|
|||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
//
|
//
|
||||||
|
// NOTE: this file is organized bottoms-up, with the most general
|
||||||
|
// (top-level) patterns at the bottom.
|
||||||
|
//
|
||||||
// XXX need better mismatch checking -- ideally stating the exact spot
|
// XXX need better mismatch checking -- ideally stating the exact spot
|
||||||
// where we did not match and the path of fails it created...
|
// where we did not match and the path of fails it created...
|
||||||
//
|
//
|
||||||
@ -157,13 +161,17 @@ module.OPTIONS = AND(
|
|||||||
OPT('no_length', B),
|
OPT('no_length', B),
|
||||||
OPT('cmp', F) )
|
OPT('cmp', F) )
|
||||||
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
var DIFF_OBJECT =
|
var DIFF_OBJECT =
|
||||||
module.DIFF_OBJECT = AND(
|
module.DIFF_OBJECT = AND(
|
||||||
// format metadata...
|
// format metadata...
|
||||||
AT('format', diff.FORMAT_NAME),
|
AT('format', diff.FORMAT_NAME),
|
||||||
//AT('version', S(/\d+\.\d+\.\d+/)),
|
AT('version', AND(
|
||||||
AT('version', diff.FORMAT_VERSION),
|
// version format...
|
||||||
|
S(/\d+\.\d+\.\d+[ab]?/),
|
||||||
|
// explicit version value...
|
||||||
|
diff.FORMAT_VERSION)),
|
||||||
|
|
||||||
// instance metadata...
|
// instance metadata...
|
||||||
AT('options', OPTIONS),
|
AT('options', OPTIONS),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user