File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export function valid(aura: aura, str: string): boolean {
8888export function nuck ( str : string ) : coin | null {
8989 if ( str === '' ) return null ;
9090
91- // narrow options down by the first character, before doing regex texts
91+ // narrow options down by the first character, before doing regex tests
9292 // and trying to parse for real
9393 //
9494 const c = str [ 0 ] ;
@@ -136,9 +136,10 @@ export function nuck(str: string): coin | null {
136136 if ( str === '.n' ) {
137137 return { type : 'dime' , aura : 'f' , atom : 1n } ;
138138 } else
139- //REVIEW entering the branch this way assumes regexes for sequentially-tested auras don't overlap...
140- // going down the list of options this way matches hoon parser behavior the closest, but is slow for the "miss" case.
141- // should probably run some perf tests
139+ //REVIEW entering the branch this way assumes regexes for sequentially-tested auras don't overlap...
140+ // going down the list of options this way matches hoon parser behavior the closest, but is slow for the "miss" case.
141+ // could be optimized by hard-returning if the regex fails for cases where the lead char is unique.
142+ // should probably run some perf tests
142143 if ( str [ 1 ] === '~' && regex [ 'q' ] . test ( str ) ) {
143144 const q = str . slice ( 1 ) ; //NOTE q.ts insanity, need to strip leading .
144145 try {
You can’t perform that action at this time.
0 commit comments