[Frugalware-git] frugalware-current: generatesyntax * initial draft
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=082967e6bedd8111d3ec02f9f804cbef8a5d1cb2 commit 082967e6bedd8111d3ec02f9f804cbef8a5d1cb2 Author: James Buren r...@frugalware.org Date: Tue Mar 30 15:11:13 2010 -0500 generatesyntax * initial draft diff --git a/tools/generatesyntax b/tools/generatesyntax new file mode 100755 index 000..b2bed91 --- /dev/null +++ b/tools/generatesyntax @@ -0,0 +1,45 @@ +#!/bin/bash + +# Authored by James Buren r...@frugalware.org +# Generate FrugalBuild syntax highlighting for editors +# Will not do all the work but will help with the tedious +# task of updating the syntax as the schemas change + +# Output for nano editor +nano_output() { + + for i in $FUNCTIONS; do +echo color red \$i\ + done + + for i in $VARIABLES; do +echo color brightcyan \$i\ + done + +} + +if [ -z $1 ]; then + echo Usage: $0 output format + exit 1 +fi + +# Schemas to search +SCHEMAS=$(git rev-parse --show-cdup)/source/include/*.sh + +# Assemble names of all functions, filter out any starting with '__' +FUNCTIONS=`grep -ho '^\w\+()\s*{\?' $SCHEMAS | grep -v '^__' | sed 's|[(){ \t]||g' | sort -u` + +# Define variables all FrugalBuilds may have +VARIABLES=pkgname pkgver pkgrel pkgdesc pkgdesc_localized url license install +VARIABLES+= up2date source sha1sums signatures groups archs backup depends +VARIABLES+= makedepends rodepends conflicts provides removes replaces options +VARIABLES+= subpkgs subdescs subdescs_localized sublicense subreplaces +VARIABLES+= subgroups subdepends subrodepends subremoves subconflicts +VARIABLES+= subprovides subbackup subinstall suboptions subarchs + +# Append variables +VARIABLES=$VARIABLES `grep -hEo '\b(_F_|F)\w+=' $SCHEMAS | sed 's|=\$||'` + +if [ $1 == nano ]; then + nano_output +fi ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
Re: [Frugalware-git] frugalware-current: generatesyntax * initial draft
On 31 March 2010 06:14, James Buren r...@frugalware.org wrote: Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=082967e6bedd8111d3ec02f9f804cbef8a5d1cb2 commit 082967e6bedd8111d3ec02f9f804cbef8a5d1cb2 Author: James Buren r...@frugalware.org Date: Tue Mar 30 15:11:13 2010 -0500 generatesyntax * initial draft ryuo, Is this at a point when I can announce it in the next newsletter, or would you prefer that I wait until it's finished? May you always be Frugal, Russell Dickenson (AKA phayz) ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git