diff options
author | Adam Hirst <ahirst@cedint.upm.es> | 2014-07-25 11:37:26 +0000 |
---|---|---|
committer | Adam Hirst <ahirst@cedint.upm.es> | 2014-07-25 11:37:26 +0000 |
commit | 78afd7ec55755e82dcfe4c9fc198d2fbb88a3a1e (patch) | |
tree | 7a825e76c7177af473de7cec909445a111599f87 /pygments/lexers/compiled.py | |
parent | 2f1c724903db081f1d6941d366ca95070049e94b (diff) | |
download | pygments-78afd7ec55755e82dcfe4c9fc198d2fbb88a3a1e.tar.gz |
Added missing Fortran 2003/8 keywords/intrinsics.
Modelled after https://github.com/geany/geany/commit/05dda6b001ac71d0fc8592f480e30b8a52e2def5 which I submitted to Geany earlier this year.
Source: "Modern Fortran Explained" by Metcalf
Diffstat (limited to 'pygments/lexers/compiled.py')
-rw-r--r-- | pygments/lexers/compiled.py | 81 |
1 files changed, 46 insertions, 35 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index 25c7a4d8..1d1ed6ee 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -1582,17 +1582,20 @@ class FortranLexer(RegexLexer): ], 'core': [ # Statements - (r'\b(ABSTRACT|ACCEPT|ALLOCATABLE|ALLOCATE|ARRAY|ASSIGN|ASYNCHRONOUS|' - r'BACKSPACE|BIND|BLOCK( DATA)?|BYTE|CALL|CASE|CLASS|CLOSE|COMMON|CONTAINS|' - r'CONTINUE|CYCLE|DATA|DEALLOCATE|DECODE|DEFERRED|DIMENSION|DO|' - r'ELEMENTAL|ELSE|ENCODE|END( FILE)?|ENDIF|ENTRY|ENUMERATOR|EQUIVALENCE|' - r'EXIT|EXTERNAL|EXTRINSIC|FINAL|FORALL|FORMAT|FUNCTION|GENERIC|' - r'GOTO|IF|IMPLICIT|IMPORT|INCLUDE|INQUIRE|INTENT|INTERFACE|' - r'INTRINSIC|MODULE|NAMELIST|NULLIFY|NONE|NON_INTRINSIC|' - r'NON_OVERRIDABLE|NOPASS|OPEN|OPTIONAL|OPTIONS|PARAMETER|PASS|' - r'PAUSE|POINTER|PRINT|PRIVATE|PROGRAM|PROTECTED|PUBLIC|PURE|READ|' - r'RECURSIVE|RESULT|RETURN|REWIND|SAVE|SELECT|SEQUENCE|STOP|SUBROUTINE|' - r'TARGET|THEN|TYPE|USE|VALUE|VOLATILE|WHERE|WRITE|WHILE)\s*\b', + (r'\b(ALL|ALLSTOP|ABSTRACT|ACCEPT|ALLOCATABLE|ALLOCATE|ARRAY|ASSIGN|' + r'ASYNCHRONOUS|BACKSPACE|BIND|BLOCK( DATA)?|BYTE|CALL|CASE|CLASS|CLOSE|' + r'CODIMENSION|COMMON|CONCURRRENT|CONTIGUOUS|CONTAINS|CONTINUE|CRITICAL|' + r'CYCLE|DATA|DEALLOCATE|DECODE|DEFERRED|DIMENSION|DO|ELEMENTAL|ELSE|' + r'ENCODE|END( FILE)?|ENDCRITICAL|ENDIF|ENDPROCEDURE|ENTRY|ENUM|' + r'ENUMERATOR|EQUIVALENCE|EXIT|EXTERNAL|EXTRINSIC|FINAL|FORALL|FORMAT|' + r'FUNCTION|GENERIC|GOTO|IF|IMAGES|IMPLICIT|IMPORT|IMPUREINCLUDE|' + r'INQUIRE|INTENT|INTERFACE|INTRINSIC|IS|LOCK|MEMORY|MODULE|NAMELIST|' + r'NULLIFY|NONE|NON_INTRINSIC|NON_OVERRIDABLE|NOPASS|OPEN|OPTIONAL|' + r'OPTIONS|PARAMETER|PASS|PAUSE|POINTER|PRINT|PRIVATE|PROGRAM|' + r'PROTECTED|PUBLIC|PURE|READ|RECURSIVE|RESULT|RETURN|REWIND|SAVE|' + r'SELECT|SEQUENCE|STOP|SUBMODULE|SUBROUTINE|SYNC|SYNCALL|SYNCIMAGES|' + r'SYNCMEMORY|TARGET|THEN|TYPE|UNLOCK|USE|VALUE|VOLATILE|WHERE|WRITE|' + r'WHILE)\s*\b', Keyword), # Data Types @@ -1614,37 +1617,45 @@ class FortranLexer(RegexLexer): (r'[()\[\],:&%;]', Punctuation), # Intrinsics - (r'\b(Abort|Abs|Access|AChar|ACos|AdjustL|AdjustR|AImag|AInt|Alarm|' - r'All|Allocated|ALog|AMax|AMin|AMod|And|ANInt|Any|ASin|Associated|' - r'ATan|BesJ|BesJN|BesY|BesYN|Bit_Size|BTest|CAbs|CCos|Ceiling|' + (r'\b(Abort|Abs|Access|AChar|ACos|ACosH|AdjustL|AdjustR|AImag|AInt|' + r'Alarm|All|Allocated|ALog|AMax|AMin|AMod|And|ANInt|Any|ASin|ASinH|' + r'Associated|ATan|ATanH|Atomic_Define|Atomic_Ref|BesJ|BesJN|' + r'Bessel_J0|Bessel_J1|Bessel_JN|Bessel_Y0|Bessel_Y1|Bessel_YN|' + r'BesY|BesYN|BGE|BGT|BLE|BLT|Bit_Size|BTest|CAbs|CCos|Ceiling|' r'CExp|Char|ChDir|ChMod|CLog|Cmplx|Command_Argument_Count|Complex|' r'Conjg|Cos|CosH|Count|CPU_Time|CShift|CSin|CSqRt|CTime|C_Funloc|' - r'C_Loc|C_Associated|C_Null_Ptr|C_Null_Funptr|C_F_Pointer|' - r'C_Null_Char|C_Alert|C_Backspace|C_Form_Feed|C_New_Line|' + r'C_Loc|C_Associated|C_Null_Ptr|C_Null_Funptr|C_F_Pointer| + r'C_F_ProcPointer|C_Null_Char|C_Alert|C_Backspace|C_Form_Feed|' + r'C_FunLoc|C_Loc|C_SizeofC_New_Line|' r'C_Carriage_Return|C_Horizontal_Tab|C_Vertical_Tab|' r'DAbs|DACos|DASin|DATan|Date_and_Time|DbesJ|' r'DbesJ|DbesJN|DbesY|DbesY|DbesYN|Dble|DCos|DCosH|DDiM|DErF|DErFC|' r'DExp|Digits|DiM|DInt|DLog|DLog|DMax|DMin|DMod|DNInt|Dot_Product|' - r'DProd|DSign|DSinH|DSin|DSqRt|DTanH|DTan|DTime|EOShift|Epsilon|' - r'ErF|ErFC|ETime|Exit|Exp|Exponent|Extends_Type_Of|FDate|FGet|' - r'FGetC|Float|Floor|Flush|FNum|FPutC|FPut|Fraction|FSeek|FStat|' - r'FTell|GError|GetArg|Get_Command|Get_Command_Argument|' + r'DProd|DSign|DSinH|DShiftL|DShiftR|DSin|DSqRt|DTanH|DTan|DTime| + r'EOShift|Epsilon|ErF|ErFC|ErFC_Scaled|ETime|Execute_Command_Line|' + r'Exit|Exp|Exponent|Extends_Type_Of|FDate|FGet|FGetC|' + r'FindLoc|Float|Floor|Flush|FNum|FPutC|FPut|Fraction|FSeek|FStat|' + r'FTell|Gamma|GError|GetArg|Get_Command|Get_Command_Argument|' r'Get_Environment_Variable|GetCWD|GetEnv|GetGId|GetLog|GetPId|' - r'GetUId|GMTime|HostNm|Huge|IAbs|IAChar|IAnd|IArgC|IBClr|IBits|' - r'IBSet|IChar|IDate|IDiM|IDInt|IDNInt|IEOr|IErrNo|IFix|Imag|' - r'ImagPart|Index|Int|IOr|IRand|IsaTty|IShft|IShftC|ISign|' - r'Iso_C_Binding|Is_Iostat_End|Is_Iostat_Eor|ITime|Kill|Kind|' - r'LBound|Len|Len_Trim|LGe|LGt|Link|LLe|LLt|LnBlnk|Loc|Log|' - r'Logical|Long|LShift|LStat|LTime|MatMul|Max|MaxExponent|MaxLoc|' - r'MaxVal|MClock|Merge|Move_Alloc|Min|MinExponent|MinLoc|MinVal|' - r'Mod|Modulo|MvBits|Nearest|New_Line|NInt|Not|Or|Pack|PError|' - r'Precision|Present|Product|Radix|Rand|Random_Number|Random_Seed|' - r'Range|Real|RealPart|Rename|Repeat|Reshape|RRSpacing|RShift|' - r'Same_Type_As|Scale|Scan|Second|Selected_Int_Kind|' - r'Selected_Real_Kind|Set_Exponent|Shape|Short|Sign|Signal|SinH|' - r'Sin|Sleep|Sngl|Spacing|Spread|SqRt|SRand|Stat|Sum|SymLnk|' - r'System|System_Clock|Tan|TanH|Time|Tiny|Transfer|Transpose|Trim|' - r'TtyNam|UBound|UMask|Unlink|Unpack|Verify|XOr|ZAbs|ZCos|ZExp|' + r'GetUId|GMTime|HostNm|Huge|Hypot|IAbs|IAChar|IAll|IAnd|IAny|' + r'IArgC|IBClr|IBits|IBSet|IChar|IDate|IDiM|IDInt|IDNInt|IEOr|' + r'IErrNo|IFix|Imag|ImagPart|Image_Index|Index|Int|IOr|IParity|' + r'IRand|IsaTty|IShft|IShftC|ISign|Iso_C_Binding|Is_Contiguous|' + r'Is_Iostat_End|Is_Iostat_Eor|ITime|Kill|Kind|LBound|LCoBound|' + r'Len|Len_Trim|LGe|LGt|Link|LLe|LLt|LnBlnk|Loc|Log|Log_Gamma|' + r'Logical|Long|LShift|LStat|LTime|MaskL|MaskR|MatMul|Max|' + r'MaxExponent|MaxLoc|MaxVal|MClock|Merge|Merge_Bits|Move_Alloc|' + r'Min|MinExponent|MinLoc|MinVal|Mod|Modulo|MvBits|Nearest|' + r'New_Line|NInt|Norm2|Not|Null|Num_Images|Or|Pack|Parity|PError|' + r'Precision|Present|Product|Radix|Rand|Random_Number|' + r'Random_Seed|Range|Real|RealPart|Rename|Repeat|Reshape|' + r'RRSpacing|RShift|Same_Type_As|Scale|Scan|Second|' + r'Selected_Char_Kind|Selected_Int_Kind|Selected_Real_Kind|' + r'Set_Exponent|Shape|ShiftA|ShiftL|ShiftR|Short|Sign|Signal|SinH|' + r'Sin|Sleep|Sngl|Spacing|Spread|SqRt|SRand|Stat|Storage_Size|Sum|' + r'SymLnk|System|System_Clock|Tan|TanH|Time|This_Image|Tiny|' + r'TrailZ|Transfer|Transpose|Trim|TtyNam|UBound|UCoBound|UMask|' + r'Unlink|Unpack|Verify|XOr|ZAbs|ZCos|ZExp|' r'ZLog|ZSin|ZSqRt)\s*\b', Name.Builtin), |