File tree 3 files changed +7
-6
lines changed
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import { CommandName } from "./types";
2
2
3
3
const bounded = ( text : string ) => `\\b${ text } \\b` ;
4
4
5
- const identifierStart = "[_a -zA-Z]" ;
6
- const identifierContinue = "[_a -zA-Z0-9]" ;
5
+ const identifierStart = "[\\-a -zA-Z]" ;
6
+ const identifierContinue = "[\\-a -zA-Z0-9]" ;
7
7
const identifier = bounded ( `${ identifierStart } ${ identifierContinue } *` ) ;
8
8
9
9
const keywords = Object . values ( CommandName ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export enum CommandName {
15
15
Subscription = "subscription" ,
16
16
Claim = "claim" ,
17
17
// Sub-commands
18
+ PreApprove = "pre-approve" ,
18
19
Approve = "approve" ,
19
20
TransferFrom = "transfer-from" ,
20
21
Upgrade = "upgrade" ,
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import { CommandName } from "./types";
2
2
3
3
const bounded = ( text : string ) => `\\b${ text } \\b` ;
4
4
5
- const identifierStart = "[_a -zA-Z]" ;
6
- const identifierContinue = "[_a -zA-Z0-9]" ;
5
+ const identifierStart = "[a -zA-Z]" ;
6
+ const identifierContinue = "[\\-:a -zA-Z0-9]" ;
7
7
const identifier = bounded ( `${ identifierStart } ${ identifierContinue } *` ) ;
8
8
9
9
const keywords = Object . values ( CommandName ) ;
@@ -12,11 +12,11 @@ const namedLiterals = ["true", "false"];
12
12
13
13
const nonCommentWs = `[ \\t\\r\\n]` ;
14
14
15
- const numericLiteral = `[0-9]+` ;
15
+ const numericLiteral = `0x( [0-9a-fA-F]+)|([0- 9]+(e[0-9]+)?(mo|[s|m|h|d|w|mo|y])?(/mo|[s|m|h|d|w|mo|y])?) ` ;
16
16
17
17
export const conf = {
18
18
comments : {
19
- lineComment : "//" ,
19
+ lineComment : [ "//" , "#" ] ,
20
20
} ,
21
21
brackets : [
22
22
[ "{" , "}" ] ,
You can’t perform that action at this time.
0 commit comments