Skip to content

Commit 1519827

Browse files
committed
chore: dist rebuild
1 parent 9a1726e commit 1519827

File tree

3 files changed

+17
-45
lines changed

3 files changed

+17
-45
lines changed

dist/js-yaml.js

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,10 @@
536536

537537
for (; index < max; index++) {
538538
ch = data[index];
539-
if (ch === '_') continue;
540539
if (ch !== '0' && ch !== '1') return false;
541540
hasDigits = true;
542541
}
543-
return hasDigits && ch !== '_';
542+
return hasDigits;
544543
}
545544

546545

@@ -550,55 +549,42 @@
550549

551550
for (; index < max; index++) {
552551
ch = data[index];
553-
if (ch === '_') continue;
554552
if (!isHexCode(data.charCodeAt(index))) return false;
555553
hasDigits = true;
556554
}
557-
return hasDigits && ch !== '_';
555+
return hasDigits;
558556
}
559557

560-
561558
if (ch === 'o') {
562559
// base 8
563560
index++;
564561

565562
for (; index < max; index++) {
566563
ch = data[index];
567-
if (ch === '_') continue;
568564
if (!isOctCode(data.charCodeAt(index))) return false;
569565
hasDigits = true;
570566
}
571-
return hasDigits && ch !== '_';
567+
return hasDigits;
572568
}
573569
}
574570

575571
// base 10 (except 0)
576572

577-
// value should not start with `_`;
578-
if (ch === '_') return false;
579-
580573
for (; index < max; index++) {
581574
ch = data[index];
582-
if (ch === '_') continue;
583575
if (!isDecCode(data.charCodeAt(index))) {
584576
return false;
585577
}
586578
hasDigits = true;
587579
}
588580

589-
// Should have digits and should not end with `_`
590-
if (!hasDigits || ch === '_') return false;
591-
592-
return true;
581+
// Should have digits
582+
return hasDigits;
593583
}
594584

595585
function constructYamlInteger(data) {
596586
var value = data, sign = 1, ch;
597587

598-
if (value.indexOf('_') !== -1) {
599-
value = value.replace(/_/g, '');
600-
}
601-
602588
ch = value[0];
603589

604590
if (ch === '-' || ch === '+') {
@@ -646,10 +632,10 @@
646632

647633
var YAML_FLOAT_PATTERN = new RegExp(
648634
// 2.5e4, 2.5 and integers
649-
'^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
635+
'^(?:[-+]?(?:[0-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +
650636
// .2e4, .2
651637
// special case, seems not from spec
652-
'|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
638+
'|\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +
653639
// .inf
654640
'|[-+]?\\.(?:inf|Inf|INF)' +
655641
// .nan
@@ -671,7 +657,7 @@
671657
function constructYamlFloat(data) {
672658
var value, sign;
673659

674-
value = data.replace(/_/g, '').toLowerCase();
660+
value = data.toLowerCase();
675661
sign = value[0] === '-' ? -1 : 1;
676662

677663
if ('+-'.indexOf(value[0]) >= 0) {

0 commit comments

Comments
 (0)