@lokascript/framework 4.8.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -1
- package/dist/api/create-dsl.d.ts +9 -10
- package/dist/api/create-dsl.d.ts.map +1 -1
- package/dist/api/index.js +835 -1670
- package/dist/api/index.js.map +1 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +549 -1132
- package/dist/core/index.js.map +1 -1
- package/dist/core/matching/index.d.ts +2 -0
- package/dist/core/matching/index.d.ts.map +1 -1
- package/dist/core/matching/possessive-keywords.d.ts.map +1 -0
- package/dist/core/matching/stock-confidence.d.ts +3 -4
- package/dist/core/matching/stock-confidence.d.ts.map +1 -1
- package/dist/core/matching/stock-reading.d.ts +4 -4
- package/dist/core/{pattern-matching/utils → matching}/type-validation.d.ts +1 -1
- package/dist/core/matching/type-validation.d.ts.map +1 -0
- package/dist/generation/index.d.ts +1 -1
- package/dist/generation/index.d.ts.map +1 -1
- package/dist/generation/index.js +20 -169
- package/dist/generation/index.js.map +1 -1
- package/dist/generation/profile.d.ts +30 -0
- package/dist/generation/profile.d.ts.map +1 -0
- package/dist/generation/renderer.d.ts +1 -1
- package/dist/generation/renderer.d.ts.map +1 -1
- package/dist/generation/schema-patterns.d.ts +3 -3
- package/dist/index.cjs +929 -1674
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +929 -1668
- package/dist/index.js.map +1 -1
- package/dist/multilingual/builders.d.ts +3 -3
- package/dist/multilingual/builders.d.ts.map +1 -1
- package/dist/multilingual/index.js.map +1 -1
- package/dist/parsing/index.d.ts +0 -1
- package/dist/parsing/index.d.ts.map +1 -1
- package/dist/parsing/index.js +0 -1145
- package/dist/parsing/index.js.map +1 -1
- package/dist/testing/gate/lint/types.d.ts +1 -1
- package/dist/testing/gate/lint/types.d.ts.map +1 -1
- package/package.json +3 -8
- package/src/__test__/test-utils.ts +1 -1
- package/src/api/create-dsl-engine.test.ts +60 -35
- package/src/api/create-dsl.ts +24 -35
- package/src/core/index.ts +0 -1
- package/src/core/matching/index.ts +2 -0
- package/src/core/matching/stock-confidence.ts +3 -4
- package/src/core/matching/stock-reading.ts +6 -6
- package/src/core/{pattern-matching/utils → matching}/type-validation.test.ts +2 -2
- package/src/core/{pattern-matching/utils → matching}/type-validation.ts +1 -1
- package/src/generation/domain-renderer.test.ts +1 -1
- package/src/generation/index.ts +1 -1
- package/src/generation/profile.ts +41 -0
- package/src/generation/renderer.test.ts +1 -1
- package/src/generation/renderer.ts +1 -1
- package/src/generation/schema-patterns.ts +3 -3
- package/src/multilingual/bridge.test.ts +31 -23
- package/src/multilingual/builders.ts +3 -3
- package/src/parsing/index.ts +0 -1
- package/src/testing/gate/lint/types.ts +1 -1
- package/dist/core/pattern-matching/index.d.ts +0 -6
- package/dist/core/pattern-matching/index.d.ts.map +0 -1
- package/dist/core/pattern-matching/index.js +0 -1211
- package/dist/core/pattern-matching/index.js.map +0 -1
- package/dist/core/pattern-matching/pattern-matcher.d.ts +0 -122
- package/dist/core/pattern-matching/pattern-matcher.d.ts.map +0 -1
- package/dist/core/pattern-matching/utils/index.d.ts +0 -6
- package/dist/core/pattern-matching/utils/index.d.ts.map +0 -1
- package/dist/core/pattern-matching/utils/possessive-keywords.d.ts.map +0 -1
- package/dist/core/pattern-matching/utils/type-validation.d.ts.map +0 -1
- package/dist/generation/pattern-generator.d.ts +0 -55
- package/dist/generation/pattern-generator.d.ts.map +0 -1
- package/src/core/pattern-matching/index.ts +0 -6
- package/src/core/pattern-matching/pattern-matcher.test.ts +0 -1031
- package/src/core/pattern-matching/pattern-matcher.ts +0 -765
- package/src/core/pattern-matching/utils/index.ts +0 -6
- package/src/generation/pattern-generator.test.ts +0 -532
- package/src/generation/pattern-generator.ts +0 -327
- /package/dist/core/{pattern-matching/utils → matching}/possessive-keywords.d.ts +0 -0
- /package/src/core/{pattern-matching/utils → matching}/possessive-keywords.ts +0 -0
package/src/api/create-dsl.ts
CHANGED
|
@@ -13,10 +13,9 @@ import type {
|
|
|
13
13
|
} from '../core/types';
|
|
14
14
|
import { extractRoleValue } from '../core/types';
|
|
15
15
|
import type { CommandSchema } from '../schema';
|
|
16
|
-
import { PatternMatcher } from '../core/pattern-matching';
|
|
17
16
|
import { MatchSkeleton, createStockReader, stockConfidenceModel } from '../core/matching';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
17
|
+
import type { PatternGenLanguageProfile } from '../generation/profile';
|
|
18
|
+
import type { DomainRenderFn } from '../generation/renderer';
|
|
20
19
|
import {
|
|
21
20
|
createSchemaPatternGenerator,
|
|
22
21
|
type SchemaPatternProfile,
|
|
@@ -186,18 +185,17 @@ export interface DSLConfig {
|
|
|
186
185
|
readonly customPatterns?: LanguagePattern[];
|
|
187
186
|
|
|
188
187
|
/**
|
|
189
|
-
* What reads and writes the DSL
|
|
190
|
-
* default:
|
|
191
|
-
* `'core'`: the core semantic's hyperscript parser runs — patterns from
|
|
188
|
+
* What reads and writes the DSL. `'core'`, the only engine (and the
|
|
189
|
+
* default): the core semantic's hyperscript parser runs — patterns from
|
|
192
190
|
* `createSchemaPatternGenerator` (positions descending, as a domain's schemas
|
|
193
191
|
* read), matched by `MatchSkeleton` with the stock reader and confidence
|
|
194
192
|
* model, and rendered through those patterns where the domain's own renderer
|
|
195
|
-
* declines.
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
193
|
+
* declines. The option stays so a config written for framework 4.7–4.8
|
|
194
|
+
* (`engine: 'core'`) builds unchanged; `'classic'`, framework's first
|
|
195
|
+
* generator and matcher, was removed in 5.0 (domains rethink Phase 6) and
|
|
196
|
+
* throws.
|
|
199
197
|
*/
|
|
200
|
-
readonly engine?: '
|
|
198
|
+
readonly engine?: 'core';
|
|
201
199
|
}
|
|
202
200
|
|
|
203
201
|
/**
|
|
@@ -888,10 +886,10 @@ export function createMultilingualDSL(config: DSLConfig): MultilingualDSL {
|
|
|
888
886
|
// =============================================================================
|
|
889
887
|
|
|
890
888
|
/**
|
|
891
|
-
* What
|
|
892
|
-
*
|
|
893
|
-
*
|
|
894
|
-
*
|
|
889
|
+
* What reads and writes a DSL: how each command's pattern is generated, how
|
|
890
|
+
* input is matched against it, and the renderer `render()` falls back to.
|
|
891
|
+
* Parsing's whole-input rule, refusals, translation's read-back, compile,
|
|
892
|
+
* explicit syntax and extensions sit above it.
|
|
895
893
|
*/
|
|
896
894
|
interface DSLEngine {
|
|
897
895
|
generate(schema: CommandSchema, profile: PatternGenLanguageProfile): LanguagePattern;
|
|
@@ -900,29 +898,20 @@ interface DSLEngine {
|
|
|
900
898
|
}
|
|
901
899
|
|
|
902
900
|
/**
|
|
903
|
-
* The engine `config.engine` names
|
|
904
|
-
* with the default
|
|
905
|
-
*
|
|
901
|
+
* The engine `config.engine` names: the core, the only one since 5.0. An
|
|
902
|
+
* unknown name throws rather than reading with the default, and `'classic'`
|
|
903
|
+
* says what replaced it.
|
|
906
904
|
*/
|
|
907
905
|
function engineFor(config: DSLConfig): DSLEngine {
|
|
908
|
-
const name = config.engine ?? '
|
|
909
|
-
if (name === 'classic') return classicEngine();
|
|
906
|
+
const name: string = config.engine ?? 'core';
|
|
910
907
|
if (name === 'core') return coreEngine();
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
generate: (schema, profile) => generatePattern(schema, profile),
|
|
919
|
-
match: (tokens, pattern, language) => matcher.matchPattern(tokens, pattern, { code: language }),
|
|
920
|
-
fallbackRenderer: config =>
|
|
921
|
-
createDomainRenderer({
|
|
922
|
-
schemas: config.schemas,
|
|
923
|
-
profiles: config.languages.map(l => l.patternProfile),
|
|
924
|
-
}),
|
|
925
|
-
};
|
|
908
|
+
if (name === 'classic') {
|
|
909
|
+
throw new Error(
|
|
910
|
+
'The "classic" DSL engine was removed in @lokascript/framework 5.0. ' +
|
|
911
|
+
'Omit `engine` (or pass "core"): every domain reads on the core.'
|
|
912
|
+
);
|
|
913
|
+
}
|
|
914
|
+
throw new Error(`Unknown DSL engine "${name}" (expected "core")`);
|
|
926
915
|
}
|
|
927
916
|
|
|
928
917
|
/**
|
package/src/core/index.ts
CHANGED
|
@@ -10,3 +10,5 @@ export type { ConfidenceBreakdown, ConfidenceContext, ConfidenceModel } from './
|
|
|
10
10
|
export { StockValueReader, createStockReader, greedyStopMarkers, readGreedy } from './stock-reader';
|
|
11
11
|
export { readRoleValue, type ReadingProfile } from './stock-reading';
|
|
12
12
|
export { stockConfidenceModel } from './stock-confidence';
|
|
13
|
+
export * from './type-validation';
|
|
14
|
+
export * from './possessive-keywords';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The stock confidence model: how framework's
|
|
3
|
-
* pattern's match
|
|
4
|
-
*
|
|
5
|
-
* it too until Phase 6.
|
|
2
|
+
* The stock confidence model: how framework's first matcher scored a domain
|
|
3
|
+
* pattern's match, moved here as a `ConfidenceModel` for the matcher's
|
|
4
|
+
* skeleton (domains rethink Phase 4.7).
|
|
6
5
|
*
|
|
7
6
|
* Role coverage (a required slot 1, an optional one 0.8, an absent optional one
|
|
8
7
|
* with a default 60% of that), a stem-match penalty (up to 15%, floor 0.5), and
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Reading a domain value at a role slot: the value reading framework's
|
|
3
|
-
* matcher
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Reading a domain value at a role slot: the value reading framework's first
|
|
3
|
+
* matcher did, moved here for the stock reader on the matcher's skeleton
|
|
4
|
+
* (`stock-reader.ts`, domains rethink Phase 4.7). The first matcher was
|
|
5
|
+
* deleted in 5.0 (Phase 6).
|
|
6
6
|
*
|
|
7
7
|
* In order: an English noise word before a selector (`the`), then the
|
|
8
8
|
* multi-token forms (a possessive, `my value`; a method call,
|
|
@@ -22,8 +22,8 @@ import type {
|
|
|
22
22
|
LanguageToken,
|
|
23
23
|
} from '../types';
|
|
24
24
|
import { createSelector, createLiteral, createReference, createPropertyPath } from '../types';
|
|
25
|
-
import { isTypeCompatible } from '
|
|
26
|
-
import { getPossessiveReference } from '
|
|
25
|
+
import { isTypeCompatible } from './type-validation';
|
|
26
|
+
import { getPossessiveReference } from './possessive-keywords';
|
|
27
27
|
|
|
28
28
|
/** What value reading needs of a language profile: its code, and its possessive words. */
|
|
29
29
|
export interface ReadingProfile {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type Validation Tests
|
|
3
3
|
*
|
|
4
|
-
* Tests the type compatibility and validation utilities
|
|
4
|
+
* Tests the type compatibility and validation utilities the stock reader uses.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { describe, it, expect } from 'vitest';
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
isVariableRef,
|
|
18
18
|
isBuiltInReference,
|
|
19
19
|
} from './type-validation';
|
|
20
|
-
import type { SemanticValue } from '
|
|
20
|
+
import type { SemanticValue } from '../types';
|
|
21
21
|
|
|
22
22
|
describe('Type Validation', () => {
|
|
23
23
|
describe('isTypeCompatible', () => {
|
|
@@ -12,7 +12,7 @@ import { createDomainRenderer, createSchemaRenderer } from './renderer';
|
|
|
12
12
|
import type { SemanticNode } from '../core/types';
|
|
13
13
|
import type { CommandSchema } from '../schema';
|
|
14
14
|
import { defineCommand, defineRole } from '../schema';
|
|
15
|
-
import type { PatternGenLanguageProfile } from './
|
|
15
|
+
import type { PatternGenLanguageProfile } from './profile';
|
|
16
16
|
|
|
17
17
|
function makeNode(action: string, roles: Record<string, string>): SemanticNode {
|
|
18
18
|
const rolesMap = new Map<string, { type: 'expression'; raw: string }>();
|
package/src/generation/index.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A domain's language profile, and the role order its sentences use.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { RoleSpec } from '../schema';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A domain's language profile as framework reads it: word order, command
|
|
9
|
+
* keywords, and role markers (with the side of the value each attaches to).
|
|
10
|
+
*/
|
|
11
|
+
export interface PatternGenLanguageProfile {
|
|
12
|
+
readonly code: string;
|
|
13
|
+
readonly wordOrder: 'SVO' | 'SOV' | 'VSO' | 'VOS' | 'OSV' | 'OVS' | 'free';
|
|
14
|
+
readonly keywords: Record<string, { primary: string; alternatives?: string[] }>;
|
|
15
|
+
readonly roleMarkers?: Record<
|
|
16
|
+
string,
|
|
17
|
+
{ primary: string; alternatives?: string[]; position?: 'before' | 'after' }
|
|
18
|
+
>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Sort roles by word order: descending `svoPosition` (or `sovPosition` in an
|
|
23
|
+
* SOV language) — higher values come first. The schema renderer
|
|
24
|
+
* (`createSchemaRenderer`) orders roles with it, as the core's pattern
|
|
25
|
+
* generator does (`createSchemaPatternGenerator` with `positionOrder:
|
|
26
|
+
* 'descending'`), so a rendered surface re-parses.
|
|
27
|
+
*/
|
|
28
|
+
export function sortRolesByWordOrder(roles: RoleSpec[], wordOrder: string): RoleSpec[] {
|
|
29
|
+
const sorted = [...roles];
|
|
30
|
+
|
|
31
|
+
if (wordOrder === 'SVO') {
|
|
32
|
+
// Sort by svoPosition (higher = earlier)
|
|
33
|
+
sorted.sort((a, b) => (b.svoPosition ?? 0) - (a.svoPosition ?? 0));
|
|
34
|
+
} else if (wordOrder === 'SOV') {
|
|
35
|
+
// Sort by sovPosition (higher = earlier)
|
|
36
|
+
sorted.sort((a, b) => (b.sovPosition ?? 0) - (a.sovPosition ?? 0));
|
|
37
|
+
}
|
|
38
|
+
// VSO and others use SVO-style ordering
|
|
39
|
+
|
|
40
|
+
return sorted;
|
|
41
|
+
}
|
|
@@ -11,7 +11,7 @@ import type { KeywordTable, MarkerTable } from './renderer';
|
|
|
11
11
|
import type { SemanticNode } from '../core/types';
|
|
12
12
|
import type { CommandSchema } from '../schema';
|
|
13
13
|
import { defineCommand, defineRole } from '../schema';
|
|
14
|
-
import type { PatternGenLanguageProfile } from './
|
|
14
|
+
import type { PatternGenLanguageProfile } from './profile';
|
|
15
15
|
|
|
16
16
|
// =============================================================================
|
|
17
17
|
// Test Data
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type { SemanticNode } from '../core/types';
|
|
12
12
|
import { extractRoleValue, extractValue } from '../core/types';
|
|
13
13
|
import type { CommandSchema } from '../schema';
|
|
14
|
-
import { sortRolesByWordOrder, type PatternGenLanguageProfile } from './
|
|
14
|
+
import { sortRolesByWordOrder, type PatternGenLanguageProfile } from './profile';
|
|
15
15
|
|
|
16
16
|
// =============================================================================
|
|
17
17
|
// Renderer Interface
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Patterns from command schemas: the generator semantic's hyperscript parser
|
|
3
3
|
* runs (domains rethink Phase 4.4, `docs-internal/DOMAINS_RETHINK.md`), moved
|
|
4
|
-
* here from `@lokascript/semantic`
|
|
5
|
-
* (
|
|
4
|
+
* here from `@lokascript/semantic`; `createMultilingualDSL` generates every
|
|
5
|
+
* domain's patterns with it (the classic generator went in 5.0, Phase 6).
|
|
6
6
|
*
|
|
7
7
|
* Per command and language it builds the main pattern and its variants: the
|
|
8
8
|
* simple variant (required roles only), the omit-role, widened-type and
|
|
@@ -21,7 +21,7 @@ export interface SchemaPatternGrammar {
|
|
|
21
21
|
/**
|
|
22
22
|
* How `svoPosition` / `sovPosition` sort: `'ascending'` puts the lowest first
|
|
23
23
|
* (hyperscript's schemas, 1-based), `'descending'` the highest (a domain's
|
|
24
|
-
* schemas, as
|
|
24
|
+
* schemas, as `sortRolesByWordOrder` and the schema renderer read them).
|
|
25
25
|
*/
|
|
26
26
|
readonly positionOrder: 'ascending' | 'descending';
|
|
27
27
|
}
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
deriveRoleMarkers,
|
|
15
15
|
} from './builders';
|
|
16
16
|
import type { GrammarProfileSlice, DomainVocabulary } from './types';
|
|
17
|
-
import { generatePattern } from '../generation/pattern-generator';
|
|
18
17
|
import { defineCommand, defineRole } from '../schema';
|
|
19
18
|
import { createMultilingualDSL } from '../api/create-dsl';
|
|
19
|
+
import { extractValue } from '../core/types';
|
|
20
20
|
|
|
21
21
|
// =============================================================================
|
|
22
22
|
// Fixture slices (mirror the shape of semantic KNOWN_PROFILES entries)
|
|
@@ -189,7 +189,7 @@ describe('buildPatternProfile', () => {
|
|
|
189
189
|
expect(profile.keywords.select.alternatives).toEqual([...alternatives]);
|
|
190
190
|
});
|
|
191
191
|
|
|
192
|
-
describe('
|
|
192
|
+
describe('a DSL built from the profile (the core engine)', () => {
|
|
193
193
|
const moveSchema = defineCommand({
|
|
194
194
|
action: 'move',
|
|
195
195
|
description: 'Move a thing',
|
|
@@ -212,37 +212,45 @@ describe('buildPatternProfile', () => {
|
|
|
212
212
|
}),
|
|
213
213
|
],
|
|
214
214
|
});
|
|
215
|
+
const dsl = createMultilingualDSL({
|
|
216
|
+
name: 'Move',
|
|
217
|
+
schemas: [moveSchema],
|
|
218
|
+
languages: [
|
|
219
|
+
buildLanguageConfig(EN_SLICE, { keywords: { move: { primary: 'move' } } }),
|
|
220
|
+
buildLanguageConfig(JA_SLICE, { keywords: { move: { primary: '移動' } } }),
|
|
221
|
+
buildLanguageConfig(AR_SLICE, { keywords: { move: { primary: 'انقل' } } }),
|
|
222
|
+
],
|
|
223
|
+
});
|
|
224
|
+
const roles = (input: string, language: string) => {
|
|
225
|
+
const node = dsl.parse(input, language);
|
|
226
|
+
return [
|
|
227
|
+
node.action,
|
|
228
|
+
...[...node.roles].map(([role, value]) => `${role}=${extractValue(value)}`),
|
|
229
|
+
];
|
|
230
|
+
};
|
|
215
231
|
|
|
216
232
|
it('SVO (en-like): keyword first, prepositional marker before its role', () => {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
{ type: 'literal', value: 'move' },
|
|
222
|
-
{ type: 'role', role: 'patient', optional: false, expectedTypes: ['expression'] },
|
|
223
|
-
{ type: 'literal', value: 'into' },
|
|
224
|
-
{ type: 'role', role: 'destination', optional: false, expectedTypes: ['expression'] },
|
|
233
|
+
expect(roles('move box into shelf', 'en')).toEqual([
|
|
234
|
+
'move',
|
|
235
|
+
'patient=box',
|
|
236
|
+
'destination=shelf',
|
|
225
237
|
]);
|
|
226
238
|
});
|
|
227
239
|
|
|
228
240
|
it('SOV (ja-like): particles after their roles, verb last', () => {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
{ type: 'role', role: 'patient', optional: false, expectedTypes: ['expression'] },
|
|
234
|
-
{ type: 'literal', value: 'を' },
|
|
235
|
-
{ type: 'role', role: 'destination', optional: false, expectedTypes: ['expression'] },
|
|
236
|
-
{ type: 'literal', value: 'に' },
|
|
237
|
-
{ type: 'literal', value: '移動' },
|
|
241
|
+
expect(roles('box を shelf に 移動', 'ja')).toEqual([
|
|
242
|
+
'move',
|
|
243
|
+
'patient=box',
|
|
244
|
+
'destination=shelf',
|
|
238
245
|
]);
|
|
239
246
|
});
|
|
240
247
|
|
|
241
248
|
it('VSO (ar-like): verb first', () => {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
249
|
+
expect(roles('انقل box في shelf', 'ar')).toEqual([
|
|
250
|
+
'move',
|
|
251
|
+
'patient=box',
|
|
252
|
+
'destination=shelf',
|
|
253
|
+
]);
|
|
246
254
|
});
|
|
247
255
|
});
|
|
248
256
|
});
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import type { LanguageTokenizer } from '../core/types';
|
|
13
|
-
import type { PatternGenLanguageProfile } from '../generation/
|
|
13
|
+
import type { PatternGenLanguageProfile } from '../generation/profile';
|
|
14
14
|
import type { LanguageConfig } from '../api/create-dsl';
|
|
15
15
|
import type { LanguageProfile as GrammarProfile } from '../grammar';
|
|
16
16
|
import { createSimpleTokenizer, type TokenizerProfile } from '../core/tokenization/base-tokenizer';
|
|
@@ -51,8 +51,8 @@ function mergeRoleMarkers(
|
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Build a pattern-generation profile: domain keywords + slice grammar
|
|
54
|
-
* (word order, role markers). The result feeds `
|
|
55
|
-
*
|
|
54
|
+
* (word order, role markers). The result feeds `LanguageConfig.patternProfile`
|
|
55
|
+
* and the schema renderer.
|
|
56
56
|
*/
|
|
57
57
|
export function buildPatternProfile(
|
|
58
58
|
slice: GrammarProfileSlice,
|
package/src/parsing/index.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
// Re-export core parsing types
|
|
6
6
|
export type { SemanticNode, TokenStream, LanguageTokenizer } from '../core/types';
|
|
7
|
-
export { PatternMatcher } from '../core/pattern-matching';
|
|
8
7
|
|
|
9
8
|
// Multi-statement parser
|
|
10
9
|
export { createMultiStatementParser, accumulateBlocks } from './multi-statement';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type { CommandSchema } from '../../../schema';
|
|
6
6
|
import type { LanguageTokenizer } from '../../../core/types';
|
|
7
|
-
import type { PatternGenLanguageProfile } from '../../../generation/
|
|
7
|
+
import type { PatternGenLanguageProfile } from '../../../generation/profile';
|
|
8
8
|
|
|
9
9
|
export type Severity = 'error' | 'warning' | 'note';
|
|
10
10
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/pattern-matching/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|