summaryrefslogtreecommitdiff
path: root/tex/context/base/node-rul.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-03-18 14:42:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-03-18 14:42:00 +0100
commit66a814af45f6ebe7ff0210238b2b9eba7dd3a499 (patch)
treec227b9351820db8c6084b82777c60b4367c80dd8 /tex/context/base/node-rul.lua
parentf8583123d8e264910387d015f4d6576551fe0ee4 (diff)
downloadcontext-66a814af45f6ebe7ff0210238b2b9eba7dd3a499.tar.gz
beta 2010.03.18 14:42
Diffstat (limited to 'tex/context/base/node-rul.lua')
-rw-r--r--tex/context/base/node-rul.lua41
1 files changed, 22 insertions, 19 deletions
diff --git a/tex/context/base/node-rul.lua b/tex/context/base/node-rul.lua
index f217c3a97..17b7c7658 100644
--- a/tex/context/base/node-rul.lua
+++ b/tex/context/base/node-rul.lua
@@ -13,26 +13,28 @@ local disc = node.id("disc")
local rule = node.id("rule")
function nodes.strip_range(first,last) -- todo: dir
- local current = first
- while current ~= last do
- local id = current.id
- if id == glyph or id == disc then
---~ if id == glyph or id == rule or id == disc then
- first = current
- break
- else
- current = current.next
+ if first and last then -- just to be sure
+ local current = first
+ while current and current ~= last do
+ local id = current.id
+ if id == glyph or id == disc then
+ --~ if id == glyph or id == rule or id == disc then
+ first = current
+ break
+ else
+ current = current.next
+ end
end
- end
- local current = last
- while current ~= first do
- local id = current.id
---~ if id == glyph or id == rule or id == disc then
- if id == glyph or id == disc then
- last = current
- break
- else
- current = current.prev
+ local current = last
+ while current and current ~= first do
+ local id = current.id
+ --~ if id == glyph or id == rule or id == disc then
+ if id == glyph or id == disc then
+ last = current
+ break
+ else
+ current = current.prev
+ end
end
end
return first, last
@@ -169,6 +171,7 @@ function nodes.rules.define(settings)
end
local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but acceptable for this purpose
+-- check for f and l
local r, m
if true then
f, l = strip_range(f,l)