]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/fortran.js
1 /*! `fortran` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Author: Anthony Scemama <scemama@irsamc.ups-tlse.fr>
8 Website: https://en.wikipedia.org/wiki/Fortran
12 /** @type LanguageFn */
13 function fortran(hljs
) {
14 const regex
= hljs
.regex
;
21 const COMMENT
= { variants: [
22 hljs
.COMMENT('!', '$', { relevance: 0 }),
23 // allow FORTRAN 77 style comments
24 hljs
.COMMENT('^C[ ]', '$', { relevance: 0 }),
25 hljs
.COMMENT('^C$', '$', { relevance: 0 })
28 // regex in both fortran and irpf90 should match
29 const OPTIONAL_NUMBER_SUFFIX
= /(_[a-z_\d]+)?/;
30 const OPTIONAL_NUMBER_EXP
= /([de][+-]?\d+)?/;
34 { begin: regex
.concat(/\b\d+/, /\.(\d*)/, OPTIONAL_NUMBER_EXP
, OPTIONAL_NUMBER_SUFFIX
) },
35 { begin: regex
.concat(/\b\d+/, OPTIONAL_NUMBER_EXP
, OPTIONAL_NUMBER_SUFFIX
) },
36 { begin: regex
.concat(/\.\d+/, OPTIONAL_NUMBER_EXP
, OPTIONAL_NUMBER_SUFFIX
) }
41 const FUNCTION_DEF
= {
42 className: 'function',
43 beginKeywords: 'subroutine function program',
46 hljs
.UNDERSCORE_TITLE_MODE
,
55 hljs
.APOS_STRING_MODE
,
56 hljs
.QUOTE_STRING_MODE
189 "c_long_double_complex",
206 "character_storage_size",
212 "numeric_storage_size",
216 "ieee_support_underflow_control",
217 "ieee_get_underflow_mode",
218 "ieee_set_underflow_mode",
458 "selected_real_kind",
479 "command_argument_count",
481 "get_command_argument",
482 "get_environment_variable",
485 "ieee_support_underflow_control",
486 "ieee_get_underflow_mode",
487 "ieee_set_underflow_mode",
491 "selected_char_kind",
512 "execute_command_line",
551 case_insensitive: true,
557 $pattern: /\b[a-z][a-z0-9_]+\b|\.[a-z][a-z0-9_]+\./,
566 // allow `C = value` for assignments so they aren't misdetected
567 // as Fortran 77 style comments
569 begin: /^C\s*=(?!=)/,
582 export default hljsGrammar
;