summary refs log tree commit diff stats
path: root/lib/packages
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-02-28 22:57:57 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-02-28 22:57:57 +0100
commit1102b8ac6e643c8f8428dd7db0994d26b0c65ea6 (patch)
treeb08388f89e7867f03e5d59be00db70a6535752dc /lib/packages
parent728ff1004a60835c18c44b64830ea08dc805485e (diff)
downloadNim-1102b8ac6e643c8f8428dd7db0994d26b0c65ea6.tar.gz
StringStream and parseJson, parseCfg, parseSql et al for the vm (#10746)
Diffstat (limited to 'lib/packages')
-rw-r--r--lib/packages/docutils/rst.nim17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim
index 615119135..0b077b1f1 100644
--- a/lib/packages/docutils/rst.nim
+++ b/lib/packages/docutils/rst.nim
@@ -155,18 +155,17 @@ proc getAdornment(L: var Lexer, tok: var Token) =
 
 proc getIndentAux(L: var Lexer, start: int): int =
   var pos = start
-  var buf = L.buf
   # skip the newline (but include it in the token!)
-  if buf[pos] == '\x0D':
-    if buf[pos + 1] == '\x0A': inc(pos, 2)
+  if L.buf[pos] == '\x0D':
+    if L.buf[pos + 1] == '\x0A': inc(pos, 2)
     else: inc(pos)
-  elif buf[pos] == '\x0A':
+  elif L.buf[pos] == '\x0A':
     inc(pos)
   if L.skipPounds:
-    if buf[pos] == '#': inc(pos)
-    if buf[pos] == '#': inc(pos)
+    if L.buf[pos] == '#': inc(pos)
+    if L.buf[pos] == '#': inc(pos)
   while true:
-    case buf[pos]
+    case L.buf[pos]
     of ' ', '\x0B', '\x0C':
       inc(pos)
       inc(result)
@@ -175,9 +174,9 @@ proc getIndentAux(L: var Lexer, start: int): int =
       result = result - (result mod 8) + 8
     else:
       break                   # EndOfFile also leaves the loop
-  if buf[pos] == '\0':
+  if L.buf[pos] == '\0':
     result = 0
-  elif (buf[pos] == '\x0A') or (buf[pos] == '\x0D'):
+  elif (L.buf[pos] == '\x0A') or (L.buf[pos] == '\x0D'):
     # look at the next line for proper indentation:
     result = getIndentAux(L, pos)
   L.bufpos = pos              # no need to set back buf