-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap node name in \tikz@pp@name
when passed to pgf gd
#1119
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8b7f391
fix(gd): Wrap node name in `\tikz@pp@name`
muzimuzhi 2440c7d
fix(gd): Add `\tikz@pp@name` for edge kind `-!-`
muzimuzhi dd89951
test(gd)!: New test set and its first test
muzimuzhi beb25f1
chore: Add changelog entries
muzimuzhi 6187845
test(gd): optimize Lua code
hmenke 0c37efc
fixup! test(gd): optimize Lua code
hmenke 73689ac
fixup! fixup! test(gd): optimize Lua code
hmenke b65622a
Merge branch 'master' into gd-name-prefix
muzimuzhi 5b154e6
feat(ci): Archive failed test output for all test sets
muzimuzhi b17faf5
fixup! fixup! fixup! test(gd): optimize Lua code
muzimuzhi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,32 @@ | ||
local InterfaceToDisplay = pgf.gd.interface.InterfaceToDisplay | ||
local InterfaceToDisplay = assert(pgf.gd.interface.InterfaceToDisplay) | ||
|
||
--- Wrap InterfaceToDisplay functions to prepend debugging code | ||
local createVertex = InterfaceToDisplay.createVertex | ||
-- here `...` is a vararg expression, | ||
-- see https://www.lua.org/manual/5.3/manual.html#3.4.11 | ||
function InterfaceToDisplay.createVertex(...) | ||
local name = ... | ||
debug("Create vertex '%s'", name) | ||
createVertex(...) | ||
-- helper | ||
local function typeout(...) | ||
texio.write_nl(17, string.format(...)) | ||
end | ||
|
||
local createEdge = InterfaceToDisplay.createEdge | ||
function InterfaceToDisplay.createEdge(...) | ||
local tail, head, direction = ... | ||
debug("Create edge '%s' from '%s' to '%s'", direction, tail, head) | ||
createEdge(...) | ||
local createVertex = assert(InterfaceToDisplay.createVertex) | ||
function InterfaceToDisplay.createVertex(name, ...) | ||
typeout("Create vertex '%s'", name) | ||
createVertex(name, ...) | ||
end | ||
|
||
-- this generates too many debugging lines | ||
-- local createEvent = InterfaceToDisplay.createEvent | ||
-- function InterfaceToDisplay.createEvent(...) | ||
-- local kind = ... | ||
-- debug("Create event '%s'", kind) | ||
-- return createEvent(...) | ||
-- end | ||
|
||
local addToVertexOptions = InterfaceToDisplay.addToVertexOptions | ||
function InterfaceToDisplay.addToVertexOptions(...) | ||
local name = ... | ||
debug("Add options to vertex '%s'", name) | ||
addToVertexOptions(...) | ||
local createEdge = assert(InterfaceToDisplay.createEdge) | ||
function InterfaceToDisplay.createEdge(tail, head, direction, ...) | ||
typeout("Create edge '%s' from '%s' to '%s'", direction, tail, head) | ||
createEdge(tail, head, direction, ...) | ||
end | ||
|
||
--[[ this generates too many debugging lines | ||
local createEvent = assert(InterfaceToDisplay.createEvent) | ||
function InterfaceToDisplay.createEvent(kind, ...) | ||
typeout("Create event '%s'", kind) | ||
return createEvent(kind, ...) | ||
end | ||
--]] | ||
|
||
-- helper | ||
function debug(format_str, ...) | ||
tex.sprint(string.format("\\pgfgdluainfo{" .. format_str .. "}", ...)) | ||
local addToVertexOptions = assert(InterfaceToDisplay.addToVertexOptions) | ||
function InterfaceToDisplay.addToVertexOptions(name, ...) | ||
typeout("Add options to vertex '%s'", name) | ||
addToVertexOptions(name, ...) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,5 @@ | ||
\input regression-test.tex | ||
|
||
\catcode`\@=11 % \makeatletter | ||
|
||
% this macro should be used _after_ graphdrawing library is loaded | ||
\def\pgfgdBeforeBeginDocument{ | ||
% redirect error | ||
\def\pgfutil@packageerror#1#2#3{\immediate\write17{Package #1 Error: #2.}} | ||
muzimuzhi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
% new message type "info" | ||
\def\pgftest@genericinfo#1#2{\immediate\write17{#1 Info: #2.}} | ||
\def\pgfgdluainfo{\pgftest@genericinfo{Gd Lua layer}} | ||
|
||
% insert debugging code | ||
\ifdefined\directlua | ||
\directlua{dofile('pgfgd-debug.lua')} | ||
} | ||
|
||
\catcode`\@=12 % \makeatother | ||
\fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the test fails with
because when
pgfgd-debug.lua
is read in, the wholepgf
is not loaded yet. This explains why the\pgfgdBeforeBeginDocument
was introduced (and used after package loading and just before\begin{document}
). For latex format only,\AtBeginDocument
suffices but I more or less want(ed) a portable solution (not a strong opinion).