summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/luat-mac.lua
diff options
context:
space:
mode:
authorMojca Miklavec <mojca.miklavec@gmail.com>2012-05-22 21:04:25 +0000
committerMojca Miklavec <mojca.miklavec@gmail.com>2012-05-22 21:04:25 +0000
commita115fb4ebf3890ee3cabdf98f3f945a349860752 (patch)
treee4d25217d24f4c1b6d863007725f538169379e87 /Master/texmf-dist/tex/context/base/luat-mac.lua
parentd36378879c10c7378bc52d9fe7d1ce9c3677d98b (diff)
ConTeXt 2012.05.22 16:12
git-svn-id: svn://tug.org/texlive/trunk@26572 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/luat-mac.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/luat-mac.lua18
1 files changed, 10 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/context/base/luat-mac.lua b/Master/texmf-dist/tex/context/base/luat-mac.lua
index 75d52781c93..f8f87a25ae7 100644
--- a/Master/texmf-dist/tex/context/base/luat-mac.lua
+++ b/Master/texmf-dist/tex/context/base/luat-mac.lua
@@ -14,12 +14,6 @@ if not modules then modules = { } end modules ['luat-mac'] = {
--
-- \def\foo#1{\expandafter\normaldef\csname#1\endcsname}
--- todo:
---
--- \def\dosomething#content{%%%<= fine with “#1”
--- % { %%% Open unbalanced brace breaks macros.
--- }
-
local P, V, S, R, C, Cs, Cmt, Carg = lpeg.P, lpeg.V, lpeg.S, lpeg.R, lpeg.C, lpeg.Cs, lpeg.Cmt, lpeg.Carg
local lpegmatch, patterns = lpeg.match, lpeg.patterns
@@ -116,7 +110,7 @@ local always = patterns.alwaysmatched
local commenttoken = P("%")
local crorlf = S("\n\r")
-local commentline = commenttoken * ((Carg(1) * C((1-crorlf)^0))/function(strip,s) return strip and "" or s end)
+----- commentline = commenttoken * ((Carg(1) * C((1-crorlf)^0))/function(strip,s) return strip and "" or s end)
local commentline = commenttoken * ((1-crorlf)^0)
local leadingcomment = (commentline * crorlf^1)^1
local furthercomment = (crorlf^1 * commentline)^1
@@ -166,6 +160,7 @@ local grammar = { "converter",
+ V("texcode")
+ V("braced")
+ furthercomment
+ + leadingcomment -- new per 2012-05-15 (message on mailing list)
+ nobrace
)^0
-- * rightbrace^-1, -- the -1 catches errors
@@ -291,7 +286,14 @@ end
-- {\normalexpanded{\def\noexpand\next#content\expandafter\noexpand\csname stop#name\endcsname}{#name : #content}%
-- \next}
-- ]]))
-
+--
+-- print(macros.preprocessed([[
+-- \def\dosomething#content{%%% {{
+-- % { }{{ %%
+-- \bgroup\italic#content\egroup
+-- }
+-- ]]))
+--
-- Just an experiment:
--
-- \catcode\numexpr"10FF25=\commentcatcode %% > 110000 is invalid