Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: NASTRAN input/DMAP |
| 3 | " Maintainer: Tom Kowalski <trk@schaefferas.com> |
| 4 | " Last change: April 27, 2001 |
| 5 | " Thanks to the authors and maintainers of fortran.vim. |
| 6 | " Since DMAP shares some traits with fortran, this syntax file |
| 7 | " is based on the fortran.vim syntax file. |
| 8 | "---------------------------------------------------------------------- |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 9 | " quit when a syntax file was already loaded |
| 10 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 11 | finish |
| 12 | endif |
| 13 | " DMAP is not case dependent |
| 14 | syn case ignore |
| 15 | " |
| 16 | "--------------------DMAP SYNTAX--------------------------------------- |
| 17 | " |
| 18 | " -------Executive Modules and Statements |
| 19 | " |
| 20 | syn keyword nastranDmapexecmod call dbview delete end equiv equivx exit |
| 21 | syn keyword nastranDmapexecmod file message purge purgex return subdmap |
| 22 | syn keyword nastranDmapType type |
| 23 | syn keyword nastranDmapLabel go to goto |
| 24 | syn keyword nastranDmapRepeat if else elseif endif then |
| 25 | syn keyword nastranDmapRepeat do while |
| 26 | syn region nastranDmapString start=+"+ end=+"+ oneline |
| 27 | syn region nastranDmapString start=+'+ end=+'+ oneline |
| 28 | " If you don't like initial tabs in dmap (or at all) |
| 29 | "syn match nastranDmapIniTab "^\t.*$" |
| 30 | "syn match nastranDmapTab "\t" |
| 31 | |
| 32 | " Any integer |
| 33 | syn match nastranDmapNumber "-\=\<[0-9]\+\>" |
| 34 | " floating point number, with dot, optional exponent |
| 35 | syn match nastranDmapFloat "\<[0-9]\+\.[0-9]*\([edED][-+]\=[0-9]\+\)\=\>" |
| 36 | " floating point number, starting with a dot, optional exponent |
| 37 | syn match nastranDmapFloat "\.[0-9]\+\([edED][-+]\=[0-9]\+\)\=\>" |
| 38 | " floating point number, without dot, with exponent |
| 39 | syn match nastranDmapFloat "\<[0-9]\+[edED][-+]\=[0-9]\+\>" |
| 40 | |
| 41 | syn match nastranDmapLogical "\(true\|false\)" |
| 42 | |
| 43 | syn match nastranDmapPreCondit "^#define\>" |
| 44 | syn match nastranDmapPreCondit "^#include\>" |
| 45 | " |
| 46 | " -------Comments may be contained in another line. |
| 47 | " |
| 48 | syn match nastranDmapComment "^[\$].*$" |
| 49 | syn match nastranDmapComment "\$.*$" |
| 50 | syn match nastranDmapComment "^[\$].*$" contained |
| 51 | syn match nastranDmapComment "\$.*$" contained |
| 52 | " Treat all past 72nd column as a comment. Do not work with tabs! |
| 53 | " Breaks down when 72-73rd column is in another match (eg number or keyword) |
| 54 | syn match nastranDmapComment "^.\{-72}.*$"lc=72 contained |
| 55 | |
| 56 | " |
| 57 | " -------Utility Modules |
| 58 | " |
| 59 | syn keyword nastranDmapUtilmod append copy dbc dbdict dbdir dmin drms1 |
| 60 | syn keyword nastranDmapUtilmod dtiin eltprt ifp ifp1 inputt2 inputt4 lamx |
| 61 | syn keyword nastranDmapUtilmod matgen matgpr matmod matpch matprn matprt |
| 62 | syn keyword nastranDmapUtilmod modtrl mtrxin ofp output2 output4 param |
| 63 | syn keyword nastranDmapUtilmod paraml paramr prtparam pvt scalar |
| 64 | syn keyword nastranDmapUtilmod seqp setval tabedit tabprt tabpt vec vecplot |
| 65 | syn keyword nastranDmapUtilmod xsort |
| 66 | " |
| 67 | " -------Matrix Modules |
| 68 | " |
| 69 | syn keyword nastranDmapMatmod add add5 cead dcmp decomp diagonal fbs merge |
| 70 | syn keyword nastranDmapMatmod mpyad norm read reigl smpyad solve solvit |
| 71 | syn keyword nastranDmapMatmod trnsp umerge umerge1 upartn dmiin partn |
| 72 | syn region nastranDmapMatmod start=+^ *[Dd][Mm][Ii]+ end=+[\/]+ |
| 73 | " |
| 74 | " -------Implicit Functions |
| 75 | " |
| 76 | syn keyword nastranDmapImplicit abs acos acosh andl asin asinh atan atan2 |
| 77 | syn keyword nastranDmapImplicit atanh atanh2 char clen clock cmplx concat1 |
| 78 | syn keyword nastranDmapImplicit concat2 concat3 conjg cos cosh dble diagoff |
| 79 | syn keyword nastranDmapImplicit diagon dim dlablank dlxblank dprod eqvl exp |
| 80 | syn keyword nastranDmapImplicit getdiag getsys ichar imag impl index indexstr |
| 81 | syn keyword nastranDmapImplicit int itol leq lge lgt lle llt lne log log10 |
| 82 | syn keyword nastranDmapImplicit logx ltoi mcgetsys mcputsys max min mod neqvl |
| 83 | syn keyword nastranDmapImplicit nint noop normal notl numeq numge numgt numle |
| 84 | syn keyword nastranDmapImplicit numlt numne orl pi precison putdiag putsys |
| 85 | syn keyword nastranDmapImplicit rand rdiagon real rtimtogo setcore sign sin |
| 86 | syn keyword nastranDmapImplicit sinh sngl sprod sqrt substrin tan tanh |
| 87 | syn keyword nastranDmapImplicit timetogo wlen xorl |
| 88 | " |
| 89 | " |
| 90 | "--------------------INPUT FILE SYNTAX--------------------------------------- |
| 91 | " |
| 92 | " |
| 93 | " -------Nastran Statement |
| 94 | " |
| 95 | syn keyword nastranNastranCard nastran |
| 96 | " |
| 97 | " -------The File Management Section (FMS) |
| 98 | " |
| 99 | syn region nastranFMSCard start=+^ *[Aa][Cc][Qq][Uu][Ii]+ end=+$+ oneline |
| 100 | syn region nastranFMSCard start=+^ *[Aa][Ss][Ss][Ii][Gg]+ end=+$+ oneline |
| 101 | syn region nastranFMSCard start=+^ *[Cc][oO][Nn][Nn][Ee]+ end=+$+ oneline |
| 102 | syn region nastranFMSCard start=+^ *[Dd][Bb][Cc][Ll][Ee]+ end=+$+ oneline |
| 103 | syn region nastranFMSCard start=+^ *[Dd][Bb][Dd][Ii][Cc]+ end=+$+ oneline |
| 104 | syn region nastranFMSCard start=+^ *[Dd][Bb][Dd][Ii][Rr]+ end=+$+ oneline |
| 105 | syn region nastranFMSCard start=+^ *[Dd][Bb][Ff][Ii][Xx]+ end=+$+ oneline |
| 106 | syn region nastranFMSCard start=+^ *[Dd][Bb][Ll][Oo][Aa]+ end=+$+ oneline |
| 107 | syn region nastranFMSCard start=+^ *[Dd][Bb][Ll][Oo][Cc]+ end=+$+ oneline |
| 108 | syn region nastranFMSCard start=+^ *[Dd][Bb][Ss][Ee][Tt]+ end=+$+ oneline |
| 109 | syn region nastranFMSCard start=+^ *[Dd][Bb][Uu][Nn][Ll]+ end=+$+ oneline |
| 110 | syn region nastranFMSCard start=+^ *[Dd][Bb][Uu][Pp][Dd]+ end=+$+ oneline |
| 111 | syn region nastranFMSCard start=+^ *[Dd][Ee][Ff][Ii][Nn]+ end=+$+ oneline |
| 112 | syn region nastranFMSCard start=+^ *[Ee][Nn][Dd][Jj][Oo]+ end=+$+ oneline |
| 113 | syn region nastranFMSCard start=+^ *[Ee][Xx][Pp][Aa][Nn]+ end=+$+ oneline |
| 114 | syn region nastranFMSCard start=+^ *[Ii][Nn][Cc][Ll][Uu]+ end=+$+ oneline |
| 115 | syn region nastranFMSCard start=+^ *[Ii][Nn][Ii][Tt]+ end=+$+ oneline |
| 116 | syn region nastranFMSCard start=+^ *[Pp][Rr][Oo][Jj]+ end=+$+ oneline |
| 117 | syn region nastranFMSCard start=+^ *[Rr][Ee][Ss][Tt]+ end=+$+ oneline |
| 118 | syn match nastranDmapUtilmod "^ *[Rr][Ee][Ss][Tt][Aa].*,.*," contains=nastranDmapComment |
| 119 | " |
| 120 | " -------Executive Control Section |
| 121 | " |
| 122 | syn region nastranECSCard start=+^ *[Aa][Ll][Tt][Ee][Rr]+ end=+$+ oneline |
| 123 | syn region nastranECSCard start=+^ *[Aa][Pp][Pp]+ end=+$+ oneline |
| 124 | syn region nastranECSCard start=+^ *[Cc][Oo][Mm][Pp][Ii]+ end=+$+ oneline |
| 125 | syn region nastranECSCard start=+^ *[Dd][Ii][Aa][Gg] + end=+$+ oneline |
| 126 | syn region nastranECSCard start=+^ *[Ee][Cc][Hh][Oo]+ end=+$+ oneline |
| 127 | syn region nastranECSCard start=+^ *[Ee][Nn][Dd][Aa][Ll]+ end=+$+ oneline |
| 128 | syn region nastranECSCard start=+^ *[Ii][Dd]+ end=+$+ oneline |
| 129 | syn region nastranECSCard start=+^ *[Ii][Nn][Cc][Ll][Uu]+ end=+$+ oneline |
| 130 | syn region nastranECSCard start=+^ *[Ll][Ii][Nn][Kk]+ end=+$+ oneline |
| 131 | syn region nastranECSCard start=+^ *[Mm][Aa][Ll][Tt][Ee]+ end=+$+ oneline |
| 132 | syn region nastranECSCard start=+^ *[Ss][Oo][Ll] + end=+$+ oneline |
| 133 | syn region nastranECSCard start=+^ *[Tt][Ii][Mm][Ee]+ end=+$+ oneline |
| 134 | " |
| 135 | " -------Delimiters |
| 136 | " |
| 137 | syn match nastranDelimiter "[Cc][Ee][Nn][Dd]" contained |
| 138 | syn match nastranDelimiter "[Bb][Ee][Gg][Ii][Nn]" contained |
| 139 | syn match nastranDelimiter " *[Bb][Uu][Ll][Kk]" contained |
| 140 | syn match nastranDelimiter "[Ee][Nn][Dd] *[dD][Aa][Tt][Aa]" contained |
| 141 | " |
| 142 | " -------Case Control section |
| 143 | " |
| 144 | syn region nastranCC start=+^ *[Cc][Ee][Nn][Dd]+ end=+^ *[Bb][Ee][Gg][Ii][Nn]+ contains=nastranDelimiter,nastranBulkData,nastranDmapComment |
| 145 | |
| 146 | " |
| 147 | " -------Bulk Data section |
| 148 | " |
| 149 | syn region nastranBulkData start=+ *[Bb][Uu][Ll][Kk] *$+ end=+^ [Ee][Nn][Dd] *[Dd]+ contains=nastranDelimiter,nastranDmapComment |
| 150 | " |
| 151 | " -------The following cards may appear in multiple sections of the file |
| 152 | " |
| 153 | syn keyword nastranUtilCard ECHOON ECHOOFF INCLUDE PARAM |
| 154 | |
| 155 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 156 | " The default methods for highlighting. Can be overridden later |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 157 | hi def link nastranDmapexecmod Statement |
| 158 | hi def link nastranDmapType Type |
| 159 | hi def link nastranDmapPreCondit Error |
| 160 | hi def link nastranDmapUtilmod PreProc |
| 161 | hi def link nastranDmapMatmod nastranDmapUtilmod |
| 162 | hi def link nastranDmapString String |
| 163 | hi def link nastranDmapNumber Constant |
| 164 | hi def link nastranDmapFloat nastranDmapNumber |
| 165 | hi def link nastranDmapInitTab nastranDmapNumber |
| 166 | hi def link nastranDmapTab nastranDmapNumber |
| 167 | hi def link nastranDmapLogical nastranDmapExecmod |
| 168 | hi def link nastranDmapImplicit Identifier |
| 169 | hi def link nastranDmapComment Comment |
| 170 | hi def link nastranDmapRepeat nastranDmapexecmod |
| 171 | hi def link nastranNastranCard nastranDmapPreCondit |
| 172 | hi def link nastranECSCard nastranDmapUtilmod |
| 173 | hi def link nastranFMSCard nastranNastranCard |
| 174 | hi def link nastranCC nastranDmapexecmod |
| 175 | hi def link nastranDelimiter Special |
| 176 | hi def link nastranBulkData nastranDmapType |
| 177 | hi def link nastranUtilCard nastranDmapexecmod |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 178 | |
| 179 | let b:current_syntax = "nastran" |
| 180 | |
| 181 | "EOF vim: ts=8 noet tw=120 sw=8 sts=0 |