Skip to content

Commit

Permalink
Modifications to doc_check.sh and def_check.sh
Browse files Browse the repository at this point in the history
These modifications serve to remove a few false positives.
  • Loading branch information
rpspringuel committed Apr 14, 2017
1 parent 9424e77 commit 76bcbc6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
23 changes: 23 additions & 0 deletions def_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ Gre:g' $TEXFILE
sed -i.temp '/Gre/!d' $TEXFILE
sed -i.temp 's:\(Gre[a-zA-Z]*\).*:\1:' $TEXFILE

#remove bar lines (these names are assembled piecemeal, not whole)
sed -i.temp 's:^GreDivisioFinalis$::' $TEXFILE
sed -i.temp 's:^GreDivisioMaior$::' $TEXFILE
sed -i.temp 's:^GreDivisioMinima$::' $TEXFILE
sed -i.temp 's:^GreDivisioMinor$::' $TEXFILE
sed -i.temp 's:^GreDominica$::' $TEXFILE
sed -i.temp 's:^GreVirgula$::' $TEXFILE
sed -i.temp 's:^GreFinalDivisioFinalis$::' $TEXFILE
sed -i.temp 's:^GreFinalDivisioMaior$::' $TEXFILE
sed -i.temp 's:^GreInDivisioFinalis$::' $TEXFILE
sed -i.temp 's:^GreInDivisioMaior$::' $TEXFILE
sed -i.temp 's:^GreInDivisioMinima$::' $TEXFILE
sed -i.temp 's:^GreInDivisioMinor$::' $TEXFILE
sed -i.temp 's:^GreInDominica$::' $TEXFILE
sed -i.temp 's:^GreInVirgula$::' $TEXFILE


#label file
echo "00 GreMacros Defined in TeX" >> $TEXFILE

Expand All @@ -60,6 +77,12 @@ Gre:g' $CFILE
sed -i.temp '/Gre/!d' $CFILE
sed -i.temp 's:\(Gre[a-zA-Z]*\).*:\1:' $CFILE

#remove prefixes of assembled function names
sed -i.temp 's:^Gre$::' $CFILE
sed -i.temp 's:^GreCP$::' $CFILE
sed -i.temp 's:^GreFinal$::' $CFILE
sed -i.temp 's:^GreIn$::' $CFILE

#label file
echo "00 Macros Written by C" >> $CFILE

Expand Down
13 changes: 11 additions & 2 deletions doc_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ gsed -i.temp 's/^[ \t]*//;s/[ \t]*$//' $CODEFILE
#remove new and trailing code
sed -i.temp 's:.*\\new[a-z]*{*\(\\*[a-zA-Z@]*\)[\\}]*.*:\1:' $CODEFILE

#get rid of work around def
sed -i.temp -E 's:\\def\\x{::' $CODEFILE

#accept only first def on line
sed -i.temp -E 's:\\[gex]?def:special:' $CODEFILE
#remove def and definition
Expand All @@ -55,8 +58,8 @@ sed -i.temp 's:.*\\let[a-z]*\(\\[a-zA-Z@]*\)[\\=].*:\1:' $CODEFILE
#remove gredefsymbol and definition
sed -i.temp 's:.*\\gredefsymbol{\([A-Za-z]*\)}.*:\\\1:' $CODEFILE

#unwrap csname
sed -i.temp 's:.*\(\\csname.*\\endcsname\).*:\1:' $CODEFILE
#remove csname
sed -i.temp 's:.*\(\\csname.*\\endcsname\).*::' $CODEFILE

#colors
grep -hE '\\definecolor.*' *.sty >> $CODEFILE
Expand Down Expand Up @@ -85,9 +88,15 @@ sed -i.temp 's:.*count@temp@.*::' $CODEFILE
#registers for saved values
sed -i.temp 's:\\gre@saved@.*::' $CODEFILE

#macros used to process options
sed -i.temp 's:\\gre@autocompile::' $CODEFILE
sed -i.temp 's:\\gre@forcecompile::' $CODEFILE
sed -i.temp 's:\\gre@nevercompile::' $CODEFILE

#block documented items
sed -i.temp 's:\\gre@pitch.*::' $CODEFILE
sed -i.temp 's:.*gre@char@he@.*::' $CODEFILE
sed -i.temp 's:\\gre@protrusionfactor@.*::' $CODEFILE

#label file
echo "00 Macros Defined in TeX" >> $CODEFILE
Expand Down

0 comments on commit 76bcbc6

Please sign in to comment.