1- import type { RuleDefReturn } from '@traqula/core' ;
1+ import type { RuleDefReturn , Wrap } from '@traqula/core' ;
22import type { TokenType } from 'chevrotain' ;
33import * as l from '../lexer' ;
4- import type { DatasetClauses , TermIri , Wrap } from '../RoundTripTypes' ;
4+ import type { DatasetClauses , TermIri } from '../RoundTripTypes' ;
55import type { SparqlGrammarRule , SparqlRule } from '../Sparql11types' ;
66import { iri } from './literals' ;
77
@@ -16,17 +16,12 @@ export function datasetClauseUsing<RuleName extends 'usingClause' | 'datasetClau
1616 return OR < RuleDefReturn < typeof datasetClause > > ( [
1717 { ALT : ( ) => {
1818 const iri = SUBRULE ( defaultGraphClause , undefined ) ;
19- return ACTION ( ( ) => ( {
20- val : { named : false , value : iri } ,
21- ...C . factory . sourceLocation ( start , iri . loc ) ,
22- } ) ) ;
19+ return ACTION ( ( ) => C . factory . wrap ( { named : false , value : iri } , C . factory . sourceLocation ( start , iri ) ) ) ;
2320 } } ,
2421 { ALT : ( ) => {
2522 const namedClause = SUBRULE ( namedGraphClause , undefined ) ;
26- return ACTION ( ( ) => ( {
27- val : { named : true , value : namedClause . val } ,
28- ...C . factory . sourceLocation ( start , namedClause ) ,
29- } ) ) ;
23+ return ACTION ( ( ) =>
24+ C . factory . wrap ( { named : true , value : namedClause . val } , C . factory . sourceLocation ( start , namedClause ) ) ) ;
3025 } } ,
3126 ] ) ;
3227 } ,
@@ -98,7 +93,7 @@ export const namedGraphClause: SparqlGrammarRule<'namedGraphClause', Wrap<TermIr
9893 impl : ( { ACTION , SUBRULE , CONSUME } ) => ( C ) => {
9994 const named = CONSUME ( l . graph . named ) ;
10095 const iri = SUBRULE ( sourceSelector , undefined ) ;
101- return ACTION ( ( ) => ( { val : iri , ... C . factory . sourceLocation ( named , iri . loc ) } ) ) ;
96+ return ACTION ( ( ) => C . factory . wrap ( iri , C . factory . sourceLocation ( named , iri ) ) ) ;
10297 } ,
10398} ;
10499
0 commit comments