diff options
author | knu <knu@FreeBSD.org> | 2002-11-10 03:59:45 +0800 |
---|---|---|
committer | knu <knu@FreeBSD.org> | 2002-11-10 03:59:45 +0800 |
commit | 27df49724ef21cd9a4fa16dc69c4809a5170316e (patch) | |
tree | 5c500b16ac4b04b8c3e61eef7f33b60262937306 /devel/ruby-nodedump | |
parent | 9db3347deb56be7785f971ec678d8387f9a0e0a9 (diff) | |
download | freebsd-ports-gnome-27df49724ef21cd9a4fa16dc69c4809a5170316e.tar.gz freebsd-ports-gnome-27df49724ef21cd9a4fa16dc69c4809a5170316e.tar.zst freebsd-ports-gnome-27df49724ef21cd9a4fa16dc69c4809a5170316e.zip |
Add ruby-nodedump, which displays the internal structure of a parsed
Ruby program.
Diffstat (limited to 'devel/ruby-nodedump')
-rw-r--r-- | devel/ruby-nodedump/Makefile | 32 | ||||
-rw-r--r-- | devel/ruby-nodedump/distinfo | 1 | ||||
-rw-r--r-- | devel/ruby-nodedump/files/patch-nodeDump.c | 51 | ||||
-rw-r--r-- | devel/ruby-nodedump/pkg-descr | 7 | ||||
-rw-r--r-- | devel/ruby-nodedump/pkg-plist | 3 |
5 files changed, 94 insertions, 0 deletions
diff --git a/devel/ruby-nodedump/Makefile b/devel/ruby-nodedump/Makefile new file mode 100644 index 000000000000..1b6b9aadd9a1 --- /dev/null +++ b/devel/ruby-nodedump/Makefile @@ -0,0 +1,32 @@ +# New ports collection makefile for: NodeDump for Ruby +# Date created: 10 November 2002 +# Whom: Akinori MUSHA aka knu <knu@idaemons.org> +# +# $FreeBSD$ +# + +PORTNAME= nodedump +PORTVERSION= 0.1.7 +CATEGORIES= devel ruby +MASTER_SITES= http://www.pragmaticprogrammer.com/ruby/downloads/files/ +PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX} +DISTNAME= nodeDump-${PORTVERSION} +EXTRACT_SUFX= .tgz +DIST_SUBDIR= ruby + +MAINTAINER= knu@FreeBSD.org + +PORTCOMMENT= Displays the internal structure of a parsed Ruby program + +USE_RUBY= yes +USE_RUBY_EXTCONF= yes + +INSTALL_TARGET= site-install + +post-install: +.if !defined(NOPORTDOCS) + ${MKDIR} ${RUBY_MODDOCDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${RUBY_MODDOCDIR}/ +.endif + +.include <bsd.port.mk> diff --git a/devel/ruby-nodedump/distinfo b/devel/ruby-nodedump/distinfo new file mode 100644 index 000000000000..8c31999b913e --- /dev/null +++ b/devel/ruby-nodedump/distinfo @@ -0,0 +1 @@ +MD5 (ruby/nodeDump-0.1.7.tgz) = 0b02456eee1e591ecf954e55fc62cd2a diff --git a/devel/ruby-nodedump/files/patch-nodeDump.c b/devel/ruby-nodedump/files/patch-nodeDump.c new file mode 100644 index 000000000000..3f007a92d1b9 --- /dev/null +++ b/devel/ruby-nodedump/files/patch-nodeDump.c @@ -0,0 +1,51 @@ +[ruby-core: 00560] + +--- nodeDump.c.orig Fri Jul 26 20:14:32 2002 ++++ nodeDump.c Thu Oct 24 03:32:21 2002 +@@ -103,5 +103,4 @@ static void doDump(NODE *n, int level) { + lp(level, "%s: ", node_names[type]); + +- again: + switch (type) { + +@@ -117,10 +116,9 @@ static void doDump(NODE *n, int level) { + case NODE_OR: + nl(); +- doDump(n->nd_1st, level + 1); +- if (n->nd_2nd && nd_type(n->nd_2nd)) { +- n = n->nd_2nd; +- goto again; +- } +- doDump(n->nd_2nd, level + 1); ++ ++level; ++ do { ++ doDump(n->nd_1st, level); ++ } while (n->nd_2nd && (type == nd_type(n = n->nd_2nd))); ++ doDump(n, level); + break; + +@@ -352,4 +350,7 @@ static void doDump(NODE *n, int level) { + case NODE_DREGX: + case NODE_DREGX_ONCE: ++#ifdef NODE_DSYM ++ case NODE_DSYM: ++#endif + dumpLiteral(n->nd_lit, level+1); + n1 = n->nd_next; +@@ -677,8 +678,14 @@ static void doDump(NODE *n, int level) { + case NODE_WHILE: + nl(); +- lp(level+1, "Condition:\n"); +- doDump(n->nd_cond, level+2); ++ if (n->nd_state) { ++ lp(level+1, "Condition:\n"); ++ doDump(n->nd_cond, level+2); ++ } + lp(level+1, "Body:\n"); + doDump(n->nd_body, level+2); ++ if (!n->nd_state) { ++ lp(level+1, "Condition:\n"); ++ doDump(n->nd_cond, level+2); ++ } + break; + diff --git a/devel/ruby-nodedump/pkg-descr b/devel/ruby-nodedump/pkg-descr new file mode 100644 index 000000000000..748638a60f33 --- /dev/null +++ b/devel/ruby-nodedump/pkg-descr @@ -0,0 +1,7 @@ +NodeDump displays the internal structure of a parsed Ruby program. +This is really only of use to people who want to hack the interpreter, +or who are curious about how Ruby represents their programs +internally. + +Author: The Pragmatic Programmers, LLC +WWW: http://www.pragmaticprogrammer.com/ruby/downloads/nodeDump.html diff --git a/devel/ruby-nodedump/pkg-plist b/devel/ruby-nodedump/pkg-plist new file mode 100644 index 000000000000..55089fdca567 --- /dev/null +++ b/devel/ruby-nodedump/pkg-plist @@ -0,0 +1,3 @@ +%%RUBY_SITEARCHLIBDIR%%/NodeDump.so +%%PORTDOCS%%%%RUBY_MODDOCDIR%%/README +%%PORTDOCS%%@dirrm %%RUBY_MODDOCDIR%% |