MCPcopy Index your code
hub / github.com/nodejs/node / scanNumberFragment

Function scanNumberFragment

test/fixtures/snapshot/typescript.js:10884–10920  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10882 }
10883 }
10884 function scanNumberFragment() {
10885 var start = pos;
10886 var allowSeparator = false;
10887 var isPreviousTokenSeparator = false;
10888 var result = "";
10889 while (true) {
10890 var ch = text.charCodeAt(pos);
10891 if (ch === 95 /* CharacterCodes._ */) {
10892 tokenFlags |= 512 /* TokenFlags.ContainsSeparator */;
10893 if (allowSeparator) {
10894 allowSeparator = false;
10895 isPreviousTokenSeparator = true;
10896 result += text.substring(start, pos);
10897 }
10898 else if (isPreviousTokenSeparator) {
10899 error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1);
10900 }
10901 else {
10902 error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1);
10903 }
10904 pos++;
10905 start = pos;
10906 continue;
10907 }
10908 if (isDigit(ch)) {
10909 allowSeparator = true;
10910 isPreviousTokenSeparator = false;
10911 pos++;
10912 continue;
10913 }
10914 break;
10915 }
10916 if (text.charCodeAt(pos - 1) === 95 /* CharacterCodes._ */) {
10917 error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);
10918 }
10919 return result + text.substring(start, pos);
10920 }
10921 function scanNumber() {
10922 var start = pos;
10923 var mainFragment = scanNumberFragment();

Callers 1

scanNumberFunction · 0.85

Calls 2

isDigitFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…