├── Preferences ├── Folding.tmPreferences └── Miscellaneous.tmPreferences ├── README.mdown ├── Snippets ├── Gri logo.plist └── Contour (con).plist ├── info.plist ├── Commands └── Gri and view.plist └── Syntaxes └── Gri.plist /Preferences/Folding.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Folding 7 | scope 8 | source.gri 9 | settings 10 | 11 | foldingStartMarker 12 | (/\*\*|\{\s*$) 13 | foldingStopMarker 14 | (\*\*/|^\s*\}) 15 | 16 | uuid 17 | BA8F4D0B-245A-4335-8955-666FFBB2C313 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Miscellaneous.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Miscellaneous 7 | scope 8 | source.gri 9 | settings 10 | 11 | highlightPairs 12 | 13 | 14 | ( 15 | ) 16 | 17 | 18 | { 19 | } 20 | 21 | 22 | increaseIndentPattern 23 | \b(?i:(while))\b 24 | smartTypingPairs 25 | 26 | 27 | ( 28 | ) 29 | 30 | 31 | { 32 | } 33 | 34 | 35 | " 36 | " 37 | 38 | 39 | 40 | uuid 41 | 3BC63705-0826-4C6F-B0F4-7417722655DB 42 | 43 | 44 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. 4 | 5 | # General 6 | 7 | * [Bundle Styleguide](http://kb.textmate.org/bundle_styleguide) — _before you make changes_ 8 | * [Commit Styleguide](http://kb.textmate.org/commit_styleguide) — _before you send a pull request_ 9 | * [Writing Bug Reports](http://kb.textmate.org/writing_bug_reports) — _before you report an issue_ 10 | 11 | # License 12 | 13 | If not otherwise specified (see below), files in this repository fall under the following license: 14 | 15 | Permission to copy, use, modify, sell and distribute this 16 | software is granted. This software is provided "as is" without 17 | express or implied warranty, and with no claim as to its 18 | suitability for any purpose. 19 | 20 | An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”. -------------------------------------------------------------------------------- /Snippets/Gri logo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | # `date` 7 | # ${1:$TM_FULLNAME} 8 | 9 | set x size 5 10 | set y size 5 11 | set y margin 20 12 | set x axis 0 1 0.25 13 | set y axis 0 20 10 14 | set font size 0 15 | \\background_color = "hsb 0.6 0.2 1.0" 16 | \\line_color = "red" 17 | \\word_color = "rgb 0.0 0.1 0.6" 18 | 19 | read columns x y 20 | 0.0 12.5 21 | 0.25 19 22 | 0.5 12 23 | 0.75 15 24 | 1 13 25 | 26 | draw axes none 27 | set color \\background_color 28 | set line width axis rapidograph 6 29 | draw curve filled to ..ybottom.. y 30 | set color black 31 | #draw axes frame 32 | 33 | set color \\line_color 34 | set line width 10 35 | draw curve 36 | 37 | set color \\word_color 38 | set font size 100 39 | set font to Helvetica 40 | draw label "Gri" at 0.05 1.3 41 | 42 | name 43 | Icon 44 | scope 45 | source.gri 46 | tabTrigger 47 | icon 48 | uuid 49 | 68248C77-9EB9-4B05-BEA6-162719D55AE0 50 | 51 | 52 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | Qna.Xryyrl@qny.pn 7 | contactName 8 | Dan Kelley 9 | description 10 | Support for <a href="http://gri.sourceforge.net/">Gri</a>, a language for scientific graphics programming. 11 | mainMenu 12 | 13 | items 14 | 15 | 41A8F343-48CB-482E-A395-34C31CE9A5AB 16 | ------------------------------------ 17 | 2046FFE7-A68E-4955-8FCA-C802F456792C 18 | 68248C77-9EB9-4B05-BEA6-162719D55AE0 19 | 20 | submenus 21 | 22 | 23 | name 24 | Gri 25 | ordering 26 | 27 | 41A8F343-48CB-482E-A395-34C31CE9A5AB 28 | 2046FFE7-A68E-4955-8FCA-C802F456792C 29 | 68248C77-9EB9-4B05-BEA6-162719D55AE0 30 | A7E000BE-6A87-4D7E-A053-469DA0DFEA02 31 | 3BC63705-0826-4C6F-B0F4-7417722655DB 32 | 33 | uuid 34 | 47889EBB-6E0F-4D16-ADDE-0616D5795636 35 | 36 | 37 | -------------------------------------------------------------------------------- /Snippets/Contour (con).plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | # `date` 7 | # ${1:$TM_FULLNAME} 8 | 9 | # Read columnar data (x,y,z), convert to a grid, then contour. 10 | 11 | # Data from figure 5 of Koch et al., 1983, J. Climate 12 | # Appl. Met., volume 22, pages 1487-1503. 13 | open "http://gri.sourceforge.net/gridoc/examples/example5.dat" 14 | read columns x y z 15 | close 16 | set x size 12 17 | set x axis 0 12 2 18 | set y size 10 19 | set y axis 0 10 2 20 | set y margin 15 21 | draw axes 22 | set color rgb 0 0 .6 # dark blue 23 | set line width symbol 0.2 24 | set symbol size 0.2 25 | draw symbol bullet 26 | set font size 8 27 | draw values 28 | set color black 29 | set x grid 0 12 0.25 30 | set y grid 0 10 0.25 31 | 32 | # Uncomment one of the 'convert' lines below, to try 33 | # various gridding schemes. 34 | convert columns to grid # "default" 35 | #convert columns to grid objective # As default 36 | #convert columns to grid objective -1.4 -1.4 # As default 37 | #convert columns to grid objective -1.4 -1.4 5 1 # As default 38 | #convert columns to grid objective -1.4 -1.4 5 -1 # + fill grid 39 | #convert columns to grid objective -2 -2 # Average 40 | #convert columns to grid objective 2 2 # 41 | #convert columns to grid boxcar # Ugly 42 | #convert columns to grid boxcar -2 -2 # Still ugly 43 | 44 | set font size 12 45 | draw contour 0 40 10 2 46 | set line width rapidograph 3 47 | draw contour 0 40 10 48 | set color black 49 | draw title "N. Am. wind (Fig5 Koch et al, 1983)" 50 | 51 | name 52 | Contour 53 | scope 54 | source.gri 55 | tabTrigger 56 | con 57 | uuid 58 | 2046FFE7-A68E-4955-8FCA-C802F456792C 59 | 60 | 61 | -------------------------------------------------------------------------------- /Commands/Gri and view.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | # Run Gri, convert the PostScript to PDF, and then show the latter. 12 | # The code is patterned on that for the "LaTeX and view" command. 13 | # GPL 2005 Dan Kelley. 14 | # (I hope it's OK to GPL something in TM!) 15 | 16 | . "${TM_SUPPORT_PATH}/lib/html.sh" 17 | 18 | # The comment and line below are copied from the "LaTeX and view" command. 19 | # Get the viewer program. Any program (that works with open -a <name>) can be used, 20 | # except 'html' which is reserved to mean the internal HTML window. This is also the 21 | # default option. 22 | V=${TM_LATEX_VIEWER:=html} 23 | 24 | DIR=`dirname "$TM_FILEPATH"` 25 | FILE=`basename "$TM_FILEPATH"` 26 | PSFILE=`basename "$FILE" .gri`.ps 27 | PDFFILE=`basename "$FILE" .gri`.pdf 28 | CWD="`pwd`/" 29 | TOPDF="epstopdf" 30 | 31 | # Switch to the right directory. 32 | cd "$TM_PROJECT_DIRECTORY" 33 | cd "$DIR" 34 | 35 | # Prepare output window. 36 | htmlHeader "Running Gri on file ${FILE}" 37 | echo "<h1>Running Gri on ${FILE}...</h1>"; 38 | 39 | # Function to close window if the error level is low enough. 40 | close() { 41 | if (($RC == 0)); then closeWindow; fi 42 | } 43 | 44 | 45 | # Compile. Bail out on errors. 46 | echo "gri -output ${DIR}/${PSFILE} ${TM_FILEPATH}"; 47 | echo "<BR>"; 48 | "${TM_GRI:-gri}" -output "${DIR}/${PSFILE}" "${TM_FILEPATH}"; 49 | RC=$? 50 | if (($RC != 0)); then exit; fi 51 | echo "${TOPDF} ${DIR}/$PSFILE ${DIR}/$PDFFILE"; 52 | echo "<BR>"; 53 | ${TOPDF} "${DIR}/$PSFILE" > "${DIR}/$PDFFILE"; 54 | 55 | # View... 56 | if [ "$V" == html ]; then 57 | if [ -s "${PDFFILE}" ]; then 58 | WEB_LOC="file://${DIR}/${PDFFILE}" 59 | if (($RC != 0)); then 60 | link "${WEB_LOC}" 'Click Here to Preview' 61 | else 62 | redirect "${WEB_LOC}" 63 | fi 64 | else 65 | strong "Error: PDF file not written to disk" 66 | fi 67 | htmlFooter 68 | else 69 | echo "HUH?<br>" 70 | open -a "$V" "${DIR}/${PDFFILE}" 71 | close 72 | fi 73 | 74 | input 75 | none 76 | inputFormat 77 | text 78 | keyEquivalent 79 | @b 80 | name 81 | Gri and View 82 | outputCaret 83 | afterOutput 84 | outputFormat 85 | html 86 | outputLocation 87 | newWindow 88 | requiredCommands 89 | 90 | 91 | command 92 | gri 93 | locations 94 | 95 | /opt/local/bin/gri 96 | /usr/local/bin/gri 97 | 98 | variable 99 | TM_GRI 100 | 101 | 102 | scope 103 | source.gri 104 | semanticClass 105 | process.build.gri 106 | uuid 107 | 41A8F343-48CB-482E-A395-34C31CE9A5AB 108 | version 109 | 2 110 | 111 | 112 | -------------------------------------------------------------------------------- /Syntaxes/Gri.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | gri 8 | 9 | firstLineMatch 10 | -[*]-( Mode:)? Gri -[*]- 11 | name 12 | Gri 13 | patterns 14 | 15 | 16 | captures 17 | 18 | 1 19 | 20 | name 21 | punctuation.definition.function.gri 22 | 23 | 2 24 | 25 | name 26 | entity.name.function.gri 27 | 28 | 3 29 | 30 | name 31 | punctuation.definition.function.gri 32 | 33 | 34 | match 35 | (\`)(.*)(') 36 | name 37 | meta.function.gri 38 | 39 | 40 | begin 41 | (^[ \t]+)?(?=#) 42 | beginCaptures 43 | 44 | 1 45 | 46 | name 47 | punctuation.whitespace.comment.leading.gri 48 | 49 | 50 | end 51 | (?!\G) 52 | patterns 53 | 54 | 55 | begin 56 | # 57 | beginCaptures 58 | 59 | 0 60 | 61 | name 62 | punctuation.definition.comment.gri 63 | 64 | 65 | end 66 | \n 67 | name 68 | comment.line.number-sign.gri 69 | patterns 70 | 71 | 72 | match 73 | (?>\\\s*\n) 74 | name 75 | punctuation.separator.continuation.gri 76 | 77 | 78 | 79 | 80 | 81 | 82 | begin 83 | (^[ \t]+)?(?=//) 84 | beginCaptures 85 | 86 | 1 87 | 88 | name 89 | punctuation.whitespace.comment.leading.gri 90 | 91 | 92 | end 93 | (?!\G) 94 | patterns 95 | 96 | 97 | begin 98 | // 99 | beginCaptures 100 | 101 | 0 102 | 103 | name 104 | punctuation.definition.comment.gri 105 | 106 | 107 | end 108 | \n 109 | name 110 | comment.line.double-slash.gri 111 | patterns 112 | 113 | 114 | match 115 | (?>\\\s*\n) 116 | name 117 | punctuation.separator.continuation.gri 118 | 119 | 120 | 121 | 122 | 123 | 124 | match 125 | \b(break|else|end|if|return|rpn|while)\b 126 | name 127 | keyword.control.gri 128 | 129 | 130 | match 131 | (\-|\+|\*|\/|%\/%|%%|\^) 132 | name 133 | keyword.operator.arithmetic.gri 134 | 135 | 136 | match 137 | (=|<-) 138 | name 139 | keyword.operator.assignment.gri 140 | 141 | 142 | match 143 | (==|!=) 144 | name 145 | keyword.operator.comparison.gri 146 | 147 | 148 | match 149 | \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b 150 | name 151 | constant.numeric.gri 152 | 153 | 154 | begin 155 | (<< *")([^"]*)(") 156 | captures 157 | 158 | 1 159 | 160 | name 161 | punctuation.definition.heredoc.gri 162 | 163 | 3 164 | 165 | name 166 | punctuation.definition.heredoc.gri 167 | 168 | 169 | end 170 | ^\2$ 171 | name 172 | string.unquoted.heredoc.doublequote.gri 173 | 174 | 175 | captures 176 | 177 | 1 178 | 179 | name 180 | punctuation.definition.variable.gri 181 | 182 | 183 | match 184 | (\\)[\.a-zA-Z0-9_][\.a-zA-Z0-9_]*\b 185 | name 186 | variable.other.synonym.gri 187 | 188 | 189 | captures 190 | 191 | 1 192 | 193 | name 194 | punctuation.definition.variable.gri 195 | 196 | 2 197 | 198 | name 199 | punctuation.definition.variable.gri 200 | 201 | 202 | match 203 | (\.)[a-zA-Z0-9_][a-zA-Z0-9_]*(\.) 204 | name 205 | variable.other.variable.gri 206 | 207 | 208 | captures 209 | 210 | 1 211 | 212 | name 213 | punctuation.definition.variable.gri 214 | 215 | 2 216 | 217 | name 218 | punctuation.definition.variable.gri 219 | 220 | 221 | match 222 | (\.\.)[a-zA-Z0-9_][a-zA-Z0-9_]*(\.\.) 223 | name 224 | variable.other.variabledot.gri 225 | 226 | 227 | begin 228 | " 229 | beginCaptures 230 | 231 | 0 232 | 233 | name 234 | punctuation.definition.string.begin.gri 235 | 236 | 237 | end 238 | " 239 | endCaptures 240 | 241 | 0 242 | 243 | name 244 | punctuation.definition.string.end.gri 245 | 246 | 247 | name 248 | string.quoted.double.gri 249 | 250 | 251 | scopeName 252 | source.gri 253 | uuid 254 | A7E000BE-6A87-4D7E-A053-469DA0DFEA02 255 | 256 | 257 | --------------------------------------------------------------------------------