Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 6f5f7e6

Browse files
author
g. nicholas d'andrea
committed
Handle _ and $
1 parent d57be48 commit 6f5f7e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/parse-mapping-lookup/src/parser.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ const testCases = [
6262
})
6363
},
6464
{
65-
expression: `m[0].k[1]`,
65+
expression: `m$[0]._k[1]`,
6666
result: expression({
67-
root: identifier({ name: "m" }),
67+
root: identifier({ name: "m$" }),
6868
pointer: pointer({
6969
path: [
7070
access({ index: literal({ value: "0" }) }),
71-
lookup({ property: identifier({ name: "k" }) }),
71+
lookup({ property: identifier({ name: "_k" }) }),
7272
access({ index: literal({ value: "1" }) })
7373
]
7474
})

packages/parse-mapping-lookup/src/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
* Identifier
3434
*/
3535

36-
const identifierP = regexp(/[a-zA-Z][a-zA-Z0-9]*/).pipe(
36+
const identifierP = regexp(/[a-zA-Z_$][a-zA-Z0-9_$]*/).pipe(
3737
map(([name]) => identifier({ name }))
3838
);
3939

0 commit comments

Comments
 (0)