+ /* if it starts with a v, it could be a version number */
+ case 'v':
+ {
+ char *pos = s;
+ pos++;
+ while (isDIGIT(*pos))
+ pos++;
+ if (*pos == '.' && isDIGIT(pos[1])) {
+ UV rev;
+ U8 tmpbuf[10];
+ U8 *tmpend;
+ NV nshift = 1.0;
+ bool utf8 = FALSE;
+ s++; /* get past 'v' */
+
+ sv = NEWSV(92,5);
+ SvUPGRADE(sv, SVt_PVNV);
+ sv_setpvn(sv, "", 0);
+
+ do {
+ if (*s == '0' && isDIGIT(s[1]))
+ yyerror("Octal number in vector unsupported");
+ rev = atoi(s);
+ s = ++pos;
+ while (isDIGIT(*pos))
+ pos++;
+
+ if (rev > 127) {
+ tmpend = uv_to_utf8(tmpbuf, rev);
+ utf8 = TRUE;
+ }
+ else {
+ tmpbuf[0] = (U8)rev;
+ tmpend = &tmpbuf[1];
+ }
+ *tmpend = '\0';
+ sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
+ if (rev > 0)
+ SvNVX(sv) += (NV)rev/nshift;
+ nshift *= 1000;
+ } while (*pos == '.' && isDIGIT(pos[1]));
+
+ if (*s == '0' && isDIGIT(s[1]))
+ yyerror("Octal number in vector unsupported");
+ rev = atoi(s);
+ s = pos;
+ tmpend = uv_to_utf8(tmpbuf, rev);
+ utf8 = utf8 || rev > 127;
+ *tmpend = '\0';
+ sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
+ if (rev > 0)
+ SvNVX(sv) += (NV)rev/nshift;
+
+ SvPOK_on(sv);
+ SvNOK_on(sv);
+ SvREADONLY_on(sv);
+ if (utf8)
+ SvUTF8_on(sv);
+ }
+ }
+ break;