Skip to content

Commit e360468

Browse files
committed
parse: comment touch-ups
1 parent 8ef8cc1 commit e360468

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/parse.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function valid(aura: aura, str: string): boolean {
8888
export 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 {

0 commit comments

Comments
 (0)