From b3a29553726f93702bc6ddff7e4141cfdd775c1e Mon Sep 17 00:00:00 2001 From: rowan Date: Thu, 28 Nov 2024 02:13:41 -0600 Subject: [PATCH] eawarweraraaaaaAAAA --- src/index.js | 43 -------------------------------- src/query-parser/match.js | 2 +- src/query-parser/where.js | 2 +- tests/query-parser/query.test.js | 1 - tests/query-parser/where.test.js | 5 ++-- 5 files changed, 4 insertions(+), 49 deletions(-) delete mode 100644 src/index.js diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 595ae73..0000000 --- a/src/index.js +++ /dev/null @@ -1,43 +0,0 @@ -import { query } from './query.js' -import { - createWorld, - Types, - defineComponent, - defineQuery, - addEntity, - addComponent, - pipe, -} from 'bitecs' - -const Edge = { from: Types.eid, to: Types.eid } -const Fox = defineComponent() -const Knows = defineComponent(Edge) -const Bot = defineComponent() - -const components = { - Fox, - Bot, - Knows -} - -const world = createWorld() -world.components = components - -const rown = addEntity(world) -addComponent(world, Fox, rown) - -const cynn = addEntity(world) -addComponent(world, Bot, cynn) - -const edge = addEntity(world) -addComponent(world, Knows, edge) -Knows.from[edge] = rown -Knows.to[edge] = cynn - -//const q = query(world, '(:Fox)') -//q(world).forEach(eid => console.log(eid, 'has Fox!')) - -const q2 = query(world, '(rawran:Fox)-[:Knows]->(cynnnnnnnn:Bot)') -q2(world).forEach(eid => console.log(eid)) - - diff --git a/src/query-parser/match.js b/src/query-parser/match.js index e7a87f3..aada8a7 100644 --- a/src/query-parser/match.js +++ b/src/query-parser/match.js @@ -1,7 +1,7 @@ import { identifier, Keyword, literal, Symbols, ws } from './common.js' import { Node, Edge, KeyValuePair, Label, Name, Direction, DirectedEdge, Relationship, Component, Match } from './types.js' import { construct, curry, head, is } from '../fn.js' -import { many, maybe, map, seq, skip, between, noCaseString, separated, list, any } from '../parser.js' +import { many, maybe, map, seq, skip, between, separated, list, any } from '../parser.js' const { Bracket, Colon, Comma, Hyphen } = Symbols diff --git a/src/query-parser/where.js b/src/query-parser/where.js index 72e9419..f9616d9 100644 --- a/src/query-parser/where.js +++ b/src/query-parser/where.js @@ -1,5 +1,5 @@ import { construct } from '../fn.js' -import { always, any, char, many1, manyUntil, map, map1, noCaseString, seq, skip, string } from '../parser.js' +import { always, any, char, manyUntil, map, map1, noCaseString, seq, skip, string } from '../parser.js' import { keyword, Keyword, Symbols, value, word, ws } from './common.js' import { And, Equal, Filter, GreaterThan, GreaterThanEqual, LesserThan, LesserThanEqual, Literal, None, Not, Or, Xor } from './types.js' diff --git a/tests/query-parser/query.test.js b/tests/query-parser/query.test.js index 101522f..b5794e9 100644 --- a/tests/query-parser/query.test.js +++ b/tests/query-parser/query.test.js @@ -1,4 +1,3 @@ -import util from 'node:util' import { describe, it } from 'node:test' import assert from '../assert.js' import { query } from '../../src/query-parser/index.js' diff --git a/tests/query-parser/where.test.js b/tests/query-parser/where.test.js index 6b86f65..97bef4f 100644 --- a/tests/query-parser/where.test.js +++ b/tests/query-parser/where.test.js @@ -1,8 +1,7 @@ import { describe, it } from 'node:test' import assert from '../assert.js' -import { and, eq, expr, gt, gte, lt, lte, not, or, params, whereClause, xor } from '../../src/query-parser/where.js' -import { And, Equal, Filter, GreaterThan, GreaterThanEqual, Identifier, LesserThan, LesserThanEqual, Literal, ObjectPath, Or, Property } from '../../src/query-parser/types.js' -import { parse } from '../../src/parser.js' +import { and, eq, gt, gte, lt, lte, not, or, whereClause, xor } from '../../src/query-parser/where.js' +import { And, Equal, GreaterThan, Identifier, LesserThan, LesserThanEqual, Literal, ObjectPath, Or, Property } from '../../src/query-parser/types.js' const l = x => new Literal(x) describe('where operators', () => {