From 2bae264461a4b04a70eb529105980744e84022bc Mon Sep 17 00:00:00 2001 From: ran Date: Thu, 8 Sep 2016 16:24:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example.coffee | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/example.coffee b/example.coffee index c104724..b05cdc3 100644 --- a/example.coffee +++ b/example.coffee @@ -1,28 +1,27 @@ {Parser, SemanticAnalysis} = require './ooq' query = - name: - $or: [ - "john" - "baner" - ] - age: - $not: - op: 'gt' - value: 30 - "$or": - "type": - "$not": - "$and": [ - { op: "eq", value: "food" } - { op: "gt", value: "z*" } - { op: "lt", value: "m*" } - ] - "location": - "$or": [ - { op: "eq", value: "New Yorks" } - { op: "eq", value: "Missiby" } + name: + op: 'gt' + value: 5 + love: 'game' + $not: + # case: 5 + $xor: + home: 3 + work: + $or: ['china', 'usa'] + $or: + age:10 + location: + $and: [ + {op: 'lt', value: "dsds"} + {op: 'neq', value: 'ddd'} ] + $and: + xx: { op: 'like', value: 465 } + yy: { op: 'isNull' } + parser = new Parser query console.log "抽象语法树 =>"