File tree Expand file tree Collapse file tree 6 files changed +55
-4
lines changed Expand file tree Collapse file tree 6 files changed +55
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,11 @@ infixAssertion = attributePath SP infixAssertionOperator SP infixAssertionValue
2020infixAssertionOperator = " eq" / " ne" / " co" / " sw" / " ew" / " gt" / " lt" / " ge" / " le"
2121infixAssertionValue = null / true / false / number / string
2222
23+ <<<<<<< Updated upstream
2324attributePath = [URI " :" ] attributePathSegment * (" ." attributePathSegment )
25+ =======
26+ attributePath = [URI " <" ] attributePathSegment * 1(" ." attributePathSegment )
27+ >>>>>>> Stashed changes
2428attributePathSegment = ALPHA * (" -" / " _" / DIGIT / ALPHA )
2529
2630; rfc7159
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class TrackMap {
2424 infixAssertionValue = [ ] as ( null | boolean | number | string ) [ ] ;
2525 attributePath = [ ] as string [ ] [ ] ;
2626 attributePathSegment = [ ] as string [ ] ;
27+ uri = [ ] as string [ ] ;
2728}
2829
2930class Stat {
@@ -43,6 +44,7 @@ class Stat {
4344 infixAssertionValue = 0 as number ;
4445 attributePath = 0 as number ;
4546 attributePathSegment = 0 as number ;
47+ uri = 0 as number ;
4648}
4749
4850class StatsMap {
@@ -62,6 +64,7 @@ class StatsMap {
6264 infixAssertionValue = [ ] as Stat [ ] ;
6365 attributePath = [ ] as Stat [ ] ;
6466 attributePathSegment = [ ] as Stat [ ] ;
67+ uri = [ ] as Stat [ ] ;
6568}
6669
6770export class Yard {
Original file line number Diff line number Diff line change @@ -14,15 +14,17 @@ export function attributePath(
1414 break ;
1515
1616 case ids . SEM_POST :
17- const { attributePathSegment } = yard . post ( "attributePath" ) ;
17+ const { attributePathSegment, uri } = yard . post ( "attributePath" ) ;
1818
1919 if ( attributePathSegment . length < 1 ) {
2020 throw new Error (
2121 `INVARIANT: Expected 1 or more attributePathSegment, but got ${ attributePathSegment . length } ;`
2222 ) ;
2323 }
24-
25- yard . tracks . attributePath . push ( attributePathSegment . reverse ( ) ) ;
24+ yard . tracks . attributePath . push ( [
25+ ...uri ,
26+ ...attributePathSegment . reverse ( )
27+ ] ) ;
2628 break ;
2729 }
2830
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { infixAssertionOperator } from "./infixAssertionOperator";
1919import { infixAssertionValue } from "./infixAssertionValue" ;
2020import { attributePath } from "./attributePath" ;
2121import { attributePathSegment } from "./attributePathSegment" ;
22+ import { uri } from "./uri" ;
2223
2324const grammar = new Grammar ( ) ;
2425const parser = new Parser ( ) ;
@@ -39,7 +40,8 @@ parser.ast.callbacks = {
3940 infixAssertionOperator,
4041 infixAssertionValue,
4142 attributePath,
42- attributePathSegment
43+ attributePathSegment,
44+ uri
4345} ;
4446
4547export function compileFilter ( input : string ) : ( data : any ) => boolean {
Original file line number Diff line number Diff line change 1+ import { ids , utils } from "apg-lib" ;
2+ import { Yard } from "./Yard" ;
3+
4+ export function uri (
5+ state : typeof ids . SEM_PRE | typeof ids . SEM_POST ,
6+ chars : number [ ] ,
7+ phraseIndex : number ,
8+ phraseLength : number ,
9+ yard : Yard
10+ ) : typeof ids . SEM_OK | typeof ids . SEM_SKIP {
11+ switch ( state ) {
12+ case ids . SEM_PRE :
13+ break ;
14+
15+ case ids . SEM_POST :
16+ yard . tracks . uri . push (
17+ utils . charsToString ( chars , phraseIndex , phraseLength )
18+ ) ;
19+ break ;
20+ }
21+
22+ return ids . SEM_OK ;
23+ }
You can’t perform that action at this time.
0 commit comments