Skip to content

Commit d458672

Browse files
committed
added s:isodigit() and s:StringReader.read_odigit()
1 parent 77f99b3 commit d458672

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

autoload/vimlparser.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ function! s:isdigit(c)
206206
return a:c =~# '^[0-9]$'
207207
endfunction
208208

209+
function! s:isodigit(c)
210+
return a:c =~# '^[0-7]$'
211+
endfunction
212+
209213
function! s:isxdigit(c)
210214
return a:c =~# '^[0-9A-Fa-f]$'
211215
endfunction
@@ -3537,6 +3541,14 @@ function! s:StringReader.read_digit()
35373541
return r
35383542
endfunction
35393543

3544+
function! s:StringReader.read_odigit()
3545+
let r = ''
3546+
while s:isodigit(self.peekn(1))
3547+
let r .= self.getn(1)
3548+
endwhile
3549+
return r
3550+
endfunction
3551+
35403552
function! s:StringReader.read_xdigit()
35413553
let r = ''
35423554
while s:isxdigit(self.peekn(1))

0 commit comments

Comments
 (0)