Changeset 11788 for utils/developer/fortran.py
- Timestamp:
- 2019-10-24T15:06:36+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/developer/fortran.py
r11781 r11788 39 39 40 40 tokens = { 41 41 42 'root': [ 42 43 include('cmt' ), 43 44 include('nlst'), 44 45 include('str' ), 46 include('num' ), 45 47 include('bool'), 46 48 include('opr' ), … … 48 50 include('core'), 49 51 (r'[a-z][\w$]*', Name), 50 include('num'),51 52 (r'[\s]+', Text), 52 53 ], 54 53 55 'cmt': [ 54 56 (r'^#.*\n', Comment.Preproc), 55 (r'!.*\n', Comment), 56 ], 57 (r'!.*\n' , Comment ), 58 ], 59 57 60 'core': [ 58 61 # Statements … … 75 78 'STOP', 'SUBMODULE', 'SUBROUTINE', 'SYNC', 'SYNCALL', 'SYNCIMAGES', 76 79 'SYNCMEMORY', 'TARGET', 'THEN', 'TYPE', 'UNLOCK', 'USE', 'VALUE', 77 'VOLATILE', 'WHERE', 'WRITE', 'WHILE' ), prefix=r'\b', suffix=r'\s*\b'),78 Keyword),80 'VOLATILE', 'WHERE', 'WRITE', 'WHILE' 81 ), prefix=r'\b', suffix=r'\s*\b'), Keyword), 79 82 80 83 # Data Types … … 87 90 'C_INT_FAST64_T', 'C_INTMAX_T', 'C_INTPTR_T', 'C_FLOAT', 'C_DOUBLE', 88 91 'C_LONG_DOUBLE', 'C_FLOAT_COMPLEX', 'C_DOUBLE_COMPLEX', 89 'C_LONG_DOUBLE_COMPLEX', 'C_BOOL', 'C_CHAR', 'C_PTR', 'C_FUNPTR'), 90 prefix=r'\b', suffix=r'\s*\b'), 91 Keyword.Type), 92 'C_LONG_DOUBLE_COMPLEX', 'C_BOOL', 'C_CHAR', 'C_PTR', 'C_FUNPTR' 93 ), prefix=r'\b', suffix=r'\s*\b'), Keyword.Type), 92 94 93 95 # … … 145 147 'Transpose', 'Trim', 'TtyNam', 'UBound', 'UCoBound', 'UMask', 146 148 'Unlink', 'Unpack', 'Verify', 'XOr', 'ZAbs', 'ZCos', 'ZExp', 147 'ZLog', 'ZSin', 'ZSqRt'), prefix=r'\b', suffix=r'\s*\b'), 148 Name.Builtin), 149 ], 149 'ZLog', 'ZSin', 'ZSqRt' 150 ), prefix=r'\b', suffix=r'\s*\b'), Name.Builtin), 151 ], 152 150 153 'bool': [ 151 154 # Booleans 152 155 (r'\.(true|false)\.', Keyword.Constant), 153 156 ], 157 154 158 'opr': [ 155 159 # Operators … … 159 163 (r'\.(eq|ne|lt|le|gt|ge|not|and|or|eqv|neqv)\.', Operator.Word), 160 164 ], 165 161 166 'punc': [ 162 167 # Punctuation … … 164 169 (r'&(?=\s)' , Punctuation), 165 170 ], 171 166 172 'nlst': [ 167 173 (r'^&[a-z]\w*', Name.Namespace), 168 # include('cmt'), 169 (r'^(\s*)([a-z]\w*)(\()?(\s*)?(\d*)?(\s*)?(\))?(%[a-z]\w*)?(\s*)(=)', 170 bygroups(Text, Name.Variable, 171 Punctuation , Text, Number.Integer, Text, Punctuation, 172 Name.Variable, 173 Text, Operator )), 174 (r'([+-])', Operator), 174 (r'([a-z]\w*)(\()?(\s*)?(\d*)?(\s*)?(\))?(%[a-z]\w*)?(\s*)(=)', bygroups( 175 Name.Variable, 176 Punctuation , Text , Number.Integer, Text, Punctuation, 177 Name.Variable, 178 Text , Operator 179 )), 175 180 (r'^\/$', Name.Namespace), 176 181 ], 182 177 183 'str': [ 178 184 (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), 179 185 (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), 180 186 ], 187 181 188 'num': [ 182 (r'\d+(?![.e])(_[a-z]\w+)?' , Number.Integer),183 (r'[+-]?\d*\.\d+([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float ),184 (r'[+-]?\d+\.\d*([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float ),185 (r'[+-]?\d+(\.\d*)?[ed][-+]?\d+(_[a-z]\w+)?', Number.Float ),189 (r'\d+(?![.e])(_[a-z]\w+)?' , Number.Integer), 190 (r'[+-]?\d*\.\d+([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float ), 191 (r'[+-]?\d+\.\d*([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float ), 192 (r'[+-]?\d+(\.\d*)?[ed][-+]?\d+(_[a-z]\w+)?', Number.Float ), 186 193 ], 187 194 }
Note: See TracChangeset
for help on using the changeset viewer.