From af36b8b8cf0b062904823fbaa99efa81f1a04ab8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 11 Aug 2011 18:03:01 +0000 Subject: match_parens ruby script (30jul11) git-svn-id: svn://tug.org/texlive/trunk@23500 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/support/match_parens/README | 17 ++ .../doc/support/match_parens/created.rid | 1 + .../doc/support/match_parens/fr_class_index.html | 26 +++ .../doc/support/match_parens/fr_file_index.html | 27 +++ .../doc/support/match_parens/fr_method_index.html | 26 +++ .../texmf-dist/doc/support/match_parens/index.html | 24 +++ .../doc/support/match_parens/match_parens.html | 152 +++++++++++++++ .../doc/support/match_parens/rdoc-style.css | 208 +++++++++++++++++++++ .../texmf-dist/scripts/match_parens/match_parens | 61 ++++++ 9 files changed, 542 insertions(+) create mode 100644 Master/texmf-dist/doc/support/match_parens/README create mode 100644 Master/texmf-dist/doc/support/match_parens/created.rid create mode 100644 Master/texmf-dist/doc/support/match_parens/fr_class_index.html create mode 100644 Master/texmf-dist/doc/support/match_parens/fr_file_index.html create mode 100644 Master/texmf-dist/doc/support/match_parens/fr_method_index.html create mode 100644 Master/texmf-dist/doc/support/match_parens/index.html create mode 100644 Master/texmf-dist/doc/support/match_parens/match_parens.html create mode 100644 Master/texmf-dist/doc/support/match_parens/rdoc-style.css create mode 100755 Master/texmf-dist/scripts/match_parens/match_parens (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/support/match_parens/README b/Master/texmf-dist/doc/support/match_parens/README new file mode 100644 index 00000000000..c1a90e6d5db --- /dev/null +++ b/Master/texmf-dist/doc/support/match_parens/README @@ -0,0 +1,17 @@ +This is release 1.3 of the match_parens script +LICENSE: GPL + +Short description: +Mismatches of parentheses, braces, (angle) brackets, especially +in TeX sources which may be rich in those, may be difficult to +trace. This little script helps you by writing your text to +standard output, after adding a left margin to your text, which +will normally be almost empty, but will clearly show any +mismatches. (Just try the script on myself to see that the +parenthesis starting this sentence will not appear to be matched +at the end of the file. If you are looking at me in the vim editor, try +the command: + +:%!match_parens + +$Id: README,v 1.5 2011-07-30 09:29:02 wybo Exp $ diff --git a/Master/texmf-dist/doc/support/match_parens/created.rid b/Master/texmf-dist/doc/support/match_parens/created.rid new file mode 100644 index 00000000000..6fb2168692a --- /dev/null +++ b/Master/texmf-dist/doc/support/match_parens/created.rid @@ -0,0 +1 @@ +Sat, 30 Jul 2011 11:57:29 +0200 diff --git a/Master/texmf-dist/doc/support/match_parens/fr_class_index.html b/Master/texmf-dist/doc/support/match_parens/fr_class_index.html new file mode 100644 index 00000000000..49ce9e299aa --- /dev/null +++ b/Master/texmf-dist/doc/support/match_parens/fr_class_index.html @@ -0,0 +1,26 @@ + + + + + + + + Classes + + + + + +
+

Classes

+
+
+
+ + \ No newline at end of file diff --git a/Master/texmf-dist/doc/support/match_parens/fr_file_index.html b/Master/texmf-dist/doc/support/match_parens/fr_file_index.html new file mode 100644 index 00000000000..b2ed504eeca --- /dev/null +++ b/Master/texmf-dist/doc/support/match_parens/fr_file_index.html @@ -0,0 +1,27 @@ + + + + + + + + Files + + + + + +
+

Files

+ +
+ + \ No newline at end of file diff --git a/Master/texmf-dist/doc/support/match_parens/fr_method_index.html b/Master/texmf-dist/doc/support/match_parens/fr_method_index.html new file mode 100644 index 00000000000..cdfab83ff8d --- /dev/null +++ b/Master/texmf-dist/doc/support/match_parens/fr_method_index.html @@ -0,0 +1,26 @@ + + + + + + + + Methods + + + + + +
+

Methods

+
+
+
+ + \ No newline at end of file diff --git a/Master/texmf-dist/doc/support/match_parens/index.html b/Master/texmf-dist/doc/support/match_parens/index.html new file mode 100644 index 00000000000..df838c5c21a --- /dev/null +++ b/Master/texmf-dist/doc/support/match_parens/index.html @@ -0,0 +1,24 @@ + + + + + + + RDoc Documentation + + + + + + + + + + + \ No newline at end of file diff --git a/Master/texmf-dist/doc/support/match_parens/match_parens.html b/Master/texmf-dist/doc/support/match_parens/match_parens.html new file mode 100644 index 00000000000..38fdf620ccf --- /dev/null +++ b/Master/texmf-dist/doc/support/match_parens/match_parens.html @@ -0,0 +1,152 @@ + + + + + + File: match_parens + + + + + + + + + + +
+

match_parens

+ + + + + + + + + +
Path:match_parens +
Last Update:Sat Jul 30 11:31:24 +0200 2011
+
+ + +
+ + + +
+ +
+

match_parens - find mismatches of parentheses, braces, (angle) brackets, in texts

+

Synopsis

+
+        match_parens [_filename_]
+
+

Description

+

+Mismatches of parentheses, braces, (angle) brackets, especially in TeX +sources which may be rich in those, may be difficult to trace. This little +script helps you by writing your text to standard output, after adding a +left margin to your text, which will normally be almost empty, but will +clearly show any mismatches. (Just try me on myself to see that the +parenthesis starting this sentence will not appear to be matched at the end +of the file. If you look at me in the vim editor, try the command :%!% +

+

Copyright

+

+Copyright (C) 2009 Wybo Dekker (wybo@dekkerdocumenten.nl) +

+

+This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General +Public License as published by the Free Software Foundation, either +version 3 of the License, or (at your option) any later version. +

+

+This program is distributed in the hope that it will be useful, but without +any warranty; without even the implied warranty of merchantability or +fitness for a particular purpose. See the GNU General Public License for more +details. +

+

+$Id: match_parens,v 1.7 2011-07-30 09:31:24 wybo Exp $ +

+ +
+ + +
+ + +
+ + + + +
+ + +
+

Constants

+ +
+ + + + + + +
RELEASE=1.3
+
+
+ + + + + + + + + +
+ + +
+

[Validate]

+
+ + + \ No newline at end of file diff --git a/Master/texmf-dist/doc/support/match_parens/rdoc-style.css b/Master/texmf-dist/doc/support/match_parens/rdoc-style.css new file mode 100644 index 00000000000..6653aedfa7a --- /dev/null +++ b/Master/texmf-dist/doc/support/match_parens/rdoc-style.css @@ -0,0 +1,208 @@ + +body { + font-family: DejaVu Serif,Comic Sans MS,serif; + font-size: 90%; + margin: 0; + margin-left: 40px; + padding: 0; + background: white; +} + +h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; } +h1 { font-size: 150%; } +h2,h3,h4 { margin-top: 1em; } + +a { background: #eef; color: #039; text-decoration: none; } +a:hover { background: #039; color: #eef; } + +/* Override the base stylesheet's Anchor inside a table cell */ +td > a { + background: transparent; + color: #039; + text-decoration: none; +} + +/* and inside a section title */ +.section-title > a { + background: transparent; + color: #eee; + text-decoration: none; +} + +/* === Structural elements =================================== */ + +div#index { + margin: 0; + margin-left: -40px; + padding: 0; + font-size: 90%; +} + + +div#index a { + margin-left: 0.7em; +} + +div#index .section-bar { + margin-left: 0px; + padding-left: 0.7em; + background: #ccc; + font-size: small; +} + + +div#classHeader, div#fileHeader { + width: auto; + color: white; + padding: 0.5em 1.5em 0.5em 1.5em; + margin: 0; + margin-left: -40px; + border-bottom: 3px solid #006; +} + +div#classHeader a, div#fileHeader a { + background: inherit; + color: white; +} + +div#classHeader td, div#fileHeader td { + background: inherit; + color: white; +} + + +div#fileHeader { + background: #057; +} + +div#classHeader { + background: #048; +} + + +.class-name-in-header { + font-size: 180%; + font-weight: bold; +} + + +div#bodyContent { + padding: 0 1.5em 0 1.5em; +} + +div#description { + padding: 0.5em 1.5em; + background: #efefef; + border: 1px dotted #999; +} + +div#description h1,h2,h3,h4,h5,h6 { + color: #125;; + background: transparent; +} + +div#validator-badges { + text-align: center; +} +div#validator-badges img { border: 0; } + +div#copyright { + color: #333; + background: #efefef; + font: 0.75em sans-serif; + margin-top: 5em; + margin-bottom: 0; + padding: 0.5em 2em; +} + + +/* === Classes =================================== */ + +table.header-table { + color: white; + font-size: small; +} + +.type-note { + font-size: small; + color: #DEDEDE; +} + +.xxsection-bar { + background: #eee; + color: #333; + padding: 3px; +} + +.section-bar { + color: #333; + border-bottom: 1px solid #999; + margin-left: -20px; +} + + +.section-title { + background: #79a; + color: #eee; + padding: 3px; + margin-top: 2em; + margin-left: -30px; + border: 1px solid #999; +} + +.top-aligned-row { vertical-align: top } +.bottom-aligned-row { vertical-align: bottom } + +/* --- Context section classes ----------------------- */ + +.context-row { } +.context-item-name { font-family: monospace; font-weight: bold; color: black; } +.context-item-value { font-size: small; color: #448; } +.context-item-desc { color: #333; padding-left: 2em; } + +/* --- Method classes -------------------------- */ +.method-detail { + background: #efefef; + padding: 0; + margin-top: 0.5em; + margin-bottom: 1em; + border: 1px dotted #ccc; +} +.method-heading { + color: black; + background: #ccc; + border-bottom: 1px solid #666; + padding: 0.2em 0.5em 0 0.5em; +} +.method-signature { color: black; background: inherit; } +.method-name { font-weight: bold; } +.method-args { font-style: italic; } +.method-description { padding: 0 0.5em 0 0.5em; } + +/* --- Source code sections -------------------- */ + +a.source-toggle { font-size: 90%; } +div.method-source-code { + background: #262626; + color: #ffdead; + margin: 1em; + padding: 0.5em; + border: 1px dashed #999; + overflow: hidden; +} + +div.method-source-code pre { color: #ffdead; overflow: hidden; } + +/* --- Ruby keyword styles --------------------- */ + +.standalone-code { background: #221111; color: #ffdead; overflow: hidden; } + +.ruby-constant { color: #7fffd4; background: transparent; } +.ruby-keyword { color: #00ffff; background: transparent; } +.ruby-ivar { color: #eedd82; background: transparent; } +.ruby-operator { color: #00ffee; background: transparent; } +.ruby-identifier { color: #ffdead; background: transparent; } +.ruby-node { color: #ffa07a; background: transparent; } +.ruby-comment { color: #b22222; font-weight: bold; background: transparent; } +.ruby-regexp { color: #ffa07a; background: transparent; } +.ruby-value { color: #7fffd4; background: transparent; } \ No newline at end of file diff --git a/Master/texmf-dist/scripts/match_parens/match_parens b/Master/texmf-dist/scripts/match_parens/match_parens new file mode 100755 index 00000000000..b5c0fa18da1 --- /dev/null +++ b/Master/texmf-dist/scripts/match_parens/match_parens @@ -0,0 +1,61 @@ +#!/usr/bin/env ruby + +=begin rdoc + +== match_parens - find mismatches of parentheses, braces, (angle) brackets, in texts + +== Synopsis + + match_parens [_filename_] + +== Description + +Mismatches of parentheses, braces, (angle) brackets, especially in TeX +sources which may be rich in those, may be difficult to trace. This +little script helps you by writing your text to standard output, after +adding a left margin to your text, which will normally be almost empty, +but will clearly show any mismatches. (Just try me on myself to see that +the parenthesis starting this sentence will not appear to be matched at +the end of the file. If you look at me in the vim editor, try the command +:%!% + +=== Copyright + +Copyright (C) 2009 Wybo Dekker (wybo@dekkerdocumenten.nl) + +This program is free software: you can redistribute it and/or modify it +under the terms of the {GNU General Public License}[http://www.gnu.org/licenses/] +as published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but without any warranty; without even the implied warranty of +merchantability or fitness for a particular purpose. See the {GNU +General Public License}[http://www.gnu.org/licenses/] for more details. + +$Id: match_parens,v 1.7 2011-07-30 09:31:24 wybo Exp $ +=end + +private + s, n, html, parens = +'', '0', false, '^{}[]()' + +RELEASE = 1.3 + +while gets() + if html + if ~/^=end/ || ~/<\/html>/i + html = false + parens = '^{}[]()' + end + else + if ~/^=begin rdoc/ || ~/\/i + html = true + parens = '^{}[]()<>' + end + end + # look for <> in html or rdoc: + s << $_.tr(parens,'') + while s.gsub!(/\{\}|\(\)|\[\]|<>/,'') do end + puts [n.next!,s,$_].join("\t") +end -- cgit v1.2.3