fix: Improve VIS VRB remark parsing for mixed fractions
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
+13
-2
@@ -317,8 +317,19 @@
|
|||||||
{
|
{
|
||||||
match: p => p[0] === 'VIS' && p.length > 2 && p[1] === 'VRB' && p[2].includes('-'),
|
match: p => p[0] === 'VIS' && p.length > 2 && p[1] === 'VRB' && p[2].includes('-'),
|
||||||
decode: p => {
|
decode: p => {
|
||||||
const [min, max] = p[2].split('-');
|
const [min, max_part1] = p[2].split('-');
|
||||||
return { consumed: 3, text: ` - VIS VRB ${p[2]}: Visibility variable between ${min} and ${max} statute miles` };
|
let max = max_part1;
|
||||||
|
let consumed = 3;
|
||||||
|
let raw_range = p[2];
|
||||||
|
|
||||||
|
// Handle fractional part for max visibility, e.g. VIS VRB 3/4-2 1/2
|
||||||
|
if (p.length > 3 && /^\d+\/\d+$/.test(p[3])) {
|
||||||
|
max += ` ${p[3]}`;
|
||||||
|
consumed++;
|
||||||
|
raw_range += ` ${p[3]}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return { consumed: consumed, text: ` - VIS VRB ${raw_range}: Visibility variable between ${min} and ${max} statute miles` };
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// VIS
|
// VIS
|
||||||
|
|||||||
Reference in New Issue
Block a user